xunge/DecIR huggingface dataset:
int test_imm_5Aint8_mem(signed char *val) {
  return ((*val) & (0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Aint8_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, 90
%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_5Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 90
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int clip3(int a, int b, int c) {
  if (c < a)
    return a;
  if (c > b)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<clip3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clip3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip3+0x41>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clip3+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip3+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip3>:
mov    %esi,%eax
cmp    %esi,%edx
cmovle %edx,%eax
cmp    %edi,%edx
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %0
%5 = icmp sgt i32 %2, %1
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
void FFTABLEOUT(unsigned char *data, unsigned char *tab, int g) {
  *((int *)data) = *(((int *)tab) + g);
  *(((int *)data) + 1) = *(((int *)tab) + 32 + g);
}


x86 assembly (clang, -O0):
<FFTABLEOUT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    0x80(%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFTABLEOUT>:
movslq %edx,%rax
mov    (%rsi,%rax,4),%ecx
mov    %ecx,(%rdi)
mov    0x80(%rsi,%rax,4),%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @FFTABLEOUT(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to i32*
%17 = getelementptr inbounds i32, i32* %16, i64 32
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i8*, i8** %4
%23 = bitcast i8* %22 to i32*
%24 = getelementptr inbounds i32, i32* %23, i64 1
store i32 %21, i32* %24
ret void
}

LLVM IR (-O2):
define void @FFTABLEOUT(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %1 to i32*
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = bitcast i8* %0 to i32*
store i32 %7, i32* %8
%9 = getelementptr inbounds i8, i8* %1, i64 128
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 %5
%12 = load i32, i32* %11
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
ret void
}
A0AX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*((double *)10000000)) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0x989680,%eax
movsd  (%rax),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <A0AX1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <A0AX1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AX1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @A0AX1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 10000000 to double*)
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @A0AX1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 10000000 to double*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int auditwarnlog(char **);
int audit_warn_auditoff(void) {
  char *args[2];
  args[0] = "auditoff";
  args[1] = NULL;
  return (auditwarnlog(args));
}


x86 assembly (clang, -O0):
<audit_warn_auditoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <auditwarnlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_warn_auditoff>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <auditwarnlog@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"auditoff\00"
define i32 @audit_warn_auditoff() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @auditwarnlog(i8** %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"auditoff\00"
define i32 @audit_warn_auditoff() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @auditwarnlog(i8** %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun2() { printf("This Fun2 \n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"This Fun2 \00"
define void @fun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct DFA {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ compute_transition_sigs(struct DFA *, int);
int /*<<< orphan*/ find_default_states(struct DFA *, int);
void compress_transition_table(struct DFA *dfa, int ntokens) {
  compute_transition_sigs(dfa, ntokens);
  find_default_states(dfa, ntokens);
}


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

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

LLVM IR (-O0):
%struct.DFA = type { i32 }
define void @compress_transition_table(%struct.DFA* %0, i32 %1) {
%3 = alloca %struct.DFA*
%4 = alloca i32
store %struct.DFA* %0, %struct.DFA** %3
store i32 %1, i32* %4
%5 = load %struct.DFA*, %struct.DFA** %3
%6 = load i32, i32* %4
%7 = call i32 @compute_transition_sigs(%struct.DFA* %5, i32 %6)
%8 = load %struct.DFA*, %struct.DFA** %3
%9 = load i32, i32* %4
%10 = call i32 @find_default_states(%struct.DFA* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.DFA = type { i32 }
define void @compress_transition_table(%struct.DFA* %0, i32 %1) {
%3 = tail call i32 @compute_transition_sigs(%struct.DFA* %0, i32 %1)
%4 = tail call i32 @find_default_states(%struct.DFA* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
int /*<<< orphan*/ printf(char *, double, int /*<<< orphan*/);
void calculate_abs(double num) {
  printf("abs value of %lf is %lf\n", num, fabs(num));
}


x86 assembly (clang, -O0):
<calculate_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
movsd  -0x10(%rbp),%xmm0
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_abs>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
lea    0xece(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"abs value of %lf is %lf\0A\00"
define void @calculate_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call i32 @fabs(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"abs value of %lf is %lf\0A\00"
define void @calculate_abs(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %0, i32 %2)
ret void
}
main() {
  float a = 0;
  int i = 0;
  a = i++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca i32
store float 0.000000e+00, float* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = sitofp i32 %3 to float
store float %5, float* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test10();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ test7();
int /*<<< orphan*/ test8();
int /*<<< orphan*/ test9();
int main(void) {
  test1();
  test2();
  test3();
  test4();
  test5();
  test6();
  test7();
  test8();
  test9();
  test10();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test1@plt>
mov    $0x0,%al
call   10b0 <test2@plt>
mov    $0x0,%al
call   1050 <test3@plt>
mov    $0x0,%al
call   10a0 <test4@plt>
mov    $0x0,%al
call   1040 <test5@plt>
mov    $0x0,%al
call   1090 <test6@plt>
mov    $0x0,%al
call   1030 <test7@plt>
mov    $0x0,%al
call   10c0 <test8@plt>
mov    $0x0,%al
call   1080 <test9@plt>
mov    $0x0,%al
call   1060 <test10@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test1@plt>
xor    %eax,%eax
call   10b0 <test2@plt>
xor    %eax,%eax
call   1050 <test3@plt>
xor    %eax,%eax
call   10a0 <test4@plt>
xor    %eax,%eax
call   1040 <test5@plt>
xor    %eax,%eax
call   1090 <test6@plt>
xor    %eax,%eax
call   1030 <test7@plt>
xor    %eax,%eax
call   10c0 <test8@plt>
xor    %eax,%eax
call   1080 <test9@plt>
xor    %eax,%eax
call   1060 <test10@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
%8 = call i32 (...) @test7()
%9 = call i32 (...) @test8()
%10 = call i32 (...) @test9()
%11 = call i32 (...) @test10()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
%7 = tail call i32 (...) @test7()
%8 = tail call i32 (...) @test8()
%9 = tail call i32 (...) @test9()
%10 = tail call i32 (...) @test10()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(pid_t pid, int sig) { return 0; }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
ret i32 0
}
int V(int R, int G, int B) { return 112 * R - 94 * G - 18 * B; }


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x70,-0x4(%rbp),%eax
imul   $0x5e,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x12,-0xc(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
imul   $0x70,%edi,%ecx
imul   $0xffffffa2,%esi,%eax
add    %ecx,%eax
add    %edx,%edx
lea    (%rdx,%rdx,8),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @V(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 112, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 94, %9
%11 = sub nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 18, %12
%14 = sub nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @V(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 112
%5 = mul i32 %1, -94
%6 = add i32 %5, %4
%7 = mul i32 %2, -18
%8 = add i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *newptr;
  if ((newptr = malloc(size)) == NULL)
    err(1, "malloc()");
  return (newptr);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <xmalloc+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned short fast_log2(double n) {
  return (*((unsigned long long *)&n) >> 52) - 1023;
}


x86 assembly (clang, -O0):
<fast_log2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x34,%rax
sub    $0x3ff,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_log2>:
movq   %xmm0,%rax
shr    $0x34,%rax
add    $0xfffffc01,%eax
ret

LLVM IR (-O0):
define zeroext i16 @fast_log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i64*
%4 = load i64, i64* %3
%5 = lshr i64 %4, 52
%6 = sub i64 %5, 1023
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @fast_log2(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 52
%4 = trunc i64 %3 to i16
%5 = add nsw i16 %4, -1023
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, ...);
void parse_usage(FILE *fd, const char *progname, const char *s1, const char *s2,
                 const char *description) {
  fprintf(fd, "%s: %s %s\n", progname, s1, s2);
  fprintf(fd, "%s\n", description);
  exit(0);
}


x86 assembly (clang, -O0):
<parse_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<parse_usage>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s: %s %s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @parse_usage(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14)
%16 = load i32*, i32** %6
%17 = load i8*, i8** %10
%18 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: %s %s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @parse_usage(i32* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%7 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = tail call i32 @exit(i32 0)
unreachable
}
void init_add_rel_pixel_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_pixel_color_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doAddNextObjectEvent();
void addNextObjectEvent(void) { doAddNextObjectEvent(); }


x86 assembly (clang, -O0):
<addNextObjectEvent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <doAddNextObjectEvent@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @addNextObjectEvent() {
%1 = call i32 (...) @doAddNextObjectEvent()
ret void
}

LLVM IR (-O2):
define void @addNextObjectEvent() {
%1 = tail call i32 (...) @doAddNextObjectEvent()
ret void
}
const char *raptorial_def_status_file(void) { return "/var/lib/dpkg/status"; }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"/var/lib/dpkg/status\00"
define i8* @raptorial_def_status_file() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"/var/lib/dpkg/status\00"
define i8* @raptorial_def_status_file() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
void UYVYToUV422Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUV422Row_AVX2() {
ret void
}
/* Variables and functions */
int fat(int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int m = fat(2);
  printf("%d\n", m);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <fat@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @fat(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void min_caml_prerr_int(void *fv, int n) { fprintf(stderr, "%d", n); }


x86 assembly (clang, -O0):
<min_caml_prerr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_caml_prerr_int>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @min_caml_prerr_int(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void PWMIntEnable(unsigned long ulBase, unsigned long ulGenFault) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) |= ulGenFault;
}


x86 assembly (clang, -O0):
<PWMIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMIntEnable>:
or     %rsi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @PWMIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 20
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @PWMIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void store_register(char *p) { printf("store_register()\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"store_register()\00"
define void @store_register(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no)) unsigned char foo6(int x) { return x; }


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

x86 assembly (clang, -O2):
<foo6>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @foo6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @foo6(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
int main() {
  int a = 1;
  switch (1) {
  case 0:
    a += a + 3;
    a += 1;
    return 0;
  case 1:
    a = 43;
    a += 1;
    a += 2;
    break;
  case 2:
    a = 4;
    break;
  case 3:
    a = 5;
    break;
  default:
    return 4;
  }
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 46
}
__attribute__((always_)) void bitmap_zero(unsigned long *dst, int nbits) {
  if ((__builtin_constant_p(nbits) && (nbits) <= 32))
    *dst = 0UL;
  else {
    int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) *
              sizeof(unsigned long);
    __builtin_memset(dst, 0, len);
  }
}


x86 assembly (clang, -O0):
<bitmap_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
shl    $0x3,%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_zero>:
movslq %esi,%rax
shl    $0x1d,%rax
movabs $0x7e0000000,%rdx
add    %rax,%rdx
sar    $0x20,%rdx
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bitmap_zero(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i1 @llvm.is.constant.i32(i32 %6)
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 32
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i64*, i64** %3
store i64 0, i64* %12
br label %25
13: ; preds = %8, %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = add i64 %15, 64
%17 = sub i64 %16, 1
%18 = udiv i64 %17, 64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
store i32 %20, i32* %5
%21 = load i64*, i64** %3
%22 = bitcast i64* %21 to i8*
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
br label %25
25: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
define void @bitmap_zero(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = bitcast i64* %0 to i8*
%5 = shl nsw i64 %3, 29
%6 = add nsw i64 %5, 33822867456
%7 = ashr i64 %6, 32
%8 = and i64 %7, -8
tail call void @llvm.memset.p0i8.i64(i8* align 8 %4, i8 0, i64 %8, i1 false)
ret void
}
int float_equal_xxxx(int a, int b) {
  if (a < 0) {
    a = 0x80000000u - a;
  }
  if (b < 0) {
    b = 0x80000000u - b;
  }
  return a == b;
}


x86 assembly (clang, -O0):
<float_equal_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <float_equal_xxxx+0x1f>
mov    $0x80000000,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1134 <float_equal_xxxx+0x34>
mov    $0x80000000,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_equal_xxxx>:
mov    $0x80000000,%ecx
mov    $0x80000000,%edx
sub    %edi,%edx
test   %edi,%edi
cmovns %edi,%edx
sub    %esi,%ecx
test   %esi,%esi
cmovns %esi,%ecx
xor    %eax,%eax
cmp    %ecx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @float_equal_xxxx(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub i32 -2147483648, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub i32 -2147483648, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @float_equal_xxxx(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub i32 -2147483648, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = icmp slt i32 %1, 0
%7 = sub i32 -2147483648, %1
%8 = select i1 %6, i32 %7, i32 %1
%9 = icmp eq i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void pattern_center(float *p) {
  float up_res = 8.0;
  p[0] = 32.0 * up_res * 5 - 0.5;
  p[1] = 32.0 * up_res * 5 - 0.5;
  return;
}


x86 assembly (clang, -O0):
<pattern_center>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  0xf08(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeea(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern_center>:
movabs $0x449ff000449ff000,%rax
f0 9f 44
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @pattern_center(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
store float 8.000000e+00, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fmul double 3.200000e+01, %5
%7 = call double @llvm.fmuladd.f64(double %6, double 5.000000e+00, double -5.000000e-01)
%8 = fptrunc double %7 to float
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fmul double 3.200000e+01, %12
%14 = call double @llvm.fmuladd.f64(double %13, double 5.000000e+00, double -5.000000e-01)
%15 = fptrunc double %14 to float
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i64 1
store float %15, float* %17
ret void
}

LLVM IR (-O2):
define void @pattern_center(float* nocapture writeonly %0) {
store float 1.279500e+03, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 1.279500e+03, float* %2
ret void
}
/* Variables and functions */
char *xstrdup(char const *);
int header_strdup(const char *header, void *closure) {
  *(char **)closure = xstrdup(header);
  return 1;
}


x86 assembly (clang, -O0):
<header_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_strdup>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xstrdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @header_strdup(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 i8* @xstrdup(i8* %5)
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i8**
store i8* %6, i8** %8
ret i32 1
}

LLVM IR (-O2):
define i32 @header_strdup(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i8* @xstrdup(i8* %0)
%4 = bitcast i8* %1 to i8**
store i8* %3, i8** %4
ret i32 1
}
/* Variables and functions */
int closefd(int, int);
int NET_SocketClose(int fd) { return closefd(-1, fd); }


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

x86 assembly (clang, -O2):
<NET_SocketClose>:
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <closefd@plt>

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

LLVM IR (-O2):
define i32 @NET_SocketClose(i32 %0) {
%2 = tail call i32 @closefd(i32 -1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ m_abort(int);
void *m_xmalloc(size_t);
void *realloc(void *, size_t);
void *m_xrealloc(void *ptr, size_t new_size) {
  if (!ptr)
    return m_xmalloc(new_size);
  ptr = realloc(ptr, new_size);
  if (!ptr)
    m_abort(1);
  return ptr;
}


x86 assembly (clang, -O0):
<m_xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <m_xrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <m_xmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    118b <m_xrealloc+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1183 <m_xrealloc+0x53>
mov    $0x1,%edi
call   1050 <m_abort@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_xrealloc>:
test   %rdi,%rdi
je     1142 <m_xrealloc+0x12>
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     114a <m_xrealloc+0x1a>
pop    %rcx
ret
mov    %rsi,%rdi
jmp    1030 <m_xmalloc@plt>
mov    $0x1,%edi
call   1050 <m_abort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @m_xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %5
%10 = call i8* @m_xmalloc(i64 %9)
store i8* %10, i8** %3
br label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %11
%18 = call i32 @m_abort(i32 1)
br label %19
19: ; preds = %17, %11
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %21
21: ; preds = %19, %8
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @m_xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @m_xmalloc(i64 %1)
br label %11
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @m_abort(i32 1)
br label %11
11: ; preds = %6, %9, %4
%12 = phi i8* [ %5, %4 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
/* Variables and functions */
int zero_or_ten(int);
void l2_concrete_no_underrun_Good_FP() {
  int a[9];
  a[zero_or_ten(1) - 1] = 0;
}


x86 assembly (clang, -O0):
<l2_concrete_no_underrun_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x1,%edi
call   1030 <zero_or_ten@plt>
sub    $0x1,%eax
cltq
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2_concrete_no_underrun_Good_FP>:
mov    $0x1,%edi
jmp    1030 <zero_or_ten@plt>

LLVM IR (-O0):
define void @l2_concrete_no_underrun_Good_FP() {
%1 = alloca [9 x i32]
%2 = call i32 @zero_or_ten(i32 1)
%3 = sub nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @l2_concrete_no_underrun_Good_FP() {
%1 = tail call i32 @zero_or_ten(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x5f() {
  Assert_real((isdigit(95) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              480, ("isdigit should be 0 for _"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x5f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x5f>:
push   %rax
mov    $0x5f,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for _\00"
define void @t_isdigit_0x5f() {
%1 = call i64 @isdigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for _\00"
define void @t_isdigit_0x5f() {
%1 = tail call i64 @isdigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_D4D_receive_ACK();
int /*<<< orphan*/ drv_D4D_send_extra_nowait(char const *, unsigned int const,
                                             unsigned char, unsigned char,
                                             unsigned char, unsigned char);
void drv_D4D_send_extra(const char *data, const unsigned int len,
                        unsigned char pos1, unsigned char pos2,
                        unsigned char pos3, unsigned char pos4) {
  drv_D4D_send_extra_nowait(data, len, pos1, pos2, pos3, pos4);
  drv_D4D_receive_ACK();
}


x86 assembly (clang, -O0):
<drv_D4D_send_extra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x20(%rbp)
mov    %ecx,%eax
mov    -0x20(%rbp),%ecx
mov    %eax,-0x1c(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
mov    %eax,-0x18(%rbp)
mov    %esi,%eax
mov    -0x18(%rbp),%esi
mov    %eax,-0x14(%rbp)
mov    %rdi,%r8
mov    -0x14(%rbp),%edi
mov    %r9b,%al
mov    %r8,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %sil,-0xd(%rbp)
mov    %dl,-0xe(%rbp)
mov    %cl,-0xf(%rbp)
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xd(%rbp),%dl
mov    -0xe(%rbp),%cl
mov    -0xf(%rbp),%al
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %al,%r8d
movzbl -0x10(%rbp),%r9d
call   1040 <drv_D4D_send_extra_nowait@plt>
mov    $0x0,%al
call   1030 <drv_D4D_receive_ACK@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_D4D_send_extra>:
push   %rax
call   1040 <drv_D4D_send_extra_nowait@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <drv_D4D_receive_ACK@plt>

LLVM IR (-O0):
define void @drv_D4D_send_extra(i8* %0, i32 %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8, i8* %9
%16 = load i8, i8* %10
%17 = load i8, i8* %11
%18 = load i8, i8* %12
%19 = call i32 @drv_D4D_send_extra_nowait(i8* %13, i32 %14, i8 zeroext %15, i8 zeroext %16, i8 zeroext %17, i8 zeroext %18)
%20 = call i32 (...) @drv_D4D_receive_ACK()
ret void
}

LLVM IR (-O2):
define void @drv_D4D_send_extra(i8* %0, i32 %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = tail call i32 @drv_D4D_send_extra_nowait(i8* %0, i32 %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5)
%8 = tail call i32 (...) @drv_D4D_receive_ACK()
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int c;
  int n;
  n = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      n++;
    }
  }
  printf("Numero de lineas: %d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [22 x i8] c"Numero de lineas: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %14, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [22 x i8] c"Numero de lineas: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}