xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int A[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_lock_handler(int);
void io_lock(void) { io_lock_handler(1); }


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

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

LLVM IR (-O0):
define void @io_lock() {
%1 = call i32 @io_lock_handler(i32 1)
ret void
}

LLVM IR (-O2):
define void @io_lock() {
%1 = tail call i32 @io_lock_handler(i32 1)
ret void
}
/* Variables and functions */
int roi_get_sensor_response_bump_r(char *);
int roi_get_stream_response_bump_r(char *buff) {
  if (buff[2] == 0) {
    return roi_get_sensor_response_bump_r(&buff[3]);
  }
  if (buff[2] == 6) {
    return roi_get_sensor_response_bump_r(&buff[3]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<roi_get_stream_response_bump_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1142 <roi_get_stream_response_bump_r+0x32>
mov    -0x10(%rbp),%rdi
add    $0x3,%rdi
call   1030 <roi_get_sensor_response_bump_r@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <roi_get_stream_response_bump_r+0x5f>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6,%eax
jne    1168 <roi_get_stream_response_bump_r+0x58>
mov    -0x10(%rbp),%rdi
add    $0x3,%rdi
call   1030 <roi_get_sensor_response_bump_r@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <roi_get_stream_response_bump_r+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_get_stream_response_bump_r>:
mov    0x2(%rdi),%al
cmp    $0x6,%al
je     111b <roi_get_stream_response_bump_r+0xb>
test   %al,%al
jne    1124 <roi_get_stream_response_bump_r+0x14>
add    $0x3,%rdi
jmp    1030 <roi_get_sensor_response_bump_r@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @roi_get_stream_response_bump_r(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
switch i8 %3, label %7 [
i8 0, label %4
i8 6, label %4
]
4: ; preds = %1, %1
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = tail call i32 @roi_get_sensor_response_bump_r(i8* %5)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ 0, %1 ], [ %6, %4 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ base64_decode(char *);
void rtsp_decode_base64(char *buffer) { base64_decode(buffer); }


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

x86 assembly (clang, -O2):
<rtsp_decode_base64>:
jmp    1030 <base64_decode@plt>

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

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


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int medusaReceiveInternal(int, char *, int);
int /*<<< orphan*/ writeError(int, char *, char *);
int medusaReceive(int socket, char *buf, int length) {
  int ret;
  ret = medusaReceiveInternal(socket, buf, length);
  writeError(7, "Data received: %s", buf);
  return ret;
}


x86 assembly (clang, -O0):
<medusaReceive>:
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   1040 <medusaReceiveInternal@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x7,%edi
lea    0xeac(%rip),%rsi
call   1030 <writeError@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceive>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <medusaReceiveInternal@plt>
mov    %eax,%ebp
lea    0xecc(%rip),%rsi
mov    $0x7,%edi
mov    %rbx,%rdx
call   1030 <writeError@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Data received: %s\00"
define i32 @medusaReceive(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @medusaReceiveInternal(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i8*, i8** %5
%13 = call i32 @writeError(i32 7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"Data received: %s\00"
define i32 @medusaReceive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @medusaReceiveInternal(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @writeError(i32 7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %4
}
/* Variables and functions */
double __builtin_wasm_max_f64(double, double);
double max_f64(double x, double y) { return __builtin_wasm_max_f64(x, y); }


x86 assembly (clang, -O0):
<max_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_wasm_max_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f64>:
jmp    1030 <__builtin_wasm_max_f64@plt>

LLVM IR (-O0):
define double @max_f64(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 = call double @__builtin_wasm_max_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @max_f64(double %0, double %1) {
%3 = tail call double @__builtin_wasm_max_f64(double %0, double %1)
ret double %3
}
void roadmap_download_no_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_download_no_handler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ putwchar(int /*<<< orphan*/);
void uninitvar_putwchar(void) {
  wchar_t c;
  (void)putwchar(c);
}


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

x86 assembly (clang, -O2):
<uninitvar_putwchar>:
jmp    1030 <putwchar@plt>

LLVM IR (-O0):
define void @uninitvar_putwchar() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @putwchar(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_putwchar() {
%1 = tail call i32 @putwchar(i32 undef)
ret void
}
int fun364() { return 364; }


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

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

LLVM IR (-O0):
define i32 @fun364() {
ret i32 364
}

LLVM IR (-O2):
define i32 @fun364() {
ret i32 364
}
unsigned long long __stdlib_pow(unsigned long base, unsigned long exp) {
  unsigned long long rbase = 1;
  while (exp--)
    rbase *= base;
  return rbase;
}


x86 assembly (clang, -O0):
<__stdlib_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <__stdlib_pow+0x3f>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <__stdlib_pow+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdlib_pow>:
test   %rsi,%rsi
je     111b <__stdlib_pow+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <__stdlib_pow+0x21>
mov    $0x1,%eax
jmp    1156 <__stdlib_pow+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <__stdlib_pow+0x30>
test   %rcx,%rcx
je     116a <__stdlib_pow+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <__stdlib_pow+0x60>
ret

LLVM IR (-O0):
define i64 @__stdlib_pow(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 1, i64* %5
br label %6
6: ; preds = %10, %2
%7 = load i64, i64* %4
%8 = add i64 %7, -1
store i64 %8, i64* %4
%9 = icmp ne i64 %7, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i64, i64* %3
%12 = load i64, i64* %5
%13 = mul i64 %12, %11
store i64 %13, i64* %5
br label %6
14: ; preds = %6
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @__stdlib_pow(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul i64 %11, %0
%14 = mul i64 %13, %0
%15 = mul i64 %14, %0
%16 = mul i64 %15, %0
%17 = mul i64 %16, %0
%18 = mul i64 %17, %0
%19 = mul i64 %18, %0
%20 = mul i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wallet_get_pubkeyhash(int /*<<< orphan*/ const *,
                                         int /*<<< orphan*/ *);
void wallet_get_address_raw(const uint8_t *pub_key, uint8_t version,
                            uint8_t *addr_raw) {
  addr_raw[0] = version;
  wallet_get_pubkeyhash(pub_key, addr_raw + 1);
}


x86 assembly (clang, -O0):
<wallet_get_address_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
call   1030 <wallet_get_pubkeyhash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wallet_get_address_raw>:
mov    %esi,(%rdx)
lea    0x4(%rdx),%rsi
jmp    1030 <wallet_get_pubkeyhash@plt>

LLVM IR (-O0):
define void @wallet_get_address_raw(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %5
%8 = load i32*, i32** %6
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %4
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = call i32 @wallet_get_pubkeyhash(i32* %10, i32* %12)
ret void
}

LLVM IR (-O2):
define void @wallet_get_address_raw(i32* %0, i32 %1, i32* %2) {
store i32 %1, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 1
%5 = tail call i32 @wallet_get_pubkeyhash(i32* %0, i32* %4)
ret void
}
int match(const void *key1, const void *key2) {
  unsigned int *i1 = (unsigned int *)key1;
  unsigned int *i2 = (unsigned int *)key2;
  if (*i1 == *i2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    113a <match+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <match+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void BSP_FREE(void *pMem) {}


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

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

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

LLVM IR (-O2):
define void @BSP_FREE(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int get_nprocs();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("your system has %d processors. \n", get_nprocs());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"your system has %d processors. \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @get_nprocs()
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"your system has %d processors. \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_nprocs()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
_Bool isMarsCrosser(double q, double e, double i) {
  return q < 1.67 && q >= 1.3 && q * (1 + e) / (1 - e) > 1.58;
}


x86 assembly (clang, -O0):
<isMarsCrosser>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xor    %eax,%eax
movsd  0xee3(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x19(%rbp)
jbe    1180 <isMarsCrosser+0x80>
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     1180 <isMarsCrosser+0x80>
movsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMarsCrosser>:
xor    %eax,%eax
movsd  0xef6(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    1141 <isMarsCrosser+0x41>
ucomisd 0xef0(%rip),%xmm0
jb     1141 <isMarsCrosser+0x41>
movsd  0xeee(%rip),%xmm2
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm3
ucomisd 0xeda(%rip),%xmm3
seta   %al
ret

LLVM IR (-O0):
define zeroext i1 @isMarsCrosser(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fcmp olt double %7, 1.670000e+00
br i1 %8, label %9, label %21
9: ; preds = %3
%10 = load double, double* %4
%11 = fcmp oge double %10, 1.300000e+00
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fadd double 1.000000e+00, %14
%16 = fmul double %13, %15
%17 = load double, double* %5
%18 = fsub double 1.000000e+00, %17
%19 = fdiv double %16, %18
%20 = fcmp ogt double %19, 1.580000e+00
br label %21
21: ; preds = %12, %9, %3
%22 = phi i1 [ false, %9 ], [ false, %3 ], [ %20, %12 ]
ret i1 %22
}

LLVM IR (-O2):
define zeroext i1 @isMarsCrosser(double %0, double %1, double %2) {
%4 = fcmp olt double %0, 1.670000e+00
%5 = fcmp oge double %0, 1.300000e+00
%6 = and i1 %4, %5
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = fadd double %1, 1.000000e+00
%9 = fmul double %8, %0
%10 = fsub double 1.000000e+00, %1
%11 = fdiv double %9, %10
%12 = fcmp ogt double %11, 1.580000e+00
br label %13
13: ; preds = %7, %3
%14 = phi i1 [ false, %3 ], [ %12, %7 ]
ret i1 %14
}
void jac_chain_nm6_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @jac_chain_nm6_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(unsigned short);
void write_ds1307(unsigned short address, unsigned short w_data) {
  I2C1_Start();
  I2C1_Wr(0xD0);
  I2C1_Wr(address);
  I2C1_Wr(w_data);
  I2C1_Stop();
}


x86 assembly (clang, -O0):
<write_ds1307>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
movzwl -0x2(%rbp),%edi
call   1040 <I2C1_Wr@plt>
movzwl -0x4(%rbp),%edi
call   1040 <I2C1_Wr@plt>
mov    $0x0,%al
call   1030 <I2C1_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ds1307>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebp,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebx,%edi
call   1040 <I2C1_Wr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <I2C1_Stop@plt>

LLVM IR (-O0):
define void @write_ds1307(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call i32 (...) @I2C1_Start()
%6 = call i32 @I2C1_Wr(i16 zeroext 208)
%7 = load i16, i16* %3
%8 = call i32 @I2C1_Wr(i16 zeroext %7)
%9 = load i16, i16* %4
%10 = call i32 @I2C1_Wr(i16 zeroext %9)
%11 = call i32 (...) @I2C1_Stop()
ret void
}

LLVM IR (-O2):
define void @write_ds1307(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 (...) @I2C1_Start()
%4 = tail call i32 @I2C1_Wr(i16 zeroext 208)
%5 = tail call i32 @I2C1_Wr(i16 zeroext %0)
%6 = tail call i32 @I2C1_Wr(i16 zeroext %1)
%7 = tail call i32 (...) @I2C1_Stop()
ret void
}
void rop3_212_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = T ^ *D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_212_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_212_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
and    %sil,%al
not    %sil
and    %dl,%sil
and    %cl,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_212_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %9
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = load i8, i8* %9
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %8
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %7
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %5
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = trunc i32 %47 to i8
%49 = load i8*, i8** %4
store i8 %48, i8* %49
ret void
}

LLVM IR (-O2):
define void @rop3_212_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %1, -1
%7 = and i8 %6, %2
%8 = and i8 %7, %5
%9 = and i8 %4, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
int foo(int x) { return x < 0 ? 1 : x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <foo+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <foo+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
mov    $0x1,%eax
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
ret i32 %3
}
/* Type definitions */
struct arg_uint {
  int dummy;
};

/* Variables and functions */
struct arg_uint *arg_uintn(char const *, char const *, char const *, int, int,
                           char const *);
struct arg_uint *arg_uint1(const char *shortopts, const char *longopts,
                           const char *datatype, const char *glossary) {
  return arg_uintn(shortopts, longopts, datatype, 1, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_uint1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <arg_uintn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_uint1>:
mov    %rcx,%r9
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <arg_uintn@plt>

LLVM IR (-O0):
%struct.arg_uint = type { i32 }
define %struct.arg_uint* @arg_uint1(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call %struct.arg_uint* @arg_uintn(i8* %9, i8* %10, i8* %11, i32 1, i32 1, i8* %12)
ret %struct.arg_uint* %13
}

LLVM IR (-O2):
%struct.arg_uint = type { i32 }
define %struct.arg_uint* @arg_uint1(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.arg_uint* @arg_uintn(i8* %0, i8* %1, i8* %2, i32 1, i32 1, i8* %3)
ret %struct.arg_uint* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
s(void) { printf("Smile!"); }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):

:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"Smile!\00"
define i32 @s() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
unsigned long insert_spr(unsigned long insn, long value,
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}


x86 assembly (clang, -O0):
<insert_spr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0x3e0,%rcx
shl    $0x6,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_spr>:
mov    %esi,%eax
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
shl    $0x6,%esi
and    $0xf800,%esi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @insert_spr(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = and i64 %10, 31
%12 = shl i64 %11, 16
%13 = or i64 %9, %12
%14 = load i64, i64* %6
%15 = and i64 %14, 992
%16 = shl i64 %15, 6
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @insert_spr(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = shl i64 %1, 16
%6 = and i64 %5, 2031616
%7 = or i64 %6, %0
%8 = shl i64 %1, 6
%9 = and i64 %8, 63488
%10 = or i64 %7, %9
ret i64 %10
}
int stack_test_1() {
  int x = 6;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @stack_test_1() {
ret i32 6
}
int int2sig(int thesignal) {
  switch (thesignal) {
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<int2sig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <int2sig+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int2sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @int2sig(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
void myfread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  size_t bytes_read;
  bytes_read = fread(ptr, size, nmemb, stream);
  assert(bytes_read == nmemb);
}


x86 assembly (clang, -O0):
<myfread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfread>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fread@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @myfread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %8
%14 = call i64 @fread(i8* %10, i64 %11, i64 %12, i32* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = load i64, i64* %7
%17 = icmp eq i64 %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
define void @myfread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, %2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
/* Variables and functions */
double minipack_unpack_double(void *, size_t *);
void sky_set_double(void *target, void *value, size_t *sz) {
  *((double *)target) = minipack_unpack_double(value, sz);
}


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

x86 assembly (clang, -O2):
<sky_set_double>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <minipack_unpack_double@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sky_set_double(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%7 = load i8*, i8** %5
%8 = load i64*, i64** %6
%9 = call double @minipack_unpack_double(i8* %7, i64* %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
store double %9, double* %11
ret void
}

LLVM IR (-O2):
define void @sky_set_double(i8* nocapture writeonly %0, i8* %1, i64* %2) {
%4 = tail call double @minipack_unpack_double(i8* %1, i64* %2)
%5 = bitcast i8* %0 to double*
store double %4, double* %5
ret void
}
int fa_blackman_cof_num(float ftrans) { return (int)(6.6 / ftrans); }


x86 assembly (clang, -O0):
<fa_blackman_cof_num>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_blackman_cof_num>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @fa_blackman_cof_num(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double 6.600000e+00, %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fa_blackman_cof_num(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double 6.600000e+00, %2
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
double atod(char *);
scalar_t__ readln(char *, int);
double readd() {
  char buf[80];
  if (readln(buf, 80) == 0)
    return 0;
  return atod(buf);
}


x86 assembly (clang, -O0):
<readd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1040 <readln@plt>
cmp    $0x0,%rax
jne    114d <readd+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115b <readd+0x3b>
lea    -0x60(%rbp),%rdi
call   1030 <atod@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readd>:
sub    $0x58,%rsp
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <readln@plt>
test   %rax,%rax
je     1143 <readd+0x23>
mov    %rsp,%rdi
call   1030 <atod@plt>
add    $0x58,%rsp
ret
xorps  %xmm0,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @readd() {
%1 = alloca double
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i64 @readln(i8* %3, i32 80)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store double 0.000000e+00, double* %1
br label %10
7: ; preds = %0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = call double @atod(i8* %8)
store double %9, double* %1
br label %10
10: ; preds = %7, %6
%11 = load double, double* %1
ret double %11
}

LLVM IR (-O2):
define double @readd() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i64 @readln(i8* %2, i32 80)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call double @atod(i8* %2)
br label %7
7: ; preds = %0, %5
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %0 ]
ret double %8
}
int f(char *p, char *q) {
  int i;
  i = p - q;
  return i;
}


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ aecium(int, char **);
int main(int argc, char **argv) {
  aecium(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @aecium(i32 %0, i8** %1)
ret i32 0
}
int fibonacci_recursive(int num) {
  if (num > 1)
    return fibonacci_recursive(num - 1) + fibonacci_recursive(num - 2);
  if (num == 1 || num == 0)
    return num;
}


x86 assembly (clang, -O0):
<fibonacci_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <fibonacci_recursive+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci_recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci_recursive@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <fibonacci_recursive+0x57>
cmpl   $0x1,-0x8(%rbp)
je     1161 <fibonacci_recursive+0x51>
cmpl   $0x0,-0x8(%rbp)
jne    1167 <fibonacci_recursive+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci_recursive>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1136 <fibonacci_recursive+0x26>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci_recursive@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1120 <fibonacci_recursive+0x10>
jmp    1138 <fibonacci_recursive+0x28>
mov    %ebx,%ecx
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci_recursive(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci_recursive(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned long timeval_to_ms(struct timeval *);
unsigned long get_deadline(unsigned long ms) {
  struct timeval current;
  gettimeofday(&current, 0);
  unsigned long current_ms = timeval_to_ms(&current);
  unsigned long deadline_result = current_ms + ms;
  return deadline_result;
}


x86 assembly (clang, -O0):
<get_deadline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
lea    -0x10(%rbp),%rdi
call   1040 <timeval_to_ms@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_deadline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %r14,%rdi
call   1040 <timeval_to_ms@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @get_deadline(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
%6 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%7 = call i64 @timeval_to_ms(%struct.timeval* %3)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = load i64, i64* %2
%10 = add i64 %8, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @get_deadline(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = call i64 @timeval_to_ms(%struct.timeval* %2)
%6 = add i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void warn(const char *message) {
  fprintf(stderr, "\033[33mWarning\033[0m: %s\n", message);
}


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"\1B[33mWarning\1B[0m: %s\0A\00"
define void @warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"\1B[33mWarning\1B[0m: %s\0A\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int i2c_write(int file_handle, uint8_t *source, uint8_t amount) {
  return write(file_handle, source, amount);
}


x86 assembly (clang, -O0):
<i2c_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):
<i2c_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @i2c_write(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @i2c_write(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void httpCacheControl(const char *directive) {
  if (directive != NULL) {
    printf("Cache-Control: %s\n", directive);
  }
  return;
}


x86 assembly (clang, -O0):
<httpCacheControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <httpCacheControl+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpCacheControl>:
test   %rdi,%rdi
je     1124 <httpCacheControl+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Cache-Control: %s\0A\00"
define void @httpCacheControl(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Cache-Control: %s\0A\00"
define void @httpCacheControl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}