xunge/DecIR huggingface dataset:
float abs_r(float p) {
  if (p < 0)
    return 0 - p;
  return p;
}


x86 assembly (clang, -O0):
<abs_r>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1128 <abs_r+0x28>
xorps  %xmm0,%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1132 <abs_r+0x32>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_r>:
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
cmpltss %xmm2,%xmm1
subss  %xmm0,%xmm2
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @abs_r(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fsub float 0.000000e+00, %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int srv_main(int, char **);
int main(int argc, char **argv) { return srv_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <srv_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <srv_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @srv_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int RAND_pseudo_bytes(unsigned char *, int);
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
char *saslc__crypto_nonce(size_t len) {
  char *n;
  if ((n = malloc(len)) == NULL)
    return NULL;
  if (RAND_pseudo_bytes((unsigned char *)n, (int)len) != 1) {
    free(n);
    return NULL;
  }
  return n;
}


x86 assembly (clang, -O0):
<saslc__crypto_nonce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1160 <saslc__crypto_nonce+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1196 <saslc__crypto_nonce+0x66>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1050 <RAND_pseudo_bytes@plt>
cmp    $0x1,%eax
je     118e <saslc__crypto_nonce+0x5e>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1196 <saslc__crypto_nonce+0x66>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saslc__crypto_nonce>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     115c <saslc__crypto_nonce+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14d,%esi
call   1050 <RAND_pseudo_bytes@plt>
cmp    $0x1,%eax
je     115e <saslc__crypto_nonce+0x2e>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @saslc__crypto_nonce(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %20
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = call i32 @RAND_pseudo_bytes(i8* %10, i32 %12)
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
store i8* null, i8** %2
br label %20
18: ; preds = %9
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %15, %8
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @saslc__crypto_nonce(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = trunc i64 %0 to i32
%6 = tail call i32 @RAND_pseudo_bytes(i8* %2, i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @free(i8* %2)
br label %10
10: ; preds = %4, %1, %8
%11 = phi i8* [ null, %8 ], [ null, %1 ], [ %2, %4 ]
ret i8* %11
}
void readFiles() { return; }


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

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

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

LLVM IR (-O2):
define void @readFiles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dispTryte(int *);
int /*<<< orphan*/ printf(char *);
void dump(int **mem) {
  int i;
  printf("Memory Dump:\n");
  for (i = 0; i < 729; i++) {
    dispTryte(mem[i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2d9,-0xc(%rbp)
jge    1177 <dump+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <dispTryte@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <dump+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1050 <dispTryte@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x2d9,%rbx
jne    1150 <dump+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Memory Dump:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dump(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 729
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32**, i32*** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32*, i32** %9, i64 %11
%13 = load i32*, i32** %12
%14 = call i32 @dispTryte(i32* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Memory Dump:\00"
define void @dump(i32** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = tail call i32 @dispTryte(i32* %6)
%8 = tail call i32 @putchar(i32 10)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 729
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ setenv(char *, char *, int /*<<< orphan*/);
void pager_preexec(void) {
  fd_set in;
  FD_ZERO(&in);
  FD_SET(0, &in);
  select(1, &in, NULL, &in, NULL);
  setenv("LESS", "FRSX", 0);
}


x86 assembly (clang, -O0):
<pager_preexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    $0x1,%edi
lea    -0x4(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rcx,%rsi
mov    %r8,%rdx
call   1050 <select@plt>
lea    0xe84(%rip),%rdi
lea    0xe82(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pager_preexec>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <FD_SET@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1050 <select@plt>
lea    0xe88(%rip),%rdi
lea    0xe86(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"LESS\00"
@.str.1 = [5 x i8] c"FRSX\00"
define void @pager_preexec() {
%1 = alloca i32
%2 = call i32 @FD_ZERO(i32* %1)
%3 = call i32 @FD_SET(i32 0, i32* %1)
%4 = call i32 @select(i32 1, i32* %1, i32* null, i32* %1, i32* null)
%5 = call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"LESS\00"
@.str.1 = [5 x i8] c"FRSX\00"
define void @pager_preexec() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @FD_ZERO(i32* %1)
%4 = call i32 @FD_SET(i32 0, i32* %1)
%5 = call i32 @select(i32 1, i32* %1, i32* null, i32* %1, i32* null)
%6 = call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\"It is a wise father that knows his own child.\" Shakespeare");
  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 = [61 x i8] c"\0A\22It is a wise father that knows his own child.\22 Shakespeare\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"\0A\22It is a wise father that knows his own child.\22 Shakespeare\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x8c() {
  Assert_real((isupper(140) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              705, ("isupper should be 0 for 0x8c"));
}


x86 assembly (clang, -O0):
<t_isupper_0x8c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8c,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2c1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x8c\00"
define void @t_isupper_0x8c() {
%1 = call i64 @isupper(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x8c\00"
define void @t_isupper_0x8c() {
%1 = tail call i64 @isupper(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int mjson_print_null(const char *ptr, int len, void *userdata) {
  (void)ptr;
  (void)userdata;
  return len;
}


x86 assembly (clang, -O0):
<mjson_print_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mjson_print_null(i8* nocapture readnone %0, i32 returned %1, i8* nocapture readnone %2) {
ret i32 %1
}
void f4(char a[]) {}


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

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

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

LLVM IR (-O2):
define void @f4(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ __my_longjmp(int /*<<< orphan*/, int);
void my_longjmp(jmp_buf env, int value) { __my_longjmp(env, value); }


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

x86 assembly (clang, -O2):
<my_longjmp>:
jmp    1030 <__my_longjmp@plt>

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

LLVM IR (-O2):
define void @my_longjmp(i32 %0, i32 %1) {
%3 = tail call i32 @__my_longjmp(i32 %0, i32 %1)
ret void
}
int test_imm_B9int8_mem(signed char *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9int8_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, 185
%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_B9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -71
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double exp(double);
double gaussline(const double v, const double oneOnSigma) {
  double val;
  val = v * v * oneOnSigma * oneOnSigma;
  return exp(-val);
}


x86 assembly (clang, -O0):
<gaussline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussline>:
movapd 0xee8(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @gaussline(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = load double, double* %4
%12 = fmul double %10, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fneg double %13
%15 = call double @exp(double %14)
ret double %15
}

LLVM IR (-O2):
define double @gaussline(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = fmul double %4, %1
%6 = fmul double %5, %1
%7 = tail call double @exp(double %6)
ret double %7
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __fxstat64(int, int, struct stat64 *);
int fstat64(int fd, struct stat64 *buf) { return __fxstat64(1, fd, buf); }


x86 assembly (clang, -O0):
<fstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <__fxstat64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat64>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <__fxstat64@plt>

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

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @fstat64(i32 %0, %struct.stat64* %1) {
%3 = tail call i32 @__fxstat64(i32 1, i32 %0, %struct.stat64* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Welcome from userspace\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 <puts@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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Welcome from userspace\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Welcome from userspace\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  char c = 3;
  c += 2;
  if (c != 5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x3,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x2,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5,%eax
je     1141 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 3, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 5
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool ts_check_duplicate(uint8_t i_cc, uint8_t i_last_cc) {
  return i_last_cc == i_cc;
}


x86 assembly (clang, -O0):
<ts_check_duplicate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_check_duplicate>:
xor    %eax,%eax
cmp    %rdi,%rsi
sete   %al
ret

LLVM IR (-O0):
define i32 @ts_check_duplicate(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ts_check_duplicate(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_log_state(unsigned long, unsigned char, unsigned char);
void init_output(unsigned long when, unsigned char addr, unsigned char value) {
  write_log_state(when, addr * 2 + 1, value);
}


x86 assembly (clang, -O0):
<init_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
movzbl %al,%esi
movzbl -0xa(%rbp),%edx
call   1030 <write_log_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_output>:
add    %sil,%sil
or     $0x1,%sil
movzbl %sil,%esi
jmp    1030 <write_log_state@plt>

LLVM IR (-O0):
define void @init_output(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i64, i64* %4
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, 2
%11 = add nsw i32 %10, 1
%12 = trunc i32 %11 to i8
%13 = load i8, i8* %6
%14 = call i32 @write_log_state(i64 %7, i8 zeroext %12, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @init_output(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = shl i8 %1, 1
%5 = or i8 %4, 1
%6 = tail call i32 @write_log_state(i64 %0, i8 zeroext %5, i8 zeroext %2)
ret void
}
void ubi_fastmap_init(struct ubi_device *ubi, int *count) {}


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

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

LLVM IR (-O0):
%struct.ubi_device = type opaque
define void @ubi_fastmap_init(%struct.ubi_device* %0, i32* %1) {
%3 = alloca %struct.ubi_device*
%4 = alloca i32*
store %struct.ubi_device* %0, %struct.ubi_device** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.ubi_device = type opaque
define void @ubi_fastmap_init(%struct.ubi_device* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int ENOSYS;
int xntrace_user_start(void) { return -ENOSYS; }


x86 assembly (clang, -O0):
<xntrace_user_start>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xntrace_user_start>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @xntrace_user_start() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @xntrace_user_start() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}
void fst_global_stop(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ finish();
int /*<<< orphan*/ najeResolveReferences();
int /*<<< orphan*/ najeSync();
int /*<<< orphan*/ najeWriteMap();
int /*<<< orphan*/ prepare();
int /*<<< orphan*/ process_file(char *);
int /*<<< orphan*/ save();
int32_t main(int argc, char **argv) {
  int32_t i;
  prepare();
  process_file(argv[1]);
  najeSync();
  najeResolveReferences();
  najeSync();
  finish();
  save();
  najeWriteMap();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <prepare@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <process_file@plt>
mov    $0x0,%al
call   1090 <najeSync@plt>
mov    $0x0,%al
call   1080 <najeResolveReferences@plt>
mov    $0x0,%al
call   1090 <najeSync@plt>
mov    $0x0,%al
call   1030 <finish@plt>
mov    $0x0,%al
call   1050 <save@plt>
mov    $0x0,%al
call   1060 <najeWriteMap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1070 <prepare@plt>
mov    0x8(%rbx),%rdi
call   1040 <process_file@plt>
xor    %eax,%eax
call   1090 <najeSync@plt>
xor    %eax,%eax
call   1080 <najeResolveReferences@plt>
xor    %eax,%eax
call   1090 <najeSync@plt>
xor    %eax,%eax
call   1030 <finish@plt>
xor    %eax,%eax
call   1050 <save@plt>
xor    %eax,%eax
call   1060 <najeWriteMap@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @prepare()
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @process_file(i8* %10)
%12 = call i32 (...) @najeSync()
%13 = call i32 (...) @najeResolveReferences()
%14 = call i32 (...) @najeSync()
%15 = call i32 (...) @finish()
%16 = call i32 (...) @save()
%17 = call i32 (...) @najeWriteMap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @prepare()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @process_file(i8* %5)
%7 = tail call i32 (...) @najeSync()
%8 = tail call i32 (...) @najeResolveReferences()
%9 = tail call i32 (...) @najeSync()
%10 = tail call i32 (...) @finish()
%11 = tail call i32 (...) @save()
%12 = tail call i32 (...) @najeWriteMap()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(1 + 1 == 3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int XDisplayWidth(int /*<<< orphan*/ *, int);
int _DtGetDisplayResolution(Display *disp, int screen) {
  int screenWidth = XDisplayWidth(disp, screen);
  if (screenWidth >= 1176) {
    return (4);
  }
  if (screenWidth >= 851) {
    return (3);
  }
  if (screenWidth >= 512) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<_DtGetDisplayResolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <XDisplayWidth@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x498,-0x18(%rbp)
jl     1147 <_DtGetDisplayResolution+0x37>
movl   $0x4,-0x4(%rbp)
jmp    1180 <_DtGetDisplayResolution+0x70>
cmpl   $0x353,-0x18(%rbp)
jl     1160 <_DtGetDisplayResolution+0x50>
movl   $0x3,-0x4(%rbp)
jmp    1180 <_DtGetDisplayResolution+0x70>
cmpl   $0x200,-0x18(%rbp)
jl     1179 <_DtGetDisplayResolution+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1180 <_DtGetDisplayResolution+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtGetDisplayResolution>:
push   %rax
call   1030 <XDisplayWidth@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    $0x497,%ecx
jg     113d <_DtGetDisplayResolution+0x2d>
mov    $0x3,%eax
cmp    $0x352,%ecx
jg     113d <_DtGetDisplayResolution+0x2d>
xor    %eax,%eax
cmp    $0x200,%ecx
setge  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_DtGetDisplayResolution(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = call i32 @XDisplayWidth(i32* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp sge i32 %10, 1176
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 4, i32* %3
br label %22
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 851
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %3
br label %22
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp sge i32 %18, 512
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %16, %12
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @_DtGetDisplayResolution(i32* %0, i32 %1) {
%3 = tail call i32 @XDisplayWidth(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 1175
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = icmp sgt i32 %3, 850
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp sgt i32 %3, 511
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %5, %2
%11 = phi i32 [ 4, %2 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *d = fopen("toto", "w+");
  fprintf(d, "Hello world\n");
  fclose(d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"toto\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"toto\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double f(double x) {
  double result;
  result = 1.0 / (5.0 * pow(x, 3.0) + 6.0);
  return result;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @pow(double %0, double 3.000000e+00)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e+00, double 6.000000e+00)
%4 = fdiv double 1.000000e+00, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void send_msg2(void) {
  static char msg[] = "Goodnight Irene\r\n";
  write(1, msg, strlen(msg));
}


x86 assembly (clang, -O0):
<send_msg2>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0x2f02(%rip),%rsi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg2>:
push   %rbx
lea    0x2f18(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@send_msg2.msg = internal global [18 x i8] c"Goodnight Irene\0D\0A\00"
define void @send_msg2() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @send_msg2.msg, i64 0, i64 0))
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @send_msg2.msg, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@send_msg2.msg = internal global [18 x i8] c"Goodnight Irene\0D\0A\00"
define void @send_msg2() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @send_msg2.msg, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @send_msg2.msg, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *kmap_atomic(struct page *page) {
  assert(0);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @kmap_atomic(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = call i32 @assert(i32 0)
ret i8* null
}

LLVM IR (-O2):
%struct.page = type { i32 }
define noalias i8* @kmap_atomic(%struct.page* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i8* null
}
/* Variables and functions */
float __ocml_sqrt_rtn_f32(float);
float __fsqrt_ru(float x) { return __ocml_sqrt_rtn_f32(x); }


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

x86 assembly (clang, -O2):
<__fsqrt_ru>:
jmp    1030 <__ocml_sqrt_rtn_f32@plt>

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

LLVM IR (-O2):
define float @__fsqrt_ru(float %0) {
%2 = tail call float @__ocml_sqrt_rtn_f32(float %0)
ret float %2
}
double acos(x)
double x;
{ return asin_acos(x, 1); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <asin_acos@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <asin_acos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, i32, ...) bitcast (i32 (...)* @asin_acos to i32 (double, i32, ...)*)(double %3, i32 1)
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @asin_acos to i32 (double, i32, ...)*)(double %0, i32 1)
%3 = sitofp i32 %2 to double
ret double %3
}
short test7(short a) {
  a &= 0x8fff;
  a >>= 2;
  return a;
}


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

x86 assembly (clang, -O2):
<test7>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0xe3ff,%eax
ret

LLVM IR (-O0):
define signext i16 @test7(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 36863
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = ashr i32 %8, 2
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
%11 = load i16, i16* %2
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @test7(i16 signext %0) {
%2 = ashr i16 %0, 2
%3 = and i16 %2, -7169
ret i16 %3
}
int b_twist_r2_on_midperm(mperm)
int mperm;
{
  int temp_arr[4];
  b_midperm_unpack(mperm, temp_arr);
  two_cycle(temp_arr, 0, 2);
  return b_midperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_r2_on_midperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <b_midperm_unpack@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1050 <two_cycle@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <b_midperm_pack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_r2_on_midperm>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <b_midperm_unpack@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <two_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <b_midperm_pack@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_r2_on_midperm(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_midperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %7, i32 0, i32 2)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_midperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_r2_on_midperm(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_midperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %4, i32 0, i32 2)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_midperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
void swr_alloc() {}


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

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

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

LLVM IR (-O2):
define void @swr_alloc() {
ret void
}
long BLAST_Nint(double x) {
  x += (x >= 0. ? 0.5 : -0.5);
  return (long)x;
}


x86 assembly (clang, -O0):
<BLAST_Nint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm3
movsd  0xeea(%rip),%xmm2
xorps  %xmm0,%xmm0
cmplesd %xmm1,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLAST_Nint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @BLAST_Nint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, double 5.000000e-01, double -5.000000e-01
%7 = load double, double* %2
%8 = fadd double %7, %6
store double %8, double* %2
%9 = load double, double* %2
%10 = fptosi double %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @BLAST_Nint(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = select i1 %2, double 5.000000e-01, double -5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_message(void) { printf("Hello World\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @print_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
double chi_square(int observed, int expected, double *p_value) {
  double stat = ((observed - expected) * (observed - expected)) / expected;
  return stat;
}


x86 assembly (clang, -O0):
<chi_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
cltd
idivl  -0x8(%rbp)
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<chi_square>:
mov    %edi,%eax
sub    %esi,%eax
imul   %eax,%eax
cltd
idiv   %esi
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @chi_square(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = mul nsw i32 %10, %13
%15 = load i32, i32* %5
%16 = sdiv i32 %14, %15
%17 = sitofp i32 %16 to double
store double %17, double* %7
%18 = load double, double* %7
ret double %18
}

LLVM IR (-O2):
define double @chi_square(i32 %0, i32 %1, double* nocapture readnone %2) {
%4 = sub nsw i32 %0, %1
%5 = mul nsw i32 %4, %4
%6 = sdiv i32 %5, %1
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int __socket(int, int, int);
int socket(int domain, int type, int protocol) {
  return __socket(domain, type, protocol);
}


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

x86 assembly (clang, -O2):
<socket>:
jmp    1030 <__socket@plt>

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

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UART0_SendData32(unsigned long);
int /*<<< orphan*/ UART0_SendString(char *);
void UART0_SendData32_n(unsigned long int data) {
  UART0_SendData32(data);
  UART0_SendString("\n\r");
}


x86 assembly (clang, -O0):
<UART0_SendData32_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <UART0_SendData32@plt>
lea    0xec4(%rip),%rdi
call   1040 <UART0_SendString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART0_SendData32_n>:
push   %rax
call   1030 <UART0_SendData32@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <UART0_SendString@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0D\00"
define void @UART0_SendData32_n(i64 %0) {
%2 = tail call i32 @UART0_SendData32(i64 %0)
%3 = tail call i32 @UART0_SendString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct animal_builder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void animal_builder_ops_build_header(struct animal_builder *animal_builder) {
  printf("animal_builder::build_header()\n");
}


x86 assembly (clang, -O0):
<animal_builder_ops_build_header>:
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):
<animal_builder_ops_build_header>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
%struct.animal_builder = type { i32 }
@str = [31 x i8] c"animal_builder::build_header()\00"
define void @animal_builder_ops_build_header(%struct.animal_builder* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}