xunge/DecIR huggingface dataset:
int main1() {
  char *s, t;
  (__extension__(__builtin_constant_p(t) && !__builtin_constant_p(s) &&
                         (t) == '\0'
                     ? (char *)__rawmemchr(s, t)
                     : __builtin_strchr(s, t)));
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main1() {
%1 = alloca i8*
%2 = alloca i8
%3 = load i8, i8* %2
%4 = call i1 @llvm.is.constant.i8(i8 %3)
br i1 %4, label %5, label %17
5: ; preds = %0
br i1 false, label %17, label %6
6: ; preds = %5
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @__rawmemchr to i32 (i8*, i32, ...)*)(i8* %11, i32 %13)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
br label %22
17: ; preds = %6, %5, %0
%18 = load i8*, i8** %1
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = call i8* @strchr(i8* %18, i32 %20)
br label %22
22: ; preds = %17, %10
%23 = phi i8* [ %16, %10 ], [ %21, %17 ]
ret i32 0
}

LLVM IR (-O2):
define i32 @main1() {
%1 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @__rawmemchr to i32 (i8*, i32, ...)*)(i8* undef, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
TEK_exit() {
  putchar('\037');
  putchar('\030');
}


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

x86 assembly (clang, -O2):
<TEK_exit>:
push   %rax
mov    $0x1f,%edi
call   1030 <putchar@plt>
mov    $0x18,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @TEK_exit() {
%1 = alloca i32
%2 = call i32 @putchar(i8 signext 31)
%3 = call i32 @putchar(i8 signext 24)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @TEK_exit() {
%1 = tail call i32 @putchar(i8 signext 31)
%2 = tail call i32 @putchar(i8 signext 24)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1))) void hp7(void) { printf("hello, world!\n"); }


