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

/* Variables and functions */
bool I2CMasterBusy(uint32_t ui32Base) {
  ;
  if ((*((volatile unsigned long *)(0x40002000 + 0x00000804))) & 0x00000001) {
    return (true);
  } else {
    return (false);
  }
}


x86 assembly (clang, -O0):
<I2CMasterBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x40002804,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1129 <I2CMasterBusy+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <I2CMasterBusy+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterBusy>:
mov    0x40002804,%rax
40
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterBusy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
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 @I2CMasterBusy(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 1
ret i32 %4
}
void GB_CPUEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @GB_CPUEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glFlush();
void glutSwapBuffers(void) { glFlush(); }


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

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

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

LLVM IR (-O2):
define void @glutSwapBuffers() {
%1 = tail call i32 (...) @glFlush()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int cmp_by_ip_addr_t(const void *p1, const void *p2) {
  return memcmp((in_addr_t *)p1, (in_addr_t *)p2, sizeof(in_addr_t));
}


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

x86 assembly (clang, -O2):
<cmp_by_ip_addr_t>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_by_ip_addr_t(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @memcmp(i32* %3, i32* %4, i32 4)
ret i32 %5
}
int *A() {}


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

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

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

LLVM IR (-O2):
define noalias i32* @A() {
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
void ftpmap_draw(int ch, int times) {
  int i = 0;
  printf("+");
  for (i = 0; i <= times; i++) {
    putchar(ch);
  }
  printf("+\n");
}


x86 assembly (clang, -O0):
<ftpmap_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116a <ftpmap_draw+0x4a>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <ftpmap_draw+0x28>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftpmap_draw>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2b,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
js     114c <ftpmap_draw+0x2c>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <ftpmap_draw+0x20>
lea    0xead(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"+\00"
define void @ftpmap_draw(i32 %0, i32 %1) {
%3 = tail call i32 @putchar(i32 43)
%4 = icmp slt i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @putchar(i32 %0)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void bs_timer_procnull() { return; }


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

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

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

LLVM IR (-O2):
define void @bs_timer_procnull() {
ret void
}
/* Variables and functions */
scalar_t__ prj_get_postbuildcommands();
int prj_getlistsize(void **);
int prj_get_numpostbuildcommands() {
  return prj_getlistsize((void **)prj_get_postbuildcommands());
}


x86 assembly (clang, -O0):
<prj_get_numpostbuildcommands>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prj_get_postbuildcommands@plt>
mov    %rax,%rdi
call   1030 <prj_getlistsize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_get_numpostbuildcommands>:
push   %rax
xor    %eax,%eax
call   1040 <prj_get_postbuildcommands@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <prj_getlistsize@plt>

LLVM IR (-O0):
define i32 @prj_get_numpostbuildcommands() {
%1 = call i64 (...) @prj_get_postbuildcommands()
%2 = inttoptr i64 %1 to i8**
%3 = call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @prj_get_numpostbuildcommands() {
%1 = tail call i64 (...) @prj_get_postbuildcommands()
%2 = inttoptr i64 %1 to i8**
%3 = tail call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}
int get_bit(unsigned long int n, unsigned int index) {
  n = n >> index;
  if (index >= 63)
    return (-1);
  n = n % 2;
  return (n);
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shr    %cl,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x3f,-0x14(%rbp)
jb     112f <get_bit+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <get_bit+0x42>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
shr    %cl,%rdi
and    $0x1,%edi
cmp    $0x3f,%esi
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i64, i64* %4
%7 = load i32, i32* %5
%8 = zext i32 %7 to i64
%9 = lshr i64 %6, %8
store i64 %9, i64* %4
%10 = load i32, i32* %5
%11 = icmp uge i32 %10, 63
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i64, i64* %4
%15 = urem i64 %14, 2
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_bit(i64 %0, i32 %1) {
%3 = icmp ugt i32 %1, 62
%4 = zext i32 %1 to i64
%5 = lshr i64 %0, %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = select i1 %3, i32 -1, i32 %7
ret i32 %8
}
signed char complement(signed char x) { return ~x; }


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @complement(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @complement(i8 signext %0) {
%2 = xor i8 %0, -1
ret i8 %2
}
unsigned int mem_get_le32(const void *vmem) {
  unsigned int val;
  const unsigned char *mem = (const unsigned char *)vmem;
  val = mem[3] << 24;
  val |= mem[2] << 16;
  val |= mem[1] << 8;
  val |= mem[0];
  return val;
}


x86 assembly (clang, -O0):
<mem_get_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mem_get_le32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 24
store i32 %10, i32* %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 16
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 8
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i32, i32* %3
%30 = or i32 %29, %28
store i32 %30, i32* %3
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @mem_get_le32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ cs2shcb(void *);
void cs2shcb_(void *hcbfn) { cs2shcb(hcbfn); }


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

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

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

LLVM IR (-O2):
define void @cs2shcb_(i8* %0) {
%2 = tail call i32 @cs2shcb(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char *);
void usage(char **argv) {
  errx(2,
       "usage: %s [-b BITS] [-s SEED] [-j JUMPS] [-r RUNS] [-m MASK_HEX]"
       " [-c CPU]",
       argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    $0x2,%edi
lea    0xed1(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdi),%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"usage: %s [-b BITS] [-s SEED] [-j JUMPS] [-r RUNS] [-m MASK_HEX] [-c CPU]\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @errx(i32 2, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"usage: %s [-b BITS] [-s SEED] [-j JUMPS] [-r RUNS] [-m MASK_HEX] [-c CPU]\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @errx(i32 2, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ A_STANDOUT;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ fillLine(char *, int);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
void renderBottomPanel(int scry, int scrx) {
  attron(A_STANDOUT);
  move(scry - 2, 0);
  fillLine("Folder Curses v. 1.0.0", scrx);
  attroff(A_STANDOUT);
}


x86 assembly (clang, -O0):
<renderBottomPanel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    -0x8(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1050 <fillLine@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderBottomPanel>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e91(%rip),%r14
mov    (%r14),%edi
call   1040 <attron@plt>
add    $0xfffffffe,%ebp
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <move@plt>
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
call   1050 <fillLine@plt>
mov    (%r14),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
@A_STANDOUT = global i32 0
@.str = [23 x i8] c"Folder Curses v. 1.0.0\00"
define void @renderBottomPanel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @A_STANDOUT
%6 = call i32 @attron(i32 %5)
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 2
%9 = call i32 @move(i32 %8, i32 0)
%10 = load i32, i32* %4
%11 = call i32 @fillLine(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @A_STANDOUT
%13 = call i32 @attroff(i32 %12)
ret void
}

LLVM IR (-O2):
@A_STANDOUT = global i32 0
@.str = [23 x i8] c"Folder Curses v. 1.0.0\00"
define void @renderBottomPanel(i32 %0, i32 %1) {
%3 = load i32, i32* @A_STANDOUT
%4 = tail call i32 @attron(i32 %3)
%5 = add nsw i32 %0, -2
%6 = tail call i32 @move(i32 %5, i32 0)
%7 = tail call i32 @fillLine(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = load i32, i32* @A_STANDOUT
%9 = tail call i32 @attroff(i32 %8)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int ebbrt_newlib_stat(char const *, struct stat *);
int stat(const char *file, struct stat *st) {
  return ebbrt_newlib_stat(file, st);
}


x86 assembly (clang, -O0):
<stat>:
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 <ebbrt_newlib_stat@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @ebbrt_newlib_stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_fn(const void *one, const void *two) {
  const char *one_ = *(const char **)one;
  const char *two_ = *(const char **)two;
  return strcmp(one_, two_);
}


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

x86 assembly (clang, -O2):
<cmp_fn>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_fn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_add_new(float *, float const *, float const *, int);
void vec4f_add_new(float result[4], const float a[4], const float b[4]) {
  vecNf_add_new(result, a, b, 4);
}


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

x86 assembly (clang, -O2):
<vec4f_add_new>:
mov    $0x4,%ecx
jmp    1030 <vecNf_add_new@plt>

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

LLVM IR (-O2):
define void @vec4f_add_new(float* %0, float* %1, float* %2) {
%4 = tail call i32 @vecNf_add_new(float* %0, float* %1, float* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cc3_delay_us_4(int);
void _cc3_pixbuf_write_rewind() {
  (*(volatile unsigned long *)((0xE002800C))) = 0x400;
  (*(volatile unsigned long *)((0xE002800C))) = 0x2000;
  _cc3_delay_us_4(1);
  (*(volatile unsigned long *)((0xE0028004))) = 0x2000;
}


x86 assembly (clang, -O0):
<_cc3_pixbuf_write_rewind>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002800c,%eax
movq   $0x400,(%rax)
mov    $0xe002800c,%eax
movq   $0x2000,(%rax)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
mov    $0xe0028004,%eax
movq   $0x2000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_pixbuf_write_rewind>:
push   %rbx
mov    $0xe002800c,%ebx
movq   $0x400,(%rbx)
movq   $0x2000,(%rbx)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
movq   $0x2000,-0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @_cc3_pixbuf_write_rewind() {
store volatile i64 1024, i64* inttoptr (i64 3758260236 to i64*)
store volatile i64 8192, i64* inttoptr (i64 3758260236 to i64*)
%1 = call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 8192, i64* inttoptr (i64 3758260228 to i64*)
ret void
}

LLVM IR (-O2):
define void @_cc3_pixbuf_write_rewind() {
store volatile i64 1024, i64* inttoptr (i64 3758260236 to i64*)
store volatile i64 8192, i64* inttoptr (i64 3758260236 to i64*)
%1 = tail call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 8192, i64* inttoptr (i64 3758260228 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror_with_name(char const *);
int /*<<< orphan*/ xexit(int);
void pfatal_with_name(const char *name) {
  perror_with_name(name);
  xexit(1);
}


x86 assembly (clang, -O0):
<pfatal_with_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror_with_name@plt>
mov    $0x1,%edi
call   1040 <xexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfatal_with_name>:
push   %rax
call   1030 <perror_with_name@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <xexit@plt>

LLVM IR (-O0):
define void @pfatal_with_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror_with_name(i8* %3)
%5 = call i32 @xexit(i32 1)
ret void
}

LLVM IR (-O2):
define void @pfatal_with_name(i8* %0) {
%2 = tail call i32 @perror_with_name(i8* %0)
%3 = tail call i32 @xexit(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int __rsyscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setuid(uid_t uid) { return __rsyscall(213, uid, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xd5,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__rsyscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setuid>:
push   %rax
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0xd5,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__rsyscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
%2 = tail call i32 @__rsyscall(i32 213, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int cmp_4(const void *a, const void *b) { return memcmp(a, b, 4); }


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

x86 assembly (clang, -O2):
<cmp_4>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_4(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 4)
ret i32 %3
}
/* Type definitions */
typedef void uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef void *uint32_t;

/* Variables and functions */
void *AV_RN32(void const *);
uint64_t AV_RN64(const void *p) {
  union {
    uint64_t v;
    uint32_t hl[2];
  } v;
  v.hl[0] = AV_RN32(p);
  v.hl[1] = AV_RN32((const uint8_t *)p + 4);
  return v.v;
}


x86 assembly (clang, -O0):
<AV_RN64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <AV_RN32@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1030 <AV_RN32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AV_RN64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <AV_RN32@plt>
mov    %rax,%r14
add    $0x4,%rbx
mov    %rbx,%rdi
call   1030 <AV_RN32@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { [2 x i8*] }
define i32 @AV_RN64(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @AV_RN32(i8* %4)
%6 = bitcast %union.anon* %3 to [2 x i8*]*
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* %5, i8** %7
%8 = load i8*, i8** %2
%9 = getelementptr i8, i8* %8, i64 4
%10 = call i8* @AV_RN32(i8* %9)
%11 = bitcast %union.anon* %3 to [2 x i8*]*
%12 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 1
store i8* %10, i8** %12
%13 = bitcast %union.anon* %3 to i32*
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @AV_RN64(i8* %0) {
%2 = tail call i8* @AV_RN32(i8* %0)
%3 = getelementptr i8, i8* %0, i64 4
%4 = tail call i8* @AV_RN32(i8* %3)
%5 = ptrtoint i8* %2 to i64
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void rec(int i) {
  int a;
  scanf("%d", &a);
  if (a > 0)
    rec(i + 1);
  else {
    printf("You gave  %d  positive numbers!\n", i);
    return;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1165 <rec+0x35>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1050 <rec@plt>
jmp    1174 <rec+0x44>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    115b <rec+0x2b>
add    $0x1,%ebx
mov    %ebx,%edi
call   1050 <rec@plt>
jmp    1169 <rec+0x39>
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [33 x i8] c"You gave %d positive numbers!\0A\00"
define void @rec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [33 x i8] c"You gave %d positive numbers!\0A\00"
define void @rec(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = add nsw i32 %0, 1
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %7, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kr_first_coalesce(void *);
void kr_first_free(void *ptr) { kr_first_coalesce(ptr); }


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

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

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

LLVM IR (-O2):
define void @kr_first_free(i8* %0) {
%2 = tail call i32 @kr_first_coalesce(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
char *appaserver_link_get_abbreviated_output_filename(char *, char *, char *,
                                                      int /*<<< orphan*/,
                                                      char *, char *);
char *appaserver_link_abbreviated_output_filename(
    char *filename_stem, char *begin_date_string, char *end_date_string,
    pid_t process_id, char *session, char *extension) {
  return appaserver_link_get_abbreviated_output_filename(
      filename_stem, begin_date_string, end_date_string, process_id, session,
      extension);
}


x86 assembly (clang, -O0):
<appaserver_link_abbreviated_output_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <appaserver_link_get_abbreviated_output_filename@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @appaserver_link_abbreviated_output_filename(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @appaserver_link_get_abbreviated_output_filename(i8* %13, i8* %14, i8* %15, i32 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @appaserver_link_abbreviated_output_filename(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = tail call i8* @appaserver_link_get_abbreviated_output_filename(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ log_exit(char *);
void *malloc(size_t);
void *xmalloc(size_t sz) {
  void *p;
  p = malloc(sz);
  if (!p)
    log_exit("failed to allocate memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <log_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <log_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"failed to allocate memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @log_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"failed to allocate memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @log_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_suck_restofline_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_suck_restofline(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_suck_restofline_rec(lexbuf, 12);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_suck_restofline>:
mov    $0xc,%esi
jmp    1030 <Cyc_suck_restofline_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_suck_restofline(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_suck_restofline_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 12)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_suck_restofline(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_suck_restofline_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 12)
ret i32 %2
}
int _rsh(int x, int y, void *garb) { return x >> y; }


x86 assembly (clang, -O0):
<_rsh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rsh>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @_rsh(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = ashr i32 %0, %1
ret i32 %4
}
/* Variables and functions */
char *strstr(char *, char *);
int strpos(char *haystack, char *needle) {
  char *p = strstr(haystack, needle);
  if (p)
    return p - haystack;
  return -1;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <strpos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <strpos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
const char *getSpec(void) {
  return "typ_spec { name=typ_VideowallControlType; }";
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"typ_spec { name=typ_VideowallControlType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"typ_spec { name=typ_VideowallControlType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void file2arr(char *filename, char *buffer) {
  FILE *in;
  in = fopen(filename, "r");
  char temp;
  fclose(in);
}


x86 assembly (clang, -O0):
<file2arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file2arr>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @file2arr(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fclose(i32* %3)
ret void
}
__uint128_t __attribute__((no)) ushift_13_ll(unsigned long long data) {
  return (__uint128_t)data << 13;
}


x86 assembly (clang, -O0):
<ushift_13_ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
shl    $0xd,%rax
shr    $0x33,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ushift_13_ll>:
mov    %rdi,%rax
shl    $0xd,%rax
shr    $0x33,%rdi
mov    %rdi,%rdx
ret

LLVM IR (-O0):
define { i64, i64 } @ushift_13_ll(i64 %0) {
%2 = alloca i128
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = zext i64 %4 to i128
%6 = shl i128 %5, 13
store i128 %6, i128* %2
%7 = bitcast i128* %2 to { i64, i64 }*
%8 = load { i64, i64 }, { i64, i64 }* %7
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @ushift_13_ll(i64 %0) {
%2 = shl i64 %0, 13
%3 = lshr i64 %0, 51
%4 = insertvalue { i64, i64 } poison, i64 %2, 0
%5 = insertvalue { i64, i64 } %4, i64 %3, 1
ret { i64, i64 } %5
}
unsigned int McASPRxBufRead(unsigned int baseAddr, unsigned int serNum) {
  return ((*((volatile unsigned int *)(baseAddr + (0x280 + (serNum * 4))))));
}


x86 assembly (clang, -O0):
<McASPRxBufRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x280,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxBufRead>:
lea    (%rdi,%rsi,4),%eax
add    $0x280,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @McASPRxBufRead(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %6, 4
%8 = add i32 640, %7
%9 = add i32 %5, %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @McASPRxBufRead(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %0, 640
%5 = add i32 %4, %3
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "test\r\n", 6);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"test\0D\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"test\0D\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
double sqrt(double const);
double metric(const double *p) {
  return (sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]));
}


x86 assembly (clang, -O0):
<metric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <metric+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @metric(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @metric(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
float _cos_fix(scalar_t__);
float sin_fix(float x) {
  return (_cos_fix(0xc000 +
                   ((uint16_t)(0xFFFF * (x / 6.283185307179586476925286)))) /
          (float)0x4000);
}


x86 assembly (clang, -O0):
<sin_fix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
add    $0xc000,%rdi
call   1030 <_cos_fix@plt>
movss  0xea9(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_fix>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
mulsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%rdi
add    $0xc000,%rdi
call   1030 <_cos_fix@plt>
mulss  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sin_fix(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x401921FB54442D18
%6 = fmul double 6.553500e+04, %5
%7 = fptosi double %6 to i64
%8 = add nsw i64 49152, %7
%9 = call float @_cos_fix(i64 %8)
%10 = fdiv float %9, 1.638400e+04
ret float %10
}

LLVM IR (-O2):
define float @sin_fix(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x401921FB54442D18
%4 = fmul double %3, 6.553500e+04
%5 = fptosi double %4 to i64
%6 = add nsw i64 %5, 49152
%7 = tail call float @_cos_fix(i64 %6)
%8 = fmul float %7, 0x3F10000000000000
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ document_quick_output_body(char *, char *);
void document_output_quick_body(char *application_name,
                                char *appaserver_mount_point) {
  document_quick_output_body(application_name, appaserver_mount_point);
}


x86 assembly (clang, -O0):
<document_output_quick_body>:
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 <document_quick_output_body@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @document_output_quick_body(i8* %0, i8* %1) {
%3 = tail call i32 @document_quick_output_body(i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
struct str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ str_formattime(struct str *, int, char const *, struct tm *);
void str_catftime(struct str *sa, const char *fmt, struct tm *tm) {
  str_formattime(sa, 1, fmt, tm);
}


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

x86 assembly (clang, -O2):
<str_catftime>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <str_formattime@plt>

LLVM IR (-O0):
%struct.str = type { i32 }
%struct.tm = type { i32 }
define void @str_catftime(%struct.str* %0, i8* %1, %struct.tm* %2) {
%4 = alloca %struct.str*
%5 = alloca i8*
%6 = alloca %struct.tm*
store %struct.str* %0, %struct.str** %4
store i8* %1, i8** %5
store %struct.tm* %2, %struct.tm** %6
%7 = load %struct.str*, %struct.str** %4
%8 = load i8*, i8** %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i32 @str_formattime(%struct.str* %7, i32 1, i8* %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.str = type { i32 }
%struct.tm = type { i32 }
define void @str_catftime(%struct.str* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i32 @str_formattime(%struct.str* %0, i32 1, i8* %1, %struct.tm* %2)
ret void
}