xunge/DecIR huggingface dataset:
char *habitable_exoplanet(double L, double r) {
  char *habitability = "";
  return habitability;
}


x86 assembly (clang, -O0):
<habitable_exoplanet>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @habitable_exoplanet(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i8*
store double %0, double* %3
store double %1, double* %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @habitable_exoplanet(double %0, double %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ doupdate();
void update_screen(void) { doupdate(); }


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

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

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

LLVM IR (-O2):
define void @update_screen() {
%1 = tail call i32 (...) @doupdate()
ret void
}
/* Variables and functions */
scalar_t__ COND_VC();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svc_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_VC() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_svc_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_VC@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_svc_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_VC@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_svc_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_VC()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_svc_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_VC()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ sched_getcpu();
int /*<<< orphan*/ sched_setaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
void setaffinity() {
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(sched_getcpu(), &mask);
  sched_setaffinity(0, sizeof(cpu_set_t), &mask);
}


x86 assembly (clang, -O0):
<setaffinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    $0x0,%al
call   1050 <sched_getcpu@plt>
mov    %eax,%edi
lea    -0x4(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x4(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setaffinity>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
xor    %eax,%eax
call   1050 <sched_getcpu@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <sched_setaffinity@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @setaffinity() {
%1 = alloca i32
%2 = call i32 @CPU_ZERO(i32* %1)
%3 = call i32 (...) @sched_getcpu()
%4 = call i32 @CPU_SET(i32 %3, i32* %1)
%5 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %1)
ret void
}

LLVM IR (-O2):
define void @setaffinity() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @CPU_ZERO(i32* %1)
%4 = call i32 (...) @sched_getcpu()
%5 = call i32 @CPU_SET(i32 %4, i32* %1)
%6 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %1)
ret void
}
int comparator(const void *a, const void *b) { return (*(int *)b - *(int *)a); }


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

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

LLVM IR (-O0):
define i32 @comparator(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void gtk_button_set_alignment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_set_alignment() {
ret void
}
/* Variables and functions */
char *_s2_f2cstr(char *, long);
int /*<<< orphan*/ free(char *);
int ss2lcm(char *, int, int);
int s2loadmap_(char *imapfile, int *startidx, int *maxn, long int textlen) {
  char *ttex = _s2_f2cstr(imapfile, textlen);
  int result = ss2lcm(ttex, *startidx, *maxn);
  free(ttex);
  return result;
}


x86 assembly (clang, -O0):
<s2loadmap_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1040 <ss2lcm@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2loadmap_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rcx,%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,%rbx
mov    (%r15),%esi
mov    (%r14),%edx
mov    %rax,%rdi
call   1040 <ss2lcm@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s2loadmap_(i8* %0, i32* %1, i32* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%11 = load i8*, i8** %5
%12 = load i64, i64* %8
%13 = call i8* @_s2_f2cstr(i8* %11, i64 %12)
store i8* %13, i8** %9
%14 = load i8*, i8** %9
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = call i32 @ss2lcm(i8* %14, i32 %16, i32 %18)
store i32 %19, i32* %10
%20 = load i8*, i8** %9
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %10
ret i32 %22
}

LLVM IR (-O2):
define i32 @s2loadmap_(i8* %0, i32* nocapture %1, i32* nocapture %2, i64 %3) {
%5 = tail call i8* @_s2_f2cstr(i8* %0, i64 %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = tail call i32 @ss2lcm(i8* %5, i32 %6, i32 %7)
%9 = tail call i32 @free(i8* %5)
ret i32 %8
}
void foo189(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo189(i32 %0) {
ret void
}
void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(void) {
  CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol();
}


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

x86 assembly (clang, -O2):
xor    %eax,%eax
jmp    1030 <CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol@plt>

LLVM IR (-O0):
define void @"CC1000RadioIntM$RadioReceiveCoordinator$startSymbol"() {
%1 = call i32 (...) @"CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol"()
ret void
}

LLVM IR (-O2):
define void @"CC1000RadioIntM$RadioReceiveCoordinator$startSymbol"() {
%1 = tail call i32 (...) @"CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol"()
ret void
}
int mem_shutdown(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @mem_shutdown() {
ret i32 0
}
double round(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @round(double returned %0) {
ret double %0
}
/* Variables and functions */
char *get_end_of_arg(char *);
char *prv_end_of_space(char *);
char *get_next_arg(char *buffer, char **end) {
  buffer = get_end_of_arg(buffer);
  buffer = prv_end_of_space(buffer);
  if (end != NULL) {
    *end = get_end_of_arg(buffer);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<get_next_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_end_of_arg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <prv_end_of_space@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <get_next_arg+0x48>
mov    -0x8(%rbp),%rdi
call   1040 <get_end_of_arg@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_arg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <get_end_of_arg@plt>
mov    %rax,%rdi
call   1030 <prv_end_of_space@plt>
mov    %rax,%rbx
test   %r14,%r14
je     1147 <get_next_arg+0x27>
mov    %rbx,%rdi
call   1040 <get_end_of_arg@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_next_arg(i8* %0, i8** writeonly %1) {
%3 = tail call i8* @get_end_of_arg(i8* %0)
%4 = tail call i8* @prv_end_of_space(i8* %3)
%5 = icmp eq i8** %1, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @get_end_of_arg(i8* %4)
store i8* %7, i8** %1
br label %8
8: ; preds = %6, %2
ret i8* %4
}
void addPrologue(unsigned char *code) {
  code[0] = 0x55;
  code[1] = 0x89;
  code[2] = 0xe5;
}


x86 assembly (clang, -O0):
<addPrologue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x55,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x89,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0xe5,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addPrologue>:
movw   $0x8955,(%rdi)
movb   $0xe5,0x2(%rdi)
ret

LLVM IR (-O0):
define void @addPrologue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 85, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 -119, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 -27, i8* %8
ret void
}

LLVM IR (-O2):
define void @addPrologue(i8* nocapture writeonly %0) {
store i8 85, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -119, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 -27, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x = 999, n = 0;
  while (x) {
    x = x & (x - 1);
    n++;
  }
  printf("%d", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e7,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <main+0x3c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 999, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = sub nsw i32 %8, 1
%10 = and i32 %7, %9
store i32 %10, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abortmsg(char *);
void *malloc(size_t);
void *mallocx(size_t size) {
  void *result = malloc(size);
  if (!result)
    abortmsg("failed to malloc");
  return result;
}


x86 assembly (clang, -O0):
<mallocx>:
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    1150 <mallocx+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <abortmsg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocx>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mallocx+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <abortmsg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"failed to malloc\00"
define i8* @mallocx(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 @abortmsg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"failed to malloc\00"
define noalias i8* @mallocx(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 @abortmsg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void next_page() { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @next_page() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double exp(double x) { return pow(x, 2.71828183); }


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

x86 assembly (clang, -O2):
<exp>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double @pow(double %0, double 0x4005BF0A8B4949CB)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dpotri_(char *, int *, double *, int *, int *);
void clapack_dpotri(char uplo, int n, double *a, int lda, int *info) {
  dpotri_(&uplo, &n, a, &lda, info);
}


x86 assembly (clang, -O0):
<clapack_dpotri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
call   1030 <dpotri_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clapack_dpotri>:
sub    $0x18,%rsp
mov    %dil,0xf(%rsp)
mov    %esi,0x14(%rsp)
mov    %ecx,0x10(%rsp)
lea    0xf(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   1030 <dpotri_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @clapack_dpotri(i8 signext %0, i32 %1, double* %2, i32 %3, i32* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32*
store i8 %0, i8* %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load double*, double** %8
%12 = load i32*, i32** %10
%13 = call i32 @dpotri_(i8* %6, i32* %7, double* %11, i32* %9, i32* %12)
ret void
}

LLVM IR (-O2):
define void @clapack_dpotri(i8 signext %0, i32 %1, double* %2, i32 %3, i32* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %6
store i32 %1, i32* %7
store i32 %3, i32* %8
%9 = call i32 @dpotri_(i8* %6, i32* %7, double* %2, i32* %8, i32* %4)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int timespec_now(struct timespec *ts) {
  return clock_gettime(CLOCK_REALTIME, ts);
}


x86 assembly (clang, -O0):
<timespec_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_now>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timespec_now(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_REALTIME
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timespec_now(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_REALTIME
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret i32 %3
}
int chk_palin(char ar[100], int size, int start, int mid) {
  if (start == mid)
    return 1;
  if (ar[start] == ar[size - start - 1])
    return (ar, size, start + 1, mid);
  else
    return 0;
}


x86 assembly (clang, -O0):
<chk_palin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1129 <chk_palin+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1163 <chk_palin+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    115c <chk_palin+0x5c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <chk_palin+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_palin>:
mov    $0x1,%eax
cmp    %ecx,%edx
je     1120 <chk_palin+0x20>
movslq %edx,%rax
mov    (%rdi,%rax,1),%r8b
not    %edx
add    %esi,%edx
movslq %edx,%rdx
xor    %eax,%eax
cmp    (%rdi,%rdx,1),%r8b
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @chk_palin(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %17, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = xor i32 %2, -1
%11 = add i32 %10, %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %9, %14
%16 = select i1 %15, i32 %3, i32 0
br label %17
17: ; preds = %6, %4
%18 = phi i32 [ 1, %4 ], [ %16, %6 ]
ret i32 %18
}
int test_imm_68int16_mem(short *val) {
  return ((*val) & (0x68 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_68int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 104
%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_68int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 104
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ random();
double xrandom(double xl, double xh) {
  return (xl + (xh - xl) * ((double)random()) / 2147483647.0);
}


x86 assembly (clang, -O0):
<xrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrandom>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0xebf(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @xrandom(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* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call i64 (...) @random()
%10 = sitofp i64 %9 to double
%11 = fmul double %8, %10
%12 = fdiv double %11, 0x41DFFFFFFFC00000
%13 = fadd double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @xrandom(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @random()
%5 = sitofp i64 %4 to double
%6 = fmul double %3, %5
%7 = fdiv double %6, 0x41DFFFFFFFC00000
%8 = fadd double %7, %0
ret double %8
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int get_unaligned_be32(void const *);
uint64_t get_unaligned_be64(const void *ptr) {
  uint32_t low = get_unaligned_be32(ptr + 4);
  uint64_t high = get_unaligned_be32(ptr);
  return high << 32 | low;
}


x86 assembly (clang, -O0):
<get_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1030 <get_unaligned_be32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_unaligned_be32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_be64>:
push   %rbx
mov    %rdi,%rbx
add    $0x4,%rdi
call   1030 <get_unaligned_be32@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_unaligned_be32@plt>

LLVM IR (-O0):
define i32 @get_unaligned_be64(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr i8, i8* %5, i64 4
%7 = call i32 @get_unaligned_be32(i8* %6)
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = call i32 @get_unaligned_be32(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = shl i32 %10, 32
%12 = load i32, i32* %3
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_unaligned_be64(i8* %0) {
%2 = getelementptr i8, i8* %0, i64 4
%3 = tail call i32 @get_unaligned_be32(i8* %2)
%4 = tail call i32 @get_unaligned_be32(i8* %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ __NR_kcmp;
long syscall(int /*<<< orphan*/, int, int, int, int, int);
long sys_kcmp(int pid1, int pid2, int type, int fd1, int fd2) {
  return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2);
}


x86 assembly (clang, -O0):
<sys_kcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_kcmp>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_kcmp = global i32 0
define i64 @sys_kcmp(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
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
%11 = load i32, i32* @__NR_kcmp
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i64 @syscall(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
ret i64 %17
}

LLVM IR (-O2):
@__NR_kcmp = global i32 0
define i64 @sys_kcmp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @__NR_kcmp
%7 = tail call i64 @syscall(i32 %6, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i64 %7
}
/* Type definitions */
struct i2c_client {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int i2c_smbus_read_i2c_block_data(struct i2c_client *, unsigned char, int,
                                  unsigned char *);
struct i2c_client *to_i2c_client(struct device *);
int adxl34x_smbus_read_block(struct device *dev, unsigned char reg, int count,
                             unsigned char *buf) {
  struct i2c_client *client = to_i2c_client(dev);
  return i2c_smbus_read_i2c_block_data(client, reg, count, buf);
}


x86 assembly (clang, -O0):
<adxl34x_smbus_read_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <to_i2c_client@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
movzbl %al,%esi
call   1040 <i2c_smbus_read_i2c_block_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxl34x_smbus_read_block>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %esi,%ebx
call   1030 <to_i2c_client@plt>
mov    %rax,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <i2c_smbus_read_i2c_block_data@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @adxl34x_smbus_read_block(%struct.device* %0, i8 zeroext %1, i32 %2, i8* %3) {
%5 = alloca %struct.device*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.i2c_client*
store %struct.device* %0, %struct.device** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load %struct.device*, %struct.device** %5
%11 = call %struct.i2c_client* @to_i2c_client(%struct.device* %10)
store %struct.i2c_client* %11, %struct.i2c_client** %9
%12 = load %struct.i2c_client*, %struct.i2c_client** %9
%13 = load i8, i8* %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = call i32 @i2c_smbus_read_i2c_block_data(%struct.i2c_client* %12, i8 zeroext %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @adxl34x_smbus_read_block(%struct.device* %0, i8 zeroext %1, i32 %2, i8* %3) {
%5 = tail call %struct.i2c_client* @to_i2c_client(%struct.device* %0)
%6 = tail call i32 @i2c_smbus_read_i2c_block_data(%struct.i2c_client* %5, i8 zeroext %1, i32 %2, i8* %3)
ret i32 %6
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_read(struct ac_buffer *, int *, int);
int buffer_read_int(struct ac_buffer *buffer, int *value) {
  return _buffer_read(buffer, value, sizeof(int));
}


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

x86 assembly (clang, -O2):
<buffer_read_int>:
mov    $0x4,%edx
jmp    1030 <_buffer_read@plt>

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

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_int(%struct.ac_buffer* %0, i32* %1) {
%3 = tail call i32 @_buffer_read(%struct.ac_buffer* %0, i32* %1, i32 4)
ret i32 %3
}
short int usrp_to_host_short(unsigned short int x) { return x; }


x86 assembly (clang, -O0):
<usrp_to_host_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @usrp_to_host_short(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @usrp_to_host_short(i16 returned zeroext %0) {
ret i16 %0
}
void RTSystemQueryTotalRam(void) {}


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

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

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

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

/* Variables and functions */
__attribute__((always_)) const uint32_t __generic_swab32(uint32_t x) {
  return ((((uint8_t *)&x)[0] << 24) | (((uint8_t *)&x)[1] << 16) |
          (((uint8_t *)&x)[2] << 8) | (((uint8_t *)&x)[3]));
}


x86 assembly (clang, -O0):
<__generic_swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    0x0(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__generic_swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 0
%4 = load i32, i32* %3
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
%10 = getelementptr inbounds i32, i32* %2, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = getelementptr inbounds i32, i32* %2, i64 3
%15 = load i32, i32* %14
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @__generic_swab32(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void *sm_setptr_err(void *ptr) {
  fprintf(stderr,
          "invalid pointer: (%p)"
          "\n",
          ptr);
  return (NULL);
}


x86 assembly (clang, -O0):
<sm_setptr_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_setptr_err>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"invalid pointer: (%p)\0A\00"
define i8* @sm_setptr_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"invalid pointer: (%p)\0A\00"
define noalias i8* @sm_setptr_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ converse(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int N = 1024, r = 2;
  converse(N, r);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <converse@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
mov    $0x2,%esi
call   1040 <converse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @converse(i32 1024, i32 2)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
int noll_entl_to_hom(void) {
  int res = 1;
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @noll_entl_to_hom() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
unsigned int equals(char *str1, char *str2) { return !strcmp(str1, str2); }


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equals(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int is_alureg(int opcode) { return opcode == 0; }


x86 assembly (clang, -O0):
<is_alureg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alureg>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_alureg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_alureg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void eShutdown(int errorlevel) { exit(errorlevel); }


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

x86 assembly (clang, -O2):
<eShutdown>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @eShutdown(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node) { return; }


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

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

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

LLVM IR (-O2):
%struct.batadv_orig_node = type opaque
define void @batadv_mcast_purge_orig(%struct.batadv_orig_node* nocapture %0) {
ret void
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ sprintf(char *, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ write_file0(char *);
void write_file(const char *d) {
  static int i = 0;
  char fn[BUFSIZ];
  sprintf(fn, "%s/%05d.vtk", d, i++);
  write_file0(fn);
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    0x2ed2(%rip),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2ec7(%rip)
lea    0xe8c(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <write_file0@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2eeb(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2ee2(%rip)
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <write_file0@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@write_file.i = internal global i32 0
@BUFSIZ = global i32 0
@.str = [12 x i8] c"%s/%05d.vtk\00"
define void @write_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %2
%10 = load i32, i32* @write_file.i
%11 = add nsw i32 %10, 1
store i32 %11, i32* @write_file.i
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%13 = call i32 @write_file0(i8* %8)
%14 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@write_file.i = internal unnamed_addr global i32 0
@BUFSIZ = global i32 0
@.str = [12 x i8] c"%s/%05d.vtk\00"
define void @write_file(i8* %0) {
%2 = load i32, i32* @BUFSIZ
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = load i32, i32* @write_file.i
%6 = add nsw i32 %5, 1
store i32 %6, i32* @write_file.i
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5)
%8 = call i32 @write_file0(i8* %4)
ret void
}
/* Variables and functions */
void *mclpInstantiate(void *, int, double);
void *mclpInit_v(void *ivp) { return mclpInstantiate(ivp, -1, 1.0); }


x86 assembly (clang, -O0):
<mclpInit_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
movsd  0xed3(%rip),%xmm0
call   1030 <mclpInstantiate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mclpInit_v>:
movsd  0xee8(%rip),%xmm0
mov    $0xffffffff,%esi
jmp    1030 <mclpInstantiate@plt>

LLVM IR (-O0):
define i8* @mclpInit_v(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @mclpInstantiate(i8* %3, i32 -1, double 1.000000e+00)
ret i8* %4
}

LLVM IR (-O2):
define i8* @mclpInit_v(i8* %0) {
%2 = tail call i8* @mclpInstantiate(i8* %0, i32 -1, double 1.000000e+00)
ret i8* %2
}
float f_max(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<f_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <f_max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <f_max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_max>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @f_max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_blue_led();
int /*<<< orphan*/ gpio_toggle_blue_led();
int /*<<< orphan*/ some_delay(unsigned int);
int main(void) {
  gpio_init_blue_led();
  while (1) {
    gpio_toggle_blue_led();
    some_delay(100000u);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gpio_init_blue_led@plt>
mov    $0x0,%al
call   1030 <gpio_toggle_blue_led@plt>
mov    $0x186a0,%edi
call   1040 <some_delay@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <gpio_init_blue_led@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gpio_toggle_blue_led@plt>
mov    $0x186a0,%edi
call   1040 <some_delay@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gpio_init_blue_led()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @gpio_toggle_blue_led()
%5 = call i32 @some_delay(i32 100000)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gpio_init_blue_led()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @gpio_toggle_blue_led()
%4 = tail call i32 @some_delay(i32 100000)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdSoundRecordCtrl(int);
void MCUSendCmdSoundRecordCtrlStop() { MCUSendCmdSoundRecordCtrl(1); }


x86 assembly (clang, -O0):
<MCUSendCmdSoundRecordCtrlStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <MCUSendCmdSoundRecordCtrl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCUSendCmdSoundRecordCtrlStop>:
mov    $0x1,%edi
jmp    1030 <MCUSendCmdSoundRecordCtrl@plt>

LLVM IR (-O0):
define void @MCUSendCmdSoundRecordCtrlStop() {
%1 = call i32 @MCUSendCmdSoundRecordCtrl(i32 1)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdSoundRecordCtrlStop() {
%1 = tail call i32 @MCUSendCmdSoundRecordCtrl(i32 1)
ret void
}