xunge/DecIR huggingface dataset:
unsigned int currsp(void) {
  unsigned int esp;
  asm("movl %%esp,%0 " : "=rm"(esp));
  return esp;
}


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

x86 assembly (clang, -O2):
<currsp>:
mov    %esp,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @currsp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @currsp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ SG_DXFER_FROM_DEV;
int scsi_command(int, int /*<<< orphan*/, int /*<<< orphan*/ const *, int,
                 int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/ *,
                 int /*<<< orphan*/);
int test_unit_ready(int fd, uint8_t *requestsense) {
  static const uint8_t command[] = {0, 0, 0, 0, 0, 0};
  return scsi_command(fd, SG_DXFER_FROM_DEV, command, sizeof(command), NULL, 0,
                      requestsense, 0);
}


x86 assembly (clang, -O0):
<test_unit_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
lea    0xeca(%rip),%rdx
mov    $0x18,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <scsi_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unit_ready>:
push   %rax
mov    %rsi,%rax
mov    0x2ecd(%rip),%rcx
mov    (%rcx),%esi
lea    0xedc(%rip),%rdx
mov    $0x18,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   %rax
call   1030 <scsi_command@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@test_unit_ready.command = internal constant [6 x i32] zeroinitializer
@SG_DXFER_FROM_DEV = global i32 0
define i32 @test_unit_ready(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* @SG_DXFER_FROM_DEV
%7 = load i32*, i32** %4
%8 = call i32 @scsi_command(i32 %5, i32 %6, i32* getelementptr inbounds ([6 x i32], [6 x i32]* @test_unit_ready.command, i64 0, i64 0), i32 24, i32* null, i32 0, i32* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@test_unit_ready.command = internal constant [6 x i32] zeroinitializer
@SG_DXFER_FROM_DEV = global i32 0
define i32 @test_unit_ready(i32 %0, i32* %1) {
%3 = load i32, i32* @SG_DXFER_FROM_DEV
%4 = tail call i32 @scsi_command(i32 %0, i32 %3, i32* getelementptr inbounds ([6 x i32], [6 x i32]* @test_unit_ready.command, i64 0, i64 0), i32 24, i32* null, i32 0, i32* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printD();
int main() {
  printD();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printD()
ret i32 0
}
int is_win_loss_or_point(int sum_dice) {
  int is_point = -1;
  if ((sum_dice == 7) || (sum_dice == 11)) {
    is_point = 1;
  } else if ((sum_dice > 3) && (sum_dice < 11)) {
    is_point = 0;
  }
  return is_point;
}


x86 assembly (clang, -O0):
<is_win_loss_or_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x7,-0x4(%rbp)
je     1122 <is_win_loss_or_point+0x22>
cmpl   $0xb,-0x4(%rbp)
jne    112e <is_win_loss_or_point+0x2e>
movl   $0x1,-0x8(%rbp)
jmp    114e <is_win_loss_or_point+0x4e>
cmpl   $0x3,-0x4(%rbp)
jle    1149 <is_win_loss_or_point+0x49>
cmpl   $0xb,-0x4(%rbp)
jge    1149 <is_win_loss_or_point+0x49>
movl   $0x0,-0x8(%rbp)
jmp    114e <is_win_loss_or_point+0x4e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_win_loss_or_point>:
mov    $0x1,%eax
cmp    $0x7,%edi
je     110f <is_win_loss_or_point+0xf>
cmp    $0xb,%edi
jne    1110 <is_win_loss_or_point+0x10>
ret
add    $0xfffffff5,%edi
cmp    $0xfffffff9,%edi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_win_loss_or_point(i32 %0) {
switch i32 %0, label %2 [
i32 11, label %6
i32 7, label %6
]
2: ; preds = %1
%3 = add i32 %0, -11
%4 = icmp ult i32 %3, -7
%5 = sext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Variables and functions */
int __divsi3(int, int);
int __modsi3(int n, int d) { return n - __divsi3(n, d) * d; }


x86 assembly (clang, -O0):
<__modsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__divsi3@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__modsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <__divsi3@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__modsi3(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* %3
%7 = load i32, i32* %4
%8 = call i32 @__divsi3(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__modsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__divsi3(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ student_state(int);
void *student_func(void *args) {
  int *ptr = (int *)args;
  int i = *ptr;
  while (1) {
    student_state(i);
  }
}


x86 assembly (clang, -O0):
<student_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <student_state@plt>
jmp    112d <student_func+0x1d>

x86 assembly (clang, -O2):
<student_func>:
push   %rbx
mov    (%rdi),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <student_state@plt>
jmp    1120 <student_func+0x10>

LLVM IR (-O0):
define i8* @student_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %4
br label %9
9: ; preds = %1, %9
%10 = load i32, i32* %4
%11 = call i32 @student_state(i32 %10)
br label %9
}

LLVM IR (-O2):
define noalias i8* @student_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @student_state(i32 %3)
br label %4
}
int count_one_bits(unsigned value) {
  int ones;
  for (ones = 0; value != 0; value >>= 1)
    if ((value & 1) != 0)
      ones += 1;
  return ones;
}


x86 assembly (clang, -O0):
<count_one_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <count_one_bits+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <count_one_bits+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <count_one_bits+0x35>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_one_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_one_bits>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <count_one_bits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_one_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_one_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
void putc(char c) {
  while ((*((volatile unsigned long *)0x7F005018)) & (1 << 14))
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
void PERQTNothing(void) {}


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

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

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

LLVM IR (-O2):
define void @PERQTNothing() {
ret void
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_keyboard {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_keyboard);
}


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

x86 assembly (clang, -O2):
<wl_keyboard_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_keyboard = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_keyboard_get_user_data(%struct.wl_keyboard* %0) {
%2 = alloca %struct.wl_keyboard*
store %struct.wl_keyboard* %0, %struct.wl_keyboard** %2
%3 = load %struct.wl_keyboard*, %struct.wl_keyboard** %2
%4 = bitcast %struct.wl_keyboard* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_keyboard = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_keyboard_get_user_data(%struct.wl_keyboard* %0) {
%2 = bitcast %struct.wl_keyboard* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ exp(double);
double fmax(scalar_t__, double);
double elu(double x) { return fmax(exp(x) - 1, x); }


x86 assembly (clang, -O0):
<elu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
movsd  -0x8(%rbp),%xmm0
call   1040 <fmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elu>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
lea    -0x1(%rax),%rdi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <fmax@plt>

LLVM IR (-O0):
define double @elu(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @exp(double %3)
%5 = sub nsw i64 %4, 1
%6 = load double, double* %2
%7 = call double @fmax(i64 %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @elu(double %0) {
%2 = tail call i64 @exp(double %0)
%3 = add nsw i64 %2, -1
%4 = tail call double @fmax(i64 %3, double %0)
ret double %4
}
int f_ne_rc1(float a1) { return (((a1) != (100))); }


x86 assembly (clang, -O0):
<f_ne_rc1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_rc1>:
cmpneqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_rc1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp une float %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ne_rc1(float %0) {
%2 = fcmp une float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t readl(uint32_t addr) { return *(volatile uint32_t *)addr; }


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

x86 assembly (clang, -O2):
<readl>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @readl(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @readl(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
unsigned char *sysfn1(void *p) {
  unsigned char *uc = (void *)1;
  uc = (void *)1;
  sysbar((void *)1);
  return (void *)1;
}


x86 assembly (clang, -O0):
<sysfn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <sysbar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @sysfn1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* inttoptr (i64 1 to i8*), i8** %3
store i8* inttoptr (i64 1 to i8*), i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @sysbar to i32 (i8*, ...)*)(i8* inttoptr (i64 1 to i8*))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @sysfn1(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @sysbar to i32 (i8*, ...)*)(i8* inttoptr (i64 1 to i8*))
ret i8* inttoptr (i64 1 to i8*)
}
int add(int a, int b) {
  int sum, carry;
  if (b == 0)
    return a;
  else
    sum = a ^ b;
  carry = (a & b) << 1;
  return add(sum, carry);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <add+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <add+0x46>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
test   %esi,%esi
je     111d <add+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%eax
xor    %edi,%eax
and    %edi,%esi
mov    %eax,%edi
add    %esi,%esi
jne    1110 <add+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = xor i32 %5, %6
%8 = and i32 %5, %6
%9 = shl i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
bool guac_terminal_has_glyph(int codepoint) {
  return codepoint != 0 && codepoint != ' ';
}


x86 assembly (clang, -O0):
<guac_terminal_has_glyph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <guac_terminal_has_glyph+0x20>
cmpl   $0x20,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guac_terminal_has_glyph>:
xor    %eax,%eax
test   $0xffffffdf,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @guac_terminal_has_glyph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 32
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @guac_terminal_has_glyph(i32 %0) {
%2 = and i32 %0, -33
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
AR0A1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[10000000]) <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0A1>:
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    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     113b <AR0A1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <AR0A1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0A1>:
mov    0x2625a00(%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @AR0A1(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** %12
%15 = getelementptr inbounds i32, i32* %14, i64 10000000
%16 = load i32, i32* %15
%17 = load i32, i32* inttoptr (i64 11111111 to i32*)
%18 = icmp ule i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = load i32, i32* inttoptr (i64 11111111 to i32*)
%10 = icmp ule i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int rand();
int randval(int max) {
  int n = rand();
  return n % max;
}


x86 assembly (clang, -O0):
<randval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randval>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @randval(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
void bm_getmask(int *pos, unsigned char *bmask) {
  *bmask = (unsigned char)(1 << (*pos % 8));
  *pos /= 8;
}


x86 assembly (clang, -O0):
<bm_getmask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_getmask>:
mov    (%rdi),%cl
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,(%rsi)
mov    (%rdi),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @bm_getmask(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = srem i32 %6, 8
%8 = shl i32 1, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
store i8 %9, i8* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 8
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @bm_getmask(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 7
%5 = shl nuw nsw i32 1, %4
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i32, i32* %0
%8 = sdiv i32 %7, 8
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square(int);
int main(void) {
  int x = 10;
  x = square(x);
  printf("after square: %d\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"after square: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void task_numa_fault(int last_node, int node, int pages, int flags) {}


x86 assembly (clang, -O0):
<task_numa_fault>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @task_numa_fault(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @task_numa_fault(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void state_init(void) {}


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

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

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

LLVM IR (-O2):
define void @state_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(0);
  test(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 0)
%2 = tail call i32 @test(i32 5)
ret i32 0
}
const char *ajUrlinTypeGetFields(void) { return "id acc"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"id acc\00"
define i8* @ajUrlinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"id acc\00"
define i8* @ajUrlinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void vramRefresh() {}


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

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

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

LLVM IR (-O2):
define void @vramRefresh() {
ret void
}
/* Variables and functions */
void *gumbo_user_allocator(int /*<<< orphan*/ *, size_t);
void *gumbo_malloc(size_t size) { return gumbo_user_allocator(NULL, size); }


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

x86 assembly (clang, -O2):
<gumbo_malloc>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <gumbo_user_allocator@plt>

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

LLVM IR (-O2):
define i8* @gumbo_malloc(i64 %0) {
%2 = tail call i8* @gumbo_user_allocator(i32* null, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void yyerror(char const *s) { printf("%s\n", s); }


x86 assembly (clang, -O0):
<yyerror>:
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):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  double tv_sec;
  int tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double getutime() {
  struct rusage usage;
  getrusage(RUSAGE_SELF, &usage);
  return usage.ru_utime.tv_sec + usage.ru_utime.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<getutime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getutime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i32 }
@RUSAGE_SELF = global i32 0
define double @getutime() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %11
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i32 }
@RUSAGE_SELF = global i32 0
define double @getutime() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
void ultrasonic_read() {}


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

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

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

LLVM IR (-O2):
define void @ultrasonic_read() {
ret void
}
/* Type definitions */
struct msgu_datatable {
  int dummy;
};

/* Variables and functions */
int msgu_datatable_erase(struct msgu_datatable *t, size_t index) { return -1; }


x86 assembly (clang, -O0):
<msgu_datatable_erase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.msgu_datatable = type { i32 }
define i32 @msgu_datatable_erase(%struct.msgu_datatable* nocapture readnone %0, i64 %1) {
ret i32 -1
}
/* Variables and functions */
int write(int, ...);
void write_param(int socket, char *param, int size) {
  if (write(socket, &size, 4) != 4)
    return;
  if (size > 0) {
    if (write(socket, param, size) != size)
      return;
  }
}


x86 assembly (clang, -O0):
<write_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0x4,%eax
je     1143 <write_param+0x33>
jmp    1171 <write_param+0x61>
cmpl   $0x0,-0x14(%rbp)
jle    1171 <write_param+0x61>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     116c <write_param+0x5c>
jmp    1171 <write_param+0x61>
jmp    1171 <write_param+0x61>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_param>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0x4,%eax
jne    1146 <write_param+0x36>
mov    0x4(%rsp),%edx
test   %edx,%edx
jle    1146 <write_param+0x36>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @write_param(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 (i32, ...) @write(i32 %0, i32* %4, i32 4)
%6 = icmp eq i32 %5, 4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i32, ...) @write(i32 %0, i8* %1, i32 %7)
br label %12
12: ; preds = %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void seventeen(const int d) {
  printf("The radius of the circle is: %f.\n", (float)d / 2.0f);
}


x86 assembly (clang, -O0):
<seventeen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seventeen>:
cvtsi2ss %edi,%xmm0
mulss  0xee4(%rip),%xmm0
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"The radius of the circle is: %f.\0A\00"
define void @seventeen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fdiv float %4, 2.000000e+00
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"The radius of the circle is: %f.\0A\00"
define void @seventeen(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fmul float %2, 5.000000e-01
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}
int fun1362() { return 1362; }


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

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

LLVM IR (-O0):
define i32 @fun1362() {
ret i32 1362
}

LLVM IR (-O2):
define i32 @fun1362() {
ret i32 1362
}
int prime(int num) {
  int i;
  for (i = 2; i < num; i++)
    if (num % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <prime+0x50>
jmp    113b <prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ TtlSetDeactivated(int);
uint32_t HandlerDeactivate(void) { return TtlSetDeactivated(1); }


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

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

LLVM IR (-O0):
define i32 @HandlerDeactivate() {
%1 = call i32 @TtlSetDeactivated(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @HandlerDeactivate() {
%1 = tail call i32 @TtlSetDeactivated(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int remove(char *);
int remover(void) {
  int st;
  st = remove("errors.err");
  if (!st)
    printf("Excluido com sucesso!\n");
  else
    printf("Falha na exclusao\n");
  return st;
}


x86 assembly (clang, -O0):
<remover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1152 <remover+0x32>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
jmp    115e <remover+0x3e>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remover>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xed3(%rip),%rax
lea    0xee2(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"errors.err\00"
@.str.1 = [23 x i8] c"Excluido com sucesso!\0A\00"
@.str.2 = [19 x i8] c"Falha na exclusao\0A\00"
define i32 @remover() {
%1 = alloca i32
%2 = call i32 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"errors.err\00"
@str = [22 x i8] c"Excluido com sucesso!\00"
@str.3 = [18 x i8] c"Falha na exclusao\00"
define i32 @remover() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %1
}
/* Variables and functions */
char *memchr(char *, char, size_t);
size_t next_line(char *s, size_t n) {
  char *l;
  return (l = memchr(s, '\n', n)) ? l - s + 1 : n;
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xa,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1158 <next_line+0x48>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1160 <next_line+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xa,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
add    $0x1,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @next_line(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @memchr(i8* %6, i8 signext 10, i64 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = add nsw i64 %15, 1
br label %19
17: ; preds = %2
%18 = load i64, i64* %4
br label %19
19: ; preds = %17, %10
%20 = phi i64 [ %16, %10 ], [ %18, %17 ]
ret i64 %20
}

LLVM IR (-O2):
define i64 @next_line(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 10, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 1, %6
%8 = add i64 %7, %5
%9 = select i1 %4, i64 %1, i64 %8
ret i64 %9
}
double min(double x, double y) { return (((x < y) ? x : y)); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTVfsObjToFile() {
ret void
}
int update_keys() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @update_keys() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr, "usage: %s lock|check <lockfile>\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: %s lock|check <lockfile>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: %s lock|check <lockfile>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int INHERENT_fchmod() { return 1; }


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

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

LLVM IR (-O0):
define i32 @INHERENT_fchmod() {
ret i32 1
}

LLVM IR (-O2):
define i32 @INHERENT_fchmod() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ WritePinValue(int, int);
void digitalWrite(int pin, int value) { WritePinValue(pin, value); }


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

x86 assembly (clang, -O2):
<digitalWrite>:
jmp    1030 <WritePinValue@plt>

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

LLVM IR (-O2):
define void @digitalWrite(i32 %0, i32 %1) {
%3 = tail call i32 @WritePinValue(i32 %0, i32 %1)
ret void
}
void SSMR3GetGCPhys64(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetGCPhys64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dma8_stop();
void pb_stop(void) { dma8_stop(); }


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

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

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

LLVM IR (-O2):
define void @pb_stop() {
%1 = tail call i32 (...) @dma8_stop()
ret void
}