xunge/DecIR huggingface dataset:
void band_pass_image(image, nx, ny) float *image;
int nx, ny;
{ subtract_image_value(image, image_mean(image, nx, ny), nx, ny); }


x86 assembly (clang, -O0):
<band_pass_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1040 <image_mean@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x0,%al
call   1030 <subtract_image_value@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<band_pass_image>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <image_mean@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <subtract_image_value@plt>

LLVM IR (-O0):
define void @band_pass_image(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @image_mean to i32 (float*, i32, i32, ...)*)(float* %8, i32 %9, i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 (float*, i32, i32, i32, ...) bitcast (i32 (...)* @subtract_image_value to i32 (float*, i32, i32, i32, ...)*)(float* %7, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @band_pass_image(float* %0, i32 %1, i32 %2) {
%4 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @image_mean to i32 (float*, i32, i32, ...)*)(float* %0, i32 %1, i32 %2)
%5 = tail call i32 (float*, i32, i32, i32, ...) bitcast (i32 (...)* @subtract_image_value to i32 (float*, i32, i32, i32, ...)*)(float* %0, i32 %4, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit2(void) { printf("second exit handler\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"second exit handler\00"
define void @my_exit2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int spi_transfer_w32(unsigned int *, unsigned int *);
unsigned int small1_poll() {
  unsigned int CMD = 1;
  unsigned int rbuf = 31;
  int ret = spi_transfer_w32(&CMD, &rbuf);
  CMD = 0xffffffff;
  ret = spi_transfer_w32(&CMD, &rbuf);
  if (ret)
    error("Cannot write");
  return rbuf;
}


x86 assembly (clang, -O0):
<small1_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <spi_transfer_w32@plt>
mov    %eax,-0xc(%rbp)
movl   $0xffffffff,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <spi_transfer_w32@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1173 <small1_poll+0x53>
lea    0xe92(%rip),%rdi
call   1030 <error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small1_poll>:
push   %r14
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x1f,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <spi_transfer_w32@plt>
movl   $0xffffffff,0x4(%rsp)
ff
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <spi_transfer_w32@plt>
test   %eax,%eax
je     1169 <small1_poll+0x49>
lea    0xe9c(%rip),%rdi
call   1030 <error@plt>
mov    (%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Cannot write\00"
define i32 @small1_poll() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 31, i32* %2
%4 = call i32 @spi_transfer_w32(i32* %1, i32* %2)
store i32 %4, i32* %3
store i32 -1, i32* %1
%5 = call i32 @spi_transfer_w32(i32* %1, i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"Cannot write\00"
define i32 @small1_poll() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 31, i32* %2
%5 = call i32 @spi_transfer_w32(i32* %1, i32* %2)
store i32 -1, i32* %1
%6 = call i32 @spi_transfer_w32(i32* %1, i32* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %2
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ s2circxy(float, float, float, float, int, float);
void s2circxy_(float *px, float *py, float *pz, float *r, int *nseg,
               float *asp) {
  s2circxy(*px, *py, *pz, *r, *nseg, *asp);
}


x86 assembly (clang, -O0):
<s2circxy_>:
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    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm3
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm4
call   1030 <s2circxy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2circxy_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
movss  (%rcx),%xmm3
mov    (%r8),%edi
movss  (%r9),%xmm4
jmp    1030 <s2circxy@plt>

LLVM IR (-O0):
define void @s2circxy_(float* %0, float* %1, float* %2, float* %3, i32* %4, float* %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32*
%12 = alloca float*
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store i32* %4, i32** %11
store float* %5, float** %12
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = load float*, float** %9
%18 = load float, float* %17
%19 = load float*, float** %10
%20 = load float, float* %19
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
%23 = load float*, float** %12
%24 = load float, float* %23
%25 = call i32 @s2circxy(float %14, float %16, float %18, float %20, i32 %22, float %24)
ret void
}

LLVM IR (-O2):
define void @s2circxy_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, i32* nocapture %4, float* nocapture %5) {
%7 = load float, float* %0
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load i32, i32* %4
%12 = load float, float* %5
%13 = tail call i32 @s2circxy(float %7, float %8, float %9, float %10, i32 %11, float %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rom_unload();
void dmg_unload_rom() { rom_unload(); }


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

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

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

LLVM IR (-O2):
define void @dmg_unload_rom() {
%1 = tail call i32 (...) @rom_unload()
ret void
}
/* Variables and functions */
void *BLNK_LookupLabelOS(char *);
void *BIPRO_LookupLabelOS(char *name) { return (BLNK_LookupLabelOS(name)); }


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

x86 assembly (clang, -O2):
<BIPRO_LookupLabelOS>:
jmp    1030 <BLNK_LookupLabelOS@plt>

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

LLVM IR (-O2):
define i8* @BIPRO_LookupLabelOS(i8* %0) {
%2 = tail call i8* @BLNK_LookupLabelOS(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ bar(double);
void foo(double *p, double a, int n) {
  do
    bar(*--p + a);
  while (n--);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  -0x8(%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <bar@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jne    1124 <foo+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r15d
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%r14
not    %r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%r14,%rbx,8),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <bar@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1130 <foo+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @foo(double* %0, double %1, i32 %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %4
store double %1, double* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %14, %3
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i32 -1
store double* %9, double** %4
%10 = load double, double* %9
%11 = load double, double* %5
%12 = fadd double %10, %11
%13 = call i32 @bar(double %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %6
%16 = add nsw i32 %15, -1
store i32 %16, i32* %6
%17 = icmp ne i32 %15, 0
br i1 %17, label %7, label %18
18: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @foo(double* nocapture %0, double %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi double* [ %0, %3 ], [ %7, %4 ]
%6 = phi i32 [ %2, %3 ], [ %11, %4 ]
%7 = getelementptr inbounds double, double* %5, i64 -1
%8 = load double, double* %7
%9 = fadd double %8, %1
%10 = tail call i32 @bar(double %9)
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %6, 0
br i1 %12, label %13, label %4
13: ; preds = %4
ret void
}
/* Type definitions */
struct ivals_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assemble_write_mmio(struct ivals_context *, int, int,
                                       unsigned int);
void shm_control_word(struct ivals_context *ctx, unsigned int routing,
                      unsigned int offset) {
  unsigned int control;
  control = (routing & 0xFFFF);
  control <<= 16;
  control |= (offset & 0xFFFF);
  assemble_write_mmio(ctx, 0x160, 4, control);
}


x86 assembly (clang, -O0):
<shm_control_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x160,%esi
mov    $0x4,%edx
call   1030 <assemble_write_mmio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_control_word>:
shl    $0x10,%esi
movzwl %dx,%ecx
or     %esi,%ecx
mov    $0x160,%esi
mov    $0x4,%edx
jmp    1030 <assemble_write_mmio@plt>

LLVM IR (-O0):
%struct.ivals_context = type { i32 }
define void @shm_control_word(%struct.ivals_context* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ivals_context*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.ivals_context* %0, %struct.ivals_context** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = and i32 %8, 65535
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = shl i32 %10, 16
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = and i32 %12, 65535
%14 = load i32, i32* %7
%15 = or i32 %14, %13
store i32 %15, i32* %7
%16 = load %struct.ivals_context*, %struct.ivals_context** %4
%17 = load i32, i32* %7
%18 = call i32 @assemble_write_mmio(%struct.ivals_context* %16, i32 352, i32 4, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.ivals_context = type { i32 }
define void @shm_control_word(%struct.ivals_context* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 16
%5 = and i32 %2, 65535
%6 = or i32 %5, %4
%7 = tail call i32 @assemble_write_mmio(%struct.ivals_context* %0, i32 352, i32 4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<my_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @my_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printstr2(void *handle, const char str[]) { printf("intpnt: %s", str); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"intpnt: %s\00"
define void @printstr2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"intpnt: %s\00"
define void @printstr2(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int buserror(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char **argv) {
  char busdata[6];
  int x;
  strcpy(busdata, "Xyes\n");
  x = buserror(busdata);
  write(1, &x, 4);
  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)
lea    -0x16(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x16(%rbp),%rdi
call   1050 <buserror@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x1,%edi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <buserror@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Xyes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%11 = call i32 @buserror(i8* %10)
store i32 %11, i32* %7
%12 = call i32 @write(i32 1, i32* %7, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Xyes\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @buserror(i8* %5)
store i32 %8, i32* %4
%9 = call i32 @write(i32 1, i32* %4, i32 4)
ret i32 0
}
/* Variables and functions */
float cos(float);
int /*<<< orphan*/ sin(float);
int /*<<< orphan*/ vcopy(float *, float *);
int /*<<< orphan*/ vnormal(float *);
int /*<<< orphan*/ vscale(float *, int /*<<< orphan*/);
void axis_to_quat(float a[3], float phi, float q[4]) {
  vnormal(a);
  vcopy(a, q);
  vscale(q, sin(phi / 2.0f));
  q[3] = cos(phi / 2.0f);
}


x86 assembly (clang, -O0):
<axis_to_quat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vnormal@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <vcopy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe70(%rip),%xmm1
divss  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1060 <vscale@plt>
movss  -0xc(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
divss  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<axis_to_quat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movss  %xmm0,0x4(%rsp)
mov    %rdi,%rbx
call   1030 <vnormal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <vcopy@plt>
movss  0x4(%rsp),%xmm0
mulss  0xe82(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1040 <sin@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <vscale@plt>
movss  0x4(%rsp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,0xc(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @axis_to_quat(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = call i32 @vnormal(float* %7)
%9 = load float*, float** %4
%10 = load float*, float** %6
%11 = call i32 @vcopy(float* %9, float* %10)
%12 = load float*, float** %6
%13 = load float, float* %5
%14 = fdiv float %13, 2.000000e+00
%15 = call i32 @sin(float %14)
%16 = call i32 @vscale(float* %12, i32 %15)
%17 = load float, float* %5
%18 = fdiv float %17, 2.000000e+00
%19 = call float @cos(float %18)
%20 = load float*, float** %6
%21 = getelementptr inbounds float, float* %20, i64 3
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @axis_to_quat(float* %0, float %1, float* %2) {
%4 = tail call i32 @vnormal(float* %0)
%5 = tail call i32 @vcopy(float* %0, float* %2)
%6 = fmul float %1, 5.000000e-01
%7 = tail call i32 @sin(float %6)
%8 = tail call i32 @vscale(float* %2, i32 %7)
%9 = tail call float @cos(float %6)
%10 = getelementptr inbounds float, float* %2, i64 3
store float %9, float* %10
ret void
}
short keventpending(int fd, short events) { return 0; }


x86 assembly (clang, -O0):
<keventpending>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
xor    %eax,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @keventpending(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
ret i16 0
}

LLVM IR (-O2):
define signext i16 @keventpending(i32 %0, i16 signext %1) {
ret i16 0
}
char *strcpy(char *s1, const char *s2) {
  char *res = s1;
  while ((*s1++ = *s2++))
    ;
  return (res);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
unsigned int vavgu2(unsigned int a, unsigned int b) {
  unsigned int r, c;
  c = a ^ b;
  r = a | b;
  c = c & 0xfffefffe;
  c = c >> 1;
  r = r - c;
  return r;
}


x86 assembly (clang, -O0):
<vavgu2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfffefffe,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vavgu2>:
mov    %esi,%eax
mov    %esi,%ecx
xor    %edi,%ecx
or     %edi,%eax
shr    %ecx
and    $0x7fff7fff,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vavgu2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %13, -65538
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = lshr i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @vavgu2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = or i32 %1, %0
%5 = lshr i32 %3, 1
%6 = and i32 %5, 2147450879
%7 = sub i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int reverse(int);
void reverse_original(int *no) {
  int num = *no;
  int rev = reverse(num);
  *no = rev;
}


x86 assembly (clang, -O0):
<reverse_original>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_original>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <reverse@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @reverse_original(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @reverse(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int parityb(int);
int parity(int x) {
  x ^= (x >> 16);
  x ^= (x >> 8);
  return parityb(x);
}


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

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
xor    %eax,%edi
jmp    1030 <parityb@plt>

LLVM IR (-O0):
define i32 @parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @parityb(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 8
%5 = xor i32 %4, %3
%6 = tail call i32 @parityb(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_alarm(int signal) {
  printf("alarm is here~~~~~~~~~");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_alarm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"alarm is here~~~~~~~~~\00"
define void @sig_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"alarm is here~~~~~~~~~\00"
define void @sig_alarm(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int gdsum(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gdsum() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s [-468dEn] [-e char] [-l username] [-p port] "
                "[username@]host\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"Usage: %s [-468dEn] [-e char] [-l username] [-p port] [username@]host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"Usage: %s [-468dEn] [-e char] [-l username] [-p port] [username@]host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void config_ddr_data_x_0(void) {
  *(uint32_t *)(0x44E120C8) = (uint32_t)(0x00000038);
  *(uint32_t *)(0x44E120DC) = (uint32_t)(0x00000044);
  *(uint32_t *)(0x44E120F0) = (uint32_t)(0x00000000);
  *(uint32_t *)(0x44E120FC) = (uint32_t)(0x00000000);
  *(uint32_t *)(0x44E12108) = (uint32_t)(0x00000094);
  *(uint32_t *)(0x44E12120) = (uint32_t)(0x0000007D);
  *(uint32_t *)(0x44E12134) = (uint32_t)(0x00000000);
  *(uint32_t *)(0x44E12138) = (uint32_t)(0x00000000);
}


x86 assembly (clang, -O0):
<config_ddr_data_x_0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e120c8,%eax
movq   $0x38,(%rax)
mov    $0x44e120dc,%eax
movq   $0x44,(%rax)
mov    $0x44e120f0,%eax
movq   $0x0,(%rax)
mov    $0x44e120fc,%eax
movq   $0x0,(%rax)
mov    $0x44e12108,%eax
movq   $0x94,(%rax)
mov    $0x44e12120,%eax
movq   $0x7d,(%rax)
mov    $0x44e12134,%eax
movq   $0x0,(%rax)
mov    $0x44e12138,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_ddr_data_x_0>:
movq   $0x38,0x44e120c8
movq   $0x44,0x44e120dc
movq   $0x0,0x44e120f0
movq   $0x0,0x44e120fc
movq   $0x94,0x44e12108
movq   $0x7d,0x44e12120
movq   $0x0,0x44e12134
movq   $0x0,0x44e12138
ret

LLVM IR (-O0):
define void @config_ddr_data_x_0() {
store i64 56, i64* inttoptr (i64 1155604680 to i64*)
store i64 68, i64* inttoptr (i64 1155604700 to i64*)
store i64 0, i64* inttoptr (i64 1155604720 to i64*)
store i64 0, i64* inttoptr (i64 1155604732 to i64*)
store i64 148, i64* inttoptr (i64 1155604744 to i64*)
store i64 125, i64* inttoptr (i64 1155604768 to i64*)
store i64 0, i64* inttoptr (i64 1155604788 to i64*)
store i64 0, i64* inttoptr (i64 1155604792 to i64*)
ret void
}

LLVM IR (-O2):
define void @config_ddr_data_x_0() {
store i64 56, i64* inttoptr (i64 1155604680 to i64*)
store i64 68, i64* inttoptr (i64 1155604700 to i64*)
store i64 0, i64* inttoptr (i64 1155604720 to i64*)
store i64 0, i64* inttoptr (i64 1155604732 to i64*)
store i64 148, i64* inttoptr (i64 1155604744 to i64*)
store i64 125, i64* inttoptr (i64 1155604768 to i64*)
store i64 0, i64* inttoptr (i64 1155604788 to i64*)
store i64 0, i64* inttoptr (i64 1155604792 to i64*)
ret void
}
void swap(int *pointer1, int *pointer2) {
  int temp = *pointer1;
  *pointer1 = *pointer2;
  *pointer2 = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
BOOST_AUTO_TEST_CASE(arccos) { TESTCASE1(arccos, 1, 0); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

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

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0)
ret i32 undef
}
/* Variables and functions */
int japi_panel(int);
int j_panel(int arg0) { return (japi_panel(arg0)); }


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

x86 assembly (clang, -O2):
<j_panel>:
jmp    1030 <japi_panel@plt>

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

LLVM IR (-O2):
define i32 @j_panel(i32 %0) {
%2 = tail call i32 @japi_panel(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __ctors();
void __init() {
  static int initialized = 0;
  if (!initialized) {
    initialized = 1;
    __ctors();
  }
}


x86 assembly (clang, -O0):
<__init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1132 <__init+0x22>
movl   $0x1,0x2f01(%rip)
mov    $0x0,%al
call   1030 <__ctors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__init>:
cmpb   $0x0,0x2f15(%rip)
je     111a <__init+0xa>
ret
movb   $0x1,0x2f0b(%rip)
xor    %eax,%eax
jmp    1030 <__ctors@plt>

LLVM IR (-O0):
@__init.initialized = internal global i32 0
define void @__init() {
%1 = load i32, i32* @__init.initialized
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
store i32 1, i32* @__init.initialized
%4 = call i32 (...) @__ctors()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@__init.initialized = internal unnamed_addr global i1 false
define void @__init() {
%1 = load i1, i1* @__init.initialized
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @__init.initialized
%3 = tail call i32 (...) @__ctors()
br label %4
4: ; preds = %2, %0
ret void
}
unsigned long fibonacci(unsigned long n) {
  if (n <= 1)
    return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
ja     1134 <fibonacci+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <fibonacci+0x50>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
cmp    $0x2,%rdi
jb     1136 <fibonacci+0x26>
lea    -0x1(%rbx),%rdi
call   1030 <fibonacci@plt>
add    $0xfffffffffffffffe,%rbx
add    %rax,%r14
cmp    $0x1,%rbx
ja     1120 <fibonacci+0x10>
add    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add i64 %4, -1
%7 = tail call i64 @fibonacci(i64 %6)
%8 = add i64 %4, -2
%9 = add i64 %7, %5
%10 = icmp ult i64 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
%13 = phi i64 [ %0, %1 ], [ %8, %3 ]
%14 = add i64 %13, %12
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ calc_primes(int);
void sequential() {
  int i;
  for (i = 0; i < 100000; i++)
    calc_primes(1000);
}


x86 assembly (clang, -O0):
<sequential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    1144 <sequential+0x34>
mov    $0x3e8,%edi
call   1030 <calc_primes@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <sequential+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequential>:
push   %rbx
mov    $0x186a0,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <calc_primes@plt>
add    $0xffffffff,%ebx
jne    1120 <sequential+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @sequential() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100000
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @calc_primes(i32 1000)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @sequential() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @calc_primes(i32 1000)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
char *roadmap_config_skip_until(char *p, char c) {
  while (*p != '\n' && *p != c && *p != 0)
    p++;
  return p;
}


x86 assembly (clang, -O0):
<roadmap_config_skip_until>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     114b <roadmap_config_skip_until+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     114b <roadmap_config_skip_until+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    115b <roadmap_config_skip_until+0x5b>
jmp    116c <roadmap_config_skip_until+0x6c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <roadmap_config_skip_until+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_config_skip_until>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %sil,%cl
je     1126 <roadmap_config_skip_until+0x26>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1126 <roadmap_config_skip_until+0x26>
cmp    $0xa,%cl
je     1126 <roadmap_config_skip_until+0x26>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <roadmap_config_skip_until+0x10>
ret

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

LLVM IR (-O2):
define i8* @roadmap_config_skip_until(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = freeze i8 %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %14, label %6
6: ; preds = %2, %9
%7 = phi i8 [ %12, %9 ], [ %4, %2 ]
%8 = phi i8* [ %10, %9 ], [ %0, %2 ]
switch i8 %7, label %9 [
i8 10, label %14
i8 0, label %14
]
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = freeze i8 %11
%13 = icmp eq i8 %12, %1
br i1 %13, label %14, label %6
14: ; preds = %9, %6, %6, %2
%15 = phi i8* [ %0, %2 ], [ %8, %6 ], [ %8, %6 ], [ %10, %9 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ assert(double *);
scalar_t__ malloc(int);
double *dvector(int minx, int maxx) {
  double *m;
  m = (double *)malloc((maxx - minx + 1) * sizeof(double));
  assert(m);
  m -= minx;
  return m;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x8(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to double*
store double* %14, double** %5
%15 = load double*, double** %5
%16 = call i32 @assert(double* %15)
%17 = load i32, i32* %3
%18 = load double*, double** %5
%19 = sext i32 %17 to i64
%20 = sub i64 0, %19
%21 = getelementptr inbounds double, double* %18, i64 %20
store double* %21, double** %5
%22 = load double*, double** %5
ret double* %22
}

LLVM IR (-O2):
define double* @dvector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 3
%5 = add i32 %4, 8
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to double*
%8 = tail call i32 @assert(double* %7)
%9 = sext i32 %0 to i64
%10 = sub nsw i64 0, %9
%11 = getelementptr inbounds double, double* %7, i64 %10
ret double* %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *calloc(int, size_t);
void *xcalloc(size_t bytes) {
  void *ret = calloc(1, bytes);
  assert(ret);
  return ret;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
int e_map(unsigned int, void **, unsigned int *);
int /*<<< orphan*/ e_unmap(char *);
int e_write(unsigned addr, unsigned data) {
  int ret;
  unsigned offset;
  char *ptr;
  ret = e_map(addr, (void **)&ptr, &offset);
  *((unsigned *)(ptr + offset)) = data;
  e_unmap(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<e_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <e_map@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1040 <e_unmap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_write>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <e_map@plt>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%eax
mov    %ebx,(%rdi,%rax,1)
call   1040 <e_unmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @e_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @e_map(i32 %0, i8** %4, i32* %3)
%8 = load i8*, i8** %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
store i32 %1, i32* %12
%13 = call i32 @e_unmap(i8* %8)
ret i32 0
}
int csz_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                  struct nlmsghdr *n) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.qdisc_util = type opaque
%struct.nlmsghdr = type opaque
define i32 @csz_parse_opt(%struct.qdisc_util* %0, i32 %1, i8** %2, %struct.nlmsghdr* %3) {
%5 = alloca %struct.qdisc_util*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca %struct.nlmsghdr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store %struct.nlmsghdr* %3, %struct.nlmsghdr** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.qdisc_util = type opaque
%struct.nlmsghdr = type opaque
define i32 @csz_parse_opt(%struct.qdisc_util* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, %struct.nlmsghdr* nocapture readnone %3) {
ret i32 -1
}