#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*/ double_simd_op(char *, unsigned long);
int /*<<< orphan*/ float_simd_op(char *, unsigned long);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ int_simd_op(char *, unsigned long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void bench_level0(char *b, unsigned long r, char *o, char *dt) {
  if (strcmp(b, "simd") == 0) {
    if (strcmp(dt, "int") == 0)
      int_simd_op(o, r);
    else if (strcmp(dt, "float") == 0)
      float_simd_op(o, r);
    else if (strcmp(dt, "double") == 0)
      double_simd_op(o, r);
    else
      fprintf(stderr, "ERROR: check you are using a valid data type...\n");
  } else
    printf("Not implemented yet.\n");
}


x86 assembly (clang, -O0):
<bench_level0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    123a <bench_level0+0xda>
mov    -0x20(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11be <bench_level0+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <int_simd_op@plt>
jmp    1235 <bench_level0+0xd5>
mov    -0x20(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <bench_level0+0x8a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <float_simd_op@plt>
jmp    1230 <bench_level0+0xd0>
mov    -0x20(%rbp),%rdi
lea    0xe1a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1216 <bench_level0+0xb6>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <double_simd_op@plt>
jmp    122b <bench_level0+0xcb>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
lea    0xdf0(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1230 <bench_level0+0xd0>
jmp    1235 <bench_level0+0xd5>
jmp    1246 <bench_level0+0xe6>
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_level0>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r14
lea    0xe8b(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1190 <bench_level0+0x30>
lea    0xec1(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11e6 <bench_level0+0x86>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11f6 <bench_level0+0x96>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1206 <bench_level0+0xa6>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
lea    0xe3a(%rip),%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <fprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1080 <int_simd_op@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <float_simd_op@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <double_simd_op@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"simd\00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [6 x i8] c"float\00"
@.str.3 = [7 x i8] c"double\00"
@stderr = global i32 0
@.str.4 = [49 x i8] c"ERROR: check you are using a valid data type...\0A\00"
@.str.5 = [22 x i8] c"Not implemented yet.\0A\00"
define void @bench_level0(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %42
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8*, i8** %7
%18 = load i64, i64* %6
%19 = call i32 @int_simd_op(i8* %17, i64 %18)
br label %41
20: ; preds = %12
%21 = load i8*, i8** %8
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8*, i8** %7
%26 = load i64, i64* %6
%27 = call i32 @float_simd_op(i8* %25, i64 %26)
br label %40
28: ; preds = %20
%29 = load i8*, i8** %8
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i8*, i8** %7
%34 = load i64, i64* %6
%35 = call i32 @double_simd_op(i8* %33, i64 %34)
br label %39
36: ; preds = %28
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %36, %32
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40, %16
br label %44
42: ; preds = %4
%43 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %41
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"simd\00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [6 x i8] c"float\00"
@.str.3 = [7 x i8] c"double\00"
@stderr = global i32 0
@.str.4 = [49 x i8] c"ERROR: check you are using a valid data type...\0A\00"
@str = [21 x i8] c"Not implemented yet.\00"
define void @bench_level0(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @int_simd_op(i8* %2, i64 %1)
br label %27
12: ; preds = %7
%13 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @float_simd_op(i8* %2, i64 %1)
br label %27
17: ; preds = %12
%18 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 @double_simd_op(i8* %2, i64 %1)
br label %27
22: ; preds = %17
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
br label %27
25: ; preds = %4
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %27
27: ; preds = %10, %20, %22, %15, %25
ret void
}