#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*/ checkPlayerStatus(char *, char *);
int /*<<< orphan*/ printUsage(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **args) {
  if (argc < 2)
    printUsage(args[0]);
  char *logFile = args[1];
  for (int i = 2; i < argc; i++) {
    if (strcmp(args[i], "--help") == 0) {
      printUsage(args[0]);
    } else if (strcmp(args[i], "--player-status") == 0) {
      checkPlayerStatus(logFile, args[++i]);
    }
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printUsage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1205 <main+0xd5>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe72(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ae <main+0x7e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printUsage@plt>
jmp    11f2 <main+0xc2>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe46(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ed <main+0xbd>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1050 <checkPlayerStatus@plt>
jmp    11f2 <main+0xc2>
jmp    11f7 <main+0xc7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116f <main+0x3f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     114d <main+0x1d>
mov    (%rbx),%rdi
call   1040 <printUsage@plt>
jmp    1155 <main+0x25>
mov    %edi,%r13d
cmp    $0x2,%edi
jne    1166 <main+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rbx),%rax
mov    %rax,(%rsp)
mov    $0x2,%ebp
lea    0xe86(%rip),%r15
lea    0xe86(%rip),%r12
jmp    11a0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%rdi
call   1040 <printUsage@plt>
add    $0x1,%ebp
cmp    %r13d,%ebp
jge    1155 <main+0x25>
movslq %ebp,%r14
mov    (%rbx,%r14,8),%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1190 <main+0x60>
mov    (%rbx,%r14,8),%rdi
mov    %r12,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1198 <main+0x68>
lea    0x1(%r14),%ebp
mov    0x8(%rbx,%r14,8),%rsi
mov    (%rsp),%rdi
call   1050 <checkPlayerStatus@plt>
jmp    1198 <main+0x68>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [16 x i8] c"--player-status\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @printUsage(i8* %13)
br label %15
15: ; preds = %10, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
store i32 2, i32* %7
br label %19
19: ; preds = %55, %15
%20 = load i32, i32* %7
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %58
23: ; preds = %19
%24 = load i8**, i8*** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %36
31: ; preds = %23
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @printUsage(i8* %34)
br label %54
36: ; preds = %23
%37 = load i8**, i8*** %5
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %36
%45 = load i8*, i8** %6
%46 = load i8**, i8*** %5
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %46, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 @checkPlayerStatus(i8* %45, i8* %51)
br label %53
53: ; preds = %44, %36
br label %54
54: ; preds = %53, %31
br label %55
55: ; preds = %54
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %19
58: ; preds = %19
%59 = load i32, i32* %3
ret i32 %59
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [16 x i8] c"--player-status\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printUsage(i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i32 %0, 2
br i1 %10, label %11, label %12
11: ; preds = %32, %4, %7
ret i32 0
12: ; preds = %7, %32
%13 = phi i32 [ %34, %32 ], [ 2, %7 ]
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i8*, i8** %1
%21 = tail call i32 @printUsage(i8* %20)
br label %32
22: ; preds = %12
%23 = load i8*, i8** %15
%24 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = add nsw i32 %13, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %1, i64 %28
%30 = load i8*, i8** %29
%31 = tail call i32 @checkPlayerStatus(i8* %9, i8* %30)
br label %32
32: ; preds = %19, %26, %22
%33 = phi i32 [ %13, %19 ], [ %27, %26 ], [ %13, %22 ]
%34 = add nsw i32 %33, 1
%35 = icmp slt i32 %34, %0
br i1 %35, label %12, label %11
}