xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() {
  int *i;
  f((char *)0 == i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = bitcast i32* %2 to i8*
%4 = icmp eq i8* null, %3
%5 = zext i1 %4 to i32
%6 = call i32 @f(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
ret i32 0
}
/* Variables and functions */
char *get_aux_buffer();
int /*<<< orphan*/ sprintf(char *, char *, float);
char *convertiratexto(float f) {
  char *buf = get_aux_buffer();
  sprintf(buf, "%f", f);
  return buf;
}


x86 assembly (clang, -O0):
<convertiratexto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_aux_buffer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
lea    0xeb8(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertiratexto>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <get_aux_buffer@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
movss  0xc(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i8* @convertiratexto(float %0) {
%2 = alloca float
%3 = alloca i8*
store float %0, float* %2
%4 = call i8* (...) @get_aux_buffer()
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load float, float* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i8* @convertiratexto(float %0) {
%2 = tail call i8* (...) @get_aux_buffer()
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret i8* %2
}
/* Variables and functions */
int main();
int /*<<< orphan*/ set_irq_handler();
int main_div_zero_test(void) {
  set_irq_handler();
  return main();
}


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

x86 assembly (clang, -O2):
<main_div_zero_test>:
push   %rax
xor    %eax,%eax
call   1030 <set_irq_handler@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <main@plt>

LLVM IR (-O0):
define i32 @main_div_zero_test() {
%1 = call i32 (...) @set_irq_handler()
%2 = call i32 (...) @main()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main_div_zero_test() {
%1 = tail call i32 (...) @set_irq_handler()
%2 = tail call i32 (...) @main()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fild_preg64_dword(int reg64) {
  put8(0xDB);
  put8(reg64);
}


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

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

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

LLVM IR (-O2):
define void @fild_preg64_dword(i32 %0) {
%2 = tail call i32 @put8(i32 219)
%3 = tail call i32 @put8(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_cnst_ast();
int /*<<< orphan*/ init_files();
int /*<<< orphan*/ init_lex();
int /*<<< orphan*/ init_regs();
int /*<<< orphan*/ init_spill_loc();
int /*<<< orphan*/ init_types();
void init() {
  init_files();
  init_lex();
  init_types();
  init_cnst_ast();
  init_regs();
  init_spill_loc();
  return;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <init_files@plt>
mov    $0x0,%al
call   1070 <init_lex@plt>
mov    $0x0,%al
call   1040 <init_types@plt>
mov    $0x0,%al
call   1060 <init_cnst_ast@plt>
mov    $0x0,%al
call   1050 <init_regs@plt>
mov    $0x0,%al
call   1030 <init_spill_loc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1080 <init_files@plt>
xor    %eax,%eax
call   1070 <init_lex@plt>
xor    %eax,%eax
call   1040 <init_types@plt>
xor    %eax,%eax
call   1060 <init_cnst_ast@plt>
xor    %eax,%eax
call   1050 <init_regs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_spill_loc@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @init_files()
%2 = call i32 (...) @init_lex()
%3 = call i32 (...) @init_types()
%4 = call i32 (...) @init_cnst_ast()
%5 = call i32 (...) @init_regs()
%6 = call i32 (...) @init_spill_loc()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @init_files()
%2 = tail call i32 (...) @init_lex()
%3 = tail call i32 (...) @init_types()
%4 = tail call i32 (...) @init_cnst_ast()
%5 = tail call i32 (...) @init_regs()
%6 = tail call i32 (...) @init_spill_loc()
ret void
}
unsigned char *bitmap_get_buffer(void *bitmap) {
  printf(">>> bitmap_get_buffer 0x%8.8X\n", bitmap);
  return bitmap;
}


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

x86 assembly (clang, -O2):
<bitmap_get_buffer>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c">>> bitmap_get_buffer 0x%8.8X\0A\00"
define i8* @bitmap_get_buffer(i8* returned %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ reverse_aux(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
void reverse(char s[]) { reverse_aux(s, 0, strlen(s) - 1); }


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <reverse_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <reverse_aux@plt>

LLVM IR (-O0):
define void @reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call i32 @reverse_aux(i8* %3, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @reverse_aux(i8* %0, i32 0, i64 %3)
ret void
}
void linked_list_sort(struct linked_list **curr) {}


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

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

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

LLVM IR (-O2):
%struct.linked_list = type opaque
define void @linked_list_sort(%struct.linked_list** nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  char *cs1 = (char *)s1;
  char *cs2 = (char *)s2;
  if (strcmp(cs1, cs2) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1153 <equal_string+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115a <equal_string+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int fn4(int a, int b) {
  int tem1 = b & a;
  int tem2 = b ^ a;
  return tem1 ^ tem2;
}


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

x86 assembly (clang, -O2):
<fn4>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
size_t max(size_t a, size_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int pca_cmp_matches(const void *v1, const void *v2) {
  const char **s1 = (const char **)v1;
  const char **s2 = (const char **)v2;
  return strcmp(*s1 + 1, *s2 + 1);
}


x86 assembly (clang, -O0):
<pca_cmp_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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
mov    (%rax),%rdi
add    $0x1,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pca_cmp_matches>:
mov    (%rdi),%rdi
add    $0x1,%rdi
mov    (%rsi),%rsi
add    $0x1,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @pca_cmp_matches(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @strcmp(i8* %13, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @pca_cmp_matches(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ do_update_titleline();
int /*<<< orphan*/ post_update();
void update_titleline(void) {
  curs_set(0);
  do_update_titleline();
  post_update();
}


x86 assembly (clang, -O0):
<update_titleline>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1030 <do_update_titleline@plt>
mov    $0x0,%al
call   1040 <post_update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_titleline>:
push   %rax
xor    %edi,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
call   1030 <do_update_titleline@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <post_update@plt>

LLVM IR (-O0):
define void @update_titleline() {
%1 = call i32 @curs_set(i32 0)
%2 = call i32 (...) @do_update_titleline()
%3 = call i32 (...) @post_update()
ret void
}

LLVM IR (-O2):
define void @update_titleline() {
%1 = tail call i32 @curs_set(i32 0)
%2 = tail call i32 (...) @do_update_titleline()
%3 = tail call i32 (...) @post_update()
ret void
}
void f104(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f104>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1119 <f104+0x19>

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

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

LLVM IR (-O2):
define void @f104() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void wait_any_key() {
  printf("\n(more)\n");
  (void)getc(stdin);
}


x86 assembly (clang, -O0):
<wait_any_key>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_any_key>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <getc@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0A(more)\0A\00"
@stdin = global i32 0
define void @wait_any_key() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = call i32 @getc(i32 %2)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [8 x i8] c"\0A(more)\00"
define void @wait_any_key() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
ret void
}
void top_options_init(void) {}


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

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

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

LLVM IR (-O2):
define void @top_options_init() {
ret void
}
void genbeq() {}


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

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

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

LLVM IR (-O2):
define void @genbeq() {
ret void
}
unsigned long USBEndpointDataAvail(unsigned long ulBase,
                                   unsigned long ulEndpoint) {
  unsigned long ulRegister;
  ;

  ;
  if (ulEndpoint == 0x00000000) {
    ulRegister = 0x00000102;
  } else {
    ulRegister = 0x00000116 + (ulEndpoint - 0x10);
  }
  if (((*((volatile unsigned short *)(ulBase + ulRegister))) & 0x00000001) ==
      0) {
    return (0);
  }
  return ((*((volatile unsigned short *)(ulBase + 0x00000108 + ulEndpoint))));
}


x86 assembly (clang, -O0):
<USBEndpointDataAvail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <USBEndpointDataAvail+0x24>
movq   $0x102,-0x20(%rbp)
jmp    1136 <USBEndpointDataAvail+0x36>
mov    -0x18(%rbp),%rax
sub    $0x10,%rax
add    $0x116,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    115d <USBEndpointDataAvail+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    1175 <USBEndpointDataAvail+0x75>
mov    -0x10(%rbp),%rax
add    $0x108,%rax
add    -0x18(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDataAvail>:
lea    0x106(%rsi),%rax
test   %rsi,%rsi
mov    $0x102,%ecx
cmovne %rax,%rcx
movzwl (%rcx,%rdi,1),%eax
test   $0x1,%al
jne    111e <USBEndpointDataAvail+0x1e>
xor    %eax,%eax
ret
movzwl 0x108(%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i64 @USBEndpointDataAvail(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 258, i64* %6
br label %14
10: ; preds = %2
%11 = load i64, i64* %5
%12 = sub i64 %11, 16
%13 = add i64 278, %12
store i64 %13, i64* %6
br label %14
14: ; preds = %10, %9
%15 = load i64, i64* %4
%16 = load i64, i64* %6
%17 = add i64 %15, %16
%18 = inttoptr i64 %17 to i16*
%19 = load volatile i16, i16* %18
%20 = zext i16 %19 to i32
%21 = and i32 %20, 1
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %14
store i64 0, i64* %3
br label %32
24: ; preds = %14
%25 = load i64, i64* %4
%26 = add i64 %25, 264
%27 = load i64, i64* %5
%28 = add i64 %26, %27
%29 = inttoptr i64 %28 to i16*
%30 = load volatile i16, i16* %29
%31 = zext i16 %30 to i64
store i64 %31, i64* %3
br label %32
32: ; preds = %24, %23
%33 = load i64, i64* %3
ret i64 %33
}

LLVM IR (-O2):
define i64 @USBEndpointDataAvail(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = add i64 %1, 262
%5 = select i1 %3, i64 258, i64 %4
%6 = add i64 %5, %0
%7 = inttoptr i64 %6 to i16*
%8 = load volatile i16, i16* %7
%9 = and i16 %8, 1
%10 = icmp eq i16 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = add i64 %0, 264
%13 = add i64 %12, %1
%14 = inttoptr i64 %13 to i16*
%15 = load volatile i16, i16* %14
%16 = zext i16 %15 to i64
br label %17
17: ; preds = %2, %11
%18 = phi i64 [ %16, %11 ], [ 0, %2 ]
ret i64 %18
}
void swap(char *buf1[], char *buf2[]) {
  char *t = *buf1;
  *buf1 = *buf2;
  *buf2 = t;
}


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

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

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void beep_beep(int n) { printf("beep_beep(%d)\n", n); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"beep_beep(%d)\0A\00"
define void @beep_beep(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main(void) {
  test("a.");
  test("0P");
  test("1hA0l0ah1.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <test@plt>
lea    0xedc(%rip),%rdi
call   1030 <test@plt>
lea    0xed3(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <test@plt>
lea    0xedf(%rip),%rdi
call   1030 <test@plt>
lea    0xed6(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"a.\00"
@.str.1 = [3 x i8] c"0P\00"
@.str.2 = [11 x i8] c"1hA0l0ah1.\00"
define i32 @main() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"a.\00"
@.str.1 = [3 x i8] c"0P\00"
@.str.2 = [11 x i8] c"1hA0l0ah1.\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void gpio_iic_init() {
  (*((volatile uint32_t *)0xE02000C0)) =
      ((*((volatile uint32_t *)0xE02000C0)) & 0xffffff0f) | 0x00000010;
  (*((volatile uint32_t *)0xE02000C4)) |= 1 << 0x01;
  (*((volatile uint32_t *)0xE02000C0)) =
      ((*((volatile uint32_t *)0xE02000C0)) & 0xfffffff0) | 0x00000001;
  (*((volatile uint32_t *)0xE02000C4)) |= 1 << 0x00;
}


x86 assembly (clang, -O0):
<gpio_iic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe02000c0,%eax
mov    (%rax),%ecx
and    $0xffffff0f,%ecx
or     $0x10,%ecx
mov    $0xe02000c0,%eax
mov    %ecx,(%rax)
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
mov    $0xe02000c0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
or     $0x1,%ecx
mov    $0xe02000c0,%eax
mov    %ecx,(%rax)
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_iic_init>:
mov    $0xe02000c0,%eax
mov    $0xffffff0f,%ecx
and    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
orl    $0x2,0x4(%rax)
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
orl    $0x1,0x4(%rax)
ret

LLVM IR (-O0):
define void @gpio_iic_init() {
%1 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%2 = and i32 %1, -241
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 3760193728 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%5 = or i32 %4, 2
store volatile i32 %5, i32* inttoptr (i64 3760193732 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%7 = and i32 %6, -16
%8 = or i32 %7, 1
store volatile i32 %8, i32* inttoptr (i64 3760193728 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%10 = or i32 %9, 1
store volatile i32 %10, i32* inttoptr (i64 3760193732 to i32*)
ret void
}

LLVM IR (-O2):
define void @gpio_iic_init() {
%1 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%2 = and i32 %1, -241
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 3760193728 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%5 = or i32 %4, 2
store volatile i32 %5, i32* inttoptr (i64 3760193732 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%7 = and i32 %6, -16
%8 = or i32 %7, 1
store volatile i32 %8, i32* inttoptr (i64 3760193728 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%10 = or i32 %9, 1
store volatile i32 %10, i32* inttoptr (i64 3760193732 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NRerror(char *);
scalar_t__ malloc(size_t);
unsigned long *lvector(long nl, long nh) {
  unsigned long *v;
  v = (unsigned long *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    NRerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <NRerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <NRerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i64*
store i64* %13, i64** %5
%14 = load i64*, i64** %5
%15 = icmp ne i64* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i64*, i64** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = getelementptr inbounds i64, i64* %22, i64 1
ret i64* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
void cluster_list_unlock_(void) {}


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

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

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

LLVM IR (-O2):
define void @cluster_list_unlock_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crash_handler(unsigned int *, int);
void crash_handler_undef_instr(unsigned int *context, int unused1,
                               int unused2) {
  crash_handler(context, 2);
}


x86 assembly (clang, -O0):
<crash_handler_undef_instr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <crash_handler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_handler_undef_instr>:
mov    $0x2,%esi
jmp    1030 <crash_handler@plt>

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

LLVM IR (-O2):
define void @crash_handler_undef_instr(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @crash_handler(i32* %0, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/);
int strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date(char *strdate, int taillestr) {
  time_t ticks = time(NULL);
  struct tm *strucTime = gmtime(ticks);
  return strftime(strdate, taillestr, "%F %H:%M:%S", strucTime);
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xe97(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%edi
call   1050 <gmtime@plt>
lea    0xeb3(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%F %H:%M:%S\00"
define i32 @date(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = call %struct.tm* @gmtime(i32 %8)
store %struct.tm* %9, %struct.tm** %6
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load %struct.tm*, %struct.tm** %6
%13 = call i32 @strftime(i8* %10, i32 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%F %H:%M:%S\00"
define i32 @date(i8* %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call %struct.tm* @gmtime(i32 %3)
%5 = tail call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i32 %5
}
/* Variables and functions */
double nearbyintl(double);
double nearbyint(double x) { return nearbyintl(x); }


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

x86 assembly (clang, -O2):
<nearbyint>:
jmp    1030 <nearbyintl@plt>

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

LLVM IR (-O2):
define double @nearbyint(double %0) {
%2 = tail call double @nearbyintl(double %0)
ret double %2
}
void JvRunMainName() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
struct ipsecalgent *getipsecalgbynum(int alg_num, int protocol_num,
                                     int *errnop) {
  assert("getipsecalgbynum not implmemented" == NULL);
}


x86 assembly (clang, -O0):
<getipsecalgbynum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ipsecalgent = type { i32 }
@.str = [34 x i8] c"getipsecalgbynum not implmemented\00"
define %struct.ipsecalgent* @getipsecalgbynum(i32 %0, i32 %1, i32* %2) {
%4 = alloca %struct.ipsecalgent*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = call i32 @assert(i32 0)
%9 = load %struct.ipsecalgent*, %struct.ipsecalgent** %4
ret %struct.ipsecalgent* %9
}

LLVM IR (-O2):
%struct.ipsecalgent = type { i32 }
define noalias %struct.ipsecalgent* @getipsecalgbynum(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret %struct.ipsecalgent* undef
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSELECTPALETTE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


x86 assembly (clang, -O0):
<U_WMRSELECTPALETTE_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <U_WMRCORE_N16_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRSELECTPALETTE_swap>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSELECTPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int rand();
int changeiter() {
  int door = rand() % 3 + 1;
  int choice = rand() % 3 + 1;
  return door != choice;
}


x86 assembly (clang, -O0):
<changeiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeiter>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x55555556,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @changeiter() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp ne i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @changeiter() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = icmp ne i32 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int partition(int *, int const, int const);
void quickSort(int *v, const int left, const int right) {
  if (left < right) {
    int i = partition(v, left, right);
    quickSort(v, left, i - 1);
    quickSort(v, i + 1, right);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int drive_at_track0(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @drive_at_track0() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void UART2_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @UART2_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @UART2_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int main() {
  int *localArr = (int *)0x00000000;
  int *remoteArr1 = (int *)0x02000000;
  int *remoteArr2 = (int *)0x04000000;
  int *remoteArr3 = (int *)0x06000000;
  *(localArr) = 0;
  *(remoteArr1) = 1;
  *(remoteArr2) = 2;
  *(remoteArr3) = 3;
  *(localArr) += 1;
  *(remoteArr1 + 1) = *(localArr);
  *(remoteArr2 + 1) = *(remoteArr1 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x2000000,%eax
mov    %rax,-0x18(%rbp)
mov    $0x4000000,%eax
mov    %rax,-0x20(%rbp)
mov    $0x6000000,%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
store i32* inttoptr (i64 33554432 to i32*), i32** %3
store i32* inttoptr (i64 67108864 to i32*), i32** %4
store i32* inttoptr (i64 100663296 to i32*), i32** %5
%6 = load i32*, i32** %2
store i32 0, i32* %6
%7 = load i32*, i32** %3
store i32 1, i32* %7
%8 = load i32*, i32** %4
store i32 2, i32* %8
%9 = load i32*, i32** %5
store i32 3, i32* %9
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32 %19, i32* %21
ret i32 0
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
int gen_posix_mutex_destroy(pthread_mutex_t *mut) {
  if (!mut) {
    return (-EINVAL);
  }
  pthread_mutex_destroy(mut);
  free(mut);
  return (0);
}


x86 assembly (clang, -O0):
<gen_posix_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <gen_posix_mutex_destroy+0x2a>
xor    %eax,%eax
mov    0x2ea0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <gen_posix_mutex_destroy+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_posix_mutex_destroy>:
push   %rbx
test   %rdi,%rdi
je     113a <gen_posix_mutex_destroy+0x1a>
mov    %rdi,%rbx
call   1040 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e9f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @gen_posix_mutex_destroy(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %14
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @pthread_mutex_destroy(i32* %10)
%12 = load i32*, i32** %3
%13 = call i32 @free(i32* %12)
store i32 0, i32* %2
br label %14
14: ; preds = %9, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @gen_posix_mutex_destroy(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
br label %9
6: ; preds = %1
%7 = tail call i32 @pthread_mutex_destroy(i32* %0)
%8 = tail call i32 @free(i32* %0)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ 0, %6 ], [ %5, %3 ]
ret i32 %10
}
void DCSMReadZone2EXEONLY(void) {
  volatile unsigned long temp;
  temp = (*((volatile unsigned long *)(0x00200000 + 0x002FFFDC)));
}


x86 assembly (clang, -O0):
<DCSMReadZone2EXEONLY>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4fffdc,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMReadZone2EXEONLY>:
mov    0x4fffdc,%rax
mov    %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @DCSMReadZone2EXEONLY() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 5242844 to i64*)
store volatile i64 %2, i64* %1
ret void
}

LLVM IR (-O2):
define void @DCSMReadZone2EXEONLY() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load volatile i64, i64* inttoptr (i64 5242844 to i64*)
store volatile i64 %3, i64* %1
ret void
}
int f(int *restrict a, int *restrict b) {
  *a = 3;
  return 0;
}


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

x86 assembly (clang, -O2):
<f>:
movl   $0x3,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32* noalias nocapture writeonly %0, i32* noalias nocapture readnone %1) {
store i32 3, i32* %0
ret i32 0
}
void omap_cam_reserve_sdram_memblock(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_cam_reserve_sdram_memblock() {
ret void
}
const char *build_flags() { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @build_flags() {
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* @build_flags() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}