x86 assembly (clang, -O0):
<hp7>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hp7>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp7() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp7() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_setstackaddr(pthread_attr_t *a, void *b) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_attr_setstackaddr>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_setstackaddr(i32* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ xwayland_client_test();
void wrapxwayland_client_test(void *data) {
  (void)data;
  xwayland_client_test();
}


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

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

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

LLVM IR (-O2):
define void @wrapxwayland_client_test(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @xwayland_client_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main(void) { _exit(42); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_exit(i32 42)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 42)
unreachable
}
struct node *find_leaf(struct node *n) {}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @find_leaf(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = load %struct.node*, %struct.node** %2
ret %struct.node* %4
}

LLVM IR (-O2):
%struct.node = type opaque
define noalias %struct.node* @find_leaf(%struct.node* nocapture readnone %0) {
ret %struct.node* undef
}
int asm_mipswrap() { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @asm_mipswrap() {
ret i32 1
}
/* Variables and functions */
int __access_ok(unsigned long, unsigned long);
int access_ok(int type, const void *p, unsigned long size) {
  unsigned long addr = (unsigned long)p;
  return __access_ok(addr, size);
}


x86 assembly (clang, -O0):
<access_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <__access_ok@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access_ok>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <__access_ok@plt>

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

LLVM IR (-O2):
define i32 @access_ok(i32 %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = tail call i32 @__access_ok(i64 %4, i64 %2)
ret i32 %5
}
/* Variables and functions */
long double tanl(long double);
long double libm_tanl(long double x) { return tanl(x); }


x86 assembly (clang, -O0):
<libm_tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tanl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_tanl>:
jmp    1030 <tanl@plt>

LLVM IR (-O0):
define x86_fp80 @libm_tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @tanl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @libm_tanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @tanl(x86_fp80 %0)
ret x86_fp80 %2
}
int __default_match(void *_a, void *_b) {
  long a = (long)_a;
  long b = (long)_b;
  return a > b ? (-1) : a == b ? (0) : (1);
}


x86 assembly (clang, -O0):
<__default_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1137 <__default_match+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    114f <__default_match+0x4f>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__default_match>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__default_match(i8* readnone %0, i8* readnone %1) {
%3 = icmp sgt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void foo(int x, int y) {
label:
  __attribute__((__unused__)) foo(x, y - 0);
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 0
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
void fooc() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ transmit(int, int, int /*<<< orphan*/);
void send_f(uint32_t pulse_len) {
  transmit(1, 3, pulse_len);
  transmit(3, 1, pulse_len);
}


x86 assembly (clang, -O0):
<send_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <transmit@plt>
mov    -0x4(%rbp),%edx
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <transmit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_f>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x3,%esi
mov    %ebx,%edx
call   1030 <transmit@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <transmit@plt>

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

LLVM IR (-O2):
define void @send_f(i32 %0) {
%2 = tail call i32 @transmit(i32 1, i32 3, i32 %0)
%3 = tail call i32 @transmit(i32 3, i32 1, i32 %0)
ret void
}
void H210ToAR30() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @fild_WakeUnLock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x0d() {
  Assert_real((isxdigit(13) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              70, ("isxdigit should be 0 for 0x0d"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x0d>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x46,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x0d\00"
define void @t_isxdigit_0x0d() {
%1 = call i64 @isxdigit(i32 13)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x0d\00"
define void @t_isxdigit_0x0d() {
%1 = tail call i64 @isxdigit(i32 13)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int shr2(x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<shr2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @shr2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int test_imm_C8int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C8int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xc8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C8int64_midword_mem>:
testb  $0xc8,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C8int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 200
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_C8int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13107200
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long atol(char const *);
__attribute__((__weak__, __always___)) long
softboundcets_atol(const char *nptr) {
  return atol(nptr);
}


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

x86 assembly (clang, -O2):
<softboundcets_atol>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define weak i64 @softboundcets_atol(i8* %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
void g_shell_parse_argv() {}


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

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

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

LLVM IR (-O2):
define void @g_shell_parse_argv() {
ret void
}
int sp(int x) { return (x & 7) << 1; }


x86 assembly (clang, -O0):
<sp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp>:
lea    (%rdi,%rdi,1),%eax
and    $0xe,%eax
ret

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

LLVM IR (-O2):
define i32 @sp(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 14
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exact_square(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  exact_square(number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <exact_square@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
ret i32 0
}
/* Variables and functions */
int generate_c_api();
int generate_api(void) { return generate_c_api(); }


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

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

LLVM IR (-O0):
define i32 @generate_api() {
%1 = call i32 (...) @generate_c_api()
ret i32 %1
}

LLVM IR (-O2):
define i32 @generate_api() {
%1 = tail call i32 (...) @generate_c_api()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int, char *);
void zraisecpl(char *msg, char *srcname, unsigned int linum) {
  printf("%s[%u]: Error: %s\n", srcname, linum, msg);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"%s[%u]: Error: %s\0A\00"
define void @zraisecpl(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** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s[%u]: Error: %s\0A\00"
define void @zraisecpl(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_no_timestamp() {
  char *str = " ";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 0 && (dest % 1000000000) == 0);
}


x86 assembly (clang, -O0):
<test_no_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    116f <test_no_timestamp+0x4f>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_timestamp>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
mov    0x4(%rsp),%eax
lea    0x3b9ac9ff(%rax),%ecx
xor    %edi,%edi
cmp    $0x773593fe,%ecx
ja     115d <test_no_timestamp+0x3d>
imul   $0x3a2e9c6d,%eax,%eax
add    $0x400,%eax
ror    $0x9,%eax
xor    %edi,%edi
cmp    $0x5,%eax
setb   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @test_no_timestamp() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @test_no_timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, 999999999
%6 = icmp ult i32 %5, 1999999999
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = srem i32 %4, 1000000000
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 0, %0 ], [ %10, %7 ]
%13 = call i32 @assert(i32 %12)
ret void
}
void _M2_bounce4_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_bounce4_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printPointerValue(int *a) { printf("%d", *a); }


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

x86 assembly (clang, -O2):
<printPointerValue>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printPointerValue(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sh_error(char *, int);
long sysconf(int name) { sh_error("no sysconf for: %d", name); }


x86 assembly (clang, -O0):
<sysconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <sh_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysconf>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <sh_error@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"no sysconf for: %d\00"
define i64 @sysconf(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @sh_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
@.str = [19 x i8] c"no sysconf for: %d\00"
define i64 @sysconf(i32 %0) {
%2 = tail call i32 @sh_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long I2STxFIFOLevelGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  return ((*((volatile unsigned long *)(ulBase + 0x00000018))));
}


x86 assembly (clang, -O0):
<I2STxFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxFIFOLevelGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x18(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2STxFIFOLevelGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 24
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @I2STxFIFOLevelGet(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 24
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
unsigned char SPI_MODE_3;
unsigned char spi_mode_3() { return SPI_MODE_3; }


x86 assembly (clang, -O0):
<spi_mode_3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_mode_3>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
@SPI_MODE_3 = global i8 0
define zeroext i8 @spi_mode_3() {
%1 = load i8, i8* @SPI_MODE_3
ret i8 %1
}

LLVM IR (-O2):
@SPI_MODE_3 = global i8 0
define zeroext i8 @spi_mode_3() {
%1 = load i8, i8* @SPI_MODE_3
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void irq_handler(void) { printf("irq_handler\n"); }


x86 assembly (clang, -O0):
<irq_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_handler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"irq_handler\0A\00"
define void @irq_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"irq_handler\00"
define void @irq_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_D0int64_midword_reg(long long val) {
  return ((val >> 16) & (0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xd0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D0int64_midword_reg>:
test   $0xd00000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D0int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 208
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D0int64_midword_reg(i64 %0) {
%2 = and i64 %0, 13631488
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  fprintf(stdout, "%s", "Hello World.\n");
  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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0xedb(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Hello World.\0A\00"
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* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Hello World.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t MIPS32_NOP(void) { return 0x00000000; }


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

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

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

LLVM IR (-O2):
define i32 @MIPS32_NOP() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_hashmap_iterate() {
  printf("NOT IMPLEMENTED:"
         "pa_hashmap_iterate"
         "\n");
}


x86 assembly (clang, -O0):
<pa_hashmap_iterate>:
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):
<pa_hashmap_iterate>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_hashmap_iterate\00"
define i32 @pa_hashmap_iterate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t flip32(uint32_t v) {
  int i;
  uint32_t out = 0;
  for (i = 0; i < 32; i++)
    if (v & (1 << i))
      out |= (1 << (31 - i));
  return out;
}


x86 assembly (clang, -O0):
<flip32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1161 <flip32+0x61>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114e <flip32+0x4e>
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <flip32+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <flip32+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip32>:
xor    %r8d,%r8d
xor    %eax,%eax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    $0x80000000,%esi
mov    %edx,%ecx
shr    %cl,%esi
bt     %edx,%edi
cmovae %r8d,%esi
or     %eax,%esi
lea    0x1(%rdx),%eax
movzbl %al,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
bt     %ecx,%edi
cmovae %r8d,%eax
or     %esi,%eax
add    $0x2,%edx
cmp    $0x20,%edx
jne    1110 <flip32+0x10>
ret

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

LLVM IR (-O2):
define i32 @flip32(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %17, %2 ]
%4 = phi i32 [ 0, %1 ], [ %18, %2 ]
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %0
%7 = icmp eq i32 %6, 0
%8 = lshr i32 -2147483648, %4
%9 = select i1 %7, i32 0, i32 %8
%10 = or i32 %9, %3
%11 = or i32 %4, 1
%12 = shl nuw i32 1, %11
%13 = and i32 %12, %0
%14 = icmp eq i32 %13, 0
%15 = lshr i32 -2147483648, %11
%16 = select i1 %14, i32 0, i32 %15
%17 = or i32 %16, %10
%18 = add nuw nsw i32 %4, 2
%19 = icmp eq i32 %18, 32
br i1 %19, label %20, label %2
20: ; preds = %2
ret i32 %17
}
void reduce_sum(double *array, int n) { double *temp; }


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

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

LLVM IR (-O0):
define void @reduce_sum(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double*
store double* %0, double** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @reduce_sum(double* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int spi_command_read(char, char *, int, char *);
int nrf_read_register(char reg, char *regval, char *retstatus) {
  return spi_command_read((reg | 0x00), regval, 1, retstatus);
}


x86 assembly (clang, -O0):
<nrf_read_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x0,%eax
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
movsbl %al,%edi
call   1030 <spi_command_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_read_register>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <spi_command_read@plt>

LLVM IR (-O0):
define i32 @nrf_read_register(i8 signext %0, i8* %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = or i32 %8, 0
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @spi_command_read(i8 signext %10, i8* %11, i32 1, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @nrf_read_register(i8 signext %0, i8* %1, i8* %2) {
%4 = tail call i32 @spi_command_read(i8 signext %0, i8* %1, i32 1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, long);
int /*<<< orphan*/ stderr;
void _E__pr_info_header(char const *f, long ln, char const *msg) {
  (void)fflush(stderr);
  (void)fprintf(stderr, "%s: %s(%ld): ", msg, f, ln);
}


x86 assembly (clang, -O0):
<_E__pr_info_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_E__pr_info_header>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea8(%rip),%r12
mov    (%r12),%edi
call   1040 <fflush@plt>
mov    (%r12),%edi
lea    0xeb4(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"%s: %s(%ld): \00"
define void @_E__pr_info_header(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"%s: %s(%ld): \00"
define void @_E__pr_info_header(i8* %0, i64 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i64 %1)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int cstat(const char *pathname, struct stat *statbuf) {
  return stat(pathname, statbuf);
}


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

x86 assembly (clang, -O2):
<cstat>:
jmp    1030 <stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @cstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
void yy_1_InlineContentPlus(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_InlineContentPlus(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int utimensat(int, int /*<<< orphan*/, struct timespec const *,
              int /*<<< orphan*/);
int futimens(int fd, const struct timespec times[2]) {
  return utimensat(fd, 0, times, 0);
}


x86 assembly (clang, -O0):
<futimens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <utimensat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futimens>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <utimensat@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @futimens(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @utimensat(i32 %0, i32 0, %struct.timespec* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ platformStart();
void machineResume() { platformStart(); }


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

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

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

LLVM IR (-O2):
define void @machineResume() {
%1 = tail call i32 (...) @platformStart()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mark1() { printf("inside mark1\n"); }


x86 assembly (clang, -O0):
<mark1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"inside mark1\0A\00"
define void @mark1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"inside mark1\00"
define void @mark1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
ckexpf(file) register char *file;
{
  if (expfile(file) != -1)
    return 0;
  logent("CAN'T EXPAND FILENAME - PWD FAILED", file + 1);
  return -1;
}


x86 assembly (clang, -O0):
<ckexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <expfile@plt>
cmp    $0xffffffff,%eax
je     114c <ckexpf+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1169 <ckexpf+0x49>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <logent@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckexpf>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <expfile@plt>
cmp    $0xffffffff,%eax
jne    114e <ckexpf+0x2e>
add    $0x1,%rbx
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <logent@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"CAN'T EXPAND FILENAME - PWD FAILED\00"
define i32 @ckexpf(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @expfile to i32 (i8*, ...)*)(i8* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @logent to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [35 x i8] c"CAN'T EXPAND FILENAME - PWD FAILED\00"
define i32 @ckexpf(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @expfile to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @logent to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _sw(int, int);
int /*<<< orphan*/ ee_kmode_enter();
int /*<<< orphan*/ ee_kmode_exit();
void HookEngine(void) {
  ee_kmode_enter();
  _sw(0x0c01E244, 0x800002fc);
  ee_kmode_exit();
}


x86 assembly (clang, -O0):
<HookEngine>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ee_kmode_enter@plt>
mov    $0xc01e244,%edi
mov    $0x800002fc,%esi
call   1050 <_sw@plt>
mov    $0x0,%al
call   1040 <ee_kmode_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HookEngine>:
push   %rax
xor    %eax,%eax
call   1030 <ee_kmode_enter@plt>
mov    $0xc01e244,%edi
mov    $0x800002fc,%esi
call   1050 <_sw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ee_kmode_exit@plt>

LLVM IR (-O0):
define void @HookEngine() {
%1 = call i32 (...) @ee_kmode_enter()
%2 = call i32 @_sw(i32 201450052, i32 -2147482884)
%3 = call i32 (...) @ee_kmode_exit()
ret void
}

LLVM IR (-O2):
define void @HookEngine() {
%1 = tail call i32 (...) @ee_kmode_enter()
%2 = tail call i32 @_sw(i32 201450052, i32 -2147482884)
%3 = tail call i32 (...) @ee_kmode_exit()
ret void
}
/* Variables and functions */
extern void *TakeTwoPointersToInt(int *ptr1, int *ptr2) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @TakeTwoPointersToInt(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}