void big_switch() {
  for (int i = 0; i < 32; ++i) {
    switch (1 << i) {
    case (1 << 0):
      if (i) {
      }
    case (1 << 1):
      if (i) {
      }
      break;
    case (1 << 2)...(1 << 12):
      if (i) {
      }
      break;
    case (1 << 13):
      if (i) {
      }
      break;
    case (1 << 14)...(1 << 28):
      if (i) {
      }
      break;
    case (1 << 29)...((1 << 29) + 1):
      if (i) {
      }
      break;
    default:
      if (i) {
      }
      break;
    }
  }
}


x86 assembly (clang, -O0):
<big_switch>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1237 <big_switch+0x137>
mov    -0x4(%rbp),%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     116a <big_switch+0x6a>
jmp    1130 <big_switch+0x30>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     117e <big_switch+0x7e>
jmp    1141 <big_switch+0x41>
mov    -0x8(%rbp),%eax
sub    $0x2000,%eax
je     11bc <big_switch+0xbc>
jmp    1154 <big_switch+0x54>
mov    -0x8(%rbp),%eax
add    $0xe0000000,%eax
sub    $0x2,%eax
jb     11fc <big_switch+0xfc>
jmp    11e4 <big_switch+0xe4>
cmpl   $0x0,-0x4(%rbp)
je     1179 <big_switch+0x79>
jmp    1179 <big_switch+0x79>
jmp    117e <big_switch+0x7e>
cmpl   $0x0,-0x4(%rbp)
je     118d <big_switch+0x8d>
jmp    118d <big_switch+0x8d>
jmp    1224 <big_switch+0x124>
cmpl   $0x0,-0x4(%rbp)
je     11a1 <big_switch+0xa1>
jmp    11a1 <big_switch+0xa1>
jmp    1224 <big_switch+0x124>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
cmp    $0xffc,%eax
jbe    1192 <big_switch+0x92>
jmp    1210 <big_switch+0x110>
cmpl   $0x0,-0x4(%rbp)
je     11cb <big_switch+0xcb>
jmp    11cb <big_switch+0xcb>
jmp    1224 <big_switch+0x124>
cmpl   $0x0,-0x4(%rbp)
je     11df <big_switch+0xdf>
jmp    11df <big_switch+0xdf>
jmp    1224 <big_switch+0x124>
mov    -0x8(%rbp),%eax
sub    $0x4000,%eax
cmp    $0xfffc000,%eax
jbe    11d0 <big_switch+0xd0>
jmp    11a6 <big_switch+0xa6>
cmpl   $0x0,-0x4(%rbp)
je     120b <big_switch+0x10b>
jmp    120b <big_switch+0x10b>
jmp    1224 <big_switch+0x124>
cmpl   $0x0,-0x4(%rbp)
je     121f <big_switch+0x11f>
jmp    121f <big_switch+0x11f>
jmp    1224 <big_switch+0x124>
jmp    1229 <big_switch+0x129>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <big_switch+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_switch>:
ret

LLVM IR (-O0):
define void @big_switch() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %50, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %53
5: ; preds = %2
%6 = load i32, i32* %1
%7 = shl i32 1, %6
switch i32 %7, label %36 [
i32 1, label %8
i32 2, label %13
i32 8192, label %26
i32 536870912, label %39
i32 536870913, label %39
]
8: ; preds = %5
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8
br label %13
13: ; preds = %5, %12
%14 = load i32, i32* %1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
br label %17
17: ; preds = %16, %13
br label %49
18: ; preds = %23
%19 = load i32, i32* %1
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
br label %22
22: ; preds = %21, %18
br label %49
23: ; preds = %36
%24 = sub i32 %7, 4
%25 = icmp ule i32 %24, 4092
br i1 %25, label %18, label %44
26: ; preds = %5
%27 = load i32, i32* %1
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %26
br label %30
30: ; preds = %29, %26
br label %49
31: ; preds = %36
%32 = load i32, i32* %1
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %31
br label %35
35: ; preds = %34, %31
br label %49
36: ; preds = %5
%37 = sub i32 %7, 16384
%38 = icmp ule i32 %37, 268419072
br i1 %38, label %31, label %23
39: ; preds = %5, %5
%40 = load i32, i32* %1
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %39
br label %43
43: ; preds = %42, %39
br label %49
44: ; preds = %23
%45 = load i32, i32* %1
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %44
br label %48
48: ; preds = %47, %44
br label %49
49: ; preds = %48, %43, %35, %30, %22, %17
br label %50
50: ; preds = %49
%51 = load i32, i32* %1
%52 = add nsw i32 %51, 1
store i32 %52, i32* %1
br label %2
53: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @big_switch() {
ret void
}