xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(void) { raise(SIGINT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @raise(i32 %1)
ret i32 0
}

LLVM IR (-O2):
@SIGINT = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @raise(i32 %1)
ret i32 0
}
ttclose() {}


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

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

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

LLVM IR (-O2):
define i32 @ttclose() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
void safe_listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) != 0) {
    perror("safe_bind - Failed to listen");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<safe_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
je     116d <safe_listen+0x3d>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_listen>:
push   %rax
call   1030 <listen@plt>
test   %rax,%rax
jne    113d <safe_listen+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"safe_bind - Failed to listen\00"
@EXIT_FAILURE = global i32 0
define void @safe_listen(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 i64 @listen(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"safe_bind - Failed to listen\00"
@EXIT_FAILURE = global i32 0
define void @safe_listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
char *safealloc(int);
void while_loop() {
  int i = 0;
  char *a = safealloc(10);
  while (*(a + i) && i < 10)
    a[i++] = 1;
}


x86 assembly (clang, -O0):
<while_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <safealloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1151 <while_loop+0x41>
cmpl   $0xa,-0x4(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1161 <while_loop+0x51>
jmp    117c <while_loop+0x6c>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
movslq %ecx,%rcx
movb   $0x1,(%rax,%rcx,1)
jmp    112d <while_loop+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<while_loop>:
push   %rax
mov    $0xa,%edi
call   1030 <safealloc@plt>
cmpb   $0x0,(%rax)
je     1148 <while_loop+0x38>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x1,(%rax,%rcx,1)
cmpb   $0x0,0x1(%rax,%rcx,1)
je     1148 <while_loop+0x38>
lea    0x1(%rcx),%rdx
cmp    $0x9,%rcx
mov    %rdx,%rcx
jb     1130 <while_loop+0x20>
pop    %rax
ret

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

LLVM IR (-O2):
define void @while_loop() {
%1 = tail call i8* @safealloc(i32 10)
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i64 [ %7, %4 ], [ 0, %0 ]
%6 = phi i8* [ %8, %4 ], [ %1, %0 ]
%7 = add nuw nsw i64 %5, 1
store i8 1, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
%11 = icmp ult i64 %5, 9
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
int _wc_indelim(wchar_t wc, const wchar_t *delim) {
  while (*delim) {
    if (wc == *delim)
      return 1;
    delim++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_wc_indelim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1148 <_wc_indelim+0x48>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jne    1137 <_wc_indelim+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114f <_wc_indelim+0x4f>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <_wc_indelim+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wc_indelim>:
mov    (%rsi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1121 <_wc_indelim+0x21>
add    $0x8,%rsi
xchg   %ax,%ax
cmp    %rdi,%rcx
je     1122 <_wc_indelim+0x22>
mov    (%rsi),%rcx
add    $0x8,%rsi
test   %rcx,%rcx
jne    1110 <_wc_indelim+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_wc_indelim(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i64, i64* %12
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i64 [ %6, %5 ], [ %3, %2 ]
%10 = phi i64* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i64 %9, %0
%12 = getelementptr inbounds i64, i64* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ screen_putch(int /*<<< orphan*/);
void screen_puts(const char *text) {
  while (*text)
    screen_putch(*text++);
}


x86 assembly (clang, -O0):
<screen_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <screen_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <screen_putch@plt>
jmp    111c <screen_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <screen_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <screen_putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <screen_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @screen_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @screen_putch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showhelp() {
  printf("Shannon-Fano coding archiver\nby Minh Ngo (nlminhtl@gmail.com)\n\n");
  printf("Ussage: ./shannon-fano OPTION input "
         "output\n\t-p\tcompressing\n\t-u\tuncompressing\n");
}


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

x86 assembly (clang, -O2):
<showhelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Shannon-Fano coding archiver\0Aby Minh Ngo (nlminhtl@gmail.com)\0A\0A\00"
@.str.1 = [78 x i8] c"Ussage: ./shannon-fano OPTION input output\0A\09-p\09compressing\0A\09-u\09uncompressing\0A\00"
define void @showhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"Shannon-Fano coding archiver\0Aby Minh Ngo (nlminhtl@gmail.com)\0A\00"
@str.2 = [77 x i8] c"Ussage: ./shannon-fano OPTION input output\0A\09-p\09compressing\0A\09-u\09uncompressing\00"
define void @showhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.2, i64 0, i64 0))
ret void
}
int min1(int arg1, int arg2) {
  int res;
  if (arg1 <= arg2) {
    res = arg1;
  } else {
    res = arg2;
  }
  return res;
}


x86 assembly (clang, -O0):
<min1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <min1+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min1+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min1>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min1(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 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @min1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int __byte_encoded_array_size(const uint8_t *p, int elements) {
  (void)p;
  return sizeof(uint8_t) * elements;
}


x86 assembly (clang, -O0):
<__byte_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__byte_encoded_array_size(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__byte_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
void CFilterFactoryDestroy(void *arg) { (void)arg; }


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

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

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

LLVM IR (-O2):
define void @CFilterFactoryDestroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int syscall(int, long, long, long, long, long, long);
int munmap(void *addr, long length) {
  return syscall(0x0b, (long)(addr), (long)(length), (long)(0), (long)(0),
                 (long)(0), (long)(0));
}


x86 assembly (clang, -O0):
<munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xb,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
movq   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    $0xb,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = call i32 @syscall(i32 11, i64 %6, i64 %7, i64 0, i64 0, i64 0, i64 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @munmap(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @syscall(i32 11, i64 %3, i64 %1, i64 0, i64 0, i64 0, i64 0)
ret i32 %4
}
int get_number_of_cores() { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_number_of_cores() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_number_of_cores() {
ret i32 1
}
/* Variables and functions */
int add_el_full(char *, int, int, int);
int add_node(char *id, int type) {
  type = (type & ((0x80 | 0x40 | 0x100) | (0x20 | 0x10 | 0x08))) | 0x04;
  return add_el_full(id, type, -1, -1);
}


x86 assembly (clang, -O0):
<add_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f8,%eax
or     $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1030 <add_el_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_node>:
and    $0x1f8,%esi
or     $0x4,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
jmp    1030 <add_el_full@plt>

LLVM IR (-O0):
define i32 @add_node(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 504
%7 = or i32 %6, 4
store i32 %7, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @add_el_full(i8* %8, i32 %9, i32 -1, i32 -1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @add_node(i8* %0, i32 %1) {
%3 = and i32 %1, 504
%4 = or i32 %3, 4
%5 = tail call i32 @add_el_full(i8* %0, i32 %4, i32 -1, i32 -1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glColor3f(1.0, 1.0, 1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
movsd  0xe9b(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
movsd  0xe6b(%rip),%xmm4
movsd  0xe6b(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
movsd  0xe96(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe76(%rip),%xmm0
movsd  0xe66(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
movaps %xmm0,%xmm4
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%3 = load i32, i32* @GL_PROJECTION
%4 = call i32 @glMatrixMode(i32 %3)
%5 = call i32 (...) @glLoadIdentity()
%6 = call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
double __ddiv_rn(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<__ddiv_rn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ddiv_rn>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__ddiv_rn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @__ddiv_rn(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
void ff_hevc_put_hevc_uni_qpel_v64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v64_12_sse4() {
ret void
}
void _M2_MathLib0_finish(__attribute__((unused)) int argc,
                         __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_MathLib0_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_MathLib0_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t __htons(uint16_t v) { return ((v) << 8) | ((v) >> 8); }


x86 assembly (clang, -O0):
<__htons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__htons>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__htons(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__htons(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ze_summary() { printf("\nTODO: print 'Failures:' summary\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0ATODO: print 'Failures:' summary\0A\00"
define void @ze_summary() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"\0ATODO: print 'Failures:' summary\00"
define void @ze_summary() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawpolygon(int, int, int *, int *);
void j_drawpolygon(int arg0, int arg1, int *arg2, int *arg3) {
  japi_drawpolygon(arg0, arg1, arg2, arg3);
}


x86 assembly (clang, -O0):
<j_drawpolygon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <japi_drawpolygon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_drawpolygon>:
jmp    1030 <japi_drawpolygon@plt>

LLVM IR (-O0):
define void @j_drawpolygon(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 @japi_drawpolygon(i32 %9, i32 %10, i32* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @j_drawpolygon(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @japi_drawpolygon(i32 %0, i32 %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, scalar_t__, int /*<<< orphan*/);
scalar_t__ strlen(char *);
void sendToClient(int fd, char *message) {
  send(fd, message, strlen(message) + 1, 0);
}


x86 assembly (clang, -O0):
<sendToClient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendToClient>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
define void @sendToClient(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @send(i32 %5, i8* %6, i64 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @sendToClient(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void logicsfree(void *ptr) { free((char *)ptr); }


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

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

LLVM IR (-O2):
define void @logicsfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float lerp(float, float, float);
float smootherstep(float p1, float p2, float amount) {
  float scaled_amount =
      amount * amount * amount * (amount * (amount * 6 - 15) + 10);
  return lerp(p1, p2, scaled_amount);
}


x86 assembly (clang, -O0):
<smootherstep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  0xebc(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xeb4(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe9c(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <lerp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smootherstep>:
movaps %xmm2,%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm2,%xmm3
movss  0xedd(%rip),%xmm4
mulss  %xmm2,%xmm4
addss  0xed5(%rip),%xmm4
mulss  %xmm4,%xmm2
addss  0xecd(%rip),%xmm2
mulss  %xmm3,%xmm2
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @smootherstep(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %6
%10 = fmul float %8, %9
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %14, float 6.000000e+00, float -1.500000e+01)
%16 = call float @llvm.fmuladd.f32(float %13, float %15, float 1.000000e+01)
%17 = fmul float %12, %16
store float %17, float* %7
%18 = load float, float* %4
%19 = load float, float* %5
%20 = load float, float* %7
%21 = call float @lerp(float %18, float %19, float %20)
ret float %21
}

LLVM IR (-O2):
define float @smootherstep(float %0, float %1, float %2) {
%4 = fmul float %2, %2
%5 = fmul float %4, %2
%6 = tail call float @llvm.fmuladd.f32(float %2, float 6.000000e+00, float -1.500000e+01)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %6, float 1.000000e+01)
%8 = fmul float %5, %7
%9 = tail call float @lerp(float %0, float %1, float %8)
ret float %9
}
char *strcpy(char *dest, const char *src) {
  char *dest_save = dest;
  while ((*dest++ = *src++)) {
  }
  return dest_save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
double floor(double);
double fmod(double x, double y) { return (x - y * floor(x / y)); }


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %6
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %5)
ret double %12
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fneg double %1
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %0)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_anl_atRi(char *str, unsigned char i) {
  sprintf(str, "ANL   A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<sprint_anl_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_anl_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"ANL A, @R%X \00"
define void @sprint_anl_atRi(i8* %0, i8 zeroext %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 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"ANL A, @R%X \00"
define void @sprint_anl_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
double pow(int /*<<< orphan*/, double);
int /*<<< orphan*/ sin(float);
float f(float x) { return pow(sin(x), 2.0) * 0.5; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%edi
movsd  0xec7(%rip),%xmm0
call   1040 <pow@plt>
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <sin@plt>
movsd  0xed2(%rip),%xmm0
mov    %eax,%edi
call   1040 <pow@plt>
mulsd  0xecb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sin(float %3)
%5 = call double @pow(i32 %4, double 2.000000e+00)
%6 = fmul double %5, 5.000000e-01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call i32 @sin(float %0)
%3 = tail call double @pow(i32 %2, double 2.000000e+00)
%4 = fmul double %3, 5.000000e-01
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int check_for_known_file_in_dir(char const *, char const *);
int check_for_known_file_in_bin_dir(const char *dir) {
  const char *known_file = "asf_import";
  return check_for_known_file_in_dir(dir, known_file);
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"asf_import\00"
define i32 @check_for_known_file_in_bin_dir(i8* %0) {
%2 = tail call i32 @check_for_known_file_in_dir(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void empty() {}


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

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

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

LLVM IR (-O2):
define void @empty() {
ret void
}
int getpagesize() { return 0x1000; }


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

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

LLVM IR (-O0):
define i32 @getpagesize() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @getpagesize() {
ret i32 4096
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_Lex_wstrng_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_wstrng(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_Lex_wstrng_rec(lexbuf, 5);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Lex_wstrng>:
mov    $0x5,%esi
jmp    1030 <Cyc_Lex_wstrng_rec@plt>

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

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_wstrng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_wstrng_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 5)
ret i32 %2
}
/* Type definitions */
struct netasync_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netasync_socks_handler(struct netasync_socket *);
void netasync_sock_recv_cb(struct netasync_socket *sock, void *recvBuf,
                           size_t len, void *clientdata) {
  netasync_socks_handler(sock);
}


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

x86 assembly (clang, -O2):
<netasync_sock_recv_cb>:
jmp    1030 <netasync_socks_handler@plt>

LLVM IR (-O0):
%struct.netasync_socket = type { i32 }
define void @netasync_sock_recv_cb(%struct.netasync_socket* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca %struct.netasync_socket*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store %struct.netasync_socket* %0, %struct.netasync_socket** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load %struct.netasync_socket*, %struct.netasync_socket** %5
%10 = call i32 @netasync_socks_handler(%struct.netasync_socket* %9)
ret void
}

LLVM IR (-O2):
%struct.netasync_socket = type { i32 }
define void @netasync_sock_recv_cb(%struct.netasync_socket* %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @netasync_socks_handler(%struct.netasync_socket* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_LSB_FIRST;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int spi_get_lsb_first(int fd, __u8 *plsb) {
  return ioctl(fd, SPI_IOC_RD_LSB_FIRST, plsb);
}


x86 assembly (clang, -O0):
<spi_get_lsb_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_get_lsb_first>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@SPI_IOC_RD_LSB_FIRST = global i32 0
define i32 @spi_get_lsb_first(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* @SPI_IOC_RD_LSB_FIRST
%7 = load i32*, i32** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@SPI_IOC_RD_LSB_FIRST = global i32 0
define i32 @spi_get_lsb_first(i32 %0, i32* %1) {
%3 = load i32, i32* @SPI_IOC_RD_LSB_FIRST
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ read_uint32(void const *);
int32_t bson_value_to_int32(const void *valuePtr) {
  return read_uint32(valuePtr);
}


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

x86 assembly (clang, -O2):
<bson_value_to_int32>:
jmp    1030 <read_uint32@plt>

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

LLVM IR (-O2):
define i32 @bson_value_to_int32(i8* %0) {
%2 = tail call i32 @read_uint32(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, unsigned int *, int);
unsigned int utils_get_random_int(unsigned int min, unsigned int max) {
  int randomData = open("/dev/urandom", O_RDONLY);
  unsigned int rInt;
  read(randomData, &rInt, sizeof rInt);
  rInt = rInt % (max - min) + min;
  close(randomData);
  return rInt;
}


x86 assembly (clang, -O0):
<utils_get_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_get_random_int>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%r14d
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0xc(%rsp),%eax
sub    %ebx,%ebp
xor    %edx,%edx
div    %ebp
add    %edx,%ebx
mov    %r14d,%edi
call   1030 <close@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @utils_get_random_int(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
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @read(i32 %9, i32* %6, i32 4)
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub i32 %12, %13
%15 = urem i32 %11, %14
%16 = load i32, i32* %3
%17 = add i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = call i32 @close(i32 %18)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @utils_get_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = bitcast i32* %3 to i8*
%7 = call i32 @read(i32 %5, i32* %3, i32 4)
%8 = load i32, i32* %3
%9 = sub i32 %1, %0
%10 = urem i32 %8, %9
%11 = add i32 %10, %0
%12 = tail call i32 @close(i32 %5)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ADS1015_open(int, float);
int open_lux() { ADS1015_open(3, 1.0f); }


x86 assembly (clang, -O0):
<open_lux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
movss  0xedb(%rip),%xmm0
call   1030 <ADS1015_open@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_lux>:
movss  0xee8(%rip),%xmm0
mov    $0x3,%edi
jmp    1030 <ADS1015_open@plt>

LLVM IR (-O0):
define i32 @open_lux() {
%1 = alloca i32
%2 = call i32 @ADS1015_open(i32 3, float 1.000000e+00)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @open_lux() {
%1 = tail call i32 @ADS1015_open(i32 3, float 1.000000e+00)
ret i32 undef
}
/* Variables and functions */
char *base_name(char *);
char *dir_name(char const *);
int /*<<< orphan*/ free(char *);
char *parent_base_name(const char *path) {
  char *dir;
  char *parent_base;
  dir = dir_name(path);
  if (!dir)
    return NULL;
  parent_base = base_name(dir);
  free(dir);
  return parent_base;
}


x86 assembly (clang, -O0):
<parent_base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dir_name@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <parent_base_name+0x31>
movq   $0x0,-0x8(%rbp)
jmp    117f <parent_base_name+0x4f>
mov    -0x18(%rbp),%rdi
call   1050 <base_name@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_base_name>:
push   %r14
push   %rbx
push   %rax
call   1040 <dir_name@plt>
test   %rax,%rax
je     1159 <parent_base_name+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <base_name@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    115b <parent_base_name+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @parent_base_name(i8* %0) {
%2 = tail call i8* @dir_name(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @base_name(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigalrm_handler(int sig) {
  fprintf(stderr, "Program timed out after %d seconds\n", 0);
  sig = sig;
  exit(1);
}


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
xor    %edx,%edx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Program timed out after %d seconds\0A\00"
define void @sigalrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = load i32, i32* %2
store i32 %5, i32* %2
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Program timed out after %d seconds\0A\00"
define void @sigalrm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_36_4(int *mem) { return __atomic_add_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_36_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,(%rdx)
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_36_4>:
mov    $0x1,%eax
lock xadd %eax,(%rdi)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_36_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw add i32* %6, i32 %7 acq_rel
%9 = add i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_36_4(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 acq_rel
%3 = add i32 %2, 1
ret i32 %3
}