#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int launch_commands(char *);
int /*<<< orphan*/ run_launch_tests(int, char **);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1 && !strcmp(argv[1], "-test")) {
    run_launch_tests(argc - 1, argv + 1);
    return EXIT_SUCCESS;
  }
  if (argc != 2) {
    fprintf(stderr, "Usage: launch <launch_set_filename>\n");
    return EXIT_FAILURE;
  }
  return launch_commands(argv[1]);
}


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    11a1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11a1 <main+0x61>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <run_launch_tests@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e1 <main+0xa1>
cmpl   $0x2,-0x8(%rbp)
je     11d1 <main+0x91>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e1 <main+0xa1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <launch_commands@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1176 <main+0x36>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%r14
lea    0xea7(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1194 <main+0x54>
cmp    $0x2,%ebp
jne    1176 <main+0x36>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <launch_commands@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e46(%rip),%rax
jmp    11ac <main+0x6c>
add    $0x8,%rbx
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <run_launch_tests@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"-test\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.1 = [37 x i8] c"Usage: launch <launch_set_filename>\0A\00"
@EXIT_FAILURE = global i32 0
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 %21
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %21, label %14
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 @run_launch_tests(i32 %16, i8** %18)
%20 = load i32, i32* @EXIT_SUCCESS
store i32 %20, i32* %3
br label %33
21: ; preds = %8, %2
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
store i32 %27, i32* %3
br label %33
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @launch_commands(i8* %31)
store i32 %32, i32* %3
br label %33
33: ; preds = %28, %24, %14
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [6 x i8] c"-test\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.1 = [37 x i8] c"Usage: launch <launch_set_filename>\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = add nsw i32 %0, -1
%11 = tail call i32 @run_launch_tests(i32 %10, i8** %5)
%12 = load i32, i32* @EXIT_SUCCESS
br label %21
13: ; preds = %4
%14 = icmp eq i32 %0, 2
br i1 %14, label %19, label %15
15: ; preds = %2, %13
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
br label %21
19: ; preds = %13
%20 = tail call i32 @launch_commands(i8* %6)
br label %21
21: ; preds = %19, %15, %9
%22 = phi i32 [ %18, %15 ], [ %20, %19 ], [ %12, %9 ]
ret i32 %22
}