xunge/DecIR huggingface dataset:
int FLOAT_EQ_INT(float f, int i) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
  return (f == i);
#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<FLOAT_EQ_INT>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLOAT_EQ_INT>:
cvtsi2ss %edi,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @FLOAT_EQ_INT(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fcmp oeq float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @FLOAT_EQ_INT(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fcmp oeq float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int toggle_read(struct mainwindow *);
int handle_toggle_read(struct mainwindow *mw) { return toggle_read(mw); }


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

x86 assembly (clang, -O2):
<handle_toggle_read>:
jmp    1030 <toggle_read@plt>

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

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_toggle_read(%struct.mainwindow* %0) {
%2 = tail call i32 @toggle_read(%struct.mainwindow* %0)
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
int positionOfFirstNonDigit(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int idFromName(char *name) {
  char str[100];
  int i = positionOfFirstNonDigit(name);
  strncpy(str, name, i);
  return atoi(str);
}


x86 assembly (clang, -O0):
<idFromName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <positionOfFirstNonDigit@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x74(%rbp),%edx
call   1030 <strncpy@plt>
lea    -0x70(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idFromName>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
call   1050 <positionOfFirstNonDigit@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
call   1040 <atoi@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @idFromName(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @positionOfFirstNonDigit(i8* %5)
store i32 %6, i32* %4
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @idFromName(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @positionOfFirstNonDigit(i8* %0)
%5 = call i32 @strncpy(i8* %3, i8* %0, i32 %4)
%6 = call i32 @atoi(i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int teste = 1;
  if (teste) {
    printf("eh verdadeiro");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <main+0x25>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"eh verdadeiro\00"
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"eh verdadeiro\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float powf(float x, int y) {
  float r = x;
  for (y--; y > 0; y--)
    r = r * r;
  return r;
}


x86 assembly (clang, -O0):
<powf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <powf+0x46>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <powf+0x1f>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<powf>:
cmp    $0x2,%edi
jl     111c <powf+0x1c>
add    $0x1,%edi
nopl   0x0(%rax,%rax,1)
mulss  %xmm0,%xmm0
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1110 <powf+0x10>
ret

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

LLVM IR (-O2):
define float @powf(float %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi float [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = fmul float %5, %5
%9 = icmp ugt i32 %6, 2
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi float [ %0, %2 ], [ %8, %4 ]
ret float %11
}
/* Variables and functions */
double baz(double);
int foo(int, int, int, int, double);
__attribute__((noclone, no)) int bar(int a, int b, int c, int d, double i,
                                     double j) {
  double l = baz(i) * j;
  return foo(a, b, c, d, l);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <baz@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1040 <foo@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movsd  %xmm1,(%rsp)
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <baz@plt>
mulsd  (%rsp),%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %11
%15 = call double @baz(double %14)
%16 = load double, double* %12
%17 = fmul double %15, %16
store double %17, double* %13
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load double, double* %13
%23 = call i32 @foo(i32 %18, i32 %19, i32 %20, i32 %21, double %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3, double %4, double %5) {
%7 = tail call double @baz(double %4)
%8 = fmul double %7, %5
%9 = tail call i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, double %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void magadd_ShowSyntax(FILE *outfile) {
  fprintf(outfile, "-magadd <\"fix\" value | \"list\" [\"column\" col] | "
                   "\"fixcolumn\" <colname | colnum> | \"expr\" expr>\n");
}


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

x86 assembly (clang, -O2):
<magadd_ShowSyntax>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x5d,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"-magadd <\22fix\22 value | \22list\22 [\22column\22 col] | \22fixcolumn\22 <colname | colnum> | \22expr\22 expr>\0A\00"
define void @magadd_ShowSyntax(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [94 x i8] c"-magadd <\22fix\22 value | \22list\22 [\22column\22 col] | \22fixcolumn\22 <colname | colnum> | \22expr\22 expr>\0A\00"
define void @magadd_ShowSyntax(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i64 93, i64 1, i32* %0)
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
long TestingMostlyAscending(long index, long total) {
  return index + rand() * 1.0 / RAND_MAX * 5 - 2.5;
}


x86 assembly (clang, -O0):
<TestingMostlyAscending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
mulsd  %xmm2,%xmm0
mov    0x2e9e(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xeb2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestingMostlyAscending>:
push   %rax
cvtsi2sd %rdi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebf(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xec6(%rip),%xmm0
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyAscending(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 = sitofp i64 %5 to double
%7 = call double (...) @rand()
%8 = fmul double %7, 1.000000e+00
%9 = load double, double* @RAND_MAX
%10 = fdiv double %8, %9
%11 = call double @llvm.fmuladd.f64(double %10, double 5.000000e+00, double %6)
%12 = fsub double %11, 2.500000e+00
%13 = fptosi double %12 to i64
ret i64 %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyAscending(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double 5.000000e+00, double %3)
%8 = fadd double %7, -2.500000e+00
%9 = fptosi double %8 to i64
ret i64 %9
}
float *Vector3Add(const float v1[3], const float v2[3], float result[3]) {
  result[0] = v1[0] + v2[0];
  result[1] = v1[1] + v2[1];
  result[2] = v1[2] + v2[2];
  return result;
}


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

x86 assembly (clang, -O2):
<Vector3Add>:
mov    %rdx,%rax
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

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

LLVM IR (-O2):
define float* @Vector3Add(float* nocapture %0, float* nocapture %1, float* returned writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret float* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void spb_swap(void *a, void *b, size_t size) {
  void *tmp = malloc(size);
  memcpy(tmp, a, size);
  memcpy(a, b, size);
  memcpy(b, tmp, size);
  free(tmp);
}


x86 assembly (clang, -O0):
<spb_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spb_swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @spb_swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @spb_swap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i64 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ GENWQE_DEVNAME;
scalar_t__ strncmp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int __genwqe_filter(const struct dirent *name) {
  if (0 == strncmp(name->d_name, GENWQE_DEVNAME, 6))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<__genwqe_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114f <__genwqe_filter+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <__genwqe_filter+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__genwqe_filter>:
push   %rax
mov    (%rdi),%edi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@GENWQE_DEVNAME = global i32 0
define i32 @__genwqe_filter(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = load i32, i32* @GENWQE_DEVNAME
%8 = call i64 @strncmp(i32 %6, i32 %7, i32 6)
%9 = icmp eq i64 0, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@GENWQE_DEVNAME = global i32 0
define i32 @__genwqe_filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @GENWQE_DEVNAME
%5 = tail call i64 @strncmp(i32 %3, i32 %4, i32 6)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int abi1(int x) { return x + 48; }


x86 assembly (clang, -O0):
<abi1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abi1>:
lea    0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @abi1(i32 %0) {
%2 = add nsw i32 %0, 48
ret i32 %2
}
__typeof__(vfprintf(1, 1)) test_vfprintf_264(void) { return vfprintf(1, 1); }


x86 assembly (clang, -O0):
<test_vfprintf_264>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <vfprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfprintf_264>:
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
define i32 @test_vfprintf_264() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i32, ...)*)(i32 1, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_vfprintf_264() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i32, ...)*)(i32 1, i32 1)
ret i32 %1
}
int test_imm_10int8_mem(signed char *val) {
  return ((*val) & (-0x10 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_10int8_mem>:
cmpb   $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_10int8_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, -16
%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_10int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 16
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ machine_store_frame(struct lemon *, struct lframe *);
void lemon_machine_store_frame(struct lemon *lemon, struct lframe *frame) {
  machine_store_frame(lemon, frame);
}


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

x86 assembly (clang, -O2):
<lemon_machine_store_frame>:
jmp    1030 <machine_store_frame@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define void @lemon_machine_store_frame(%struct.lemon* %0, %struct.lframe* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lframe*
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lframe* %1, %struct.lframe** %4
%5 = load %struct.lemon*, %struct.lemon** %3
%6 = load %struct.lframe*, %struct.lframe** %4
%7 = call i32 @machine_store_frame(%struct.lemon* %5, %struct.lframe* %6)
ret void
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define void @lemon_machine_store_frame(%struct.lemon* %0, %struct.lframe* %1) {
%3 = tail call i32 @machine_store_frame(%struct.lemon* %0, %struct.lframe* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printHTMLfooter(FILE *fd) { fprintf(fd, "</body></html>"); }


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

x86 assembly (clang, -O2):
<printHTMLfooter>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"</body></html>\00"
define void @printHTMLfooter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"</body></html>\00"
define void @printHTMLfooter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 14, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, size_t, int, int /*<<< orphan*/ *);
int output_bin(const char *name, unsigned char *arr, size_t size, FILE *fdo) {
  int ret = fwrite(arr, size, 1, fdo);
  (void)name;
  return ret == 1 ? 0 : 1;
}


x86 assembly (clang, -O0):
<output_bin>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_bin>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @output_bin(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i32* nocapture %3) {
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %3)
%6 = icmp ne i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror(
      "usage:\n"
      "RNAaliduplex [-e range] [-s] [standard options] file1.aln file2.aln\n");
}


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

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

LLVM IR (-O0):
@.str = [76 x i8] c"usage:\0ARNAaliduplex [-e range] [-s] [standard options] file1.aln file2.aln\0A\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"usage:\0ARNAaliduplex [-e range] [-s] [standard options] file1.aln file2.aln\0A\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double z1();
float fun(void) {
  unsigned long i;
  float f;
  i = 5.5 * z1();
  f = i;
  if (i & 1)
    f += 1.0;
  return f;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <z1@plt>
movsd  0xed9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xec6(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x14(%rbp)
test   %rax,%rax
movss  %xmm0,-0x10(%rbp)
js     1192 <fun+0x82>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     11cc <fun+0xbc>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe51(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
xor    %eax,%eax
call   1030 <z1@plt>
mulsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
subsd  0xed4(%rip),%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rax,%rcx
mov    %ecx,%eax
and    $0x1,%eax
test   %rcx,%rcx
js     1158 <fun+0x48>
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
test   %rax,%rax
jne    116f <fun+0x5f>
jmp    1177 <fun+0x67>
shr    %rcx
or     %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
test   %rax,%rax
je     1177 <fun+0x67>
addss  0xe99(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fun() {
%1 = alloca i64
%2 = alloca float
%3 = call double (...) @z1()
%4 = fmul double 5.500000e+00, %3
%5 = fptoui double %4 to i64
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = uitofp i64 %6 to float
store float %7, float* %2
%8 = load i64, i64* %1
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fadd double %13, 1.000000e+00
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %16
16: ; preds = %11, %0
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @fun() {
%1 = tail call double (...) @z1()
%2 = fmul double %1, 5.500000e+00
%3 = fptoui double %2 to i64
%4 = uitofp i64 %3 to float
%5 = and i64 %3, 1
%6 = icmp eq i64 %5, 0
%7 = fadd float %4, 1.000000e+00
%8 = select i1 %6, float %4, float %7
ret float %8
}
void __init_libc(int argc, char **argv, char **envp) {
  (void)argc;
  (void)argv;
  (void)envp;
}


x86 assembly (clang, -O0):
<__init_libc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__init_libc(i32 %0, i8** nocapture %1, i8** nocapture %2) {
ret void
}
void *stats_thread(void *ptr) { return ptr; }


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

x86 assembly (clang, -O2):
<stats_thread>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @stats_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @stats_thread(i8* readnone returned %0) {
ret i8* %0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_pid;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void new_handler(int signum, siginfo_t *info, void *ptr) {
  (void)ptr;
  printf("Received signal %d\n", signum);
  printf("Signal originates from process %lu\n", (unsigned long)info->si_pid);
}


x86 assembly (clang, -O0):
<new_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_handler>:
push   %rbx
mov    %rsi,%rbx
movslq %edi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
lea    0xee7(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@.str = [20 x i8] c"Received signal %d\0A\00"
@.str.1 = [36 x i8] c"Signal originates from process %lu\0A\00"
define void @new_handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 %13)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@.str = [20 x i8] c"Received signal %d\0A\00"
@.str.1 = [36 x i8] c"Signal originates from process %lu\0A\00"
define void @new_handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = sext i32 %0 to i64
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 %7)
ret void
}
void adj360(double *deg) {
  for (;;)
    if (*deg < 0)
      *deg += 360;
    else if (*deg > 360)
      *deg -= 360;
    else
      break;
}


x86 assembly (clang, -O0):
<adj360>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1132 <adj360+0x32>
mov    -0x8(%rbp),%rax
movsd  0xedb(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1173 <adj360+0x73>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1169 <adj360+0x69>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xea4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    116e <adj360+0x6e>
jmp    1178 <adj360+0x78>
jmp    1173 <adj360+0x73>
jmp    1108 <adj360+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adj360>:
movsd  (%rdi),%xmm0
movsd  0xef4(%rip),%xmm1
xorpd  %xmm2,%xmm2
movsd  0xef0(%rip),%xmm3
jmp    1128 <adj360+0x28>
nopw   0x0(%rax,%rax,1)
addsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
ucomisd %xmm0,%xmm2
movapd %xmm1,%xmm4
ja     1120 <adj360+0x20>
ucomisd %xmm1,%xmm0
movapd %xmm3,%xmm4
ja     1120 <adj360+0x20>
ret

LLVM IR (-O0):
define void @adj360(double* %0) {
%2 = alloca double*
store double* %0, double** %2
br label %3
3: ; preds = %21, %1
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = fadd double %9, 3.600000e+02
store double %10, double* %8
br label %21
11: ; preds = %3
%12 = load double*, double** %2
%13 = load double, double* %12
%14 = fcmp ogt double %13, 3.600000e+02
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load double*, double** %2
%17 = load double, double* %16
%18 = fsub double %17, 3.600000e+02
store double %18, double* %16
br label %20
19: ; preds = %11
br label %22
20: ; preds = %15
br label %21
21: ; preds = %20, %7
br label %3
22: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @adj360(double* nocapture %0) {
%2 = load double, double* %0
br label %3
3: ; preds = %8, %1
%4 = phi double [ %10, %8 ], [ %2, %1 ]
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt double %4, 3.600000e+02
br i1 %7, label %8, label %11
8: ; preds = %6, %3
%9 = phi double [ 3.600000e+02, %3 ], [ -3.600000e+02, %6 ]
%10 = fadd double %4, %9
store double %10, double* %0
br label %3
11: ; preds = %6
ret void
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_lflag;
};

/* Variables and functions */
int /*<<< orphan*/ ECHO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ free(struct termios *);
struct termios *get_termio_attr();
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void enable_echo(void) {
  struct termios *current;
  current = get_termio_attr();
  current->c_lflag |= ECHO;
  tcsetattr(STDIN_FILENO, 0, current);
  free(current);
}


x86 assembly (clang, -O0):
<enable_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_termio_attr@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1050 <tcsetattr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_echo>:
push   %rbx
xor    %eax,%eax
call   1040 <get_termio_attr@plt>
mov    %rax,%rbx
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
or     %eax,(%rbx)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <tcsetattr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@ECHO = global i32 0
@STDIN_FILENO = global i32 0
define void @enable_echo() {
%1 = alloca %struct.termios*
%2 = call %struct.termios* (...) @get_termio_attr()
store %struct.termios* %2, %struct.termios** %1
%3 = load i32, i32* @ECHO
%4 = load %struct.termios*, %struct.termios** %1
%5 = getelementptr inbounds %struct.termios, %struct.termios* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = or i32 %6, %3
store i32 %7, i32* %5
%8 = load i32, i32* @STDIN_FILENO
%9 = load %struct.termios*, %struct.termios** %1
%10 = call i32 @tcsetattr(i32 %8, i32 0, %struct.termios* %9)
%11 = load %struct.termios*, %struct.termios** %1
%12 = call i32 @free(%struct.termios* %11)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ECHO = global i32 0
@STDIN_FILENO = global i32 0
define void @enable_echo() {
%1 = tail call %struct.termios* (...) @get_termio_attr()
%2 = load i32, i32* @ECHO
%3 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = or i32 %4, %2
store i32 %5, i32* %3
%6 = load i32, i32* @STDIN_FILENO
%7 = tail call i32 @tcsetattr(i32 %6, i32 0, %struct.termios* %1)
%8 = tail call i32 @free(%struct.termios* %1)
ret void
}
char *strerror(int code) {}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @strerror(i32 %0) {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vtab;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int cXInit(int /*<<< orphan*/ *, void *, int, char const *const *,
           int /*<<< orphan*/ **, char **, int /*<<< orphan*/);
int cXConnect(sqlite3 *db, void *pAux, int argc, const char *const *argv,
              sqlite3_vtab **ppVTab, char **pzErr) {
  return cXInit(db, pAux, argc, argv, ppVTab, pzErr, 0);
}


x86 assembly (clang, -O0):
<cXConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <cXInit@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cXConnect>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <cXInit@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cXConnect(i32* %0, i8* %1, i32 %2, i8** %3, i32** %4, i8** %5) {
%7 = tail call i32 @cXInit(i32* %0, i8* %1, i32 %2, i8** %3, i32** %4, i8** %5, i32 0)
ret i32 %7
}
double reconstructDouble(int sides[2]) {
  double reconstructed = sides[0];
  reconstructed += (sides[1] / 1000000.0) - 1;
  return reconstructed;
}


x86 assembly (clang, -O0):
<reconstructDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
subsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reconstructDouble>:
cvtsi2sdl (%rdi),%xmm1
cvtsi2sdl 0x4(%rdi),%xmm0
divsd  0xeef(%rip),%xmm0
addsd  0xeef(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @reconstructDouble(i32* %0) {
%2 = alloca i32*
%3 = alloca double
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fsub double %12, 1.000000e+00
%14 = load double, double* %3
%15 = fadd double %14, %13
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @reconstructDouble(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sitofp i32 %2 to double
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %7, -1.000000e+00
%9 = fadd double %8, %3
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ SetDirection(unsigned char, int);
void Rev(unsigned char Outputs) { SetDirection(Outputs, 0x00); }


x86 assembly (clang, -O0):
<Rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movzbl -0x1(%rbp),%edi
call   1030 <SetDirection@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rev>:
xor    %esi,%esi
jmp    1030 <SetDirection@plt>

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

LLVM IR (-O2):
define void @Rev(i8 zeroext %0) {
%2 = tail call i32 @SetDirection(i8 zeroext %0, i32 0)
ret void
}
void sourisOnclick(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @sourisOnclick(i32 %0, i32 %1) {
ret void
}
void msm_watchdog_check_pet(unsigned long long timestamp) {}


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

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

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

LLVM IR (-O2):
define void @msm_watchdog_check_pet(i64 %0) {
ret void
}
int fun737() { return 737; }


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

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

LLVM IR (-O0):
define i32 @fun737() {
ret i32 737
}

LLVM IR (-O2):
define i32 @fun737() {
ret i32 737
}
/* Variables and functions */
int /*<<< orphan*/ array_test();
int /*<<< orphan*/ printf(char *);
int main() {
  array_test();
  printf("array test OK!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"array test OK!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @array_test()
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"array test OK!\00"
define i32 @main() {
%1 = tail call i32 (...) @array_test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int cholu(double *, int);
int chol(double *A, int N) {
  int sc;
  sc = cholu(A, N);
  return sc;
}


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

x86 assembly (clang, -O2):
<chol>:
jmp    1030 <cholu@plt>

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

LLVM IR (-O2):
define i32 @chol(double* %0, i32 %1) {
%3 = tail call i32 @cholu(double* %0, i32 %1)
ret i32 %3
}
int abs(int a) {
  if (a > 0)
    return a;
  return -a;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int fac_intern(int, int *);
int fac(int n, int *result_ptr) {
  *result_ptr = 1;
  return fac_intern(n, result_ptr);
}


x86 assembly (clang, -O0):
<fac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fac_intern@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fac>:
movl   $0x1,(%rsi)
jmp    1030 <fac_intern@plt>

LLVM IR (-O0):
define i32 @fac(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
store i32 1, i32* %5
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = call i32 @fac_intern(i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fac(i32 %0, i32* %1) {
store i32 1, i32* %1
%3 = tail call i32 @fac_intern(i32 %0, i32* %1)
ret i32 %3
}