xunge/DecIR huggingface dataset:
void t8() {
  struct tag8 {
    int a;
    int b;
  } x;
  struct tag8 *p = &x;
  (*p).b = 72;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          61, 72, x.b);
  ;
}


x86 assembly (clang, -O0):
<t8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x48,0x4(%rax)
mov    -0x4(%rbp),%ecx
lea    0xecb(%rip),%rdi
mov    $0x3d,%esi
mov    $0x48,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t8>:
lea    0xee9(%rip),%rdi
mov    $0x3d,%esi
mov    $0x48,%edx
mov    $0x48,%ecx
xor    %eax,%eax
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.tag8 = type { i32, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t8() {
%1 = alloca %struct.tag8
%2 = alloca %struct.tag8*
store %struct.tag8* %1, %struct.tag8** %2
%3 = load %struct.tag8*, %struct.tag8** %2
%4 = getelementptr inbounds %struct.tag8, %struct.tag8* %3, i32 0, i32 1
store i32 72, i32* %4
%5 = getelementptr inbounds %struct.tag8, %struct.tag8* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 61, i32 72, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.tag8 = type { i32, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t8() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 61, i32 72, i32 72)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parsefile();
int main() {
  parsefile();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <parsefile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <parsefile@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @parsefile()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void fs_force_rm_beargit_dir() { system("rm -rf .beargit"); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"rm -rf .beargit\00"
define void @fs_force_rm_beargit_dir() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int nanosleep(struct timespec *, struct timespec *);
void Sys_Sleep(void) {
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = 1000000;
  while (nanosleep(&ts, &ts) == -1)
    if (errno != EINTR)
      break;
}


x86 assembly (clang, -O0):
<Sys_Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0xf4240,-0x10(%rbp)
lea    -0x10(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
jne    1160 <Sys_Sleep+0x50>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     115b <Sys_Sleep+0x4b>
jmp    1160 <Sys_Sleep+0x50>
jmp    1127 <Sys_Sleep+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_Sleep>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
movl   $0xf4240,(%rsp)
mov    %rsp,%rbx
mov    0x2ead(%rip),%r14
mov    0x2e9e(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
jne    1158 <Sys_Sleep+0x48>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1140 <Sys_Sleep+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@errno = global i64 0
@EINTR = global i64 0
define void @Sys_Sleep() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 1000000, i32* %3
br label %4
4: ; preds = %12, %0
%5 = call i32 @nanosleep(%struct.timespec* %1, %struct.timespec* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %4
13: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@errno = global i64 0
@EINTR = global i64 0
define void @Sys_Sleep() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1000000, i32* %4
br label %5
5: ; preds = %8, %0
%6 = call i32 @nanosleep(%struct.timespec* %1, %struct.timespec* %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br i1 %11, label %5, label %12
12: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
scalar_t__ ft_strsub_free(char *, int, int /*<<< orphan*/);
void fmt_unconvertible(void **addr) {
  if (addr && *addr) {
    *addr = (void *)ft_strsub_free((char *)*addr, 1, ft_strlen((char *)*addr));
  }
}


x86 assembly (clang, -O0):
<fmt_unconvertible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <fmt_unconvertible+0x56>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1176 <fmt_unconvertible+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
mov    $0x1,%esi
call   1040 <ft_strsub_free@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_unconvertible>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114e <fmt_unconvertible+0x2e>
mov    %rdi,%rbx
mov    (%rdi),%r14
test   %r14,%r14
je     114e <fmt_unconvertible+0x2e>
mov    %r14,%rdi
call   1030 <ft_strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1040 <ft_strsub_free@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fmt_unconvertible(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @ft_strlen(i8* %4)
%8 = tail call i64 @ft_strsub_free(i8* %4, i32 1, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %0
br label %10
10: ; preds = %6, %3, %1
ret void
}
void checkZero(double *v) {
  if ((((*v) > 0.0) && ((*v) < 0.01)) || (((*v) < 0.0) && ((*v) > -0.01))) {
    (*v) = 0.0;
  }
}


x86 assembly (clang, -O0):
<checkZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1133 <checkZero+0x33>
mov    -0x8(%rbp),%rax
movsd  0xed7(%rip),%xmm0
ucomisd (%rax),%xmm0
ja     115e <checkZero+0x5e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1169 <checkZero+0x69>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1169 <checkZero+0x69>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkZero>:
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    111c <checkZero+0x1c>
movsd  0xeea(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     112c <checkZero+0x2c>
ucomisd %xmm0,%xmm1
jbe    1133 <checkZero+0x33>
ucomisd 0xede(%rip),%xmm0
jbe    1133 <checkZero+0x33>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @checkZero(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = fcmp olt double %8, 1.000000e-02
br i1 %9, label %18, label %10
10: ; preds = %6, %1
%11 = load double*, double** %2
%12 = load double, double* %11
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load double*, double** %2
%16 = load double, double* %15
%17 = fcmp ogt double %16, -1.000000e-02
br i1 %17, label %18, label %20
18: ; preds = %14, %6
%19 = load double*, double** %2
store double 0.000000e+00, double* %19
br label %20
20: ; preds = %18, %14, %10
ret void
}

LLVM IR (-O2):
define void @checkZero(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ogt double %2, 0.000000e+00
%4 = fcmp olt double %2, 1.000000e-02
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = fcmp olt double %2, 0.000000e+00
%8 = fcmp ogt double %2, -1.000000e-02
%9 = and i1 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store double 0.000000e+00, double* %0
br label %11
11: ; preds = %10, %6
ret void
}
void init_graph(int nn_id) {}


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

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

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

LLVM IR (-O2):
define void @init_graph(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bswap(int /*<<< orphan*/);
void be32enc(void *buf, uint32_t x) { *((uint32_t *)buf) = _bswap(x); }


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

x86 assembly (clang, -O2):
<be32enc>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <_bswap@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @be32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @_bswap(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ usart_in_out(int);
uint8_t usart_in_byte(void) { return usart_in_out(0xff); }


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

x86 assembly (clang, -O2):
<usart_in_byte>:
mov    $0xff,%edi
jmp    1030 <usart_in_out@plt>

LLVM IR (-O0):
define i32 @usart_in_byte() {
%1 = call i32 @usart_in_out(i32 255)
ret i32 %1
}

LLVM IR (-O2):
define i32 @usart_in_byte() {
%1 = tail call i32 @usart_in_out(i32 255)
ret i32 %1
}
int ostcheck(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ostcheck() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dumpheader(void) {
  printf(
      "pc   sp   o    a    b    c    x    y    z    i    j    instruction\n"
      "---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----------\n");
}


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

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

LLVM IR (-O0):
@.str = [135 x i8] c"pc sp o a b c x y z i j instruction\0A---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----------\0A\00"
define void @dumpheader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [134 x i8] c"pc sp o a b c x y z i j instruction\0A---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----------\00"
define void @dumpheader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([134 x i8], [134 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t bsr(uint32_t value) {
  uint32_t res;
  asm volatile("bsr %1,%0" : "=r"(res) : "r"(value));
  return res;
}


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

x86 assembly (clang, -O2):
<bsr>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @bsr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "bsr $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @bsr(i8* %0) {
%2 = tail call i8* asm sideeffect "bsr $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int creat(char const *, int /*<<< orphan*/);
int Creat(const char *pathname, mode_t mode) {
  int retval;
  assert(pathname != NULL);
  retval = creat(pathname, mode);
  if (retval == -1)
    Sys_failure("creat");
  return retval;
}


x86 assembly (clang, -O0):
<Creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <creat@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1176 <Creat+0x46>
lea    0xe8f(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Creat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <creat@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1163 <Creat+0x33>
lea    0xea2(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"creat\00"
define i32 @Creat(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @creat(i8* %0, i32 %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *s, size_t n) { (void)memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bzero(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 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DoNothing(void) { printf("Do nothing\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Do nothing\00"
define void @DoNothing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned char const);
bool cutils_cdar_DynamicArray_unsigned_char_format(const unsigned char *i,
                                                   char **b, size_t *s) {
  snprintf(*b, *s, "%u", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_unsigned_char_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
lea    0xec3(%rip),%rdx
movzbl (%rax),%ecx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_unsigned_char_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
movzbl (%rdi),%ecx
lea    0xedf(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @cutils_cdar_DynamicArray_unsigned_char_format(i8* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i8, i8* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret i32 1
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int getrusage(int /*<<< orphan*/, struct rusage *);
int main(void) {
  struct rusage usage;
  return getrusage(RUSAGE_SELF, &usage);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rusage
store i32 0, i32* %1
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *,
                          char *);
void moved(char *script_name, char *url) {
  char *title = "Moved";
  (void)printf("Location: %s\nContent-type: "
               "text/html\n\n<HTML><HEAD><TITLE>%s</TITLE></"
               "HEAD>\n<BODY><H2>%s</H2>\nThe requested filename, %s, has "
               "moved to a new URL:\n<A HREF=\"%s\">%s</A>.\n</BODY></HTML>\n",
               url, title, title, script_name, url, url);
}


x86 assembly (clang, -O0):
<moved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x10(%rbp),%rax
lea    0xebc(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moved>:
push   %rax
mov    %rdi,%r8
mov    %rsi,(%rsp)
lea    0xee7(%rip),%rdi
lea    0xeda(%rip),%rcx
mov    %rcx,%rdx
mov    %rsi,%r9
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Moved\00"
@.str.1 = [182 x i8] c"Location: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0AThe requested filename, %s, has moved to a new URL:\0A<A HREF=\22%s\22>%s</A>.\0A</BODY></HTML>\0A\00"
define void @moved(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7, i8* %8, i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Moved\00"
@.str.1 = [182 x i8] c"Location: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0AThe requested filename, %s, has moved to a new URL:\0A<A HREF=\22%s\22>%s</A>.\0A</BODY></HTML>\0A\00"
define void @moved(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %1)
ret void
}
void MailMoveEvent() {}


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

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

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

LLVM IR (-O2):
define void @MailMoveEvent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_be(long);
int /*<<< orphan*/ output_char(char);
void output_num(char opcode, long int num) {
  output_char(opcode);
  output_be(num);
}


x86 assembly (clang, -O0):
<output_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <output_char@plt>
mov    -0x10(%rbp),%rdi
call   1040 <output_be@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_num>:
push   %rbx
mov    %rsi,%rbx
call   1030 <output_char@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <output_be@plt>

LLVM IR (-O0):
define void @output_num(i8 signext %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 = call i32 @output_char(i8 signext %5)
%7 = load i64, i64* %4
%8 = call i32 @output_be(i64 %7)
ret void
}

LLVM IR (-O2):
define void @output_num(i8 signext %0, i64 %1) {
%3 = tail call i32 @output_char(i8 signext %0)
%4 = tail call i32 @output_be(i64 %1)
ret void
}
void PC_InitTokenHeap(void) {}


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

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

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

LLVM IR (-O2):
define void @PC_InitTokenHeap() {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double x, double *psin, double *pcos) {
  *psin = sin(x);
  *pcos = cos(x);
}


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

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
void icl_start_energy_measurement() {}


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

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

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

LLVM IR (-O2):
define void @icl_start_energy_measurement() {
ret void
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_LOCAL0;
int LOG_NDELAY;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void initLogger() {
  openlog("snake", LOG_NDELAY | LOG_CONS, LOG_LOCAL0);
  syslog(LOG_INFO, "Log reached.");
}


x86 assembly (clang, -O0):
<initLogger>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
or     (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
call   1040 <openlog@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <syslog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initLogger>:
push   %rax
mov    0x2e98(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
call   1040 <openlog@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
pop    %rax
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"snake\00"
@LOG_NDELAY = global i32 0
@LOG_CONS = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [13 x i8] c"Log reached.\00"
define void @initLogger() {
%1 = load i32, i32* @LOG_NDELAY
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_LOCAL0
%5 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"snake\00"
@LOG_NDELAY = global i32 0
@LOG_CONS = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [13 x i8] c"Log reached.\00"
define void @initLogger() {
%1 = load i32, i32* @LOG_NDELAY
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_LOCAL0
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ display();
int redraw(void) {
  clear();
  display();
  return 0;
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
mov    $0x0,%al
call   1030 <display@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @redraw() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @display()
ret i32 0
}

LLVM IR (-O2):
define i32 @redraw() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @display()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
int is_dir(struct stat *info) { return (info->st_mode & S_IFDIR); }


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ec3(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @is_dir(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @S_IFDIR
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @is_dir(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IFDIR
%5 = and i32 %4, %3
ret i32 %5
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=23 REPO_URL=heads/master "
         "REVISION=r3p2-01rel3-5ae74d6 CHANGED_REVISION=5ae74d6 "
         "CHANGE_DATE=2013-08-15 00:41:16 -0400 BUILD_DATE=Wed Sep 25 11:11:27 "
         "EDT 2013 BUILD=debug TARGET_PLATFORM=rk30 MALI_PLATFORM=rk30 "
         "KDIR=/home/thesawolf/android/system/kernel/rockchip/rk3188/drivers/"
         "gpu/mali/rk3x OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y "
         "USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [460 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel3-5ae74d6 CHANGED_REVISION=5ae74d6 CHANGE_DATE=2013-08-15 00:41:16 -0400 BUILD_DATE=Wed Sep 25 11:11:27 EDT 2013 BUILD=debug TARGET_PLATFORM=rk30 MALI_PLATFORM=rk30 KDIR=/home/thesawolf/android/system/kernel/rockchip/rk3188/drivers/gpu/mali/rk3x OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([460 x i8], [460 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [460 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel3-5ae74d6 CHANGED_REVISION=5ae74d6 CHANGE_DATE=2013-08-15 00:41:16 -0400 BUILD_DATE=Wed Sep 25 11:11:27 EDT 2013 BUILD=debug TARGET_PLATFORM=rk30 MALI_PLATFORM=rk30 KDIR=/home/thesawolf/android/system/kernel/rockchip/rk3188/drivers/gpu/mali/rk3x OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([460 x i8], [460 x i8]* @.str, i64 0, i64 0)
}
char *xstrdup(s)
char *s;
{
  char *t;
  if (s) {
    t = xmalloc(strlen(s) + 1);
    strcpy(t, s);
  } else {
    t = xmalloc(1);
    *t = 0;
  }
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <xstrdup+0x46>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    118f <xstrdup+0x5f>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115c <xstrdup+0x2c>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    116e <xstrdup+0x3e>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rbx
movb   $0x0,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add i64 %8, 1
%10 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %13, i8* %14)
br label %21
16: ; preds = %1
%17 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 1)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %3
%20 = load i8*, i8** %3
store i8 0, i8* %20
br label %21
21: ; preds = %16, %6
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %8, i8* %0)
br label %14
10: ; preds = %1
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 1)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8 0, i8* %13
br label %14
14: ; preds = %10, %3
%15 = phi i8* [ %8, %3 ], [ %13, %10 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void check_alloc(void *p) {
  if (!p) {
    exit(errno);
  }
}


x86 assembly (clang, -O0):
<check_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <check_alloc+0x25>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_alloc>:
test   %rdi,%rdi
je     1116 <check_alloc+0x6>
ret
push   %rax
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @check_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @errno
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(unsigned int *, int, int, int /*<<< orphan*/ *);
int writeLastId(const char *path, unsigned int id) {
  FILE *fd = fopen(path, "wb");
  if (!fd)
    return 1;
  fwrite(&id, sizeof(unsigned int), 1, fd);
  fclose(fd);
  return 0;
}


x86 assembly (clang, -O0):
<writeLastId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116a <writeLastId+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1191 <writeLastId+0x61>
mov    -0x20(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLastId>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,0xc(%rsp)
lea    0xec0(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1170 <writeLastId+0x40>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1175 <writeLastId+0x45>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @writeLastId(i8* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int stb_prefix(char *s, char *t) {
  while (*t)
    if (*s++ != *t++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<stb_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <stb_prefix+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <stb_prefix+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <stb_prefix+0x5d>
jmp    110c <stb_prefix+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_prefix>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <stb_prefix+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <stb_prefix+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @stb_prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
void gtk_label_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void rewind(FILE *fp) {
  fseek(fp, 0, SEEK_SET);
  clearerr(fp);
}


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i32 0, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @clearerr(i32* %6)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @clearerr(i32* %0)
ret void
}
/* Variables and functions */
int keta(char *);
int ind(char *str) {
  if (keta(str) % 4 == 0)
    return keta(str) / 4;
  if (keta(str) % 4 > 0)
    return keta(str) / 4;
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <keta@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <ind+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <keta@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    117d <ind+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <keta@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    117d <ind+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <keta@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <keta@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <keta@plt>
mov    %eax,%ecx
test   $0x3,%bpl
je     113f <ind+0x2f>
test   $0x80000003,%ecx
jle    114c <ind+0x3c>
mov    %rbx,%rdi
call   1030 <keta@plt>
mov    %eax,%ecx
lea    0x3(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
jmp    114c <ind+0x3c>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ind(i8* %0) {
%2 = tail call i32 @keta(i8* %0)
%3 = and i32 %2, 3
%4 = icmp eq i32 %3, 0
%5 = tail call i32 @keta(i8* %0)
br i1 %4, label %6, label %8
6: ; preds = %1
%7 = sdiv i32 %5, 4
br label %14
8: ; preds = %1
%9 = and i32 %5, -2147483645
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @keta(i8* %0)
%13 = sdiv i32 %12, 4
br label %14
14: ; preds = %6, %11, %8
%15 = phi i32 [ %7, %6 ], [ %13, %11 ], [ undef, %8 ]
ret i32 %15
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_clear_quaddobl_data(void) {
  int fail;
  int precision = 2;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(864, &precision, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_clear_quaddobl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2,-0x8(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x360,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_clear_quaddobl_data>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x360,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_clear_quaddobl_data() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca double*
store i32 2, i32* %2
%5 = load i32*, i32** %3
%6 = load double*, double** %4
%7 = call i32 @_ada_use_c2phc4c(i32 864, i32* %2, i32* %5, double* %6, i32 0)
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @padcon_clear_quaddobl_data() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = call i32 @_ada_use_c2phc4c(i32 864, i32* %1, i32* undef, double* undef, i32 0)
ret i32 %3
}