xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ runtests(int);
int /*<<< orphan*/ testDiag(char *);
int testDone();
int /*<<< orphan*/ testPlan(int);
int main(int argc, char **argv) {
  testPlan(119);
  testDiag("run and reset state between tests");
  runtests(1);
  testDiag("run tests w/o resets");
  runtests(0);
  return testDone();
}


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    $0x77,%edi
call   1060 <testPlan@plt>
lea    0xe99(%rip),%rdi
call   1040 <testDiag@plt>
mov    $0x1,%edi
call   1030 <runtests@plt>
lea    0xea5(%rip),%rdi
call   1040 <testDiag@plt>
xor    %edi,%edi
call   1030 <runtests@plt>
mov    $0x0,%al
call   1050 <testDone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x77,%edi
call   1060 <testPlan@plt>
lea    0xeae(%rip),%rdi
call   1040 <testDiag@plt>
mov    $0x1,%edi
call   1030 <runtests@plt>
lea    0xeba(%rip),%rdi
call   1040 <testDiag@plt>
xor    %edi,%edi
call   1030 <runtests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <testDone@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"run and reset state between tests\00"
@.str.1 = [21 x i8] c"run tests w/o resets\00"
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 @testPlan(i32 119)
%7 = call i32 @testDiag(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @runtests(i32 1)
%9 = call i32 @testDiag(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @runtests(i32 0)
%11 = call i32 (...) @testDone()
ret i32 %11
}

LLVM IR (-O2):
@.str = [34 x i8] c"run and reset state between tests\00"
@.str.1 = [21 x i8] c"run tests w/o resets\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @testPlan(i32 119)
%4 = tail call i32 @testDiag(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @runtests(i32 1)
%6 = tail call i32 @testDiag(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @runtests(i32 0)
%8 = tail call i32 (...) @testDone()
ret i32 %8
}
int has_stats(const unsigned int *info) {
  return (info[0] && info[info[0] + 1] > info[0]);
}


x86 assembly (clang, -O0):
<has_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
je     1138 <has_stats+0x38>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_stats>:
mov    (%rdi),%ecx
test   %ecx,%ecx
je     1112 <has_stats+0x12>
lea    0x1(%rcx),%edx
xor    %eax,%eax
cmp    %ecx,(%rdi,%rdx,4)
seta   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @has_stats(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %8, i64 %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = icmp ugt i32 %15, %18
br label %20
20: ; preds = %7, %1
%21 = phi i1 [ false, %1 ], [ %19, %7 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @has_stats(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i32 %2, 1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp ugt i32 %8, %2
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, unsigned char);
void si475xAMRX_set_volume(unsigned char volume) {
  si475x_set_property(0x0301, 0);
  si475x_set_property(0x0300, volume);
}


x86 assembly (clang, -O0):
<si475xAMRX_set_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
mov    $0x300,%edi
movzbl -0x1(%rbp),%esi
call   1030 <si475x_set_property@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMRX_set_volume>:
push   %rbx
mov    %edi,%ebx
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
mov    $0x300,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xAMRX_set_volume(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @si475x_set_property(i32 769, i8 zeroext 0)
%4 = load i8, i8* %2
%5 = call i32 @si475x_set_property(i32 768, i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @si475xAMRX_set_volume(i8 zeroext %0) {
%2 = tail call i32 @si475x_set_property(i32 769, i8 zeroext 0)
%3 = tail call i32 @si475x_set_property(i32 768, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void stat() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @stat() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *filenameof(char *fname) {
  char *p;
  p = strrchr(fname, '/');
  if (p)
    fname = p + 1;
  return fname;
}


x86 assembly (clang, -O0):
<filenameof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <filenameof+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filenameof>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @filenameof(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ bignum_bitwise_not(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ untag_object(int /*<<< orphan*/);
void primitive_bignum_not(void) {
  drepl(tag_bignum(bignum_bitwise_not(untag_object(dpeek()))));
}


x86 assembly (clang, -O0):
<primitive_bignum_not>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1050 <bignum_bitwise_not@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
call   1060 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_not>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1050 <bignum_bitwise_not@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_not() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @untag_object(i32 %1)
%3 = call i32 @bignum_bitwise_not(i32 %2)
%4 = call i32 @tag_bignum(i32 %3)
%5 = call i32 @drepl(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_not() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @untag_object(i32 %1)
%3 = tail call i32 @bignum_bitwise_not(i32 %2)
%4 = tail call i32 @tag_bignum(i32 %3)
%5 = tail call i32 @drepl(i32 %4)
ret void
}
void gtk_action_group_set_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_set_visible() {
ret void
}
void _align(int *val, int n) {
  *val = (*val + (n - 1)) & ~(n - 1);
  return;
}


x86 assembly (clang, -O0):
<_align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_align>:
mov    (%rdi),%eax
add    %esi,%eax
add    $0xffffffff,%eax
neg    %esi
and    %eax,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @_align(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* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = load i32*, i32** %3
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @_align(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %1, -1
%5 = add nsw i32 %4, %3
%6 = sub i32 0, %1
%7 = and i32 %5, %6
store i32 %7, i32* %0
ret void
}
/* Variables and functions */
int Fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int p2(int n) {
  int x;
  x = Fibonacci(n);
  printf("   P2 recebeu %d\n", n);
  printf("   Fibonacci %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<p2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Fibonacci@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <Fibonacci@plt>
mov    %eax,%ebp
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c" P2 recebeu %d\0A\00"
@.str.1 = [17 x i8] c" Fibonacci %d\0A\00"
define i32 @p2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Fibonacci(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c" P2 recebeu %d\0A\00"
@.str.1 = [17 x i8] c" Fibonacci %d\0A\00"
define i32 @p2(i32 %0) {
%2 = tail call i32 @Fibonacci(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out(char *);
void outnothing(void const *ptr, long size, int ndx) {
  (void)ptr;
  (void)size;
  (void)ndx;
  out("{ }");
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"{ }\00"
define void @outnothing(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @out(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"{ }\00"
define void @outnothing(i8* nocapture readnone %0, i64 %1, i32 %2) {
%4 = tail call i32 @out(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reuse_out_of_mem();
char *strdup(char const *);
char *xstrdup2(const char *str) {
  char *ptr;
  if (!str || !*str)
    return NULL;
  ptr = strdup(str);
  if (ptr == NULL)
    reuse_out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xstrdup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <xstrdup2+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1151 <xstrdup2+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1178 <xstrdup2+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1170 <xstrdup2+0x50>
mov    $0x0,%al
call   1030 <reuse_out_of_mem@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup2>:
push   %rbx
test   %rdi,%rdi
je     1143 <xstrdup2+0x23>
cmpb   $0x0,(%rdi)
je     1143 <xstrdup2+0x23>
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1145 <xstrdup2+0x25>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <reuse_out_of_mem@plt>
jmp    1145 <xstrdup2+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup2(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i8* @strdup(i8* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @reuse_out_of_mem()
br label %11
11: ; preds = %6, %9, %1, %3
%12 = phi i8* [ null, %3 ], [ null, %1 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
/* Variables and functions */
scalar_t__ malloc(int);
void copierIntE(const void *valeur, void **lieu) {
  (*lieu) = (void *)malloc(sizeof(int));
  (**((int **)lieu)) = (*((int *)valeur));
}


x86 assembly (clang, -O0):
<copierIntE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copierIntE>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    (%r14),%ecx
mov    %ecx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @copierIntE(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i8*
%7 = load i8**, i8*** %4
store i8* %6, i8** %7
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8**, i8*** %4
%12 = bitcast i8** %11 to i32**
%13 = load i32*, i32** %12
store i32 %10, i32* %13
ret void
}

LLVM IR (-O2):
define void @copierIntE(i8* nocapture %0, i8** nocapture writeonly %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = inttoptr i64 %3 to i32*
store i32 %6, i32* %7
ret void
}
int cmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }


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

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_file_cb(char *filedata, int len, void *app_ctx) {
  printf("data %s", filedata);
}


x86 assembly (clang, -O0):
<test_file_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"data %s\00"
define void @test_file_cb(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void empty_void_function_int_param(int integer_parama) {}


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

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

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

LLVM IR (-O2):
define void @empty_void_function_int_param(i32 %0) {
ret void
}
void seed(int *i) { *i = 281701264; }


x86 assembly (clang, -O0):
<seed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x10ca6b90,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed>:
movl   $0x10ca6b90,(%rdi)
ret

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

LLVM IR (-O2):
define void @seed(i32* nocapture writeonly %0) {
store i32 281701264, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void je_rj(unsigned char saut) {
  put8(0x74);
  put8(saut);
}


x86 assembly (clang, -O0):
<je_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x74,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<je_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x74,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @je_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 116)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @je_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 116)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
void foo215(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo215(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage : "
          "dns_forwarder_client"
          " [--ip <ipaddr> ] [--cafile <cafile>]\n"
          "[--keyfile <keyfile>] [--chainfile <chainfile>] [--port <port>]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [131 x i8] c"Usage : dns_forwarder_client [--ip <ipaddr> ] [--cafile <cafile>]\0A[--keyfile <keyfile>] [--chainfile <chainfile>] [--port <port>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [131 x i8] c"Usage : dns_forwarder_client [--ip <ipaddr> ] [--cafile <cafile>]\0A[--keyfile <keyfile>] [--chainfile <chainfile>] [--port <port>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_ADDD(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xfe);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_ADDD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xfe,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_ADDD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xfe,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_ADDD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 254)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_ADDD(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 254)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
void dput(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<dput>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dput>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.dput = [5 x i8] c"dput\00"
define void @dput() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.dput, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.dput = [5 x i8] c"dput\00"
define void @dput() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.dput, i64 0, i64 0))
ret void
}
void check_incoming_control_channel(struct context *c) {}


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

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

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

LLVM IR (-O2):
%struct.context = type opaque
define void @check_incoming_control_channel(%struct.context* nocapture %0) {
ret void
}
/* Variables and functions */
double f(double);
double f_prime(double);
double next_guess_nm(double x_i) { return x_i - (f(x_i) / f_prime(x_i)); }


x86 assembly (clang, -O0):
<next_guess_nm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <f@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <f_prime@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_guess_nm>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <f@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <f_prime@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @next_guess_nm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @f(double %4)
%6 = load double, double* %2
%7 = call double @f_prime(double %6)
%8 = fdiv double %5, %7
%9 = fsub double %3, %8
ret double %9
}

LLVM IR (-O2):
define double @next_guess_nm(double %0) {
%2 = tail call double @f(double %0)
%3 = tail call double @f_prime(double %0)
%4 = fdiv double %2, %3
%5 = fsub double %0, %4
ret double %5
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_write_register(struct tl880_dev *, int,
                                        unsigned short);
void tl880_init_sys_pll_eq(struct tl880_dev *tl880dev,
                           unsigned short reference) {
  tl880_write_register(tl880dev, 0x5000,
                       ((reference & 0x3ff) << 0x11) - 0x1e6e0);
}


x86 assembly (clang, -O0):
<tl880_init_sys_pll_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%eax
and    $0x3ff,%eax
shl    $0x11,%eax
sub    $0x1e6e0,%eax
mov    $0x5000,%esi
movzwl %ax,%edx
call   1030 <tl880_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_init_sys_pll_eq>:
mov    $0x5000,%esi
mov    $0x1920,%edx
jmp    1030 <tl880_write_register@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_init_sys_pll_eq(%struct.tl880_dev* %0, i16 zeroext %1) {
%3 = alloca %struct.tl880_dev*
%4 = alloca i16
store %struct.tl880_dev* %0, %struct.tl880_dev** %3
store i16 %1, i16* %4
%5 = load %struct.tl880_dev*, %struct.tl880_dev** %3
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = and i32 %7, 1023
%9 = shl i32 %8, 17
%10 = sub nsw i32 %9, 124640
%11 = trunc i32 %10 to i16
%12 = call i32 @tl880_write_register(%struct.tl880_dev* %5, i32 20480, i16 zeroext %11)
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_init_sys_pll_eq(%struct.tl880_dev* %0, i16 zeroext %1) {
%3 = tail call i32 @tl880_write_register(%struct.tl880_dev* %0, i32 20480, i16 zeroext 6432)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *malloc0(size_t size) {
  void *buf = malloc(size);
  if (!buf) {
    return buf;
  }
  memset(buf, 0, size);
  return buf;
}


x86 assembly (clang, -O0):
<malloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <malloc0+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <malloc0+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <malloc0+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @malloc0(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t ZOBRIST_BOARD_SQ_INDEX(int pc, int sq) {
  const size_t npieces = 12;
  const size_t index = npieces * sq + pc;
  assert(pc >= 0 && pc <= npieces);
  assert(index >= 0 && index < 64 * 12);
  return index;
}


x86 assembly (clang, -O0):
<ZOBRIST_BOARD_SQ_INDEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0xc,-0x10(%rbp)
movslq -0x8(%rbp),%rax
imul   $0xc,%rax,%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x19(%rbp)
jl     1156 <ZOBRIST_BOARD_SQ_INDEX+0x46>
movslq -0x4(%rbp),%rax
cmp    $0xc,%rax
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x1a(%rbp)
jb     1181 <ZOBRIST_BOARD_SQ_INDEX+0x71>
cmpq   $0x300,-0x18(%rbp)
setb   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZOBRIST_BOARD_SQ_INDEX>:
push   %rbx
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
movslq %edi,%rcx
lea    (%rcx,%rax,4),%rbx
xor    %edi,%edi
cmp    $0xd,%ecx
setb   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x300,%rbx
setb   %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ZOBRIST_BOARD_SQ_INDEX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i64 12, i64* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 12, %8
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = add i64 %9, %11
store i64 %12, i64* %6
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = icmp ule i64 %17, 12
br label %19
19: ; preds = %15, %2
%20 = phi i1 [ false, %2 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i64, i64* %6
%24 = icmp uge i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i64, i64* %6
%27 = icmp ult i64 %26, 768
br label %28
28: ; preds = %25, %19
%29 = phi i1 [ false, %19 ], [ %27, %25 ]
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = load i64, i64* %6
ret i64 %32
}

LLVM IR (-O2):
define i64 @ZOBRIST_BOARD_SQ_INDEX(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = mul nsw i64 %3, 12
%5 = sext i32 %0 to i64
%6 = add nsw i64 %4, %5
%7 = icmp ult i32 %0, 13
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp ult i64 %6, 768
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i64 %6
}
int ft_isascii(int c) {
  if (c >= 0 && c <= 127)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <ft_isascii+0x27>
cmpl   $0x7f,-0x8(%rbp)
jg     1127 <ft_isascii+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isascii+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isascii(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int rmdir(char const *);
int /*<<< orphan*/ stat(char const *, struct stat *);
int unlink(char const *);
int remove(const char *pathname) {
  struct stat buf;
  stat(pathname, &buf);
  if (S_ISDIR(buf.st_mode)) {
    return rmdir(pathname);
  } else {
    return unlink(pathname);
  }
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <stat@plt>
mov    -0x18(%rbp),%edi
call   1050 <S_ISDIR@plt>
cmp    $0x0,%rax
je     117c <remove+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <rmdir@plt>
mov    %eax,-0x4(%rbp)
jmp    1188 <remove+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1060 <stat@plt>
mov    0x8(%rsp),%edi
call   1050 <S_ISDIR@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
test   %rax,%rax
je     116d <remove+0x2d>
pop    %rbx
jmp    1040 <rmdir@plt>
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @rmdir(i8* %12)
store i32 %13, i32* %2
br label %17
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = call i32 @unlink(i8* %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @remove(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISDIR(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @rmdir(i8* %0)
br label %13
11: ; preds = %1
%12 = tail call i32 @unlink(i8* %0)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
int main() {
  setup();
  while (1) {
    loop();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @loop()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ heap_stats();
void _heap_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  heap_stats();
}


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

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

LLVM IR (-O0):
define void @_heap_handler(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 = load i8**, i8*** %4
%7 = call i32 (...) @heap_stats()
ret void
}

LLVM IR (-O2):
define void @_heap_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @heap_stats()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(int argc, char *argv[]) {
  uint32_t t;
  t = 26 << 27;
  printf("%08lx\n", (unsigned long)t);
  (void)argc;
  (void)argv;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xd0000000,-0x14(%rbp)
movslq -0x14(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%08lx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -805306368, i32* %6
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%08lx\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 -805306368)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_def_byte(void) { output_with_tab(".db\t"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c".db\09\00"
define void @gen_def_byte() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".db\09\00"
define void @gen_def_byte() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getenv(char const *);
int /*<<< orphan*/ stderr;
float env2f(const char *n) {
  char *v_ch = getenv(n);
  if (v_ch == NULL) {
    fprintf(stderr, "(rw) ERROR: environment variable `%s' should be set\n", n);
    exit(2);
  }
  return atof(v_ch);
}


x86 assembly (clang, -O0):
<env2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <env2f+0x47>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <atof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env2f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1157 <env2f+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atof@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"(rw) ERROR: environment variable `%s' should be set\0A\00"
define float @env2f(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call float @atof(i8* %14)
ret float %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"(rw) ERROR: environment variable `%s' should be set\0A\00"
define float @env2f(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
%9 = tail call float @atof(i8* %2)
ret float %9
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t time_nsec() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return (uint64_t)t.tv_sec * 1000000000 + t.tv_nsec;
}


x86 assembly (clang, -O0):
<time_nsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_nsec>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @time_nsec() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @time_nsec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
int ar5312_init_devices(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ar5312_init_devices() {
ret i32 0
}
int parent(int x) {
  int y = x / 2;
  return y;
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
int dldump(const char *str1, const char *str2, int x) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dldump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @dldump(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
double log2l(long double);
long double log10l(long double x) {
  double log10_2;
  return log10_2 * log2l(x);
}


x86 assembly (clang, -O0):
<log10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log2l@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <log2l@plt>
flds   0xeda(%rip)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca double
store x86_fp80 %0, x86_fp80* %2
%4 = load double, double* %3
%5 = load x86_fp80, x86_fp80* %2
%6 = call double @log2l(x86_fp80 %5)
%7 = fmul double %4, %6
%8 = fpext double %7 to x86_fp80
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = tail call double @log2l(x86_fp80 %0)
ret x86_fp80 0xK7FFFC000000000000000
}