xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int _hrt_p2_up(unsigned int);
unsigned int _hrt_p2_down(unsigned int x) {
  unsigned int y = _hrt_p2_up(x);
  return (x == y) ? y : y << 1;
}


x86 assembly (clang, -O0):
<_hrt_p2_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_hrt_p2_up@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113d <_hrt_p2_down+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <_hrt_p2_down+0x36>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hrt_p2_down>:
push   %rbx
mov    %edi,%ebx
call   1030 <_hrt_p2_up@plt>
cmp    %ebx,%eax
setne  %cl
shl    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_hrt_p2_down(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_hrt_p2_up(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = shl i32 %12, 1
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ %10, %9 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @_hrt_p2_down(i32 %0) {
%2 = tail call i32 @_hrt_p2_up(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
%5 = shl i32 %2, %4
ret i32 %5
}
/* Variables and functions */
int OPER_I_16();
int m68ki_get_ccr();
int /*<<< orphan*/ m68ki_set_ccr(int);
void m68k_op_andi_16_toc(void) { m68ki_set_ccr(m68ki_get_ccr() & OPER_I_16()); }


x86 assembly (clang, -O0):
<m68k_op_andi_16_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <m68ki_get_ccr@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <OPER_I_16@plt>
mov    -0x4(%rbp),%edi
and    %eax,%edi
call   1030 <m68ki_set_ccr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_andi_16_toc>:
push   %rbx
xor    %eax,%eax
call   1050 <m68ki_get_ccr@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <OPER_I_16@plt>
and    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <m68ki_set_ccr@plt>

LLVM IR (-O0):
define void @m68k_op_andi_16_toc() {
%1 = call i32 (...) @m68ki_get_ccr()
%2 = call i32 (...) @OPER_I_16()
%3 = and i32 %1, %2
%4 = call i32 @m68ki_set_ccr(i32 %3)
ret void
}

LLVM IR (-O2):
define void @m68k_op_andi_16_toc() {
%1 = tail call i32 (...) @m68ki_get_ccr()
%2 = tail call i32 (...) @OPER_I_16()
%3 = and i32 %2, %1
%4 = tail call i32 @m68ki_set_ccr(i32 %3)
ret void
}
/* Variables and functions */
long long give_me_power(int, int);
int /*<<< orphan*/ printf(char *, double);
double square_root(double);
int main() {
  long long n = give_me_power(2, 26);
  printf("%lld\n", n);
  double s = square_root((double)n);
  printf("%lf\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x1a,%esi
call   1030 <give_me_power@plt>
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
cvtsi2sdq -0x10(%rbp),%xmm0
call   1050 <square_root@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x1a,%esi
call   1030 <give_me_power@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
call   1050 <square_root@plt>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld\0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca double
store i32 0, i32* %1
%4 = call i64 @give_me_power(i32 2, i32 26)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to double
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i64, i64* %2
%9 = sitofp i64 %8 to double
%10 = call double @square_root(double %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i64 @give_me_power(i32 2, i32 26)
%2 = sitofp i64 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @square_root(double %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cauchy_neo(double *, int, double *, double *, int, double);
void cauchy_packet(double *x, int sigInLength, double *f, int sigOutLength,
                   double ys) {
  cauchy_neo(x, sigInLength, f, f + sigInLength, sigOutLength, ys);
  return;
}


x86 assembly (clang, -O0):
<cauchy_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
movsd  -0x28(%rbp),%xmm0
call   1030 <cauchy_neo@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cauchy_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
jmp    1030 <cauchy_neo@plt>

LLVM IR (-O0):
define void @cauchy_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = load double, double* %10
%20 = call i32 @cauchy_neo(double* %11, i32 %12, double* %13, double* %17, i32 %18, double %19)
ret void
}

LLVM IR (-O2):
define void @cauchy_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cauchy_neo(double* %0, i32 %1, double* %2, double* %7, i32 %3, double %4)
ret void
}
void g_thread_pool_set_max_unused_threads() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_pool_set_max_unused_threads() {
ret void
}
void *kmemset(char *dst, char src, int n) {
  char *p = dst;
  while (n--) {
    *dst++ = src;
  }
  return p;
}


x86 assembly (clang, -O0):
<kmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1146 <kmemset+0x46>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1119 <kmemset+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmemset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
je     1126 <kmemset+0x16>
mov    %edx,%edx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @kmemset(i8* returned writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int _syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int syscall(uint32_t syscall_nr, uint32_t arg1, uint32_t arg2, uint32_t arg3,
            uint32_t arg4, uint32_t arg5) {
  int ret;
  do {
    ret = _syscall(syscall_nr, arg1, arg2, arg3, arg4, arg5);
  } while (ret == (-1024));
  return ret;
}


x86 assembly (clang, -O0):
<syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <_syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffc00,-0x1c(%rbp)
je     112c <syscall+0x1c>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <_syscall@plt>
cmp    $0xfffffc00,%eax
je     1130 <syscall+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @syscall(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* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
br label %14
14: ; preds = %22, %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = call i32 @_syscall(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20)
store i32 %21, i32* %13
br label %22
22: ; preds = %14
%23 = load i32, i32* %13
%24 = icmp eq i32 %23, -1024
br i1 %24, label %14, label %25
25: ; preds = %22
%26 = load i32, i32* %13
ret i32 %26
}

LLVM IR (-O2):
define i32 @syscall(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
br label %7
7: ; preds = %7, %6
%8 = tail call i32 @_syscall(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%9 = icmp eq i32 %8, -1024
br i1 %9, label %7, label %10
10: ; preds = %7
ret i32 %8
}
/* Variables and functions */
int random();
int rand_key_int_pos(int nonrepeat, int pos) {
  int r;
  r = random() % (0x7FFFFFFF - (nonrepeat - 1));
  r += pos - r % nonrepeat;
  return r;
}


x86 assembly (clang, -O0):
<rand_key_int_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
mov    $0x7fffffff,%ecx
sub    %edx,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_key_int_pos>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
mov    $0x80000000,%ecx
sub    %ebp,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    %edx,%eax
cltd
idiv   %ebp
add    %ecx,%ebx
sub    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_key_int_pos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @random()
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sub nsw i32 2147483647, %8
%10 = srem i32 %6, %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
%15 = sub nsw i32 %11, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @rand_key_int_pos(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = sub i32 -2147483648, %0
%5 = srem i32 %3, %4
%6 = srem i32 %5, %0
%7 = add i32 %5, %1
%8 = sub i32 %7, %6
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xvisibility_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xvisibility.serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xvisibility_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
unsigned long task_io_get_oublock(const struct task_struct *p) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i64 @task_io_get_oublock(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret i64 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i64 @task_io_get_oublock(%struct.task_struct* nocapture readnone %0) {
ret i64 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_enqueue_after(struct list *, struct list *);
void list_enqueue_front(struct list *head, struct list *newitem) {
  list_enqueue_after(head, newitem);
}


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

x86 assembly (clang, -O2):
<list_enqueue_front>:
jmp    1030 <list_enqueue_after@plt>

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

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_enqueue_front(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_enqueue_after(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Terminal_reset_cursor(int mode) {
  if (mode == 0) {
    printf("\033[?25l");
  } else if (mode == 1) {
    printf("\033[?25h");
  }
}


x86 assembly (clang, -O0):
<Terminal_reset_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <Terminal_reset_cursor+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <Terminal_reset_cursor+0x41>
cmpl   $0x1,-0x4(%rbp)
jne    114c <Terminal_reset_cursor+0x3c>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <Terminal_reset_cursor+0x41>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Terminal_reset_cursor>:
test   %edi,%edi
je     1125 <Terminal_reset_cursor+0x15>
cmp    $0x1,%edi
jne    1131 <Terminal_reset_cursor+0x21>
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
define void @Terminal_reset_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
define void @Terminal_reset_cursor(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
br label %6
6: ; preds = %3, %1
ret void
}
void cmpx(m, buf, len) char *m, *buf;
int len;
{
  printf("\nunsigned char %s[] ={\n", m);
  print_c_hex_string(buf, len);
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<cmpx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <print_c_hex_string@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpx>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <print_c_hex_string@plt>
lea    0xebc(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0Aunsigned char %s[] ={\0A\00"
@.str.1 = [5 x i8] c"\0A};\0A\00"
define void @cmpx(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print_c_hex_string to i32 (i8*, i32, ...)*)(i8* %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0Aunsigned char %s[] ={\0A\00"
@str = [4 x i8] c"\0A};\00"
define void @cmpx(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print_c_hex_string to i32 (i8*, i32, ...)*)(i8* %1, i32 %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int year;
  printf("Enter your age in years: ");
  scanf("%d", &year);
  printf("%d years in seconds is %e seconds.\n", year, 3.156E7 * year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cvtsi2sd %esi,%xmm0
mulsd  0xeb0(%rip),%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter your age in years: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"%d years in seconds is %e seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fmul double 3.156000e+07, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %5, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter your age in years: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"%d years in seconds is %e seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 3.156000e+07
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %5, double %7)
ret i32 0
}
/* Variables and functions */
int rand();
double cpa_generate_probability(void *data) {
  return (double)(rand() % 10) + 1;
}


x86 assembly (clang, -O0):
<cpa_generate_probability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpa_generate_probability>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cpa_generate_probability(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 10
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 1.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @cpa_generate_probability(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 10
%4 = add nsw i32 %3, 1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: ipvalid [-q] ipaddress\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: ipvalid [-q] ipaddress\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: ipvalid [-q] ipaddress\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ floats_rpy_to_mat44(float const *, float *);
void floats_xyzrpy_to_mat44(const float xyzrpy[6], float M[16]) {
  floats_rpy_to_mat44(&xyzrpy[3], M);
  M[3] = xyzrpy[0];
  M[7] = xyzrpy[1];
  M[11] = xyzrpy[2];
}


x86 assembly (clang, -O0):
<floats_xyzrpy_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <floats_rpy_to_mat44@plt>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_xyzrpy_to_mat44>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xc,%rdi
call   1030 <floats_rpy_to_mat44@plt>
movss  (%rbx),%xmm0
movss  %xmm0,0xc(%r14)
movss  0x4(%rbx),%xmm0
movss  %xmm0,0x1c(%r14)
movss  0x8(%rbx),%xmm0
movss  %xmm0,0x2c(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @floats_xyzrpy_to_mat44(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 = getelementptr inbounds float, float* %5, i64 3
%7 = load float*, float** %4
%8 = call i32 @floats_rpy_to_mat44(float* %6, float* %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 3
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 7
store float %16, float* %18
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 11
store float %21, float* %23
ret void
}

LLVM IR (-O2):
define void @floats_xyzrpy_to_mat44(float* %0, float* %1) {
%3 = getelementptr inbounds float, float* %0, i64 3
%4 = tail call i32 @floats_rpy_to_mat44(float* %3, float* %1)
%5 = load float, float* %0
%6 = getelementptr inbounds float, float* %1, i64 3
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 7
store float %8, float* %9
%10 = getelementptr inbounds float, float* %0, i64 2
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 11
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x1 = 14;
  int x2 = 20;
  int x3 = 30;
  printf("x"
         "1"
         " = %d\n",
         x1);
  printf("x"
         "2"
         " = %d\n",
         x2);
  printf("x"
         "3"
         " = %d\n",
         x3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x1e,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"x1 = %d\0A\00"
@.str.1 = [9 x i8] c"x2 = %d\0A\00"
@.str.2 = [9 x i8] c"x3 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 14, i32* %2
store i32 20, i32* %3
store i32 30, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"x1 = %d\0A\00"
@.str.1 = [9 x i8] c"x2 = %d\0A\00"
@.str.2 = [9 x i8] c"x3 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 30)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cu_enable_debug_flags(char *);
char *getenv(char *);
void cu_enabledebug(char *f) {
  char *env_flags = NULL;
  env_flags = getenv("DEBUG_FLAGS");
  cu_enable_debug_flags(f);
  if (env_flags != NULL)
    cu_enable_debug_flags(env_flags);
}


x86 assembly (clang, -O0):
<cu_enabledebug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cu_enable_debug_flags@plt>
cmpq   $0x0,-0x10(%rbp)
je     1161 <cu_enabledebug+0x41>
mov    -0x10(%rbp),%rdi
call   1040 <cu_enable_debug_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu_enabledebug>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <cu_enable_debug_flags@plt>
test   %rbx,%rbx
je     1152 <cu_enabledebug+0x32>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cu_enable_debug_flags@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"DEBUG_FLAGS\00"
define void @cu_enabledebug(i8* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cu_enable_debug_flags(i8* %0)
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @cu_enable_debug_flags(i8* %2)
br label %7
7: ; preds = %5, %1
ret void
}
double power(double n, int p) {
  double pow = 1;
  int i;
  for (i = 1; i <= p; i++) {
    pow *= n;
  }
  return pow;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1149 <power+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <power+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
jle    111b <power+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <power+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <power+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <power+0x30>
test   %eax,%eax
je     1169 <power+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <power+0x60>
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_wait_sensor(int packet_id) {
  ;
  create_write_byte(158);
  create_write_byte(packet_id);
  ;
}


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

x86 assembly (clang, -O2):
<create_wait_sensor>:
push   %rbx
mov    %edi,%ebx
mov    $0x9e,%edi
call   1030 <create_write_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <create_write_byte@plt>

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

LLVM IR (-O2):
define void @create_wait_sensor(i32 %0) {
%2 = tail call i32 @create_write_byte(i32 158)
%3 = tail call i32 @create_write_byte(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ factorial(int, double *);
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  int j;
  double fact;
  for (j = 0; j <= 20; ++j) {
    factorial(j, &fact);
    printf("j = %3d    factorial(j) = %12.3e\n", j, fact);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     116e <main+0x4e>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <factorial@plt>
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%r14
lea    0xec9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <factorial@plt>
movsd  0x8(%rsp),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"j = %3d factorial(j) = %12.3e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 20
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @factorial(i32 %8, double* %3)
%10 = load i32, i32* %2
%11 = load double, double* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10, double %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"j = %3d factorial(j) = %12.3e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %8, %3 ]
%5 = call i32 @factorial(i32 %4, double* %1)
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4, double %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 21
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
void sk_is_sorted(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_type_hint() {
ret void
}
int _test_time_code_quarter_frame(void *buffer) {
  return ((unsigned char *)buffer)[0] == 0xf1;
}


x86 assembly (clang, -O0):
<_test_time_code_quarter_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xf1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_time_code_quarter_frame>:
xor    %eax,%eax
cmpb   $0xf1,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @_test_time_code_quarter_frame(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -15
%4 = zext i1 %3 to i32
ret i32 %4
}
double r_net_day(double bbalb, double solar, double tsw) {
  double result;
  result = ((1.0 - bbalb) * solar) - (110.0 * tsw);
  return result;
}


x86 assembly (clang, -O0):
<r_net_day>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xeed(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xed3(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_net_day>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm0,%xmm3
mulsd  0xef4(%rip),%xmm2
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @r_net_day(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fmul double 1.100000e+02, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
store double %14, double* %7
%15 = load double, double* %7
ret double %15
}

LLVM IR (-O2):
define double @r_net_day(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %0
%5 = fmul double %2, -1.100000e+02
%6 = tail call double @llvm.fmuladd.f64(double %4, double %1, double %5)
ret double %6
}
void inc_zcache_eph_ate_tail_failed(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_eph_ate_tail_failed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int main() { loop(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @loop()
ret i32 0
}
/* Variables and functions */
int read(int, void *, int);
int Serialize_ReadData(int Stream, void *Data, int Bytes) {
  return read(Stream, Data, Bytes);
}


x86 assembly (clang, -O0):
<Serialize_ReadData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serialize_ReadData>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @Serialize_ReadData(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Serialize_ReadData(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void gtk_button_set_relief() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ INIT_OHLIST_NODE(struct ohlist_node *);
int /*<<< orphan*/ __ohlist_del(struct ohlist_node *);
int /*<<< orphan*/ ohlist_unhashed(struct ohlist_node *);
void ohlist_del_init(struct ohlist_node *node) {
  if (!ohlist_unhashed(node)) {
    __ohlist_del(node);
    INIT_OHLIST_NODE(node);
  }
}


x86 assembly (clang, -O0):
<ohlist_del_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ohlist_unhashed@plt>
cmp    $0x0,%eax
jne    1160 <ohlist_del_init+0x30>
mov    -0x8(%rbp),%rdi
call   1040 <__ohlist_del@plt>
mov    -0x8(%rbp),%rdi
call   1050 <INIT_OHLIST_NODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ohlist_unhashed@plt>
test   %eax,%eax
je     113f <ohlist_del_init+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <__ohlist_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <INIT_OHLIST_NODE@plt>

LLVM IR (-O0):
%struct.ohlist_node = type { i32 }
define void @ohlist_del_init(%struct.ohlist_node* %0) {
%2 = alloca %struct.ohlist_node*
store %struct.ohlist_node* %0, %struct.ohlist_node** %2
%3 = load %struct.ohlist_node*, %struct.ohlist_node** %2
%4 = call i32 @ohlist_unhashed(%struct.ohlist_node* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.ohlist_node*, %struct.ohlist_node** %2
%8 = call i32 @__ohlist_del(%struct.ohlist_node* %7)
%9 = load %struct.ohlist_node*, %struct.ohlist_node** %2
%10 = call i32 @INIT_OHLIST_NODE(%struct.ohlist_node* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.ohlist_node = type { i32 }
define void @ohlist_del_init(%struct.ohlist_node* %0) {
%2 = tail call i32 @ohlist_unhashed(%struct.ohlist_node* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @__ohlist_del(%struct.ohlist_node* %0)
%6 = tail call i32 @INIT_OHLIST_NODE(%struct.ohlist_node* %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_lrint();
scalar_t__ lrint(double);
void test_lrint(double d) {
  if (lrint(d) != lrint(d))
    link_failure_lrint();
}


x86 assembly (clang, -O0):
<test_lrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lrint@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lrint@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_lrint+0x3c>
mov    $0x0,%al
call   1040 <link_failure_lrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lrint>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <lrint@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <lrint@plt>
cmp    %rax,%rbx
jne    1149 <test_lrint+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_lrint@plt>

LLVM IR (-O0):
define void @test_lrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lrint(double %3)
%5 = load double, double* %2
%6 = call i64 @lrint(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_lrint()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_lrint(double %0) {
%2 = tail call i64 @lrint(double %0)
%3 = tail call i64 @lrint(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_lrint()
br label %7
7: ; preds = %5, %1
ret void
}