xunge/DecIR huggingface dataset:
/* Variables and functions */
float powf(float, float);
float num_pow(float a, float b) { return powf(a, b); }


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

x86 assembly (clang, -O2):
<num_pow>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @num_pow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @num_pow(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
int strcmp(const char *str1, const char *str2) {
  while (*str1 && (*str1 == *str2))
    str1++, str2++;
  return *(const unsigned char *)str1 - *(const unsigned char *)str2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
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 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
int /*<<< orphan*/ stack();
void sbcSp16(void) { sbc16(readmemw65816(stack())); }


x86 assembly (clang, -O0):
<sbcSp16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <stack@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcSp16>:
push   %rax
xor    %eax,%eax
call   1040 <stack@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcSp16() {
%1 = call i32 (...) @stack()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcSp16() {
%1 = tail call i32 (...) @stack()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
void test56_On4_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test56_On4_targetInit__I() {
ret void
}
int SetOpt(char *s, char **opt, char **val) {
  *opt = s;
  *val = 0;
  while (*s) {
    if (*s == '=') {
      *(s++) = 0;
      *val = s;
      return 1;
    }
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<SetOpt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117d <SetOpt+0x7d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    116c <SetOpt+0x6c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1184 <SetOpt+0x84>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <SetOpt+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetOpt>:
mov    %rdi,(%rsi)
movq   $0x0,(%rdx)
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdi
movzbl -0x1(%rdi),%eax
test   %al,%al
je     112d <SetOpt+0x2d>
cmp    $0x3d,%al
jne    1110 <SetOpt+0x10>
movb   $0x0,-0x1(%rdi)
mov    %rdi,(%rdx)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SetOpt(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
store i8* %0, i8** %1
store i8* null, i8** %2
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %10, %9 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %11
i8 61, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %5
store i8* %8, i8** %2
br label %11
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
11: ; preds = %4, %7
%12 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
long long rshft_ll(long long *, long long *);
long long intr_wrap_565(long long p1, long long p2) {
  return rshft_ll(&p1, &p2);
}


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

x86 assembly (clang, -O2):
<intr_wrap_565>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <rshft_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_565(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @rshft_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_565(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @rshft_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M209_f(char *s) {
  debug("M209_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M209_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M209_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M209_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M209_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M209_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M209_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int dlclose(void *handle) {
  (void)handle;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct crk5_cfg_mem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct crk5_cfg_mem *);
void crk5_cfg_mem_delete(struct crk5_cfg_mem *mem) { free(mem); }


x86 assembly (clang, -O0):
<crk5_cfg_mem_delete>:
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):
<crk5_cfg_mem_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.crk5_cfg_mem = type { i32 }
define void @crk5_cfg_mem_delete(%struct.crk5_cfg_mem* %0) {
%2 = alloca %struct.crk5_cfg_mem*
store %struct.crk5_cfg_mem* %0, %struct.crk5_cfg_mem** %2
%3 = load %struct.crk5_cfg_mem*, %struct.crk5_cfg_mem** %2
%4 = call i32 @free(%struct.crk5_cfg_mem* %3)
ret void
}

LLVM IR (-O2):
%struct.crk5_cfg_mem = type { i32 }
define void @crk5_cfg_mem_delete(%struct.crk5_cfg_mem* nocapture %0) {
%2 = tail call i32 @free(%struct.crk5_cfg_mem* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double const);
int /*<<< orphan*/ stdout;
void print_result(const double pai) {
  fprintf(stdout, "PI(pay) is\t = %.10f\n", pai);
}


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"PI(pay) is\09 = %.10f\0A\00"
define void @print_result(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stdout
%4 = load double, double* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"PI(pay) is\09 = %.10f\0A\00"
define void @print_result(double %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
void *vmalloc(unsigned long size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @vmalloc(i64 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ update_rect(int, int, int, int, int);
void update_text(int sid, int x, int y, int len) {
  update_rect(sid, x, y, len * (8), (16));
}


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

x86 assembly (clang, -O2):
<update_text>:
shl    $0x3,%ecx
mov    $0x10,%r8d
jmp    1030 <update_rect@plt>

LLVM IR (-O0):
define void @update_text(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul nsw i32 %12, 8
%14 = call i32 @update_rect(i32 %9, i32 %10, i32 %11, i32 %13, i32 16)
ret void
}

LLVM IR (-O2):
define void @update_text(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %3, 3
%6 = tail call i32 @update_rect(i32 %0, i32 %1, i32 %2, i32 %5, i32 16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_init_gen_rand(int /*<<< orphan*/);
void init_gen_rand(uint32_t seed) { dsfmt_gv_init_gen_rand(seed); }


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

x86 assembly (clang, -O2):
<init_gen_rand>:
jmp    1030 <dsfmt_gv_init_gen_rand@plt>

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

LLVM IR (-O2):
define void @init_gen_rand(i32 %0) {
%2 = tail call i32 @dsfmt_gv_init_gen_rand(i32 %0)
ret void
}
float Q_rsqrt(float in) {
  int i;
  float x, y;
  x = in * 0.5f;
  i = *(int *)&in;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (1.5f - (x * y * y));
  return y;
}


x86 assembly (clang, -O0):
<Q_rsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_rsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Q_rsqrt(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = fmul float %6, 5.000000e-01
store float %7, float* %4
%8 = bitcast float* %2 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 1
%12 = sub nsw i32 1597463007, %11
store i32 %12, i32* %3
%13 = bitcast i32* %3 to float*
%14 = load float, float* %13
store float %14, float* %5
%15 = load float, float* %5
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load float, float* %5
%20 = fneg float %18
%21 = call float @llvm.fmuladd.f32(float %20, float %19, float 1.500000e+00)
%22 = fmul float %15, %21
store float %22, float* %5
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
define float @Q_rsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ tan(double);
double isometric_latitude_fast(double phi) {
  return log(tan((3.14159265358979323846 / 4) + phi / 2.0));
}


x86 assembly (clang, -O0):
<isometric_latitude_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
call   1040 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isometric_latitude_fast>:
push   %rax
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @isometric_latitude_fast(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
%5 = fadd double 0x3FE921FB54442D18, %4
%6 = call i32 @tan(double %5)
%7 = call double @log(i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @isometric_latitude_fast(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fadd double %2, 0x3FE921FB54442D18
%4 = tail call i32 @tan(double %3)
%5 = tail call double @log(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soa(int *, int);
int main() {
  int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  printf("%d\n", soa(array, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <soa@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <soa@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @soa(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @soa(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int multiply(int num1, int num2) { return num1 * num2; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @multiply(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __aeabi_memset_impl(void *, size_t, int /*<<< orphan*/);
void __attribute__((weak)) __aeabi_memclr_impl2(void *dest, size_t n) {
  __aeabi_memset_impl(dest, n, 0);
}


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

x86 assembly (clang, -O2):
<__aeabi_memclr_impl2>:
xor    %edx,%edx
jmp    1030 <__aeabi_memset_impl@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memclr_impl2(i8* %0, i64 %1) {
%3 = tail call i32 @__aeabi_memset_impl(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
int inb(unsigned short);
int serial_is_transmit_empty(unsigned short com) {
  return (inb((com + 5)) & 0x20);
}


x86 assembly (clang, -O0):
<serial_is_transmit_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x5,%eax
movzwl %ax,%edi
call   1030 <inb@plt>
and    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_is_transmit_empty>:
push   %rax
add    $0x5,%edi
movzwl %di,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_is_transmit_empty(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 5
%6 = trunc i32 %5 to i16
%7 = call i32 @inb(i16 zeroext %6)
%8 = and i32 %7, 32
ret i32 %8
}

LLVM IR (-O2):
define i32 @serial_is_transmit_empty(i16 zeroext %0) {
%2 = add i16 %0, 5
%3 = tail call i32 @inb(i16 zeroext %2)
%4 = and i32 %3, 32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fn1();
int main() {
  fn1();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fn1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fn1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fn1()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn1()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int rand();
void GenerateArray(int array[], int size) {
  for (int i = size - 1; i >= 0; --i) {
    array[i] = rand();
  }
}


x86 assembly (clang, -O0):
<GenerateArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <GenerateArray+0x44>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <GenerateArray+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerateArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <GenerateArray+0x39>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%r15d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%r15,4)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <GenerateArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @GenerateArray(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* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @GenerateArray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ %5, %4 ], [ %9, %7 ]
%9 = add nsw i64 %8, -1
%10 = tail call i32 (...) @rand()
%11 = and i64 %9, 4294967295
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %10, i32* %12
%13 = icmp ugt i64 %8, 1
br i1 %13, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_term_h(int sno) {
  printf("Bye..It was fun hogging..!");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_term_h>:
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_term_h>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Bye..It was fun hogging..!\00"
define void @sig_term_h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Bye..It was fun hogging..!\00"
define void @sig_term_h(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int strlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void I_NoAppServicesLobbyUpdateName(void) {}


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

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

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

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

/* Variables and functions */
size_t badvpn_djb2_hash(const uint8_t *str) {
  size_t hash = 5381;
  int c;
  while (c = *str++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<badvpn_djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1149 <badvpn_djb2_hash+0x49>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <badvpn_djb2_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_djb2_hash>:
mov    (%rdi),%ecx
test   %ecx,%ecx
je     112b <badvpn_djb2_hash+0x2b>
add    $0x4,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movslq %ecx,%rax
add    %rdx,%rax
mov    (%rdi),%ecx
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <badvpn_djb2_hash+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @badvpn_djb2_hash(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i32
store i32* %0, i32** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %10, %1
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = load i32, i32* %6
store i32 %8, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i64, i64* %3
%12 = shl i64 %11, 5
%13 = load i64, i64* %3
%14 = add i64 %12, %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
store i64 %17, i64* %3
br label %5
18: ; preds = %5
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @badvpn_djb2_hash(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i32 %5 to i64
%11 = add i64 %9, %10
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int astrlen(char *);
int count_instances(char *, char);
int astrlen_expand(char *str, char what, int times) {
  int len = 0;
  len = astrlen(str);
  len += (count_instances(str, what) * times);
  return len;
}


x86 assembly (clang, -O0):
<astrlen_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <astrlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <count_instances@plt>
imul   -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrlen_expand>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <astrlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <count_instances@plt>
imul   %r14d,%eax
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @astrlen_expand(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8*, i8** %4
%9 = call i32 @astrlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i8, i8* %5
%12 = call i32 @count_instances(i8* %10, i8 signext %11)
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %7
%16 = add nsw i32 %15, %14
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @astrlen_expand(i8* %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @astrlen(i8* %0)
%5 = tail call i32 @count_instances(i8* %0, i8 signext %1)
%6 = mul nsw i32 %5, %2
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void foo_init() { printf("foo_init\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"foo_init\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo_init, i8* null }]
define void @foo_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo_init, i8* null }]
@str = [9 x i8] c"foo_init\00"
define void @foo_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MP_sleep(long);
void MP_wait(void) {
  long PV_time = 1L;
  MP_sleep(PV_time);
}


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

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

LLVM IR (-O0):
define void @MP_wait() {
%1 = alloca i64
store i64 1, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @MP_sleep(i64 %2)
ret void
}

LLVM IR (-O2):
define void @MP_wait() {
%1 = tail call i32 @MP_sleep(i64 1)
ret void
}
void circfs_(x, y, radius) short *x, *y, *radius;
{ circfs(*x, *y, *radius); }


x86 assembly (clang, -O0):
<circfs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edi
mov    -0x10(%rbp),%rax
movswl (%rax),%esi
mov    -0x18(%rbp),%rax
movswl (%rax),%edx
mov    $0x0,%al
call   1030 <circfs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circfs_>:
movswl (%rdi),%edi
movswl (%rsi),%esi
movswl (%rdx),%edx
xor    %eax,%eax
jmp    1030 <circfs@plt>

LLVM IR (-O0):
define void @circfs_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = load i16*, i16** %5
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = load i16*, i16** %6
%14 = load i16, i16* %13
%15 = sext i16 %14 to i32
%16 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @circfs to i32 (i32, i32, i32, ...)*)(i32 %9, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
define void @circfs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sext i16 %4 to i32
%6 = load i16, i16* %1
%7 = sext i16 %6 to i32
%8 = load i16, i16* %2
%9 = sext i16 %8 to i32
%10 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @circfs to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %7, i32 %9)
ret void
}
double tavan(double p, int n) {
  int i;
  double pow = 1.0;
  for (i = 1; i <= n; i++)
    pow *= p;
  return pow;
}


x86 assembly (clang, -O0):
<tavan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1149 <tavan+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <tavan+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tavan>:
test   %edi,%edi
jle    111b <tavan+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <tavan+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <tavan+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <tavan+0x30>
test   %eax,%eax
je     1169 <tavan+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <tavan+0x60>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @tavan(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %6
store i32 1, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %6
%14 = fmul double %13, %12
store double %14, double* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
define double @tavan(double %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
unsigned int set_semaphore(volatile unsigned int *p, unsigned int newval) {
  unsigned int semval = newval;
  __asm__ __volatile__("xchgl %2, %0\n" : "=r"(semval) : "0"(semval), "m"(*p));
  return semval;
}


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

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

LLVM IR (-O0):
define i32 @set_semaphore(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* %4
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32*, i32** %3
%9 = call i32 asm sideeffect "xchgl $2, $0\0A", "=r,0,*m,~{dirflag},~{fpsr},~{flags}"(i32 %7, i32* elementtype(i32) %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_semaphore(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "xchgl $2, $0\0A", "=r,0,*m,~{dirflag},~{fpsr},~{flags}"(i32 %1, i32* elementtype(i32) %0)
ret i32 %3
}
void EXTI4_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTI4_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello World - My name is alagu !!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [35 x i8] c"Hello World - My name is alagu !!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Hello World - My name is alagu !!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_46int64_lowword_reg(long long val) {
  return ((val) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x46,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46int64_lowword_reg>:
test   $0x46,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 70
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
  int sum_squares = 0;
  int square_sum = 0;
  for (i = 1; i <= 100; i++) {
    sum_squares += i * i;
    square_sum += i;
  }
  square_sum *= square_sum;
  printf("The difference is %d\n", (square_sum - sum_squares));
  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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1169 <main+0x59>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
sub    -0x18(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"The difference is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 1, i32* %6
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %6
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = add nsw i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %8
%20 = add nsw i32 %19, %18
store i32 %20, i32* %8
br label %21
21: ; preds = %12
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %9
24: ; preds = %9
%25 = load i32, i32* %8
%26 = load i32, i32* %8
%27 = mul nsw i32 %26, %25
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %7
%30 = sub nsw i32 %28, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The difference is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
int dice_roll(int, int);
int /*<<< orphan*/ printf(char *);
page22() {
  printf("You are searching Goods Distribution Hall 7-beta.\n");
  switch (dice_roll(1, 4)) {
  case 1:
    return 18;
  case 2:
    return 15;
  case 3:
    return 18;
  case 4:
    return 29;
  }
}


x86 assembly (clang, -O0):
<page22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <dice_roll@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1194 <page22+0x74>
mov    -0x10(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x12,-0x4(%rbp)
jmp    1194 <page22+0x74>
movl   $0xf,-0x4(%rbp)
jmp    1194 <page22+0x74>
movl   $0x12,-0x4(%rbp)
jmp    1194 <page22+0x74>
movl   $0x1d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page22>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <dice_roll@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
lea    (%rcx,%rcx,2),%ecx
add    $0xf,%ecx
cmp    $0x4,%eax
mov    $0x1d,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"You are searching Goods Distribution Hall 7-beta.\0A\00"
define i32 @page22() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @dice_roll(i32 1, i32 4)
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
]
4: ; preds = %0
store i32 18, i32* %1
br label %8
5: ; preds = %0
store i32 15, i32* %1
br label %8
6: ; preds = %0
store i32 18, i32* %1
br label %8
7: ; preds = %0
store i32 29, i32* %1
br label %8
8: ; preds = %4, %5, %6, %7, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [50 x i8] c"You are searching Goods Distribution Hall 7-beta.\00"
define i32 @page22() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @dice_roll(i32 1, i32 4)
%3 = icmp eq i32 %2, 2
%4 = select i1 %3, i32 15, i32 18
%5 = icmp eq i32 %2, 4
%6 = select i1 %5, i32 29, i32 %4
ret i32 %6
}