#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 *argv[]) {
  switch (argc) {
  case 1:
    printf("1 args\n");
    break;
  case 2:
    printf("2 args\n");
    break;
  case 3:
    printf("3 args\n");
    break;
  case 10:
    printf("10 args\n");
    break;
  case 47:
    printf("47 args\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x2e,%eax
ja     119f <main+0x8f>
mov    -0x18(%rbp),%rax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf66(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x8f>
lea    0xf5d(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x8f>
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x8f>
lea    0xf4b(%rip),%rdi
call   1030 <printf@plt>
jmp    119f <main+0x8f>
lea    0xf43(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
add    $0xffffffff,%eax
cmp    $0x2e,%eax
ja     1159 <main+0x49>
lea    0xfb8(%rip),%rdi
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf9a(%rip),%rdi
jmp    1154 <main+0x44>
lea    0xf8a(%rip),%rdi
jmp    1154 <main+0x44>
lea    0xf79(%rip),%rdi
jmp    1154 <main+0x44>
lea    0xf68(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1 args\0A\00"
@.str.1 = [8 x i8] c"2 args\0A\00"
@.str.2 = [8 x i8] c"3 args\0A\00"
@.str.3 = [9 x i8] c"10 args\0A\00"
@.str.4 = [9 x i8] c"47 args\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 10, label %13
i32 47, label %15
]
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %17
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %17
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %17
17: ; preds = %2, %15, %13, %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"47 args\00"
@str.5 = [8 x i8] c"10 args\00"
@str.6 = [7 x i8] c"3 args\00"
@str.7 = [7 x i8] c"2 args\00"
@str.8 = [7 x i8] c"1 args\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
switch i32 %0, label %10 [
i32 1, label %7
i32 2, label %3
i32 3, label %4
i32 10, label %5
i32 47, label %6
]
3: ; preds = %2
br label %7
4: ; preds = %2
br label %7
5: ; preds = %2
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %3, %4, %5, %6
%8 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.7, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0), %2 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %7, %2
ret i32 0
}