#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*/ printf(char *, ...);
scalar_t__ strcmp(char const *, char *);
int handle_args(int argc, const char *argv[]) {
  if (argc < 2) {
    printf("This is a Wren test runner.\nUsage: wren_test [file]\n");
    return 64;
  }
  if (argc == 2 && strcmp(argv[1], "--version") == 0) {
    printf("wren_test is running on Wren version %s\n", "0.4.0");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<handle_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1153 <handle_args+0x33>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x40,-0x4(%rbp)
jmp    11a3 <handle_args+0x83>
cmpl   $0x2,-0x8(%rbp)
jne    119c <handle_args+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119c <handle_args+0x7c>
lea    0xebd(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <handle_args+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_args>:
push   %rbx
cmp    $0x1,%edi
jg     1149 <handle_args+0x19>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x40,%ebx
jmp    117f <handle_args+0x4f>
xor    %ebx,%ebx
cmp    $0x2,%edi
jne    117f <handle_args+0x4f>
mov    0x8(%rsi),%rdi
lea    0xea5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    117f <handle_args+0x4f>
lea    0xe9e(%rip),%rdi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"This is a Wren test runner.\0AUsage: wren_test [file]\0A\00"
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [41 x i8] c"wren_test is running on Wren version %s\0A\00"
@.str.3 = [6 x i8] c"0.4.0\00"
define i32 @handle_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
store i32 64, i32* %3
br label %22
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %22
21: ; preds = %13, %10
store i32 0, i32* %3
br label %22
22: ; preds = %21, %19, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [41 x i8] c"wren_test is running on Wren version %s\0A\00"
@.str.3 = [6 x i8] c"0.4.0\00"
@str = [52 x i8] c"This is a Wren test runner.\0AUsage: wren_test [file]\00"
define i32 @handle_args(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
br label %15
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %8, label %15
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %6, %8, %13, %4
%16 = phi i32 [ 64, %4 ], [ 1, %13 ], [ 0, %8 ], [ 0, %6 ]
ret i32 %16
}