xunge/DecIR huggingface dataset:
int ipow2(int i) {
  int pow2 = 1;
  if (i < 0)
    return (-1);
  if (i == 0)
    return (1);
  while (i--)
    pow2 *= 2;
  return (pow2);
}


x86 assembly (clang, -O0):
<ipow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1124 <ipow2+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <ipow2+0x67>
cmpl   $0x0,-0x8(%rbp)
jne    113a <ipow2+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1167 <ipow2+0x67>
jmp    113f <ipow2+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1161 <ipow2+0x61>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <ipow2+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow2>:
test   %edi,%edi
js     111a <ipow2+0x1a>
je     1120 <ipow2+0x20>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    1126 <ipow2+0x26>
mov    $0x1,%eax
jmp    1138 <ipow2+0x38>
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
xchg   %ax,%ax
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <ipow2+0x30>
test   %ecx,%ecx
je     1147 <ipow2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <ipow2+0x40>
ret

LLVM IR (-O0):
define i32 @ipow2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %22
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %22
12: ; preds = %8
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
%16 = icmp ne i32 %14, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %4
%19 = mul nsw i32 %18, 2
store i32 %19, i32* %4
br label %13
20: ; preds = %13
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %11, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @ipow2(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %27, label %5
5: ; preds = %3
%6 = add i32 %0, -1
%7 = and i32 %0, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = and i32 %0, -8
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ 1, %9 ], [ %14, %11 ]
%13 = phi i32 [ 0, %9 ], [ %15, %11 ]
%14 = shl i32 %12, 8
%15 = add i32 %13, 8
%16 = icmp eq i32 %15, %10
br i1 %16, label %17, label %11
17: ; preds = %11, %5
%18 = phi i32 [ undef, %5 ], [ %14, %11 ]
%19 = phi i32 [ 1, %5 ], [ %14, %11 ]
%20 = icmp eq i32 %7, 0
br i1 %20, label %27, label %21
21: ; preds = %17, %21
%22 = phi i32 [ %24, %21 ], [ %19, %17 ]
%23 = phi i32 [ %25, %21 ], [ 0, %17 ]
%24 = shl nsw i32 %22, 1
%25 = add i32 %23, 1
%26 = icmp eq i32 %25, %7
br i1 %26, label %27, label %21
27: ; preds = %17, %21, %3, %1
%28 = phi i32 [ -1, %1 ], [ 1, %3 ], [ %18, %17 ], [ %24, %21 ]
ret i32 %28
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *identifier_constructor(const char *name) {
  char *id = xmalloc(strlen(name) + 2);
  strcpy(id, "%");
  strcat(id, name);
  return id;
}


