xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_daemon();
scalar_t__ test_go();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *);
int main(int argc, char **argv) {
  test_init(argc, argv);
  test_daemon();
  while (test_go())
    ;
  test_msg("PASS\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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
mov    $0x0,%al
call   1040 <test_daemon@plt>
mov    $0x0,%al
call   1060 <test_go@plt>
cmp    $0x0,%rax
je     117f <main+0x3f>
jmp    1169 <main+0x29>
lea    0xe7a(%rip),%rdi
call   1050 <test_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <test_daemon@plt>
nopl   (%rax)
xor    %eax,%eax
call   1060 <test_go@plt>
test   %rax,%rax
jne    1150 <main+0x10>
lea    0xe9d(%rip),%rdi
call   1050 <test_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 (...) @test_daemon()
br label %10
10: ; preds = %13, %2
%11 = call i64 (...) @test_go()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
%15 = call i32 @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @test_daemon()
br label %5
5: ; preds = %5, %2
%6 = tail call i64 (...) @test_go()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = tail call i32 @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterBurstLengthSet(uint32_t ui32Base, uint8_t ui8Length) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000030))) = ui8Length;
}


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

x86 assembly (clang, -O2):
<I2CMasterBurstLengthSet>:
mov    %rsi,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CMasterBurstLengthSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 48
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void RTOnce(void) {}


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

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

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

LLVM IR (-O2):
define void @RTOnce() {
ret void
}
/* Variables and functions */
int ran(int);
int pct(int n) {
  if (ran(100) < n)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<pct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <ran@plt>
cmp    -0x8(%rbp),%eax
jge    113a <pct+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <pct+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pct>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
call   1030 <ran@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @ran(i32 100)
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @pct(i32 %0) {
%2 = tail call i32 @ran(i32 100)
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int Operand_bt_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_bt_decode(i32* nocapture readnone %0) {
ret i32 0
}
int boaDeleteUser(char *user) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @boaDeleteUser(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int bb_i2c_close(int pi, unsigned SDA) {
  return pigpio_command(pi, 89, SDA, 0, 1);
}


x86 assembly (clang, -O0):
<bb_i2c_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x59,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_i2c_close>:
mov    %esi,%edx
mov    $0x59,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @bb_i2c_close(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 89, i32 %1, i32 0, i32 1)
ret i32 %3
}
int f_i7(int i0, int i1, int i2, int i3, int i4, int i5, int i6) { return i6; }


x86 assembly (clang, -O0):
<f_i7>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i7>:
mov    0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @f_i7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f_i7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 returned %6) {
ret i32 %6
}
adr0adr1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*((char *)10000000)) = (*((char *)11111111)); }


