#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc) {
  char *num;
  printf("argc:%d\n", argc);
  switch (argc - 1) {
    if (0) {
    case 0:
      num = "zero";
    }
    if (0) {
    case 2:
      num = "two";
    }
    if (0) {
    case 3:
      num = "three";
    }
    if (0) {
    case 4:
      num = "four";
    }
    if (0) {
    case 5:
      num = "five";
    }
    if (0) {
    default:
      num = "many";
    }
    printf("Called with %s arguments.\n", num);
    break;
  case 1:
    printf("Called with one argument.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     11f7 <main+0xe7>
mov    -0x18(%rbp),%rax
lea    0xead(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1176 <main+0x66>
jmp    1186 <main+0x76>
jmp    117b <main+0x6b>
lea    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1195 <main+0x85>
jmp    11a5 <main+0x95>
jmp    119a <main+0x8a>
lea    0xe89(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    11b4 <main+0xa4>
jmp    11c4 <main+0xb4>
jmp    11b9 <main+0xa9>
lea    0xe70(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    11d3 <main+0xc3>
jmp    11e3 <main+0xd3>
jmp    11d8 <main+0xc8>
lea    0xe56(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    11f2 <main+0xe2>
jmp    1202 <main+0xf2>
jmp    11f7 <main+0xe7>
lea    0xe3c(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1227 <main+0x117>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xeee(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x5,%ebx
ja     1160 <main+0x40>
lea    0xedf(%rip),%rsi
lea    0xeb7(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
jmp    1199 <main+0x79>
lea    0xed3(%rip),%rsi
jmp    118b <main+0x6b>
lea    0xeb6(%rip),%rsi
jmp    118b <main+0x6b>
lea    0xeb1(%rip),%rsi
jmp    118b <main+0x6b>
lea    0xeae(%rip),%rsi
jmp    118b <main+0x6b>
lea    0xeaa(%rip),%rsi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"argc:%d\0A\00"
@.str.1 = [5 x i8] c"zero\00"
@.str.2 = [4 x i8] c"two\00"
@.str.3 = [6 x i8] c"three\00"
@.str.4 = [5 x i8] c"four\00"
@.str.5 = [5 x i8] c"five\00"
@.str.6 = [5 x i8] c"many\00"
@.str.7 = [27 x i8] c"Called with %s arguments.\0A\00"
@.str.8 = [27 x i8] c"Called with one argument.\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %2
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
switch i32 %8, label %26 [
i32 0, label %11
i32 2, label %14
i32 3, label %17
i32 4, label %20
i32 5, label %23
i32 1, label %30
]
9: ; No predecessors!
br i1 false, label %10, label %12
10: ; preds = %9
br label %11
11: ; preds = %1, %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %12
12: ; preds = %11, %9
br i1 false, label %13, label %15
13: ; preds = %12
br label %14
14: ; preds = %1, %13
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %4
br label %15
15: ; preds = %14, %12
br i1 false, label %16, label %18
16: ; preds = %15
br label %17
17: ; preds = %1, %16
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %4
br label %18
18: ; preds = %17, %15
br i1 false, label %19, label %21
19: ; preds = %18
br label %20
20: ; preds = %1, %19
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %4
br label %21
21: ; preds = %20, %18
br i1 false, label %22, label %24
22: ; preds = %21
br label %23
23: ; preds = %1, %22
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %4
br label %24
24: ; preds = %23, %21
br i1 false, label %25, label %27
25: ; preds = %24
br label %26
26: ; preds = %1, %25
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %4
br label %27
27: ; preds = %26, %24
%28 = load i8*, i8** %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %28)
br label %32
30: ; preds = %1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"argc:%d\0A\00"
@.str.1 = [5 x i8] c"zero\00"
@.str.2 = [4 x i8] c"two\00"
@.str.3 = [6 x i8] c"three\00"
@.str.4 = [5 x i8] c"four\00"
@.str.5 = [5 x i8] c"five\00"
@.str.6 = [5 x i8] c"many\00"
@.str.7 = [27 x i8] c"Called with %s arguments.\0A\00"
@str = [26 x i8] c"Called with one argument.\00"
define i32 @main(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
switch i32 %0, label %7 [
i32 1, label %8
i32 3, label %3
i32 4, label %4
i32 5, label %5
i32 6, label %6
i32 2, label %11
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %6, %4, %3, %5, %7
%9 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %1 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %9)
br label %13
11: ; preds = %1
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret i32 0
}