x86 assembly (clang, -O0):
<identifier_constructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifier_constructor>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x2(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"%\00"
define i8* @identifier_constructor(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 2
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
define i8* @identifier_constructor(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 2
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int _init_lexer();
bool init_lexer(char **name) {
  *name = "init_lexer";
  return _init_lexer();
}


x86 assembly (clang, -O0):
<init_lexer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_init_lexer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_lexer>:
lea    0xee9(%rip),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
jmp    1030 <_init_lexer@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"init_lexer\00"
define i32 @init_lexer(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = call i32 (...) @_init_lexer()
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"init_lexer\00"
define i32 @init_lexer(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %0
%2 = tail call i32 (...) @_init_lexer()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_line(void) { printf("\n"); }


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @print_line() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @print_line() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
OP(dd, d0) { op_d0(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_d0@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_d0()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d0()
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ MULT32(scalar_t__, scalar_t__);
int32_t VFLOAT_MULT(int32_t a, int32_t ap, int32_t b, int32_t bp, int32_t *p) {
  if (a && b) {
    *p = ap + bp + 32;
    return MULT32(a, b);
  } else
    return 0;
}


x86 assembly (clang, -O0):
<VFLOAT_MULT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <VFLOAT_MULT+0x5b>
cmpq   $0x0,-0x20(%rbp)
je     116b <VFLOAT_MULT+0x5b>
mov    -0x18(%rbp),%rcx
add    -0x28(%rbp),%rcx
add    $0x20,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <MULT32@plt>
mov    %rax,-0x8(%rbp)
jmp    1173 <VFLOAT_MULT+0x63>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VFLOAT_MULT>:
test   %rdi,%rdi
je     112d <VFLOAT_MULT+0x1d>
test   %rdx,%rdx
je     112d <VFLOAT_MULT+0x1d>
lea    (%rsi,%rcx,1),%rax
add    $0x20,%rax
mov    %rax,(%r8)
mov    %rdx,%rsi
jmp    1030 <MULT32@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @VFLOAT_MULT(i64 %0, i64 %1, i64 %2, i64 %3, i64* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64*
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64* %4, i64** %11
%12 = load i64, i64* %7
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %5
%15 = load i64, i64* %9
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i64, i64* %8
%19 = load i64, i64* %10
%20 = add nsw i64 %18, %19
%21 = add nsw i64 %20, 32
%22 = load i64*, i64** %11
store i64 %21, i64* %22
%23 = load i64, i64* %7
%24 = load i64, i64* %9
%25 = call i64 @MULT32(i64 %23, i64 %24)
store i64 %25, i64* %6
br label %27
26: ; preds = %14, %5
store i64 0, i64* %6
br label %27
27: ; preds = %26, %17
%28 = load i64, i64* %6
ret i64 %28
}

LLVM IR (-O2):
define i64 @VFLOAT_MULT(i64 %0, i64 %1, i64 %2, i64 %3, i64* nocapture writeonly %4) {
%6 = icmp ne i64 %0, 0
%7 = icmp ne i64 %2, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = add i64 %1, 32
%11 = add i64 %10, %3
store i64 %11, i64* %4
%12 = tail call i64 @MULT32(i64 %0, i64 %2)
br label %13
13: ; preds = %5, %9
%14 = phi i64 [ %12, %9 ], [ 0, %5 ]
ret i64 %14
}
/* Variables and functions */
int llib_str_len(char *);
int llib_led_utils_zlen(void *s) { return llib_str_len((char *)s); }


x86 assembly (clang, -O0):
<llib_led_utils_zlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <llib_str_len@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llib_led_utils_zlen>:
jmp    1030 <llib_str_len@plt>

LLVM IR (-O0):
define i32 @llib_led_utils_zlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @llib_str_len(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @llib_led_utils_zlen(i8* %0) {
%2 = tail call i32 @llib_str_len(i8* %0)
ret i32 %2
}
void EVP_PKEY_bits(void) {}


x86 assembly (clang, -O0):
<EVP_PKEY_bits>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_bits>:
ret

LLVM IR (-O0):
define void @EVP_PKEY_bits() {
ret void
}

LLVM IR (-O2):
define void @EVP_PKEY_bits() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
int fm_is_dir(const char *filename) {
  struct stat sb;
  if (!stat(filename, &sb)) {
    if (S_ISDIR(sb.st_mode)) {
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<fm_is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%eax
jne    1165 <fm_is_dir+0x45>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1160 <fm_is_dir+0x40>
movl   $0x1,-0x4(%rbp)
jmp    116c <fm_is_dir+0x4c>
jmp    1165 <fm_is_dir+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %eax,%eax
jne    1144 <fm_is_dir+0x24>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1144 <fm_is_dir+0x24>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fm_is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %16
14: ; preds = %8
br label %15
15: ; preds = %14, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fm_is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %13
}
int test00(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x == y;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    %esi,%edi
setne  %al
test   %edx,%edx
sete   %cl
xor    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test00(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @test00(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = icmp eq i32 %2, 0
%7 = xor i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, char const *, char const *);
void on_header(void *p, const char *name, const char *value) {
  printf("%p:name=\"%s\" value=\"%s\"\n", p, name, value);
}


x86 assembly (clang, -O0):
<on_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_header>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%p:name=\22%s\22 value=\22%s\22\0A\00"
define void @on_header(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%p:name=\22%s\22 value=\22%s\22\0A\00"
define void @on_header(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
float sqrt(int);
float norm(int x, int y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @norm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = call float @sqrt(i32 %11)
ret float %12
}

LLVM IR (-O2):
define float @norm(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
%6 = tail call float @sqrt(i32 %5)
ret float %6
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int L_shr(int, int);
int32_t L_shr_r(int32_t L_var1, int16_t var2) {
  int32_t L_var_out;
  if (var2 > 31) {
    L_var_out = 0;
  } else {
    L_var_out = L_shr(L_var1, var2);
    if (var2 > 0) {
      if ((L_var1 & ((int32_t)1 << (var2 - 1))) != 0) {
        L_var_out++;
      }
    }
  }
  return (L_var_out);
}


x86 assembly (clang, -O0):
<L_shr_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    1134 <L_shr_r+0x24>
movl   $0x0,-0xc(%rbp)
jmp    117c <L_shr_r+0x6c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <L_shr@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1177 <L_shr_r+0x67>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1172 <L_shr_r+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <L_shr_r+0x67>
jmp    117c <L_shr_r+0x6c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_shr_r>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
cmp    $0x1f,%esi
jg     1134 <L_shr_r+0x24>
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <L_shr@plt>
test   %ebp,%ebp
jle    1134 <L_shr_r+0x24>
add    $0xff,%bpl
mov    %ebp,%ecx
shr    %cl,%ebx
and    $0x1,%ebx
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @L_shr_r(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 31
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %5
br label %27
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @L_shr(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %9
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = shl i32 1, %18
%20 = and i32 %16, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %15
br label %26
26: ; preds = %25, %9
br label %27
27: ; preds = %26, %8
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @L_shr_r(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 31
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i32 @L_shr(i32 %0, i32 %1)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = add nsw i32 %1, -1
%9 = lshr i32 %0, %8
%10 = and i32 %9, 1
%11 = add nsw i32 %5, %10
br label %12
12: ; preds = %7, %2, %4
%13 = phi i32 [ %5, %4 ], [ 0, %2 ], [ %11, %7 ]
ret i32 %13
}
int test_imm_A2uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xa2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2uint64_lowword_mem>:
testb  $0xa2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A2uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 162
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_A2uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 162
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double log10(double);
double mag2db(double y) { return 20.0 * log10(y); }


x86 assembly (clang, -O0):
<mag2db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag2db>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mag2db(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double 2.000000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @mag2db(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, 2.000000e+01
ret double %3
}
void corerenderrender(void) {}


x86 assembly (clang, -O0):
<corerenderrender>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corerenderrender>:
ret

LLVM IR (-O0):
define void @corerenderrender() {
ret void
}

LLVM IR (-O2):
define void @corerenderrender() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t convert_wlan_state(uint8_t state) {
  switch (state) {
  case 0x51:
    return 0x11;
  case 0x92:
    return 0x22;
  }
  return 0xFF;
}


x86 assembly (clang, -O0):
<convert_wlan_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x51,%eax
je     112e <convert_wlan_state+0x2e>
jmp    111b <convert_wlan_state+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x92,%eax
je     113a <convert_wlan_state+0x3a>
jmp    1146 <convert_wlan_state+0x46>
movl   $0x11,-0x4(%rbp)
jmp    114d <convert_wlan_state+0x4d>
movl   $0x22,-0x4(%rbp)
jmp    114d <convert_wlan_state+0x4d>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_wlan_state>:
cmp    $0x92,%edi
mov    $0x22,%eax
mov    $0xff,%ecx
cmove  %eax,%ecx
cmp    $0x51,%edi
mov    $0x11,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @convert_wlan_state(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 81, label %5
i32 146, label %6
]
5: ; preds = %1
store i32 17, i32* %2
br label %8
6: ; preds = %1
store i32 34, i32* %2
br label %8
7: ; preds = %1
store i32 255, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @convert_wlan_state(i32 %0) {
%2 = icmp eq i32 %0, 146
%3 = select i1 %2, i32 34, i32 255
%4 = icmp eq i32 %0, 81
%5 = select i1 %4, i32 17, i32 %3
ret i32 %5
}
void i2d_ASN1_bytes(void) {}


x86 assembly (clang, -O0):
<i2d_ASN1_bytes>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ASN1_bytes>:
ret

LLVM IR (-O0):
define void @i2d_ASN1_bytes() {
ret void
}

LLVM IR (-O2):
define void @i2d_ASN1_bytes() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_dobldobl_one_homogenization(int lintype) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(892, &lintype, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_one_homogenization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x37c,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_one_homogenization>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x37c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_one_homogenization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 892, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_one_homogenization(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 892, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float price;
  printf("Enter the product price: ");
  scanf("%f", &price);
  printf("The total price of the product is: %.2f\n", price * 1.18);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
lea    0xecc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter the product price: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [41 x i8] c"The total price of the product is: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double %6, 1.180000e+00
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter the product price: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [41 x i8] c"The total price of the product is: %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.180000e+00
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ atoll(char *);
int /*<<< orphan*/ printf(char *, int);
void testAtoi() {
  char *str = "abc";
  int ret = atoi(str);
  atoll("11");
  printf("atoi = %d\n", ret);
}


x86 assembly (clang, -O0):
<testAtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
lea    0xeae(%rip),%rdi
call   1040 <atoll@plt>
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAtoi>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <atoi@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [3 x i8] c"11\00"
@.str.2 = [11 x i8] c"atoi = %d\0A\00"
define void @testAtoi() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @atoi(i8* %3)
store i32 %4, i32* %2
%5 = call i32 @atoll(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.2 = [11 x i8] c"atoi = %d\0A\00"
define void @testAtoi() {
%1 = tail call i32 @atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c() { printf("I am C\n"); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"I am C\0A\00"
define void @c() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"I am C\00"
define void @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void RTDirOpenFiltered(void) {}


x86 assembly (clang, -O0):
<RTDirOpenFiltered>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTDirOpenFiltered>:
ret

LLVM IR (-O0):
define void @RTDirOpenFiltered() {
ret void
}

LLVM IR (-O2):
define void @RTDirOpenFiltered() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void GPIO_writeMultiDio(uint32_t dioMask, uint32_t bitVectoredValue) {
  ;
  (*((volatile unsigned long *)(0x40022000 + 0x00000080))) =
      ((*((volatile unsigned long *)(0x40022000 + 0x00000080))) & ~dioMask) |
      (bitVectoredValue & dioMask);
}


x86 assembly (clang, -O0):
<GPIO_writeMultiDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40022080,%eax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
and    %rdx,%rax
or     %rax,%rcx
mov    $0x40022080,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_writeMultiDio>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    0x40022080,%rax
40
mov    -0x10(%rsp),%rcx
not    %rcx
and    %rax,%rcx
mov    -0x8(%rsp),%rax
and    -0x10(%rsp),%rax
or     %rcx,%rax
mov    %rax,0x40022080
40
ret

LLVM IR (-O0):
define void @GPIO_writeMultiDio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* inttoptr (i64 1073881216 to i64*)
%6 = load volatile i64, i64* %3
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %3
%11 = and i64 %9, %10
%12 = or i64 %8, %11
store volatile i64 %12, i64* inttoptr (i64 1073881216 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIO_writeMultiDio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* inttoptr (i64 1073881216 to i64*)
%6 = load volatile i64, i64* %3
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %3
%11 = and i64 %10, %9
%12 = or i64 %11, %8
store volatile i64 %12, i64* inttoptr (i64 1073881216 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_help(const char *extra) {
  fprintf(
      stderr,
      "mozzio - Disk benchmark - http://mozzio.org\nOptions:\n  -h           "
      "This help\n  -p path      Path to benchmark file or device (default: "
      "mozzio.bin)\n  -b blcksize  Block size in kB  (default: 4kB random, "
      "128kB sequential)\n  -s filesize  File/device size in GB  (default: "
      "10GB) (for seq write test)\n  -r runtime   Test run time in seconds "
      "(default: 30s (for all but seq write)\n  -t threads   Number of threads "
      "to use (default: 2 for seq, 128 for rand)\n    %s\n",
      extra);
  exit(1);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [458 x i8] c"mozzio - Disk benchmark - http://mozzio.org\0AOptions:\0A -h This help\0A -p path Path to benchmark file or device (default: mozzio.bin)\0A -b blcksize Block size in kB (default: 4kB random, 128kB sequential)\0A -s filesize File/device size in GB (default: 10GB) (for seq write test)\0A -r runtime Test run time in seconds (default: 30s (for all but seq write)\0A -t threads Number of threads to use (default: 2 for seq, 128 for rand)\0A %s\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [458 x i8] c"mozzio - Disk benchmark - http://mozzio.org\0AOptions:\0A -h This help\0A -p path Path to benchmark file or device (default: mozzio.bin)\0A -b blcksize Block size in kB (default: 4kB random, 128kB sequential)\0A -s filesize File/device size in GB (default: 10GB) (for seq write test)\0A -r runtime Test run time in seconds (default: 30s (for all but seq write)\0A -t threads Number of threads to use (default: 2 for seq, 128 for rand)\0A %s\0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([458 x i8], [458 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ atol(char *);
int atoi(char *nptr) { return (int)atol(nptr); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <atol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atol(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Test_addTable();
int /*<<< orphan*/ Test_getMaxValidValue();
int /*<<< orphan*/ Test_invalidFromStale();
int /*<<< orphan*/ printf(char *);
main() {
  printf("Testing neighbor_table.h\n");
  printf("********************\n");
  Test_addTable();
  printf("\n");
  Test_invalidFromStale();
  printf("\n");
  Test_getMaxValidValue();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <Test_addTable@plt>
lea    0xec4(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <Test_invalidFromStale@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <Test_getMaxValidValue@plt>
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1030 <Test_addTable@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1060 <Test_invalidFromStale@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1070 <Test_getMaxValidValue@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Testing neighbor_table.h\0A\00"
@.str.1 = [22 x i8] c"********************\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @Test_addTable()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @Test_invalidFromStale()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @Test_getMaxValidValue()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Testing neighbor_table.h\00"
@str.3 = [21 x i8] c"********************\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (...) @Test_addTable()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @Test_invalidFromStale()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @Test_getMaxValidValue()
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
void orr_2(int *a) {
  for (int i = 0; i < 1024; i++)
    a[i] |= 0x00ef0000;
}


x86 assembly (clang, -O0):
<orr_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    113e <orr_2+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0xef0000,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <orr_2+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<orr_2>:
xor    %eax,%eax
movaps 0xef7(%rip),%xmm0
nopl   0x0(%rax)
movups (%rdi,%rax,4),%xmm1
movups 0x10(%rdi,%rax,4),%xmm2
movups 0x20(%rdi,%rax,4),%xmm3
movups 0x30(%rdi,%rax,4),%xmm4
orps   %xmm0,%xmm1
orps   %xmm0,%xmm2
movups %xmm1,(%rdi,%rax,4)
movups %xmm2,0x10(%rdi,%rax,4)
orps   %xmm0,%xmm3
orps   %xmm0,%xmm4
movups %xmm3,0x20(%rdi,%rax,4)
movups %xmm4,0x30(%rdi,%rax,4)
add    $0x10,%rax
cmp    $0x400,%rax
jne    1110 <orr_2+0x10>
ret

LLVM IR (-O0):
define void @orr_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = or i32 %12, 15663104
store i32 %13, i32* %11
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @orr_2(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %25, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = getelementptr inbounds i32, i32* %4, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = or <4 x i32> %6, <i32 15663104, i32 15663104, i32 15663104, i32 15663104>
%11 = or <4 x i32> %9, <i32 15663104, i32 15663104, i32 15663104, i32 15663104>
%12 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %12
%13 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %13
%14 = or i64 %3, 8
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = bitcast i32* %15 to <4 x i32>*
%17 = load <4 x i32>, <4 x i32>* %16
%18 = getelementptr inbounds i32, i32* %15, i64 4
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = or <4 x i32> %17, <i32 15663104, i32 15663104, i32 15663104, i32 15663104>
%22 = or <4 x i32> %20, <i32 15663104, i32 15663104, i32 15663104, i32 15663104>
%23 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %23
%24 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %24
%25 = add nuw nsw i64 %3, 16
%26 = icmp eq i64 %25, 1024
br i1 %26, label %27, label %2
27: ; preds = %2
ret void
}
void defaulte() {}


x86 assembly (clang, -O0):
<defaulte>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaulte>:
ret

LLVM IR (-O0):
define void @defaulte() {
ret void
}

LLVM IR (-O2):
define void @defaulte() {
ret void
}
float maxfun(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maxfun>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <maxfun+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <maxfun+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxfun>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @maxfun(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @maxfun(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
char *my_strcpy(char *dest, char *src) {
  int i;
  i = 0;
  while (*(src + i) != '\0') {
    *(dest + i) = *(src + i);
    i++;
  }
  *(dest + i) = *(src + i);
  return (dest);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <my_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define i8* @my_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = load i8*, i8** %3
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
store i8 %31, i8* %35
%36 = load i8*, i8** %3
ret i8* %36
}

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ swap(char *, char *);
void reverse_word(char *begin, char *end) {
  for (; begin < end; ++begin, --end) {
    swap(begin, end);
  }
}


x86 assembly (clang, -O0):
<reverse_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <reverse_word+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <reverse_word+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_word>:
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
jae    1138 <reverse_word+0x28>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <swap@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
cmp    %r14,%rbx
jb     1120 <reverse_word+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @reverse_word(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %13, %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ult i8* %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @swap(i8* %10, i8* %11)
br label %13
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 -1
store i8* %17, i8** %4
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @reverse_word(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 @swap(i8* %6, i8* %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 -1
%10 = icmp ult i8* %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
int intMod(int lhs, int rhs) { return lhs - ((lhs / rhs) * rhs); }


x86 assembly (clang, -O0):
<intMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @intMod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}