xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_print(char *arr) {
  fprintf(stderr, "\n%s unfolds the phase saved in a Gnuplot format\n", arr);
  fprintf(stderr,
          "\nUSAGE: %s  K < phase_in > phase_out \nwhere K is coefficient to "
          "multiply the phase, may be\nnecessary to translate the phase into "
          "dimensional units.\n\n",
          arr);
}


x86 assembly (clang, -O0):
<error_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef7(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"\0A%s unfolds the phase saved in a Gnuplot format\0A\00"
@.str.1 = [150 x i8] c"\0AUSAGE: %s K < phase_in > phase_out \0Awhere K is coefficient to multiply the phase, may be\0Anecessary to translate the phase into dimensional units.\0A\0A\00"
define void @error_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"\0A%s unfolds the phase saved in a Gnuplot format\0A\00"
@.str.1 = [150 x i8] c"\0AUSAGE: %s K < phase_in > phase_out \0Awhere K is coefficient to multiply the phase, may be\0Anecessary to translate the phase into dimensional units.\0A\0A\00"
define void @error_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10;
  int b = 20;
  int c = 30;
  int max;
  max = (c > b) ? c : ((b > a) ? b : a);
  printf("%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x1e,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114b <main+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    116e <main+0x5e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1162 <main+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1168 <main+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
void XtGetSelectionValueIncremental() {}


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

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

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

LLVM IR (-O2):
define void @XtGetSelectionValueIncremental() {
ret void
}
void main() { int *new; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
ret void
}

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

/* Variables and functions */
size_t print_hexbin(int /*<<< orphan*/ *, float *, int);
size_t print_hexbin_float(FILE *fp, float value) {
  return print_hexbin(fp, &value, 4);
}


x86 assembly (clang, -O0):
<print_hexbin_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <print_hexbin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hexbin_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <print_hexbin@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @print_hexbin_float(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
store i32* %0, i32** %3
store float %1, float* %4
%5 = load i32*, i32** %3
%6 = call i64 @print_hexbin(i32* %5, float* %4, i32 4)
ret i64 %6
}

LLVM IR (-O2):
define i64 @print_hexbin_float(i32* %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i64 @print_hexbin(i32* %0, float* %3, i32 4)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ getprid();
int /*<<< orphan*/ printf(char *);
int main(void) {
  (void)getprid();
  printf("#define HAVE_GETPRID /* yes */\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"#define HAVE_GETPRID /* yes */\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getprid()
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"#define HAVE_GETPRID /* yes */\00"
define i32 @main() {
%1 = tail call i32 (...) @getprid()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long __fib(long, long);
long __fibOfDepth(long lastButOne, long last, int depth) {
  long currFib = __fib(lastButOne, last);
  return depth == 0 ? currFib : __fibOfDepth(last, currFib, depth - 1);
}


x86 assembly (clang, -O0):
<__fibOfDepth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__fib@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115b <__fibOfDepth+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1172 <__fibOfDepth+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <__fibOfDepth@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fibOfDepth>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%rax
add    $0x1,%ebx
nopl   0x0(%rax)
mov    %rax,%r14
mov    %rax,%rsi
call   1030 <__fib@plt>
mov    %r14,%rdi
add    $0xffffffff,%ebx
jne    1120 <__fibOfDepth+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @__fibOfDepth(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i64 @__fib(i64 %8, i64 %9)
store i64 %10, i64* %7
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i64, i64* %7
br label %21
15: ; preds = %3
%16 = load i64, i64* %5
%17 = load i64, i64* %7
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
%20 = call i64 @__fibOfDepth(i64 %16, i64 %17, i32 %19)
br label %21
21: ; preds = %15, %13
%22 = phi i64 [ %14, %13 ], [ %20, %15 ]
ret i64 %22
}

LLVM IR (-O2):
define i64 @__fibOfDepth(i64 %0, i64 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %0, %3 ], [ %6, %4 ]
%6 = phi i64 [ %1, %3 ], [ %8, %4 ]
%7 = phi i32 [ %2, %3 ], [ %10, %4 ]
%8 = tail call i64 @__fib(i64 %5, i64 %6)
%9 = icmp eq i32 %7, 0
%10 = add nsw i32 %7, -1
br i1 %9, label %11, label %4
11: ; preds = %4
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ test7_T_on__I();
void test7_T_pollen__run__E() { test7_T_on__I(); }


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

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

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

LLVM IR (-O2):
define void @test7_T_pollen__run__E() {
%1 = tail call i32 (...) @test7_T_on__I()
ret void
}
/* Variables and functions */
int changeChannelState(unsigned int, char);
int enableChannel(unsigned int channel) {
  return changeChannelState(channel, '1');
}


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

x86 assembly (clang, -O2):
<enableChannel>:
mov    $0x31,%esi
jmp    1030 <changeChannelState@plt>

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

LLVM IR (-O2):
define i32 @enableChannel(i32 %0) {
%2 = tail call i32 @changeChannelState(i32 %0, i8 signext 49)
ret i32 %2
}
int get_time() {
  static int now = 0;
  return now++;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@get_time.now = internal global i32 0
define i32 @get_time() {
%1 = load i32, i32* @get_time.now
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_time.now
ret i32 %1
}

LLVM IR (-O2):
@get_time.now = internal unnamed_addr global i32 0
define i32 @get_time() {
%1 = load i32, i32* @get_time.now
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_time.now
ret i32 %1
}
/* Variables and functions */
void ptr_glXWaitX();
extern void glXWaitX(void) { return ptr_glXWaitX(); }


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

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

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

LLVM IR (-O2):
define void @glXWaitX() {
tail call void (...) @ptr_glXWaitX()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shm_unlink(char *);
void safeExit() {
  if (shm_unlink("mShm") == -1) {
    perror("error unlinking shm");
    exit(-1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<safeExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <shm_unlink@plt>
cmp    $0xffffffff,%eax
jne    115f <safeExit+0x2f>
lea    0xeb5(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<safeExit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <shm_unlink@plt>
cmp    $0xffffffff,%eax
jne    1158 <safeExit+0x28>
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"mShm\00"
@.str.1 = [20 x i8] c"error unlinking shm\00"
define void @safeExit() {
%1 = call i32 @shm_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"mShm\00"
@.str.1 = [20 x i8] c"error unlinking shm\00"
define void @safeExit() {
%1 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *malloc(size_t);
void *nativeMalloc(size_t size, uint32_t id) {
  void *addr = malloc(size);
  return addr;
}


x86 assembly (clang, -O0):
<nativeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @nativeMalloc(i64 %0, i32 %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
char *calloc(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *my_strdup(const char *s) {
  char *d = calloc(strlen(s) + 1, sizeof(char));
  if (d != NULL)
    strcpy(d, s);
  return (d);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <my_strdup+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <my_strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ overflow(int *, int, int);
int main(int argc, char **argv) {
  int *p = (int *)malloc(sizeof(char));
  overflow(p, sizeof(char), 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <overflow@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <overflow@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 1)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i32 @overflow(i32* %9, i32 1, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @overflow(i32* %4, i32 1, i32 4)
ret i32 0
}
int main(void) { return 0x1983; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1983,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 6531
}
int ls_costN_nm5_n_in(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ls_costN_nm5_n_in() {
ret i32 1
}
double Double__DIV_(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<Double__DIV_>:
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):
<Double__DIV_>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Double__DIV_(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 @Double__DIV_(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
void crypto_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @crypto_cleanup() {
ret void
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
float log(double);
scalar_t__ rand();
float parcels_expovariate(float lamb) {
  float u;
  u = (float)rand() / ((float)(RAND_MAX) + 1.0);
  return (-log(1.0 - u) / lamb);
}


x86 assembly (clang, -O0):
<parcels_expovariate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parcels_expovariate>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <log@plt>
xorpd  0xebd(%rip),%xmm0
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @parcels_expovariate(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = fdiv float %5, 1.000000e+00
store float %6, float* %3
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = call float @log(double %9)
%11 = fneg float %10
%12 = load float, float* %2
%13 = fdiv float %11, %12
ret float %13
}

LLVM IR (-O2):
define float @parcels_expovariate(float %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = fpext float %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = tail call float @log(double %5)
%7 = fneg float %6
%8 = fdiv float %7, %0
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void f25519_copy(uint8_t *x, const uint8_t *a) { memcpy(x, a, 32); }


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

x86 assembly (clang, -O2):
<f25519_copy>:
mov    $0x20,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @f25519_copy(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 i32 @memcpy(i32* %5, i32* %6, i32 32)
ret void
}

LLVM IR (-O2):
define void @f25519_copy(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arg();
int /*<<< orphan*/ movi();
int /*<<< orphan*/ opi();
int /*<<< orphan*/ ret();
int /*<<< orphan*/ stdarg();
void pcs(void) {
  arg();
  ret();
  stdarg();
  movi();
  opi();
}


x86 assembly (clang, -O0):
<pcs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arg@plt>
mov    $0x0,%al
call   1030 <ret@plt>
mov    $0x0,%al
call   1060 <stdarg@plt>
mov    $0x0,%al
call   1070 <movi@plt>
mov    $0x0,%al
call   1050 <opi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcs>:
push   %rax
xor    %eax,%eax
call   1040 <arg@plt>
xor    %eax,%eax
call   1030 <ret@plt>
xor    %eax,%eax
call   1060 <stdarg@plt>
xor    %eax,%eax
call   1070 <movi@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <opi@plt>

LLVM IR (-O0):
define void @pcs() {
%1 = call i32 (...) @arg()
%2 = call i32 (...) @ret()
%3 = call i32 (...) @stdarg()
%4 = call i32 (...) @movi()
%5 = call i32 (...) @opi()
ret void
}

LLVM IR (-O2):
define void @pcs() {
%1 = tail call i32 (...) @arg()
%2 = tail call i32 (...) @ret()
%3 = tail call i32 (...) @stdarg()
%4 = tail call i32 (...) @movi()
%5 = tail call i32 (...) @opi()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printnewline_html(void *udata) {
  printf("  </td>\n");
  printf(" </tr>\n");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c" </td>\0A\00"
@.str.1 = [8 x i8] c" </tr>\0A\00"
define void @printnewline_html(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c" </td>\00"
@str.2 = [7 x i8] c" </tr>\00"
define void @printnewline_html(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smin(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smin(N, x, stride);
  printf("min: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smin@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smin@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"min: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smin(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"min: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smin(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int repSum(int begin, int end, int function) {
  int ret = 0;
  for (begin; begin < end; begin++) {
    ret = (ret + function);
  }
  return ret;
}


x86 assembly (clang, -O0):
<repSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1137 <repSum+0x37>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <repSum+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<repSum>:
mov    %esi,%ecx
sub    %edi,%ecx
imul   %edx,%ecx
xor    %eax,%eax
cmp    %edi,%esi
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @repSum(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = sub i32 %1, %0
%6 = mul i32 %5, %2
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ append_tests();
int /*<<< orphan*/ change_tests();
int /*<<< orphan*/ clear_tests();
int /*<<< orphan*/ lifetime_tests();
int /*<<< orphan*/ matches_tests();
int /*<<< orphan*/ set_tests();
void all_tests(void) {
  lifetime_tests();
  clear_tests();
  set_tests();
  append_tests();
  change_tests();
  matches_tests();
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lifetime_tests@plt>
mov    $0x0,%al
call   1070 <clear_tests@plt>
mov    $0x0,%al
call   1050 <set_tests@plt>
mov    $0x0,%al
call   1080 <append_tests@plt>
mov    $0x0,%al
call   1030 <change_tests@plt>
mov    $0x0,%al
call   1060 <matches_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1040 <lifetime_tests@plt>
xor    %eax,%eax
call   1070 <clear_tests@plt>
xor    %eax,%eax
call   1050 <set_tests@plt>
xor    %eax,%eax
call   1080 <append_tests@plt>
xor    %eax,%eax
call   1030 <change_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <matches_tests@plt>

LLVM IR (-O0):
define void @all_tests() {
%1 = call i32 (...) @lifetime_tests()
%2 = call i32 (...) @clear_tests()
%3 = call i32 (...) @set_tests()
%4 = call i32 (...) @append_tests()
%5 = call i32 (...) @change_tests()
%6 = call i32 (...) @matches_tests()
ret void
}

LLVM IR (-O2):
define void @all_tests() {
%1 = tail call i32 (...) @lifetime_tests()
%2 = tail call i32 (...) @clear_tests()
%3 = tail call i32 (...) @set_tests()
%4 = tail call i32 (...) @append_tests()
%5 = tail call i32 (...) @change_tests()
%6 = tail call i32 (...) @matches_tests()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void fail(const char *msg, const char *arg) {
  if (!arg)
    arg = strerror(errno);
  fprintf(stderr, "*** FAIL: %s: %s\n", msg, arg);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <fail+0x2d>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
test   %rsi,%rsi
jne    114d <fail+0x1d>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rcx
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"*** FAIL: %s: %s\0A\00"
define void @fail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %4
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"*** FAIL: %s: %s\0A\00"
define void @fail(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %1, %2 ], [ %6, %4 ]
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %8)
%11 = tail call i32 @exit(i32 1)
unreachable
}
void oldfunctiondef1(a) int a;
{ return; }


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

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

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

LLVM IR (-O2):
define void @oldfunctiondef1(i32 %0) {
ret void
}
/* Type definitions */
struct forth_dict {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dict_lookup1(struct forth_dict *, char const *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int32_t dict_lookup(struct forth_dict *dict, const char *name) {
  return dict_lookup1(dict, name, strlen(name));
}


x86 assembly (clang, -O0):
<dict_lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <dict_lookup1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_lookup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dict_lookup1@plt>

LLVM IR (-O0):
%struct.forth_dict = type { i32 }
define i32 @dict_lookup(%struct.forth_dict* %0, i8* %1) {
%3 = alloca %struct.forth_dict*
%4 = alloca i8*
store %struct.forth_dict* %0, %struct.forth_dict** %3
store i8* %1, i8** %4
%5 = load %struct.forth_dict*, %struct.forth_dict** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @dict_lookup1(%struct.forth_dict* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.forth_dict = type { i32 }
define i32 @dict_lookup(%struct.forth_dict* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @dict_lookup1(%struct.forth_dict* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct semaphore {
  int dummy;
};

/* Variables and functions */
int futex_down_timeout_fairness(struct semaphore *, struct timespec *, int);
int futex_down_timeout_fair(struct semaphore *sem, struct timespec *rel) {
  return futex_down_timeout_fairness(sem, rel, 1);
}


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

x86 assembly (clang, -O2):
<futex_down_timeout_fair>:
mov    $0x1,%edx
jmp    1030 <futex_down_timeout_fairness@plt>

LLVM IR (-O0):
%struct.semaphore = type { i32 }
%struct.timespec = type { i32 }
define i32 @futex_down_timeout_fair(%struct.semaphore* %0, %struct.timespec* %1) {
%3 = alloca %struct.semaphore*
%4 = alloca %struct.timespec*
store %struct.semaphore* %0, %struct.semaphore** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.semaphore*, %struct.semaphore** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @futex_down_timeout_fairness(%struct.semaphore* %5, %struct.timespec* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
%struct.timespec = type { i32 }
define i32 @futex_down_timeout_fair(%struct.semaphore* %0, %struct.timespec* %1) {
%3 = tail call i32 @futex_down_timeout_fairness(%struct.semaphore* %0, %struct.timespec* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldr(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_imm8pc_op();
void t16_ldr_pc8() { arm_memio_ldr(t16_memio_imm8pc_op()); }


x86 assembly (clang, -O0):
<t16_ldr_pc8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_memio_imm8pc_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_ldr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_ldr_pc8>:
push   %rax
xor    %eax,%eax
call   1040 <t16_memio_imm8pc_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_ldr@plt>

LLVM IR (-O0):
define void @t16_ldr_pc8() {
%1 = call i32 (...) @t16_memio_imm8pc_op()
%2 = call i32 @arm_memio_ldr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_ldr_pc8() {
%1 = tail call i32 (...) @t16_memio_imm8pc_op()
%2 = tail call i32 @arm_memio_ldr(i32 %1)
ret void
}
/* Variables and functions */
int OK;
int saveterm() { return (OK); }


x86 assembly (clang, -O0):
<saveterm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveterm>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @saveterm() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @saveterm() {
%1 = load i32, i32* @OK
ret i32 %1
}
move(s, t) char *s, *t;
{
  cunlink(t);
  if (link(s, t) || cunlink(s)) {
    printf("move failed: %s\n", t);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <cunlink@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <link@plt>
cmp    $0x0,%eax
jne    1177 <move+0x47>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <cunlink@plt>
cmp    $0x0,%eax
je     1195 <move+0x65>
mov    -0x18(%rbp),%rsi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119c <move+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %r14d,%r14d
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <cunlink@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <link@plt>
test   %eax,%eax
jne    1166 <move+0x36>
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <cunlink@plt>
test   %eax,%eax
je     117d <move+0x4d>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"move failed: %s\0A\00"
define i32 @move(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @cunlink to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @link to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @cunlink to i32 (i8*, ...)*)(i8* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 1, %9 ], [ 0, %6 ]
ret i32 %12
}
void floatGenClean(struct LSD_SceneNodeInst const *inst, void *instData) {}


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

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

LLVM IR (-O0):
%struct.LSD_SceneNodeInst = type opaque
define void @floatGenClean(%struct.LSD_SceneNodeInst* %0, i8* %1) {
%3 = alloca %struct.LSD_SceneNodeInst*
%4 = alloca i8*
store %struct.LSD_SceneNodeInst* %0, %struct.LSD_SceneNodeInst** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define void @floatGenClean(%struct.LSD_SceneNodeInst* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpagesize();
size_t unistd_getpagesize(void) { return (size_t)getpagesize(); }


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

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

LLVM IR (-O0):
define i64 @unistd_getpagesize() {
%1 = call i32 (...) @getpagesize()
%2 = sext i32 %1 to i64
ret i64 %2
}

LLVM IR (-O2):
define i64 @unistd_getpagesize() {
%1 = tail call i32 (...) @getpagesize()
%2 = sext i32 %1 to i64
ret i64 %2
}
void __set_bit(int idx, unsigned long *bmap) {
  unsigned long mask = (1UL << ((idx) % 32));
  unsigned long *p = ((unsigned long *)bmap) + ((idx) / 32);
  *p |= mask;
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xffffffe0,%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
sar    $0x5,%eax
cltq
or     %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 32
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = or i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 32
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
ret void
}
double scaleValue(double value, double minValue, double maxValue,
                  double minRange, double maxRange) {
  return (((maxRange - minRange) * (value - minValue)) /
          (maxValue - minValue)) +
         minRange;
}


x86 assembly (clang, -O0):
<scaleValue>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleValue>:
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @scaleValue(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %10
%12 = load double, double* %9
%13 = fsub double %11, %12
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
%22 = load double, double* %9
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @scaleValue(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %4, %3
%7 = fsub double %0, %1
%8 = fmul double %7, %6
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
/* Variables and functions */
int b(int);
int __attribute__((stdcall)) bar(int x) { return b(x); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <b@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @b(i32 %0)
ret i32 %2
}
double sub(double x, double y) { return x - y; }


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

x86 assembly (clang, -O2):
<sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}