int main(int argc, char *argv[]) {
  int x = 1;
  switch (argc) {
  case 2:
    x = 2;
    do {
      x = 3;
    } while (argc > 0);
  four:
    x = 4;
    break;
  case 5:
    do {
      x = 5;
      if (argc-- > 1) {
        x = 6;
        if (argc-- > 2)
          goto four;
      } else {
        x = 7;
        if (argc == 12)
          goto twelve;
      }
      x = 8;
    } while (argc > 0);
    break;
  case 9:
    x = 9;
    if (argc == 10)
      x = 10;
    else
      x = 11;
  twelve:
    x = 12;
    break;
  }
  x = 13;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2,%eax
je     114f <main+0x4f>
jmp    112d <main+0x2d>
mov    -0x18(%rbp),%eax
sub    $0x5,%eax
je     1178 <main+0x78>
jmp    113e <main+0x3e>
mov    -0x18(%rbp),%eax
sub    $0x9,%eax
je     11ee <main+0xee>
jmp    121e <main+0x11e>
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1156 <main+0x56>
jmp    116c <main+0x6c>
movl   $0x4,-0x14(%rbp)
jmp    121e <main+0x11e>
jmp    117d <main+0x7d>
movl   $0x5,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jle    11bd <main+0xbd>
movl   $0x6,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x2,%eax
jle    11b8 <main+0xb8>
jmp    116c <main+0x6c>
jmp    11d8 <main+0xd8>
movl   $0x7,-0x14(%rbp)
cmpl   $0xc,-0x8(%rbp)
jne    11d3 <main+0xd3>
jmp    1217 <main+0x117>
jmp    11d8 <main+0xd8>
movl   $0x8,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     117d <main+0x7d>
jmp    121e <main+0x11e>
movl   $0x9,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    120b <main+0x10b>
movl   $0xa,-0x14(%rbp)
jmp    1212 <main+0x112>
movl   $0xb,-0x14(%rbp)
jmp    1217 <main+0x117>
movl   $0xc,-0x14(%rbp)
movl   $0xd,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1112 <main+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <main+0x10>
mov    $0xd,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %43 [
i32 2, label %8
i32 5, label %15
i32 9, label %36
]
8: ; preds = %2
store i32 2, i32* %6
br label %9
9: ; preds = %10, %8
store i32 3, i32* %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %10
br label %14
14: ; preds = %24, %13
store i32 4, i32* %6
br label %43
15: ; preds = %2
br label %16
16: ; preds = %32, %15
store i32 5, i32* %6
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = icmp sgt i32 %17, 1
br i1 %19, label %20, label %26
20: ; preds = %16
store i32 6, i32* %6
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
%23 = icmp sgt i32 %21, 2
br i1 %23, label %24, label %25
24: ; preds = %20
br label %14
25: ; preds = %20
br label %31
26: ; preds = %16
store i32 7, i32* %6
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 12
br i1 %28, label %29, label %30
29: ; preds = %26
br label %42
30: ; preds = %26
br label %31
31: ; preds = %30, %25
store i32 8, i32* %6
br label %32
32: ; preds = %31
%33 = load i32, i32* %4
%34 = icmp sgt i32 %33, 0
br i1 %34, label %16, label %35
35: ; preds = %32
br label %43
36: ; preds = %2
store i32 9, i32* %6
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 10, i32* %6
br label %41
40: ; preds = %36
store i32 11, i32* %6
br label %41
41: ; preds = %40, %39
br label %42
42: ; preds = %41, %29
store i32 12, i32* %6
br label %43
43: ; preds = %2, %42, %35, %14
store i32 13, i32* %6
%44 = load i32, i32* %6
ret i32 %44
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
ret i32 13
}