#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 */
struct ibe_scheme {
  int dummy;
};

/* Variables and functions */
struct ibe_scheme *ag_get_scheme();
struct ibe_scheme *cocks_get_scheme();
struct ibe_scheme *jb_get_scheme();
struct ibe_scheme *nua_get_scheme();
int /*<<< orphan*/ strcmp(char const *, char *);
struct ibe_scheme *create_scheme(const char *name) {
  if (!strcmp(name, "cocks")) {
    return cocks_get_scheme();
  } else if (!strcmp(name, "ag")) {
    return ag_get_scheme();
  } else if (!strcmp(name, "nua")) {
    return nua_get_scheme();
  } else if (!strcmp(name, "jb")) {
    return jb_get_scheme();
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<create_scheme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1185 <create_scheme+0x35>
mov    $0x0,%al
call   1030 <cocks_get_scheme@plt>
mov    %rax,-0x8(%rbp)
jmp    1208 <create_scheme+0xb8>
mov    -0x10(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ae <create_scheme+0x5e>
mov    $0x0,%al
call   1070 <ag_get_scheme@plt>
mov    %rax,-0x8(%rbp)
jmp    1208 <create_scheme+0xb8>
mov    -0x10(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d7 <create_scheme+0x87>
mov    $0x0,%al
call   1060 <nua_get_scheme@plt>
mov    %rax,-0x8(%rbp)
jmp    1208 <create_scheme+0xb8>
mov    -0x10(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1200 <create_scheme+0xb0>
mov    $0x0,%al
call   1050 <jb_get_scheme@plt>
mov    %rax,-0x8(%rbp)
jmp    1208 <create_scheme+0xb8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_scheme>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11a1 <create_scheme+0x51>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11a9 <create_scheme+0x59>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b1 <create_scheme+0x61>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b9 <create_scheme+0x69>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <cocks_get_scheme@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <ag_get_scheme@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <nua_get_scheme@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <jb_get_scheme@plt>

LLVM IR (-O0):
%struct.ibe_scheme = type { i32 }
@.str = [6 x i8] c"cocks\00"
@.str.1 = [3 x i8] c"ag\00"
@.str.2 = [4 x i8] c"nua\00"
@.str.3 = [3 x i8] c"jb\00"
define %struct.ibe_scheme* @create_scheme(i8* %0) {
%2 = alloca %struct.ibe_scheme*
%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 %9, label %7
7: ; preds = %1
%8 = call %struct.ibe_scheme* (...) @cocks_get_scheme()
store %struct.ibe_scheme* %8, %struct.ibe_scheme** %2
br label %28
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = call %struct.ibe_scheme* (...) @ag_get_scheme()
store %struct.ibe_scheme* %14, %struct.ibe_scheme** %2
br label %28
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = call %struct.ibe_scheme* (...) @nua_get_scheme()
store %struct.ibe_scheme* %20, %struct.ibe_scheme** %2
br label %28
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call %struct.ibe_scheme* (...) @jb_get_scheme()
store %struct.ibe_scheme* %26, %struct.ibe_scheme** %2
br label %28
27: ; preds = %21
store %struct.ibe_scheme* null, %struct.ibe_scheme** %2
br label %28
28: ; preds = %27, %25, %19, %13, %7
%29 = load %struct.ibe_scheme*, %struct.ibe_scheme** %2
ret %struct.ibe_scheme* %29
}

LLVM IR (-O2):
%struct.ibe_scheme = type { i32 }
@.str = [6 x i8] c"cocks\00"
@.str.1 = [3 x i8] c"ag\00"
@.str.2 = [4 x i8] c"nua\00"
@.str.3 = [3 x i8] c"jb\00"
define %struct.ibe_scheme* @create_scheme(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 %4, label %6
4: ; preds = %1
%5 = tail call %struct.ibe_scheme* (...) @cocks_get_scheme()
br label %21
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call %struct.ibe_scheme* (...) @ag_get_scheme()
br label %21
11: ; preds = %6
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call %struct.ibe_scheme* (...) @nua_get_scheme()
br label %21
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call %struct.ibe_scheme* (...) @jb_get_scheme()
br label %21
21: ; preds = %16, %19, %14, %9, %4
%22 = phi %struct.ibe_scheme* [ %20, %19 ], [ %15, %14 ], [ %10, %9 ], [ %5, %4 ], [ null, %16 ]
ret %struct.ibe_scheme* %22
}