xunge/DecIR huggingface dataset:
const char *loader_BIN_get_name(void) {
  return "loader for binary tape files (block size 130 bytes)";
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"loader for binary tape files (block size 130 bytes)\00"
define i8* @loader_BIN_get_name() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [52 x i8] c"loader for binary tape files (block size 130 bytes)\00"
define i8* @loader_BIN_get_name() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int loop() {
  int i, j = 0;
  for (i = 0; i < 10; ++i) {
    j += i;
  }
  printf("j = %d\n", j);
  for (j = 0; j < 10; ++j) {
    i += j * 2;
  }
  printf("i = %d\n", i);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1147 <loop+0x37>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <loop+0x16>
mov    -0xc(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1181 <loop+0x71>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <loop+0x4d>
mov    -0x8(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2d,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x64,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"j = %d\0A\00"
@.str.1 = [8 x i8] c"i = %d\0A\00"
define i32 @loop() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %15)
store i32 0, i32* %3
br label %17
17: ; preds = %25, %14
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, 2
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
store i32 %24, i32* %2
br label %25
25: ; preds = %20
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %17
28: ; preds = %17
%29 = load i32, i32* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [8 x i8] c"j = %d\0A\00"
@.str.1 = [8 x i8] c"i = %d\0A\00"
define i32 @loop() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 45)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 100)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int close(int);
int fsync(int);
int posix_sync_and_close(int fd) {
  int ret;
  ret = fsync(fd);
  assert(ret == 0);
  ret = close(fd);
  assert(ret == 0);
  return ret;
}


x86 assembly (clang, -O0):
<posix_sync_and_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <fsync@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_sync_and_close>:
push   %rbx
mov    %edi,%ebx
call   1050 <fsync@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @posix_sync_and_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fsync(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @posix_sync_and_close(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @close(i32 %0)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int inversions_count(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[] = {1, 2, 7, 6, 8, 9, 1, 2};
  int n = sizeof(array) / sizeof(array[0]);
  printf("%d", inversions_count(array, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <inversions_count@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <inversions_count@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 1, i32 2, i32 7, i32 6, i32 8, i32 9, i32 1, i32 2]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @inversions_count(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 1, i32 2, i32 7, i32 6, i32 8, i32 9, i32 1, i32 2]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @inversions_count(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct wf_mtllib {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wf_free_mtllib(struct wf_mtllib const *mtllib) { free((void *)mtllib); }


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

x86 assembly (clang, -O2):
<wf_free_mtllib>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.wf_mtllib = type { i32 }
define void @wf_free_mtllib(%struct.wf_mtllib* %0) {
%2 = alloca %struct.wf_mtllib*
store %struct.wf_mtllib* %0, %struct.wf_mtllib** %2
%3 = load %struct.wf_mtllib*, %struct.wf_mtllib** %2
%4 = bitcast %struct.wf_mtllib* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.wf_mtllib = type { i32 }
define void @wf_free_mtllib(%struct.wf_mtllib* nocapture %0) {
%2 = bitcast %struct.wf_mtllib* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
void kolibri_download_done(struct gui_download_window *dw) {}


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

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

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

LLVM IR (-O2):
%struct.gui_download_window = type opaque
define void @kolibri_download_done(%struct.gui_download_window* nocapture %0) {
ret void
}
/* Type definitions */
struct i2c_client {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int i2c_smbus_write_byte_data(struct i2c_client *, unsigned char,
                              unsigned char);
struct i2c_client *to_i2c_client(struct device *);
int adxl34x_smbus_write(struct device *dev, unsigned char reg,
                        unsigned char val) {
  struct i2c_client *client = to_i2c_client(dev);
  return i2c_smbus_write_byte_data(client, reg, val);
}


x86 assembly (clang, -O0):
<adxl34x_smbus_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <to_i2c_client@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x9(%rbp),%al
movzbl %al,%esi
movzbl -0xa(%rbp),%edx
call   1040 <i2c_smbus_write_byte_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxl34x_smbus_write>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <to_i2c_client@plt>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <i2c_smbus_write_byte_data@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @adxl34x_smbus_write(%struct.device* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca %struct.device*
%5 = alloca i8
%6 = alloca i8
%7 = alloca %struct.i2c_client*
store %struct.device* %0, %struct.device** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load %struct.device*, %struct.device** %4
%9 = call %struct.i2c_client* @to_i2c_client(%struct.device* %8)
store %struct.i2c_client* %9, %struct.i2c_client** %7
%10 = load %struct.i2c_client*, %struct.i2c_client** %7
%11 = load i8, i8* %5
%12 = load i8, i8* %6
%13 = call i32 @i2c_smbus_write_byte_data(%struct.i2c_client* %10, i8 zeroext %11, i8 zeroext %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @adxl34x_smbus_write(%struct.device* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call %struct.i2c_client* @to_i2c_client(%struct.device* %0)
%5 = tail call i32 @i2c_smbus_write_byte_data(%struct.i2c_client* %4, i8 zeroext %1, i8 zeroext %2)
ret i32 %5
}
/* Variables and functions */
scalar_t__ genrand_real1();
int pow(scalar_t__, double);
int tri_inv_randint(int a, int b) {
  return (int)(b - pow(1 - genrand_real1(), 0.5) * (b - a));
}


x86 assembly (clang, -O0):
<tri_inv_randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <genrand_real1@plt>
mov    $0x1,%edi
sub    %rax,%rdi
movsd  0xeb5(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tri_inv_randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <genrand_real1@plt>
mov    $0x1,%edi
sub    %rax,%rdi
movsd  0xec2(%rip),%xmm0
call   1030 <pow@plt>
sub    %ebx,%ebp
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tri_inv_randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 (...) @genrand_real1()
%7 = sub nsw i64 1, %6
%8 = call i32 @pow(i64 %7, double 5.000000e-01)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = mul nsw i32 %8, %11
%13 = sub nsw i32 %5, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @tri_inv_randint(i32 %0, i32 %1) {
%3 = tail call i64 (...) @genrand_real1()
%4 = sub nsw i64 1, %3
%5 = tail call i32 @pow(i64 %4, double 5.000000e-01)
%6 = sub i32 %0, %1
%7 = mul i32 %5, %6
%8 = add i32 %7, %1
ret i32 %8
}
void strength_result1(int *data) {
  int i = 0;
  do {
    data[data[2]] = 2;
    i = i + 21;
  } while (i < data[1]);
}


x86 assembly (clang, -O0):
<strength_result1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jl     110f <strength_result1+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
add    $0x15,%eax
cmp    0x4(%rdi),%eax
jl     1110 <strength_result1+0x10>
ret

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

LLVM IR (-O2):
define void @strength_result1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = getelementptr inbounds i32, i32* %0, i64 1
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %9, %4 ]
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 2, i32* %8
%9 = add nuw nsw i32 %5, 21
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zmalloc_free(void *ptr) {
  if (ptr && (ptr != (void *)"")) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<zmalloc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <zmalloc_free+0x31>
lea    0xed2(%rip),%rax
cmp    %rax,-0x8(%rbp)
je     1141 <zmalloc_free+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmalloc_free>:
test   %rdi,%rdi
je     1126 <zmalloc_free+0x16>
lea    0xee4(%rip),%rax
cmp    %rax,%rdi
je     1126 <zmalloc_free+0x16>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @zmalloc_free(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 %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @zmalloc_free(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = icmp ne i8* %0, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%4 = and i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double pow(double, double);
double position_to_gain(double pos) {
  if (pos == 0.0) {
    return 0.0;
  }
  return exp(((pow(pos, 1.0 / 8.0) * 198.0) - 192.0) / 6.0 * log(2.0));
}


x86 assembly (clang, -O0):
<position_to_gain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1162 <position_to_gain+0x32>
jp     1162 <position_to_gain+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c0 <position_to_gain+0x90>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
call   1050 <pow@plt>
movsd  0xe94(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe5b(%rip),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<position_to_gain>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <position_to_gain+0x11>
jp     1131 <position_to_gain+0x11>
xorpd  %xmm0,%xmm0
ret
push   %rax
movsd  0xec6(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xec1(%rip),%xmm0
addsd  0xec1(%rip),%xmm0
divsd  0xec1(%rip),%xmm0
mulsd  0xec1(%rip),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @position_to_gain(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @pow(double %8, double 1.250000e-01)
%10 = call double @llvm.fmuladd.f64(double %9, double 1.980000e+02, double -1.920000e+02)
%11 = fdiv double %10, 6.000000e+00
%12 = call double @log(double 2.000000e+00)
%13 = fmul double %11, %12
%14 = call double @exp(double %13)
store double %14, double* %2
br label %15
15: ; preds = %7, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @position_to_gain(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 1.250000e-01)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.980000e+02, double -1.920000e+02)
%6 = fdiv double %5, 6.000000e+00
%7 = fmul double %6, 0x3FE62E42FEFA39EF
%8 = tail call double @exp(double %7)
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 0.000000e+00, %1 ]
ret double %10
}
unsigned long ADCDataInjectedGet(unsigned long ulBase,
                                 unsigned long ulChannel) {
  unsigned long ulReturn = 0;
  ;
  ;
  ulReturn = (*(
      (volatile unsigned long *)(ulBase + 0x0000003C + (ulChannel - 1) * 4)));
  return ulReturn;
}


x86 assembly (clang, -O0):
<ADCDataInjectedGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3c,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDataInjectedGet>:
mov    0x38(%rdi,%rsi,4),%rax
ret

LLVM IR (-O0):
define i64 @ADCDataInjectedGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 60
%8 = load i64, i64* %4
%9 = sub i64 %8, 1
%10 = mul i64 %9, 4
%11 = add i64 %7, %10
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @ADCDataInjectedGet(i64 %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = add i64 %0, 56
%5 = add i64 %4, %3
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int increase_cseq(char *, char *);
int /*<<< orphan*/ new_branch(char *);
int new_transaction(char *message, char *reply) {
  new_branch(message);
  return increase_cseq(message, reply);
}


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

x86 assembly (clang, -O2):
<new_transaction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <new_branch@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <increase_cseq@plt>

LLVM IR (-O0):
define i32 @new_transaction(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 = call i32 @new_branch(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @increase_cseq(i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @new_transaction(i8* %0, i8* %1) {
%3 = tail call i32 @new_branch(i8* %0)
%4 = tail call i32 @increase_cseq(i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
main(int argc, char *argv[]) {
  int arg;
  if (argc > 1)
    arg = (int)strtol(argv[1], NULL, 10);
  else
    arg = 0;
  return (arg);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
jmp    1155 <main+0x45>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     112c <main+0x1c>
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strtol(i8* nocapture %6, i32* null, i32 10)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
struct szl_stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ szl_stream_close(struct szl_stream *);
__attribute__((nonnull(1))) void szl_stream_del(void *priv) {
  szl_stream_close((struct szl_stream *)priv);
  free(priv);
}


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

x86 assembly (clang, -O2):
<szl_stream_del>:
push   %rbx
mov    %rdi,%rbx
call   1040 <szl_stream_close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.szl_stream = type { i32 }
define void @szl_stream_del(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.szl_stream*
%5 = call i32 @szl_stream_close(%struct.szl_stream* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
%struct.szl_stream = type { i32 }
define void @szl_stream_del(i8* %0) {
%2 = bitcast i8* %0 to %struct.szl_stream*
%3 = tail call i32 @szl_stream_close(%struct.szl_stream* %2)
%4 = tail call i32 @free(i8* %0)
ret void
}
void fn_pat_1(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_pat_1() {
ret void
}
void SDIO_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @SDIO_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_at_end_of_proc_good_local_var() {
  int a = 57;
  exit(5);
}


x86 assembly (clang, -O0):
<exit_at_end_of_proc_good_local_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x39,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_at_end_of_proc_good_local_var>:
push   %rax
mov    $0x5,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_at_end_of_proc_good_local_var() {
%1 = alloca i32
store i32 57, i32* %1
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define void @exit_at_end_of_proc_good_local_var() {
%1 = tail call i32 @exit(i32 5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int do_dh_print(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int,
                int /*<<< orphan*/ *, int /*<<< orphan*/);
int DHparams_print(BIO *bp, const DH *x) {
  return do_dh_print(bp, x, 4, NULL, 0);
}


x86 assembly (clang, -O0):
<DHparams_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <do_dh_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DHparams_print>:
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <do_dh_print@plt>

LLVM IR (-O0):
define i32 @DHparams_print(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** %4
%7 = call i32 @do_dh_print(i32* %5, i32* %6, i32 4, i32* null, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @DHparams_print(i32* %0, i32* %1) {
%3 = tail call i32 @do_dh_print(i32* %0, i32* %1, i32 4, i32* null, i32 0)
ret i32 %3
}
void i2d_PKEY_USAGE_PERIOD(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKEY_USAGE_PERIOD() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void assertion_failure(char *message) {
  fprintf(stderr, "%s\n", message);
  exit(2);
}


x86 assembly (clang, -O0):
<assertion_failure>:
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    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @assertion_failure(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @assertion_failure(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ I2C_read_nonblock(int, int, unsigned char *, int);
int I2C_wait(int);
int I2C_read(int mask, int i2c_addr, unsigned char *p, int len) {
  I2C_read_nonblock(mask, i2c_addr, p, len);
  return I2C_wait(mask);
}


x86 assembly (clang, -O0):
<I2C_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <I2C_read_nonblock@plt>
mov    -0x4(%rbp),%edi
call   1030 <I2C_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_read>:
push   %rbx
mov    %edi,%ebx
call   1040 <I2C_read_nonblock@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <I2C_wait@plt>

LLVM IR (-O0):
define i32 @I2C_read(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @I2C_read_nonblock(i32 %9, i32 %10, i8* %11, i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @I2C_wait(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @I2C_read(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @I2C_read_nonblock(i32 %0, i32 %1, i8* %2, i32 %3)
%6 = tail call i32 @I2C_wait(i32 %0)
ret i32 %6
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t size = 0;
  while (str[size++] != '\0')
    ;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1135 <strlen+0x35>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeader() {
  printf("------------------------------------\n");
  printf("        smbusb_r2j240flasher\n");
  printf("------------------------------------\n");
}


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

x86 assembly (clang, -O2):
<printHeader>:
push   %rbx
lea    0xf05(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str.2 = [29 x i8] c" smbusb_r2j240flasher\00"
@str.3 = [37 x i8] c"------------------------------------\00"
define void @printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
ret void
}
long long llrintf(float x) {
  long long retval;
  __asm__ __volatile__("fistpll %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<llrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
flds   -0x14(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintf>:
movss  %xmm0,-0xc(%rsp)
flds   -0xc(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
void leds_init(void) {
  (*(volatile unsigned long *)0x10008800) &=
      ~((0xf << (4 * 4)) + (0xf << (5 * 4)) + (0xf << (6 * 4)) +
        (0xf << (7 * 4)));
  (*(volatile unsigned long *)0x10008800) |=
      ((1 << (4 * 4)) + (1 << (5 * 4)) + (1 << (6 * 4)) + (1 << (7 * 4)));
}


x86 assembly (clang, -O0):
<leds_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10008800,%eax
mov    (%rax),%rcx
and    $0xffff,%rcx
mov    $0x10008800,%eax
mov    %rcx,(%rax)
mov    $0x10008800,%eax
mov    (%rax),%rcx
or     $0x11110000,%rcx
mov    $0x10008800,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<leds_init>:
andq   $0xffff,0x10008800
orq    $0x11110000,0x10008800
ret

LLVM IR (-O0):
define void @leds_init() {
%1 = load volatile i64, i64* inttoptr (i64 268470272 to i64*)
%2 = and i64 %1, 65535
store volatile i64 %2, i64* inttoptr (i64 268470272 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 268470272 to i64*)
%4 = or i64 %3, 286326784
store volatile i64 %4, i64* inttoptr (i64 268470272 to i64*)
ret void
}

LLVM IR (-O2):
define void @leds_init() {
%1 = load volatile i64, i64* inttoptr (i64 268470272 to i64*)
%2 = and i64 %1, 65535
store volatile i64 %2, i64* inttoptr (i64 268470272 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 268470272 to i64*)
%4 = or i64 %3, 286326784
store volatile i64 %4, i64* inttoptr (i64 268470272 to i64*)
ret void
}
void deactive_exception() { __asm__ __volatile__(".word 0x0000025B;" : : :); }


x86 assembly (clang, -O0):
<deactive_exception>:
push   %rbp
mov    %rsp,%rbp
pop    %rbx
add    -0x3d(%rbp),%bl

x86 assembly (clang, -O2):
<deactive_exception>:
pop    %rbx
add    %bl,%al

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

LLVM IR (-O2):
define void @deactive_exception() {
tail call void asm sideeffect ".word 0x0000025B;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void wlog_TextMessage_dummy() {}


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

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

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

LLVM IR (-O2):
define void @wlog_TextMessage_dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char buf[8];
  gets(buf);
  puts(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x18(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @puts(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void *malloc(int);
void *realloc(void *, int);
int main(void) {
  void *p;
  void *r;
  p = malloc(1);
  assert(p != NULL);
  r = realloc(p, -1);
  assert(r == NULL);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
call   1060 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1060 <realloc@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %2
%10 = call i8* @realloc(i8* %9, i32 -1)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = icmp ne i8* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @realloc(i8* %1, i32 -1)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int gmx_fio_open(char *, char *);
int open_xtc(char *fn, char *mode) { return gmx_fio_open(fn, mode); }


x86 assembly (clang, -O0):
<open_xtc>:
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 <gmx_fio_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_xtc>:
jmp    1030 <gmx_fio_open@plt>

LLVM IR (-O0):
define i32 @open_xtc(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 i32 @gmx_fio_open(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @open_xtc(i8* %0, i8* %1) {
%3 = tail call i32 @gmx_fio_open(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int CLAMP(int, int, int);
char *_ulltoa_internal(unsigned long long, char *, int /*<<< orphan*/);
char *ulltoa(unsigned long long value, char *str, int base) {
  base = CLAMP(base, 2, 32);
  return _ulltoa_internal(value, str, (uint)base);
}


x86 assembly (clang, -O0):
<ulltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <CLAMP@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <_ulltoa_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulltoa>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <CLAMP@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_ulltoa_internal@plt>

LLVM IR (-O0):
define i8* @ulltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @CLAMP(i32 %7, i32 2, i32 32)
store i32 %8, i32* %6
%9 = load i64, i64* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i8* @_ulltoa_internal(i64 %9, i8* %10, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @ulltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 @CLAMP(i32 %2, i32 2, i32 32)
%5 = tail call i8* @_ulltoa_internal(i64 %0, i8* %1, i32 %4)
ret i8* %5
}
/* Variables and functions */
int Check_CPU_support_AES();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("CPU ID - CPU support AES: %x\n", Check_CPU_support_AES());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Check_CPU_support_AES@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Check_CPU_support_AES@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"CPU ID - CPU support AES: %x\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Check_CPU_support_AES()
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"CPU ID - CPU support AES: %x\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @Check_CPU_support_AES()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DisconnectKeyCodes(int /*<<< orphan*/);
int /*<<< orphan*/ MyMouseButtonSet(int /*<<< orphan*/);
void MyEvtQTryRecoverFromFull(void) {
  MyMouseButtonSet(0);
  DisconnectKeyCodes(0);
}


x86 assembly (clang, -O0):
<MyEvtQTryRecoverFromFull>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <MyMouseButtonSet@plt>
xor    %edi,%edi
call   1040 <DisconnectKeyCodes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyEvtQTryRecoverFromFull>:
push   %rax
xor    %edi,%edi
call   1030 <MyMouseButtonSet@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <DisconnectKeyCodes@plt>

LLVM IR (-O0):
define void @MyEvtQTryRecoverFromFull() {
%1 = call i32 @MyMouseButtonSet(i32 0)
%2 = call i32 @DisconnectKeyCodes(i32 0)
ret void
}

LLVM IR (-O2):
define void @MyEvtQTryRecoverFromFull() {
%1 = tail call i32 @MyMouseButtonSet(i32 0)
%2 = tail call i32 @DisconnectKeyCodes(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetInfo(int *, int *);
int GetNumStates() {
  int num_atoms, num_states;
  GetInfo(&num_atoms, &num_states);
  return num_states;
}


x86 assembly (clang, -O0):
<GetNumStates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <GetInfo@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNumStates>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <GetInfo@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GetNumStates() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @GetInfo(i32* %1, i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @GetNumStates() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @GetInfo(i32* %1, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ xmon_printf(char *, unsigned long);
int print_insn_spu(unsigned long insn, unsigned long memaddr) {
  xmon_printf("%.8x", insn);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_insn_spu>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <xmon_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.8x\00"
define i32 @print_insn_spu(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @xmon_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.8x\00"
define i32 @print_insn_spu(i64 %0, i64 %1) {
%3 = tail call i32 @xmon_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 0
}