xunge/DecIR huggingface dataset:
int f(int *i, int x) {
  if (x > 10)
    *i = 100;
  return *i + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jle    111f <f+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0xa,%esi
jle    1111 <f+0x11>
movl   $0x64,(%rdi)
mov    $0x65,%eax
ret
mov    (%rdi),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = icmp sgt i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32*, i32** %3
store i32 100, i32* %8
br label %9
9: ; preds = %7, %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 10
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = add i32 %5, 1
br label %8
7: ; preds = %2
store i32 100, i32* %0
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ %6, %4 ], [ 101, %7 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ arch_init();
int /*<<< orphan*/ dev_init();
int /*<<< orphan*/ fs_init();
int /*<<< orphan*/ mm_init();
int /*<<< orphan*/ proc_init();
int /*<<< orphan*/ splash();
void init() {
  char *str;
  splash();
  arch_init();
  mm_init();
  dev_init();
  fs_init();
  proc_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <splash@plt>
mov    $0x0,%al
call   1030 <arch_init@plt>
mov    $0x0,%al
call   1050 <mm_init@plt>
mov    $0x0,%al
call   1060 <dev_init@plt>
mov    $0x0,%al
call   1070 <fs_init@plt>
mov    $0x0,%al
call   1080 <proc_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <splash@plt>
xor    %eax,%eax
call   1030 <arch_init@plt>
xor    %eax,%eax
call   1050 <mm_init@plt>
xor    %eax,%eax
call   1060 <dev_init@plt>
xor    %eax,%eax
call   1070 <fs_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <proc_init@plt>

LLVM IR (-O0):
define void @init() {
%1 = alloca i8*
%2 = call i32 (...) @splash()
%3 = call i32 (...) @arch_init()
%4 = call i32 (...) @mm_init()
%5 = call i32 (...) @dev_init()
%6 = call i32 (...) @fs_init()
%7 = call i32 (...) @proc_init()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @splash()
%2 = tail call i32 (...) @arch_init()
%3 = tail call i32 (...) @mm_init()
%4 = tail call i32 (...) @dev_init()
%5 = tail call i32 (...) @fs_init()
%6 = tail call i32 (...) @proc_init()
ret void
}
void foo205(int p) {}


x86 assembly (clang, -O0):
<foo205>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo205(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main() {
  char a[] = "abcd";
  char b[] = "Ebcd";
  printf("%d\n", strcmp(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0xa(%rbp)
lea    -0x9(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xea1(%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
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *s = str;
  while (*s)
    s++;
  return s - str;
}


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

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

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_unsignedcast() {
  signed char c = -1;
  int i = (unsigned char)c;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c",
          16, 1, i > 0);
  ;
}


x86 assembly (clang, -O0):
<test_unsignedcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xeca(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unsignedcast>:
lea    0xee9(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c\00"
define void @test_unsignedcast() {
%1 = alloca i8
%2 = alloca i32
store i8 -1, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 16, i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c\00"
define void @test_unsignedcast() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 16, i32 1, i32 1)
ret void
}
short f3(short x, short y) { return x * y / y; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
imul   %ecx,%eax
movswl -0x4(%rbp),%ecx
cltd
idiv   %ecx
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @f3(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = sdiv i32 %9, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @f3(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
/* Variables and functions */
int ax2ho(double *, double *, int);
int ho2cu(double *, double *, int);
int ax2cu(double *ax, double *cu, int p) {
  double ho[3];
  int trash;
  trash = ax2ho(ax, ho, p);
  trash = ho2cu(ho, cu, p);
  return 1;
}


x86 assembly (clang, -O0):
<ax2cu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ho2cu@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax2cu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <ax2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <ho2cu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ax2cu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ax2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2cu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ax2cu(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @ax2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2cu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
unsigned int mk_rnd_ipv4(int);
unsigned int mk_rnd_asian_ipv4() { return mk_rnd_ipv4(202); }


x86 assembly (clang, -O0):
<mk_rnd_asian_ipv4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%edi
call   1030 <mk_rnd_ipv4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_asian_ipv4>:
mov    $0xca,%edi
jmp    1030 <mk_rnd_ipv4@plt>

LLVM IR (-O0):
define i32 @mk_rnd_asian_ipv4() {
%1 = call i32 @mk_rnd_ipv4(i32 202)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mk_rnd_asian_ipv4() {
%1 = tail call i32 @mk_rnd_ipv4(i32 202)
ret i32 %1
}
/* Variables and functions */
scalar_t__ f(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char *s1 = "abc";
  char *s2 = "cab";
  if (f(s1, s2))
    printf("YES!");
  else
    printf("NO!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <f@plt>
cmp    $0x0,%rax
je     116d <main+0x4d>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
jmp    1179 <main+0x59>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <f@plt>
test   %rax,%rax
lea    0xecf(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"cab\00"
@.str.2 = [5 x i8] c"YES!\00"
@.str.3 = [4 x i8] c"NO!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i64 @f(i8* %4, i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"cab\00"
@.str.2 = [5 x i8] c"YES!\00"
@.str.3 = [4 x i8] c"NO!\00"
define i32 @main() {
%1 = tail call i64 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
float add_float(float arg1, float arg2) { return arg1 + arg2; }


x86 assembly (clang, -O0):
<add_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_float>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @add_float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_length_multprec_solution_string(int k, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(480, &k, n, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_multprec_solution_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1e0,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_multprec_solution_string>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1e0,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_length_multprec_solution_string(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 480, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_length_multprec_solution_string(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 480, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int sin(int);
float senoidal(int amplitud, int frecuencia, float t, int angulo_inicial) {
  float resultado;
  resultado = amplitud * sin(2 * 3.14 * frecuencia * t + angulo_inicial);
  return resultado;
}


x86 assembly (clang, -O0):
<senoidal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
cvtsi2sdl -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senoidal>:
push   %rbx
cvtsi2sd %esi,%xmm1
mulsd  0xee3(%rip),%xmm1
mov    %edi,%ebx
cvtss2sd %xmm0,%xmm0
cvtsi2sd %edx,%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <sin@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @senoidal(i32 %0, i32 %1, float %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = fmul double 6.280000e+00, %12
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %13, double %15, double %17)
%19 = fptosi double %18 to i32
%20 = call i32 @sin(i32 %19)
%21 = mul nsw i32 %10, %20
%22 = sitofp i32 %21 to float
store float %22, float* %9
%23 = load float, float* %9
ret float %23
}

LLVM IR (-O2):
define float @senoidal(i32 %0, i32 %1, float %2, i32 %3) {
%5 = sitofp i32 %1 to double
%6 = fmul double %5, 6.280000e+00
%7 = fpext float %2 to double
%8 = sitofp i32 %3 to double
%9 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %8)
%10 = fptosi double %9 to i32
%11 = tail call i32 @sin(i32 %10)
%12 = mul nsw i32 %11, %0
%13 = sitofp i32 %12 to float
ret float %13
}
int test_imm_47int64_midword_reg(long long val) {
  return ((val >> 16) & (0x47 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_47int64_midword_reg>:
test   $0x470000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_47int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4653056
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long foo(long a, long b) { return a / b; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <foo+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sdiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float toobig = 3.4e38 * 100;
  printf("%e\n", toobig);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x7FF0000000000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quickSort(int *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int numbers[100000], i;
  srand(time(NULL));
  for (i = 0; i < 100000; i++)
    numbers[i] = rand();
  quickSort(numbers, 100000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61aa0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x61a94(%rbp)
cmpl   $0x186a0,-0x61a94(%rbp)
jge    11a7 <main+0x67>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%ecx
movslq -0x61a94(%rbp),%rax
mov    %ecx,-0x61a90(%rbp,%rax,4)
mov    -0x61a94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a94(%rbp)
jmp    116c <main+0x2c>
lea    -0x61a90(%rbp),%rdi
mov    $0x186a0,%esi
call   1050 <quickSort@plt>
xor    %eax,%eax
add    $0x61aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x61a80,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x186a0,%rbx
jne    1160 <main+0x20>
mov    %rsp,%rdi
mov    $0x186a0,%esi
call   1050 <quickSort@plt>
xor    %eax,%eax
add    $0x61a80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100000
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 %12
store i32 %10, i32* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%19 = call i32 @quickSort(i32* %18, i32 100000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100000 x i32]
%2 = bitcast [100000 x i32]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %9, %5 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds [100000 x i32], [100000 x i32]* %1, i64 0, i64 %6
store i32 %7, i32* %8
%9 = add nuw nsw i64 %6, 1
%10 = icmp eq i64 %9, 100000
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = getelementptr inbounds [100000 x i32], [100000 x i32]* %1, i64 0, i64 0
%13 = call i32 @quickSort(i32* %12, i32 100000)
ret i32 0
}
/* Variables and functions */
int setevent(char *, char *);
int event_disable_all(void) { return setevent("events/enable", "0"); }


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

x86 assembly (clang, -O2):
<event_disable_all>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <setevent@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"events/enable\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @event_disable_all() {
%1 = call i32 @setevent(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"events/enable\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @event_disable_all() {
%1 = tail call i32 @setevent(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
double get_sqnorm(const double *a_vec) {}


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

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

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

LLVM IR (-O2):
define double @get_sqnorm(double* nocapture readnone %0) {
ret double undef
}
/* Variables and functions */
double cosf(double);
double cog_math_cosf(double radians) { return cosf(radians); }


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

x86 assembly (clang, -O2):
<cog_math_cosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define double @cog_math_cosf(double %0) {
%2 = tail call double @cosf(double %0)
ret double %2
}
/* Variables and functions */
int destruirIPC(int);
main(int argc, char **argv) { return destruirIPC(argc); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @destruirIPC(i32 %0)
ret i32 %3
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int nn_inet_pton(int family, const char *src, void *dst) {
  return inet_pton(family, src, dst);
}


x86 assembly (clang, -O0):
<nn_inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_inet_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @nn_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FTDI_ENABLE_REG_SaveConfig();
void FTDI_ENABLE_REG_Sleep(void) { FTDI_ENABLE_REG_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @FTDI_ENABLE_REG_Sleep() {
%1 = tail call i32 (...) @FTDI_ENABLE_REG_SaveConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArbiterP__1__ResourceDefaultOwner__default__granted();
void ArbiterP__1__ResourceDefaultOwner__granted(void) {
  ArbiterP__1__ResourceDefaultOwner__default__granted();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @ArbiterP__1__ResourceDefaultOwner__default__granted()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(unsigned long, unsigned long, unsigned long);
void f2(unsigned long a, unsigned long b, unsigned long c, unsigned long i) {
  unsigned long carry1, carry2;
  ((a) += (i), (carry1) = (a) < (i));
  ((b) += (carry1), (carry2) = (b) < (carry1));
  c += carry2;
  g(a, b, c);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <g@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
add    %rcx,%rdi
adc    $0x0,%rsi
adc    $0x0,%rdx
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i64, i64* %8
%12 = load i64, i64* %5
%13 = add i64 %12, %11
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = load i64, i64* %8
%16 = icmp ult i64 %14, %15
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
store i64 %18, i64* %9
%19 = load i64, i64* %9
%20 = load i64, i64* %6
%21 = add i64 %20, %19
store i64 %21, i64* %6
%22 = load i64, i64* %6
%23 = load i64, i64* %9
%24 = icmp ult i64 %22, %23
%25 = zext i1 %24 to i32
%26 = sext i32 %25 to i64
store i64 %26, i64* %10
%27 = load i64, i64* %10
%28 = load i64, i64* %7
%29 = add i64 %28, %27
store i64 %29, i64* %7
%30 = load i64, i64* %5
%31 = load i64, i64* %6
%32 = load i64, i64* %7
%33 = call i32 @g(i64 %30, i64 %31, i64 %32)
ret void
}

LLVM IR (-O2):
define void @f2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %3, %0
%6 = icmp ult i64 %5, %3
%7 = zext i1 %6 to i64
%8 = add i64 %7, %1
%9 = icmp ult i64 %8, %7
%10 = zext i1 %9 to i64
%11 = add i64 %10, %2
%12 = tail call i32 @g(i64 %5, i64 %8, i64 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, int);
int /*<<< orphan*/ memmove(void *, void *, int);
int strlen(char const *);
char *AppendPrefix_ShiftOriginalRight(const char *szPrefix, char *szOriginal) {
  int iPreStrSize = strlen(szPrefix);
  int iOrgStrSize = strlen(szOriginal);
  memmove((void *)(szOriginal + iPreStrSize), (void *)szOriginal,
          (iOrgStrSize + 1));
  memcpy((void *)szOriginal, szPrefix, iPreStrSize);
  return szOriginal;
}


x86 assembly (clang, -O0):
<AppendPrefix_ShiftOriginalRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1050 <memmove@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AppendPrefix_ShiftOriginalRight>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %ebp,%rbp
lea    (%rbx,%rbp,1),%rdi
lea    0x1(%rax),%edx
mov    %rbx,%rsi
call   1050 <memmove@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @AppendPrefix_ShiftOriginalRight(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
%18 = call i32 @memmove(i8* %14, i8* %15, i32 %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = call i32 @memcpy(i8* %19, i8* %20, i32 %21)
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @AppendPrefix_ShiftOriginalRight(i8* %0, i8* returned %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = add nsw i32 %4, 1
%8 = tail call i32 @memmove(i8* %6, i8* %1, i32 %7)
%9 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %3)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void def_free_fun(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @def_free_fun(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float fmax(float, int /*<<< orphan*/);
int /*<<< orphan*/ fmin(float, float);
float bound(float minval, float val, float maxval) {
  return fmax(minval, fmin(val, maxval));
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <fmin@plt>
movss  -0x10(%rbp),%xmm0
mov    %eax,%edi
call   1040 <fmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <fmin@plt>
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <fmax@plt>

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

LLVM IR (-O2):
define float @bound(float %0, float %1, float %2) {
%4 = tail call i32 @fmin(float %1, float %2)
%5 = tail call float @fmax(float %0, i32 %4)
ret float %5
}
int isupper(int c) { return c >= 'A' && c <= 'Z' ? 1 : 0; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void sendbrk(int fd) {}


x86 assembly (clang, -O0):
<sendbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sendbrk(i32 %0) {
ret void
}
double i2d(int a) { return (double)a; }


x86 assembly (clang, -O0):
<i2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d>:
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @i2d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @i2d(i32 %0) {
%2 = sitofp i32 %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void log_fatal(const char *msg) {
  printf("\x1B[31m"
         "[FATAL]"
         "\x1B[0m"
         "\x1B[37m"
         " %s"
         "\x1B[0m"
         "\n",
         msg);
}


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

x86 assembly (clang, -O2):
<log_fatal>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\1B[31m[FATAL]\1B[0m\1B[37m %s\1B[0m\0A\00"
define void @log_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\1B[31m[FATAL]\1B[0m\1B[37m %s\1B[0m\0A\00"
define void @log_fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int left_nc_side(int cell) {
  switch (cell) {
  case 1:
    return (3);
  case 3:
    return (4);
  case 5:
    return (2);
  case 7:
    return (1);
  case 0:
    return (4);
  case 2:
    return (3);
  case 6:
    return (1);
  case 8:
    return (2);
  }
}


x86 assembly (clang, -O0):
<left_nc_side>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x8,%rax
ja     1187 <left_nc_side+0x87>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x4,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x2,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x4,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x3,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1187 <left_nc_side+0x87>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_nc_side>:
mov    $0x3,%eax
cmp    $0x8,%edi
ja     1117 <left_nc_side+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @left_nc_side(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 1, label %5
i32 3, label %6
i32 5, label %7
i32 7, label %8
i32 0, label %9
i32 2, label %10
i32 6, label %11
i32 8, label %12
]
5: ; preds = %1
store i32 3, i32* %2
br label %13
6: ; preds = %1
store i32 4, i32* %2
br label %13
7: ; preds = %1
store i32 2, i32* %2
br label %13
8: ; preds = %1
store i32 1, i32* %2
br label %13
9: ; preds = %1
store i32 4, i32* %2
br label %13
10: ; preds = %1
store i32 3, i32* %2
br label %13
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 2, i32* %2
br label %13
13: ; preds = %5, %6, %7, %8, %9, %10, %11, %12, %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.left_nc_side = [9 x i32] [i32 4, i32 3, i32 3, i32 4, i32 3, i32 2, i32 1, i32 1, i32 2]
define i32 @left_nc_side(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.left_nc_side, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 3, %1 ], [ %6, %3 ]
ret i32 %8
}
float truncf(float x) { return __builtin_truncf(x); }


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

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

LLVM IR (-O0):
define float @truncf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.trunc.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void filecopy(FILE *file_in, FILE *file_out) {
  int c;
  while (EOF != (c = getc(file_in))) {
    putc(c, file_out);
  }
}


x86 assembly (clang, -O0):
<filecopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp)
cmp    %ecx,%eax
je     1166 <filecopy+0x46>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <filecopy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecopy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb4(%rip),%r15
mov    (%r15),%ebp
nopw   0x0(%rax,%rax,1)
call   1040 <getc@plt>
cmp    %eax,%ebp
je     115b <filecopy+0x3b>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    (%r15),%ebp
mov    %rbx,%rdi
jmp    1140 <filecopy+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @filecopy(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @getc(i32* %0)
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %4, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = load i32, i32* @EOF
%10 = tail call i32 @getc(i32* %0)
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void fftease_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @fftease_setup() {
ret void
}
unsigned long lh_char_hash(void *k) {
  unsigned int h = 0;
  const char *data = k;
  while (*data != 0)
    h = h * 129 + (unsigned int)(*data++) + 0x9e370001UL;
  return h;
}


x86 assembly (clang, -O0):
<lh_char_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <lh_char_hash+0x59>
imul   $0x81,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,%eax
movabs $0x9e370001,%rcx
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1117 <lh_char_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_char_hash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     112f <lh_char_hash+0x2f>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x7,%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x9e370001,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <lh_char_hash+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @lh_char_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i32, i32* %3
%13 = mul i32 %12, 129
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = add i32 %13, %17
%19 = zext i32 %18 to i64
%20 = add i64 %19, 2654404609
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
br label %6
22: ; preds = %6
%23 = load i32, i32* %3
%24 = zext i32 %23 to i64
ret i64 %24
}

LLVM IR (-O2):
define i64 @lh_char_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 129
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, -1640562687
%12 = add i32 %11, %8
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = zext i32 %12 to i64
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ 0, %1 ], [ %16, %15 ]
ret i64 %18
}
/* Variables and functions */
size_t ft_strlen(const char *s) {
  size_t length;
  length = 0;
  while (s[length])
    length++;
  return (length);
}


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

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}