xunge/DecIR huggingface dataset:
int security_msg_queue_msgctl(struct msg_queue *msq, int msgid, int cmd) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_msgctl(%struct.msg_queue* %0, i32 %1, i32 %2) {
%4 = alloca %struct.msg_queue*
%5 = alloca i32
%6 = alloca i32
store %struct.msg_queue* %0, %struct.msg_queue** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_msgctl(%struct.msg_queue* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int ft_any(char **tab, int (*f)(char *)) {
  int x;
  x = 0;
  while (tab[x] != '\0') {
    if (f(tab[x]) == 1)
      return (1);
    x++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115f <ft_any+0x5f>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x1,%eax
jne    1151 <ft_any+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1166 <ft_any+0x66>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <ft_any+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
mov    (%rdi),%rdi
xor    %r14d,%r14d
test   %rdi,%rdi
je     113c <ft_any+0x3c>
mov    %rsi,%rbx
add    $0x8,%rbp
nopl   0x0(%rax)
call   *%rbx
cmp    $0x1,%eax
je     1136 <ft_any+0x36>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1120 <ft_any+0x20>
jmp    113c <ft_any+0x3c>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8*, i8** %0, i64 %14
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %14, %5 ], [ 0, %2 ]
%11 = phi i8* [ %7, %5 ], [ %3, %2 ]
%12 = tail call i32 %1(i8* %11)
%13 = icmp eq i32 %12, 1
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int get_level();
int /*<<< orphan*/ println(char *);
void show_mousehelp(void) {
  if (get_level() >= 3)
    println("Press 'q' to quit, 'r' to report modes, ' ' to clear.");
  else
    println("Press 'q' to quit, ' ' to clear.");
}


x86 assembly (clang, -O0):
<show_mousehelp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_level@plt>
cmp    $0x3,%eax
jl     1145 <show_mousehelp+0x25>
lea    0xec5(%rip),%rdi
call   1030 <println@plt>
jmp    1151 <show_mousehelp+0x31>
lea    0xeea(%rip),%rdi
call   1030 <println@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_mousehelp>:
push   %rax
xor    %eax,%eax
call   1040 <get_level@plt>
cmp    $0x3,%eax
lea    0xece(%rip),%rax
lea    0xefd(%rip),%rdi
cmovge %rax,%rdi
pop    %rax
jmp    1030 <println@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Press 'q' to quit, 'r' to report modes, ' ' to clear.\00"
@.str.1 = [33 x i8] c"Press 'q' to quit, ' ' to clear.\00"
define void @show_mousehelp() {
%1 = call i32 (...) @get_level()
%2 = icmp sge i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @println(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @println(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Press 'q' to quit, 'r' to report modes, ' ' to clear.\00"
@.str.1 = [33 x i8] c"Press 'q' to quit, ' ' to clear.\00"
define void @show_mousehelp() {
%1 = tail call i32 (...) @get_level()
%2 = icmp sgt i32 %1, 2
%3 = select i1 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @println(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_get_send_fd() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_get_send_fd"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_iochannel_get_send_fd\00"
define i32 @pa_iochannel_get_send_fd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
int main() {
  char *path = "/modules/pass1";
  unlink(path);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"/modules/pass1\00"
define i32 @main() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ldfloor(long double);
int ldceil(long double n) { return ldfloor(n) + 1; }


x86 assembly (clang, -O0):
<ldceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ldfloor@plt>
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldceil>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <ldfloor@plt>
add    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @ldceil(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @ldfloor(x86_fp80 %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @ldceil(x86_fp80 %0) {
%2 = tail call i32 @ldfloor(x86_fp80 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
void _start(void) {
  (*(char *)(0x08000100 + (3 - 0) * 2) = ('n'));
  (*(char *)(0x08000100 + (3 - 1) * 2) = ('u'));
  (*(char *)(0x08000100 + (3 - 2) * 2) = ('o'));
  (*(char *)(0x08000100 + (3 - 3) * 2) = ('s'));
  for (;;)
    ;
  return;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000106,%eax
movb   $0x6e,(%rax)
mov    $0x8000104,%eax
movb   $0x75,(%rax)
mov    $0x8000102,%eax
movb   $0x6f,(%rax)
mov    $0x8000100,%eax
movb   $0x73,(%rax)
jmp    1124 <_start+0x24>

x86 assembly (clang, -O2):
<_start>:
movb   $0x6e,0x8000106
6e
movb   $0x75,0x8000104
75
movb   $0x6f,0x8000102
6f
movb   $0x73,0x8000100
73
jmp    1120 <_start+0x20>

LLVM IR (-O0):
define void @_start() {
store i8 110, i8* inttoptr (i64 134217990 to i8*)
store i8 117, i8* inttoptr (i64 134217988 to i8*)
store i8 111, i8* inttoptr (i64 134217986 to i8*)
store i8 115, i8* inttoptr (i64 134217984 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @_start() {
store i8 110, i8* inttoptr (i64 134217990 to i8*)
store i8 117, i8* inttoptr (i64 134217988 to i8*)
store i8 111, i8* inttoptr (i64 134217986 to i8*)
store i8 115, i8* inttoptr (i64 134217984 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double epoch_double(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + (t.tv_usec * 1.0) / 1000000.0;
}


x86 assembly (clang, -O0):
<epoch_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xec1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoch_double>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @epoch_double() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fmul double %6, 1.000000e+00
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @epoch_double() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int fsemu_option_boolean(char const *);
int fsemu_config_boolean(const char *name) {
  return fsemu_option_boolean(name);
}


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

x86 assembly (clang, -O2):
<fsemu_config_boolean>:
jmp    1030 <fsemu_option_boolean@plt>

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

LLVM IR (-O2):
define i32 @fsemu_config_boolean(i8* %0) {
%2 = tail call i32 @fsemu_option_boolean(i8* %0)
ret i32 %2
}
double Neumann_phi(double x, double y) { return 4 * (x * x - y * y); }


x86 assembly (clang, -O0):
<Neumann_phi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Neumann_phi>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mulsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Neumann_phi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %5, double %6, double %10)
%12 = fmul double 4.000000e+00, %11
ret double %12
}

LLVM IR (-O2):
define double @Neumann_phi(double %0, double %1) {
%3 = fneg double %1
%4 = fmul double %3, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = fmul double %5, 4.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("programowanie jest super!\n");
  printf("a programowanie w C nawet bardziej\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"programowanie jest super!\0A\00"
@.str.1 = [36 x i8] c"a programowanie w C nawet bardziej\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"programowanie jest super!\00"
@str.2 = [35 x i8] c"a programowanie w C nawet bardziej\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void copy(char *dest, char *src) {
  while ((*dest++ = *src++) != '\n')
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0xa,%eax
je     113f <copy+0x3f>
jmp    110c <copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
cmp    $0xa,%cl
jne    1110 <copy+0x10>
ret

LLVM IR (-O0):
define void @copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %13, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = sext i8 %8 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 10
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
double _pow(int, double);
double ceil(int);
int log(int);
double frexp(double f, int *p) {
  double b = ceil(log(f) / log(2));
  double ret = 0;
  ret = f / _pow(2, b);
  *p = (int)b;
  return ret;
}


x86 assembly (clang, -O0):
<frexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1050 <log@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <_pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexp>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x10(%rsp)
cvttsd2si %xmm0,%edi
call   1050 <log@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1050 <log@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <_pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si 0x8(%rsp),%eax
mov    %eax,(%rbx)
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @frexp(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store i32* %1, i32** %4
%7 = load double, double* %3
%8 = fptosi double %7 to i32
%9 = call i32 @log(i32 %8)
%10 = call i32 @log(i32 2)
%11 = sdiv i32 %9, %10
%12 = call double @ceil(i32 %11)
store double %12, double* %5
store double 0.000000e+00, double* %6
%13 = load double, double* %3
%14 = load double, double* %5
%15 = call double @_pow(i32 2, double %14)
%16 = fdiv double %13, %15
store double %16, double* %6
%17 = load double, double* %5
%18 = fptosi double %17 to i32
%19 = load i32*, i32** %4
store i32 %18, i32* %19
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
define double @frexp(double %0, i32* nocapture writeonly %1) {
%3 = fptosi double %0 to i32
%4 = tail call i32 @log(i32 %3)
%5 = tail call i32 @log(i32 2)
%6 = sdiv i32 %4, %5
%7 = tail call double @ceil(i32 %6)
%8 = tail call double @_pow(i32 2, double %7)
%9 = fdiv double %0, %8
%10 = fptosi double %7 to i32
store i32 %10, i32* %1
ret double %9
}
void test() {
  printf("\n%s: \n", __func__);
  printf("library test routine invoked\n");
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.test = [5 x i8] c"test\00"
@.str.1 = [30 x i8] c"library test routine invoked\0A\00"
define void @test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.test = [5 x i8] c"test\00"
@str = [29 x i8] c"library test routine invoked\00"
define void @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
void unpack(unsigned int a, unsigned char *b) {
  b[0] = ((unsigned char)(a));
  b[1] = ((unsigned char)(a >> 8));
  b[2] = ((unsigned char)(a >> 16));
  b[3] = ((unsigned char)(a >> 24));
}


x86 assembly (clang, -O0):
<unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @unpack(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %3
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %3
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @unpack(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
int t(int a) {
  int r;
  if (a & 1)
    r = t(a - 1);
  else if (a)
    r = t(a - 2);
  else
    return 0;
  if (r)
    r = r;
  return r;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <t+0x2d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <t@plt>
mov    %eax,-0xc(%rbp)
jmp    116b <t+0x5b>
cmpl   $0x0,-0x8(%rbp)
je     115a <t+0x4a>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <t@plt>
mov    %eax,-0xc(%rbp)
jmp    1166 <t+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1181 <t+0x71>
jmp    116b <t+0x5b>
cmpl   $0x0,-0xc(%rbp)
je     117b <t+0x6b>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
jmp    1112 <t+0x12>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %eax,%edi
mov    $0xffffffff,%eax
test   $0x1,%dil
jne    1110 <t+0x10>
mov    $0xfffffffe,%eax
test   %edi,%edi
jne    1110 <t+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %8, %6 ]
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2, %9
%7 = phi i32 [ -2, %9 ], [ -1, %2 ]
%8 = add nsw i32 %3, %7
br label %2
9: ; preds = %2
%10 = icmp eq i32 %3, 0
br i1 %10, label %11, label %6
11: ; preds = %9
ret i32 0
}
int main() {
  int i;
  int j;
  i = 0;
  j = 5;
  while (i < 100) {
    i = i + 1;
  }
  while (j < 21) {
    j = j + 3;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1131 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
jmp    1136 <main+0x36>
cmpl   $0x15,-0xc(%rbp)
jge    114e <main+0x4e>
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x36>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 5, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %4
10: ; preds = %4
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 21
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 3
store i32 %16, i32* %3
br label %11
17: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_loaddouble(char *, double);
int plainstring_greaterequal(struct plainstring const *, char *);
int plainstring_greaterequal_double(const struct plainstring *this_string,
                                    double d) {
  char buffer[0xFF];
  cstr_loaddouble(buffer, d);
  return plainstring_greaterequal(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_greaterequal_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1040 <cstr_loaddouble@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <plainstring_greaterequal@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_greaterequal_double>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <cstr_loaddouble@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <plainstring_greaterequal@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_greaterequal_double(%struct.plainstring* %0, double %1) {
%3 = alloca %struct.plainstring*
%4 = alloca double
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store double %1, double* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @cstr_loaddouble(i8* %6, double %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_greaterequal(%struct.plainstring* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_greaterequal_double(%struct.plainstring* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @cstr_loaddouble(i8* %4, double %1)
%6 = call i32 @plainstring_greaterequal(%struct.plainstring* %0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ InitSD();
int /*<<< orphan*/ Nand_Init();
int SD_Init();
int sdmmc_sdcard_init() {
  InitSD();
  Nand_Init();
  return SD_Init();
}


x86 assembly (clang, -O0):
<sdmmc_sdcard_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitSD@plt>
mov    $0x0,%al
call   1040 <Nand_Init@plt>
mov    $0x0,%al
call   1050 <SD_Init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_sdcard_init>:
push   %rax
xor    %eax,%eax
call   1030 <InitSD@plt>
xor    %eax,%eax
call   1040 <Nand_Init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <SD_Init@plt>

LLVM IR (-O0):
define i32 @sdmmc_sdcard_init() {
%1 = call i32 (...) @InitSD()
%2 = call i32 (...) @Nand_Init()
%3 = call i32 (...) @SD_Init()
ret i32 %3
}

LLVM IR (-O2):
define i32 @sdmmc_sdcard_init() {
%1 = tail call i32 (...) @InitSD()
%2 = tail call i32 (...) @Nand_Init()
%3 = tail call i32 (...) @SD_Init()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
size_t getParamSize(char *arg) { return (size_t)strtol(arg, NULL, 10); }


x86 assembly (clang, -O0):
<getParamSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getParamSize>:
push   %rax
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @getParamSize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtol(i8* %3, i32* null, i32 10)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @getParamSize(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *);
void input_Ps_N(int16_t *p) { scanf("%hd", p); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
define void @input_Ps_N(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
char *getMerged(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *str1 = "abc";
  char *str2 = "defz";
  char *res = getMerged(str1, str2);
  printf("%s", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <getMerged@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <getMerged@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [5 x i8] c"defz\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* @getMerged(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __deregister_frame_info(const void *fi) {
  printf("__deregister_frame_info()\n");
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"__deregister_frame_info()\00"
define void @__deregister_frame_info(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void RTAvllU32GetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvllU32GetBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("HELLO NEKTECH WORLD");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"HELLO NEKTECH WORLD\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"HELLO NEKTECH WORLD\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int operation_lo(int arg) { return arg & 0xff; }


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

x86 assembly (clang, -O2):
<operation_lo>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @operation_lo(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int transport_getdata(unsigned char *buf, int count) {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<transport_getdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transport_getdata>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @transport_getdata(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 -1
}
void SDK_mainloop(void) {}


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

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

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

LLVM IR (-O2):
define void @SDK_mainloop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _k_heap_disp();
int /*<<< orphan*/ _k_memproof_disp();
void _k_mem_disp(void) {
  _k_memproof_disp();
  _k_heap_disp();
}


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

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

LLVM IR (-O0):
define void @_k_mem_disp() {
%1 = call i32 (...) @_k_memproof_disp()
%2 = call i32 (...) @_k_heap_disp()
ret void
}

LLVM IR (-O2):
define void @_k_mem_disp() {
%1 = tail call i32 (...) @_k_memproof_disp()
%2 = tail call i32 (...) @_k_heap_disp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_main(void) { printf("In c_main().\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"In c_main().\00"
define void @c_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_54int8_mem(signed char *val) {
  return ((*val) & (0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x54,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_54int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 84
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *getenv(char *);
void cgiGetenv(char **s, char *var) {
  *s = getenv(var);
  if (!(*s)) {
    *s = "";
  }
}


x86 assembly (clang, -O0):
<cgiGetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114f <cgiGetenv+0x3f>
mov    -0x8(%rbp),%rax
lea    0xeb4(%rip),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiGetenv>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeda(%rip),%rcx
cmovne %rax,%rcx
mov    %rcx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @cgiGetenv(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @getenv(i8* %5)
%7 = load i8**, i8*** %3
store i8* %6, i8** %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = load i8**, i8*** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %12
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @cgiGetenv(i8** nocapture writeonly %0, i8* nocapture %1) {
%3 = tail call i8* @getenv(i8* %1)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
store i8* %5, i8** %0
ret void
}
int myctoi(array)
char array[];
{
  int val = 0;
  (void)sscanf(array, "%d", &val);
  return val;
}


x86 assembly (clang, -O0):
<myctoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myctoi>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @myctoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int __nacl_tls_aligment() { return 32; }


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

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

LLVM IR (-O0):
define i32 @__nacl_tls_aligment() {
ret i32 32
}

LLVM IR (-O2):
define i32 @__nacl_tls_aligment() {
ret i32 32
}
void foo512() {}


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

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

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

LLVM IR (-O2):
define void @foo512() {
ret void
}
double bot_matrix_determinant_2x2_by_row(const double m_1[2],
                                         const double m_2[2]) {
  return m_1[0] * m_2[1] - m_1[1] * m_2[0];
}


x86 assembly (clang, -O0):
<bot_matrix_determinant_2x2_by_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_matrix_determinant_2x2_by_row>:
movsd  (%rsi),%xmm1
mulsd  0x8(%rdi),%xmm1
movsd  (%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bot_matrix_determinant_2x2_by_row(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %7, double %10, double %18)
ret double %19
}

LLVM IR (-O2):
define double @bot_matrix_determinant_2x2_by_row(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = load double, double* %1
%9 = fneg double %7
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *GetScientificVersion() {
  static char c[10];
  sprintf(c, "%d.%d.%d", (int)1, (int)2, (int)4);
  return c;
}


x86 assembly (clang, -O0):
<GetScientificVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x4,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScientificVersion>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x4,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@GetScientificVersion.c = internal global [10 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @GetScientificVersion() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @GetScientificVersion.c, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @GetScientificVersion.c, i64 0, i64 0)
}

LLVM IR (-O2):
@GetScientificVersion.c = internal global [10 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @GetScientificVersion() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @GetScientificVersion.c, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @GetScientificVersion.c, i64 0, i64 0)
}
void netPmk(char *ssid, char *key, char *buf) {}


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

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

LLVM IR (-O0):
define void @netPmk(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @netPmk(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}