xunge/DecIR huggingface dataset:
/* Variables and functions */
int msuspend(long);
extern int concurrent_util_msuspend(long mseconds) {
  return msuspend(mseconds);
}


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

x86 assembly (clang, -O2):
<concurrent_util_msuspend>:
jmp    1030 <msuspend@plt>

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

LLVM IR (-O2):
define i32 @concurrent_util_msuspend(i64 %0) {
%2 = tail call i32 @msuspend(i64 %0)
ret i32 %2
}
/* Variables and functions */
long long strlen(char const *);
char *strstr(char const *, char const *);
const char *check_skip(const char *in, const char *str) {
  const char *start;
  long long len = strlen(str);
  if (start = strstr(in, str)) {
    return start + len;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<check_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1169 <check_skip+0x49>
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <check_skip+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_skip>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strstr@plt>
test   %rax,%rax
je     1141 <check_skip+0x21>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
jmp    1143 <check_skip+0x23>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @check_skip(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = getelementptr inbounds i8, i8* %3, i64 %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(FILE *stream __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fileno(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ffs(int);
int chunk_to_shift(int chunksize) { return ffs(chunksize / 512) - 1; }


x86 assembly (clang, -O0):
<chunk_to_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ffs@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunk_to_shift>:
lea    0x1ff(%rdi),%eax
test   %edi,%edi
cmovs  %eax,%edi
sar    $0x9,%edi
bsf    %edi,%ecx
cmp    $0x3ff,%eax
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @chunk_to_shift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 512
%5 = call i32 @ffs(i32 %4)
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @chunk_to_shift(i32 %0) {
%2 = sdiv i32 %0, 512
%3 = tail call i32 @llvm.cttz.i32(i32 %2, i1 true)
%4 = add i32 %0, 511
%5 = icmp ult i32 %4, 1023
%6 = select i1 %5, i32 -1, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ print_header();
int /*<<< orphan*/ print_mandelbrot();
int main(int argc, char *argv[]) {
  print_header();
  print_mandelbrot();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print_header()
%4 = tail call i32 (...) @print_mandelbrot()
ret i32 0
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char const *argv[]) {
  if (chdir("/tmp") < 0) {
    fprintf(stderr, "chdir error for /tmp\n");
    exit(1);
  }
  printf("chdir to /tmp succeeded\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    118b <main+0x4b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
js     1162 <main+0x22>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"chdir error for /tmp\0A\00"
@.str.2 = [25 x i8] c"chdir to /tmp succeeded\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"chdir error for /tmp\0A\00"
@str = [24 x i8] c"chdir to /tmp succeeded\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void v3i_(vec) int vec[3];
{
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3i_>:
sub    $0x18,%rsp
cvtsi2ssl (%rdi),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssl 0x4(%rdi),%xmm0
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssl 0x8(%rdi),%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v3i_(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x float]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to float
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %19, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3i_(i32* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %6, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sclass_univ_rename_entry(int /*<<< orphan*/,
                                            int /*<<< orphan*/ const *,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/ const *,
                                            int /*<<< orphan*/);
uint8_t sclass_rename_entry(uint8_t oldnleng, const uint8_t *oldname,
                            uint8_t newnleng, const uint8_t *newname) {
  return sclass_univ_rename_entry(oldnleng, oldname, newnleng, newname, 0);
}


x86 assembly (clang, -O0):
<sclass_rename_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <sclass_univ_rename_entry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclass_rename_entry>:
xor    %r8d,%r8d
jmp    1030 <sclass_univ_rename_entry@plt>

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

LLVM IR (-O2):
define i32 @sclass_rename_entry(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = tail call i32 @sclass_univ_rename_entry(i32 %0, i32* %1, i32 %2, i32* %3, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             char *);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void clear_output(WINDOW *w) {
  wclear(w);
  box(w, 0, 0);
  mvwprintw(w, 0, 1, "PickledPi");
  wrefresh(w);
}


x86 assembly (clang, -O0):
<clear_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <wclear@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <box@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
lea    0xe8c(%rip),%rcx
call   1060 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_output>:
push   %rbx
mov    %rdi,%rbx
call   1050 <wclear@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <box@plt>
lea    0xea4(%rip),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <mvwprintw@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wrefresh@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"PickledPi\00"
define void @clear_output(i32* %0) {
%2 = tail call i32 @wclear(i32* %0)
%3 = tail call i32 @box(i32* %0, i32 0, i32 0)
%4 = tail call i32 @mvwprintw(i32* %0, i32 0, i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @wrefresh(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ azazel_init();
void init(void) { azazel_init(); }


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

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

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

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @azazel_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("Hello World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char I2C1_Rd(int /*<<< orphan*/);
int /*<<< orphan*/ I2C1_Repeated_Start();
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(int);
unsigned char RTC_Read(unsigned char ADD) {
  unsigned char DATA = 0;
  I2C1_Start();
  I2C1_Wr(0b11010000);
  I2C1_Wr(ADD);
  I2C1_Repeated_Start();
  I2C1_Wr(0b11010001);
  DATA = I2C1_Rd(0);
  I2C1_Stop();
  return DATA;
}


x86 assembly (clang, -O0):
<RTC_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
mov    $0x0,%al
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
movzbl -0x1(%rbp),%edi
call   1050 <I2C1_Wr@plt>
mov    $0x0,%al
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <I2C1_Stop@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTC_Read>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
mov    %ebx,%edi
call   1050 <I2C1_Wr@plt>
xor    %eax,%eax
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <I2C1_Stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @RTC_Read(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = call i32 (...) @I2C1_Start()
%5 = call i32 @I2C1_Wr(i32 208)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = call i32 @I2C1_Wr(i32 %7)
%9 = call i32 (...) @I2C1_Repeated_Start()
%10 = call i32 @I2C1_Wr(i32 209)
%11 = call zeroext i8 @I2C1_Rd(i32 0)
store i8 %11, i8* %3
%12 = call i32 (...) @I2C1_Stop()
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @RTC_Read(i8 zeroext %0) {
%2 = tail call i32 (...) @I2C1_Start()
%3 = tail call i32 @I2C1_Wr(i32 208)
%4 = zext i8 %0 to i32
%5 = tail call i32 @I2C1_Wr(i32 %4)
%6 = tail call i32 (...) @I2C1_Repeated_Start()
%7 = tail call i32 @I2C1_Wr(i32 209)
%8 = tail call zeroext i8 @I2C1_Rd(i32 0)
%9 = tail call i32 (...) @I2C1_Stop()
ret i8 %8
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ HOST_NOT_FOUND;
int /*<<< orphan*/ h_errno;
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
  h_errno = HOST_NOT_FOUND;
  return NULL;
}


x86 assembly (clang, -O0):
<gethostbyaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eca(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostbyaddr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@HOST_NOT_FOUND = global i32 0
@h_errno = global i32 0
define %struct.hostent* @gethostbyaddr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @HOST_NOT_FOUND
store i32 %7, i32* @h_errno
ret %struct.hostent* null
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@HOST_NOT_FOUND = global i32 0
@h_errno = global i32 0
define noalias %struct.hostent* @gethostbyaddr(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @HOST_NOT_FOUND
store i32 %4, i32* @h_errno
ret %struct.hostent* null
}
void RTCritSectEnter(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCritSectEnter() {
ret void
}
int pmm_block_to_location(int blk) { return blk * 4096; }


x86 assembly (clang, -O0):
<pmm_block_to_location>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmm_block_to_location>:
mov    %edi,%eax
shl    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @pmm_block_to_location(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 4096
ret i32 %4
}

LLVM IR (-O2):
define i32 @pmm_block_to_location(i32 %0) {
%2 = shl nsw i32 %0, 12
ret i32 %2
}
/* Type definitions */
struct cobaye_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cobaye_entry *);
void cobaye_destroy_seq(struct cobaye_entry *seq) { free(seq); }


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

x86 assembly (clang, -O2):
<cobaye_destroy_seq>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cobaye_entry = type { i32 }
define void @cobaye_destroy_seq(%struct.cobaye_entry* %0) {
%2 = alloca %struct.cobaye_entry*
store %struct.cobaye_entry* %0, %struct.cobaye_entry** %2
%3 = load %struct.cobaye_entry*, %struct.cobaye_entry** %2
%4 = call i32 @free(%struct.cobaye_entry* %3)
ret void
}

LLVM IR (-O2):
%struct.cobaye_entry = type { i32 }
define void @cobaye_destroy_seq(%struct.cobaye_entry* nocapture %0) {
%2 = tail call i32 @free(%struct.cobaye_entry* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sock_sendline(char *, char *, char *);
void ircproto_user(char *username, char *real_name) {
  sock_sendline("USER %s 0 * :%s", username, real_name);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"USER %s 0 * :%s\00"
define void @ircproto_user(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 @sock_sendline(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"USER %s 0 * :%s\00"
define void @ircproto_user(i8* %0, i8* %1) {
%3 = tail call i32 @sock_sendline(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void fctstr_safe_cpy(char *dst, char const *src, size_t num) {
  assert(dst != NULL);
  assert(src != NULL);
  assert(num > 0);
  strncpy(dst, src, num);
  dst[num - 1] = '\0';
}


x86 assembly (clang, -O0):
<fctstr_safe_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fctstr_safe_cpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
test   %r12,%r12
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
mov    %r14,%rbx
add    $0xffffffffffffffff,%rbx
setb   %dil
call   1040 <assert@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r12,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fctstr_safe_cpy(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** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %6
%16 = icmp ugt i64 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = load i64, i64* %6
%22 = call i32 @strncpy(i8* %19, i8* %20, i64 %21)
%23 = load i8*, i8** %4
%24 = load i64, i64* %6
%25 = sub i64 %24, 1
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 0, i8* %26
ret void
}

LLVM IR (-O2):
define void @fctstr_safe_cpy(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i8* %1, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp ne i64 %2, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%14 = add i64 %2, -1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *xstrdup(const char *string) {
  return strcpy(malloc(strlen(string) + 1), string);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @malloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
double degrees(int /*<<< orphan*/);
double radians(double);
double sin(double);
int /*<<< orphan*/ sun_real_longitude(double);
double sun_apparent_longitude(double tm) {
  double rc = degrees(sun_real_longitude(tm)) - 0.00569;
  return radians(rc - 0.00478 * sin(radians(-1934.136 * tm + 125.04)));
}


x86 assembly (clang, -O0):
<sun_apparent_longitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sun_real_longitude@plt>
mov    %eax,%edi
call   1060 <degrees@plt>
movsd  0xeb2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe82(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <radians@plt>
call   1040 <sin@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe53(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <radians@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_apparent_longitude>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sun_real_longitude@plt>
mov    %eax,%edi
call   1060 <degrees@plt>
addsd  0xea2(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe96(%rip),%xmm0
addsd  0xe96(%rip),%xmm0
call   1050 <radians@plt>
call   1040 <sin@plt>
mulsd  0xe8c(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1050 <radians@plt>

LLVM IR (-O0):
define double @sun_apparent_longitude(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @sun_real_longitude(double %4)
%6 = call double @degrees(i32 %5)
%7 = fsub double %6, 5.690000e-03
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double 0xC09E388B43958106, double %9, double 1.250400e+02)
%11 = call double @radians(double %10)
%12 = call double @sin(double %11)
%13 = call double @llvm.fmuladd.f64(double -4.780000e-03, double %12, double %8)
%14 = call double @radians(double %13)
ret double %14
}

LLVM IR (-O2):
define double @sun_apparent_longitude(double %0) {
%2 = tail call i32 @sun_real_longitude(double %0)
%3 = tail call double @degrees(i32 %2)
%4 = fadd double %3, -5.690000e-03
%5 = tail call double @llvm.fmuladd.f64(double %0, double 0xC09E388B43958106, double 1.250400e+02)
%6 = tail call double @radians(double %5)
%7 = tail call double @sin(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double -4.780000e-03, double %4)
%9 = tail call double @radians(double %8)
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime_s(char *, int, int /*<<< orphan*/ const *);
scalar_t__ platform_mem_allocate(int);
const char *platform_ctime(const time_t *timer) {
  char *buffer = (char *)platform_mem_allocate(64);
  ctime_s(buffer, 64, timer);
  return buffer;
}


x86 assembly (clang, -O0):
<platform_ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x40,%edi
call   1030 <platform_mem_allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x40,%esi
call   1040 <ctime_s@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_ctime>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x40,%edi
call   1030 <platform_mem_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x40,%esi
mov    %r14,%rdx
call   1040 <ctime_s@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @platform_ctime(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = call i64 @platform_mem_allocate(i32 64)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32*, i32** %2
%8 = call i32 @ctime_s(i8* %6, i32 64, i32* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @platform_ctime(i32* %0) {
%2 = tail call i64 @platform_mem_allocate(i32 64)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @ctime_s(i8* %3, i32 64, i32* %0)
ret i8* %3
}
int main(argc, argv)
int argc;
char *argv[];
{
  if (argc != 2) {
    printf("Usage:\t%s file\n", argv[0]);
  } else {
    acl_sort(argv[1]);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1179 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <acl_sort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1148 <main+0x18>
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1030 <acl_sort@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    (%rsi),%rsi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Usage:\09%s file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @acl_sort to i32 (i8*, ...)*)(i8* %16)
br label %18
18: ; preds = %13, %8
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Usage:\09%s file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @acl_sort to i32 (i8*, ...)*)(i8* %9)
br label %11
11: ; preds = %7, %4
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ base_err_alloc(size_t);
void *malloc(size_t);
void *base_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    base_err_alloc(size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<base_malloc>:
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    114d <base_malloc+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <base_err_alloc@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <base_malloc+0x1c>
mov    %r14,%rdi
call   1040 <base_err_alloc@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @base_malloc(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 eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @base_err_alloc(i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @base_malloc(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 @base_err_alloc(i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
float mrcGetComplexScale() { return 5.0; }


x86 assembly (clang, -O0):
<mrcGetComplexScale>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrcGetComplexScale>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @mrcGetComplexScale() {
ret float 5.000000e+00
}

LLVM IR (-O2):
define float @mrcGetComplexScale() {
ret float 5.000000e+00
}
/* Variables and functions */
unsigned char *ss2gpix(unsigned int *, unsigned int *);
unsigned char *ss2gpix_(unsigned int *width, unsigned int *height) {
  return ss2gpix(width, height);
}


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

x86 assembly (clang, -O2):
<ss2gpix_>:
jmp    1030 <ss2gpix@plt>

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

LLVM IR (-O2):
define i8* @ss2gpix_(i32* %0, i32* %1) {
%3 = tail call i8* @ss2gpix(i32* %0, i32* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int _listfile_write_hex(FILE *f, int data) {
  if (data >= 10)
    fprintf(f, "%c", data + 'A' - 10);
  else
    fprintf(f, "%c", data + '0');
  return 0;
}


x86 assembly (clang, -O0):
<_listfile_write_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jl     1147 <_listfile_write_hex+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x41,%edx
sub    $0xa,%edx
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115d <_listfile_write_hex+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x30,%edx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_listfile_write_hex>:
push   %rax
mov    %rdi,%rax
lea    0x30(%rsi),%ecx
lea    0x37(%rsi),%edi
cmp    $0xa,%esi
cmovl  %ecx,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_listfile_write_hex(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 9
%4 = select i1 %3, i32 55, i32 48
%5 = add nsw i32 %4, %1
%6 = tail call i32 @fputc(i32 %5, i32* %0)
ret i32 0
}
int get_mtx_index(int row, int col, int row_size) {
  return row * row_size + col;
}


x86 assembly (clang, -O0):
<get_mtx_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtx_index>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @get_mtx_index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLubyte;

/* Variables and functions */
int /*<<< orphan*/ vmwPutAlphaPixel(int, int, int, int /*<<< orphan*/ *);
int vmwDrawAlphaHLine(int x, int y, int run, int color, GLubyte *target) {
  int i;
  for (i = 0; i < run; i++) {
    vmwPutAlphaPixel(x + i, y, color, target);
  }
  return 0;
}


x86 assembly (clang, -O0):
<vmwDrawAlphaHLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <vmwDrawAlphaHLine+0x4e>
mov    -0x4(%rbp),%edi
add    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <vmwPutAlphaPixel@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <vmwDrawAlphaHLine+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwDrawAlphaHLine>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <vmwDrawAlphaHLine+0x38>
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %esi,%r12d
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <vmwPutAlphaPixel@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <vmwDrawAlphaHLine+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vmwDrawAlphaHLine(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
store i32 0, i32* %11
br label %12
12: ; preds = %24, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = load i32, i32* %6
%18 = load i32, i32* %11
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = load i32*, i32** %10
%23 = call i32 @vmwPutAlphaPixel(i32 %19, i32 %20, i32 %21, i32* %22)
br label %24
24: ; preds = %16
%25 = load i32, i32* %11
%26 = add nsw i32 %25, 1
store i32 %26, i32* %11
br label %12
27: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @vmwDrawAlphaHLine(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %13
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ 0, %5 ]
%9 = add nsw i32 %8, %0
%10 = tail call i32 @vmwPutAlphaPixel(i32 %9, i32 %1, i32 %3, i32* %4)
%11 = add nuw nsw i32 %8, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %7
13: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int Sleep(int ms) {
  usleep(ms * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 0
}
void stats_wait_queue_empty(void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @stats_wait_queue_empty(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ as_str(char const *);
int atoi(int /*<<< orphan*/);
unsigned as_int(const char *line) { return atoi(as_str(line)); }


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

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

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

LLVM IR (-O2):
define i32 @as_int(i8* %0) {
%2 = tail call i32 @as_str(i8* %0)
%3 = tail call i32 @atoi(i32 %2)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long root;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_root(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcrossing.root = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcrossing_root(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
long *func_short_enums(short values[]) {
  static long retvals[4];
  retvals[0] = values[0];
  retvals[1] = values[1];
  retvals[2] = values[2];
  retvals[3] = values[3];
  return retvals;
}


x86 assembly (clang, -O0):
<func_short_enums>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswq (%rax),%rax
mov    %rax,0x2f19(%rip)
mov    -0x8(%rbp),%rax
movswq 0x2(%rax),%rax
mov    %rax,0x2f11(%rip)
mov    -0x8(%rbp),%rax
movswq 0x4(%rax),%rax
mov    %rax,0x2f09(%rip)
mov    -0x8(%rbp),%rax
movswq 0x6(%rax),%rax
mov    %rax,0x2f01(%rip)
lea    0x2ee2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_short_enums>:
movswq (%rdi),%rax
mov    %rax,0x2f25(%rip)
lea    0x2f1e(%rip),%rax
movswq 0x2(%rdi),%rcx
mov    %rcx,0x2f1a(%rip)
movswq 0x4(%rdi),%rcx
mov    %rcx,0x2f16(%rip)
movswq 0x6(%rdi),%rcx
mov    %rcx,0x2f12(%rip)
ret

LLVM IR (-O0):
@func_short_enums.retvals = internal global [4 x i64] zeroinitializer
define i64* @func_short_enums(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 0
%5 = load i16, i16* %4
%6 = sext i16 %5 to i64
store i64 %6, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 0)
%7 = load i16*, i16** %2
%8 = getelementptr inbounds i16, i16* %7, i64 1
%9 = load i16, i16* %8
%10 = sext i16 %9 to i64
store i64 %10, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 1)
%11 = load i16*, i16** %2
%12 = getelementptr inbounds i16, i16* %11, i64 2
%13 = load i16, i16* %12
%14 = sext i16 %13 to i64
store i64 %14, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 2)
%15 = load i16*, i16** %2
%16 = getelementptr inbounds i16, i16* %15, i64 3
%17 = load i16, i16* %16
%18 = sext i16 %17 to i64
store i64 %18, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 3)
ret i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 0)
}

LLVM IR (-O2):
@func_short_enums.retvals = internal global [4 x i64] zeroinitializer
define i64* @func_short_enums(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = sext i16 %2 to i64
store i64 %3, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 0)
%4 = getelementptr inbounds i16, i16* %0, i64 1
%5 = load i16, i16* %4
%6 = sext i16 %5 to i64
store i64 %6, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 1)
%7 = getelementptr inbounds i16, i16* %0, i64 2
%8 = load i16, i16* %7
%9 = sext i16 %8 to i64
store i64 %9, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 2)
%10 = getelementptr inbounds i16, i16* %0, i64 3
%11 = load i16, i16* %10
%12 = sext i16 %11 to i64
store i64 %12, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 3)
ret i64* getelementptr inbounds ([4 x i64], [4 x i64]* @func_short_enums.retvals, i64 0, i64 0)
}
void shared_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @shared_cleanup() {
ret void
}