xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ pow(int, int);
float sqrt(scalar_t__);
float f11(float z) { return sqrt(1 - pow((2 * z - 3.14) / 3.14, 2)); }


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
push   %rax
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xecf(%rip),%xmm0
divsd  0xecf(%rip),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %rax,%rdi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @f11(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 2.000000e+00, %3
%5 = fpext float %4 to double
%6 = fsub double %5, 3.140000e+00
%7 = fdiv double %6, 3.140000e+00
%8 = fptosi double %7 to i32
%9 = call i64 @pow(i32 %8, i32 2)
%10 = sub nsw i64 1, %9
%11 = call float @sqrt(i64 %10)
ret float %11
}

LLVM IR (-O2):
define float @f11(float %0) {
%2 = fmul float %0, 2.000000e+00
%3 = fpext float %2 to double
%4 = fadd double %3, -3.140000e+00
%5 = fdiv double %4, 3.140000e+00
%6 = fptosi double %5 to i32
%7 = tail call i64 @pow(i32 %6, i32 2)
%8 = sub nsw i64 1, %7
%9 = tail call float @sqrt(i64 %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void printarg(char *str, int fd) {
  while (*str) {
    write(fd, str, 1);
    str++;
  }
}


x86 assembly (clang, -O0):
<printarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <printarg+0x3e>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <printarg+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarg>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1139 <printarg+0x29>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <printarg+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printarg(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = tail call i32 @write(i32 %1, i8* %6, i32 1)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *lic_decrypt(char *lic) {
  printf("TODO\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"TODO\0A\00"
define i8* @lic_decrypt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [5 x i8] c"TODO\00"
define noalias i8* @lic_decrypt(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fnegs(int s, int d) {
  assem_debug("fnegs d%d,s%d\n", d, s);
  output_w32(0xeeb10a40 | ((d & 14) << 11) | ((d & 1) << 22) | ((s & 14) >> 1) |
             ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fnegs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb10a40,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnegs>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
mov    %ebp,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebp
shl    $0x16,%ebp
mov    %ebx,%ecx
shr    %ecx
and    $0x7,%ecx
shl    $0x5,%ebx
and    $0x20,%ebx
or     %ecx,%ebx
or     %ebp,%ebx
lea    (%rax,%rbx,1),%edi
add    $0xeeb10a40,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fnegs d%d,s%d\0A\00"
define void @emit_fnegs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -290387392, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 14
%18 = ashr i32 %17, 1
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 1
%22 = shl i32 %21, 5
%23 = or i32 %19, %22
%24 = call i32 @output_w32(i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fnegs d%d,s%d\0A\00"
define void @emit_fnegs(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = lshr i32 %0, 1
%9 = and i32 %8, 7
%10 = shl i32 %0, 5
%11 = and i32 %10, 32
%12 = or i32 %9, %11
%13 = or i32 %12, %7
%14 = or i32 %13, %5
%15 = or i32 %14, -290387392
%16 = tail call i32 @output_w32(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *helloWorld();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *ret = helloWorld();
  printf("%s\n", ret);
  free(ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <helloWorld@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @helloWorld()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
int foo(unsigned char *test) { return 0U - (unsigned int)test; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
neg    %eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = sub i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = sub i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void halWriteReg16(uintptr_t physicalAddress, uint16_t val) {
  volatile uint16_t *ptr = (uint16_t *)physicalAddress;
  *ptr = val;
}


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

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

LLVM IR (-O0):
define void @halWriteReg16(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
store volatile i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @halWriteReg16(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_stack();
int /*<<< orphan*/ printk(char *, char const *);
__attribute__((always_)) int mhp_notimplemented(const char *func) {
  printk("<4>"
         "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n",
         func);
  dump_stack();
  return -38;
}


x86 assembly (clang, -O0):
<mhp_notimplemented>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <dump_stack@plt>
mov    $0xffffffda,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhp_notimplemented>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
call   1040 <dump_stack@plt>
mov    $0xffffffda,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"<4>%s() called, with CONFIG_MEMORY_HOTPLUG disabled\0A\00"
define i32 @mhp_notimplemented(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printk(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @dump_stack()
ret i32 -38
}

LLVM IR (-O2):
@.str = [53 x i8] c"<4>%s() called, with CONFIG_MEMORY_HOTPLUG disabled\0A\00"
define i32 @mhp_notimplemented(i8* %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @dump_stack()
ret i32 -38
}
/* Variables and functions */
int /*<<< orphan*/ scanf_int();
int /*<<< orphan*/ scanf_string();
int /*<<< orphan*/ scanf_string_array();
int main(int argc, char const *argv[]) {
  scanf_string();
  scanf_int();
  scanf_string_array();
  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 <scanf_string@plt>
mov    $0x0,%al
call   1050 <scanf_int@plt>
mov    $0x0,%al
call   1040 <scanf_string_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <scanf_string@plt>
xor    %eax,%eax
call   1050 <scanf_int@plt>
xor    %eax,%eax
call   1040 <scanf_string_array@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 (...) @scanf_string()
%7 = call i32 (...) @scanf_int()
%8 = call i32 (...) @scanf_string_array()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @scanf_string()
%4 = tail call i32 (...) @scanf_int()
%5 = tail call i32 (...) @scanf_string_array()
ret i32 0
}
unsigned char dac_4to6(unsigned char c4) { return (c4 << 2) | (c4 >> 2); }


x86 assembly (clang, -O0):
<dac_4to6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x2,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dac_4to6>:
lea    0x0(,%rdi,4),%eax
shr    $0x2,%dil
or     %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @dac_4to6(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 2
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @dac_4to6(i8 zeroext %0) {
%2 = shl i8 %0, 2
%3 = lshr i8 %0, 2
%4 = or i8 %2, %3
ret i8 %4
}
/* Variables and functions */
float powf(float, int);
float quintic_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return max_val * powf(ratio, 5);
}


x86 assembly (clang, -O0):
<quintic_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quintic_in>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quintic_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = load float, float* %7
%13 = call float @powf(float %12, i32 5)
%14 = fmul float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @quintic_in(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = tail call float @powf(float %4, i32 5)
%6 = fmul float %5, %2
ret float %6
}
int foo2(int x) { return (x) != (((x))); }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfwscanf(int /*<<< orphan*/, int /*<<< orphan*/ const *,
             int /*<<< orphan*/);
int vwscanf(const wchar_t *__restrict fmt, va_list ap) {
  return (vfwscanf(stdin, fmt, ap));
}


x86 assembly (clang, -O0):
<vwscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfwscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vwscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfwscanf@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vwscanf(i32* noalias %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @vfwscanf(i32 %5, i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vwscanf(i32* noalias %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfwscanf(i32 %3, i32* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
int /*<<< orphan*/ Label_Printf(char *, char *, int);
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", ".LC", str_no);
  Inst_Printf(".ascii", "%s", asciiz);
}


x86 assembly (clang, -O0):
<Dico_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <Label_Printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_String>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xed3(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <Label_Printf@plt>
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s%d:\00"
@.str.1 = [4 x i8] c".LC\00"
@.str.2 = [7 x i8] c".ascii\00"
@.str.3 = [3 x i8] c"%s\00"
define void @Dico_String(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 = call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%d:\00"
@.str.1 = [4 x i8] c".LC\00"
@.str.2 = [7 x i8] c".ascii\00"
@.str.3 = [3 x i8] c"%s\00"
define void @Dico_String(i32 %0, i8* %1) {
%3 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_main(int, char **);
int elua_main(int argc, char **argv) {
  char *lua_argv[] = {(char *)"lua", NULL};
  lua_main(1, lua_argv);
  return 0;
}


x86 assembly (clang, -O0):
<elua_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1030 <lua_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elua_main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <lua_main@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"lua\00"
@__const.elua_main.lua_argv = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @elua_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [2 x i8*]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [2 x i8*]* %5 to i8*
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 0
%8 = call i32 @lua_main(i32 1, i8** %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"lua\00"
@__const.elua_main.lua_argv = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @elua_main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @lua_main(i32 1, i8** %5)
ret i32 0
}
unsigned xrop3_80_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = T & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_80_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_80_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_80_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = and i32 %27, %28
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = or i32 %29, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = and i32 %38, %39
%41 = or i32 %34, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_80_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = and i32 %6, %4
%8 = xor i32 %4, -1
%9 = and i32 %8, %5
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int _scanChar() {
  char result;
  scanf("%c", &result);
  return result;
}


x86 assembly (clang, -O0):
<_scanChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_scanChar>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @_scanChar() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @_scanChar() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}
int five(void) { return 5; }


x86 assembly (clang, -O0):
<five>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @five() {
ret i32 5
}

LLVM IR (-O2):
define i32 @five() {
ret i32 5
}
int dsig(int b) {
  int d = 0, r;
  while (b) {
    r = b % 10;
    if (r)
      d += 1 << (3 * r);
    b /= 10;
  }
  return d;
}


x86 assembly (clang, -O0):
<dsig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <dsig+0x54>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <dsig+0x41>
imul   $0x3,-0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <dsig+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsig>:
xor    %eax,%eax
test   %edi,%edi
je     114d <dsig+0x4d>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%r8
imul   $0x66666667,%r8,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdi
add    %ecx,%edi
lea    (%rdi,%rdi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %r8d,%esi
sub    %ecx,%esi
lea    (%rsi,%rsi,2),%ecx
mov    $0x1,%edx
shl    %cl,%edx
test   %esi,%esi
cmove  %esi,%edx
add    %edx,%eax
add    $0x9,%r8d
cmp    $0x12,%r8d
ja     1110 <dsig+0x10>
ret

LLVM IR (-O0):
define i32 @dsig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %4
%15 = mul nsw i32 3, %14
%16 = shl i32 1, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
br label %19
19: ; preds = %13, %8
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10
store i32 %21, i32* %2
br label %5
22: ; preds = %5
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @dsig(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = icmp eq i32 %6, 0
%8 = mul nsw i32 %6, 3
%9 = shl nuw nsw i32 1, %8
%10 = select i1 %7, i32 0, i32 %9
%11 = add nsw i32 %10, %5
%12 = sdiv i32 %4, 10
%13 = add i32 %4, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %15, label %3
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ spd_set_dramc();
int /*<<< orphan*/ spd_set_drb();
int /*<<< orphan*/ spd_set_nbxcfg();
int /*<<< orphan*/ spd_set_pgpol();
int /*<<< orphan*/ spd_set_rps();
int /*<<< orphan*/ spd_set_sdramc();
void sdram_set_spd_registers(void) {
  spd_set_drb();
  spd_set_dramc();
  spd_set_rps();
  spd_set_sdramc();
  spd_set_pgpol();
  spd_set_nbxcfg();
}


x86 assembly (clang, -O0):
<sdram_set_spd_registers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <spd_set_drb@plt>
mov    $0x0,%al
call   1040 <spd_set_dramc@plt>
mov    $0x0,%al
call   1050 <spd_set_rps@plt>
mov    $0x0,%al
call   1030 <spd_set_sdramc@plt>
mov    $0x0,%al
call   1080 <spd_set_pgpol@plt>
mov    $0x0,%al
call   1060 <spd_set_nbxcfg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_set_spd_registers>:
push   %rax
xor    %eax,%eax
call   1070 <spd_set_drb@plt>
xor    %eax,%eax
call   1040 <spd_set_dramc@plt>
xor    %eax,%eax
call   1050 <spd_set_rps@plt>
xor    %eax,%eax
call   1030 <spd_set_sdramc@plt>
xor    %eax,%eax
call   1080 <spd_set_pgpol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <spd_set_nbxcfg@plt>

LLVM IR (-O0):
define void @sdram_set_spd_registers() {
%1 = call i32 (...) @spd_set_drb()
%2 = call i32 (...) @spd_set_dramc()
%3 = call i32 (...) @spd_set_rps()
%4 = call i32 (...) @spd_set_sdramc()
%5 = call i32 (...) @spd_set_pgpol()
%6 = call i32 (...) @spd_set_nbxcfg()
ret void
}

LLVM IR (-O2):
define void @sdram_set_spd_registers() {
%1 = tail call i32 (...) @spd_set_drb()
%2 = tail call i32 (...) @spd_set_dramc()
%3 = tail call i32 (...) @spd_set_rps()
%4 = tail call i32 (...) @spd_set_sdramc()
%5 = tail call i32 (...) @spd_set_pgpol()
%6 = tail call i32 (...) @spd_set_nbxcfg()
ret void
}
/* Variables and functions */
char *bar();
char *foo();
int /*<<< orphan*/ free(char *);
int main() {
  char *f1 = foo();
  char *b2 = bar();
  free(f1);
  char *b3 = bar();
  char *b4 = bar();
  free(b2);
  free(b3);
  free(b4);
  char *f2 = foo();
  free(f2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <bar@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <bar@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1040 <bar@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @foo()
%2 = tail call i8* (...) @bar()
%3 = tail call i32 @free(i8* %1)
%4 = tail call i8* (...) @bar()
%5 = tail call i8* (...) @bar()
%6 = tail call i32 @free(i8* %2)
%7 = tail call i32 @free(i8* %4)
%8 = tail call i32 @free(i8* %5)
%9 = tail call i8* (...) @foo()
%10 = tail call i32 @free(i8* %9)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int *createArray();
int main() {
  int *arr = createArray();
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @createArray()
store i32* %3, i32** %2
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32* (...) @createArray()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int _link_error(char *, int);
int link(char *, char *);
int _link(char *file1, char *file2) {
  if (link(file1, file2) == -1)
    return _link_error(file2, 1);
  return 0;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <link@plt>
cmp    $0xffffffff,%eax
jne    115c <_link+0x3c>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_link_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <_link+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
push   %rbx
mov    %rsi,%rbx
call   1040 <link@plt>
cmp    $0xffffffff,%eax
je     1132 <_link+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <_link_error@plt>

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

LLVM IR (-O2):
define i32 @_link(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @_link_error(i8* %1, i32 1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ atan2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basAtan2() { pushNumber(atan2(popNumber(), popNumber())); }


x86 assembly (clang, -O0):
<basAtan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basAtan2>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basAtan2() {
%1 = call i32 (...) @popNumber()
%2 = call i32 (...) @popNumber()
%3 = call i32 @atan2(i32 %1, i32 %2)
%4 = call i32 @pushNumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @basAtan2() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 @atan2(i32 %1, i32 %2)
%4 = tail call i32 @pushNumber(i32 %3)
ret void
}
int CmdNOP(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CmdNOP() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank2High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank2();
void vrc2_4_setParamsCXX1(uint16_t addr, uint8_t val) {
  __setCHRBank2High(addr, val);
  vrc2_4_SetChrROMBank2();
}


x86 assembly (clang, -O0):
<vrc2_4_setParamsCXX1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__setCHRBank2High@plt>
mov    $0x0,%al
call   1040 <vrc2_4_SetChrROMBank2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vrc2_4_setParamsCXX1(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank2High(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank2()
ret void
}
unsigned long XAllPlanes() {}


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

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

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

LLVM IR (-O2):
define i64 @XAllPlanes() {
ret i64 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ strntoumax(char const *, char **, int, size_t);
intmax_t strntoimax(const char *nptr, char **endptr, int base, size_t n) {
  return (intmax_t)strntoumax(nptr, endptr, base, n);
}


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

x86 assembly (clang, -O2):
<strntoimax>:
jmp    1030 <strntoumax@plt>

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

LLVM IR (-O2):
define i32 @strntoimax(i8* %0, i8** %1, i32 %2, i64 %3) {
%5 = tail call i32 @strntoumax(i8* %0, i8** %1, i32 %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ api_beep(int /*<<< orphan*/);
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putstr0(char *);
void end(char *s) {
  if (s != 0) {
    api_putstr0(s);
  }
  api_beep(0);
  api_end();
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <end+0x20>
mov    -0x8(%rbp),%rdi
call   1040 <api_putstr0@plt>
xor    %edi,%edi
call   1050 <api_beep@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end>:
push   %rax
test   %rdi,%rdi
je     113b <end+0xb>
call   1040 <api_putstr0@plt>
xor    %edi,%edi
call   1050 <api_beep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
define void @end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @api_putstr0(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @api_beep(i32 0)
%10 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
define void @end(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @api_putstr0(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @api_beep(i32 0)
%7 = tail call i32 (...) @api_end()
ret void
}
/* Variables and functions */
unsigned char *__ziplistDelete(unsigned char *, unsigned char *, unsigned int);
unsigned char *ziplistIndex(unsigned char *, unsigned int);
unsigned char *ziplistDeleteRange(unsigned char *zl, unsigned int index,
                                  unsigned int num) {
  unsigned char *p = ziplistIndex(zl, index);
  return (p == NULL) ? zl : __ziplistDelete(zl, p, num);
}


x86 assembly (clang, -O0):
<ziplistDeleteRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ziplistIndex@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <ziplistDeleteRange+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    116e <ziplistDeleteRange+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1040 <__ziplistDelete@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziplistDeleteRange>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <ziplistIndex@plt>
test   %rax,%rax
je     1145 <ziplistDeleteRange+0x25>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__ziplistDelete@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @ziplistDeleteRange(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @ziplistIndex(i8* %0, i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @__ziplistDelete(i8* %0, i8* %4, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ %0, %3 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_usage(FILE *handle) {
  fputs("Usage: diction [-b] [-d] [-f file [-n|-L language]] [-q] [file ...]\n "
        "      diction [--beginner] [--ignore-double-words]\n               "
        "[--file file [--no-default-file|--language]] [--quiet] [file ...]\n   "
        "    diction --version\n",
        handle);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [227 x i8] c"Usage: diction [-b] [-d] [-f file [-n|-L language]] [-q] [file ...]\0A diction [--beginner] [--ignore-double-words]\0A [--file file [--no-default-file|--language]] [--quiet] [file ...]\0A diction --version\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [227 x i8] c"Usage: diction [-b] [-d] [-f file [-n|-L language]] [-q] [file ...]\0A diction [--beginner] [--ignore-double-words]\0A [--file file [--no-default-file|--language]] [--quiet] [file ...]\0A diction --version\0A\00"
define void @print_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str, i64 0, i64 0), i64 226, i64 1, i32* %0)
ret void
}
void lerrsf_fatal(msg, arg) const char *msg, arg[];
{
  char errmsg[2048];
  snprintf(errmsg, sizeof(errmsg) - 1, msg, arg);
  errmsg[sizeof(errmsg) - 1] = 0;
  flexfatal(errmsg);
}


x86 assembly (clang, -O0):
<lerrsf_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x7ff,%esi
mov    $0x0,%al
call   1030 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1040 <flexfatal@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrsf_fatal>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    $0x7ff,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
movb   $0x0,0x7ff(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <flexfatal@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrsf_fatal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 2047, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 2047
store i8 0, i8* %10
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* %11)
ret void
}

LLVM IR (-O2):
define void @lerrsf_fatal(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 2047, i8* %0, i8* %1)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 2047
store i8 0, i8* %6
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* %4)
ret void
}
int number_add_mod(int a, int b, int mod) { return (a + b) % mod; }


x86 assembly (clang, -O0):
<number_add_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_add_mod>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @number_add_mod(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @number_add_mod(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = srem i32 %4, %2
ret i32 %5
}
int log2mem_atomic_incr_fetch_uint(unsigned int *v, int value) {
  return __sync_add_and_fetch(v, value);
}


x86 assembly (clang, -O0):
<log2mem_atomic_incr_fetch_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,(%rdx)
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2mem_atomic_incr_fetch_uint>:
mov    %esi,%eax
lock xadd %eax,(%rdi)
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @log2mem_atomic_incr_fetch_uint(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 = atomicrmw add i32* %5, i32 %6 seq_cst
%8 = add i32 %7, %6
ret i32 %8
}

LLVM IR (-O2):
define i32 @log2mem_atomic_incr_fetch_uint(i32* nocapture %0, i32 %1) {
%3 = atomicrmw add i32* %0, i32 %1 seq_cst
%4 = add i32 %3, %1
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int depth;
};
typedef TYPE_1__ XPixmapFormatValues;

/* Variables and functions */
void set_XPixmapFormatValues_depth(void *_p, int _v) {
  ((XPixmapFormatValues *)_p)->depth = (int)_v;
}


x86 assembly (clang, -O0):
<set_XPixmapFormatValues_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XPixmapFormatValues_depth(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XPixmapFormatValues_depth(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}