xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int /*<<< orphan*/, int);
int main() {
  int a[] = {1,  2,  3,  4,  5,   6,   7,   8,   9,   12, 13,
             45, 67, 89, 99, 101, 111, 123, 134, 565, 677};
  int i = search(a, 99, 0, sizeof(a) / sizeof(a[0]) - 1);
  printf("find 99 at %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x54,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x63,%esi
xor    %edx,%edx
mov    $0x14,%ecx
call   1040 <search@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf26(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x63,%esi
xor    %edx,%edx
mov    $0x14,%ecx
call   1040 <search@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [21 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 12, i32 13, i32 45, i32 67, i32 89, i32 99, i32 101, i32 111, i32 123, i32 134, i32 565, i32 677]
@.str = [15 x i8] c"find 99 at %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [21 x i32]* %2 to i8*
%5 = getelementptr inbounds [21 x i32], [21 x i32]* %2, i64 0, i64 0
%6 = call i32 @search(i32* %5, i32 99, i32 0, i32 20)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [21 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 12, i32 13, i32 45, i32 67, i32 89, i32 99, i32 101, i32 111, i32 123, i32 134, i32 565, i32 677]
@.str = [15 x i8] c"find 99 at %d\0A\00"
define i32 @main() {
%1 = alloca [21 x i32]
%2 = bitcast [21 x i32]* %1 to i8*
%3 = getelementptr inbounds [21 x i32], [21 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 99, i32 0, i32 20)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void CfgDepBase_ENT_SET_OBJ(bb, ss, vv) int *bb, ss, vv;
{
  int r, b;
  CfgDepBase_SRC_HIH_EQL_SET_OBJ(&b, &r, ss, vv);
  if (b == 0) {
    CfgDepBase_PSH_SET_OBJ(bb, ss, vv);
  } else {
    *bb = 1;
  }
}


x86 assembly (clang, -O0):
<CfgDepBase_ENT_SET_OBJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <CfgDepBase_SRC_HIH_EQL_SET_OBJ@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1167 <CfgDepBase_ENT_SET_OBJ+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1040 <CfgDepBase_PSH_SET_OBJ@plt>
jmp    1171 <CfgDepBase_ENT_SET_OBJ+0x51>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CfgDepBase_ENT_SET_OBJ>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <CfgDepBase_SRC_HIH_EQL_SET_OBJ@plt>
cmpl   $0x0,0x8(%rsp)
je     1154 <CfgDepBase_ENT_SET_OBJ+0x34>
movl   $0x1,(%r14)
jmp    1162 <CfgDepBase_ENT_SET_OBJ+0x42>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <CfgDepBase_PSH_SET_OBJ@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @CfgDepBase_ENT_SET_OBJ(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @CfgDepBase_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %8, i32* %7, i32 %9, i32 %10)
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @CfgDepBase_PSH_SET_OBJ to i32 (i32*, i32, i32, ...)*)(i32* %15, i32 %16, i32 %17)
br label %21
19: ; preds = %3
%20 = load i32*, i32** %4
store i32 1, i32* %20
br label %21
21: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @CfgDepBase_ENT_SET_OBJ(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @CfgDepBase_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %5, i32* %4, i32 %1, i32 %2)
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @CfgDepBase_PSH_SET_OBJ to i32 (i32*, i32, i32, ...)*)(i32* %0, i32 %1, i32 %2)
br label %14
13: ; preds = %3
store i32 1, i32* %0
br label %14
14: ; preds = %13, %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void f3(int size) {
  char src[12] = "helloworld";
  char dest[12];
  if (size < 0)
    memcpy(dest, src, size);
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1149 <f3+0x39>
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
test   %edi,%edi
js     1133 <f3+0x23>
add    $0x18,%rsp
ret
mov    %edi,%edx
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f3.src = [12 x i8] c"helloworld\00\00"
define void @f3(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
br label %13
13: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.f3.src = [12 x i8] c"helloworld\00\00"
define void @f3(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @memcpy(i8* %5, i8* %4, i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
int divv(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<divv>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @divv(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
void *SIMD_ALIGNED_MALLOC(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *SIMD_ALIGNED_CALLOC(size_t nmemb, size_t size) {
  void *p = SIMD_ALIGNED_MALLOC(nmemb * size);
  if (p)
    memset(p, 0, nmemb * size);
  return p;
}


x86 assembly (clang, -O0):
<SIMD_ALIGNED_CALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <SIMD_ALIGNED_MALLOC@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <SIMD_ALIGNED_CALLOC+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIMD_ALIGNED_CALLOC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <SIMD_ALIGNED_MALLOC@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <SIMD_ALIGNED_CALLOC+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @SIMD_ALIGNED_CALLOC(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @SIMD_ALIGNED_MALLOC(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
unsigned hash(char *s) {
  unsigned hash_val;
  for (hash_val = 0; *s != '\0'; s++)
    hash_val = (unsigned)*s + 31 * hash_val;
  return hash_val;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ out(char *);
int /*<<< orphan*/ outputaddresses();
int /*<<< orphan*/ outputenum();
int /*<<< orphan*/ outputpieces();
int /*<<< orphan*/ outputstruct();
void output(void) {
  out("#include <stddef.h>\n");
  out("#include <elf.h>\n");
  out("\n");
  outputaddresses();
  outputenum();
  outputstruct();
  outputpieces();
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1050 <out@plt>
lea    0xeae(%rip),%rdi
call   1050 <out@plt>
lea    0xea0(%rip),%rdi
call   1050 <out@plt>
mov    $0x0,%al
call   1060 <outputaddresses@plt>
mov    $0x0,%al
call   1040 <outputenum@plt>
mov    $0x0,%al
call   1070 <outputstruct@plt>
mov    $0x0,%al
call   1030 <outputpieces@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <out@plt>
lea    0xeb1(%rip),%rdi
call   1050 <out@plt>
lea    0xea3(%rip),%rdi
call   1050 <out@plt>
xor    %eax,%eax
call   1060 <outputaddresses@plt>
xor    %eax,%eax
call   1040 <outputenum@plt>
xor    %eax,%eax
call   1070 <outputstruct@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <outputpieces@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"#include <stddef.h>\0A\00"
@.str.1 = [18 x i8] c"#include <elf.h>\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @output() {
%1 = call i32 @out(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @out(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @outputaddresses()
%5 = call i32 (...) @outputenum()
%6 = call i32 (...) @outputstruct()
%7 = call i32 (...) @outputpieces()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"#include <stddef.h>\0A\00"
@.str.1 = [18 x i8] c"#include <elf.h>\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @output() {
%1 = tail call i32 @out(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @out(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @outputaddresses()
%5 = tail call i32 (...) @outputenum()
%6 = tail call i32 (...) @outputstruct()
%7 = tail call i32 (...) @outputpieces()
ret void
}
int nt_little_endian() {
  int to_return = 1;
  union {
    int number;
    char bytes[sizeof(int)];
  } u;
  unsigned int i;
  u.number = (int)0;
  for (i = 0; i < sizeof(int); i++) {
    u.number |= (int)(i + 1) << (8 * i);
  }
  for (i = 0; i < sizeof(int); i++) {
    if ((unsigned int)u.bytes[i] != i + 1) {
      to_return = 0;
      break;
    }
  }
  return to_return;
}


x86 assembly (clang, -O0):
<nt_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x4,%rax
jae    1148 <nt_little_endian+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <nt_little_endian+0x19>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x4,%rax
jae    1191 <nt_little_endian+0x91>
mov    -0xc(%rbp),%eax
movsbl -0x8(%rbp,%rax,1),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     117e <nt_little_endian+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    1191 <nt_little_endian+0x91>
jmp    1183 <nt_little_endian+0x83>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <nt_little_endian+0x4f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @nt_little_endian() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = alloca i32
store i32 1, i32* %1
%4 = bitcast %union.anon* %2 to i32*
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = icmp ult i64 %7, 4
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add i32 %10, 1
%12 = load i32, i32* %3
%13 = mul i32 8, %12
%14 = shl i32 %11, %13
%15 = bitcast %union.anon* %2 to i32*
%16 = load i32, i32* %15
%17 = or i32 %16, %14
store i32 %17, i32* %15
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
store i32 0, i32* %3
br label %22
22: ; preds = %38, %21
%23 = load i32, i32* %3
%24 = zext i32 %23 to i64
%25 = icmp ult i64 %24, 4
br i1 %25, label %26, label %41
26: ; preds = %22
%27 = bitcast %union.anon* %2 to [4 x i8]*
%28 = load i32, i32* %3
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %27, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = load i32, i32* %3
%34 = add i32 %33, 1
%35 = icmp ne i32 %32, %34
br i1 %35, label %36, label %37
36: ; preds = %26
store i32 0, i32* %1
br label %41
37: ; preds = %26
br label %38
38: ; preds = %37
%39 = load i32, i32* %3
%40 = add i32 %39, 1
store i32 %40, i32* %3
br label %22
41: ; preds = %36, %22
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
define i32 @nt_little_endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n > 0) {
    printf("positive");
  } else if (n < 0) {
    printf("Negative");
  } else
    printf("zero");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
cmpl   $0x0,-0x8(%rbp)
jge    1175 <main+0x55>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xece(%rip),%rax
lea    0xed0(%rip),%rcx
cmovs  %rax,%rcx
lea    0xeb3(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"positive\00"
@.str.2 = [9 x i8] c"Negative\00"
@.str.3 = [5 x i8] c"zero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"positive\00"
@.str.2 = [9 x i8] c"Negative\00"
@.str.3 = [5 x i8] c"zero\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
%6 = icmp slt i32 %4, 0
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%8 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %7
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
char *malloc(unsigned int);
char *get_data_mem(unsigned int sz) { return malloc(sz); }


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

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

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

LLVM IR (-O2):
define noalias i8* @get_data_mem(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void CANDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<CANDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANDisable>:
movslq %edi,%rax
orl    $0x1,(%rax)
ret

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

LLVM IR (-O2):
define void @CANDisable(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 1
store volatile i32 %5, i32* %3
ret void
}
void glGetStringi(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetStringi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a) {
  int *p;
  p = a;
  while (p) {
    printf("%d;", *p);
    p = *(p + 1);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <print+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <print+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1143 <print+0x33>
mov    %rdi,%rbx
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movslq 0x4(%rbx),%rbx
test   %rbx,%rbx
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d;\00"
define void @print(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
br label %5
5: ; preds = %8, %1
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %3
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d;\00"
define void @print(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32* [ %10, %3 ], [ %0, %1 ]
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %4, i64 1
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vswscanf(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
             int /*<<< orphan*/);
int __isoc99_vswscanf(const wchar_t *restrict input,
                      const wchar_t *restrict format, va_list args) {
  return vswscanf(input, format, args);
}


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

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

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

LLVM IR (-O2):
define i32 @__isoc99_vswscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = tail call i32 @vswscanf(i32* %0, i32* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509V3_EXT_METHOD;
typedef int /*<<< orphan*/ X509V3_CTX;

/* Variables and functions */
void *ASN1_NULL_new();
void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
                       const char *str) {
  return ASN1_NULL_new();
}


x86 assembly (clang, -O0):
<s2i_ocsp_nocheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <ASN1_NULL_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @s2i_ocsp_nocheck(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @ASN1_NULL_new()
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumOfNaturalNumbers(int);
int main() {
  int zeroToNumber = 5;
  zeroToNumber = sumOfNaturalNumbers(zeroToNumber);
  printf("Summation is %d", zeroToNumber);
  return 1;
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sumOfNaturalNumbers@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <sumOfNaturalNumbers@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Summation is %d\00"
define i32 @main() {
%1 = tail call i32 @sumOfNaturalNumbers(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
unsigned int hash_str(const void *key) {
  const unsigned char *str = key;
  unsigned int hash = 5381;
  unsigned int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1149 <hash_str+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash_str+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_str+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_str+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_func80(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<test_func80>:
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):
<test_func80>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @test_func80(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int v_lanes64(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @v_lanes64() {
ret i32 1
}

LLVM IR (-O2):
define i32 @v_lanes64() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree(void *ptr) { free(ptr); }


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

LLVM IR (-O0):
define void @zfree(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 @zfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solve_with_multiprecision(int dcp, int max, double eps, int *nit) {
  int fail = _ada_use_c2phc(275, &max, nit, &eps);
  return fail;
}


x86 assembly (clang, -O0):
<solve_with_multiprecision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x113,%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rcx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_with_multiprecision>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x113,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @solve_with_multiprecision(i32 %0, i32 %1, double %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
store i32 %1, i32* %5
store double %2, double* %6
%7 = call i32 @_ada_use_c2phc(i32 275, i32* %5, i32* %3, double* %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int _wyr32(int /*<<< orphan*/ const *);
uint64_t __wyr64(const uint8_t *p) { return (_wyr32(p) << 32) | _wyr32(p + 4); }


x86 assembly (clang, -O0):
<__wyr64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_wyr32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <_wyr32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wyr64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_wyr32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_wyr32@plt>

LLVM IR (-O0):
define i32 @__wyr64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @_wyr32(i32* %3)
%5 = shl i32 %4, 32
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @_wyr32(i32* %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__wyr64(i32* %0) {
%2 = tail call i32 @_wyr32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @_wyr32(i32* %3)
ret i32 poison
}
/* Variables and functions */
void *compare(void *a, void *b) {
  if (a == b) {
    return a;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1127 <compare+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <compare+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = select i1 %3, i8* %0, i8* null
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _hostname_usage(void) {
  fputs("Usage: "
        "hostname"
        " [name]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_hostname_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hostname_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: hostname [name]\0A\00"
@stderr = global i32 0
define i32 @_hostname_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: hostname [name]\0A\00"
@stderr = global i32 0
define i32 @_hostname_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int getline(char **, size_t *, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
void term_read_line(char **raw_input) {
  size_t len = 0;
  if (getline(raw_input, &len, stdin) == -1) {
    *raw_input = malloc(sizeof(char) * 10);
    strcpy(*raw_input, "exit\n");
  }
  return;
}


x86 assembly (clang, -O0):
<term_read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
jne    118a <term_read_line+0x5a>
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_read_line>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
jne    1175 <term_read_line+0x45>
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"exit\0A\00"
define void @term_read_line(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
store i64 0, i64* %3
%4 = load i8**, i8*** %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %4, i64* %3, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = call i8* @malloc(i32 10)
%10 = load i8**, i8*** %2
store i8* %9, i8** %10
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"exit\0A\00"
define void @term_read_line(i8** %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i32, i32* @stdin
%5 = call i32 @getline(i8** %0, i64* %2, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call dereferenceable_or_null(10) i8* @malloc(i32 10)
store i8* %8, i8** %0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
const int8_t *pinyin_enhance_pylist_get(const int8_t *count, int index) {
  return count + index * 3 + 1;
}


x86 assembly (clang, -O0):
<pinyin_enhance_pylist_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinyin_enhance_pylist_get>:
lea    (%rsi,%rsi,2),%eax
cltq
lea    (%rdi,%rax,4),%rax
add    $0x4,%rax
ret

LLVM IR (-O0):
define i32* @pinyin_enhance_pylist_get(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 1
ret i32* %10
}

LLVM IR (-O2):
define i32* @pinyin_enhance_pylist_get(i32* readnone %0, i32 %1) {
%3 = mul nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
ret i32* %6
}
/* Variables and functions */
scalar_t__ pmlstate_query_close(void ***);
int pml_query_close(void ***objptr) {
  return (int)pmlstate_query_close(objptr);
}


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

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

LLVM IR (-O0):
define i32 @pml_query_close(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = call i64 @pmlstate_query_close(i8*** %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @pml_query_close(i8*** %0) {
%2 = tail call i64 @pmlstate_query_close(i8*** %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void xcls(void) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @xcls() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void cont_Check(void) {}


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

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

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

LLVM IR (-O2):
define void @cont_Check() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d\t", a[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int testLib5(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testLib5() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int);
void b_space(int n) { print("skip %d\n", n); }


x86 assembly (clang, -O0):
<b_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_space>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"skip %d\0A\00"
define void @b_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"skip %d\0A\00"
define void @b_space(i32 %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
procedure(void *current, void (*symbol)(void *)) {
  printf("Current is %x, symbol %x\n", current, symbol);
}


x86 assembly (clang, -O0):
<procedure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procedure>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Current is %x, symbol %x\0A\00"
define i32 @procedure(i8* %0, void (i8*)* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca void (i8*)*
store i8* %0, i8** %4
store void (i8*)* %1, void (i8*)** %5
%6 = load i8*, i8** %4
%7 = load void (i8*)*, void (i8*)** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, void (i8*)* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [26 x i8] c"Current is %x, symbol %x\0A\00"
define i32 @procedure(i8* %0, void (i8*)* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, void (i8*)* %1)
ret i32 undef
}
char *Test1() { return "Expected this failure"; }


x86 assembly (clang, -O0):
<Test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Expected this failure\00"
define i8* @Test1() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Expected this failure\00"
define i8* @Test1() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}