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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char const *);
FILE *x_fopen(const char *pathname, const char *mode) {
  FILE *fp = fopen(pathname, mode);
  if (fp == NULL) {
    perror(pathname);
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<x_fopen>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <x_fopen+0x43>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_fopen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1140 <x_fopen+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32* @x_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i32* @x_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
long add2(int, int);
long add1(int n) { return add2(n + 1, n - 1); }


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

x86 assembly (clang, -O2):
<add1>:
lea    0x1(%rdi),%eax
lea    -0x1(%rdi),%esi
mov    %eax,%edi
jmp    1030 <add2@plt>

LLVM IR (-O0):
define i64 @add1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = call i64 @add2(i32 %4, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @add1(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = add nsw i32 %0, -1
%4 = tail call i64 @add2(i32 %2, i32 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2() { printf("Hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void delete_pool(void) {}


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

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

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

LLVM IR (-O2):
define void @delete_pool() {
ret void
}
void r200InitSSECodegen(struct dfn_generators *gen) { (void)gen; }


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.dfn_generators = type opaque
define void @r200InitSSECodegen(%struct.dfn_generators* %0) {
%2 = alloca %struct.dfn_generators*
store %struct.dfn_generators* %0, %struct.dfn_generators** %2
%3 = load %struct.dfn_generators*, %struct.dfn_generators** %2
ret void
}

LLVM IR (-O2):
%struct.dfn_generators = type opaque
define void @r200InitSSECodegen(%struct.dfn_generators* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ft_islower(int);
int ft_toupper(int c) {
  if (ft_islower(c))
    return (c - 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
je     113b <ft_toupper+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <ft_toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ft_islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i64 @ft_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
char *alloc_mem(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *copy_cstring(const char *str) {
  char *new_string;
  size_t length;
  length = strlen(str);
  new_string = alloc_mem(length + 1);
  if (!new_string) {
    return NULL;
  }
  memcpy(new_string, str, length);
  new_string[length] = '\0';
  return new_string;
}


x86 assembly (clang, -O0):
<copy_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1030 <alloc_mem@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <copy_cstring+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1197 <copy_cstring+0x67>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_cstring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1030 <alloc_mem@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <copy_cstring+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @copy_cstring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @alloc_mem(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%8 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %8
br label %9
9: ; preds = %1, %6
ret i8* %4
}
char letterGrade() {}


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

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

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

LLVM IR (-O2):
define signext i8 @letterGrade() {
ret i8 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wcsftime(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ *,
                            struct tm *);
void nullPointer_wcsftime(size_t maxsize) {
  wchar_t *ptr = 0;
  wchar_t *format = 0;
  struct tm *timeptr = 0;
  (void)wcsftime(ptr, maxsize, format, timeptr);
  (void)wcsftime(0, maxsize, 0, 0);
}


x86 assembly (clang, -O0):
<nullPointer_wcsftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <wcsftime@plt>
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdi
mov    %rcx,%rdx
call   1030 <wcsftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_wcsftime>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <wcsftime@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <wcsftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @nullPointer_wcsftime(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.tm*
store i64 %0, i64* %2
store i32* null, i32** %3
store i32* null, i32** %4
store %struct.tm* null, %struct.tm** %5
%6 = load i32*, i32** %3
%7 = load i64, i64* %2
%8 = load i32*, i32** %4
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @wcsftime(i32* %6, i64 %7, i32* %8, %struct.tm* %9)
%11 = load i64, i64* %2
%12 = call i32 @wcsftime(i32* null, i64 %11, i32* null, %struct.tm* null)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @nullPointer_wcsftime(i64 %0) {
%2 = tail call i32 @wcsftime(i32* null, i64 %0, i32* null, %struct.tm* null)
%3 = tail call i32 @wcsftime(i32* null, i64 %0, i32* null, %struct.tm* null)
ret void
}
void free_dmatrix(double **m, int minx, int maxx, int miny, int maxy) {
  int i;
  double *p;
  m += minx;
  p = m[0] + miny;
  free(p);
  free(m);
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %rbx
movslq %esi,%rdx
lea    (%rdi,%rdx,8),%rbx
movslq %ecx,%rax
shl    $0x3,%rax
add    (%rdi,%rdx,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dmatrix(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %7
%14 = load double**, double*** %6
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds double*, double** %14, i64 %15
store double** %16, double*** %6
%17 = load double**, double*** %6
%18 = getelementptr inbounds double*, double** %17, i64 0
%19 = load double*, double** %18
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
store double* %22, double** %12
%23 = load double*, double** %12
%24 = bitcast double* %23 to i8*
%25 = load double**, double*** %6
%26 = bitcast double** %25 to i8*
ret void
}

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = load double*, double** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds double, double* %8, i64 %9
%11 = bitcast double* %10 to i8*
tail call void @free(i8* %11)
%12 = bitcast double** %7 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void test_oom_handler(size_t size) {
  fprintf(stderr, "out of memory: %lu\n", size);
  perror("test_oom_handler()");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<test_oom_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<test_oom_handler>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"out of memory: %lu\0A\00"
@.str.1 = [19 x i8] c"test_oom_handler()\00"
@EXIT_FAILURE = global i32 0
define void @test_oom_handler(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stderr
%4 = load i64, i64* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"out of memory: %lu\0A\00"
@.str.1 = [19 x i8] c"test_oom_handler()\00"
@EXIT_FAILURE = global i32 0
define void @test_oom_handler(i64 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void print_constant_ptr(char *name, int value) {
  printf("#define %s(task) ((unsigned long *) "
         "&(((char *) (task))[%d]))\n",
         name, value);
}


x86 assembly (clang, -O0):
<print_constant_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_constant_ptr>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"#define %s(task) ((unsigned long *) &(((char *) (task))[%d]))\0A\00"
define void @print_constant_ptr(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 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"#define %s(task) ((unsigned long *) &(((char *) (task))[%d]))\0A\00"
define void @print_constant_ptr(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void set_dr0(void *value) { asm volatile("mov %0,%%dr0" : : "r"(value)); }


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

x86 assembly (clang, -O2):
<set_dr0>:
mov    %rdi,%db0
ret

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

LLVM IR (-O2):
define void @set_dr0(i8* %0) {
tail call void asm sideeffect "mov $0,%dr0", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long owner;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
void set_XSelectionRequestEvent_owner(void *_p, unsigned long _v) {
  ((XSelectionRequestEvent *)_p)->owner = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XSelectionRequestEvent_owner(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void eeprom_put_char(unsigned int addr, unsigned char new_value) {}


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

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

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

LLVM IR (-O2):
define void @eeprom_put_char(i32 %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int cos(double);
double CosineInterpolate(double y1, double y2, double mu) {
  double mu2;
  mu2 = (1 - cos(mu * 3.141592653589793238462643)) / 2;
  return (y1 * (1 - mu2) + y2 * mu2);
}


x86 assembly (clang, -O0):
<CosineInterpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CosineInterpolate>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  0xed8(%rip),%xmm2
movapd %xmm2,%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x10(%rsp),%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @CosineInterpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = fmul double %8, 0x400921FB54442D18
%10 = call i32 @cos(double %9)
%11 = sub nsw i32 1, %10
%12 = sdiv i32 %11, 2
%13 = sitofp i32 %12 to double
store double %13, double* %7
%14 = load double, double* %4
%15 = load double, double* %7
%16 = fsub double 1.000000e+00, %15
%17 = load double, double* %5
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %14, double %16, double %19)
ret double %20
}

LLVM IR (-O2):
define double @CosineInterpolate(double %0, double %1, double %2) {
%4 = fmul double %2, 0x400921FB54442D18
%5 = tail call i32 @cos(double %4)
%6 = sub nsw i32 1, %5
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = fmul double %8, %1
%11 = tail call double @llvm.fmuladd.f64(double %0, double %9, double %10)
ret double %11
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, struct iovec const *,
                           unsigned long, struct iovec const *, unsigned long,
                           unsigned long);
ssize_t process_vm_readv(pid_t pid, const struct iovec *lvec,
                         unsigned long liovcnt, const struct iovec *rvec,
                         unsigned long riovcnt, unsigned long flags) {
  return syscall(376, pid, lvec, liovcnt, rvec, riovcnt, flags);
}


x86 assembly (clang, -O0):
<process_vm_readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x178,%edi
mov    %rax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_vm_readv>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9,(%rsp)
mov    $0x178,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @process_vm_readv(i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5) {
%7 = alloca i32
%8 = alloca %struct.iovec*
%9 = alloca i64
%10 = alloca %struct.iovec*
%11 = alloca i64
%12 = alloca i64
store i32 %0, i32* %7
store %struct.iovec* %1, %struct.iovec** %8
store i64 %2, i64* %9
store %struct.iovec* %3, %struct.iovec** %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i32, i32* %7
%14 = load %struct.iovec*, %struct.iovec** %8
%15 = load i64, i64* %9
%16 = load %struct.iovec*, %struct.iovec** %10
%17 = load i64, i64* %11
%18 = load i64, i64* %12
%19 = call i32 @syscall(i32 376, i32 %13, %struct.iovec* %14, i64 %15, %struct.iovec* %16, i64 %17, i64 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @process_vm_readv(i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5) {
%7 = tail call i32 @syscall(i32 376, i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5)
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint64_t pack_rgba16(uint16_t r16, uint16_t g16, uint16_t b16, uint16_t a16) {
  return (uint64_t)r16 | ((uint64_t)g16 << 16) | ((uint64_t)b16 << 32) |
         ((uint64_t)a16 << 48);
}


x86 assembly (clang, -O0):
<pack_rgba16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pack_rgba16(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = load i64, i64* %7
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 32
%18 = or i32 %14, %17
%19 = load i64, i64* %8
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 48
%22 = or i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @pack_rgba16(i64 %0, i64 %1, i64 %2, i64 %3) {
ret i32 poison
}
void SplitRGBRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SplitRGBRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SzFree(void *p, void *address) {
  p = p;
  free(address);
}


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

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

LLVM IR (-O0):
define void @SzFree(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
store i8* %5, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @SzFree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void cmp_shape_circle_deinit(struct CmpShape *circle) { (void)circle; }


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

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

LLVM IR (-O0):
%struct.CmpShape = type opaque
define void @cmp_shape_circle_deinit(%struct.CmpShape* %0) {
%2 = alloca %struct.CmpShape*
store %struct.CmpShape* %0, %struct.CmpShape** %2
%3 = load %struct.CmpShape*, %struct.CmpShape** %2
ret void
}

LLVM IR (-O2):
%struct.CmpShape = type opaque
define void @cmp_shape_circle_deinit(%struct.CmpShape* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __lgamma_r(double, int *);
double exp(int /*<<< orphan*/);
double tgamma(double x) {
  int sign;
  double y;
  y = exp(__lgamma_r(x, &sign));
  if (sign < 0)
    y = -y;
  return y;
}


x86 assembly (clang, -O0):
<tgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <__lgamma_r@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1172 <tgamma+0x52>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgamma>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <__lgamma_r@plt>
mov    %eax,%edi
call   1040 <exp@plt>
cmpl   $0x0,0x4(%rsp)
jns    1140 <tgamma+0x20>
xorps  0xec0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tgamma(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @__lgamma_r(double %5, i32* %3)
%7 = call double @exp(i32 %6)
store double %7, double* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = fneg double %11
store double %12, double* %4
br label %13
13: ; preds = %10, %1
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
define double @tgamma(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @__lgamma_r(double %0, i32* %2)
%5 = call double @exp(i32 %4)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = fneg double %5
%9 = select i1 %7, double %8, double %5
ret double %9
}
void arch_ftrace_nmi_enter(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTPipeRead() {
ret void
}
/* Variables and functions */
bool pathIsAbs(const char *path) {
  bool status = false;
  if ((path != NULL) && (*path == '/'))
    status = true;
  return status;
}


x86 assembly (clang, -O0):
<pathIsAbs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <pathIsAbs+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1131 <pathIsAbs+0x31>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathIsAbs>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <pathIsAbs+0xd>
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pathIsAbs(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int _write(int file, char *ptr, int len) { return 0; }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void copyString(char *dest, char *source) {
  char *origin = dest;
  while (*source) {
    *dest++ = *source++;
  }
  *dest = *source;
  dest = origin;
}


x86 assembly (clang, -O0):
<copyString>:
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
cmpb   $0x0,(%rax)
je     1148 <copyString+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <copyString+0x14>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rsi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @copyString(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 = %11, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
br label %7
17: ; preds = %7
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
store i8 %19, i8* %20
%21 = load i8*, i8** %5
store i8* %21, i8** %3
ret void
}

LLVM IR (-O2):
define void @copyString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
sumSquaresFrom1ToX(int x) {
  int s = 0;
  while (x > 0)
    s += x * x;
  x--;
}


x86 assembly (clang, -O0):
<sumSquaresFrom1ToX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112a <sumSquaresFrom1ToX+0x2a>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110e <sumSquaresFrom1ToX+0xe>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumSquaresFrom1ToX>:
test   %edi,%edi
jle    1112 <sumSquaresFrom1ToX+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <sumSquaresFrom1ToX+0x10>
ret

LLVM IR (-O0):
define i32 @sumSquaresFrom1ToX(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, %11
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @sumSquaresFrom1ToX(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ __copysign(double, double);
long double __copysignl(long double x, long double y) {
  return ((long double)__copysign((double)x, (double)y));
}


x86 assembly (clang, -O0):
<__copysignl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <__copysign@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__copysignl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <__copysign@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @__copysign(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @__copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @__copysign(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ read_char_range(int /*<<< orphan*/, char);
void read_single_digit() { read_char_range('0', '9'); }


x86 assembly (clang, -O0):
<read_single_digit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
mov    $0x39,%esi
call   1030 <read_char_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_single_digit>:
mov    $0x30,%edi
mov    $0x39,%esi
jmp    1030 <read_char_range@plt>

LLVM IR (-O0):
define void @read_single_digit() {
%1 = call i32 @read_char_range(i32 48, i8 signext 57)
ret void
}

LLVM IR (-O2):
define void @read_single_digit() {
%1 = tail call i32 @read_char_range(i32 48, i8 signext 57)
ret void
}
int is_vin_pin(int pin) {
  return (pin == 15 || pin == 14 || pin == 13 || pin == 4);
}


x86 assembly (clang, -O0):
<is_vin_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xf,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_vin_pin+0x3e>
mov    $0x1,%al
cmpl   $0xe,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_vin_pin+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_vin_pin+0x3e>
cmpl   $0x4,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vin_pin>:
lea    -0xd(%rdi),%eax
cmp    $0x3,%eax
setb   %al
cmp    $0x4,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_vin_pin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 15
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 14
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 4
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_vin_pin(i32 %0) {
%2 = add i32 %0, -13
%3 = icmp ult i32 %2, 3
%4 = icmp eq i32 %0, 4
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dbgmem_dump_blocks();
int logger_write(int, char *);
int main(int argc, char *argv[]) {
  int res = 0;
  if (logger_write(1, ("test\n")) != 5) {
    res = 1;
  }
  dbgmem_dump_blocks();
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%edi
lea    0xeb7(%rip),%rsi
call   1030 <logger_write@plt>
cmp    $0x5,%eax
je     115e <main+0x3e>
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1040 <dbgmem_dump_blocks@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <logger_write@plt>
xor    %ebx,%ebx
cmp    $0x5,%eax
setne  %bl
xor    %eax,%eax
call   1040 <dbgmem_dump_blocks@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"test\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @logger_write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 5
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %6
br label %10
10: ; preds = %9, %2
%11 = call i32 (...) @dbgmem_dump_blocks()
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"test\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @logger_write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 5
%5 = zext i1 %4 to i32
%6 = tail call i32 (...) @dbgmem_dump_blocks()
ret i32 %5
}
void atomic_dec_int(volatile int *var) {
  asm volatile("lock ;"
               " "
               "decl %0"
               " \n\t"
               : "=m"(*var)
               : "m"(*var)
               : "cc", "memory");
}


x86 assembly (clang, -O0):
<atomic_dec_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock decl (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_dec_int>:
lock decl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_dec_int(i32* %0) {
tail call void asm sideeffect "lock ; decl $0 \0A\09", "=*m,*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
void aeron_log_func_none(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @aeron_log_func_none(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double rating_change_loss(int, int);
double rating_change_win(int, int);
int rating_change_draw(int engine_rating, int opponent_rating) {
  double r;
  r = rating_change_win(engine_rating, opponent_rating) / 2.0;
  r += rating_change_loss(engine_rating, opponent_rating) / 2.0;
  return r;
}


x86 assembly (clang, -O0):
<rating_change_draw>:
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 <rating_change_win@plt>
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <rating_change_loss@plt>
movsd  0xea3(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rating_change_draw>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <rating_change_win@plt>
mulsd  0xecc(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <rating_change_loss@plt>
mulsd  0xeb6(%rip),%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rating_change_draw(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call double @rating_change_win(i32 %6, i32 %7)
%9 = fdiv double %8, 2.000000e+00
store double %9, double* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call double @rating_change_loss(i32 %10, i32 %11)
%13 = fdiv double %12, 2.000000e+00
%14 = load double, double* %5
%15 = fadd double %14, %13
store double %15, double* %5
%16 = load double, double* %5
%17 = fptosi double %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @rating_change_draw(i32 %0, i32 %1) {
%3 = tail call double @rating_change_win(i32 %0, i32 %1)
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @rating_change_loss(i32 %0, i32 %1)
%6 = fmul double %5, 5.000000e-01
%7 = fadd double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int strcmp(char *, char *);
int name_compare(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<name_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @name_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void assertorder(int a[], int n) {
  for (int i = 0; i < n - 1; i++) {
    assert(a[i] <= a[i + 1]);
  }
}


x86 assembly (clang, -O0):
<assertorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116d <assertorder+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <assertorder+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertorder>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1150 <assertorder+0x40>
mov    %esi,%r14d
mov    %rdi,%r15
add    $0xffffffff,%r14d
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rax,4),%ecx
lea    0x1(%rax),%rbx
xor    %edi,%edi
cmp    0x4(%r15,%rax,4),%ecx
setle  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
cmp    %rbx,%r14
jne    1130 <assertorder+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @assertorder(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %29
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = icmp sle i32 %16, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
br label %26
26: ; preds = %11
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @assertorder(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %9, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sle i32 %11, %14
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = icmp eq i64 %12, %6
br i1 %18, label %7, label %8
}
/* Variables and functions */
int read_token();
void flush_to_newline() {
  while (read_token() != 259)
    ;
}


x86 assembly (clang, -O0):
<flush_to_newline>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush_to_newline+0x9>
mov    $0x0,%al
call   1030 <read_token@plt>
cmp    $0x103,%eax
je     1130 <flush_to_newline+0x20>
jmp    1119 <flush_to_newline+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_to_newline>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_token@plt>
cmp    $0x103,%eax
jne    1120 <flush_to_newline+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush_to_newline() {
br label %1
1: ; preds = %4, %0
%2 = call i32 (...) @read_token()
%3 = icmp ne i32 %2, 259
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush_to_newline() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @read_token()
%3 = icmp eq i32 %2, 259
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}