#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 ILA_CSUM_ADJUST_TRANSPORT;
int ILA_CSUM_NEUTRAL_MAP;
int ILA_CSUM_NEUTRAL_MAP_AUTO;
int ILA_CSUM_NO_ACTION;
scalar_t__ strcmp(char *, char *);
int ila_csum_name2mode(char *name) {
  if (strcmp(name, "adj-transport") == 0)
    return ILA_CSUM_ADJUST_TRANSPORT;
  else if (strcmp(name, "neutral-map") == 0)
    return ILA_CSUM_NEUTRAL_MAP;
  else if (strcmp(name, "neutral-map-auto") == 0)
    return ILA_CSUM_NEUTRAL_MAP_AUTO;
  else if (strcmp(name, "no-action") == 0)
    return ILA_CSUM_NO_ACTION;
  else if (strcmp(name, "neutral-map-auto") == 0)
    return ILA_CSUM_NEUTRAL_MAP_AUTO;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ila_csum_name2mode>:
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,%rax
jne    1147 <ila_csum_name2mode+0x37>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <ila_csum_name2mode+0xea>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <ila_csum_name2mode+0x62>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <ila_csum_name2mode+0xea>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    119d <ila_csum_name2mode+0x8d>
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <ila_csum_name2mode+0xea>
mov    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <ila_csum_name2mode+0xb8>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <ila_csum_name2mode+0xea>
mov    -0x10(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11f3 <ila_csum_name2mode+0xe3>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fa <ila_csum_name2mode+0xea>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ila_csum_name2mode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1180 <ila_csum_name2mode+0x70>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1189 <ila_csum_name2mode+0x79>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1192 <ila_csum_name2mode+0x82>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     119b <ila_csum_name2mode+0x8b>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    0x2e69(%rip),%rcx
neg    %rax
sbb    %eax,%eax
or     (%rcx),%eax
pop    %rbx
ret
mov    0x2e69(%rip),%rax
jmp    11a2 <ila_csum_name2mode+0x92>
mov    0x2e38(%rip),%rax
jmp    11a2 <ila_csum_name2mode+0x92>
mov    0x2e47(%rip),%rax
jmp    11a2 <ila_csum_name2mode+0x92>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"adj-transport\00"
@ILA_CSUM_ADJUST_TRANSPORT = global i32 0
@.str.1 = [12 x i8] c"neutral-map\00"
@ILA_CSUM_NEUTRAL_MAP = global i32 0
@.str.2 = [17 x i8] c"neutral-map-auto\00"
@ILA_CSUM_NEUTRAL_MAP_AUTO = global i32 0
@.str.3 = [10 x i8] c"no-action\00"
@ILA_CSUM_NO_ACTION = global i32 0
define i32 @ila_csum_name2mode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @ILA_CSUM_ADJUST_TRANSPORT
store i32 %8, i32* %2
br label %34
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP
store i32 %14, i32* %2
br label %34
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP_AUTO
store i32 %20, i32* %2
br label %34
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* @ILA_CSUM_NO_ACTION
store i32 %26, i32* %2
br label %34
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP_AUTO
store i32 %32, i32* %2
br label %34
33: ; preds = %27
store i32 -1, i32* %2
br label %34
34: ; preds = %33, %31, %25, %19, %13, %7
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [14 x i8] c"adj-transport\00"
@ILA_CSUM_ADJUST_TRANSPORT = global i32 0
@.str.1 = [12 x i8] c"neutral-map\00"
@ILA_CSUM_NEUTRAL_MAP = global i32 0
@.str.2 = [17 x i8] c"neutral-map-auto\00"
@ILA_CSUM_NEUTRAL_MAP_AUTO = global i32 0
@.str.3 = [10 x i8] c"no-action\00"
@ILA_CSUM_NO_ACTION = global i32 0
define i32 @ila_csum_name2mode(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* @ILA_CSUM_ADJUST_TRANSPORT
br label %26
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP
br label %26
11: ; preds = %6
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP_AUTO
br label %26
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32, i32* @ILA_CSUM_NO_ACTION
br label %26
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
%24 = load i32, i32* @ILA_CSUM_NEUTRAL_MAP_AUTO
%25 = select i1 %23, i32 %24, i32 -1
br label %26
26: ; preds = %21, %19, %14, %9, %4
%27 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %21 ]
ret i32 %27
}