#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*/ help();
scalar_t__ strcmp(char *, char *);
int get_options(int *kill_slow, int argc, char *argv[]) {
  if (argc < 2)
    return -1;
  if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)
    help();
  if (strcmp(argv[1], "-k") == 0 || strcmp(argv[1], "--kill-slow") == 0)
    *kill_slow = 1;
  if (argc < 4)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<get_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1149 <get_options+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ef <get_options+0xcf>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1185 <get_options+0x65>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118c <get_options+0x6c>
mov    $0x0,%al
call   1040 <help@plt>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11c8 <get_options+0xa8>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d2 <get_options+0xb2>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x4,-0x14(%rbp)
jge    11e8 <get_options+0xc8>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ef <get_options+0xcf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_options>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jl     11a1 <get_options+0x81>
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x8(%rdx),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1160 <get_options+0x40>
mov    0x8(%rbx),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1167 <get_options+0x47>
xor    %eax,%eax
call   1040 <help@plt>
mov    0x8(%rbx),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1191 <get_options+0x71>
mov    0x8(%rbx),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1198 <get_options+0x78>
movl   $0x1,(%r14)
cmp    $0x4,%ebp
sbb    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-k\00"
@.str.3 = [12 x i8] c"--kill-slow\00"
define i32 @get_options(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8**
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %44
11: ; preds = %3
%12 = load i8**, i8*** %7
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i8**, i8*** %7
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17, %11
%24 = call i32 (...) @help()
br label %25
25: ; preds = %23, %17
%26 = load i8**, i8*** %7
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %37, label %31
31: ; preds = %25
%32 = load i8**, i8*** %7
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %31, %25
%38 = load i32*, i32** %5
store i32 1, i32* %38
br label %39
39: ; preds = %37, %31
%40 = load i32, i32* %6
%41 = icmp slt i32 %40, 4
br i1 %41, label %42, label %43
42: ; preds = %39
store i32 -1, i32* %4
br label %44
43: ; preds = %39
store i32 0, i32* %4
br label %44
44: ; preds = %43, %42, %10
%45 = load i32, i32* %4
ret i32 %45
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-k\00"
@.str.3 = [12 x i8] c"--kill-slow\00"
define i32 @get_options(i32* nocapture writeonly %0, i32 %1, i8** nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %28, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = load i8*, i8** %6
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10, %5
%15 = tail call i32 (...) @help()
br label %16
16: ; preds = %14, %10
%17 = load i8*, i8** %6
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i8*, i8** %6
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20, %16
store i32 1, i32* %0
br label %25
25: ; preds = %24, %20
%26 = icmp ult i32 %1, 4
%27 = sext i1 %26 to i32
br label %28
28: ; preds = %25, %3
%29 = phi i32 [ -1, %3 ], [ %27, %25 ]
ret i32 %29
}