#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*/ strcmp(char *, char *);
int determine_command(char *string) {
  if (!strcmp(string, "-help") || (!strcmp(string, "help")))
    return 1;
  if (!strcmp(string, "-read") || (!strcmp(string, "read")) ||
      (!strcmp(string, "-show")) || (!strcmp(string, "show")))
    return 2;
  if (!strcmp(string, "-write") || (!strcmp(string, "write")))
    return 3;
  return -1;
}


x86 assembly (clang, -O0):
<determine_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     114e <determine_command+0x3e>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115a <determine_command+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    120f <determine_command+0xff>
mov    -0x10(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11be <determine_command+0xae>
mov    -0x10(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11be <determine_command+0xae>
mov    -0x10(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11be <determine_command+0xae>
mov    -0x10(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11ca <determine_command+0xba>
movl   $0x2,-0x4(%rbp)
jmp    120f <determine_command+0xff>
mov    -0x10(%rbp),%rdi
lea    0xe3d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11fc <determine_command+0xec>
mov    -0x10(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1208 <determine_command+0xf8>
movl   $0x3,-0x4(%rbp)
jmp    120f <determine_command+0xff>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x2,%ebp
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c7 <determine_command+0xb7>
lea    0xe74(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c2 <determine_command+0xb2>
lea    0xe62(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %ebp,%ebp
or     $0x3,%ebp
jmp    11c7 <determine_command+0xb7>
mov    $0x3,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"-help\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [6 x i8] c"-read\00"
@.str.3 = [5 x i8] c"read\00"
@.str.4 = [6 x i8] c"-show\00"
@.str.5 = [5 x i8] c"show\00"
@.str.6 = [7 x i8] c"-write\00"
@.str.7 = [6 x i8] c"write\00"
define i32 @determine_command(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %26, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %26, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %26, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 3, i32 -1
br label %26
26: ; preds = %22, %19, %7, %10, %13, %16, %1, %4
%27 = phi i32 [ 1, %4 ], [ 1, %1 ], [ 2, %16 ], [ 2, %13 ], [ 2, %10 ], [ 2, %7 ], [ 3, %19 ], [ %25, %22 ]
ret i32 %27
}