xunge/DecIR huggingface dataset:
int kmain() {
  monitor_clear();
  monitor_write("Meu SO\n\n");
  gdt_init();
  idt_init();
  asm volatile("sti");
  asm volatile("int $0x3");
  asm volatile("int $0x4");
  init_timer(100);
  paging();
  while (1)
    ;
  return 1;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <monitor_clear@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1060 <monitor_write@plt>
mov    $0x0,%al
call   1080 <gdt_init@plt>
mov    $0x0,%al
call   1050 <idt_init@plt>
sti
int3
int    $0x4
mov    $0x64,%edi
mov    $0x0,%al
call   1070 <init_timer@plt>
mov    $0x0,%al
call   1030 <paging@plt>
jmp    119e <kmain+0x3e>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <monitor_clear@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1060 <monitor_write@plt>
xor    %eax,%eax
call   1080 <gdt_init@plt>
xor    %eax,%eax
call   1050 <idt_init@plt>
sti
int3
int    $0x4
mov    $0x64,%edi
xor    %eax,%eax
call   1070 <init_timer@plt>
xor    %eax,%eax
call   1030 <paging@plt>
nopl   0x0(%rax,%rax,1)
jmp    11a0 <kmain+0x40>

LLVM IR (-O0):
@.str = [9 x i8] c"Meu SO\0A\0A\00"
define i32 @kmain() {
%1 = call i32 (...) @monitor_clear()
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @monitor_write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gdt_init()
%4 = call i32 (...) @idt_init()
%5 = call i32 (i32, ...) bitcast (i32 (...)* @init_timer to i32 (i32, ...)*)(i32 100)
%6 = call i32 (...) @paging()
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"Meu SO\0A\0A\00"
define i32 @kmain() {
%1 = tail call i32 (...) @monitor_clear()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @monitor_write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @gdt_init()
%4 = tail call i32 (...) @idt_init()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x4", "~{dirflag},~{fpsr},~{flags}"()
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @init_timer to i32 (i32, ...)*)(i32 100)
%6 = tail call i32 (...) @paging()
br label %7
7: ; preds = %0, %7
br label %7
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int list_comparator_uint16_t(const void *a, const void *b) {
  return (*(uint16_t *)a < *(uint16_t *)b) - (*(uint16_t *)a > *(uint16_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_uint16_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_uint16_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_uint16_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello there world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"hello there world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"hello there world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isZeroChr(char *x) {
  if (x[0] == '0') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isZeroChr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1124 <isZeroChr+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isZeroChr+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isZeroChr>:
xor    %eax,%eax
cmpb   $0x30,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isZeroChr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 48
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isZeroChr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t st_inthash(const void *k, int type) {
  return (size_t)(*(const int *)k ^ type);
}


x86 assembly (clang, -O0):
<st_inthash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_inthash>:
xor    (%rdi),%esi
movslq %esi,%rax
ret

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

LLVM IR (-O2):
define i64 @st_inthash(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = xor i32 %4, %1
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ do_service(int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *route(void *arg) {
  pthread_detach(pthread_self());
  int connfd = *((int *)arg);
  free(arg);
  do_service(connfd);
}


x86 assembly (clang, -O0):
<route>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1040 <do_service@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<route>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    (%rbx),%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <do_service@plt>

LLVM IR (-O0):
define i8* @route(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @pthread_self()
%6 = call i32 @pthread_detach(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
%12 = load i32, i32* %4
%13 = call i32 @do_service(i32 %12)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @route(i8* nocapture %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @do_service(i32 %5)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_POP_PX(void *b, int wv) {
  static const unsigned char tab[3][4] = {
      {0x58, 0x83, 0xC4, 12},
      {0x5F, 0x83, 0xC4, 12},
      {0x59, 0x83, 0xC4, 12},
  };
  memcpy(b, tab[wv], 4);
}


x86 assembly (clang, -O0):
<GLUE_POP_PX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_POP_PX>:
movslq %esi,%rax
lea    0xee6(%rip),%rcx
lea    (%rcx,%rax,4),%rsi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_POP_PX.tab = internal constant [3 x [4 x i8]] [[4 x i8] c"X\83\C4\0C", [4 x i8] c"_\83\C4\0C", [4 x i8] c"Y\83\C4\0C"]
define void @GLUE_POP_PX(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* @GLUE_POP_PX.tab, i64 0, i64 %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 4)
ret void
}

LLVM IR (-O2):
@GLUE_POP_PX.tab = internal constant [3 x [4 x i8]] [[4 x i8] c"X\83\C4\0C", [4 x i8] c"_\83\C4\0C", [4 x i8] c"Y\83\C4\0C"]
define void @GLUE_POP_PX(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [4 x i8]], [3 x [4 x i8]]* @GLUE_POP_PX.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ unlink(char *);
int is_root() {
  FILE *Fp;
  Fp = fopen("/_mnemontemp_", "w");
  if (Fp == NULL) {
    return !1;
  }
  fclose(Fp);
  unlink("/_mnemontemp_");
  return 1;
}


x86 assembly (clang, -O0):
<is_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1166 <is_root+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1182 <is_root+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xe8a(%rip),%rdi
call   1030 <unlink@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_root>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1164 <is_root+0x34>
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0xea8(%rip),%rdi
call   1030 <unlink@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/_mnemontemp_\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @is_root() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %11
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
%10 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"/_mnemontemp_\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @is_root() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
%5 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void display_help(void) {
  fprintf(stderr, "Usage: replay [-v|rc] filename\n"
                  "\t-v\tdisplay version\n"
                  "\t-r\trepeat playlist\n"
                  "\r-s\tshuffle playlist\n"
                  "\t-c\tuse curses interface\n"
                  "\t-h\tdisplay this help message\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [148 x i8] c"Usage: replay [-v|rc] filename\0A\09-v\09display version\0A\09-r\09repeat playlist\0A\0D-s\09shuffle playlist\0A\09-c\09use curses interface\0A\09-h\09display this help message\0A\00"
@EXIT_FAILURE = global i32 0
define void @display_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [148 x i8] c"Usage: replay [-v|rc] filename\0A\09-v\09display version\0A\09-r\09repeat playlist\0A\0D-s\09shuffle playlist\0A\09-c\09use curses interface\0A\09-h\09display this help message\0A\00"
@EXIT_FAILURE = global i32 0
define void @display_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int IntersectionContents(int c1, int c2) {
  int out;
  out = c1 | c2;
  if (out & 0x00000001) {
    out = 0x00000001;
  }
  return out;
}


x86 assembly (clang, -O0):
<IntersectionContents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <IntersectionContents+0x29>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntersectionContents>:
or     %esi,%edi
test   $0x1,%dil
mov    $0x1,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @IntersectionContents(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = or i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %5
br label %13
13: ; preds = %12, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @IntersectionContents(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %3, i32 1
ret i32 %6
}
/* Variables and functions */
float cosf(double);
double filter_tri(float, float, float);
float filter_hann(float k, float r, float w) {
  return 0.5f -
         cosf(3.14159265358979323846264338327 * filter_tri(k, r, w)) / 2.f;
}


x86 assembly (clang, -O0):
<filter_hann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <filter_tri@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <cosf@plt>
movaps %xmm0,%xmm1
movss  0xe9a(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xe8a(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_hann>:
push   %rax
call   1040 <filter_tri@plt>
mulsd  0xed2(%rip),%xmm0
call   1030 <cosf@plt>
movss  0xecd(%rip),%xmm1
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @filter_hann(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call double @filter_tri(float %7, float %8, float %9)
%11 = fmul double 0x400921FB54442D18, %10
%12 = call float @cosf(double %11)
%13 = fdiv float %12, 2.000000e+00
%14 = fsub float 5.000000e-01, %13
ret float %14
}

LLVM IR (-O2):
define float @filter_hann(float %0, float %1, float %2) {
%4 = tail call double @filter_tri(float %0, float %1, float %2)
%5 = fmul double %4, 0x400921FB54442D18
%6 = tail call float @cosf(double %5)
%7 = fmul float %6, 5.000000e-01
%8 = fsub float 5.000000e-01, %7
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
int /*<<< orphan*/ printf(char *);
int test_fatal_1038(char *msg) {
  printf("   fatal( \"log.c:fatal(): test message: '%%s'\", msg );");
  fatal("log.c:fatal(): test message: '%s'", msg);
  printf(" passed\n");
  return (0);
}


x86 assembly (clang, -O0):
<test_fatal_1038>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef4(%rip),%rdi
call   1040 <fatal@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fatal_1038>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <fatal@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c" fatal( \22log.c:fatal(): test message: '%%s'\22, msg );\00"
@.str.1 = [34 x i8] c"log.c:fatal(): test message: '%s'\00"
@.str.2 = [9 x i8] c" passed\0A\00"
define i32 @test_fatal_1038(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c" fatal( \22log.c:fatal(): test message: '%%s'\22, msg );\00"
@.str.1 = [34 x i8] c"log.c:fatal(): test message: '%s'\00"
@str = [8 x i8] c" passed\00"
define i32 @test_fatal_1038(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 1;
  int y = 2;
  int z = (x > y) ? 0 : 1;
  printf("z = %d\n", z);
  if (x > y) {
    z = 0;
  } else {
    z = 1;
  }
  printf("z = %d\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1169 <main+0x59>
movl   $0x0,-0x10(%rbp)
jmp    1170 <main+0x60>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"z = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct iax_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct iax_frame *);
void iax_frame_free(struct iax_frame *fr) { free(fr); }


x86 assembly (clang, -O0):
<iax_frame_free>:
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):
<iax_frame_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.iax_frame = type { i32 }
define void @iax_frame_free(%struct.iax_frame* nocapture %0) {
%2 = tail call i32 @free(%struct.iax_frame* %0)
ret void
}
int dpi_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dpi_init() {
ret i32 0
}
void ReplaceChar(char *ptr, char from, char to) {
  char c;
  while (1) {
    c = *ptr;
    if (!c)
      return;
    if (c == from)
      c = to;
    *ptr++ = c;
  }
}


x86 assembly (clang, -O0):
<ReplaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xb(%rbp)
cmpb   $0x0,-0xb(%rbp)
jne    1128 <ReplaceChar+0x28>
pop    %rbp
ret
movsbl -0xb(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <ReplaceChar+0x3e>
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1113 <ReplaceChar+0x13>

x86 assembly (clang, -O2):
<ReplaceChar>:
mov    (%rdi),%al
test   %al,%al
je     1127 <ReplaceChar+0x27>
add    $0x1,%rdi
movzbl %dl,%ecx
nopl   (%rax)
cmp    %sil,%al
movzbl %al,%eax
cmove  %ecx,%eax
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <ReplaceChar+0x10>
ret

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

LLVM IR (-O2):
define void @ReplaceChar(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret void
7: ; preds = %3, %7
%8 = phi i8 [ %13, %7 ], [ %4, %3 ]
%9 = phi i8* [ %12, %7 ], [ %0, %3 ]
%10 = icmp eq i8 %8, %1
%11 = select i1 %10, i8 %2, i8 %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %11, i8* %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void error(char *err_msg) {
  write((2), err_msg, strlen(err_msg));
  write((2), "\n", 1);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xe97(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb1(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
float CalcVecAngle(float *, float *);
float CalcVecAngleDegree(float vec1[3], float vec2[3]) {
  float rad = CalcVecAngle(vec1, vec2);
  return (180.0 * rad / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<CalcVecAngleDegree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CalcVecAngle@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcVecAngleDegree>:
push   %rax
call   1030 <CalcVecAngle@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xede(%rip),%xmm0
divsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @CalcVecAngleDegree(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = call float @CalcVecAngle(float* %6, float* %7)
store float %8, float* %5
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fmul double 1.800000e+02, %10
%12 = fdiv double %11, 0x400921FB54442D18
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @CalcVecAngleDegree(float* %0, float* %1) {
%3 = tail call float @CalcVecAngle(float* %0, float* %1)
%4 = fpext float %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ sleep(int);
void test_function(void) {
  (void)getpid();
  sleep(1);
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_function>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
define void @test_function() {
%1 = call i32 (...) @getpid()
%2 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_function() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @sleep(i32 1)
ret void
}
int banded_color(int total, int n, int imax,
                 long double UNUSED_zr __attribute__((__unused__)),
                 long double UNUSED_zi __attribute__((__unused__)),
                 long double UNUSED_logr __attribute__((__unused__))) {
  return n * total / imax;
}


x86 assembly (clang, -O0):
<banded_color>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fstpt  -0x40(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<banded_color>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @banded_color(i32 %0, i32 %1, i32 %2, x86_fp80 %3, x86_fp80 %4, x86_fp80 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca x86_fp80
%11 = alloca x86_fp80
%12 = alloca x86_fp80
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store x86_fp80 %3, x86_fp80* %10
store x86_fp80 %4, x86_fp80* %11
store x86_fp80 %5, x86_fp80* %12
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %9
%17 = sdiv i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @banded_color(i32 %0, i32 %1, i32 %2, x86_fp80 %3, x86_fp80 %4, x86_fp80 %5) {
%7 = mul nsw i32 %1, %0
%8 = sdiv i32 %7, %2
ret i32 %8
}
unsigned avcodec_build(void) { return 4675; }


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

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

LLVM IR (-O0):
define i32 @avcodec_build() {
ret i32 4675
}

LLVM IR (-O2):
define i32 @avcodec_build() {
ret i32 4675
}
/* Variables and functions */
unsigned int tolower(char const);
unsigned int symbol_hash(const char *str) {
  unsigned int hash = 5381;
  while (*str) {
    hash = ((hash << 5) + hash) + tolower(*str);
    str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<symbol_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <symbol_hash+0x53>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <symbol_hash+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_hash>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114e <symbol_hash+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0x1505,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ebp
shl    $0x5,%ebp
add    %eax,%ebp
movsbl %cl,%edi
call   1030 <tolower@plt>
add    %ebp,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <symbol_hash+0x20>
jmp    1153 <symbol_hash+0x43>
mov    $0x1505,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @symbol_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = tail call i32 @tolower(i8 signext %5)
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
char *dtoa(n)
int n;
{
  static char buf[30];
  (void)sprintf(buf, "%d", n);
  return (buf);
}


x86 assembly (clang, -O0):
<dtoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@dtoa.buf = internal global [30 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @dtoa(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @dtoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @dtoa.buf, i64 0, i64 0)
}
double f14(double x) {
  double t = x + (-0.0);
  return t - (-0.0);
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f14(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, -0.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = fsub double %6, -0.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f14(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ recMFC0();
void recCFC0() { recMFC0(); }


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

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

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

LLVM IR (-O2):
define void @recCFC0() {
%1 = tail call i32 (...) @recMFC0()
ret void
}
void test_three(int x, int y) {
#pragma omp parallel for collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int setnonblocking(int socket) {
  int ret;
  ret = fcntl(socket, F_GETFL);
  if (ret >= 0) {
    ret = fcntl(socket, F_SETFL, ret | O_NONBLOCK);
  }
  return ret;
}


x86 assembly (clang, -O0):
<setnonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115d <setnonblocking+0x4d>
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e97(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1145 <setnonblocking+0x35>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edx
or     %eax,%edx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = load i32, i32* @O_NONBLOCK
%14 = or i32 %12, %13
%15 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ %9, %5 ], [ %3, %1 ]
ret i32 %11
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ qnorm(double const, double const, double const);
double qlnorm(const double p, const double logmu, const double logsigma) {
  return exp(qnorm(p, logmu, logsigma));
}


x86 assembly (clang, -O0):
<qlnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <qnorm@plt>
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @qlnorm(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 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @qnorm(double %7, double %8, double %9)
%11 = call double @exp(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @qlnorm(double %0, double %1, double %2) {
%4 = tail call i32 @qnorm(double %0, double %1, double %2)
%5 = tail call double @exp(i32 %4)
ret double %5
}
/* Variables and functions */
void *malloc(int);
void *MOJOSHADER_internal_malloc(int bytes, void *d) { return malloc(bytes); }


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

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

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

LLVM IR (-O2):
define noalias i8* @MOJOSHADER_internal_malloc(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @malloc(i32 %0)
ret i8* %3
}
/* Variables and functions */
long *x_malloc(int);
long *copy_long(long num) {
  long *l_ptr = x_malloc(sizeof(long));
  *l_ptr = num;
  return l_ptr;
}


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

x86 assembly (clang, -O2):
<copy_long>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <x_malloc@plt>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i64* @copy_long(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
store i64 %0, i64* %2
%4 = call i64* @x_malloc(i32 8)
store i64* %4, i64** %3
%5 = load i64, i64* %2
%6 = load i64*, i64** %3
store i64 %5, i64* %6
%7 = load i64*, i64** %3
ret i64* %7
}

LLVM IR (-O2):
define i64* @copy_long(i64 %0) {
%2 = tail call i64* @x_malloc(i32 8)
store i64 %0, i64* %2
ret i64* %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t is_leap(int32_t year) {
  if (year % 400 == 0)
    return 1;
  if (year % 100 == 0)
    return 0;
  if (year % 4 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_leap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <is_leap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <is_leap+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello world.\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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() {
%1 = 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() {
%1 = 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 */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, world!!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [16 x i8] c"Hello, world!!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello, world!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ floorf(float);
int _floor(float n) { return (int)floorf(n); }


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

x86 assembly (clang, -O2):
<_floor>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define i32 @_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @floorf(float %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_floor(float %0) {
%2 = tail call i64 @floorf(float %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}