<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/71629>71629</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            More exploded graph nodes with fewer if branches
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Joshua1023
      </td>
    </tr>
</table>

<pre>
    The problem was found when I used alpha.deadcode.UnreachableCode to check `test.c`:
```
clang --analyze --analyzer-no-default-checks  test.c -Xanalyzer -analyzer-config -Xanalyzer experimental-enable-naive-ctu-analysis=true  -Xanalyzer -analyzer-checker=alpha.deadcode.UnreachableCode
```
It reported:
```
test.c:90:38: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
   90 |           tmp_g && tmp_4 && tmp_5 && tmp_6 && tmp_8 && tmp_a && tmp_b && tmp_c &&
      | ^~~~~
test.c:94:54: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
   94 |                  tmp_3 && tmp_g && tmp_4 && tmp_5 && tmp_6 && tmp_8 && tmp_a &&
      | ^~~~~
test.c:123:15: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  123 | res = 10U;
      |               ^~~
test.c:187:18: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  187 | tmp_9 && tmp_a && tmp_b && tmp_c && tmp_d && tmp_e && tmp_f) {
      |                  ^~~~~
test.c:192:18: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  192 | tmp_9 && tmp_a && tmp_h && tmp_i && tmp_e && tmp_f) {
      | ^~~~~
test.c:206:61: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  206 |                  tmp_7 && tmp_8 && tmp_9 && condition_14 && tmp_h &&
      | 
6 warnings generated.
```

However, after I commented out the last `else if` branch (`test-remove-one-else-if.c`), the first two warnings disappeared:
```
test.c:123:15: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  123 |         res = 10U;
 |               ^~~
test.c:187:18: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  187 |                  tmp_9 && tmp_a && tmp_b && tmp_c && tmp_d && tmp_e && tmp_f) {
      | ^~~~~
test.c:192:18: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  192 |                  tmp_9 && tmp_a && tmp_h && tmp_i && tmp_e && tmp_f) {
      | ^~~~~
test.c:206:61: warning: This statement is never executed [alpha.deadcode.UnreachableCode]
  206 |                  tmp_7 && tmp_8 && tmp_9 && condition_14 && tmp_h &&
      | ^~~~~
4 warnings generated.
```

Since the `UnreachableCode` checker depends on the exploded graph, I modified the implementation to get the number of nodes in the exploded graph. It is wired that removing one `else if` branch leads to more nodes in the exploded graph.  The exploded graph of `test.c` has `229535` nodes while the exploded graph of `est-remove-one-else-if.c` has `229598` nodes. 

clang version: 17.0.2 (https://github.com/llvm/llvm-project/releases/tag/llvmorg-17.0.2)

`test.c` and `test-remove-one-else-if.c` are in [examples.zip](https://github.com/llvm/llvm-project/files/13291735/examples.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV01v4zYU_DX05UGCROrDOvjgrGs0BXrqLtDbghafJLYSKZCUnd1DfntB2kkUx_kqmm0PFQJFT6KHMyNyKHJrZasQVyS_IvlmwSfXabP6Rdtu4mlC2WKnxbfV5w5hNHrX4wAHbqHRkxJw6FDBNUwWBfB-7HgskItaC4y_KIO87viux09aIDgNdYf1n0CKxKF1cU2KhLA1STYkWfvr418o656rFqKIK95_-44PVyZSOhLY8Kl3UcCzAEc4iH6_awQPzWutGtnOn-HNiEYOqBzvI1SeYKS43GNUu-n4QystYRtnJoRnUH3PaAjbvKz6orhrBwZHbRyK5_SfDGLrylvEloSt4cCNkqr1l587acE67tDLAGlB4T5Iw3pyKIDkV68QyzfHngCgSoCUn-DhcMP4tQVCC0KLUGTzIp8XxbxYzgs-L3bzoj4V9wQAAgGS_3R7e3t77kBG2DrPPtaB7MyBm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