void testSwitchCond(int arg) {
  if (arg > 10) {
    switch (arg) {
    case 0x80000000 ... 10:
      clang_analyzer_warnIfReached();
      break;
    case 11 ... 20:
      clang_analyzer_warnIfReached();
      break;
    default:
      clang_analyzer_warnIfReached();
    }
    switch (arg) {
    case 0x80000000 ... 9:
      clang_analyzer_warnIfReached();
      break;
    case 10 ... 20:
      clang_analyzer_warnIfReached();
      clang_analyzer_eval(arg > 10);
      break;
    default:
      clang_analyzer_warnIfReached();
    }
  }
}


x86 assembly (clang, -O0):
<testSwitchCond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    11e9 <testSwitchCond+0xc9>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xfffffff5,%eax
sub    $0xa,%eax
jb     1170 <testSwitchCond+0x50>
jmp    1158 <testSwitchCond+0x38>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
jmp    1183 <testSwitchCond+0x63>
mov    -0x8(%rbp),%eax
sub    $0x80000000,%eax
cmp    $0x8000000a,%eax
jbe    114c <testSwitchCond+0x2c>
jmp    117c <testSwitchCond+0x5c>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
jmp    1183 <testSwitchCond+0x63>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff6,%eax
sub    $0xb,%eax
jb     11be <testSwitchCond+0x9e>
jmp    11a6 <testSwitchCond+0x86>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
jmp    11e4 <testSwitchCond+0xc4>
mov    -0xc(%rbp),%eax
sub    $0x80000000,%eax
cmp    $0x80000009,%eax
jbe    119a <testSwitchCond+0x7a>
jmp    11dd <testSwitchCond+0xbd>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
cmpl   $0xa,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
jmp    11e4 <testSwitchCond+0xc4>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
jmp    11e9 <testSwitchCond+0xc9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSwitchCond>:
cmp    $0xb,%edi
jl     114b <testSwitchCond+0x2b>
push   %rbx
mov    %edi,%ebx
add    $0xfffffff5,%ebx
xor    %eax,%eax
call   1040 <clang_analyzer_warnIfReached@plt>
xor    %eax,%eax
call   1040 <clang_analyzer_warnIfReached@plt>
cmp    $0x9,%ebx
pop    %rbx
ja     114b <testSwitchCond+0x2b>
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <clang_analyzer_eval@plt>
ret

LLVM IR (-O0):
define void @testSwitchCond(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
br i1 %4, label %5, label %32
5: ; preds = %1
%6 = load i32, i32* %2
switch i32 %6, label %9 [
i32 11, label %12
i32 12, label %12
i32 13, label %12
i32 14, label %12
i32 15, label %12
i32 16, label %12
i32 17, label %12
i32 18, label %12
i32 19, label %12
i32 20, label %12
]
7: ; preds = %9
%8 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
9: ; preds = %5
%10 = sub i32 %6, -2147483648
%11 = icmp ule i32 %10, -2147483638
br i1 %11, label %7, label %14
12: ; preds = %5, %5, %5, %5, %5, %5, %5, %5, %5, %5
%13 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
14: ; preds = %9
%15 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
16: ; preds = %14, %12, %7
%17 = load i32, i32* %2
switch i32 %17, label %20 [
i32 10, label %23
i32 11, label %23
i32 12, label %23
i32 13, label %23
i32 14, label %23
i32 15, label %23
i32 16, label %23
i32 17, label %23
i32 18, label %23
i32 19, label %23
i32 20, label %23
]
18: ; preds = %20
%19 = call i32 (...) @clang_analyzer_warnIfReached()
br label %31
20: ; preds = %16
%21 = sub i32 %17, -2147483648
%22 = icmp ule i32 %21, -2147483639
br i1 %22, label %18, label %29
23: ; preds = %16, %16, %16, %16, %16, %16, %16, %16, %16, %16, %16
%24 = call i32 (...) @clang_analyzer_warnIfReached()
%25 = load i32, i32* %2
%26 = icmp sgt i32 %25, 10
%27 = zext i1 %26 to i32
%28 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %27)
br label %31
29: ; preds = %20
%30 = call i32 (...) @clang_analyzer_warnIfReached()
br label %31
31: ; preds = %29, %23, %18
br label %32
32: ; preds = %31, %1
ret void
}

LLVM IR (-O2):
define void @testSwitchCond(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = add nsw i32 %0, -11
%5 = icmp ult i32 %4, 10
%6 = tail call i32 (...) @clang_analyzer_warnIfReached()
%7 = tail call i32 (...) @clang_analyzer_warnIfReached()
br i1 %5, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
br label %10
10: ; preds = %3, %8, %1
ret void
}