#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 const *, char *);
int get_test_type(const char *str) {
  if (str == NULL)
    return -1;
  if (!strcmp(str, "one_to_one"))
    return 1;
  if (!strcmp(str, "all_to_all"))
    return 2;
  if (!strcmp(str, "async_one_to_one"))
    return 3;
  if (!strcmp(str, "send_recv_and_recv_send"))
    return 4;
  if (!strcmp(str, "noise"))
    return 5;
  if (!strcmp(str, "noise_blocking"))
    return 6;
  if (!strcmp(str, "bcast"))
    return 7;
  if (!strcmp(str, "put"))
    return 8;
  if (!strcmp(str, "get"))
    return 9;
  return 0;
}


x86 assembly (clang, -O0):
<get_test_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <get_test_type+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1158 <get_test_type+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    117d <get_test_type+0x6d>
movl   $0x2,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11a2 <get_test_type+0x92>
movl   $0x3,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c7 <get_test_type+0xb7>
movl   $0x4,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11ec <get_test_type+0xdc>
movl   $0x5,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1211 <get_test_type+0x101>
movl   $0x6,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1236 <get_test_type+0x126>
movl   $0x7,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xe0e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    125b <get_test_type+0x14b>
movl   $0x8,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
mov    -0x10(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1280 <get_test_type+0x170>
movl   $0x9,-0x4(%rbp)
jmp    1287 <get_test_type+0x177>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_test_type>:
push   %rbx
test   %rdi,%rdi
je     11dd <get_test_type+0xcd>
mov    %rdi,%rbx
lea    0xeed(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11e4 <get_test_type+0xd4>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11eb <get_test_type+0xdb>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f2 <get_test_type+0xe2>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f9 <get_test_type+0xe9>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1200 <get_test_type+0xf0>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1207 <get_test_type+0xf7>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     120e <get_test_type+0xfe>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1215 <get_test_type+0x105>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,8),%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret
mov    $0x3,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret
mov    $0x5,%eax
pop    %rbx
ret
mov    $0x6,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret
mov    $0x8,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"one_to_one\00"
@.str.1 = [11 x i8] c"all_to_all\00"
@.str.2 = [17 x i8] c"async_one_to_one\00"
@.str.3 = [24 x i8] c"send_recv_and_recv_send\00"
@.str.4 = [6 x i8] c"noise\00"
@.str.5 = [15 x i8] c"noise_blocking\00"
@.str.6 = [6 x i8] c"bcast\00"
@.str.7 = [4 x i8] c"put\00"
@.str.8 = [4 x i8] c"get\00"
define i32 @get_test_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %53
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i32 1, i32* %2
br label %53
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
store i32 2, i32* %2
br label %53
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i32 3, i32* %2
br label %53
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
store i32 4, i32* %2
br label %53
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %27
store i32 5, i32* %2
br label %53
32: ; preds = %27
%33 = load i8*, i8** %3
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32
store i32 6, i32* %2
br label %53
37: ; preds = %32
%38 = load i8*, i8** %3
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %37
store i32 7, i32* %2
br label %53
42: ; preds = %37
%43 = load i8*, i8** %3
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %47, label %46
46: ; preds = %42
store i32 8, i32* %2
br label %53
47: ; preds = %42
%48 = load i8*, i8** %3
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %47
store i32 9, i32* %2
br label %53
52: ; preds = %47
store i32 0, i32* %2
br label %53
53: ; preds = %52, %51, %46, %41, %36, %31, %26, %21, %16, %11, %6
%54 = load i32, i32* %2
ret i32 %54
}

LLVM IR (-O2):
@.str = [11 x i8] c"one_to_one\00"
@.str.1 = [11 x i8] c"all_to_all\00"
@.str.2 = [17 x i8] c"async_one_to_one\00"
@.str.3 = [24 x i8] c"send_recv_and_recv_send\00"
@.str.4 = [6 x i8] c"noise\00"
@.str.5 = [15 x i8] c"noise_blocking\00"
@.str.6 = [6 x i8] c"bcast\00"
@.str.7 = [4 x i8] c"put\00"
@.str.8 = [4 x i8] c"get\00"
define i32 @get_test_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %31, label %3
3: ; preds = %1
%4 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %31, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %31, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %31, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(24) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %31, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %31, label %24
24: ; preds = %21
%25 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %24
%28 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 9, i32 0
br label %31
31: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %3, %1
%32 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 2, %6 ], [ 3, %9 ], [ 4, %12 ], [ 5, %15 ], [ 6, %18 ], [ 7, %21 ], [ 8, %24 ], [ %30, %27 ]
ret i32 %32
}