xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __breakpoint__inv(size_t *);
size_t zero_inc(size_t x) {
  if (x == 0) {
    __breakpoint__inv(&x);
    ++x;
  }
  return x;
}


x86 assembly (clang, -O0):
<zero_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <zero_inc+0x2c>
lea    -0x8(%rbp),%rdi
call   1030 <__breakpoint__inv@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_inc>:
push   %rax
mov    %rdi,%rax
mov    %rdi,(%rsp)
test   %rdi,%rdi
je     111f <zero_inc+0xf>
pop    %rcx
ret
mov    %rsp,%rdi
call   1030 <__breakpoint__inv@plt>
mov    (%rsp),%rax
add    $0x1,%rax
mov    %rax,(%rsp)
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @zero_inc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = call i32 @__breakpoint__inv(i64* %2)
%6 = load i64, i64* %2
%7 = add i64 %6, 1
store i64 %7, i64* %2
br label %8
8: ; preds = %4, %1
%9 = phi i64 [ %7, %4 ], [ %0, %1 ]
ret i64 %9
}
void switchint(int *x, int *y) {
  int tmp = *x;
  *x = *y;
  *y = tmp;
}


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

x86 assembly (clang, -O2):
<switchint>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @switchint(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
const char *date_to_str(time_t i) {
  static char str[sizeof("YYYY-mm-dd HH:MM:SS")];
  strftime(str, sizeof(str), "%Y-%m-%d %H:%M:%S", localtime(&i));
  return str;
}


x86 assembly (clang, -O0):
<date_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%ecx
lea    0x2f03(%rip),%rdi
mov    $0x14,%esi
lea    0xeb7(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2eeb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_to_str>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@date_to_str.str = internal global [20 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @date_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @date_to_str.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @date_to_str.str, i64 0, i64 0)
}

LLVM IR (-O2):
@date_to_str.str = internal global [20 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @date_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @date_to_str.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @date_to_str.str, i64 0, i64 0)
}
/* Variables and functions */
bool __ptr_oob(const void *ptr, const void *start, const size_t size) {
  const void *end = (const void *)((const unsigned long)start + size);
  return ptr > end || ptr < start;
}


