xunge/DecIR huggingface dataset:
double to_degree(double radian) {
  return (180 / 3.14159265358979323846) * radian;
}


x86 assembly (clang, -O0):
<to_degree>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_degree>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_degree(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x404CA5DC1A63C1F8, %3
ret double %4
}

LLVM IR (-O2):
define double @to_degree(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}
int getsmallestnum(int a, int b, int c) {
  int small;
  small = a;
  if (b < small)
    small = b;
  if (c < small)
    small = c;
  return small;
}


x86 assembly (clang, -O0):
<getsmallestnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <getsmallestnum+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <getsmallestnum+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getsmallestnum(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int declare_function(char const *);
int /*<<< orphan*/ printf(char *, char const *);
int begin_function(const char *name) {
  int func_id = declare_function(name);
  if (func_id >= 0)
    printf("M68K_FUNCTION(%s)\n{\n", name);
  return func_id;
}


x86 assembly (clang, -O0):
<begin_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <declare_function@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1152 <begin_function+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_function>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <declare_function@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1140 <begin_function+0x20>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"M68K_FUNCTION(%s)\0A{\0A\00"
define i32 @begin_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @declare_function(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"M68K_FUNCTION(%s)\0A{\0A\00"
define i32 @begin_function(i8* %0) {
%2 = tail call i32 @declare_function(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void thread_exit(void *value_pointer) { pthread_exit(value_pointer); }


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

x86 assembly (clang, -O2):
<thread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @thread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
void g_random_int_range() {}


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

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

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

LLVM IR (-O2):
define void @g_random_int_range() {
ret void
}
void Putchar(c) char c;
{ putchar(c); }


x86 assembly (clang, -O0):
<Putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Putchar>:
movsbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @Putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
define void @Putchar(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ss2tc(int);
void ss2tc_(int *enabledisable) { ss2tc(*enabledisable); }


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

x86 assembly (clang, -O2):
<ss2tc_>:
mov    (%rdi),%edi
jmp    1030 <ss2tc@plt>

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

LLVM IR (-O2):
define void @ss2tc_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ss2tc(i32 %2)
ret void
}
double Fraction_of_Day(int hr, int mi, double se) {
  double dhr, dmi;
  dhr = (double)hr;
  dmi = (double)mi;
  return ((dhr + (dmi + se / 60.0) / 60.0) / 24.0);
}


x86 assembly (clang, -O0):
<Fraction_of_Day>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xece(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fraction_of_Day>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm2
movsd  0xef0(%rip),%xmm3
divsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
divsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Fraction_of_Day(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
store double %10, double* %7
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
store double %12, double* %8
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %6
%16 = fdiv double %15, 6.000000e+01
%17 = fadd double %14, %16
%18 = fdiv double %17, 6.000000e+01
%19 = fadd double %13, %18
%20 = fdiv double %19, 2.400000e+01
ret double %20
}

LLVM IR (-O2):
define double @Fraction_of_Day(i32 %0, i32 %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fdiv double %2, 6.000000e+01
%7 = fadd double %6, %5
%8 = fdiv double %7, 6.000000e+01
%9 = fadd double %8, %4
%10 = fdiv double %9, 2.400000e+01
ret double %10
}
/* Variables and functions */
scalar_t__ getmem(size_t, int);
float *fgetmem(const int leng) {
  return ((float *)getmem((size_t)leng, sizeof(float)));
}


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

x86 assembly (clang, -O2):
<fgetmem>:
movslq %edi,%rdi
mov    $0x4,%esi
jmp    1030 <getmem@plt>

LLVM IR (-O0):
define float* @fgetmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i64 @getmem(i64 %4, i32 4)
%6 = inttoptr i64 %5 to float*
ret float* %6
}

LLVM IR (-O2):
define float* @fgetmem(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @getmem(i64 %2, i32 4)
%4 = inttoptr i64 %3 to float*
ret float* %4
}
int get_dst_code_from_opcode(int instruction) {
  return (instruction & 0b00111000) >> 3;
}


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

x86 assembly (clang, -O2):
<get_dst_code_from_opcode>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @get_dst_code_from_opcode(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int valor;
  valor = 25;
  printf("Ejemplo de almancemaniento a memoria [ %d ]\n", valor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x19,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"Ejemplo de almancemaniento a memoria [ %d ]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 25, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Ejemplo de almancemaniento a memoria [ %d ]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 25)
ret i32 0
}
void isr_int_co_seg_overrun() {}


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

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

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

LLVM IR (-O2):
define void @isr_int_co_seg_overrun() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sra_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sra_epi16(__m128i A, __m128i B) { return _mm_sra_epi16(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sra_epi16>:
jmp    1030 <_mm_sra_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sra_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sra_epi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int length(char *);
int length_r(char *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char s[100];
  gets(s);
  printf("Length: %d and %d\n", length(s), length_r(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <length_r@plt>
mov    -0x74(%rbp),%esi
mov    %eax,%edx
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <length@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <length_r@plt>
lea    0xe96(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Length: %d and %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @length(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @length_r(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Length: %d and %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @length(i8* %2)
%5 = call i32 @length_r(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
int fun580() { return 580; }


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

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

LLVM IR (-O0):
define i32 @fun580() {
ret i32 580
}

LLVM IR (-O2):
define i32 @fun580() {
ret i32 580
}
/* Type definitions */
typedef int /*<<< orphan*/ XColor;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XColor(void *_p) {
  if (_p == NULL)
    abort();
  free((XColor *)_p);
}


x86 assembly (clang, -O0):
<free_XColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XColor+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XColor>:
test   %rdi,%rdi
je     112a <free_XColor+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XColor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XColor(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run_perf_tests();
int main(int argc, char *argv[]) {
  printf(":: format performance test harness ::\n");
  run_perf_tests();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c":: format performance test harness ::\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @run_perf_tests()
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c":: format performance test harness ::\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @run_perf_tests()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ green_mask;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
unsigned long get_XVisualInfo_green_mask(void *_p) {
  return (unsigned long)((XVisualInfo *)_p)->green_mask;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XVisualInfo_green_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XVisualInfo_green_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef unsigned int __sum16;

/* Variables and functions */
__sum16 csum_fold(unsigned int sum) {
  sum = (sum & 0xffff) + (sum >> 16);
  sum = (sum & 0xffff) + (sum >> 16);
  return ~sum;
}


x86 assembly (clang, -O0):
<csum_fold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_fold>:
movzwl %di,%eax
shr    $0x10,%edi
add    %edi,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @csum_fold(i32 %0) {
%2 = and i32 %0, 65535
%3 = lshr i32 %0, 16
%4 = add nuw nsw i32 %2, %3
%5 = and i32 %4, 65535
%6 = lshr i32 %4, 16
%7 = add nuw nsw i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void s_free(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<s_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <s_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_free>:
test   %rdi,%rdi
je     111a <s_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @s_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @s_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
void *aligned_malloc(size_t size, size_t alignment) {
  void *pointer = NULL;
  int rv = posix_memalign(&pointer, alignment, size);
  if (rv != 0) {
    pointer = NULL;
  }
  return pointer;
}


x86 assembly (clang, -O0):
<aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114e <aligned_malloc+0x3e>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_malloc>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    112e <aligned_malloc+0x1e>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @aligned_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = icmp eq i32 %5, 0
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* %7, i8* null
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
extern void do_regular_work(void) {
  printf("SuperSleep version 1.0 Running - Licensed Software\n");
  sleep(10);
}


x86 assembly (clang, -O0):
<do_regular_work>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_regular_work>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"SuperSleep version 1.0 Running - Licensed Software\0A\00"
define void @do_regular_work() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 10)
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"SuperSleep version 1.0 Running - Licensed Software\00"
define void @do_regular_work() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ stderr;
void fail(char *msg) {
  fputs(msg, stderr);
  setenv("?", "1", 1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xebb(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xeca(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x1,%edx
pop    %rax
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"?\00"
@.str.1 = [2 x i8] c"1\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 @setenv(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void writefile(const char *path, const char *text) {
  FILE *fd = fopen(path, "w");
  fputs(text, fd);
  fflush(fd);
  fclose(fd);
}


x86 assembly (clang, -O0):
<writefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fflush@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writefile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1050 <fflush@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @writefile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = call i32 @fputs(i8* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fflush(i32* %11)
%13 = load i32*, i32** %5
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writefile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fputs(i8* %1, i32* %3)
%5 = tail call i32 @fflush(i32* %3)
%6 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int syslinux_setadv(int tag, size_t size, const void *data) { return 0; }


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

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

LLVM IR (-O0):
define i32 @syslinux_setadv(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @syslinux_setadv(i32 %0, i64 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
double cos(double);
double _interpolate(double a, double b, double amount) {
  amount = (1.0 - cos(amount * 3.1415927)) * 0.5;
  return a * (1.0 - amount) + b * amount;
}


x86 assembly (clang, -O0):
<_interpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_interpolate>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  0xed8(%rip),%xmm2
movapd %xmm2,%xmm0
call   1030 <cos@plt>
movsd  0xecf(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
mulsd  0xec7(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @_interpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double %7, 0x400921FB5A7ED197
%9 = call double @cos(double %8)
%10 = fsub double 1.000000e+00, %9
%11 = fmul double %10, 5.000000e-01
store double %11, double* %6
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fsub double 1.000000e+00, %13
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %12, double %14, double %17)
ret double %18
}

LLVM IR (-O2):
define double @_interpolate(double %0, double %1, double %2) {
%4 = fmul double %2, 0x400921FB5A7ED197
%5 = tail call double @cos(double %4)
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %6, 5.000000e-01
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %7, %1
%10 = tail call double @llvm.fmuladd.f64(double %0, double %8, double %9)
ret double %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_next_linear_product_solution(int n, int *i, int *m, double *sol) {
  int fail, a[2];
  a[0] = n, a[1] = *i;
  fail = _ada_use_c2phc(143, a, m, sol);
  *i = a[1];
  return fail;
}


x86 assembly (clang, -O0):
<solcon_next_linear_product_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x8f,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_next_linear_product_solution>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x8f,%edi
call   1030 <_ada_use_c2phc@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @solcon_next_linear_product_solution(i32 %0, i32* %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca [2 x i32]
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%17 = load i32*, i32** %7
%18 = load double*, double** %8
%19 = call i32 @_ada_use_c2phc(i32 143, i32* %16, i32* %17, double* %18)
store i32 %19, i32* %9
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%21 = load i32, i32* %20
%22 = load i32*, i32** %6
store i32 %21, i32* %22
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @solcon_next_linear_product_solution(i32 %0, i32* nocapture %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = load i32, i32* %1
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %8, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 143, i32* %7, i32* %2, double* %3)
%11 = load i32, i32* %9
store i32 %11, i32* %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int init(char *buff) {
  if (buff) {
    char tmp[] = {0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
                  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x10};
    memcpy(buff, tmp, 16);
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <init+0x4b>
mov    0xed2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    1162 <init+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
test   %rdi,%rdi
je     1138 <init+0x28>
sub    $0x18,%rsp
movaps 0xee0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@__const.init.tmp = [16 x i8] c"\01\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\10"
define i32 @init(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [16 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = bitcast [16 x i8]* %4 to i8*
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 16)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@__const.init.tmp = [16 x i8] c"\01\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\10"
define i32 @init(i8* %0) {
%2 = alloca [16 x i8]
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @memcpy(i8* %0, i8* %5, i32 16)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
double M2z_y(double, double, double, double);
double M3y_y(double sign, double xi, double et, double qq) {
  return M2z_y(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<M3y_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <M2z_y@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3y_y>:
jmp    1030 <M2z_y@plt>

LLVM IR (-O0):
define double @M3y_y(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @M2z_y(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @M3y_y(double %0, double %1, double %2, double %3) {
%5 = tail call double @M2z_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_action_frame_usage(void) {
  printf("\nUsage : wifidirect_action_frame <CONFIG_FILE> |"
         " [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\n");
  printf("\nAction frame is sent using parameters in the CONFIG_FILE "
         "or parameters specified on command line.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_action_frame_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"\0AUsage : wifidirect_action_frame <CONFIG_FILE> | [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\0A\00"
@.str.1 = [100 x i8] c"\0AAction frame is sent using parameters in the CONFIG_FILE or parameters specified on command line.\0A\00"
define void @print_wifidirect_action_frame_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [100 x i8] c"\0AUsage : wifidirect_action_frame <CONFIG_FILE> | [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\00"
@str.2 = [99 x i8] c"\0AAction frame is sent using parameters in the CONFIG_FILE or parameters specified on command line.\00"
define void @print_wifidirect_action_frame_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test3a(unsigned int const *);
void test3(const unsigned *src) { test3a(src); }


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

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <test3a@plt>

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

LLVM IR (-O2):
define void @test3(i32* %0) {
%2 = tail call i32 @test3a(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_miro() { printf("This is Test method"); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"This is Test method\00"
define void @hello_miro() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
double secs2days(double s) { return s / 86400.; }


x86 assembly (clang, -O0):
<secs2days>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<secs2days>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @secs2days(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 8.640000e+04
ret double %4
}

LLVM IR (-O2):
define double @secs2days(double %0) {
%2 = fdiv double %0, 8.640000e+04
ret double %2
}
int regulator_bulk_enable(int num_consumers,
                          struct regulator_bulk_data *consumers) {
  return 0;
}


x86 assembly (clang, -O0):
<regulator_bulk_enable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.regulator_bulk_data = type opaque
define i32 @regulator_bulk_enable(i32 %0, %struct.regulator_bulk_data* %1) {
%3 = alloca i32
%4 = alloca %struct.regulator_bulk_data*
store i32 %0, i32* %3
store %struct.regulator_bulk_data* %1, %struct.regulator_bulk_data** %4
ret i32 0
}

LLVM IR (-O2):
%struct.regulator_bulk_data = type opaque
define i32 @regulator_bulk_enable(i32 %0, %struct.regulator_bulk_data* nocapture readnone %1) {
ret i32 0
}
void subfunc(int a) {
  a *= 2;
  a *= 2;
}


x86 assembly (clang, -O0):
<subfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @subfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @subfunc(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float, float);
int main() {
  float target, a, b, c, d;
  target = 51235;
  a = target + 7.0;
  b = target - 7.0;
  c = target * 7.0;
  d = target / 7.0;
  printf("%.2f %.2f %.2f %.2f\n", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movss  0xed8(%rip),%xmm2
movss  0xed4(%rip),%xmm3
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%.2f %.2f %.2f %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 5.123500e+04, float* %2
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 7.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fsub double %12, 7.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %4
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fmul double %16, 7.000000e+00
%18 = fptrunc double %17 to float
store float %18, float* %5
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = fdiv double %20, 7.000000e+00
%22 = fptrunc double %21 to float
store float %22, float* %6
%23 = load float, float* %3
%24 = load float, float* %4
%25 = load float, float* %5
%26 = load float, float* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %23, float %24, float %25, float %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%.2f %.2f %.2f %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float 5.124200e+04, float 5.122800e+04, float 3.586450e+05, float 0x40BC974920000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_display2d(char **);
void ft_display3d(char **array[]) {
  int level;
  level = -1;
  while (array[++level])
    ft_display2d(array[level]);
}


x86 assembly (clang, -O0):
<ft_display3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <ft_display3d+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_display2d@plt>
jmp    1123 <ft_display3d+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_display3d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <ft_display3d+0x21>
add    $0x8,%rbx
call   1030 <ft_display2d@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <ft_display3d+0x10>
pop    %rbx
ret

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

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