xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x71() {
  Assert_real((isgraph(113)),
              "/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_isgraph.c",
              570, ("isgraph should be 1 for q"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x71>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23a,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x71>:
push   %rax
mov    $0x71,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for q\00"
define void @t_isgraph_0x71() {
%1 = call i32 @isgraph(i32 113)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for q\00"
define void @t_isgraph_0x71() {
%1 = tail call i32 @isgraph(i32 113)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void leaf_call(char *name) { printf("Call %s\n", name); }


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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Call %s\0A\00"
define void @leaf_call(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bye() { printf("bye, forks~\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"bye, forks~\0A\00"
define void @bye() {
%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"bye, forks~\00"
define void @bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void g_option_context_new() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_new() {
ret void
}
int is_left_anchor(int anc) {
  if (anc == (1 << 3) || anc == (1 << 4) || anc == (1 << 5) ||
      anc == (1 << 10) || anc == (1 << 11))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_left_anchor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
je     113f <is_left_anchor+0x3f>
cmpl   $0x10,-0x8(%rbp)
je     113f <is_left_anchor+0x3f>
cmpl   $0x20,-0x8(%rbp)
je     113f <is_left_anchor+0x3f>
cmpl   $0x400,-0x8(%rbp)
je     113f <is_left_anchor+0x3f>
cmpl   $0x800,-0x8(%rbp)
jne    114b <is_left_anchor+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <is_left_anchor+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_left_anchor>:
xor    %eax,%eax
cmp    $0x20,%edi
ja     1119 <is_left_anchor+0x19>
mov    %edi,%ecx
movabs $0x100010100,%rdx
bt     %rcx,%rdx
jb     1129 <is_left_anchor+0x29>
cmp    $0x400,%edi
je     1129 <is_left_anchor+0x29>
cmp    $0x800,%edi
jne    112a <is_left_anchor+0x2a>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_left_anchor(i32 %0) {
switch i32 %0, label %2 [
i32 2048, label %3
i32 1024, label %3
i32 32, label %3
i32 16, label %3
i32 8, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ calc_parity(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                               int, int, int);
void calc_p_parity(uint8_t *sector) {
  calc_parity(sector, 0, 43, 19, 2 * 43, 2);
}


x86 assembly (clang, -O0):
<calc_p_parity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2b,%edx
mov    $0x13,%ecx
mov    $0x56,%r8d
mov    $0x2,%r9d
call   1030 <calc_parity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_p_parity>:
xor    %esi,%esi
mov    $0x2b,%edx
mov    $0x13,%ecx
mov    $0x56,%r8d
mov    $0x2,%r9d
jmp    1030 <calc_parity@plt>

LLVM IR (-O0):
define void @calc_p_parity(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @calc_parity(i32* %3, i32 0, i32 43, i32 19, i32 86, i32 2)
ret void
}

LLVM IR (-O2):
define void @calc_p_parity(i32* %0) {
%2 = tail call i32 @calc_parity(i32* %0, i32 0, i32 43, i32 19, i32 86, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_USR2(int /*<<< orphan*/);
int gen_USR2(void) {
  handle_USR2(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_USR2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_USR2@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_USR2() {
%1 = call i32 @handle_USR2(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_USR2() {
%1 = tail call i32 @handle_USR2(i32 0)
ret i32 0
}
/* Variables and functions */
bool add_named_escape(char ch, char **buffer, char *buffer_end) {
  if (buffer_end - *buffer < 2)
    return false;
  *(*buffer)++ = '\\';
  *(*buffer)++ = ch;
  return true;
}


x86 assembly (clang, -O0):
<add_named_escape>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
cmp    $0x2,%rax
jge    1136 <add_named_escape+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1167 <add_named_escape+0x67>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x5c,(%rax)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_named_escape>:
mov    (%rsi),%rcx
sub    %rcx,%rdx
xor    %eax,%eax
cmp    $0x2,%rdx
jl     112a <add_named_escape+0x2a>
lea    0x1(%rcx),%rax
mov    %rax,(%rsi)
movb   $0x5c,(%rcx)
mov    (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    %dil,(%rax)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @add_named_escape(i8 signext %0, i8** nocapture %1, i8* %2) {
%4 = load i8*, i8** %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %4 to i64
%7 = sub i64 %5, %6
%8 = icmp slt i64 %7, 2
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %10, i8** %1
store i8 92, i8* %4
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %1
store i8 %0, i8* %11
br label %13
13: ; preds = %3, %9
%14 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %14
}
void putDebugChar(unsigned ch) {
  while (((*(volatile unsigned char *)(0x7f38)) & 0x08) == 0)
    ;
  (*(volatile unsigned int *)((0x7f38) + 4)) = ch;
}


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7f38,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1122 <putDebugChar+0x22>
jmp    1107 <putDebugChar+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x7f3c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
testb  $0x8,0x7f38
08
je     1100 <putDebugChar>
mov    %edi,0x7f3c
ret

LLVM IR (-O0):
define void @putDebugChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i8, i8* inttoptr (i64 32568 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 32572 to i32*)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 32568 to i8*)
%4 = and i8 %3, 8
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 32572 to i32*)
ret void
}
void RTAvloU32Get(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *uint_realloc(int /*<<< orphan*/, size_t);
uint *uint_alloc(size_t size) { return uint_realloc(0, size); }


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

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

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

LLVM IR (-O2):
define i32* @uint_alloc(i64 %0) {
%2 = tail call i32* @uint_realloc(i32 0, i64 %0)
ret i32* %2
}
void ifdef() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void Feedback(FILE *out, char *prefix, char *string, va_list arg,
              char *suffix) {
  fprintf(out, prefix);
  vfprintf(out, string, arg);
  fprintf(out, suffix);
}


x86 assembly (clang, -O0):
<Feedback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Feedback>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%rbx
mov    %rdi,%rbp
call   1030 <fprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1040 <vfprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
define void @Feedback(i32* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i32 @fprintf(i32* %11, i8* %12)
%14 = load i32*, i32** %6
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = call i32 @vfprintf(i32* %14, i8* %15, i32 %16)
%18 = load i32*, i32** %6
%19 = load i8*, i8** %10
%20 = call i32 @fprintf(i32* %18, i8* %19)
ret void
}

LLVM IR (-O2):
define void @Feedback(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3, i8* nocapture %4) {
%6 = tail call i32 @fprintf(i32* %0, i8* %1)
%7 = tail call i32 @vfprintf(i32* %0, i8* %2, i32 %3)
%8 = tail call i32 @fprintf(i32* %0, i8* %4)
ret void
}
char *getenv(const char *name) {
  char *rc;
  return rc;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @getenv(i8* nocapture readnone %0) {
ret i8* undef
}
/* Type definitions */
struct core_instr_params {
  int dummy;
};
struct core_cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ core_cpu_i__call(struct core_cpu *,
                                    struct core_instr_params *,
                                    int /*<<< orphan*/);
void core_cpu_i_op_cl(struct core_cpu *cpu, struct core_instr_params *p) {
  core_cpu_i__call(cpu, p, 0);
}


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

x86 assembly (clang, -O2):
<core_cpu_i_op_cl>:
xor    %edx,%edx
jmp    1030 <core_cpu_i__call@plt>

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

LLVM IR (-O2):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_cl(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = tail call i32 @core_cpu_i__call(%struct.core_cpu* %0, %struct.core_instr_params* %1, i32 0)
ret void
}
/* Variables and functions */
int des_crypt(unsigned char const *, unsigned char *, int /*<<< orphan*/);
int des_encrypt(const unsigned char message[8], unsigned char output[8]) {
  return des_crypt(message, output, 0);
}


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

x86 assembly (clang, -O2):
<des_encrypt>:
xor    %edx,%edx
jmp    1030 <des_crypt@plt>

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

LLVM IR (-O2):
define i32 @des_encrypt(i8* %0, i8* %1) {
%3 = tail call i32 @des_crypt(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ crand48();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%hhu\n", crand48());
  printf("%hhu\n", crand48());
  printf("%hhu\n", crand48());
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%hhu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @crand48()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @crand48()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @crand48()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
int BPQSerialSetDSR(unsigned int hDevice) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BPQSerialSetDSR(i32 %0) {
ret i32 0
}
/* Variables and functions */
void *calloc(int, size_t);
void *memory_create(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<memory_create>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @memory_create(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
void testtoextd_(double *z, double *x) { *z = (long double)*x; }


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

x86 assembly (clang, -O2):
<testtoextd_>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @testtoextd_(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = fpext double %6 to x86_fp80
%8 = fptrunc x86_fp80 %7 to double
%9 = load double*, double** %3
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @testtoextd_(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
ret void
}
/* Variables and functions */
void *lp_cod_huff(void *, size_t *, int);
void *lp_cod_huf8(void *data, size_t *data_sz) {
  return lp_cod_huff(data, data_sz, 8);
}


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

x86 assembly (clang, -O2):
<lp_cod_huf8>:
mov    $0x8,%edx
jmp    1030 <lp_cod_huff@plt>

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

LLVM IR (-O2):
define i8* @lp_cod_huf8(i8* %0, i64* %1) {
%3 = tail call i8* @lp_cod_huff(i8* %0, i64* %1, i32 8)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ readb(void *);
int /*<<< orphan*/ writeb(unsigned char, long);
void outb_p(unsigned char value, long address) {
  readb((void *)(address & 0xffffff00) + 0x40);
  writeb(value, address);
}


x86 assembly (clang, -O0):
<outb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffff00,%rdi
and    -0x10(%rbp),%rdi
add    $0x40,%rdi
call   1030 <readb@plt>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1040 <writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb_p>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebx,%edi
and    $0xffffff00,%edi
or     $0x40,%rdi
call   1030 <readb@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writeb@plt>

LLVM IR (-O0):
define void @outb_p(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 4294967040
%7 = inttoptr i64 %6 to i8*
%8 = getelementptr i8, i8* %7, i64 64
%9 = call i32 @readb(i8* %8)
%10 = load i8, i8* %3
%11 = load i64, i64* %4
%12 = call i32 @writeb(i8 zeroext %10, i64 %11)
ret void
}

LLVM IR (-O2):
define void @outb_p(i8 zeroext %0, i64 %1) {
%3 = and i64 %1, 4294967040
%4 = inttoptr i64 %3 to i8*
%5 = getelementptr i8, i8* %4, i64 64
%6 = tail call i32 @readb(i8* %5)
%7 = tail call i32 @writeb(i8 zeroext %0, i64 %1)
ret void
}
int function(int x) {
  int y = 20;
  return x * y;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
shl    $0x2,%edi
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @function(i32 %0) {
%2 = mul nsw i32 %0, 20
ret i32 %2
}
void error_done(void) {}


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

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

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

LLVM IR (-O2):
define void @error_done() {
ret void
}
int has_sendfile(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @has_sendfile() {
ret i32 1
}
double smoothstep(double x) { return (x * x) * (3 - 2 * x); }


x86 assembly (clang, -O0):
<smoothstep>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
addsd  %xmm2,%xmm2
movsd  0xedc(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoothstep>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm0,%xmm0
movsd  0xeec(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @smoothstep(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %6, double 3.000000e+00)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @smoothstep(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 3.000000e+00)
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int close(int);
int net_close(int fd) {
  if (fd >= 0)
    return close(fd);
  return -1;
}


x86 assembly (clang, -O0):
<net_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1135 <net_close+0x25>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
jmp    113c <net_close+0x2c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_close>:
test   %edi,%edi
js     1119 <net_close+0x9>
jmp    1030 <close@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @net_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @net_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
unsigned long uart_read(unsigned offs) {
  volatile unsigned long *reg = (volatile unsigned long *)(0x80000000 + offs);
  return *reg;
}


x86 assembly (clang, -O0):
<uart_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80000000,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_read>:
mov    %edi,%eax
mov    $0x80000000,%ecx
xor    %rax,%rcx
mov    (%rcx),%rax
ret

LLVM IR (-O0):
define i64 @uart_read(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 -2147483648, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store i64* %7, i64** %3
%8 = load i64*, i64** %3
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @uart_read(i32 %0) {
%2 = xor i32 %0, -2147483648
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
/* Variables and functions */
float AngleNormalize180(float);
float AngleDelta(float angle1, float angle2) {
  return AngleNormalize180(angle1 - angle2);
}


x86 assembly (clang, -O0):
<AngleDelta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <AngleNormalize180@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleDelta>:
subss  %xmm1,%xmm0
jmp    1030 <AngleNormalize180@plt>

LLVM IR (-O0):
define float @AngleDelta(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @AngleNormalize180(float %7)
ret float %8
}

LLVM IR (-O2):
define float @AngleDelta(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @AngleNormalize180(float %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminationHandler(const int signal_unused) {
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<terminationHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminationHandler>:
push   %rax
xor    %eax,%eax
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @terminationHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminationHandler(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void spy_usage() {
  printf("usage:spy_server\n"
         "===========================\n"
         "[--port=<port>]\n"
         "[--ip=<listen address>]\n"
         "[--data_dir=<data directory>]\n"
         "[--error_log=<error log file>]\n"
         "[--mem_blocks=<memory blocks for stream buffer>]\n"
         "[--chunks=<number of chunks>]\n"
         "[--sync=<sync when write, 1 or 0>]\n"
         "[--daemonize=<1 or 0>]\n"
         "--master_ip=<chunkmaster ip addr>\n"
         "--master_port=<chunkmaster port>\n"
         "--group_id=<unique group id>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<spy_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<spy_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [380 x i8] c"usage:spy_server\0A===========================\0A[--port=<port>]\0A[--ip=<listen address>]\0A[--data_dir=<data directory>]\0A[--error_log=<error log file>]\0A[--mem_blocks=<memory blocks for stream buffer>]\0A[--chunks=<number of chunks>]\0A[--sync=<sync when write, 1 or 0>]\0A[--daemonize=<1 or 0>]\0A--master_ip=<chunkmaster ip addr>\0A--master_port=<chunkmaster port>\0A--group_id=<unique group id>\0A\00"
define void @spy_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([380 x i8], [380 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [379 x i8] c"usage:spy_server\0A===========================\0A[--port=<port>]\0A[--ip=<listen address>]\0A[--data_dir=<data directory>]\0A[--error_log=<error log file>]\0A[--mem_blocks=<memory blocks for stream buffer>]\0A[--chunks=<number of chunks>]\0A[--sync=<sync when write, 1 or 0>]\0A[--daemonize=<1 or 0>]\0A--master_ip=<chunkmaster ip addr>\0A--master_port=<chunkmaster port>\0A--group_id=<unique group id>\00"
define void @spy_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([379 x i8], [379 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ UART_BUSY(void *);
int /*<<< orphan*/ UART_PUTC(void *, char);
void default_putf(void *base_address, char data) {
  while (UART_BUSY(base_address))
    ;
  UART_PUTC(base_address, data);
}


x86 assembly (clang, -O0):
<default_putf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <UART_BUSY@plt>
cmp    $0x0,%rax
je     114a <default_putf+0x2a>
jmp    1132 <default_putf+0x12>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <UART_PUTC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_putf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <UART_BUSY@plt>
test   %rax,%rax
jne    1130 <default_putf+0x10>
movsbl %bpl,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <UART_PUTC@plt>

LLVM IR (-O0):
define void @default_putf(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = call i64 @UART_BUSY(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %4
%13 = call i32 @UART_PUTC(i8* %11, i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @default_putf(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @UART_BUSY(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = tail call i32 @UART_PUTC(i8* %0, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ svc(int, int *);
void qemu_semihost_putc(int c) { svc(0x03, &c); }


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

x86 assembly (clang, -O2):
<qemu_semihost_putc>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edi
call   1030 <svc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @qemu_semihost_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @svc(i32 3, i32* %2)
ret void
}

LLVM IR (-O2):
define void @qemu_semihost_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @svc(i32 3, i32* %2)
ret void
}
const char *VixDiskLib_ListTransportModes(void) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @VixDiskLib_ListTransportModes() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @VixDiskLib_ListTransportModes() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *malloc(size_t);
int main(int argc, char **argv) {
  size_t size = 16;
  void *p = malloc(size - 8);
  ((char *)p)[16] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
sub    $0x8,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,0x10(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 16, i64* %5
%7 = load i64, i64* %5
%8 = sub i64 %7, 8
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 16
store i8 0, i8* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
adr0imm1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*((double *)10000000)) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0imm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  0xedc(%rip),%xmm0
mov    $0x989680,%eax
ucomisd (%rax),%xmm0
jb     113f <adr0imm1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <adr0imm1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1>:
movsd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd 0x989680,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adr0imm1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 10000000 to double*)
%15 = fcmp ole double %14, 3.300000e+01
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %18
17: ; preds = %6
store i32 0, i32* %7
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @adr0imm1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 10000000 to double*)
%8 = fcmp ole double %7, 3.300000e+01
%9 = zext i1 %8 to i32
ret i32 %9
}
void add4(int x, int *y) { *y += x; }


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

x86 assembly (clang, -O2):
<add4>:
add    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @add4(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int, int, int);
void DoTwoNip(void) { InlineWords(4, 19, 20, 19, 20); }


x86 assembly (clang, -O0):
<DoTwoNip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x13,%ecx
mov    $0x14,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTwoNip>:
mov    $0x4,%edi
mov    $0x13,%esi
mov    $0x14,%edx
mov    $0x13,%ecx
mov    $0x14,%r8d
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoTwoNip() {
%1 = call i32 @InlineWords(i32 4, i32 19, i32 20, i32 19, i32 20)
ret void
}

LLVM IR (-O2):
define void @DoTwoNip() {
%1 = tail call i32 @InlineWords(i32 4, i32 19, i32 20, i32 19, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n, tri_num;
  tri_num = 0;
  n = 1;
  while (n <= 200) {
    tri_num = tri_num + n;
    n += 1;
  }
  printf("The 200th triangular number is %i\n", tri_num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 20100)
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_8(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_8() {
ret i32 0
}
OP(ed, b6) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bulktester2();
int main(int argc, char *argv[]) {
  bulktester2();
  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    $0x0,%al
call   1030 <bulktester2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bulktester2@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 = call i32 (...) @bulktester2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @bulktester2()
ret i32 0
}
__float128 from_sign_char_load_n(signed char *a, long n) {
  return (__float128)a[n];
}


x86 assembly (clang, -O0):
<from_sign_char_load_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
movsbl %al,%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<from_sign_char_load_n>:
push   %rax
movsbl (%rdi,%rsi,1),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_sign_char_load_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sitofp i8 %8 to fp128
ret fp128 %9
}

LLVM IR (-O2):
define fp128 @from_sign_char_load_n(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = sitofp i8 %4 to fp128
ret fp128 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(FILE *fp) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @fileno(i32* nocapture readnone %0) {
ret i32 0
}
int count_tos_bits(unsigned char bitpattern) {
  int bits;
  for (bits = 0, bitpattern &= 0x0E; bitpattern > 0x00; bitpattern >>= 1)
    bits += bitpattern & 0x01;
  return bits;
}


x86 assembly (clang, -O0):
<count_tos_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xe,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1144 <count_tos_bits+0x44>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    111b <count_tos_bits+0x1b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_tos_bits>:
xor    %eax,%eax
and    $0xe,%dil
je     1124 <count_tos_bits+0x24>
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%dl
movzbl %dl,%edx
add    %edx,%eax
shr    %cl
cmp    $0x1,%dil
mov    %ecx,%edi
ja     1110 <count_tos_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_tos_bits(i8 zeroext %0) {
%2 = and i8 %0, 14
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = and i8 %6, 1
%8 = zext i8 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = lshr i8 %6, 1
%11 = icmp ult i8 %6, 2
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
int sumOneToNum(int n) { return n * (n + 1) / 2; }


x86 assembly (clang, -O0):
<sumOneToNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOneToNum>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sumOneToNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @sumOneToNum(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}