xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void reboot(void) {
  *((unsigned short *)0x472) = 0x0;
  while (1) {
    outb(0xFE, 0x64);
    outb(0x02, 0xcf9);
    outb(0x04, 0xcf9);
    outb(0x0E, 0xcf9);
  }
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x472,%eax
movw   $0x0,(%rax)
mov    $0xfe,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0xe,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
jmp    111e <reboot+0xe>

x86 assembly (clang, -O2):
<reboot>:
push   %rax
movw   $0x0,0x472
nopl   0x0(%rax,%rax,1)
mov    $0xfe,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0xe,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
jmp    1120 <reboot+0x10>

LLVM IR (-O0):
define void @reboot() {
store i16 0, i16* inttoptr (i64 1138 to i16*)
br label %1
1: ; preds = %0, %1
%2 = call i32 @outb(i32 254, i32 100)
%3 = call i32 @outb(i32 2, i32 3321)
%4 = call i32 @outb(i32 4, i32 3321)
%5 = call i32 @outb(i32 14, i32 3321)
br label %1
}

LLVM IR (-O2):
define void @reboot() {
store i16 0, i16* inttoptr (i64 1138 to i16*)
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @outb(i32 254, i32 100)
%3 = tail call i32 @outb(i32 2, i32 3321)
%4 = tail call i32 @outb(i32 4, i32 3321)
%5 = tail call i32 @outb(i32 14, i32 3321)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ pass_floats(float);
void call_floats(float a, float b) { pass_floats(b); }


x86 assembly (clang, -O0):
<call_floats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <pass_floats@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_floats>:
movaps %xmm1,%xmm0
jmp    1030 <pass_floats@plt>

LLVM IR (-O0):
define void @call_floats(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call i32 @pass_floats(float %5)
ret void
}

LLVM IR (-O2):
define void @call_floats(float %0, float %1) {
%3 = tail call i32 @pass_floats(float %1)
ret void
}
/* Variables and functions */
bool FLOAT_AS_BOOL(float f) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
  return (f != 0.0f);
#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<FLOAT_AS_BOOL>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLOAT_AS_BOOL>:
xorps  %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @FLOAT_AS_BOOL(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp une float %3, 0.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @FLOAT_AS_BOOL(float %0) {
%2 = fcmp une float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *memchr(char const *, char, int);
int /*<<< orphan*/ printf(char *, char *, char, char *, char *);
int main(void) {
  const char *s = "This is a string";
  printf("%s\'%c\'%s\"%s\"\n", "The remainder of s after character ", 'r',
         " is found is ", memchr(s, 'r', 16));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x72,%esi
mov    $0x10,%edx
call   1040 <memchr@plt>
mov    %rax,%r8
lea    0xeba(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x72,%edx
lea    0xed9(%rip),%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x72,%esi
mov    $0x10,%edx
call   1040 <memchr@plt>
lea    0xed3(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xef7(%rip),%rcx
mov    $0x72,%edx
mov    %rax,%r8
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"This is a string\00"
@.str.1 = [14 x i8] c"%s'%c'%s\22%s\22\0A\00"
@.str.2 = [36 x i8] c"The remainder of s after character \00"
@.str.3 = [14 x i8] c" is found is \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @memchr(i8* %3, i8 signext 114, i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8 signext 114, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"This is a string\00"
@.str.1 = [14 x i8] c"%s'%c'%s\22%s\22\0A\00"
@.str.2 = [36 x i8] c"The remainder of s after character \00"
@.str.3 = [14 x i8] c" is found is \00"
define i32 @main() {
%1 = tail call i8* @memchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext 114, i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8 signext 114, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %1)
ret i32 0
}
unsigned int uihash(const char *str) {
  unsigned int hash = 5381;
  while (*str)
    hash = ((hash << 5) + hash) + (*str++);
  return hash;
}


x86 assembly (clang, -O0):
<uihash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <uihash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <uihash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uihash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <uihash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <uihash+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i32 @uihash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 5
%11 = load i32, i32* %3
%12 = add i32 %10, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = add i32 %12, %16
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @uihash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogStallDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000418))) &= ~(0x00000100);
}


x86 assembly (clang, -O0):
<WatchdogStallDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x418(%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    %rcx,0x418(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStallDisable>:
andq   $0xfffffffffffffeff,0x418(%rdi)
ff fe ff ff
ret

LLVM IR (-O0):
define void @WatchdogStallDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1048
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -257
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogStallDisable(i64 %0) {
%2 = add nsw i64 %0, 1048
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -257
store volatile i64 %5, i64* %3
ret void
}
unsigned st_g(unsigned *p) {
  *p = 42;
  return *p;
}


x86 assembly (clang, -O0):
<st_g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_g>:
movl   $0x2a,(%rdi)
mov    $0x2a,%eax
ret

LLVM IR (-O0):
define i32 @st_g(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 42, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @st_g(i32* nocapture writeonly %0) {
store i32 42, i32* %0
ret i32 42
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rsp_reg2(uint32_t address) { return (address & 0xffff) >> 2; }


x86 assembly (clang, -O0):
<rsp_reg2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsp_reg2>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3fff,%eax
ret

LLVM IR (-O0):
define i32 @rsp_reg2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @rsp_reg2(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 16383
ret i32 %3
}
int tree_find(int *tree, int size, int value) {
  int i;
  int temp;
  for (i = 0; i < size; ++i) {
    temp = tree[value];
    if (temp == -1)
      return value;
    value = temp;
  }
  return value;
}


x86 assembly (clang, -O0):
<tree_find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1158 <tree_find+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1144 <tree_find+0x44>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <tree_find+0x5e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <tree_find+0x15>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_find>:
test   %esi,%esi
jle    1125 <tree_find+0x25>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%eax
movslq %edx,%rcx
mov    (%rdi,%rcx,4),%edx
cmp    $0xffffffff,%edx
je     1124 <tree_find+0x24>
mov    %edx,%eax
add    $0xffffffff,%esi
jne    1110 <tree_find+0x10>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @tree_find(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %7, label %15
5: ; preds = %7
%6 = icmp eq i32 %14, %1
br i1 %6, label %15, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %14, %5 ], [ 0, %3 ]
%9 = phi i32 [ %12, %5 ], [ %2, %3 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
%14 = add nuw nsw i32 %8, 1
br i1 %13, label %15, label %5
15: ; preds = %7, %5, %3
%16 = phi i32 [ %2, %3 ], [ %12, %5 ], [ %9, %7 ]
ret i32 %16
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int gl_pathc;
};
typedef TYPE_1__ glob_t;

/* Variables and functions */
int octave_glob_num_matches(void *glob_info) {
  return glob_info ? ((glob_t *)glob_info)->gl_pathc : 0;
}


x86 assembly (clang, -O0):
<octave_glob_num_matches>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <octave_glob_num_matches+0x21>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <octave_glob_num_matches+0x2b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <octave_glob_num_matches+0x2b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_glob_num_matches>:
test   %rdi,%rdi
je     1108 <octave_glob_num_matches+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @octave_glob_num_matches(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load i32, i32* %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i32 [ %9, %5 ], [ 0, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @octave_glob_num_matches(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bitScan_fun_uint32_t(uint32_t x) {
  uint32_t r = 32;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bitScan_fun_uint32_t+0x2f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitScan_fun_uint32_t+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_uint32_t>:
mov    $0x20,%eax
test   %edi,%edi
je     111c <bitScan_fun_uint32_t+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitScan_fun_uint32_t+0x10>
ret

LLVM IR (-O0):
define i32 @bitScan_fun_uint32_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @bitScan_fun_uint32_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 32, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 32, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void Clear() { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @Clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void somar(float x, float y, float *r) { *r = x + y; }


x86 assembly (clang, -O0):
<somar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<somar>:
addss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @somar(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fadd float %7, %8
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @somar(float %0, float %1, float* nocapture writeonly %2) {
%4 = fadd float %0, %1
store float %4, float* %2
ret void
}
/* Variables and functions */
int exp(int);
double beta_m(const double V) { return 4. * exp((25. - V) / 18.); }


x86 assembly (clang, -O0):
<beta_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta_m>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @beta_m(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 2.500000e+01, %3
%5 = fdiv double %4, 1.800000e+01
%6 = fptosi double %5 to i32
%7 = call i32 @exp(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fmul double 4.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @beta_m(double %0) {
%2 = fsub double 2.500000e+01, %0
%3 = fdiv double %2, 1.800000e+01
%4 = fptosi double %3 to i32
%5 = tail call i32 @exp(i32 %4)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 4.000000e+00
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ copyString(char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
void testCopyString(void) { test(copyString("abcde"), "abcde"); }


x86 assembly (clang, -O0):
<testCopyString>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <copyString@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCopyString>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <copyString@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <test@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
define void @testCopyString() {
%1 = tail call i32 @copyString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
char *realloc(char *, size_t);
char *charrealloc(char *buffer, size_t len) {
  char *new_buffer;
  new_buffer = realloc(buffer, len);
  if (new_buffer == NULL) {
    perror(NULL);
    exit(EXIT_FAILURE);
  }
  return new_buffer;
}


x86 assembly (clang, -O0):
<charrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <charrealloc+0x43>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <charrealloc+0xd>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <perror@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @charrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i32* null)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @charrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i32* null)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __semihost(int, scalar_t__ *);
scalar_t__ strlen(char const *);
int semihost_open(const char *name, int openmode) {
  uint32_t args[3];
  args[0] = (uint32_t)name;
  args[1] = (uint32_t)openmode;
  args[2] = (uint32_t)strlen(name);
  return __semihost((0x1), args);
}


x86 assembly (clang, -O0):
<semihost_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x1,%edi
call   1040 <__semihost@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_open>:
sub    $0x18,%rsp
mov    %rdi,(%rsp)
movslq %esi,%rax
mov    %rax,0x8(%rsp)
call   1030 <strlen@plt>
mov    %rax,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <__semihost@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @semihost_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [3 x i64]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 1
store i64 %10, i64* %11
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 2
store i64 %13, i64* %14
%15 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%16 = call i32 @__semihost(i32 1, i64* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @semihost_open(i8* %0, i32 %1) {
%3 = alloca [3 x i64]
%4 = bitcast [3 x i64]* %3 to i8*
%5 = ptrtoint i8* %0 to i64
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
store i64 %5, i64* %6
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 1
store i64 %7, i64* %8
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 2
store i64 %9, i64* %10
%11 = call i32 @__semihost(i32 1, i64* %6)
ret i32 %11
}
void g_hook_compare_ids() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_compare_ids() {
ret void
}
void ADCComparatorRegionSet(unsigned long ulBase, unsigned long ulComp,
                            unsigned long ulLowRef, unsigned long ulHighRef) {
  ;
  ;
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000E40 + (ulComp * 4)))) =
      (ulHighRef << 16) | ulLowRef;
}


x86 assembly (clang, -O0):
<ADCComparatorRegionSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
shl    $0x10,%rcx
or     -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0xe40,%rax
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorRegionSet>:
shl    $0x10,%rcx
or     %rdx,%rcx
mov    %rcx,0xe40(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @ADCComparatorRegionSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = shl i64 %9, 16
%11 = load i64, i64* %7
%12 = or i64 %10, %11
%13 = load i64, i64* %5
%14 = add i64 %13, 3648
%15 = load i64, i64* %6
%16 = mul i64 %15, 4
%17 = add i64 %14, %16
%18 = inttoptr i64 %17 to i64*
store volatile i64 %12, i64* %18
ret void
}

LLVM IR (-O2):
define void @ADCComparatorRegionSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = shl i64 %3, 16
%6 = or i64 %5, %2
%7 = add i64 %0, 3648
%8 = shl i64 %1, 2
%9 = add i64 %7, %8
%10 = inttoptr i64 %9 to i64*
store volatile i64 %6, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Z_BEST_COMPRESSION;
int /*<<< orphan*/ png_write_palette_based2(char const *, unsigned char *,
                                            unsigned int, unsigned int, int,
                                            int /*<<< orphan*/);
void png_write_palette_based_2(const char *filename, unsigned char *data,
                               unsigned width, unsigned height) {
  png_write_palette_based2(filename, data, width, height, 256,
                           Z_BEST_COMPRESSION);
}


x86 assembly (clang, -O0):
<png_write_palette_based_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x2ead(%rip),%rax
mov    (%rax),%r9d
mov    $0x100,%r8d
call   1030 <png_write_palette_based2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<png_write_palette_based_2>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r9d
mov    $0x100,%r8d
jmp    1030 <png_write_palette_based2@plt>

LLVM IR (-O0):
@Z_BEST_COMPRESSION = global i32 0
define void @png_write_palette_based_2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* @Z_BEST_COMPRESSION
%14 = call i32 @png_write_palette_based2(i8* %9, i8* %10, i32 %11, i32 %12, i32 256, i32 %13)
ret void
}

LLVM IR (-O2):
@Z_BEST_COMPRESSION = global i32 0
define void @png_write_palette_based_2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @Z_BEST_COMPRESSION
%6 = tail call i32 @png_write_palette_based2(i8* %0, i8* %1, i32 %2, i32 %3, i32 256, i32 %5)
ret void
}
void foo623(int p) {}


x86 assembly (clang, -O0):
<foo623>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo623(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo623(i32 %0) {
ret void
}
void CA_Deinit() {}


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

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

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

LLVM IR (-O2):
define void @CA_Deinit() {
ret void
}
char *genxGetVersion() { return "beta5"; }


x86 assembly (clang, -O0):
<genxGetVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genxGetVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"beta5\00"
define i8* @genxGetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"beta5\00"
define i8* @genxGetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct stat {
  scalar_t__ st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
long nfile_mtime(const char *fname) {
  struct stat buf;
  if (stat(fname, &buf) != -1) {
    return (long)buf.st_mtime;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<nfile_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     113f <nfile_mtime+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <nfile_mtime+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfile_mtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1124 <nfile_mtime+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @nfile_mtime(i8* %0) {
%2 = alloca i64
%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, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
store i64 %10, i64* %2
br label %12
11: ; preds = %1
store i64 0, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @nfile_mtime(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, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 0, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *exe) {
  printf("%s <COMx|list> <scan|address [addess_type]>\n", exe);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"%s <COMx|list> <scan|address [addess_type]>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"%s <COMx|list> <scan|address [addess_type]>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct ebmb_node {
  int dummy;
};
struct eb_root {
  int dummy;
};

/* Variables and functions */
struct ebmb_node *__ebmb_insert(struct eb_root *, struct ebmb_node *,
                                unsigned int);
struct ebmb_node *ebmb_insert(struct eb_root *root, struct ebmb_node *new,
                              unsigned int len) {
  return __ebmb_insert(root, new, len);
}


x86 assembly (clang, -O0):
<ebmb_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__ebmb_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebmb_insert>:
jmp    1030 <__ebmb_insert@plt>

LLVM IR (-O0):
%struct.eb_root = type { i32 }
%struct.ebmb_node = type { i32 }
define %struct.ebmb_node* @ebmb_insert(%struct.eb_root* %0, %struct.ebmb_node* %1, i32 %2) {
%4 = alloca %struct.eb_root*
%5 = alloca %struct.ebmb_node*
%6 = alloca i32
store %struct.eb_root* %0, %struct.eb_root** %4
store %struct.ebmb_node* %1, %struct.ebmb_node** %5
store i32 %2, i32* %6
%7 = load %struct.eb_root*, %struct.eb_root** %4
%8 = load %struct.ebmb_node*, %struct.ebmb_node** %5
%9 = load i32, i32* %6
%10 = call %struct.ebmb_node* @__ebmb_insert(%struct.eb_root* %7, %struct.ebmb_node* %8, i32 %9)
ret %struct.ebmb_node* %10
}

LLVM IR (-O2):
%struct.eb_root = type { i32 }
%struct.ebmb_node = type { i32 }
define %struct.ebmb_node* @ebmb_insert(%struct.eb_root* %0, %struct.ebmb_node* %1, i32 %2) {
%4 = tail call %struct.ebmb_node* @__ebmb_insert(%struct.eb_root* %0, %struct.ebmb_node* %1, i32 %2)
ret %struct.ebmb_node* %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_lte_str_fn(const char *a, const char *b) {
  return strcmp(a, b) <= 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<prv_lte_str_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovle %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_lte_str_fn>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_lte_str_fn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp sle i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_lte_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int freq2freqbin(float, int, int);
int deltak_splitenum(float fs, int fft_len, int *splnum1, int *splnum2) {
  int freqbin1, freqbin2;
  freqbin1 = freq2freqbin(fs, fft_len, 5500);
  freqbin2 = freq2freqbin(fs, fft_len, 11000);
  *splnum1 = freqbin1;
  *splnum2 = freqbin2;
  return 0;
}


x86 assembly (clang, -O0):
<deltak_splitenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    $0x157c,%esi
call   1030 <freq2freqbin@plt>
mov    %eax,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    $0x2af8,%esi
call   1030 <freq2freqbin@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deltak_splitenum>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
movss  %xmm0,0x4(%rsp)
mov    $0x157c,%esi
call   1030 <freq2freqbin@plt>
mov    %eax,%ebx
movss  0x4(%rsp),%xmm0
mov    %ebp,%edi
mov    $0x2af8,%esi
call   1030 <freq2freqbin@plt>
mov    %ebx,(%r15)
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @deltak_splitenum(float %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store float %0, float* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load float, float* %5
%12 = load i32, i32* %6
%13 = call i32 @freq2freqbin(float %11, i32 %12, i32 5500)
store i32 %13, i32* %9
%14 = load float, float* %5
%15 = load i32, i32* %6
%16 = call i32 @freq2freqbin(float %14, i32 %15, i32 11000)
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i32, i32* %10
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @deltak_splitenum(float %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @freq2freqbin(float %0, i32 %1, i32 5500)
%6 = tail call i32 @freq2freqbin(float %0, i32 %1, i32 11000)
store i32 %5, i32* %2
store i32 %6, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execSysCall(int, int, int, int /*<<< orphan*/);
void read_music(int *score) {
  int i;
  for (i = 0; score[i] != -1;) {
    execSysCall(0x0C80, score[i++], score[i++], 0);
  }
}


x86 assembly (clang, -O0):
<read_music>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1170 <read_music+0x60>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    $0xc80,%edi
xor    %ecx,%ecx
call   1030 <execSysCall@plt>
jmp    1123 <read_music+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_music>:
push   %rbx
mov    (%rdi),%esi
cmp    $0xffffffff,%esi
je     113a <read_music+0x2a>
mov    %rdi,%rbx
add    $0x8,%rbx
nop
mov    -0x4(%rbx),%edx
mov    $0xc80,%edi
xor    %ecx,%ecx
call   1030 <execSysCall@plt>
mov    (%rbx),%esi
add    $0x8,%rbx
cmp    $0xffffffff,%esi
jne    1120 <read_music+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @read_music(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %25
11: ; preds = %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @execSysCall(i32 3200, i32 %17, i32 %23, i32 0)
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @read_music(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %13, %4 ], [ %2, %1 ]
%7 = or i64 %5, 1
%8 = add nuw i64 %5, 2
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 @execSysCall(i32 3200, i32 %6, i32 %10, i32 0)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret void
}
void g_type_module_set_name() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_set_name() {
ret void
}
/* Type definitions */
struct video_output_stats {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ video_thread_get_stats(struct video_output_stats *);
void stream_video_stats(struct video_output_stats *s) {
  video_thread_get_stats(s);
}


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

x86 assembly (clang, -O2):
<stream_video_stats>:
jmp    1030 <video_thread_get_stats@plt>

LLVM IR (-O0):
%struct.video_output_stats = type { i32 }
define void @stream_video_stats(%struct.video_output_stats* %0) {
%2 = alloca %struct.video_output_stats*
store %struct.video_output_stats* %0, %struct.video_output_stats** %2
%3 = load %struct.video_output_stats*, %struct.video_output_stats** %2
%4 = call i32 @video_thread_get_stats(%struct.video_output_stats* %3)
ret void
}

LLVM IR (-O2):
%struct.video_output_stats = type { i32 }
define void @stream_video_stats(%struct.video_output_stats* %0) {
%2 = tail call i32 @video_thread_get_stats(%struct.video_output_stats* %0)
ret void
}
int f() {
  int x = 1;
  if (x > 0) {
    x += 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111e <f+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @f() {
ret i32 2
}
int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev) { return 0; }


x86 assembly (clang, -O0):
<ad7298_register_ring_funcs_and_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ad7298_register_ring_funcs_and_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @ad7298_register_ring_funcs_and_init(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ad7298_register_ring_funcs_and_init(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
signed long int readlinkat(signed int __fd, const char *restrict __path,
                           char *restrict __buf, unsigned long int __len) {
  signed long int return_value___readlinkat_chk$1;
  signed long int return_value___readlinkat_chk_warn$2;
  signed long int return_value___readlinkat_alias$3;
  return_value___readlinkat_alias$3 =
      __readlinkat_alias(__fd, __path, __buf, __len);
  return return_value___readlinkat_alias$3;
}


x86 assembly (clang, -O0):
<readlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <__readlinkat_alias@plt>
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlinkat>:
push   %rax
xor    %eax,%eax
call   1030 <__readlinkat_alias@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @readlinkat(i32 %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = call i32 (i32, i8*, i8*, i64, ...) bitcast (i32 (...)* @__readlinkat_alias to i32 (i32, i8*, i8*, i64, ...)*)(i32 %12, i8* %13, i8* %14, i64 %15)
%17 = sext i32 %16 to i64
store i64 %17, i64* %11
%18 = load i64, i64* %11
ret i64 %18
}

LLVM IR (-O2):
define i64 @readlinkat(i32 %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = tail call i32 (i32, i8*, i8*, i64, ...) bitcast (i32 (...)* @__readlinkat_alias to i32 (i32, i8*, i8*, i64, ...)*)(i32 %0, i8* %1, i8* %2, i64 %3)
%6 = sext i32 %5 to i64
ret i64 %6
}
void VecAdd3iv(int v[3], const int a[3], const int b[3]) {
  v[0] = a[0] + b[0];
  v[1] = a[1] + b[1];
  v[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<VecAdd3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
add    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecAdd3iv>:
mov    (%rdx),%eax
add    (%rsi),%eax
mov    %eax,(%rdi)
mov    0x4(%rdx),%eax
add    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    0x8(%rdx),%eax
add    0x8(%rsi),%eax
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VecAdd3iv(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = add nsw i32 %18, %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 1
store i32 %22, i32* %24
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 2
%27 = load i32, i32* %26
%28 = load i32*, i32** %6
%29 = getelementptr inbounds i32, i32* %28, i64 2
%30 = load i32, i32* %29
%31 = add nsw i32 %27, %30
%32 = load i32*, i32** %4
%33 = getelementptr inbounds i32, i32* %32, i64 2
store i32 %31, i32* %33
ret void
}

LLVM IR (-O2):
define void @VecAdd3iv(i32* nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
store i32 %6, i32* %0
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %2, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %1, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %2, i64 2
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %14
%18 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %17, i32* %18
ret void
}