#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 atoi(char *);
int /*<<< orphan*/ fork0();
int /*<<< orphan*/ fork1();
int /*<<< orphan*/ fork10();
int /*<<< orphan*/ fork11();
int /*<<< orphan*/ fork12();
int /*<<< orphan*/ fork13();
int /*<<< orphan*/ fork14();
int /*<<< orphan*/ fork15();
int /*<<< orphan*/ fork16();
int /*<<< orphan*/ fork17();
int /*<<< orphan*/ fork2();
int /*<<< orphan*/ fork3();
int /*<<< orphan*/ fork4();
int /*<<< orphan*/ fork5();
int /*<<< orphan*/ fork6();
int /*<<< orphan*/ fork7();
int /*<<< orphan*/ fork8();
int /*<<< orphan*/ fork9();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int option = 0;
  if (argc > 1)
    option = atoi(argv[1]);
  switch (option) {
  case 0:
    fork0();
    break;
  case 1:
    fork1();
    break;
  case 2:
    fork2();
    break;
  case 3:
    fork3();
    break;
  case 4:
    fork4();
    break;
  case 5:
    fork5();
    break;
  case 6:
    fork6();
    break;
  case 7:
    fork7();
    break;
  case 8:
    fork8();
    break;
  case 9:
    fork9();
    break;
  case 10:
    fork10();
    break;
  case 11:
    fork11();
    break;
  case 12:
    fork12();
    break;
  case 13:
    fork13();
    break;
  case 14:
    fork14();
    break;
  case 15:
    fork15();
    break;
  case 16:
    fork16();
    break;
  case 17:
    fork17();
    break;
  default:
    printf("Unknown option %d\n", option);
    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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1277 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1140 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x11,%rax
ja     1374 <main+0x134>
mov    -0x20(%rbp),%rax
lea    0xd6d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <fork0@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1100 <fork1@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1060 <fork2@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10f0 <fork3@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1040 <fork4@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1110 <fork5@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1050 <fork6@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10e0 <fork7@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1030 <fork8@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10d0 <fork9@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1130 <fork10@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1090 <fork11@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10b0 <fork12@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1150 <fork13@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1120 <fork14@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1080 <fork15@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   10c0 <fork16@plt>
jmp    1383 <main+0x143>
mov    $0x0,%al
call   1160 <fork17@plt>
jmp    1383 <main+0x143>
mov    -0x14(%rbp),%esi
lea    0xcca(%rip),%rdi
call   10a0 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1266 <main+0x26>
mov    0x8(%rsi),%rdi
call   1140 <atoi@plt>
cmp    $0x11,%eax
ja     1271 <main+0x31>
mov    %eax,%eax
lea    0xda3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <fork0@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xdd0(%rip),%rdi
mov    %eax,%esi
call   10a0 <printf@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1100 <fork1@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1060 <fork2@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   10f0 <fork3@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1040 <fork4@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1110 <fork5@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1050 <fork6@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   10e0 <fork7@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1030 <fork8@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   10d0 <fork9@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1130 <fork10@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1090 <fork11@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   10b0 <fork12@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1150 <fork13@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1120 <fork14@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1080 <fork15@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   10c0 <fork16@plt>
jmp    126d <main+0x2d>
xor    %eax,%eax
call   1160 <fork17@plt>
jmp    126d <main+0x2d>

LLVM IR (-O0):
@.str = [19 x i8] c"Unknown option %d\0A\00"
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 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
switch i32 %15, label %52 [
i32 0, label %16
i32 1, label %18
i32 2, label %20
i32 3, label %22
i32 4, label %24
i32 5, label %26
i32 6, label %28
i32 7, label %30
i32 8, label %32
i32 9, label %34
i32 10, label %36
i32 11, label %38
i32 12, label %40
i32 13, label %42
i32 14, label %44
i32 15, label %46
i32 16, label %48
i32 17, label %50
]
16: ; preds = %14
%17 = call i32 (...) @fork0()
br label %55
18: ; preds = %14
%19 = call i32 (...) @fork1()
br label %55
20: ; preds = %14
%21 = call i32 (...) @fork2()
br label %55
22: ; preds = %14
%23 = call i32 (...) @fork3()
br label %55
24: ; preds = %14
%25 = call i32 (...) @fork4()
br label %55
26: ; preds = %14
%27 = call i32 (...) @fork5()
br label %55
28: ; preds = %14
%29 = call i32 (...) @fork6()
br label %55
30: ; preds = %14
%31 = call i32 (...) @fork7()
br label %55
32: ; preds = %14
%33 = call i32 (...) @fork8()
br label %55
34: ; preds = %14
%35 = call i32 (...) @fork9()
br label %55
36: ; preds = %14
%37 = call i32 (...) @fork10()
br label %55
38: ; preds = %14
%39 = call i32 (...) @fork11()
br label %55
40: ; preds = %14
%41 = call i32 (...) @fork12()
br label %55
42: ; preds = %14
%43 = call i32 (...) @fork13()
br label %55
44: ; preds = %14
%45 = call i32 (...) @fork14()
br label %55
46: ; preds = %14
%47 = call i32 (...) @fork15()
br label %55
48: ; preds = %14
%49 = call i32 (...) @fork16()
br label %55
50: ; preds = %14
%51 = call i32 (...) @fork17()
br label %55
52: ; preds = %14
%53 = load i32, i32* %6
%54 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Unknown option %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
switch i32 %7, label %44 [
i32 0, label %8
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
i32 5, label %18
i32 6, label %20
i32 7, label %22
i32 8, label %24
i32 9, label %26
i32 10, label %28
i32 11, label %30
i32 12, label %32
i32 13, label %34
i32 14, label %36
i32 15, label %38
i32 16, label %40
i32 17, label %42
]
8: ; preds = %2, %4
%9 = tail call i32 (...) @fork0()
br label %46
10: ; preds = %4
%11 = tail call i32 (...) @fork1()
br label %46
12: ; preds = %4
%13 = tail call i32 (...) @fork2()
br label %46
14: ; preds = %4
%15 = tail call i32 (...) @fork3()
br label %46
16: ; preds = %4
%17 = tail call i32 (...) @fork4()
br label %46
18: ; preds = %4
%19 = tail call i32 (...) @fork5()
br label %46
20: ; preds = %4
%21 = tail call i32 (...) @fork6()
br label %46
22: ; preds = %4
%23 = tail call i32 (...) @fork7()
br label %46
24: ; preds = %4
%25 = tail call i32 (...) @fork8()
br label %46
26: ; preds = %4
%27 = tail call i32 (...) @fork9()
br label %46
28: ; preds = %4
%29 = tail call i32 (...) @fork10()
br label %46
30: ; preds = %4
%31 = tail call i32 (...) @fork11()
br label %46
32: ; preds = %4
%33 = tail call i32 (...) @fork12()
br label %46
34: ; preds = %4
%35 = tail call i32 (...) @fork13()
br label %46
36: ; preds = %4
%37 = tail call i32 (...) @fork14()
br label %46
38: ; preds = %4
%39 = tail call i32 (...) @fork15()
br label %46
40: ; preds = %4
%41 = tail call i32 (...) @fork16()
br label %46
42: ; preds = %4
%43 = tail call i32 (...) @fork17()
br label %46
44: ; preds = %4
%45 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %46
46: ; preds = %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8
ret i32 0
}