#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ b2i();
int /*<<< orphan*/ debug();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gs(char *);
int /*<<< orphan*/ id();
int /*<<< orphan*/ lb(char *);
int /*<<< orphan*/ pb(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ s2b();
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  FILE *prog_file;
  int i, c;
  if (!(argc - 2) || !(argc - 1)) {
    puts("Too few arguments");
    exit(0);
  } else if (!strcmp(argv[1], "-c")) {
    gs(argv[2]);
    s2b();
    pb(argv[3]);
  } else if (!strcmp(argv[1], "-e")) {
    lb(argv[2]);
    b2i();
    id();
  } else if (!strcmp(argv[1], "-i")) {
    gs(argv[2]);
    s2b();
    pb("temp.byte");
    lb("temp.byte");
    b2i();
    id();
  } else if (!strcmp(argv[1], "--debug")) {
    lb(argv[2]);
    b2i();
    debug();
  } else {
    puts("Wrong arguments.");
  }
}


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
sub    $0x2,%eax
cmp    $0x0,%eax
je     11d4 <main+0x34>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jne    11e7 <main+0x47>
lea    0xe25(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    122a <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <gs@plt>
mov    $0x0,%al
call   1080 <s2b@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <pb@plt>
jmp    131b <main+0x17b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xddc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1267 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <lb@plt>
mov    $0x0,%al
call   1090 <b2i@plt>
mov    $0x0,%al
call   10c0 <id@plt>
jmp    1316 <main+0x176>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12c3 <main+0x123>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <gs@plt>
mov    $0x0,%al
call   1080 <s2b@plt>
lea    0xd7c(%rip),%rdi
call   1060 <pb@plt>
lea    0xd70(%rip),%rdi
call   10a0 <lb@plt>
mov    $0x0,%al
call   1090 <b2i@plt>
mov    $0x0,%al
call   10c0 <id@plt>
jmp    1311 <main+0x171>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd53(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1300 <main+0x160>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <lb@plt>
mov    $0x0,%al
call   1090 <b2i@plt>
mov    $0x0,%al
call   1040 <debug@plt>
jmp    130c <main+0x16c>
lea    0xd26(%rip),%rdi
call   1030 <puts@plt>
jmp    1311 <main+0x171>
jmp    1316 <main+0x176>
jmp    131b <main+0x17b>
jmp    1320 <main+0x180>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
add    $0xffffffff,%edi
cmp    $0x1,%edi
jbe    128a <main+0xea>
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
lea    0xe54(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1211 <main+0x71>
lea    0xe44(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     122c <main+0x8c>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1232 <main+0x92>
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1271 <main+0xd1>
lea    0xe23(%rip),%rdi
call   1030 <puts@plt>
jmp    1267 <main+0xc7>
mov    0x10(%r14),%rdi
call   1050 <gs@plt>
xor    %eax,%eax
call   1080 <s2b@plt>
mov    0x18(%r14),%rdi
call   1060 <pb@plt>
jmp    1267 <main+0xc7>
mov    0x10(%r14),%rdi
jmp    1254 <main+0xb4>
mov    0x10(%r14),%rdi
call   1050 <gs@plt>
xor    %eax,%eax
call   1080 <s2b@plt>
lea    0xdd2(%rip),%rbx
mov    %rbx,%rdi
call   1060 <pb@plt>
mov    %rbx,%rdi
call   10a0 <lb@plt>
xor    %eax,%eax
call   1090 <b2i@plt>
xor    %eax,%eax
call   10c0 <id@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x10(%r14),%rdi
call   10a0 <lb@plt>
xor    %eax,%eax
call   1090 <b2i@plt>
xor    %eax,%eax
call   1040 <debug@plt>
jmp    1267 <main+0xc7>
lea    0xd6f(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Too few arguments\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [10 x i8] c"temp.byte\00"
@.str.5 = [8 x i8] c"--debug\00"
@.str.6 = [17 x i8] c"Wrong arguments.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %12, %2
%17 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %12
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %35, label %25
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @gs(i8* %28)
%30 = call i32 (...) @s2b()
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 3
%33 = load i8*, i8** %32
%34 = call i32 @pb(i8* %33)
br label %82
35: ; preds = %19
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %48, label %41
41: ; preds = %35
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @lb(i8* %44)
%46 = call i32 (...) @b2i()
%47 = call i32 (...) @id()
br label %81
48: ; preds = %35
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %64, label %54
54: ; preds = %48
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i32 @gs(i8* %57)
%59 = call i32 (...) @s2b()
%60 = call i32 @pb(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%61 = call i32 @lb(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%62 = call i32 (...) @b2i()
%63 = call i32 (...) @id()
br label %80
64: ; preds = %48
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %77, label %70
70: ; preds = %64
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 2
%73 = load i8*, i8** %72
%74 = call i32 @lb(i8* %73)
%75 = call i32 (...) @b2i()
%76 = call i32 (...) @debug()
br label %79
77: ; preds = %64
%78 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %79
79: ; preds = %77, %70
br label %80
80: ; preds = %79, %54
br label %81
81: ; preds = %80, %41
br label %82
82: ; preds = %81, %25
br label %83
83: ; preds = %82
%84 = load i32, i32* %3
ret i32 %84
}

LLVM IR (-O2):
@.str = [18 x i8] c"Too few arguments\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [10 x i8] c"temp.byte\00"
@.str.5 = [8 x i8] c"--debug\00"
@.str.6 = [17 x i8] c"Wrong arguments.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @gs(i8* %15)
%17 = tail call i32 (...) @s2b()
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = tail call i32 @pb(i8* %19)
br label %53
21: ; preds = %8
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32 @lb(i8* %26)
%28 = tail call i32 (...) @b2i()
%29 = tail call i32 (...) @id()
br label %53
30: ; preds = %21
%31 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = tail call i32 @gs(i8* %35)
%37 = tail call i32 (...) @s2b()
%38 = tail call i32 @pb(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%39 = tail call i32 @lb(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%40 = tail call i32 (...) @b2i()
%41 = tail call i32 (...) @id()
br label %53
42: ; preds = %30
%43 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = getelementptr inbounds i8*, i8** %1, i64 2
%47 = load i8*, i8** %46
%48 = tail call i32 @lb(i8* %47)
%49 = tail call i32 (...) @b2i()
%50 = tail call i32 (...) @debug()
br label %53
51: ; preds = %42
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %53
53: ; preds = %13, %33, %51, %45, %24
ret i32 0
}