#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 *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int check_options_quit(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--version") == 0) {
      printf("%s", "1.00.0005");
      return true;
    }
    if (strcmp(argv[i], "--help") == 0) {
      usage();
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<check_options_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11db <check_options_quit+0xab>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1193 <check_options_quit+0x63>
lea    0xe8f(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e2 <check_options_quit+0xb2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <check_options_quit+0x98>
mov    $0x0,%al
call   1050 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e2 <check_options_quit+0xb2>
jmp    11cd <check_options_quit+0x9d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <check_options_quit+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_options_quit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    $0x2,%edi
jl     11af <check_options_quit+0x7f>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0xeab(%rip),%r12
lea    0xebb(%rip),%r15
nopl   0x0(%rax)
mov    (%rbx,%rbp,8),%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118d <check_options_quit+0x5d>
mov    (%rbx,%rbp,8),%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a2 <check_options_quit+0x72>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1160 <check_options_quit+0x30>
jmp    11af <check_options_quit+0x7f>
lea    0xe76(%rip),%rdi
lea    0xe72(%rip),%rsi
call   1030 <printf@plt>
jmp    11a9 <check_options_quit+0x79>
xor    %eax,%eax
call   1050 <usage@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"--version\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"1.00.0005\00"
@.str.3 = [7 x i8] c"--help\00"
define i32 @check_options_quit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %16
%7 = icmp eq i64 %20, %5
br i1 %7, label %23, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 1, %4 ], [ %20, %6 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %23
16: ; preds = %8
%17 = load i8*, i8** %10
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
%20 = add nuw nsw i64 %9, 1
br i1 %19, label %21, label %6
21: ; preds = %16
%22 = tail call i32 (...) @usage()
br label %23
23: ; preds = %6, %2, %21, %14
%24 = phi i32 [ 1, %14 ], [ 1, %21 ], [ 0, %2 ], [ 0, %6 ]
ret i32 %24
}