xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned char const uint32_t;

/* Variables and functions */
uint32_t get_uint32_le(const unsigned char *ptr) {
  return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
}


x86 assembly (clang, -O0):
<get_uint32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint32_le>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint32_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = trunc i32 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @get_uint32_le(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int swab(int arg) {
  return ((arg & 0xff) << 24) | ((arg & 0xff00) << 8) |
         ((arg & 0xff0000) >> 8) | ((arg & 0xff000000) >> 24);
}


x86 assembly (clang, -O0):
<swab>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swab(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int divisible(int n, int x) { return n % x == 0; }


x86 assembly (clang, -O0):
<divisible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisible>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @divisible(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @divisible(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pmrf_delay_us(int);
int /*<<< orphan*/ pmrf_reset_pin(int);
void mrf24j40_hard_reset() {
  pmrf_reset_pin(0);
  pmrf_delay_us(500);
  pmrf_reset_pin(1);
  pmrf_delay_us(500);
}


x86 assembly (clang, -O0):
<mrf24j40_hard_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pmrf_reset_pin@plt>
mov    $0x1f4,%edi
call   1040 <pmrf_delay_us@plt>
mov    $0x1,%edi
call   1030 <pmrf_reset_pin@plt>
mov    $0x1f4,%edi
call   1040 <pmrf_delay_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_hard_reset>:
push   %rax
xor    %edi,%edi
call   1030 <pmrf_reset_pin@plt>
mov    $0x1f4,%edi
call   1040 <pmrf_delay_us@plt>
mov    $0x1,%edi
call   1030 <pmrf_reset_pin@plt>
mov    $0x1f4,%edi
pop    %rax
jmp    1040 <pmrf_delay_us@plt>

LLVM IR (-O0):
define void @mrf24j40_hard_reset() {
%1 = call i32 @pmrf_reset_pin(i32 0)
%2 = call i32 @pmrf_delay_us(i32 500)
%3 = call i32 @pmrf_reset_pin(i32 1)
%4 = call i32 @pmrf_delay_us(i32 500)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_hard_reset() {
%1 = tail call i32 @pmrf_reset_pin(i32 0)
%2 = tail call i32 @pmrf_delay_us(i32 500)
%3 = tail call i32 @pmrf_reset_pin(i32 1)
%4 = tail call i32 @pmrf_delay_us(i32 500)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *mgc_create_identifier(char *str) {
  char *new_str = malloc(strlen(str) + 1);
  strcpy(new_str, str);
  return new_str;
}


x86 assembly (clang, -O0):
<mgc_create_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgc_create_identifier>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mgc_create_identifier(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @mgc_create_identifier(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wdt_reset() { usleep(100); }


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

x86 assembly (clang, -O2):
<wdt_reset>:
mov    $0x64,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wdt_reset() {
%1 = call i32 @usleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @wdt_reset() {
%1 = tail call i32 @usleep(i32 100)
ret void
}
/* Variables and functions */
void *basis_malloc(long);
void *basis_calloc(long length, int obj_size) {
  void *p;
  p = basis_malloc(length * obj_size);
  return p;
}


x86 assembly (clang, -O0):
<basis_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   %rax,%rdi
call   1030 <basis_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basis_calloc>:
movslq %esi,%rax
imul   %rax,%rdi
jmp    1030 <basis_malloc@plt>

LLVM IR (-O0):
define i8* @basis_calloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
%10 = call i8* @basis_malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @basis_calloc(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = mul nsw i64 %3, %0
%5 = tail call i8* @basis_malloc(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ enable_servo_interrupt();
void servo_init(void) {
  (*(volatile unsigned long *)((0xE0008004))) = 0;
  (*(volatile unsigned long *)((0xE0008008))) = 0;
  (*(volatile unsigned long *)((0xE0008010))) = 0;
  (*(volatile unsigned long *)((0xE000800C))) =
      (int)(((14745600 * 4) / 1000) / 255);
  (*(volatile unsigned long *)((0xE0008000))) = 0x01;
  (*(volatile unsigned long *)((0xE0008014))) = 0x01;
  (*(volatile unsigned long *)((0xE0008018))) = 255 * 18;
  (*(volatile unsigned long *)((0xE0008004))) = 1;
  enable_servo_interrupt();
}


x86 assembly (clang, -O0):
<servo_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0008004,%eax
movq   $0x0,(%rax)
mov    $0xe0008008,%eax
movq   $0x0,(%rax)
mov    $0xe0008010,%eax
movq   $0x0,(%rax)
mov    $0xe000800c,%eax
movq   $0xe7,(%rax)
mov    $0xe0008000,%eax
movq   $0x1,(%rax)
mov    $0xe0008014,%eax
movq   $0x1,(%rax)
mov    $0xe0008018,%eax
movq   $0x11ee,(%rax)
mov    $0xe0008004,%eax
movq   $0x1,(%rax)
mov    $0x0,%al
call   1030 <enable_servo_interrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<servo_init>:
mov    $0xe0008004,%eax
movq   $0x0,(%rax)
movq   $0x0,0x4(%rax)
movq   $0x0,0xc(%rax)
movq   $0xe7,0x8(%rax)
movq   $0x1,-0x4(%rax)
movq   $0x1,0x10(%rax)
movq   $0x11ee,0x14(%rax)
movq   $0x1,(%rax)
xor    %eax,%eax
jmp    1030 <enable_servo_interrupt@plt>

LLVM IR (-O0):
define void @servo_init() {
store volatile i64 0, i64* inttoptr (i64 3758129156 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758129160 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758129168 to i64*)
store volatile i64 231, i64* inttoptr (i64 3758129164 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129152 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129172 to i64*)
store volatile i64 4590, i64* inttoptr (i64 3758129176 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129156 to i64*)
%1 = call i32 (...) @enable_servo_interrupt()
ret void
}

LLVM IR (-O2):
define void @servo_init() {
store volatile i64 0, i64* inttoptr (i64 3758129156 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758129160 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758129168 to i64*)
store volatile i64 231, i64* inttoptr (i64 3758129164 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129152 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129172 to i64*)
store volatile i64 4590, i64* inttoptr (i64 3758129176 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758129156 to i64*)
%1 = tail call i32 (...) @enable_servo_interrupt()
ret void
}
/* Type definitions */
struct fastx_read_list_s {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fastx_read_list_scan_read(struct fastx_read_list_s *,
                                     int /*<<< orphan*/ *, int);
size_t fastx_read_list_scan_se(struct fastx_read_list_s *fastx_read_list,
                               FILE *fp, int flags) {
  size_t numreads = 0;
  while (fastx_read_list_scan_read(fastx_read_list, fp, flags) > 0)
    numreads++;
  return numreads;
}


x86 assembly (clang, -O0):
<fastx_read_list_scan_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fastx_read_list_scan_read@plt>
cmp    $0x0,%rax
jle    1156 <fastx_read_list_scan_se+0x46>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <fastx_read_list_scan_se+0x1b>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastx_read_list_scan_se>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0xffffffffffffffff,%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <fastx_read_list_scan_read@plt>
add    $0x1,%rbp
test   %rax,%rax
jg     1130 <fastx_read_list_scan_se+0x20>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fastx_read_list_s = type { i32 }
define i64 @fastx_read_list_scan_se(%struct.fastx_read_list_s* %0, i32* %1, i32 %2) {
%4 = alloca %struct.fastx_read_list_s*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
store %struct.fastx_read_list_s* %0, %struct.fastx_read_list_s** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i64 0, i64* %7
br label %8
8: ; preds = %14, %3
%9 = load %struct.fastx_read_list_s*, %struct.fastx_read_list_s** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i64 @fastx_read_list_scan_read(%struct.fastx_read_list_s* %9, i32* %10, i32 %11)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i64, i64* %7
%16 = add i64 %15, 1
store i64 %16, i64* %7
br label %8
17: ; preds = %8
%18 = load i64, i64* %7
ret i64 %18
}

LLVM IR (-O2):
%struct.fastx_read_list_s = type { i32 }
define i64 @fastx_read_list_scan_se(%struct.fastx_read_list_s* %0, i32* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ 0, %3 ], [ %8, %4 ]
%6 = tail call i64 @fastx_read_list_scan_read(%struct.fastx_read_list_s* %0, i32* %1, i32 %2)
%7 = icmp sgt i64 %6, 0
%8 = add i64 %5, 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ ecl2fk5(double *, double *, double);
int /*<<< orphan*/ fk524e(double *, double *, double);
void ecl2fk4(double *dtheta, double *dphi, double epoch) {
  ecl2fk5(dtheta, dphi, epoch);
  fk524e(dtheta, dphi, epoch);
  return;
}


x86 assembly (clang, -O0):
<ecl2fk4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1030 <ecl2fk5@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1040 <fk524e@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecl2fk4>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <ecl2fk5@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fk524e@plt>

LLVM IR (-O0):
define void @ecl2fk4(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** %4
%8 = load double*, double** %5
%9 = load double, double* %6
%10 = call i32 @ecl2fk5(double* %7, double* %8, double %9)
%11 = load double*, double** %4
%12 = load double*, double** %5
%13 = load double, double* %6
%14 = call i32 @fk524e(double* %11, double* %12, double %13)
ret void
}

LLVM IR (-O2):
define void @ecl2fk4(double* %0, double* %1, double %2) {
%4 = tail call i32 @ecl2fk5(double* %0, double* %1, double %2)
%5 = tail call i32 @fk524e(double* %0, double* %1, double %2)
ret void
}
struct clk_hw *__clk_get_hw(struct clk *clk) {
  return (struct clk_hw *)clk;
}


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

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

LLVM IR (-O0):
%struct.clk_hw = type opaque
%struct.clk = type opaque
define %struct.clk_hw* @__clk_get_hw(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
%3 = load %struct.clk*, %struct.clk** %2
%4 = bitcast %struct.clk* %3 to %struct.clk_hw*
ret %struct.clk_hw* %4
}

LLVM IR (-O2):
%struct.clk_hw = type opaque
%struct.clk = type opaque
define %struct.clk_hw* @__clk_get_hw(%struct.clk* readnone %0) {
%2 = bitcast %struct.clk* %0 to %struct.clk_hw*
ret %struct.clk_hw* %2
}
/* Variables and functions */
unsigned long long do_ceil(unsigned long long const, int);
unsigned long long get_num_blocks(const unsigned long long num_bytes) {
  return do_ceil(num_bytes, 16);
}


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

x86 assembly (clang, -O2):
<get_num_blocks>:
mov    $0x10,%esi
jmp    1030 <do_ceil@plt>

LLVM IR (-O0):
define i64 @get_num_blocks(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @do_ceil(i64 %3, i32 16)
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_num_blocks(i64 %0) {
%2 = tail call i64 @do_ceil(i64 %0, i32 16)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void safe_raw_copy(void *destination, const void *source, size_t number,
                   size_t sizeOfElement) {
  if (number > 0)
    memcpy(destination, source, number * sizeOfElement);
}


x86 assembly (clang, -O0):
<safe_raw_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1149 <safe_raw_copy+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
imul   -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_raw_copy>:
test   %rdx,%rdx
je     1121 <safe_raw_copy+0x11>
imul   %rdx,%rcx
mov    %rcx,%rdx
jmp    1030 <memcpy@plt>
ret

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

LLVM IR (-O2):
define void @safe_raw_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = mul i64 %3, %2
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %7)
br label %9
9: ; preds = %6, %4
ret void
}
void up_start_monitor(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @up_start_monitor(i8* nocapture %0) {
ret void
}
float max_f(float a, float b) { return (b < a) ? a : b; }


x86 assembly (clang, -O0):
<max_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <max_f+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <max_f+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @max_f(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float %0, float %1
ret float %4
}
void Q() {}


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

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

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

LLVM IR (-O2):
define void @Q() {
ret void
}
int main() {
  int i;
  (void)(10 / i);
}


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() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = sdiv i32 10, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void makeDotTxt(char *dst, char *src) {
  strcpy(dst, src);
  strcat(dst, ".txt");
}


x86 assembly (clang, -O0):
<makeDotTxt>:
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 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeDotTxt>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".txt\00"
define void @makeDotTxt(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 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".txt\00"
define void @makeDotTxt(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_shift(int a, int shift) { return a >> shift; }


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

x86 assembly (clang, -O2):
<do_shift>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @do_shift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned short *, unsigned char const *, int);
unsigned short ntohs(unsigned short);
unsigned short readInt16FromBuffer(const unsigned char *buffer,
                                   unsigned short *offset) {
  unsigned short value;
  memcpy(&value, buffer + *offset, sizeof(unsigned short));
  value = ntohs(value);
  *offset += sizeof(unsigned short);
  return value;
}


x86 assembly (clang, -O0):
<readInt16FromBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
cltq
add    %rax,%rsi
lea    -0x12(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movzwl -0x12(%rbp),%edi
call   1040 <ntohs@plt>
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
add    $0x2,%rcx
mov    %cx,(%rax)
movzwl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt16FromBuffer>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movzwl (%rsi),%esi
add    %rdi,%rsi
lea    0xe(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movzwl 0xe(%rsp),%edi
call   1040 <ntohs@plt>
addw   $0x2,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @readInt16FromBuffer(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i16
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i8*, i8** %3
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = call i32 @memcpy(i16* %5, i8* %11, i32 2)
%13 = load i16, i16* %5
%14 = call zeroext i16 @ntohs(i16 zeroext %13)
store i16 %14, i16* %5
%15 = load i16*, i16** %4
%16 = load i16, i16* %15
%17 = zext i16 %16 to i64
%18 = add i64 %17, 2
%19 = trunc i64 %18 to i16
store i16 %19, i16* %15
%20 = load i16, i16* %5
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @readInt16FromBuffer(i8* %0, i16* nocapture %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
%5 = load i16, i16* %1
%6 = zext i16 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = call i32 @memcpy(i16* %3, i8* %7, i32 2)
%9 = load i16, i16* %3
%10 = call zeroext i16 @ntohs(i16 zeroext %9)
%11 = load i16, i16* %1
%12 = add i16 %11, 2
store i16 %12, i16* %1
ret i16 %10
}
/* Variables and functions */
unsigned int __arch_hweight32(unsigned int);
unsigned int __arch_hweight16(unsigned int w) {
  return __arch_hweight32(w & 0xffff);
}


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

x86 assembly (clang, -O2):
<__arch_hweight16>:
movzwl %di,%edi
jmp    1030 <__arch_hweight32@plt>

LLVM IR (-O0):
define i32 @__arch_hweight16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = call i32 @__arch_hweight32(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @__arch_hweight16(i32 %0) {
%2 = and i32 %0, 65535
%3 = tail call i32 @__arch_hweight32(i32 %2)
ret i32 %3
}
double normf(double x) {
  if (x < 0.0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<normf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <normf+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normf>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @normf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @normf(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double, double, double);
void ltr_int_print_vec(double vec[3], char *name) {
  printf("%s=[%f;%f;%f]\n", name, vec[0], vec[1], vec[2]);
}


x86 assembly (clang, -O0):
<ltr_int_print_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_print_vec>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s=[%f;%f;%f]\0A\00"
define void @ltr_int_print_vec(double* %0, i8* %1) {
%3 = alloca double*
%4 = alloca i8*
store double* %0, double** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, double %8, double %11, double %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s=[%f;%f;%f]\0A\00"
define void @ltr_int_print_vec(double* nocapture %0, i8* %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, double %3, double %5, double %7)
ret void
}
double convert_to_mv(int given) {
  double d;
  d = given * 1.0;
  d *= (5000.0 / 1023.0);
  return (d);
}


x86 assembly (clang, -O0):
<convert_to_mv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_mv>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @convert_to_mv(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 1.000000e+00
store double %6, double* %3
%7 = load double, double* %3
%8 = fmul double %7, 0x40138CE338CE338D
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @convert_to_mv(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x40138CE338CE338D
ret double %3
}
/* Variables and functions */
int print_status();
int main() { return print_status(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_status()
ret i32 %1
}
/* Variables and functions */
int uart1_rx(char *);
void uart1_rxb(char *c) {
  while (uart1_rx(c) == -1)
    ;
}


x86 assembly (clang, -O0):
<uart1_rxb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <uart1_rx@plt>
cmp    $0xffffffff,%eax
jne    1133 <uart1_rxb+0x23>
jmp    111c <uart1_rxb+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1_rxb>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <uart1_rx@plt>
cmp    $0xffffffff,%eax
je     1120 <uart1_rxb+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart1_rxb(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @uart1_rx(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pipe(int *);
void initpipe(int *fds) {
  if (pipe(fds) == -1) {
    perror("pipe");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<initpipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1164 <initpipe+0x34>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initpipe>:
push   %rax
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     113d <initpipe+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"pipe\00"
define void @initpipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *hscore_open(char *);
void hscore_clean() {
  FILE *file = hscore_open("wb");
  if (file != NULL) {
    int val = 25;
    ;
    fwrite(&val, sizeof(int), 1, file);
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<hscore_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <hscore_open@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117a <hscore_clean+0x4a>
movl   $0x19,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hscore_clean>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <hscore_open@plt>
test   %rax,%rax
je     1170 <hscore_clean+0x40>
mov    %rax,%rbx
movl   $0x19,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @hscore_clean() {
%1 = alloca i32
%2 = tail call i32* @hscore_open(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = bitcast i32* %1 to i8*
store i32 25, i32* %1
%6 = call i32 @fwrite(i32* %1, i32 4, i32 1, i32* %2)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %0
ret void
}
void CleanupScreen(int scr) {}


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

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

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

LLVM IR (-O2):
define void @CleanupScreen(i32 %0) {
ret void
}
int f_bgt_mm1(float *a1, float *a2) { return (__builtin_isgreater(*a1, *a2)); }


x86 assembly (clang, -O0):
<f_bgt_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_mm1>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @f_bgt_mm1(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp ogt float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SYS_renameat2;
int syscall(int /*<<< orphan*/, int, char const *, int, char const *,
            unsigned int);
int renameat2(int olddirfd, const char *oldpath, int newdirfd,
              const char *newpath, unsigned int flags) {
  return syscall(SYS_renameat2, olddirfd, oldpath, newdirfd, newpath, flags);
}


x86 assembly (clang, -O0):
<renameat2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameat2>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_renameat2 = global i32 0
define i32 @renameat2(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @SYS_renameat2
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @syscall(i32 %11, i32 %12, i8* %13, i32 %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@SYS_renameat2 = global i32 0
define i32 @renameat2(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = load i32, i32* @SYS_renameat2
%7 = tail call i32 @syscall(i32 %6, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %7
}
int main(int argc, char *argv[]) {
  int res = 0;
  return res;
}


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

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

LLVM IR (-O0):
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 0, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned xrop3_32_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = D & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_32_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_32_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_32_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_32_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = and i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int sin(double);
double math_csc(double x) { return 1 / sin(x); }


x86 assembly (clang, -O0):
<math_csc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_csc>:
push   %rax
call   1030 <sin@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @math_csc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @math_csc(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ PrintMsg(void *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ TeamName(int);
int /*<<< orphan*/ Team_ResetFlag(int);
int /*<<< orphan*/ Team_ReturnFlagSound(int /*<<< orphan*/, int);
void Team_ReturnFlag(int team) {
  Team_ReturnFlagSound(Team_ResetFlag(team), team);
  PrintMsg(((void *)0), "The %s flag has returned!\n", TeamName(team));
}


x86 assembly (clang, -O0):
<Team_ReturnFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Team_ResetFlag@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <Team_ReturnFlagSound@plt>
mov    -0x4(%rbp),%edi
call   1060 <TeamName@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%edi
lea    0xe8e(%rip),%rsi
call   1040 <PrintMsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Team_ReturnFlag>:
push   %rbx
mov    %edi,%ebx
call   1050 <Team_ResetFlag@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <Team_ReturnFlagSound@plt>
mov    %ebx,%edi
call   1060 <TeamName@plt>
lea    0xea1(%rip),%rsi
xor    %edi,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <PrintMsg@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"The %s flag has returned!\0A\00"
define void @Team_ReturnFlag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Team_ResetFlag(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @Team_ReturnFlagSound(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @TeamName(i32 %7)
%9 = call i32 @PrintMsg(i8* null, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"The %s flag has returned!\0A\00"
define void @Team_ReturnFlag(i32 %0) {
%2 = tail call i32 @Team_ResetFlag(i32 %0)
%3 = tail call i32 @Team_ReturnFlagSound(i32 %2, i32 %0)
%4 = tail call i32 @TeamName(i32 %0)
%5 = tail call i32 @PrintMsg(i8* null, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ ALISTundo_iter();
void ALISTundo() {
  while (ALISTundo_iter())
    ;
}


x86 assembly (clang, -O0):
<ALISTundo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <ALISTundo+0x9>
mov    $0x0,%al
call   1030 <ALISTundo_iter@plt>
cmp    $0x0,%rax
je     112f <ALISTundo+0x1f>
jmp    1119 <ALISTundo+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALISTundo>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ALISTundo_iter@plt>
test   %rax,%rax
jne    1120 <ALISTundo+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @ALISTundo() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @ALISTundo_iter()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @ALISTundo() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @ALISTundo_iter()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_set_line_width(int /*<<< orphan*/, float);
void g2_set_line_width_(float *dev, float *w) {
  g2_set_line_width(dtoi(*dev), *w);
}


x86 assembly (clang, -O0):
<g2_set_line_width_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <g2_set_line_width@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_set_line_width_>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
mov    %eax,%edi
pop    %rbx
jmp    1040 <g2_set_line_width@plt>

LLVM IR (-O0):
define void @g2_set_line_width_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call i32 @dtoi(float %6)
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = call i32 @g2_set_line_width(i32 %7, float %9)
ret void
}

LLVM IR (-O2):
define void @g2_set_line_width_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = tail call i32 @dtoi(float %3)
%5 = load float, float* %1
%6 = tail call i32 @g2_set_line_width(i32 %4, float %5)
ret void
}
reg0adrx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     1139 <reg0adrx1+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <reg0adrx1+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adrx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %edi,0xa98ac7(,%rcx,4)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @reg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp uge i32 %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
void f(int A) { int s = A; }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void RTThreadUnblocked(void) {}


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

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

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

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