xunge/DecIR huggingface dataset:
void swap(int *first, int *second) {
  int swap_pos;
  swap_pos = *first;
  *first = *second;
  *second = swap_pos;
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
struct drc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_crossover(struct drc *);
int /*<<< orphan*/ init_data_buffer(struct drc *);
int /*<<< orphan*/ init_emphasis_eq(struct drc *);
int /*<<< orphan*/ init_kernel(struct drc *);
void drc_init(struct drc *drc) {
  init_data_buffer(drc);
  init_emphasis_eq(drc);
  init_crossover(drc);
  init_kernel(drc);
}


x86 assembly (clang, -O0):
<drc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <init_data_buffer@plt>
mov    -0x8(%rbp),%rdi
call   1040 <init_emphasis_eq@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_crossover@plt>
mov    -0x8(%rbp),%rdi
call   1060 <init_kernel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drc_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <init_data_buffer@plt>
mov    %rbx,%rdi
call   1040 <init_emphasis_eq@plt>
mov    %rbx,%rdi
call   1050 <init_crossover@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <init_kernel@plt>

LLVM IR (-O0):
%struct.drc = type { i32 }
define void @drc_init(%struct.drc* %0) {
%2 = alloca %struct.drc*
store %struct.drc* %0, %struct.drc** %2
%3 = load %struct.drc*, %struct.drc** %2
%4 = call i32 @init_data_buffer(%struct.drc* %3)
%5 = load %struct.drc*, %struct.drc** %2
%6 = call i32 @init_emphasis_eq(%struct.drc* %5)
%7 = load %struct.drc*, %struct.drc** %2
%8 = call i32 @init_crossover(%struct.drc* %7)
%9 = load %struct.drc*, %struct.drc** %2
%10 = call i32 @init_kernel(%struct.drc* %9)
ret void
}

LLVM IR (-O2):
%struct.drc = type { i32 }
define void @drc_init(%struct.drc* %0) {
%2 = tail call i32 @init_data_buffer(%struct.drc* %0)
%3 = tail call i32 @init_emphasis_eq(%struct.drc* %0)
%4 = tail call i32 @init_crossover(%struct.drc* %0)
%5 = tail call i32 @init_kernel(%struct.drc* %0)
ret void
}
void t10() {}


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

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

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

LLVM IR (-O2):
define void @t10() {
ret void
}
unsigned long SysTickPeriodGet(void) {
  return ((*((volatile unsigned long *)(0xE000E014))) + 1);
}


x86 assembly (clang, -O0):
<SysTickPeriodGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e014,%eax
mov    (%rax),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickPeriodGet>:
mov    $0xe000e014,%eax
mov    (%rax),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @SysTickPeriodGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153748 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysTickPeriodGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153748 to i64*)
%2 = add i64 %1, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World from t1 Main!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hello World from t1 Main!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Hello World from t1 Main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ genExtra3(char *);
void _foo_foo() { genExtra3("#define FSUB1(name) PREFIX(LOWCASE(name))"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"#define FSUB1(name) PREFIX(LOWCASE(name))\00"
define void @_foo_foo() {
%1 = call i32 @genExtra3(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"#define FSUB1(name) PREFIX(LOWCASE(name))\00"
define void @_foo_foo() {
%1 = tail call i32 @genExtra3(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
double fmin(double x, double y) {
  if (x < y)
    return (x);
  return (y);
}


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sqrt_ps(int /*<<< orphan*/);
__m128 t3(__m128 a, __m128 b) {
  a = _mm_sqrt_ps(a);
  b = _mm_sqrt_ps(b);
  return _mm_or_ps(a, b);
}


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

x86 assembly (clang, -O2):
<t3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <_mm_sqrt_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_mm_sqrt_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_or_ps@plt>

LLVM IR (-O0):
define i32 @t3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_mm_sqrt_ps(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @_mm_sqrt_ps(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @_mm_or_ps(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @t3(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sqrt_ps(i32 %0)
%4 = tail call i32 @_mm_sqrt_ps(i32 %1)
%5 = tail call i32 @_mm_or_ps(i32 %3, i32 %4)
ret i32 %5
}
int g(int a, int b) { return b ^ a; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct unpacker {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ unpack_u32(struct unpacker *);
int /*<<< orphan*/ zigzag_decode(int /*<<< orphan*/);
int32_t unpack_s32(struct unpacker *self) {
  return zigzag_decode(unpack_u32(self));
}


x86 assembly (clang, -O0):
<unpack_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unpack_u32@plt>
mov    %eax,%edi
call   1040 <zigzag_decode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_s32>:
push   %rax
call   1030 <unpack_u32@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <zigzag_decode@plt>

LLVM IR (-O0):
%struct.unpacker = type { i32 }
define i32 @unpack_s32(%struct.unpacker* %0) {
%2 = alloca %struct.unpacker*
store %struct.unpacker* %0, %struct.unpacker** %2
%3 = load %struct.unpacker*, %struct.unpacker** %2
%4 = call i32 @unpack_u32(%struct.unpacker* %3)
%5 = call i32 @zigzag_decode(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.unpacker = type { i32 }
define i32 @unpack_s32(%struct.unpacker* %0) {
%2 = tail call i32 @unpack_u32(%struct.unpacker* %0)
%3 = tail call i32 @zigzag_decode(i32 %2)
ret i32 %3
}
/* Variables and functions */
void *calloc(unsigned long, int);
int /*<<< orphan*/ free(void *);
void f6(int i) {
  unsigned long j;
  j = 10;
  i = -1;
  void *ptr = calloc(j, i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rax
mov    $0xa,%edi
mov    $0xffffffff,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @f6(i32 %0) {
%2 = tail call i8* @calloc(i64 10, i32 -1)
%3 = tail call i32 @free(i8* %2)
ret void
}
void rul__dbg_disable_control_c() {}


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

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

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

LLVM IR (-O2):
define void @rul__dbg_disable_control_c() {
ret void
}
void ff_sws_init_swscale_arm() {}


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

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

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

LLVM IR (-O2):
define void @ff_sws_init_swscale_arm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_line_count(char const *);
int /*<<< orphan*/ printf(char const *, char const *);
void out_str(const char *fmt, const char *str) {
  printf(fmt, str);
  out_line_count(fmt);
  out_line_count(str);
}


x86 assembly (clang, -O0):
<out_str>:
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 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <out_line_count@plt>
mov    -0x10(%rbp),%rdi
call   1040 <out_line_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @out_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @out_line_count(i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @out_line_count(i8* %10)
ret void
}

LLVM IR (-O2):
define void @out_str(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* %0, i8* %1)
%4 = tail call i32 @out_line_count(i8* %0)
%5 = tail call i32 @out_line_count(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
int main() {
  int day = 1;
  float amount = 0.01;
  while (day <= 31) {
    printf("Day %d \t Amount is : %.2f\n", day, amount);
    amount *= 2;
    day += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jg     1171 <main+0x61>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movss  0xeab(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
movss  0xedf(%rip),%xmm0
lea    0xedc(%rip),%r14
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
movss  0x4(%rsp),%xmm0
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  %xmm0,%xmm0
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Day %d \09 Amount is : %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 1, i32* %2
store float 0x3F847AE140000000, float* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 31
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8, float %9)
%11 = load float, float* %3
%12 = fmul float %11, 2.000000e+00
store float %12, float* %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Day %d \09 Amount is : %.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 0x3F847AE140000000, %0 ], [ %5, %1 ]
%3 = phi i32 [ 1, %0 ], [ %6, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, float %2)
%5 = fmul float %2, 2.000000e+00
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
void __attribute__((weak)) weak_def(void) {}


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

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

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

LLVM IR (-O2):
define weak void @weak_def() {
ret void
}
void BN_kronecker(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_kronecker() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gt() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JG   $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JG $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @gt() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JG $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @gt() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int pow(double, int);
double psi(double x) {
  if (x >= 0.)
    return 0.;
  else
    return pow(x, 4.) / (1. + pow(x, 4.));
}


x86 assembly (clang, -O0):
<psi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113c <psi+0x2c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1181 <psi+0x71>
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xe8c(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jae    1174 <psi+0x64>
sub    $0x18,%rsp
movapd %xmm1,%xmm0
mov    $0x4,%edi
movsd  %xmm1,0x8(%rsp)
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe9e(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @psi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %16
7: ; preds = %1
%8 = load double, double* %3
%9 = call i32 @pow(double %8, i32 4)
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = call i32 @pow(double %11, i32 4)
%13 = sitofp i32 %12 to double
%14 = fadd double 1.000000e+00, %13
%15 = fdiv double %10, %14
store double %15, double* %2
br label %16
16: ; preds = %7, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @psi(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @pow(double %0, i32 4)
%5 = sitofp i32 %4 to double
%6 = tail call i32 @pow(double %0, i32 4)
%7 = sitofp i32 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %5, %8
br label %10
10: ; preds = %1, %3
%11 = phi double [ %9, %3 ], [ 0.000000e+00, %1 ]
ret double %11
}
int insn_length(unsigned char code) {
  return ((((int)code + 64) >> 7) + 1) << 1;
}


x86 assembly (clang, -O0):
<insn_length>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x40,%eax
sar    $0x7,%eax
add    $0x1,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insn_length>:
add    $0x40,%edi
shr    $0x7,%edi
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @insn_length(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 64
%6 = ashr i32 %5, 7
%7 = add nsw i32 %6, 1
%8 = shl i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @insn_length(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = add nuw nsw i32 %2, 64
%4 = lshr i32 %3, 6
%5 = and i32 %4, 6
%6 = add nuw nsw i32 %5, 2
ret i32 %6
}
void initializeString(char str[], unsigned arr_size) {
  unsigned i = 0;
  for (i; i < arr_size; ++i) {
    str[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<initializeString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1137 <initializeString+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initializeString+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeString>:
test   %esi,%esi
je     1122 <initializeString+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initializeString(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void SysFreeString(char *str) { free(str); }


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

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

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

LLVM IR (-O2):
define void @SysFreeString(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recurse(int);
int main() {
  recurse(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @recurse(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @recurse(i32 10)
ret i32 0
}
void GPIOPortQ7_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortQ7_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortQ7_Handler+0x9>
jmp    1109 <GPIOPortQ7_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortQ7_Handler>:
jmp    1100 <GPIOPortQ7_Handler>

LLVM IR (-O0):
define void @GPIOPortQ7_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortQ7_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
char *fd2tai(string)
char *string;
{
  double dj, tsec, dt;
  dj = fd2jd(string);
  dt = utdt(dj);
  tsec = fd2ts(string);
  tsec = tsec + dt - 32.184;
  return (ts2fd(tsec));
}


x86 assembly (clang, -O0):
<fd2tai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1060 <utdt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe65(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1050 <ts2fd@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2tai>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1060 <utdt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fd2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
addsd  0xe7a(%rip),%xmm0
mov    $0x1,%al
call   1050 <ts2fd@plt>
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @fd2tai(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %6)
%8 = sitofp i32 %7 to double
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %5
%12 = load i8*, i8** %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2ts to i32 (i8*, ...)*)(i8* %12)
%14 = sitofp i32 %13 to double
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fadd double %15, %16
%18 = fsub double %17, 3.218400e+01
store double %18, double* %4
%19 = load double, double* %4
%20 = call i32 (double, ...) bitcast (i32 (...)* @ts2fd to i32 (double, ...)*)(double %19)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
ret i8* %22
}

LLVM IR (-O2):
define i8* @fd2tai(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2ts to i32 (i8*, ...)*)(i8* %0)
%7 = sitofp i32 %6 to double
%8 = fadd double %5, %7
%9 = fadd double %8, -3.218400e+01
%10 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2fd to i32 (double, ...)*)(double %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fc(char *optarg) { printf("o: %s\n", optarg); }


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

x86 assembly (clang, -O2):
<fc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"o: %s\0A\00"
define void @fc(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void keyup(unsigned char key, int x, int y) {
  switch (key) {
  case 'o':
    break;
  default:;
  }
}


x86 assembly (clang, -O0):
<keyup>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x6f,%al
jne    1125 <keyup+0x25>
jmp    1120 <keyup+0x20>
jmp    112a <keyup+0x2a>
jmp    112a <keyup+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @keyup(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %10 [
i32 111, label %9
]
9: ; preds = %3
br label %11
10: ; preds = %3
br label %11
11: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @keyup(i8 zeroext %0, i32 %1, i32 %2) {
ret void
}
const char *Format_Brief(void) { return "Read or Write with Format String"; }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Read or Write with Format String\00"
define i8* @Format_Brief() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"Read or Write with Format String\00"
define i8* @Format_Brief() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int f(int const *);
int main(void) {
  const int x = 5;
  const int *p = &x;
  return f(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%.2f\n", ((a - 32) / 1.8));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffe0,%eax
cvtsi2sd %eax,%xmm0
divsd  0xebb(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
scalar_t__ ntohl(long);
int64_t ntohll(int64_t x) {
  return ((int64_t)ntohl((long)(x >> 32)) & 0xFFFFFFFF) |
         (((int64_t)ntohl((long)(x & 0xFFFFFFFF))) << 32);
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
movslq %eax,%rdi
call   1030 <ntohl@plt>
and    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,%eax
mov    %eax,%edi
call   1030 <ntohl@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll>:
push   %rbx
mov    %edi,%ebx
call   1030 <ntohl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @ntohll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = sext i32 %4 to i64
%6 = call i64 @ntohl(i64 %5)
%7 = trunc i64 %6 to i32
%8 = and i32 %7, -1
%9 = load i32, i32* %2
%10 = and i32 %9, -1
%11 = zext i32 %10 to i64
%12 = call i64 @ntohl(i64 %11)
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 32
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
%2 = tail call i64 @ntohl(i64 poison)
%3 = zext i32 %0 to i64
%4 = tail call i64 @ntohl(i64 %3)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: fq [-f][-e][-E] fbin_file seq_name\n\n");
  printf("    -f    Output sequence in fasta format\n");
  printf("    -e    Output extras for sequence\n");
  printf("    -E    Output only extras for sequence\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: fq [-f][-e][-E] fbin_file seq_name\0A\0A\00"
@.str.1 = [43 x i8] c" -f Output sequence in fasta format\0A\00"
@.str.2 = [38 x i8] c" -e Output extras for sequence\0A\00"
@.str.3 = [43 x i8] c" -E Output only extras for sequence\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"Usage: fq [-f][-e][-E] fbin_file seq_name\0A\00"
@str.4 = [42 x i8] c" -f Output sequence in fasta format\00"
@str.5 = [37 x i8] c" -e Output extras for sequence\00"
@str.6 = [42 x i8] c" -E Output only extras for sequence\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_assembler_comments() {
  test_parser_verify_parse(
      test_parser_sourcefile("assembler", " !comment\n ;comment"), "assembler",
      "", "!comment\n;comment", 0);
}


x86 assembly (clang, -O0):
<test_assembler_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xed0(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assembler_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rdx
lea    0xed9(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"assembler\00"
@.str.1 = [20 x i8] c" !comment\0A ;comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [18 x i8] c"!comment\0A;comment\00"
define void @test_assembler_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"assembler\00"
@.str.1 = [20 x i8] c" !comment\0A ;comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [18 x i8] c"!comment\0A;comment\00"
define void @test_assembler_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
unsigned long prioq__rchild(unsigned long index) { return (index << 1) + 2; }


x86 assembly (clang, -O0):
<prioq__rchild>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prioq__rchild>:
lea    (%rdi,%rdi,1),%rax
add    $0x2,%rax
ret

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

LLVM IR (-O2):
define i64 @prioq__rchild(i64 %0) {
%2 = shl i64 %0, 1
%3 = add i64 %2, 2
ret i64 %3
}
void event_text(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @event_text(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ String_reverse(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[] = "pihclanoitan";
  String_reverse(str);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rdi
call   1040 <String_reverse@plt>
lea    -0x11(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6e6174696f6e61,%rax
mov    %rax,0x5(%rsp)
movabs $0x6f6e616c63686970,%rax
61 6e 6f
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <String_reverse@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.str = [13 x i8] c"pihclanoitan\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @String_reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void popa() { db(0x61); }


x86 assembly (clang, -O0):
<popa>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<popa>:
mov    $0x61,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @popa() {
%1 = call i32 @db(i32 97)
ret void
}

LLVM IR (-O2):
define void @popa() {
%1 = tail call i32 @db(i32 97)
ret void
}
unsigned blend_dodge(register unsigned color1, register unsigned color2) {
  unsigned c = (((color2) << 8) / (256 - (color1)));
  return c > 255 ? 255 : c;
}


x86 assembly (clang, -O0):
<blend_dodge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    $0x100,%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jbe    1139 <blend_dodge+0x39>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <blend_dodge+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_dodge>:
mov    %esi,%eax
shl    $0x8,%eax
mov    $0x100,%ecx
sub    %edi,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @blend_dodge(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 %6, 8
%8 = load i32, i32* %3
%9 = sub i32 256, %8
%10 = udiv i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ugt i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %2
br label %16
14: ; preds = %2
%15 = load i32, i32* %5
br label %16
16: ; preds = %14, %13
%17 = phi i32 [ 255, %13 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @blend_dodge(i32 %0, i32 %1) {
%3 = shl i32 %1, 8
%4 = sub i32 256, %0
%5 = udiv i32 %3, %4
%6 = icmp ult i32 %5, 255
%7 = select i1 %6, i32 %5, i32 255
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ decrypt();
int /*<<< orphan*/ encrypt();
int main(int argc, char **argv) {
  encrypt();
  decrypt();
  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)
mov    $0x0,%al
call   1040 <encrypt@plt>
mov    $0x0,%al
call   1030 <decrypt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <encrypt@plt>
xor    %eax,%eax
call   1030 <decrypt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @encrypt()
%7 = call i32 (...) @decrypt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @encrypt()
%4 = tail call i32 (...) @decrypt()
ret i32 0
}
int foo(int a, int b, ...) { return a + b; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @foo(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, ...) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IsElmLL(int /*<<< orphan*/);
int /*<<< orphan*/ NextElmLL(void *);
int IsLastElmLL(void *el) { return !IsElmLL(NextElmLL(el)); }


x86 assembly (clang, -O0):
<IsLastElmLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <NextElmLL@plt>
mov    %eax,%edi
call   1040 <IsElmLL@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLastElmLL>:
push   %rax
call   1030 <NextElmLL@plt>
mov    %eax,%edi
call   1040 <IsElmLL@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsLastElmLL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @NextElmLL(i8* %3)
%5 = call i32 @IsElmLL(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsLastElmLL(i8* %0) {
%2 = tail call i32 @NextElmLL(i8* %0)
%3 = tail call i32 @IsElmLL(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sbc(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regi_op();
void arm_sbc_regi() { arm_arith_sbc(arm_data_regi_op()); }


x86 assembly (clang, -O0):
<arm_sbc_regi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_regi_op@plt>
mov    %eax,%edi
call   1040 <arm_arith_sbc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sbc_regi>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_regi_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_arith_sbc@plt>

LLVM IR (-O0):
define void @arm_sbc_regi() {
%1 = call i32 (...) @arm_data_regi_op()
%2 = call i32 @arm_arith_sbc(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sbc_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_sbc(i32 %1)
ret void
}
int main() {
#pragma omp parallel
  { ; }
}


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fwait() { db(0x9B); }


x86 assembly (clang, -O0):
<fwait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwait>:
mov    $0x9b,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fwait() {
%1 = call i32 @db(i32 155)
ret void
}

LLVM IR (-O2):
define void @fwait() {
%1 = tail call i32 @db(i32 155)
ret void
}