#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*/ clParseError(int, char **, int, char *);
scalar_t__ strcasecmp(char *, char const *);
int readOption(int argc, char **argv, int *i, const char *opt) {
  if ((*i) < argc) {
    if (strcasecmp(argv[(*i)], opt) == 0) {
      return 1;
    }
  } else {
    clParseError(argc, argv, (*i), "Error parsing command line.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<readOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1179 <readOption+0x59>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1174 <readOption+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1199 <readOption+0x79>
jmp    1192 <readOption+0x72>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe73(%rip),%rcx
call   1040 <clParseError@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readOption>:
push   %rax
movslq (%rdx),%rdx
cmp    %edi,%edx
jge    1140 <readOption+0x20>
mov    (%rsi,%rdx,8),%rdi
mov    %rcx,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    114c <readOption+0x2c>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xeb9(%rip),%rcx
call   1040 <clParseError@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Error parsing command line.\00"
define i32 @readOption(i32 %0, i8** %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i8*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
%10 = load i32*, i32** %8
%11 = load i32, i32* %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %4
%15 = load i8**, i8*** %7
%16 = load i32*, i32** %8
%17 = load i32, i32* %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %15, i64 %18
%20 = load i8*, i8** %19
%21 = load i8*, i8** %9
%22 = call i64 @strcasecmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %14
store i32 1, i32* %5
br label %33
25: ; preds = %14
br label %32
26: ; preds = %4
%27 = load i32, i32* %6
%28 = load i8**, i8*** %7
%29 = load i32*, i32** %8
%30 = load i32, i32* %29
%31 = call i32 @clParseError(i32 %27, i8** %28, i32 %30, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %26, %25
store i32 0, i32* %5
br label %33
33: ; preds = %32, %24
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error parsing command line.\00"
define i32 @readOption(i32 %0, i8** %1, i32* nocapture %2, i8* nocapture %3) {
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, %0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i64 @strcasecmp(i8* %10, i8* %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %15
13: ; preds = %4
%14 = tail call i32 @clParseError(i32 %0, i8** %1, i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %7, %13
br label %16
16: ; preds = %7, %15
%17 = phi i32 [ 0, %15 ], [ 1, %7 ]
ret i32 %17
}