xunge/DecIR huggingface dataset:
struct my_struct *return_my_struct_ptr() {
  return (struct my_struct *)1234;
}


x86 assembly (clang, -O0):
<return_my_struct_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.my_struct = type opaque
define %struct.my_struct* @return_my_struct_ptr() {
ret %struct.my_struct* inttoptr (i64 1234 to %struct.my_struct*)
}

LLVM IR (-O2):
%struct.my_struct = type opaque
define %struct.my_struct* @return_my_struct_ptr() {
ret %struct.my_struct* inttoptr (i64 1234 to %struct.my_struct*)
}
/* Variables and functions */
int /*<<< orphan*/ iowrite32(unsigned int, void *);
int /*<<< orphan*/ mb();
void COM_WriteReg32(unsigned int addr, unsigned int Val) {
  iowrite32(Val, (void *)addr);
  mb();
}


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

x86 assembly (clang, -O2):
<COM_WriteReg32>:
push   %rax
mov    %esi,%eax
mov    %edi,%esi
mov    %eax,%edi
call   1040 <iowrite32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mb@plt>

LLVM IR (-O0):
define void @COM_WriteReg32(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 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @iowrite32(i32 %5, i8* %8)
%10 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @COM_WriteReg32(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @iowrite32(i32 %1, i8* %4)
%6 = tail call i32 (...) @mb()
ret void
}
struct A *calc() {
  return (struct A *)0;
}


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

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

LLVM IR (-O0):
%struct.A = type opaque
define %struct.A* @calc() {
ret %struct.A* null
}

LLVM IR (-O2):
%struct.A = type opaque
define noalias %struct.A* @calc() {
ret %struct.A* null
}
main() {
  for (int i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void __mp_trap(void) {}


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

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

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

LLVM IR (-O2):
define void @__mp_trap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __elsa_checkType(int, int);
void f(int x) {
  int i, j, k;
  __elsa_checkType(x ? i : j, k);
  __elsa_checkType(x ? (i + 1) : j, 1);
  __elsa_checkType(x ? i : (j + 1), 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <f+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <f+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <__elsa_checkType@plt>
cmpl   $0x0,-0x4(%rbp)
je     1159 <f+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115f <f+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x1,%esi
call   1030 <__elsa_checkType@plt>
cmpl   $0x0,-0x4(%rbp)
je     1181 <f+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    118a <f+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <__elsa_checkType@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <__elsa_checkType@plt>
mov    $0x1,%esi
call   1030 <__elsa_checkType@plt>
mov    $0x1,%esi
pop    %rax
jmp    1030 <__elsa_checkType@plt>

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

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = tail call i32 @__elsa_checkType(i32 undef, i32 undef)
%3 = tail call i32 @__elsa_checkType(i32 undef, i32 1)
%4 = tail call i32 @__elsa_checkType(i32 undef, i32 1)
ret void
}
/* Variables and functions */
int a_function(int, int);
int /*<<< orphan*/ printf(char *, int);
void test(void) {
  printf("once: %d\n", a_function(2, 9));
  printf("twice: %d\n", a_function(-6, 1));
  printf("thrice: %d\n", a_function(100, 0));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x9,%esi
call   1040 <a_function@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffa,%edi
mov    $0x1,%esi
call   1040 <a_function@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <a_function@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x2,%edi
mov    $0x9,%esi
call   1040 <a_function@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffffa,%edi
mov    $0x1,%esi
call   1040 <a_function@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <a_function@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"once: %d\0A\00"
@.str.1 = [11 x i8] c"twice: %d\0A\00"
@.str.2 = [12 x i8] c"thrice: %d\0A\00"
define void @test() {
%1 = call i32 @a_function(i32 2, i32 9)
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @a_function(i32 -6, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @a_function(i32 100, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"once: %d\0A\00"
@.str.1 = [11 x i8] c"twice: %d\0A\00"
@.str.2 = [12 x i8] c"thrice: %d\0A\00"
define void @test() {
%1 = tail call i32 @a_function(i32 2, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @a_function(i32 -6, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @a_function(i32 100, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
void termop_dblwidth(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      209, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_dblwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0xd1,%r8d
lea    0xf37(%rip),%r9
lea    0xf40(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_dblwidth>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf67(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0xd1,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_dblwidth = [16 x i8] c"termop_dblwidth\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_dblwidth(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 209, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_dblwidth, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_dblwidth = [16 x i8] c"termop_dblwidth\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_dblwidth(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 209, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_dblwidth, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
double g();
f() {
  char dummy[9];
  double f1, f2, f3;
  f1 = g();
  f2 = g();
  f3 = g();
  return f1 + f2 + f3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <g@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <g@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <g@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <g@plt>
movsd  0x8(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca [9 x i8]
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = call double (...) @g()
store double %5, double* %2
%6 = call double (...) @g()
store double %6, double* %3
%7 = call double (...) @g()
store double %7, double* %4
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fadd double %8, %9
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = fptosi double %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call double (...) @g()
%2 = tail call double (...) @g()
%3 = tail call double (...) @g()
%4 = fadd double %1, %2
%5 = fadd double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
void XAutoRepeatOff() {}


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

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

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

LLVM IR (-O2):
define void @XAutoRepeatOff() {
ret void
}
void g_value_get_type() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_type() {
ret void
}
/* Variables and functions */
scalar_t__ isValueLenOk(char *, int);
scalar_t__ noDodgyChars(char *);
int /*<<< orphan*/ setConfigTextValue(char *, char *);
int updateRssHostName(char *value) {
  if (isValueLenOk(value, 32) && noDodgyChars(value)) {
    setConfigTextValue("web.rss.host", value);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<updateRssHostName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <isValueLenOk@plt>
cmp    $0x0,%rax
je     1183 <updateRssHostName+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <noDodgyChars@plt>
cmp    $0x0,%rax
je     1183 <updateRssHostName+0x53>
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1050 <setConfigTextValue@plt>
movl   $0x1,-0x4(%rbp)
jmp    118a <updateRssHostName+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateRssHostName>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x20,%esi
call   1040 <isValueLenOk@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1168 <updateRssHostName+0x38>
mov    %rbx,%rdi
call   1030 <noDodgyChars@plt>
test   %rax,%rax
je     1168 <updateRssHostName+0x38>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1050 <setConfigTextValue@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"web.rss.host\00"
define i32 @updateRssHostName(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @isValueLenOk(i8* %4, i32 32)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @noDodgyChars(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i32 @setConfigTextValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %2
br label %15
14: ; preds = %7, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"web.rss.host\00"
define i32 @updateRssHostName(i8* %0) {
%2 = tail call i64 @isValueLenOk(i8* %0, i32 32)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @noDodgyChars(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @setConfigTextValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
double quality_to_mse(int);
unsigned int mse_to_quality(double mse) {
  for (int i = 100; i > 0; i--) {
    if (mse <= quality_to_mse(i) + 0.000001) {
      return i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<mse_to_quality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1179 <mse_to_quality+0x69>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <quality_to_mse@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1166 <mse_to_quality+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <mse_to_quality+0x70>
jmp    116b <mse_to_quality+0x5b>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <mse_to_quality+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mse_to_quality>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x65,%ebx
nopl   (%rax)
lea    -0x1(%rbx),%ebp
mov    %ebp,%edi
call   1030 <quality_to_mse@plt>
addsd  0xece(%rip),%xmm0
ucomisd (%rsp),%xmm0
jae    1143 <mse_to_quality+0x33>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <mse_to_quality+0x10>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mse_to_quality(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 100, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load double, double* %3
%10 = load i32, i32* %4
%11 = call double @quality_to_mse(i32 %10)
%12 = fadd double %11, 0x3EB0C6F7A0B5ED8D
%13 = fcmp ole double %9, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %21
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 0, i32* %2
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @mse_to_quality(double %0) {
br label %2
2: ; preds = %1, %7
%3 = phi i32 [ 100, %1 ], [ %8, %7 ]
%4 = tail call double @quality_to_mse(i32 %3)
%5 = fadd double %4, 0x3EB0C6F7A0B5ED8D
%6 = fcmp ult double %5, %0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = add nsw i32 %3, -1
%9 = icmp ugt i32 %3, 1
br i1 %9, label %2, label %10
10: ; preds = %2, %7
%11 = phi i32 [ %3, %2 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ ishorzwhite(int);
scalar_t__ isnewline(int);
int iswhite(int c) { return ishorzwhite(c) || isnewline(c); }


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ishorzwhite@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <iswhite+0x37>
mov    -0x4(%rbp),%edi
call   1040 <isnewline@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
push   %rbx
mov    %edi,%ebx
call   1030 <ishorzwhite@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <iswhite+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isnewline@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iswhite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ishorzwhite(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isnewline(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @iswhite(i32 %0) {
%2 = tail call i64 @ishorzwhite(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isnewline(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int, char);
char *showElement(int *element) {
  char *buf = (char *)malloc(sizeof(char) * 1);
  sprintf(buf, "%d%c", *element, '\0');
  return buf;
}


x86 assembly (clang, -O0):
<showElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xeb5(%rip),%rsi
xor    %ecx,%ecx
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showElement>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    (%r14),%edx
lea    0xec2(%rip),%rsi
mov    %rax,%rdi
xor    %ecx,%ecx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
define i8* @showElement(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8, i8 signext 0)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
define i8* @showElement(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = load i32, i32* %0
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i8 signext 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SHA256(unsigned char const *, int, unsigned char *);
int SHA256_DIGEST_LENGTH;
void bu_Hash(unsigned char *md256, const unsigned char *data, size_t data_len) {
  unsigned char md1[SHA256_DIGEST_LENGTH];
  SHA256(data, data_len, md1);
  SHA256(md1, SHA256_DIGEST_LENGTH, md256);
}


x86 assembly (clang, -O0):
<bu_Hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <SHA256@plt>
mov    -0x30(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1030 <SHA256@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_Hash>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ebc(%rip),%r15
mov    (%r15),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1030 <SHA256@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <SHA256@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SHA256_DIGEST_LENGTH = global i32 0
define void @bu_Hash(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i32, i32* @SHA256_DIGEST_LENGTH
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %7
%12 = alloca i8, i64 %10
store i64 %10, i64* %8
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = trunc i64 %14 to i32
%16 = call i32 @SHA256(i8* %13, i32 %15, i8* %12)
%17 = load i32, i32* @SHA256_DIGEST_LENGTH
%18 = load i8*, i8** %4
%19 = call i32 @SHA256(i8* %12, i32 %17, i8* %18)
%20 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
@SHA256_DIGEST_LENGTH = global i32 0
define void @bu_Hash(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @SHA256_DIGEST_LENGTH
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = trunc i64 %2 to i32
%8 = call i32 @SHA256(i8* %1, i32 %7, i8* %6)
%9 = load i32, i32* @SHA256_DIGEST_LENGTH
%10 = call i32 @SHA256(i8* %6, i32 %9, i8* %0)
ret void
}
void I444ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGB() {
ret void
}
void glDeleteSync(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteSync() {
ret void
}
long jmin(long a, long b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<jmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <jmin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <jmin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @jmin(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 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @jmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void end_connectionn(int sock) { close(sock); }


x86 assembly (clang, -O0):
<end_connectionn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_connectionn>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @end_connectionn(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int test_imm_91uint32_mem(unsigned int *val) {
  return ((*val) & (0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 145
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  signed x;
  unsigned a;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int syscall(int, int, struct sockaddr *, int /*<<< orphan*/ *, int);
int uv__accept4(int fd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
  return syscall(288, fd, addr, addrlen, flags);
}


x86 assembly (clang, -O0):
<uv__accept4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x120,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__accept4>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x120,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @uv__accept4(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.sockaddr*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store %struct.sockaddr* %1, %struct.sockaddr** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.sockaddr*, %struct.sockaddr** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 288, i32 %9, %struct.sockaddr* %10, i32* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @uv__accept4(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = tail call i32 @syscall(i32 288, i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ smsc9220_read_mac_address(char *);
void mbed_mac_address(char *mac) { smsc9220_read_mac_address(mac); }


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

x86 assembly (clang, -O2):
<mbed_mac_address>:
jmp    1030 <smsc9220_read_mac_address@plt>

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

LLVM IR (-O2):
define void @mbed_mac_address(i8* %0) {
%2 = tail call i32 @smsc9220_read_mac_address(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
FILE *tryToOpen(const char *fileName, const char *mode) {
  FILE *qp = fopen(fileName, mode);
  if (qp == NULL) {
    printf("Error: couldn't open file: %s\n", fileName);
    exit(1);
  }
  return qp;
}


x86 assembly (clang, -O0):
<tryToOpen>:
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   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <tryToOpen+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tryToOpen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <tryToOpen+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error: couldn't open file: %s\0A\00"
define i32* @tryToOpen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error: couldn't open file: %s\0A\00"
define noalias i32* @tryToOpen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
int d_ne_cr1(double a1) { return (((100) != (a1))); }


x86 assembly (clang, -O0):
<d_ne_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_cr1>:
cmpneqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @d_ne_cr1(double %0) {
%2 = fcmp une double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int count_data_bits(unsigned int mask) {
  return ((mask >> 0) & 1) + ((mask >> 1) & 1) + ((mask >> 2) & 1) +
         ((mask >> 3) & 1);
}


x86 assembly (clang, -O0):
<count_data_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_data_bits>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x3,%edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @count_data_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 0
%5 = and i32 %4, 1
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 1
%9 = add i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 1
%13 = add i32 %9, %12
%14 = load i32, i32* %2
%15 = lshr i32 %14, 3
%16 = and i32 %15, 1
%17 = add i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @count_data_bits(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int rand();
int rand_between(int low, int high) {
  return low + (rand() % (high - low - 1));
}


x86 assembly (clang, -O0):
<rand_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %ebp,%ecx
not    %ecx
add    %ebx,%ecx
cltd
idiv   %ecx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_between(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sub nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = xor i32 %0, -1
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
float soustraction(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<soustraction>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<soustraction>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @soustraction(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @soustraction(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int do_layer3(int single) {
  int stereo1;
  if (single >= 0)
    stereo1 = 1;
  else
    stereo1 = 2;
  f(single);
  return stereo1;
}


x86 assembly (clang, -O0):
<do_layer3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1131 <do_layer3+0x21>
movl   $0x1,-0x8(%rbp)
jmp    1138 <do_layer3+0x28>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_layer3>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    $0x1,%ebx
call   1030 <f@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @do_layer3(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 1, i32 2
%4 = tail call i32 @f(i32 %0)
ret i32 %3
}
/* Variables and functions */
void *memset(void *, int, unsigned int);
void *Osal_MemSet(void *ptr, int value, unsigned int size) {
  return (memset(ptr, value, size));
}


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

x86 assembly (clang, -O2):
<Osal_MemSet>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @Osal_MemSet(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i8* @memset(i8* %7, i32 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @Osal_MemSet(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @memset(i8* %0, i32 %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ set(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  a = 0;
  b = 1;
  c = 3;
  a = b + c;
  b = 3;
  c = 5;
  set(&a);
  test_assert(a == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <set@plt>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <set@plt>
xor    %edi,%edi
cmpl   $0xa,0x4(%rsp)
sete   %dil
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 3, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = call i32 @set(i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @set(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
void test2() {
  int x[] = {1, 2, 3, 4, 6, 8, 9, 10, 123, 231, 123, 23, 24};
  foo(x);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x34,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <foo@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x38,%rsp
mov    0xf16(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xefb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test2.x = [13 x i32] [i32 1, i32 2, i32 3, i32 4, i32 6, i32 8, i32 9, i32 10, i32 123, i32 231, i32 123, i32 23, i32 24]
define void @test2() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.test2.x = [13 x i32] [i32 1, i32 2, i32 3, i32 4, i32 6, i32 8, i32 9, i32 10, i32 123, i32 231, i32 123, i32 23, i32 24]
define void @test2() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ map_id2bl(int);
scalar_t__ unit_attack_timer_sub(int, unsigned int, int, void *);
int /*<<< orphan*/ unit_unattackable(int /*<<< orphan*/);
int unit_attack_timer(int tid, unsigned int tick, int id, void *data) {
  if (unit_attack_timer_sub(tid, tick, id, data) == 0) {
    unit_unattackable(map_id2bl(id));
  }
  return 0;
}


x86 assembly (clang, -O0):
<unit_attack_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1050 <unit_attack_timer_sub@plt>
cmp    $0x0,%rax
jne    1170 <unit_attack_timer+0x40>
mov    -0xc(%rbp),%edi
call   1040 <map_id2bl@plt>
mov    %eax,%edi
call   1030 <unit_unattackable@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit_attack_timer>:
push   %rbx
mov    %edx,%ebx
call   1050 <unit_attack_timer_sub@plt>
test   %rax,%rax
jne    114b <unit_attack_timer+0x1b>
mov    %ebx,%edi
call   1040 <map_id2bl@plt>
mov    %eax,%edi
call   1030 <unit_unattackable@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unit_attack_timer(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i64 @unit_attack_timer_sub(i32 %9, i32 %10, i32 %11, i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i32, i32* %7
%17 = call i32 @map_id2bl(i32 %16)
%18 = call i32 @unit_unattackable(i32 %17)
br label %19
19: ; preds = %15, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @unit_attack_timer(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i64 @unit_attack_timer_sub(i32 %0, i32 %1, i32 %2, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @map_id2bl(i32 %2)
%9 = tail call i32 @unit_unattackable(i32 %8)
br label %10
10: ; preds = %7, %4
ret i32 0
}
void UI_get0_output_string(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get0_output_string() {
ret void
}
long long fll2(long long j, signed char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll2>:
movsbq (%rsi,%rdx,1),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fll2(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fll2(i64 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
int test_imm_E5int8_mem(signed char *val) {
  return ((*val) & (0xE5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -27
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ proc(long, long *, int, int *);
long call_proc() {
  long x1 = 1;
  int x2 = 2;
  proc(x1, &x1, x2, &x2);
  return (x1 + x2);
}


x86 assembly (clang, -O0):
<call_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rcx
call   1030 <proc@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_proc>:
sub    $0x18,%rsp
movq   $0x1,0x10(%rsp)
movl   $0x2,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <proc@plt>
movslq 0xc(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @call_proc() {
%1 = alloca i64
%2 = alloca i32
store i64 1, i64* %1
store i32 2, i32* %2
%3 = load i64, i64* %1
%4 = load i32, i32* %2
%5 = call i32 @proc(i64 %3, i64* %1, i32 %4, i32* %2)
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @call_proc() {
%1 = alloca i64
%2 = alloca i32
%3 = bitcast i64* %1 to i8*
store i64 1, i64* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @proc(i64 1, i64* %1, i32 2, i32* %2)
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
ret i64 %9
}