#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*/ _print_help();
int iracc_ctrl_main(int, char **);
int iracc_gate_main(int, char **);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1 && strcmp(argv[1], "ctrl") == 0) {
    return iracc_ctrl_main(argc - 1, argv + 1);
  } else if (argc > 1 && strcmp(argv[1], "gate") == 0) {
    return iracc_gate_main(argc - 1, argv + 1);
  }
  _print_help();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1199 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1199 <main+0x59>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <iracc_ctrl_main@plt>
mov    %eax,-0x4(%rbp)
jmp    11ef <main+0xaf>
cmpl   $0x1,-0x8(%rbp)
jle    11dc <main+0x9c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe53(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11dc <main+0x9c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1050 <iracc_gate_main@plt>
mov    %eax,-0x4(%rbp)
jmp    11ef <main+0xaf>
jmp    11e1 <main+0xa1>
mov    $0x0,%al
call   1060 <_print_help@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     117a <main+0x3a>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
add    $0x8,%rbx
lea    0xea4(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     118a <main+0x4a>
mov    (%rbx),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     119d <main+0x5d>
xor    %eax,%eax
call   1060 <_print_help@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <iracc_ctrl_main@plt>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <iracc_gate_main@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ctrl\00"
@.str.1 = [5 x i8] c"gate\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
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = call i32 @iracc_ctrl_main(i32 %16, i8** %18)
store i32 %19, i32* %3
br label %38
20: ; preds = %8, %2
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = call i32 @iracc_gate_main(i32 %31, i8** %33)
store i32 %34, i32* %3
br label %38
35: ; preds = %23, %20
br label %36
36: ; preds = %35
%37 = call i32 (...) @_print_help()
store i32 0, i32* %3
br label %38
38: ; preds = %36, %29, %14
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [5 x i8] c"ctrl\00"
@.str.1 = [5 x i8] c"gate\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nsw i32 %0, -1
%11 = tail call i32 @iracc_ctrl_main(i32 %10, i8** %5)
br label %21
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = add nsw i32 %0, -1
%18 = tail call i32 @iracc_gate_main(i32 %17, i8** %5)
br label %21
19: ; preds = %2, %12
%20 = tail call i32 (...) @_print_help()
br label %21
21: ; preds = %19, %16, %9
%22 = phi i32 [ %11, %9 ], [ %18, %16 ], [ 0, %19 ]
ret i32 %22
}