xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ q_isblank(int);
int q_isspace(int c) {
  return (q_isblank(c) || c == '\n' || c == '\r' || c == '\f' || c == '\v');
}


x86 assembly (clang, -O0):
<q_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <q_isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116c <q_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <q_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <q_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <q_isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isspace>:
push   %rbx
mov    %edi,%ebx
call   1030 <q_isblank@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <q_isspace+0x17>
pop    %rbx
ret
cmp    $0xd,%ebx
ja     1136 <q_isspace+0x26>
mov    $0x3400,%ecx
bt     %ebx,%ecx
jb     1125 <q_isspace+0x15>
xor    %eax,%eax
cmp    $0xb,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @q_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @q_isblank(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 10
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 13
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 12
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 11
br label %18
18: ; preds = %15, %12, %9, %6, %1
%19 = phi i1 [ true, %12 ], [ true, %9 ], [ true, %6 ], [ true, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @q_isspace(i32 %0) {
%2 = tail call i64 @q_isblank(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 13, label %9
i32 12, label %9
i32 10, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 11
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
int is_power_of_2(unsigned long long n) {
  return (n != 0 && ((n & (n - 1)) == 0));
}


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1112 <is_power_of_2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
void *g(size_t);
void *h(size_t n) { return g(n); }


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

x86 assembly (clang, -O2):
<h>:
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i8* @h(i64 %0) {
%2 = tail call i8* @g(i64 %0)
ret i8* %2
}
_Bool Double__GT_(double x, double y) { return x > y; }


x86 assembly (clang, -O0):
<Double__GT_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double__GT_>:
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define zeroext i1 @Double__GT_(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 ogt double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Double__GT_(double %0, double %1) {
%3 = fcmp ogt double %0, %1
ret i1 %3
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t read_port(uint32_t port) {
  uint8_t val;
  asm volatile("inb %%dx,%%al" : "=a"(val) : "d"(port));
  return val;
}


x86 assembly (clang, -O0):
<read_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_port>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @read_port(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @read_port(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void memtuner_debug_println(char const *str) {
  if (str != NULL && str[0] != '\n')
    write(1, str, strlen(str));
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<memtuner_debug_println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <memtuner_debug_println+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1168 <memtuner_debug_println+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe8c(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memtuner_debug_println>:
push   %rbx
test   %rdi,%rdi
je     1145 <memtuner_debug_println+0x25>
mov    %rdi,%rbx
cmpb   $0xa,(%rdi)
je     1145 <memtuner_debug_println+0x25>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb4(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @memtuner_debug_println(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @write(i32 1, i8* %12, i32 %14)
br label %16
16: ; preds = %11, %5, %1
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @memtuner_debug_println(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 10
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = tail call i32 @write(i32 1, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %3, %1
%10 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_UART_TXD1_OUTPUT() { set_io_bit(0x45, 3); }


x86 assembly (clang, -O0):
<TOSH_MAKE_UART_TXD1_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_UART_TXD1_OUTPUT>:
mov    $0x45,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_UART_TXD1_OUTPUT() {
%1 = call i32 @set_io_bit(i32 69, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_UART_TXD1_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 69, i32 3)
ret void
}
void query_C() {}


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

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

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

LLVM IR (-O2):
define void @query_C() {
ret void
}
/* Variables and functions */
unsigned int rand();
unsigned int range_uint(unsigned int min, unsigned int max) {
  unsigned int val = rand();
  return val < min || max < val ? min : val;
}


x86 assembly (clang, -O0):
<range_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     1140 <range_uint+0x30>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    114b <range_uint+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <range_uint+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_uint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmova  %ebp,%ecx
cmp    %ebp,%eax
cmovb  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @range_uint(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 (...) @rand()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10, %2
%15 = load i32, i32* %3
br label %18
16: ; preds = %10
%17 = load i32, i32* %5
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @range_uint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp ult i32 %3, %0
%5 = icmp ugt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ log2pow5(scalar_t__ const);
int32_t ceil_log2pow5(const int32_t e) { return log2pow5(e) + 1; }


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

x86 assembly (clang, -O2):
<ceil_log2pow5>:
push   %rax
call   1030 <log2pow5@plt>
add    $0x1,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @ceil_log2pow5(i64 %0) {
%2 = tail call i64 @log2pow5(i64 %0)
%3 = add nsw i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void linedit_interrupt(void) { kill(0, SIGINT); }


x86 assembly (clang, -O0):
<linedit_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linedit_interrupt>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @linedit_interrupt() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @kill(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @linedit_interrupt() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @kill(i32 0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ blue_mask;
};
typedef TYPE_1__ Visual;

/* Variables and functions */
unsigned long get_Visual_blue_mask(void *_p) {
  return (unsigned long)((Visual *)_p)->blue_mask;
}


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

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

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

LLVM IR (-O2):
define i64 @get_Visual_blue_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ao();
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int main() {
  motor(0, 95);
  motor(2, 100);
  msleep(3600);
  ao();
  msleep(1000);
  motor(0, -100);
  motor(2, -95);
  msleep(3800);
  ao();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x5f,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0xe10,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1050 <ao@plt>
mov    $0x3e8,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
mov    $0xffffff9c,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0xffffffa1,%esi
call   1030 <motor@plt>
mov    $0xed8,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1050 <ao@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x5f,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0x64,%esi
call   1030 <motor@plt>
mov    $0xe10,%edi
call   1040 <msleep@plt>
xor    %eax,%eax
call   1050 <ao@plt>
mov    $0x3e8,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
mov    $0xffffff9c,%esi
call   1030 <motor@plt>
mov    $0x2,%edi
mov    $0xffffffa1,%esi
call   1030 <motor@plt>
mov    $0xed8,%edi
call   1040 <msleep@plt>
xor    %eax,%eax
call   1050 <ao@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @motor(i32 0, i32 95)
%3 = call i32 @motor(i32 2, i32 100)
%4 = call i32 @msleep(i32 3600)
%5 = call i32 (...) @ao()
%6 = call i32 @msleep(i32 1000)
%7 = call i32 @motor(i32 0, i32 -100)
%8 = call i32 @motor(i32 2, i32 -95)
%9 = call i32 @msleep(i32 3800)
%10 = call i32 (...) @ao()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @motor(i32 0, i32 95)
%2 = tail call i32 @motor(i32 2, i32 100)
%3 = tail call i32 @msleep(i32 3600)
%4 = tail call i32 (...) @ao()
%5 = tail call i32 @msleep(i32 1000)
%6 = tail call i32 @motor(i32 0, i32 -100)
%7 = tail call i32 @motor(i32 2, i32 -95)
%8 = tail call i32 @msleep(i32 3800)
%9 = tail call i32 (...) @ao()
ret i32 0
}
int strcmp(s1, s2) const char *s1, *s2;
{ return (0); }


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

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

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char const *);
void puts(const char *s) { serial_puts(s); }


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

x86 assembly (clang, -O2):
<puts>:
jmp    1030 <serial_puts@plt>

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @serial_puts(i8* %0)
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint vector_get(uint *bitvector, uint pos) {
  int word_num = (pos >> 5);
  int bit_num = (pos & (sizeof(uint) * 8 - 1));
  return bitvector[word_num] & (1 << bit_num);
}


x86 assembly (clang, -O0):
<vector_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_get>:
mov    %esi,%ecx
mov    %esi,%edx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @vector_get(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = and i64 %10, 31
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = shl i32 1, %18
%20 = and i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @vector_get(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = shl nuw i32 1, %4
%9 = and i32 %7, %8
ret i32 %9
}
/* Variables and functions */
void *memcpy(void *, void const *, unsigned int);
void *Osal_MemCpy(void *dest, const void *src, unsigned int size) {
  return (memcpy(dest, src, size));
}


x86 assembly (clang, -O0):
<Osal_MemCpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Osal_MemCpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @Osal_MemCpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memcpy(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void f_scalar_stack_3(double a, int64_t b, double c, int64_t d, int e,
                      int64_t f, float g, double h, long double i) {}


x86 assembly (clang, -O0):
<f_scalar_stack_3>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movss  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
fstpt  -0x40(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_scalar_stack_3(double %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, float %6, double %7, x86_fp80 %8) {
%10 = alloca double
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca double
%18 = alloca x86_fp80
store double %0, double* %10
store i32 %1, i32* %11
store double %2, double* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store float %6, float* %16
store double %7, double* %17
store x86_fp80 %8, x86_fp80* %18
ret void
}

LLVM IR (-O2):
define void @f_scalar_stack_3(double %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, float %6, double %7, x86_fp80 %8) {
ret void
}
int MAIN() {
  int i = 8;
  int *p = &i;
  i = *p <<= 2;
  print("i ", *p);
  print(i);
  return 0;
}


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
shl    $0x2,%eax
mov    %eax,(%rcx)
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"i \00"
define i32 @MAIN() {
%1 = alloca i32
%2 = alloca i32*
store i32 8, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = shl i32 %4, 2
store i32 %5, i32* %3
store i32 %5, i32* %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"i \00"
define i32 @MAIN() {
%1 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 32)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 32)
ret i32 0
}
/* Variables and functions */
int f(int *);
int main(void) {
  int x = 0;
  return f(&x);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, void *, int);
unsigned int ntohl(unsigned int);
void *read_entry_nr(void *buf, unsigned int *out) {
  memcpy(out, buf, sizeof(*out));
  *out = ntohl(*out);
  return buf + sizeof(*out);
}


x86 assembly (clang, -O0):
<read_entry_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_entry_nr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%r14),%edi
call   1040 <ntohl@plt>
mov    %eax,(%r14)
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read_entry_nr(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %5, i8* %6, i32 4)
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @ntohl(i32 %9)
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i8*, i8** %3
%13 = getelementptr i8, i8* %12, i64 4
ret i8* %13
}

LLVM IR (-O2):
define i8* @read_entry_nr(i8* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i8* %0, i32 4)
%4 = load i32, i32* %1
%5 = tail call i32 @ntohl(i32 %4)
store i32 %5, i32* %1
%6 = getelementptr i8, i8* %0, i64 4
ret i8* %6
}
int main() {
  int a, b, c;
#pragma omp parallel
  {
#pragma omp task
    {
      a = 5;
#pragma omp task
      { b = 5; }
#pragma omp task
      { c = 6; }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void inttobig(int n, int *d) {
  int i = 0;
  for (; !i || n; d[++i] = n % 10000, n /= 10000)
    ;
  d[0] = i;
}


x86 assembly (clang, -O0):
<inttobig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     112b <inttobig+0x2b>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113b <inttobig+0x3b>
jmp    1171 <inttobig+0x71>
jmp    1140 <inttobig+0x40>
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1112 <inttobig+0x12>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttobig>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x68db8bad,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rdi
add    %edx,%edi
imul   $0x2710,%edi,%r8d
mov    %ecx,%edx
sub    %r8d,%edx
mov    %edx,0x4(%rsi,%rax,4)
add    $0x1,%rax
add    $0xffffd8f0,%ecx
cmp    $0xffffb1e1,%ecx
jb     1110 <inttobig+0x10>
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @inttobig(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ true, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %25
14: ; preds = %12
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = srem i32 %16, 10000
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
store i32 %17, i32* %22
%23 = load i32, i32* %3
%24 = sdiv i32 %23, 10000
store i32 %24, i32* %3
br label %6
25: ; preds = %12
%26 = load i32, i32* %5
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 0
store i32 %26, i32* %28
ret void
}

LLVM IR (-O2):
define void @inttobig(i32 %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %7, %3 ]
%5 = phi i32 [ %0, %2 ], [ %9, %3 ]
%6 = srem i32 %5, 10000
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds i32, i32* %1, i64 %7
store i32 %6, i32* %8
%9 = sdiv i32 %5, 10000
%10 = add i32 %5, -10000
%11 = icmp ult i32 %10, -19999
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = trunc i64 %7 to i32
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
int capturePositiveValue();
int /*<<< orphan*/ printf(char *);
int getHeight() {
  printf("\nEnter number of rows to print (i.e. the height): ");
  return capturePositiveValue();
}


x86 assembly (clang, -O0):
<getHeight>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <capturePositiveValue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHeight>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <capturePositiveValue@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"\0AEnter number of rows to print (i.e. the height): \00"
define i32 @getHeight() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @capturePositiveValue()
ret i32 %2
}

LLVM IR (-O2):
@.str = [51 x i8] c"\0AEnter number of rows to print (i.e. the height): \00"
define i32 @getHeight() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @capturePositiveValue()
ret i32 %2
}
void null_pointer_write(void) {
  int *i = 0;
  *i = 0;
}


x86 assembly (clang, -O0):
<null_pointer_write>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @null_pointer_write() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int const GLfloat;

/* Variables and functions */
GLfloat DOT2(const GLfloat a[2], const GLfloat b[2]) {
  return a[0] * b[0] + a[1] * b[1];
}


x86 assembly (clang, -O0):
<DOT2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOT2>:
mov    (%rsi),%ecx
imul   (%rdi),%ecx
mov    0x4(%rsi),%eax
imul   0x4(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DOT2(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @DOT2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int do_read_status_reg(int);
int check_wip(int fd) { return do_read_status_reg(fd) & (1 << 0); }


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

x86 assembly (clang, -O2):
<check_wip>:
push   %rax
call   1030 <do_read_status_reg@plt>
and    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_wip(i32 %0) {
%2 = tail call i32 @do_read_status_reg(i32 %0)
%3 = and i32 %2, 1
ret i32 %3
}
void test_libsym3_1(void) {}


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

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

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

LLVM IR (-O2):
define void @test_libsym3_1() {
ret void
}
/* Variables and functions */
int write(int, char *, int);
int ax_web_socket_write(int socket_fd, char *data, int len) {
  return write(socket_fd, data, len);
}


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

x86 assembly (clang, -O2):
<ax_web_socket_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @ax_web_socket_write(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 @write(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ax_web_socket_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: rand-test seed generator { parameters } / "
                  "sample-size [ low high bins ]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: rand-test seed generator { parameters } / sample-size [ low high bins ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: rand-test seed generator { parameters } / sample-size [ low high bins ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ vgaputch(char);
void puts(char *c) {
  int i = 0;
  while (c[i]) {
    vgaputch(c[i++]);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <puts+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <vgaputch@plt>
jmp    1123 <puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <vgaputch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @vgaputch(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCSet(uint32_t ui32RTCValue) {
  (*((volatile unsigned long *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC00C))) = ui32RTCValue;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fc360,%eax
mov    $0xa3359554,%ecx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fc00c,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCSet>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa3359554,%eax
mov    %rax,0x400fc360
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
mov    %rbx,0x400fc00c
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movq   $0x0,0x400fc360
xor    %eax,%eax
pop    %rbx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%3 = call i32 (...) @_HibernateWriteComplete()
%4 = load i64, i64* %2
store volatile i64 %4, i64* inttoptr (i64 1074774028 to i64*)
%5 = call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%6 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCSet(i64 %0) {
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i64 %0, i64* inttoptr (i64 1074774028 to i64*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EKFStateVarianceHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void EKFStateVarianceUpdated() { UAVObjUpdated(EKFStateVarianceHandle()); }


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

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

LLVM IR (-O0):
define void @EKFStateVarianceUpdated() {
%1 = call i32 (...) @EKFStateVarianceHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @EKFStateVarianceUpdated() {
%1 = tail call i32 (...) @EKFStateVarianceHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
signed long int signedlongint_ignoring_longdouble(signed long int x,
                                                  long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlongint_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @signedlongint_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
/* Variables and functions */
int hex_decode_digit_(char);
int hex_decode_digit(char c) { return hex_decode_digit_(c); }


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

x86 assembly (clang, -O2):
<hex_decode_digit>:
jmp    1030 <hex_decode_digit_@plt>

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

LLVM IR (-O2):
define i32 @hex_decode_digit(i8 signext %0) {
%2 = tail call i32 @hex_decode_digit_(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: test_solarsystem_config solarsystem-asset-file\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: test_solarsystem_config solarsystem-asset-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: test_solarsystem_config solarsystem-asset-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getchar();
char *malloc(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int x = getchar();
  char *p = malloc(x);
  puts(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i8* @malloc(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wfile_basepath(char *, char *);
int /*<<< orphan*/ wfile_remove_dir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ wfile_remove_utf8(char *);
void wfile_remove_file_plus_parent_dir(char *tempfile) {
  char path[512];
  if (tempfile[0] == '\0')
    return;
  wfile_remove_utf8(tempfile);
  wfile_basepath(path, tempfile);
  wfile_remove_dir(path, 0);
}


x86 assembly (clang, -O0):
<wfile_remove_file_plus_parent_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <wfile_remove_file_plus_parent_dir+0x24>
jmp    117b <wfile_remove_file_plus_parent_dir+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <wfile_remove_utf8@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <wfile_basepath@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
call   1050 <wfile_remove_dir@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_remove_file_plus_parent_dir>:
push   %r14
push   %rbx
sub    $0x208,%rsp
cmpb   $0x0,(%rdi)
je     115f <wfile_remove_file_plus_parent_dir+0x2f>
mov    %rdi,%rbx
call   1030 <wfile_remove_utf8@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <wfile_basepath@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <wfile_remove_dir@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @wfile_remove_file_plus_parent_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %18
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @wfile_remove_utf8(i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%14 = load i8*, i8** %2
%15 = call i32 @wfile_basepath(i8* %13, i8* %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%17 = call i32 @wfile_remove_dir(i8* %16, i32 0)
br label %18
18: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @wfile_remove_file_plus_parent_dir(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @wfile_remove_utf8(i8* %0)
%8 = call i32 @wfile_basepath(i8* %3, i8* %0)
%9 = call i32 @wfile_remove_dir(i8* %3, i32 0)
br label %10
10: ; preds = %1, %6
ret void
}