xunge/DecIR huggingface dataset:
int SysCall3(int EAX__, int EBX__, int ECX__) {
  asm volatile("" ::"a"(EAX__));
  asm volatile("" ::"b"(EBX__));
  asm volatile("" ::"c"(ECX__));
  asm volatile("int $0x40");
  register int res;
  asm volatile("" : "=a"(res) :);
  return res;
}


x86 assembly (clang, -O0):
<SysCall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
int    $0x40
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCall3>:
push   %rbx
mov    %edx,%ecx
mov    %esi,%ebx
mov    %edi,%eax
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SysCall3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @SysCall3(i32 %0, i32 %1, i32 %2) {
tail call void asm sideeffect "", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
tail call void asm sideeffect "", "{bx},~{dirflag},~{fpsr},~{flags}"(i32 %1)
tail call void asm sideeffect "", "{cx},~{dirflag},~{fpsr},~{flags}"(i32 %2)
tail call void asm sideeffect "int $$0x40", "~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %4
}
/* Variables and functions */
int multiply(int, int);
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("25*25= %d\n", multiply(25, 25));
  printf("5^3= %d\n", power(5, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x19,%esi
mov    %esi,%edi
call   1040 <multiply@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x19,%edi
mov    $0x19,%esi
call   1040 <multiply@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <power@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"25*25= %d\0A\00"
@.str.1 = [9 x i8] c"5^3= %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @multiply(i32 25, i32 25)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @power(i32 5, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"25*25= %d\0A\00"
@.str.1 = [9 x i8] c"5^3= %d\0A\00"
define i32 @main() {
%1 = tail call i32 @multiply(i32 25, i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @power(i32 5, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct bhv_vnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ make_bad_inode(int /*<<< orphan*/);
int /*<<< orphan*/ vn_to_inode(struct bhv_vnode *);
void vn_mark_bad(struct bhv_vnode *vp) { make_bad_inode(vn_to_inode(vp)); }


x86 assembly (clang, -O0):
<vn_mark_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
call   1030 <make_bad_inode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_mark_bad>:
push   %rax
call   1040 <vn_to_inode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <make_bad_inode@plt>

LLVM IR (-O0):
%struct.bhv_vnode = type { i32 }
define void @vn_mark_bad(%struct.bhv_vnode* %0) {
%2 = alloca %struct.bhv_vnode*
store %struct.bhv_vnode* %0, %struct.bhv_vnode** %2
%3 = load %struct.bhv_vnode*, %struct.bhv_vnode** %2
%4 = call i32 @vn_to_inode(%struct.bhv_vnode* %3)
%5 = call i32 @make_bad_inode(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.bhv_vnode = type { i32 }
define void @vn_mark_bad(%struct.bhv_vnode* %0) {
%2 = tail call i32 @vn_to_inode(%struct.bhv_vnode* %0)
%3 = tail call i32 @make_bad_inode(i32 %2)
ret void
}
int test_imm_0Dint8_mem(signed char *val) {
  return ((*val) & (0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Dint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Dint8_mem>:
testb  $0xd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 13
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *s1(size_t n) { return malloc(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @s1(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int test_imm_76int8_reg(signed char val) {
  return ((val) & (-0x76 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_76int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_76int8_reg>:
test   $0x8a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_76int8_reg(i8 signext %0) {
%2 = and i8 %0, -118
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void main() {
  unsigned int cpu_info[4];
  __asm__ __volatile__("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1"
                       : "=a"(cpu_info[0]), "=&r"(cpu_info[1]),
                         "=c"(cpu_info[2]), "=d"(cpu_info[3])
                       : "0"(0U), "2"(0U));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%eax
xchg   %esi,%ebx
cpuid
xchg   %esi,%ebx
mov    %esi,-0x14(%rbp)
mov    %eax,%esi
mov    -0x14(%rbp),%eax
mov    %esi,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    %ecx,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
xor    %ecx,%ecx
xchg   %esi,%ebx
cpuid
xchg   %esi,%ebx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
%6 = call { i32, i32, i32, i32 } asm sideeffect "xchgl %ebx, ${1:k}; cpuid; xchgl %ebx, ${1:k}", "={ax},=&r,={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 0, i32 0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %2
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call { i32, i32, i32, i32 } asm sideeffect "xchgl %ebx, ${1:k}; cpuid; xchgl %ebx, ${1:k}", "={ax},=&r,={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int volatile);
int main() {
  volatile uint32_t a = 0xffffffff, b = 0;
  b = a & 150000;
  printf("%u\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x249f0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
movl   $0x0,(%rsp)
mov    $0x249f0,%eax
and    0x4(%rsp),%eax
mov    %eax,(%rsp)
mov    (%rsp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store volatile i32 -1, i32* %1
%4 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%5 = load volatile i32, i32* %1
%6 = and i32 %5, 150000
store volatile i32 %6, i32* %2
%7 = load volatile i32, i32* %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int sommaDispari(int n) {
  if (n == 0)
    return 0;
  return (2 * (n - 1) + 1) + sommaDispari(n - 1);
}


x86 assembly (clang, -O0):
<sommaDispari>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sommaDispari+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1155 <sommaDispari+0x45>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sommaDispari@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sommaDispari>:
test   %edi,%edi
je     111f <sommaDispari+0x1f>
lea    -0x1(%rdi),%ecx
lea    (%rdi,%rdi,1),%eax
add    $0xfffffffd,%eax
imul   %ecx,%eax
lea    (%rax,%rdi,2),%eax
add    $0xfffffffe,%edi
imul   %ecx,%edi
or     $0x1,%edi
sub    %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sommaDispari(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = shl i32 %0, 1
%6 = add i32 %5, -3
%7 = mul i32 %4, %6
%8 = add i32 %7, %5
%9 = add i32 %0, -2
%10 = mul i32 %4, %9
%11 = or i32 %10, 1
%12 = sub i32 %8, %11
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_char(void) { fprintf(stdout, "char function\n"); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"char function\0A\00"
define void @print_char() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"char function\0A\00"
define void @print_char() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x90() {
  Assert_real((isbdigit(144) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              725, ("isbdigit should be 0 for 0x90"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x90>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d5,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x90>:
push   %rax
mov    $0x90,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2d5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x90\00"
define void @t_isbdigit_0x90() {
%1 = call i64 @isbdigit(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x90\00"
define void @t_isbdigit_0x90() {
%1 = tail call i64 @isbdigit(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
adrx0regx1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((((unsigned short *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzwl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114c <adrx0regx1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <adrx0regx1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0regx1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = load i16*, i16** %13
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i16, i16* %21, i64 %23
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = icmp sle i32 %20, %26
br i1 %27, label %28, label %29
28: ; preds = %6
store i32 1, i32* %7
br label %30
29: ; preds = %6
store i32 0, i32* %7
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
define i32 @adrx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* %5, i64 %10
%12 = load i16, i16* %11
%13 = icmp ule i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int ccnl_str2suite(char *cp) {
  if (!cp)
    return -1;
  return -1;
}


x86 assembly (clang, -O0):
<ccnl_str2suite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ccnl_str2suite+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <ccnl_str2suite+0x26>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ccnl_str2suite(i8* nocapture readnone %0) {
ret i32 -1
}
unsigned long FindCarrierFrequency(void *devHandle) { return 0; }


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

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

LLVM IR (-O0):
define i64 @FindCarrierFrequency(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @FindCarrierFrequency(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *xcalloc(size_t count, size_t eltsize) {
  void *p = calloc(count, eltsize);
  if (p == NULL) {
    perror("calloc() failed");
    exit(EXIT_FAILURE);
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <xcalloc+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"calloc() failed\00"
@EXIT_FAILURE = global i32 0
define i8* @xcalloc(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 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [16 x i8] c"calloc() failed\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ cleanup(int);
void clean_exit(int status) { cleanup(status); }


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

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

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

LLVM IR (-O2):
define void @clean_exit(i32 %0) {
%2 = tail call i32 @cleanup(i32 %0)
ret void
}
/* Variables and functions */
bool nrf52_errata_30(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_30() {
ret i32 0
}
int fun1159() { return 1159; }


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

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

LLVM IR (-O0):
define i32 @fun1159() {
ret i32 1159
}

LLVM IR (-O2):
define i32 @fun1159() {
ret i32 1159
}
void bar1() {}


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

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

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

LLVM IR (-O2):
define void @bar1() {
ret void
}
float bar_float(void) { return crealf(foo_float(2.0f - 2.5fi)); }


x86 assembly (clang, -O0):
<bar_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x40000000,-0x8(%rbp)
movl   $0xc0200000,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <foo_float@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_float>:
push   %rax
movaps 0xee8(%rip),%xmm0
mov    $0x1,%al
call   1030 <foo_float@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bar_float() {
%1 = alloca { float, float }
%2 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 0
%3 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
store float 2.000000e+00, float* %2
store float -2.500000e+00, float* %3
%4 = bitcast { float, float }* %1 to <2 x float>*
%5 = load <2 x float>, <2 x float>* %4
%6 = call i32 (<2 x float>, ...) bitcast (i32 (...)* @foo_float to i32 (<2 x float>, ...)*)(<2 x float> %5)
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @bar_float() {
%1 = tail call i32 (<2 x float>, ...) bitcast (i32 (...)* @foo_float to i32 (<2 x float>, ...)*)(<2 x float> <float 2.000000e+00, float -2.500000e+00>)
%2 = sitofp i32 %1 to float
ret float %2
}
/* Variables and functions */
int remove(char *);
int p_DeleteFile(char *name) {
  int rv;
  rv = remove(name);
  return (rv == 0);
}


x86 assembly (clang, -O0):
<p_DeleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_DeleteFile>:
push   %rax
call   1030 <remove@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @p_DeleteFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @p_DeleteFile(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int top_level(int, int);
int main() {
  int c = top_level(1, 2);
  printf("Result = %d\n", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Result = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @top_level(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ qdq_enqueue_close_buffer(void *,
                                            void (*)(unsigned int, void *));
void mrqd_close_delegate_buffer(void *buffer,
                                void (*funPtr)(unsigned int, void *)) {
  qdq_enqueue_close_buffer(buffer, funPtr);
}


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

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

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

LLVM IR (-O2):
define void @mrqd_close_delegate_buffer(i8* %0, void (i32, i8*)* %1) {
%3 = tail call i32 @qdq_enqueue_close_buffer(i8* %0, void (i32, i8*)* %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, size_t);
double *copy_array(double *array, size_t size) {
  double *copy = (double *)malloc(sizeof(*copy) * size);
  memcpy(copy, array, size * sizeof(*array));
  return copy;
}


x86 assembly (clang, -O0):
<copy_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x3,%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x0(,%rsi,8),%r15
mov    %r15d,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double* @copy_array(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca double*
store double* %0, double** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %5
%11 = load double*, double** %5
%12 = load double*, double** %3
%13 = load i64, i64* %4
%14 = mul i64 %13, 8
%15 = call i32 @memcpy(double* %11, double* %12, i64 %14)
%16 = load double*, double** %5
ret double* %16
}

LLVM IR (-O2):
define double* @copy_array(double* %0, i64 %1) {
%3 = shl i64 %1, 3
%4 = trunc i64 %3 to i32
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to double*
%7 = tail call i32 @memcpy(double* %6, double* %0, i64 %3)
ret double* %6
}
/* Variables and functions */
int /*<<< orphan*/ exp(float);
double log1p(int /*<<< orphan*/);
float log10_chi2_k2_cdf(float x) {
  return log1p(-exp(-x / 2)) * 0.43429448190325176;
}


x86 assembly (clang, -O0):
<log10_chi2_k2_cdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xec1(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1040 <log1p@plt>
movsd  0xe9f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10_chi2_k2_cdf>:
push   %rax
mulss  0xed7(%rip),%xmm0
call   1030 <exp@plt>
neg    %eax
mov    %eax,%edi
call   1040 <log1p@plt>
mulsd  0xec9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10_chi2_k2_cdf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = fdiv float %4, 2.000000e+00
%6 = call i32 @exp(float %5)
%7 = sub nsw i32 0, %6
%8 = call double @log1p(i32 %7)
%9 = fmul double %8, 0x3FDBCB7B1526E50D
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @log10_chi2_k2_cdf(float %0) {
%2 = fmul float %0, -5.000000e-01
%3 = tail call i32 @exp(float %2)
%4 = sub nsw i32 0, %3
%5 = tail call double @log1p(i32 %4)
%6 = fmul double %5, 0x3FDBCB7B1526E50D
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
long double sinl(long double);
__attribute__((__weak__, __always___)) long double
softboundmpx_sinl(long double x) {
  return sinl(x);
}


x86 assembly (clang, -O0):
<softboundmpx_sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak x86_fp80 @softboundmpx_sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
ret x86_fp80 %2
}
void coresight_cti_clear_trig(struct coresight_cti *cti, int ch) {}


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

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

LLVM IR (-O0):
%struct.coresight_cti = type opaque
define void @coresight_cti_clear_trig(%struct.coresight_cti* %0, i32 %1) {
%3 = alloca %struct.coresight_cti*
%4 = alloca i32
store %struct.coresight_cti* %0, %struct.coresight_cti** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.coresight_cti = type opaque
define void @coresight_cti_clear_trig(%struct.coresight_cti* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void PVD_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @PVD_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @PVD_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
struct student {
  int dummy;
};

/* Variables and functions */
struct student *allocate();
int /*<<< orphan*/ deallocate(struct student *);
int /*<<< orphan*/ generate(struct student *);
int /*<<< orphan*/ output(struct student *);
int /*<<< orphan*/ summary(struct student *);
int main() {
  struct student *stud = NULL;
  stud = allocate();
  generate(stud);
  output(stud);
  summary(stud);
  deallocate(stud);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1060 <allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <generate@plt>
mov    -0x10(%rbp),%rdi
call   1030 <output@plt>
mov    -0x10(%rbp),%rdi
call   1050 <summary@plt>
mov    -0x10(%rbp),%rdi
call   1040 <deallocate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <generate@plt>
mov    %rbx,%rdi
call   1030 <output@plt>
mov    %rbx,%rdi
call   1050 <summary@plt>
mov    %rbx,%rdi
call   1040 <deallocate@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.student = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.student*
store i32 0, i32* %1
store %struct.student* null, %struct.student** %2
%3 = call %struct.student* (...) @allocate()
store %struct.student* %3, %struct.student** %2
%4 = load %struct.student*, %struct.student** %2
%5 = call i32 @generate(%struct.student* %4)
%6 = load %struct.student*, %struct.student** %2
%7 = call i32 @output(%struct.student* %6)
%8 = load %struct.student*, %struct.student** %2
%9 = call i32 @summary(%struct.student* %8)
%10 = load %struct.student*, %struct.student** %2
%11 = call i32 @deallocate(%struct.student* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.student = type { i32 }
define i32 @main() {
%1 = tail call %struct.student* (...) @allocate()
%2 = tail call i32 @generate(%struct.student* %1)
%3 = tail call i32 @output(%struct.student* %1)
%4 = tail call i32 @summary(%struct.student* %1)
%5 = tail call i32 @deallocate(%struct.student* %1)
ret i32 0
}
int leaf(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @leaf() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fbtext_gotoxc(short);
int /*<<< orphan*/ fbtext_gotoyc(short);
void fbtext_gotoxyc(short x, short y) {
  fbtext_gotoxc(x);
  fbtext_gotoyc(y);
}


x86 assembly (clang, -O0):
<fbtext_gotoxyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%edi
call   1040 <fbtext_gotoxc@plt>
movswl -0x4(%rbp),%edi
call   1030 <fbtext_gotoyc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbtext_gotoxyc>:
push   %rbx
mov    %esi,%ebx
call   1040 <fbtext_gotoxc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fbtext_gotoyc@plt>

LLVM IR (-O0):
define void @fbtext_gotoxyc(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @fbtext_gotoxc(i16 signext %5)
%7 = load i16, i16* %4
%8 = call i32 @fbtext_gotoyc(i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @fbtext_gotoxyc(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @fbtext_gotoxc(i16 signext %0)
%4 = tail call i32 @fbtext_gotoyc(i16 signext %1)
ret void
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_table_destroy(struct hash_table *);
void extract_text_free(struct hash_table *spec_tag_ht,
                       struct hash_table *tag_attr_ht) {
  if (spec_tag_ht)
    hash_table_destroy(spec_tag_ht);
  if (tag_attr_ht)
    hash_table_destroy(tag_attr_ht);
}


x86 assembly (clang, -O0):
<extract_text_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <extract_text_free+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <hash_table_destroy@plt>
cmpq   $0x0,-0x10(%rbp)
je     1148 <extract_text_free+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <hash_table_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_text_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     111e <extract_text_free+0xe>
call   1030 <hash_table_destroy@plt>
test   %rbx,%rbx
je     112c <extract_text_free+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <hash_table_destroy@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.hash_table = type { i32 }
define void @extract_text_free(%struct.hash_table* %0, %struct.hash_table* %1) {
%3 = alloca %struct.hash_table*
%4 = alloca %struct.hash_table*
store %struct.hash_table* %0, %struct.hash_table** %3
store %struct.hash_table* %1, %struct.hash_table** %4
%5 = load %struct.hash_table*, %struct.hash_table** %3
%6 = icmp ne %struct.hash_table* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.hash_table*, %struct.hash_table** %3
%9 = call i32 @hash_table_destroy(%struct.hash_table* %8)
br label %10
10: ; preds = %7, %2
%11 = load %struct.hash_table*, %struct.hash_table** %4
%12 = icmp ne %struct.hash_table* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load %struct.hash_table*, %struct.hash_table** %4
%15 = call i32 @hash_table_destroy(%struct.hash_table* %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
define void @extract_text_free(%struct.hash_table* %0, %struct.hash_table* %1) {
%3 = icmp eq %struct.hash_table* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @hash_table_destroy(%struct.hash_table* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq %struct.hash_table* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @hash_table_destroy(%struct.hash_table* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world.\0A\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void *my_atomic_loadptr(void *volatile *a) { return __sync_fetch_and_or(a, 0); }


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

x86 assembly (clang, -O2):
<my_atomic_loadptr>:
mfence
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i8* @my_atomic_loadptr(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = bitcast i8** %3 to i64*
%5 = atomicrmw or i64* %4, i64 0 seq_cst
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @my_atomic_loadptr(i8** nocapture %0) {
%2 = bitcast i8** %0 to i64*
%3 = atomicrmw or i64* %2, i64 0 seq_cst
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int bundle_raw_get_body_off(int /*<<< orphan*/ const *, int *);
int bundle_raw_next_block_off(const uint8_t *raw) {
  int body_l = 0, body_off = 0;
  body_l = bundle_raw_get_body_off(raw, &body_off);
  return (body_l + body_off);
}


x86 assembly (clang, -O0):
<bundle_raw_next_block_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <bundle_raw_get_body_off@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bundle_raw_next_block_off>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <bundle_raw_get_body_off@plt>
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bundle_raw_next_block_off(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = call i32 @bundle_raw_get_body_off(i32* %5, i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bundle_raw_next_block_off(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @bundle_raw_get_body_off(i32* %0, i32* %2)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
ret i32 %6
}
int setuid(unsigned uid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
ret i32 0
}
/* Type definitions */
struct tms {
  scalar_t__ tms_stime;
  scalar_t__ tms_utime;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
double sys_timer() {
  struct tms use;
  clock_t tmp;
  times(&use);
  tmp = use.tms_utime + use.tms_stime;
  return (double)(tmp) / 100;
}


x86 assembly (clang, -O0):
<sys_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <times@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
cvtsi2sd %rax,%xmm0
divsd  0xecb(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
define double @sys_timer() {
%1 = alloca %struct.tms
%2 = alloca i64
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+02
ret double %11
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
define double @sys_timer() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+02
ret double %10
}
void pcibios_penalize_isa_irq(int irq) {}


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

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

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

LLVM IR (-O2):
define void @pcibios_penalize_isa_irq(i32 %0) {
ret void
}
/* Type definitions */
struct eembed_allocator {
  int dummy;
};

/* Variables and functions */
void *malloc(size_t);
void *eembed_system_malloc(struct eembed_allocator *ea, size_t size) {
  (void)ea;
  return size ? malloc(size) : NULL;
}


x86 assembly (clang, -O0):
<eembed_system_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <eembed_system_malloc+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1148 <eembed_system_malloc+0x38>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1148 <eembed_system_malloc+0x38>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_system_malloc>:
test   %rsi,%rsi
je     111d <eembed_system_malloc+0xd>
mov    %rsi,%rdi
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.eembed_allocator = type { i32 }
define i8* @eembed_system_malloc(%struct.eembed_allocator* %0, i64 %1) {
%3 = alloca %struct.eembed_allocator*
%4 = alloca i64
store %struct.eembed_allocator* %0, %struct.eembed_allocator** %3
store i64 %1, i64* %4
%5 = load %struct.eembed_allocator*, %struct.eembed_allocator** %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i64, i64* %4
%10 = call i8* @malloc(i64 %9)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %8
%13 = phi i8* [ %10, %8 ], [ null, %11 ]
ret i8* %13
}

LLVM IR (-O2):
%struct.eembed_allocator = type { i32 }
define noalias i8* @eembed_system_malloc(%struct.eembed_allocator* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}