xunge/DecIR huggingface dataset:
int sb_any_quota_active(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_any_quota_active(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float log10f(int);
float log2f(float x) { return log10f(x) / log10f(2); }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%edi
call   1030 <log10f@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <log10f@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
push   %rax
cvttss2si %xmm0,%edi
call   1030 <log10f@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <log10f@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = call float @log10f(i32 %4)
%6 = call float @log10f(i32 2)
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call float @log10f(i32 %2)
%4 = tail call float @log10f(i32 2)
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ pow(double, double);
int /*<<< orphan*/ printf(char *);
int roots(int a, int b) {
  if (a < 0) {
    printf("Roots domain invaded. Corn dumped.\n");
    exit(1);
  }
  return (int)pow((double)a, 1.0 / (double)b);
}


x86 assembly (clang, -O0):
<roots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115e <roots+0x2e>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
movsd  0xe90(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roots>:
push   %rax
test   %edi,%edi
js     114f <roots+0x1f>
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm2
movsd  0xebb(%rip),%xmm1
divsd  %xmm2,%xmm1
pop    %rax
jmp    1040 <pow@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Roots domain invaded. Corn dumped.\0A\00"
define i32 @roots(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = call i64 @pow(double %12, double %15)
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@str = [35 x i8] c"Roots domain invaded. Corn dumped.\00"
define i32 @roots(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = sitofp i32 %0 to double
%9 = sitofp i32 %1 to double
%10 = fdiv double 1.000000e+00, %9
%11 = tail call i64 @pow(double %8, double %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_master_dma(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (5 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_master_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x500,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_master_dma>:
mov    %edi,%ecx
mov    %rdx,%rdi
mov    $0x500,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_master_dma(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 1280, i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void my_strlcpy(char *dst, const char *src, size_t len) {
  strncpy(dst, src, len);
  dst[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<my_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @my_strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @my_strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
int platform_wifi_power_on(void) {
  int ret = 0;
  return ret;
}


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

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

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

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

/* Variables and functions */
struct node *createlist();
int /*<<< orphan*/ printlist(struct node *);
struct node *replicate(struct node *);
int main() {
  struct node *headnew = NULL;
  struct node *head = createlist();
  printlist(head);
  headnew = replicate(head);
  printlist(headnew);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <createlist@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <printlist@plt>
mov    -0x18(%rbp),%rdi
call   1030 <replicate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <printlist@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <createlist@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <printlist@plt>
mov    %rbx,%rdi
call   1030 <replicate@plt>
mov    %rax,%rdi
call   1050 <printlist@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%4 = call %struct.node* (...) @createlist()
store %struct.node* %4, %struct.node** %3
%5 = load %struct.node*, %struct.node** %3
%6 = call i32 @printlist(%struct.node* %5)
%7 = load %struct.node*, %struct.node** %3
%8 = call %struct.node* @replicate(%struct.node* %7)
store %struct.node* %8, %struct.node** %2
%9 = load %struct.node*, %struct.node** %2
%10 = call i32 @printlist(%struct.node* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* (...) @createlist()
%2 = tail call i32 @printlist(%struct.node* %1)
%3 = tail call %struct.node* @replicate(%struct.node* %1)
%4 = tail call i32 @printlist(%struct.node* %3)
ret i32 0
}
/* Variables and functions */
int eval_intexpr(int /*<<< orphan*/);
int /*<<< orphan*/ read_conditional_expr();
int read_intexpr() { return eval_intexpr(read_conditional_expr()); }


x86 assembly (clang, -O0):
<read_intexpr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <read_conditional_expr@plt>
mov    %eax,%edi
call   1030 <eval_intexpr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_intexpr>:
push   %rax
xor    %eax,%eax
call   1040 <read_conditional_expr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <eval_intexpr@plt>

LLVM IR (-O0):
define i32 @read_intexpr() {
%1 = call i32 (...) @read_conditional_expr()
%2 = call i32 @eval_intexpr(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @read_intexpr() {
%1 = tail call i32 (...) @read_conditional_expr()
%2 = tail call i32 @eval_intexpr(i32 %1)
ret i32 %2
}
int main(void) {
  int x = 10;
  if (x) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
jmp    1121 <main+0x21>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_fifo();
int main(int argc, char *argv[]) {
  write_fifo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @write_fifo()
ret i32 0
}
void scale3d(float *out, const float *a, float scalar) {
  out[0] = a[0] * scalar;
  out[1] = a[1] * scalar;
  out[2] = a[2] * scalar;
}


x86 assembly (clang, -O0):
<scale3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale3d>:
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @scale3d(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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float, float* %6
%11 = fmul float %9, %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %5
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 1
store float %18, float* %20
%21 = load float*, float** %5
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float, float* %6
%25 = fmul float %23, %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @scale3d(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
double ret_double(double f) { return f; }


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

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

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

LLVM IR (-O2):
define double @ret_double(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ e_eor();
int /*<<< orphan*/ e_izpx();
void e_eor_izpx() {
  e_izpx();
  e_eor();
}


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

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

LLVM IR (-O0):
define void @e_eor_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_eor()
ret void
}

LLVM IR (-O2):
define void @e_eor_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_eor()
ret void
}
/* Variables and functions */
int __builtin_mips_cabs_ngle_d(double, double);
int test9(double a, double b) { return __builtin_mips_cabs_ngle_d(a, b); }


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

x86 assembly (clang, -O2):
<test9>:
jmp    1030 <__builtin_mips_cabs_ngle_d@plt>

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

LLVM IR (-O2):
define i32 @test9(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ngle_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
void close_exit(int nl_sock, int rc) {
  close(nl_sock);
  exit(rc);
}


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

x86 assembly (clang, -O2):
<close_exit>:
push   %rbx
mov    %esi,%ebx
call   1030 <close@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @close_exit(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 = call i32 @close(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @close_exit(i32 %0, i32 %1) {
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fputc(int, int /*<<< orphan*/ *);
int fput2b(int value, FILE *stream) {
  int result;
  result = fputc((value >> 8) & 0xff, stream);
  if (result != EOF) {
    result = fputc(value & 0xff, stream);
  }
  return result;
}


x86 assembly (clang, -O0):
<fput2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
je     115e <fput2b+0x4e>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput2b>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bh,%edi
call   1030 <fputc@plt>
mov    0x2ec0(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <fput2b+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fput2b(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 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = load i32*, i32** %4
%10 = call i32 @fputc(i32 %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i32, i32* %3
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %14, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fput2b(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @fputc(i32 %4, i32* %1)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = and i32 %0, 255
%10 = tail call i32 @fputc(i32 %9, i32* %1)
br label %11
11: ; preds = %8, %2
%12 = phi i32 [ %10, %8 ], [ %5, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ interface();
int main() {
  interface();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @interface()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *hugo = "hugo was here.";
  printf("hello.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hugo was here.\00"
@.str.1 = [8 x i8] c"hello.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"hello.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
char reverse_dir(char dir) {
  static char dirs[] = "nsewud";
  char *p = strchr(dirs, dir);
  return p ? dirs[(p - dirs) ^ 1] : 0;
}


x86 assembly (clang, -O0):
<reverse_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0x2f03(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <reverse_dir+0x52>
mov    -0x10(%rbp),%rcx
lea    0x2ee0(%rip),%rax
sub    %rax,%rcx
xor    $0x1,%rcx
lea    0x2ed2(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
jmp    116c <reverse_dir+0x5c>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <reverse_dir+0x5c>
mov    -0x14(%rbp),%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_dir>:
push   %rbx
mov    %edi,%esi
lea    0x2f0e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1133 <reverse_dir+0x23>
sub    %rbx,%rax
xor    $0x1,%rax
mov    (%rax,%rbx,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@reverse_dir.dirs = internal global [7 x i8] c"nsewud\00"
define signext i8 @reverse_dir(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i8* @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @reverse_dir.dirs, i64 0, i64 0), i8 signext %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i64
%11 = sub i64 %10, ptrtoint ([7 x i8]* @reverse_dir.dirs to i64)
%12 = xor i64 %11, 1
%13 = getelementptr inbounds [7 x i8], [7 x i8]* @reverse_dir.dirs, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %8
%18 = phi i32 [ %15, %8 ], [ 0, %16 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
@reverse_dir.dirs = internal global [7 x i8] c"nsewud\00"
define signext i8 @reverse_dir(i8 signext %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @reverse_dir.dirs, i64 0, i64 0), i8 signext %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = sub i64 %5, ptrtoint ([7 x i8]* @reverse_dir.dirs to i64)
%7 = xor i64 %6, 1
%8 = getelementptr inbounds [7 x i8], [7 x i8]* @reverse_dir.dirs, i64 0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %1, %4
%11 = phi i8 [ %9, %4 ], [ 0, %1 ]
ret i8 %11
}
void divvv(double *result, const double *s1, const double *s2) {
  result[0] = s1[0] / s2[0];
  result[1] = s1[1] / s2[1];
  result[2] = s1[2] / s2[2];
}


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

x86 assembly (clang, -O2):
<divvv>:
movsd  (%rsi),%xmm0
divsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
divsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
divsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @divvv(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fdiv double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fdiv double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fdiv double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @divvv(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fdiv double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fdiv double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fdiv double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int apr_base64_decode_binary(unsigned char *, char const *);
int apr_base64_decode(char *bufplain, const char *bufcoded) {
  int len;
  len = apr_base64_decode_binary((unsigned char *)bufplain, bufcoded);
  bufplain[len] = '\0';
  return len;
}


x86 assembly (clang, -O0):
<apr_base64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <apr_base64_decode_binary@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_base64_decode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <apr_base64_decode_binary@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @apr_base64_decode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @apr_base64_decode_binary(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @apr_base64_decode(i8* %0, i8* %1) {
%3 = tail call i32 @apr_base64_decode_binary(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret i32 %3
}
void foo19() {}


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

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

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

LLVM IR (-O2):
define void @foo19() {
ret void
}
int inv(int n) {
  if (n % 2 == 0)
    return (n + 1);
  return (n - 1);
}


x86 assembly (clang, -O0):
<inv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1129 <inv+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <inv+0x32>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @inv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @inv(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 -1
%5 = add nsw i32 %4, %0
ret i32 %5
}
void foo316() {}


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

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

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

LLVM IR (-O2):
define void @foo316() {
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ write(int, void const *, size_t);
ssize_t utils_write(int fd, const void *buf, size_t count) {
  ssize_t result;
  do {
    result = write(fd, buf, count);
  } while (result < 0 && errno == EINTR);
  return result;
}


x86 assembly (clang, -O0):
<utils_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1161 <utils_write+0x51>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1123 <utils_write+0x13>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
test   %rax,%rax
jns    114b <utils_write+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <utils_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @utils_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @write(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @utils_write(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int MPI_Init_thread(int *, char ***, int, int *);
int /*<<< orphan*/ PyMPI_MPICH1_FixArgs(int **, char ****);
int PyMPI_MPICH1_MPI_Init_thread(int *argc, char ***argv, int required,
                                 int *provided) {
  PyMPI_MPICH1_FixArgs(&argc, &argv);
  return MPI_Init_thread(argc, argv, required, provided);
}


x86 assembly (clang, -O0):
<PyMPI_MPICH1_MPI_Init_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <PyMPI_MPICH1_FixArgs@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <MPI_Init_thread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PyMPI_MPICH1_MPI_Init_thread>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <PyMPI_MPICH1_FixArgs@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <MPI_Init_thread@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @PyMPI_MPICH1_MPI_Init_thread(i32* %0, i8*** %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8***
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i8*** %1, i8**** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = call i32 @PyMPI_MPICH1_FixArgs(i32** %5, i8**** %6)
%10 = load i32*, i32** %5
%11 = load i8***, i8**** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = call i32 @MPI_Init_thread(i32* %10, i8*** %11, i32 %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @PyMPI_MPICH1_MPI_Init_thread(i32* %0, i8*** %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8***
store i32* %0, i32** %5
store i8*** %1, i8**** %6
%7 = call i32 @PyMPI_MPICH1_FixArgs(i32** %5, i8**** %6)
%8 = load i32*, i32** %5
%9 = load i8***, i8**** %6
%10 = call i32 @MPI_Init_thread(i32* %8, i8*** %9, i32 %2, i32* %3)
ret i32 %10
}
unsigned int hash_string_func_for_collision(unsigned int hash,
                                            const char *str) {
  return (hash * 585 + str[0]) % 1009;
}


x86 assembly (clang, -O0):
<hash_string_func_for_collision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x249,-0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    $0x3f1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string_func_for_collision>:
imul   $0x249,%edi,%ecx
movsbl (%rsi),%eax
add    %ecx,%eax
imul   $0x3ce4585,%rax,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x9,%edx
imul   $0x3f1,%edx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_string_func_for_collision(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = mul i32 %5, 585
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add i32 %6, %10
%12 = urem i32 %11, 1009
ret i32 %12
}

LLVM IR (-O2):
define i32 @hash_string_func_for_collision(i32 %0, i8* nocapture %1) {
%3 = mul i32 %0, 585
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add i32 %3, %5
%7 = urem i32 %6, 1009
ret i32 %7
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int binCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (n1 != n2)
    return 1;
  return memcmp(pKey1, pKey2, n1);
}


x86 assembly (clang, -O0):
<binCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <binCompare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <binCompare+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binCompare>:
cmp    %ecx,%esi
jne    1120 <binCompare+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @binCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int);
unsigned int mysyscall(void) { syscall(317); }


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

x86 assembly (clang, -O2):
<mysyscall>:
mov    $0x13d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @mysyscall() {
%1 = alloca i32
%2 = call i32 @syscall(i32 317)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @mysyscall() {
%1 = tail call i32 @syscall(i32 317)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float s;
  printf("enter real data");
  scanf("%f", &s);
  printf("f=%f\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"enter real data\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"f=%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"enter real data\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"f=%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void configureIeee802154Patch(void) {
  uint8_t *pParserPatchTab = (uint8_t *)(0x21000000 + 0x0390);
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[53] = 0;
  pPatchTab[28] = 1;
  pPatchTab[105] = 2;
  pPatchTab[106] = 3;
  pPatchTab[70] = 4;
  pParserPatchTab[0] = 5;
  pIrqPatch[21] = 0x2100408d;
}


x86 assembly (clang, -O0):
<configureIeee802154Patch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21000390,%eax
mov    %rax,-0x8(%rbp)
mov    $0x21000398,%eax
mov    %rax,-0x10(%rbp)
mov    $0x21000434,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,0xd4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x70(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,0x1a4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,0x1a8(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4,0x118(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2100408d,0x54(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureIeee802154Patch>:
movl   $0x0,0x2100046c
movl   $0x1,0x21000408
movl   $0x2,0x2100053c
movl   $0x3,0x21000540
movl   $0x4,0x210004b0
movl   $0x5,0x21000390
movl   $0x2100408d,0x21000488
ret

LLVM IR (-O0):
define void @configureIeee802154Patch() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
store i32* inttoptr (i64 553649040 to i32*), i32** %1
store i32* inttoptr (i64 553649048 to i32*), i32** %2
store i32* inttoptr (i64 553649204 to i32*), i32** %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 53
store i32 0, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 28
store i32 1, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 105
store i32 2, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 106
store i32 3, i32* %11
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 70
store i32 4, i32* %13
%14 = load i32*, i32** %1
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 5, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 21
store i32 553664653, i32* %17
ret void
}

LLVM IR (-O2):
define void @configureIeee802154Patch() {
store i32 0, i32* inttoptr (i64 553649260 to i32*)
store i32 1, i32* inttoptr (i64 553649160 to i32*)
store i32 2, i32* inttoptr (i64 553649468 to i32*)
store i32 3, i32* inttoptr (i64 553649472 to i32*)
store i32 4, i32* inttoptr (i64 553649328 to i32*)
store i32 5, i32* inttoptr (i64 553649040 to i32*)
store i32 553664653, i32* inttoptr (i64 553649288 to i32*)
ret void
}
int index_to_sym(int index) { return (index != 513) ? index : 512; }


x86 assembly (clang, -O0):
<index_to_sym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x201,-0x4(%rbp)
je     111f <index_to_sym+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112c <index_to_sym+0x2c>
mov    $0x200,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <index_to_sym+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_to_sym>:
cmp    $0x201,%edi
mov    $0x200,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @index_to_sym(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 513
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i32 [ %6, %5 ], [ 512, %7 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @index_to_sym(i32 %0) {
%2 = icmp eq i32 %0, 513
%3 = select i1 %2, i32 512, i32 %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_init2() {
  printf("main_init2"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"main_init2\00"
define void @main_init2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgdiv(void) {
  gen("cqo");
  gen("idivq\t%rcx");
}


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

x86 assembly (clang, -O2):
<cgdiv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cqo\00"
@.str.1 = [11 x i8] c"idivq\09%rcx\00"
define void @cgdiv() {
%1 = call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cqo\00"
@.str.1 = [11 x i8] c"idivq\09%rcx\00"
define void @cgdiv() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int operation3(int number) { return (number + 3) % 10; }


x86 assembly (clang, -O0):
<operation3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation3>:
add    $0x3,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @operation3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
%5 = srem i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @operation3(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = srem i32 %2, 10
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) mode_t softboundcets_umask(mode_t mask) {
  return umask(mask);
}


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

x86 assembly (clang, -O2):
<softboundcets_umask>:
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}