x86 assembly (clang, -O0):
<adr0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%cl
mov    $0x989680,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1_set>:
mov    0xa98ac7,%al
mov    %al,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 11111111 to i8*)
store i8 %16, i8* inttoptr (i64 10000000 to i8*)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adr0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 11111111 to i8*)
store i8 %7, i8* inttoptr (i64 10000000 to i8*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void trancode_5004_(char *buf) { printf("my 5004\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"my 5004\00"
define void @trancode_5004_(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void SDHostIntUnregister(unsigned long ulBase) {
  IntDisable(175);
  IntUnregister(175);
}


x86 assembly (clang, -O0):
<SDHostIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xaf,%edi
call   1030 <IntDisable@plt>
mov    $0xaf,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostIntUnregister>:
push   %rax
mov    $0xaf,%edi
call   1030 <IntDisable@plt>
mov    $0xaf,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @SDHostIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @IntDisable(i32 175)
%4 = call i32 @IntUnregister(i32 175)
ret void
}

LLVM IR (-O2):
define void @SDHostIntUnregister(i64 %0) {
%2 = tail call i32 @IntDisable(i32 175)
%3 = tail call i32 @IntUnregister(i32 175)
ret void
}
/* Variables and functions */
int sprintf(char *, char *);
int f1(char *s) { return sprintf(s, "foo"); }


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

x86 assembly (clang, -O2):
<f1>:
movl   $0x6f6f66,(%rdi)
mov    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 7303014, i32* %2
ret i32 3
}
/* Variables and functions */
scalar_t__ customMalloc(int, char *, int);
void insufficient_memory_malloc() {
  int *t = (int *)customMalloc(
      5000,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/"
      "heads/master/EnhancedMalloc/src/main.c",
      38);
  ;
}


x86 assembly (clang, -O0):
<insufficient_memory_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1388,%edi
lea    0xedc(%rip),%rsi
mov    $0x26,%edx
call   1030 <customMalloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insufficient_memory_malloc>:
lea    0xee9(%rip),%rsi
mov    $0x1388,%edi
mov    $0x26,%edx
jmp    1030 <customMalloc@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @insufficient_memory_malloc() {
%1 = alloca i32*
%2 = call i64 @customMalloc(i32 5000, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 38)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
ret void
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @insufficient_memory_malloc() {
%1 = tail call i64 @customMalloc(i32 5000, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 38)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ScrollPlayfieldIfNeededExt(int);
void InitScrollPlayfield() { ScrollPlayfieldIfNeededExt(1); }


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

x86 assembly (clang, -O2):
<InitScrollPlayfield>:
mov    $0x1,%edi
jmp    1030 <ScrollPlayfieldIfNeededExt@plt>

LLVM IR (-O0):
define void @InitScrollPlayfield() {
%1 = call i32 @ScrollPlayfieldIfNeededExt(i32 1)
ret void
}

LLVM IR (-O2):
define void @InitScrollPlayfield() {
%1 = tail call i32 @ScrollPlayfieldIfNeededExt(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rsp_read_code(void *, unsigned long, int /*<<< orphan*/);
__attribute__((deprecated("use rsp_read_code instead"))) void
read_ucode(void *start, unsigned long size) {
  rsp_read_code(start, size, 0);
}


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

x86 assembly (clang, -O2):
<read_ucode>:
xor    %edx,%edx
jmp    1030 <rsp_read_code@plt>

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

LLVM IR (-O2):
define void @read_ucode(i8* %0, i64 %1) {
%3 = tail call i32 @rsp_read_code(i8* %0, i64 %1, i32 0)
ret void
}
int isPositive(int x) { return !((!x) | (x >> 31)); }


x86 assembly (clang, -O0):
<isPositive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPositive>:
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
sar    $0x1f,%edi
xor    %eax,%eax
or     %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isPositive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = load i32, i32* %2
%8 = ashr i32 %7, 31
%9 = or i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isPositive(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = or i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int printf(char *);
int foo(void *ptr) { return printf("foo\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"foo\0A\00"
define i32 @foo(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void read_double(u_int8_t *d, FILE *f) { fread(d, sizeof(double), 1, f); }


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

x86 assembly (clang, -O2):
<read_double>:
mov    %rsi,%rcx
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define void @read_double(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %0, i32 8, i32 1, i32* %1)
ret void
}
int is_insubnet() {}


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

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

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

LLVM IR (-O2):
define i32 @is_insubnet() {
ret i32 undef
}
/* Variables and functions */
unsigned long *malloc_frame_aligned(int);
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
unsigned long *new_page_table() {
  unsigned long *ans = malloc_frame_aligned(1024 * sizeof(long));
  memset(ans, 0, 1024 * sizeof(long));
  return ans;
}


x86 assembly (clang, -O0):
<new_page_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2000,%edi
call   1030 <malloc_frame_aligned@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_page_table>:
push   %rbx
mov    $0x2000,%edi
call   1030 <malloc_frame_aligned@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64* @new_page_table() {
%1 = alloca i64*
%2 = call i64* @malloc_frame_aligned(i32 8192)
store i64* %2, i64** %1
%3 = load i64*, i64** %1
%4 = call i32 @memset(i64* %3, i32 0, i32 8192)
%5 = load i64*, i64** %1
ret i64* %5
}

LLVM IR (-O2):
define i64* @new_page_table() {
%1 = tail call i64* @malloc_frame_aligned(i32 8192)
%2 = tail call i32 @memset(i64* %1, i32 0, i32 8192)
ret i64* %1
}
/* Variables and functions */
int /*<<< orphan*/ permutate(char *, int /*<<< orphan*/);
int main() {
  char str[256] = "sss";
  permutate(str, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movb   $0x73,-0x100(%rbp)
movb   $0x73,-0xff(%rbp)
movb   $0x73,-0xfe(%rbp)
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
call   1030 <permutate@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x7373,(%rsp)
movb   $0x73,0x2(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <permutate@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [256 x i8]
%2 = bitcast [256 x i8]* %1 to i8*
%3 = bitcast i8* %2 to [256 x i8]*
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i32 0, i32 0
store i8 115, i8* %4
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i32 0, i32 1
store i8 115, i8* %5
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i32 0, i32 2
store i8 115, i8* %6
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = call i32 @permutate(i8* %7, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
store i8 115, i8* %2
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 1
store i8 115, i8* %3
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
store i8 115, i8* %4
%5 = call i32 @permutate(i8* %2, i32 0)
ret i32 0
}
char *lft_sym(int lftarc) {
  if (lftarc)
    return "l";
  else
    return "r";
}


x86 assembly (clang, -O0):
<lft_sym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <lft_sym+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <lft_sym+0x2c>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lft_sym>:
test   %edi,%edi
lea    0xef9(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"l\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @lft_sym(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"l\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @lft_sym(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
char *__get_http_response(char *);
char *get_json_response(char *, char *);
char *get_http_response(char *token_header, char *res_body) {
  char *json = get_json_response(token_header, res_body);
  return __get_http_response(json);
}


x86 assembly (clang, -O0):
<get_http_response>:
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   1040 <get_json_response@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <__get_http_response@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_http_response>:
push   %rax
call   1040 <get_json_response@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <__get_http_response@plt>

LLVM IR (-O0):
define i8* @get_http_response(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_json_response(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i8* @__get_http_response(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @get_http_response(i8* %0, i8* %1) {
%3 = tail call i8* @get_json_response(i8* %0, i8* %1)
%4 = tail call i8* @__get_http_response(i8* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XmbTextEscapement() {
  printf("XmbTextEscapement called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"XmbTextEscapement called\0A\00"
define i32 @XmbTextEscapement() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"XmbTextEscapement called\00"
define i32 @XmbTextEscapement() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: unifdef [-cdeklnst] [-Ipath]"
          " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"usage: unifdef [-cdeklnst] [-Ipath] [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"usage: unifdef [-cdeklnst] [-Ipath] [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ link(char *, char *);
void c_link_(char *existing, char *new, int elen, int nlen) {
  link(existing, new);
}


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

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

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

LLVM IR (-O2):
define void @c_link_(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @link(i8* %0, i8* %1)
ret void
}
OP(dd, ff) {
  illegal_1();
  op_ff();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ff()
ret i32 undef
}
/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
scalar_t__ umount(char *);
int main() {
  if (umount("/non-existant-mount-point")) {
    if (errno != ENOENT) {
      return 1;
    }
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <umount@plt>
cmp    $0x0,%rax
je     1167 <main+0x57>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
je     115b <main+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <umount@plt>
test   %rax,%rax
sete   %al
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9c(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/non-existant-mount-point\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @umount(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOENT
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
store i32 1, i32* %1
br label %11
9: ; preds = %4
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [26 x i8] c"/non-existant-mount-point\00"
@errno = global i64 0
@ENOENT = global i64 0
define i32 @main() {
%1 = tail call i64 @umount(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = load i64, i64* @errno
%4 = load i64, i64* @ENOENT
%5 = icmp ne i64 %3, %4
%6 = select i1 %2, i1 true, i1 %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void err_sys(const char *errmsg) {
  perror(errmsg);
  exit(1);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ getVoidPtr();
void testCastVoidPtrToIntPtrThroughIntTypedAssignment() {
  int *x;
  (*((int *)(&x))) = (int)getVoidPtr();
  *x = 1;
}


x86 assembly (clang, -O0):
<testCastVoidPtrToIntPtrThroughIntTypedAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getVoidPtr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCastVoidPtrToIntPtrThroughIntTypedAssignment>:
push   %rax
xor    %eax,%eax
call   1030 <getVoidPtr@plt>
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testCastVoidPtrToIntPtrThroughIntTypedAssignment() {
%1 = alloca i32*
%2 = call i64 (...) @getVoidPtr()
%3 = trunc i64 %2 to i32
%4 = bitcast i32** %1 to i32*
store i32 %3, i32* %4
%5 = load i32*, i32** %1
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @testCastVoidPtrToIntPtrThroughIntTypedAssignment() {
%1 = tail call i64 (...) @getVoidPtr()
%2 = and i64 %1, 4294967295
%3 = inttoptr i64 %2 to i32*
store i32 1, i32* %3
ret void
}
int foo(char *x) { return ((int)x) + 1; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
void uninitvar_ferror(void) {
  FILE *fp;
  ferror(fp);
  (void)ferror(fp);
}


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

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

LLVM IR (-O0):
define void @uninitvar_ferror() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @ferror(i32* %2)
%4 = load i32*, i32** %1
%5 = call i32 @ferror(i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ferror() {
%1 = tail call i32 @ferror(i32* undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float checkPDFFileByFile(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
float checkPDFFileByPath(const char *filename) {
  FILE *fptr = fopen(filename, "rb");
  if (fptr == NULL)
    return -1;
  float retVal = checkPDFFileByFile(fptr);
  fclose(fptr);
  return retVal;
}


x86 assembly (clang, -O0):
<checkPDFFileByPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <checkPDFFileByPath+0x3d>
movss  0xe9d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <checkPDFFileByPath+0x5e>
mov    -0x18(%rbp),%rdi
call   1030 <checkPDFFileByFile@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPDFFileByPath>:
push   %rbx
sub    $0x10,%rsp
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1167 <checkPDFFileByPath+0x37>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <checkPDFFileByFile@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
movss  0xc(%rsp),%xmm0
jmp    116f <checkPDFFileByPath+0x3f>
movss  0xe91(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define float @checkPDFFileByPath(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca float
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store float -1.000000e+00, float* %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call float @checkPDFFileByFile(i32* %12)
store float %13, float* %5
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load float, float* %5
store float %16, float* %2
br label %17
17: ; preds = %11, %10
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define float @checkPDFFileByPath(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call float @checkPDFFileByFile(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi float [ %5, %4 ], [ -1.000000e+00, %1 ]
ret float %8
}
/* Variables and functions */
long double copysign(long double, long double);
long double copysignl(long double a1, long double a2) {
  return copysign(a1, a2);
}


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

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

LLVM IR (-O0):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @copysign(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @copysign(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ console_init();
void init_kernel() { console_init(); }


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

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

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

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

/* Variables and functions */
long mm_initialize(struct mm_space_config *);
int /*<<< orphan*/ mm_uninitialize();
long mm_reinitialize(struct mm_space_config *cfg) {
  long rslt = mm_initialize(cfg);
  if (rslt < 0)
    goto error_ret;
  mm_uninitialize();
  return mm_initialize(cfg);
error_ret:
  return -1;
}


x86 assembly (clang, -O0):
<mm_reinitialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mm_initialize@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1149 <mm_reinitialize+0x29>
jmp    1162 <mm_reinitialize+0x42>
mov    $0x0,%al
call   1030 <mm_uninitialize@plt>
mov    -0x10(%rbp),%rdi
call   1040 <mm_initialize@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <mm_reinitialize+0x4a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_reinitialize>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mm_initialize@plt>
test   %rax,%rax
js     113e <mm_reinitialize+0x1e>
xor    %eax,%eax
call   1030 <mm_uninitialize@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mm_initialize@plt>
mov    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mm_space_config = type { i32 }
define i64 @mm_reinitialize(%struct.mm_space_config* %0) {
%2 = alloca i64
%3 = alloca %struct.mm_space_config*
%4 = alloca i64
store %struct.mm_space_config* %0, %struct.mm_space_config** %3
%5 = load %struct.mm_space_config*, %struct.mm_space_config** %3
%6 = call i64 @mm_initialize(%struct.mm_space_config* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %14
10: ; preds = %1
%11 = call i32 (...) @mm_uninitialize()
%12 = load %struct.mm_space_config*, %struct.mm_space_config** %3
%13 = call i64 @mm_initialize(%struct.mm_space_config* %12)
store i64 %13, i64* %2
br label %15
14: ; preds = %9
store i64 -1, i64* %2
br label %15
15: ; preds = %14, %10
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
%struct.mm_space_config = type { i32 }
define i64 @mm_reinitialize(%struct.mm_space_config* %0) {
%2 = tail call i64 @mm_initialize(%struct.mm_space_config* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @mm_uninitialize()
%6 = tail call i64 @mm_initialize(%struct.mm_space_config* %0)
br label %7
7: ; preds = %1, %4
%8 = phi i64 [ %6, %4 ], [ -1, %1 ]
ret i64 %8
}
char *strcat(char *dest, char const *src) {
  char *tmp = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, float);
void loop() {
  write(1, 1.0f);
  write(2, 2.0f);
  write(3, 3.0f);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
movss  0xee7(%rip),%xmm0
call   1030 <write@plt>
mov    $0x2,%edi
movss  0xed1(%rip),%xmm0
call   1030 <write@plt>
mov    $0x3,%edi
movss  0xebb(%rip),%xmm0
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
movss  0xee7(%rip),%xmm0
mov    $0x1,%edi
call   1030 <write@plt>
movss  0xed9(%rip),%xmm0
mov    $0x2,%edi
call   1030 <write@plt>
movss  0xecb(%rip),%xmm0
mov    $0x3,%edi
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 @write(i32 1, float 1.000000e+00)
%2 = call i32 @write(i32 2, float 2.000000e+00)
%3 = call i32 @write(i32 3, float 3.000000e+00)
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 @write(i32 1, float 1.000000e+00)
%2 = tail call i32 @write(i32 2, float 2.000000e+00)
%3 = tail call i32 @write(i32 3, float 3.000000e+00)
ret void
}
unsigned wordlength(void) {
  unsigned i;
  unsigned v = (unsigned)~0x00;
  for (i = 1; (v = v >> 1) > 0; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<wordlength>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jbe    1137 <wordlength+0x37>
jmp    1129 <wordlength+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <wordlength+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wordlength() {
ret i32 32
}
int main(void) {
  __asm__("nop");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
nop
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
int func1(int j) {
  return ({
    int i = 0;
    ++i;
    i;
  });
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func1(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cdiInitialize();
int streamOpen(char const *, char *, int);
int streamOpenWrite(const char *filename, int filetype) {
  cdiInitialize();
  return (streamOpen(filename, "w", filetype));
}


x86 assembly (clang, -O0):
<streamOpenWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <cdiInitialize@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1030 <streamOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streamOpenWrite>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <cdiInitialize@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <streamOpen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @streamOpenWrite(i8* %0, i32 %1) {
%3 = tail call i32 (...) @cdiInitialize()
%4 = tail call i32 @streamOpen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %4
}