x86 assembly (clang, -O0):
<__ptr_oob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
ja     113d <__ptr_oob+0x3d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptr_oob>:
add    %rsi,%rdx
cmp    %rdi,%rdx
setb   %al
cmp    %rsi,%rdi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__ptr_oob(i8* readnone %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = add i64 %4, %2
%6 = inttoptr i64 %5 to i8*
%7 = icmp ult i8* %6, %0
%8 = icmp ult i8* %0, %1
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ foo(int);
int main() {
  int a = 10;
  int b = 0;
  if (foo(a))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
cmp    $0x0,%rax
je     114b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <main+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 10)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *strcasestr(char *, char *);
char *find_ahref(char *buf) { return (strcasestr(buf, "<A HREF=")); }


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

x86 assembly (clang, -O2):
<find_ahref>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcasestr@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"<A HREF=\00"
define i8* @find_ahref(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strcasestr(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"<A HREF=\00"
define i8* @find_ahref(i8* %0) {
%2 = tail call i8* @strcasestr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int parse(int /*<<< orphan*/);
int /*<<< orphan*/ slicer(char *, int);
int existential_formula(char *g) {
  if (g[1] == 'x' || g[1] == 'y' || g[1] == 'z') {
    return parse(slicer(g, 2));
  }
}


x86 assembly (clang, -O0):
<existential_formula>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
je     115f <existential_formula+0x3f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x79,%eax
je     115f <existential_formula+0x3f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x7a,%eax
jne    1177 <existential_formula+0x57>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <slicer@plt>
mov    %eax,%edi
call   1030 <parse@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<existential_formula>:
push   %rax
mov    0x1(%rdi),%al
add    $0x88,%al
cmp    $0x2,%al
ja     113c <existential_formula+0x1c>
mov    $0x2,%esi
call   1040 <slicer@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <parse@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @existential_formula(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = add i8 %3, -120
%5 = icmp ult i8 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @slicer(i8* %0, i32 2)
%8 = tail call i32 @parse(i32 %7)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ undef, %1 ]
ret i32 %10
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ list_add(struct list_head *, struct list_head *);
void list_move_tail(struct list_head *list, struct list_head *head) {
  __list_del_entry(list);
  list_add(list, head);
}


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

x86 assembly (clang, -O2):
<list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @list_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void sig_ill_handler(int sig) { abort(); }


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

x86 assembly (clang, -O2):
<sig_ill_handler>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @sig_ill_handler(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ gammln(double const);
double gamm(const double xx) { return exp(gammln(xx)); }


x86 assembly (clang, -O0):
<gamm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <gammln@plt>
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamm>:
push   %rax
call   1040 <gammln@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @gamm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @gammln(double %3)
%5 = call double @exp(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @gamm(double %0) {
%2 = tail call i32 @gammln(double %0)
%3 = tail call double @exp(i32 %2)
ret double %3
}
void call_initialize_minimal(void) {
  extern void __pthread_initialize_minimal(void);
  __pthread_initialize_minimal();
}


x86 assembly (clang, -O0):
<call_initialize_minimal>:
push   %rbp
mov    %rsp,%rbp
call   1030 <__pthread_initialize_minimal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_initialize_minimal>:
jmp    1030 <__pthread_initialize_minimal@plt>

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

LLVM IR (-O2):
define void @call_initialize_minimal() {
tail call void @__pthread_initialize_minimal()
ret void
}
void set_gl_compat_attributes() {}


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

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

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

LLVM IR (-O2):
define void @set_gl_compat_attributes() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ mem_error();
void *mem_alloc(size_t s) {
  void *x = malloc(s);
  if (!x)
    mem_error();
  return x;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <mem_alloc+0x2b>
mov    $0x0,%al
call   1040 <mem_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <mem_alloc+0x15>
xor    %eax,%eax
call   1040 <mem_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @mem_error()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @mem_error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int byt_ulpmc_suspend_sdp_charging(void) { return 0; }


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

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

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

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

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int h2d(int val) {
  char conv[16];
  int res = 0;
  snprintf(conv, sizeof(conv), "%X", val);
  res = atoi(conv);
  return res;
}


x86 assembly (clang, -O0):
<h2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x10,%esi
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2d>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%X\00"
define i32 @h2d(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
define i32 @h2d(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @atoi(i8* %3)
ret i32 %5
}
/* Type definitions */
struct fileInfo {
  int dummy;
};

/* Variables and functions */
struct fileInfo *listDirXExt(char *, char *, int, int /*<<< orphan*/);
struct fileInfo *listDirX(char *dir, char *pattern, int fullPath) {
  return listDirXExt(dir, pattern, fullPath, 0);
}


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

x86 assembly (clang, -O2):
<listDirX>:
xor    %ecx,%ecx
jmp    1030 <listDirXExt@plt>

LLVM IR (-O0):
%struct.fileInfo = type { i32 }
define %struct.fileInfo* @listDirX(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call %struct.fileInfo* @listDirXExt(i8* %7, i8* %8, i32 %9, i32 0)
ret %struct.fileInfo* %10
}

LLVM IR (-O2):
%struct.fileInfo = type { i32 }
define %struct.fileInfo* @listDirX(i8* %0, i8* %1, i32 %2) {
%4 = tail call %struct.fileInfo* @listDirXExt(i8* %0, i8* %1, i32 %2, i32 0)
ret %struct.fileInfo* %4
}
double mmslipflight_event_scan(double t, double *Y, int n, double *pars,
                               double *res) {
  *res = -(Y[1] - pars[0]);
  return 1;
}


x86 assembly (clang, -O0):
<mmslipflight_event_scan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeb0(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmslipflight_event_scan>:
movsd  0x8(%rdi),%xmm0
subsd  (%rdx),%xmm0
xorpd  0xeef(%rip),%xmm0
movlpd %xmm0,(%rcx)
movsd  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mmslipflight_event_scan(double %0, double* %1, i32 %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %9
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = fneg double %17
%19 = load double*, double** %10
store double %18, double* %19
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @mmslipflight_event_scan(double %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = fneg double %9
store double %10, double* %4
ret double 1.000000e+00
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ pci16_w_addr(int, int, int);
void pci16_select_reg(uint16_t bus_dev_fn, uint16_t ofs) {
  pci16_w_addr(bus_dev_fn, ofs & ~3, 0xCF8);
}


x86 assembly (clang, -O0):
<pci16_select_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xfffffffc,%esi
mov    $0xcf8,%edx
call   1030 <pci16_w_addr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci16_select_reg>:
and    $0xfffffffc,%esi
mov    $0xcf8,%edx
jmp    1030 <pci16_w_addr@plt>

LLVM IR (-O0):
define void @pci16_select_reg(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 = and i32 %6, -4
%8 = call i32 @pci16_w_addr(i32 %5, i32 %7, i32 3320)
ret void
}

LLVM IR (-O2):
define void @pci16_select_reg(i32 %0, i32 %1) {
%3 = and i32 %1, -4
%4 = tail call i32 @pci16_w_addr(i32 %0, i32 %3, i32 3320)
ret void
}
long sub4(long i, long j, long k) { return k ? i : j; }


x86 assembly (clang, -O0):
<sub4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1128 <sub4+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <sub4+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub4>:
mov    %rdi,%rax
test   %rdx,%rdx
cmove  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @sub4(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, i64 %1, i64 %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void iw_print_value_name(unsigned int value, const char *names[],
                         const unsigned int num_names) {
  if (value >= num_names)
    printf(" unknown (%d)", value);
  else
    printf(" %s", names[value]);
}


x86 assembly (clang, -O0):
<iw_print_value_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jb     1144 <iw_print_value_name+0x34>
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115d <iw_print_value_name+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_print_value_name>:
mov    %edi,%eax
cmp    %edx,%edi
jae    112a <iw_print_value_name+0x1a>
mov    %eax,%eax
mov    (%rsi,%rax,8),%rsi
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c" unknown (%d)\00"
@.str.1 = [4 x i8] c" %s\00"
define void @iw_print_value_name(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp uge i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %20
13: ; preds = %3
%14 = load i8**, i8*** %5
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c" unknown (%d)\00"
@.str.1 = [4 x i8] c" %s\00"
define void @iw_print_value_name(i32 %0, i8** nocapture %1, i32 %2) {
%4 = icmp ult i32 %0, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %12
7: ; preds = %3
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t kernel___Int_cp___impl(long self) { return (uint32_t)self; }


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

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

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

LLVM IR (-O2):
define i32 @kernel___Int_cp___impl(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buf_free(struct buffer *);
int /*<<< orphan*/ buf_init(struct buffer *);
void buf_clear(struct buffer *buf) {
  buf_free(buf);
  buf_init(buf);
}


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

x86 assembly (clang, -O2):
<buf_clear>:
push   %rbx
mov    %rdi,%rbx
call   1040 <buf_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <buf_init@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buf_clear(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call i32 @buf_free(%struct.buffer* %3)
%5 = load %struct.buffer*, %struct.buffer** %2
%6 = call i32 @buf_init(%struct.buffer* %5)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buf_clear(%struct.buffer* %0) {
%2 = tail call i32 @buf_free(%struct.buffer* %0)
%3 = tail call i32 @buf_init(%struct.buffer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void fldcw_m16(unsigned short *m16) {
  put8(0xD9);
  put8(0x2D);
  put32((unsigned int)(m16));
}


x86 assembly (clang, -O0):
<fldcw_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldcw_m16>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @fldcw_m16(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call i32 @put8(i32 217)
%4 = call i32 @put8(i32 45)
%5 = load i16*, i16** %2
%6 = ptrtoint i16* %5 to i32
%7 = call i32 @put32(i32 %6)
ret void
}

LLVM IR (-O2):
define void @fldcw_m16(i16* %0) {
%2 = tail call i32 @put8(i32 217)
%3 = tail call i32 @put8(i32 45)
%4 = ptrtoint i16* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @put32(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_aton(char *, struct in_addr *);
uint32_t ip2int(char *ip) {
  struct in_addr a;
  if (!inet_aton(ip, &a)) {
    return ((uint32_t)0);
  }
  return a.s_addr;
}


x86 assembly (clang, -O0):
<ip2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x0,%eax
jne    113e <ip2int+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <ip2int+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip2int>:
push   %rax
mov    %rsp,%rsi
call   1030 <inet_aton@plt>
test   %eax,%eax
je     1120 <ip2int+0x10>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @ip2int(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @inet_aton(i8* %5, %struct.in_addr* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @ip2int(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ uart_kbhit();
char uart_getch(void) {
  while (!uart_kbhit())
    ;
  return (*(volatile unsigned int *)(0x20000000));
}


x86 assembly (clang, -O0):
<uart_getch>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_getch+0x9>
mov    $0x0,%al
call   1030 <uart_kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <uart_getch+0x25>
jmp    113a <uart_getch+0x2a>
jmp    1119 <uart_getch+0x9>
mov    $0x20000000,%eax
mov    (%rax),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <uart_kbhit@plt>
test   %eax,%eax
je     1120 <uart_getch+0x10>
mov    0x20000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @uart_getch() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @uart_kbhit()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 536870912 to i32*)
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @uart_getch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @uart_kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 536870912 to i32*)
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
void stub_mutex_disp(pthread_mutex_t *mutex) { pthread_mutex_destroy(mutex); }


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

x86 assembly (clang, -O2):
<stub_mutex_disp>:
jmp    1030 <pthread_mutex_destroy@plt>

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

LLVM IR (-O2):
define void @stub_mutex_disp(i32* %0) {
%2 = tail call i32 @pthread_mutex_destroy(i32* %0)
ret void
}
/* Variables and functions */
void *a13(int);
void *a12(int x) { return (((x >> 12) & 1) ? a13(x) : a13(x)); }


x86 assembly (clang, -O0):
<a12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a12+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a13@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a12+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a13@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a12>:
jmp    1030 <a13@plt>

LLVM IR (-O0):
define i8* @a12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 12
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a13(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a13(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a12(i32 %0) {
%2 = tail call i8* @a13(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int int16_t;

/* Variables and functions */
int le_to_u16(int /*<<< orphan*/ const *);
int16_t le_to_i16(const uint8_t *buf) {
  uint16_t v = le_to_u16(buf);
  return v < 0x8000 ? (int16_t)v : -((int16_t)(0xffff - v)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_to_u16@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jge    1140 <le_to_i16+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <le_to_i16+0x42>
mov    $0xffff,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i16>:
push   %rax
call   1030 <le_to_u16@plt>
lea    -0x10000(%rax),%ecx
cmp    $0x8000,%eax
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @le_to_i16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u16(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 32768
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 65535, %11
%13 = sub nsw i32 0, %12
%14 = sub nsw i32 %13, 1
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @le_to_i16(i32* %0) {
%2 = tail call i32 @le_to_u16(i32* %0)
%3 = icmp slt i32 %2, 32768
%4 = add i32 %2, -65536
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
readsym() {
  printf("readsym() should not be called in AMBER\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"readsym() should not be called in AMBER\0A\00"
define i32 @readsym() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [40 x i8] c"readsym() should not be called in AMBER\00"
define i32 @readsym() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main() {
  int j;
  for (j = 0;; j++)
    putchar(j & 0xff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %bl,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = call i32 @putchar(i32 %5)
br label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = and i32 %2, 255
%4 = tail call i32 @putchar(i32 %3)
%5 = add nuw nsw i32 %2, 1
br label %1
}
double dabs(double x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <dabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <dabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int compress_bits64(int);
void nest2xyf64(int64_t nside, int64_t pix, int *ix, int *iy, int *face_num) {
  int64_t npface_ = nside * nside;
  *face_num = pix / npface_;
  pix &= (npface_ - 1);
  *ix = compress_bits64(pix);
  *iy = compress_bits64(pix >> 1);
}


x86 assembly (clang, -O0):
<nest2xyf64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x24(%rbp)
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <compress_bits64@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <compress_bits64@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nest2xyf64>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
imul   %edi,%ebp
mov    %esi,%eax
cltd
idiv   %ebp
mov    %eax,(%r8)
add    $0xffffffff,%ebp
and    %esi,%ebp
mov    %ebp,%edi
call   1030 <compress_bits64@plt>
mov    %eax,(%rbx)
sar    %ebp
mov    %ebp,%edi
call   1030 <compress_bits64@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @nest2xyf64(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = load i32, i32* %6
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %11
%15 = load i32, i32* %7
%16 = load i32, i32* %11
%17 = sdiv i32 %15, %16
%18 = load i32*, i32** %10
store i32 %17, i32* %18
%19 = load i32, i32* %11
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %7
%22 = and i32 %21, %20
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = call i32 @compress_bits64(i32 %23)
%25 = load i32*, i32** %8
store i32 %24, i32* %25
%26 = load i32, i32* %7
%27 = ashr i32 %26, 1
%28 = call i32 @compress_bits64(i32 %27)
%29 = load i32*, i32** %9
store i32 %28, i32* %29
ret void
}

LLVM IR (-O2):
define void @nest2xyf64(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = mul nsw i32 %0, %0
%7 = sdiv i32 %1, %6
store i32 %7, i32* %4
%8 = add nsw i32 %6, -1
%9 = and i32 %8, %1
%10 = tail call i32 @compress_bits64(i32 %9)
store i32 %10, i32* %2
%11 = ashr i32 %9, 1
%12 = tail call i32 @compress_bits64(i32 %11)
store i32 %12, i32* %3
ret void
}
/* Type definitions */
union bpf_attr {
  int bpf_fd;
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_PIN;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_pin(int fd, const char *pathname) {
  union bpf_attr attr = {
      .pathname = ptr_to_u64((void *)pathname),
      .bpf_fd = fd,
  };
  return syscall(__NR_bpf, BPF_OBJ_PIN, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_pin>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast %union.bpf_attr* %5 to i32*
%7 = load i32, i32* %3
store i32 %7, i32* %6
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_OBJ_PIN
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %5, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* nocapture readnone %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @__NR_bpf
%7 = load i32, i32* @BPF_OBJ_PIN
%8 = call i32 @syscall(i32 %6, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int num = 1;
  if (*(char *)&num == 1)
    printf("Little-Endian\n");
  else
    printf("Big-Endian\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1144 <main+0x34>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x40>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Little-Endian\0A\00"
@.str.1 = [12 x i8] c"Big-Endian\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [14 x i8] c"Little-Endian\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double atof(char const *);
double stringToDouble(char *string) { return atof((const char *)string); }


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

x86 assembly (clang, -O2):
<stringToDouble>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @stringToDouble(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
scalar_t__ scanf(char *, unsigned char *);
int main(void) {
  unsigned char nextChar;
  while (scanf("%c", &nextChar)) {
    printf("%c", nextChar);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
lea    0xeb0(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     116d <main+0x4d>
lea    0xebf(%rip),%rbx
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
movzbl 0x7(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = load i8, i8* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}