xunge/DecIR huggingface dataset:
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_getpgrp(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_getpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_getpgrp>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getpgrp(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getpgrp(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_get_time_clock(void *s, clockid_t *clock) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_source_get_time_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_source_get_time_clock(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_get_time_clock(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
float cosf(float);
__attribute__((__weak__, __always___)) float softboundcets_cosf(float x) {
  return cosf(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_cosf>:
jmp    1030 <cosf@plt>

LLVM IR (-O0):
define weak float @softboundcets_cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @cosf(float %3)
ret float %4
}

LLVM IR (-O2):
define weak float @softboundcets_cosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
void hmd_prep_left() {}


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

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

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

LLVM IR (-O2):
define void @hmd_prep_left() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kfork() {
  int child, pid;
  pid = getpid();
  printf("Proc %d entering kernal to fork a child...\n", pid);
  child = syscall(3, 0, 0);
  printf("Proc %d forked a child (%d)!\n", pid, child);
}


x86 assembly (clang, -O0):
<kfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <syscall@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kfork>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <syscall@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Proc %d entering kernal to fork a child...\0A\00"
@.str.1 = [30 x i8] c"Proc %d forked a child (%d)!\0A\00"
define i32 @kfork() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @syscall(i32 3, i32 0, i32 0)
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [44 x i8] c"Proc %d entering kernal to fork a child...\0A\00"
@.str.1 = [30 x i8] c"Proc %d forked a child (%d)!\0A\00"
define i32 @kfork() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @syscall(i32 3, i32 0, i32 0)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %3)
ret i32 undef
}
int subtraction(int num1, int num2) {
  int aux;
  aux = num1 - num2;
  return aux;
}


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

x86 assembly (clang, -O2):
<subtraction>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @subtraction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @subtraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
unsigned long long int rdtsc(void) {
  unsigned long long int x;
  __asm__ volatile(".byte 0x0f, 0x31" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
int is_alpha(c)
char c;
{ return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_')); }


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
shl    $0x18,%edi
mov    %edi,%eax
and    $0xdf000000,%eax
add    $0xbfffffff,%eax
cmp    $0x1affffff,%eax
setb   %al
cmp    $0x5f000000,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_alpha(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %23, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %23, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 95
br label %23
23: ; preds = %19, %15, %7
%24 = phi i1 [ true, %15 ], [ true, %7 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_alpha(i32 %0) {
%2 = shl i32 %0, 24
%3 = and i32 %2, -553648128
%4 = add i32 %3, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = icmp eq i32 %2, 1593835520
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
char *gen_instance_logname(char *template, int instance_num) {
  static char filename[80];
  snprintf(filename, 80, "%s-%d.log", template, instance_num);
  return filename;
}


x86 assembly (clang, -O0):
<gen_instance_logname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0x2f12(%rip),%rdi
mov    $0x50,%esi
lea    0xec6(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2efa(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_instance_logname>:
push   %rbx
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gen_instance_logname.filename = internal global [80 x i8] zeroinitializer
@.str = [10 x i8] c"%s-%d.log\00"
define i8* @gen_instance_logname(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 @snprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @gen_instance_logname.filename, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @gen_instance_logname.filename, i64 0, i64 0)
}

LLVM IR (-O2):
@gen_instance_logname.filename = internal global [80 x i8] zeroinitializer
@.str = [10 x i8] c"%s-%d.log\00"
define i8* @gen_instance_logname(i8* %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @gen_instance_logname.filename, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @gen_instance_logname.filename, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int bcstrfree(char *s) {
  if (s) {
    free(s);
    return (0);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<bcstrfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <bcstrfree+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <bcstrfree+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcstrfree>:
test   %rdi,%rdi
je     1122 <bcstrfree+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bcstrfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Type definitions */
struct io_mapping {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_mapping_free(struct io_mapping *);
void fbmem_fini(struct io_mapping *fb) { io_mapping_free(fb); }


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

x86 assembly (clang, -O2):
<fbmem_fini>:
jmp    1030 <io_mapping_free@plt>

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

LLVM IR (-O2):
%struct.io_mapping = type { i32 }
define void @fbmem_fini(%struct.io_mapping* %0) {
%2 = tail call i32 @io_mapping_free(%struct.io_mapping* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MessageAppend(int, char *, int, int, void *);
void MdiError(int offset1, int offset2, void *ptr) {
  MessageAppend(1, "MdiSelectGlobal: no match for offset %d,%d ptr %p\n",
                offset1, offset2, ptr);
}


x86 assembly (clang, -O0):
<MdiError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x1,%edi
lea    0xec8(%rip),%rsi
call   1030 <MessageAppend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MdiError>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee2(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <MessageAppend@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"MdiSelectGlobal: no match for offset %d,%d ptr %p\0A\00"
define void @MdiError(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @MessageAppend(i32 1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"MdiSelectGlobal: no match for offset %d,%d ptr %p\0A\00"
define void @MdiError(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @MessageAppend(i32 1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2)
ret void
}
RX0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<RX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AX1>:
movslq %ecx,%rax
mov    0xa98ac7(,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,(%r8,%rcx,4)
ret

LLVM IR (-O0):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %12
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* %4, i64 %10
store i32 %9, i32* %11
ret i32 undef
}
/* Variables and functions */
double ln_get_jupiter_earth_dist(double);
double ln_get_jupiter_equ_sdiam(double JD) {
  double So = 98.44;
  double dist;
  dist = ln_get_jupiter_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_jupiter_equ_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_jupiter_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_jupiter_equ_sdiam>:
push   %rax
call   1030 <ln_get_jupiter_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_jupiter_equ_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x40589C28F5C28F5C, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_jupiter_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_jupiter_equ_sdiam(double %0) {
%2 = tail call double @ln_get_jupiter_earth_dist(double %0)
%3 = fdiv double 0x40589C28F5C28F5C, %2
ret double %3
}
void d() {
  int i, j;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 1000000; j++) {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    114f <d+0x4f>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    113c <d+0x3c>
jmp    112e <d+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <d+0x1c>
jmp    1141 <d+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <d+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @d() {
ret void
}
void foo597(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo597(i32 %0) {
ret void
}
double __attribute__((used)) foo(_Complex double x, int b) {
  if (b)
    x = 0;
  return cabs(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113f <foo+0x2f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cabs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     111a <foo+0xa>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <cabs@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double, double, i32)* @foo to i8*)], section "llvm.metadata"
define double @foo(double %0, double %1, i32 %2) {
%4 = alloca { double, double }
%5 = alloca i32
%6 = alloca { double, double }
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %8
store i32 %2, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %11, %3
%15 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%18 = load double, double* %17
%19 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%20 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %16, double* %19
store double %18, double* %20
%21 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%22 = load double, double* %21
%23 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%24 = load double, double* %23
%25 = call double @cabs(double %22, double %24)
ret double %25
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double, double, i32)* @foo to i8*)], section "llvm.metadata"
define double @foo(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, double %0, double 0.000000e+00
%6 = select i1 %4, double %1, double 0.000000e+00
%7 = tail call double @cabs(double %5, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int msync(void *addr, size_t length, int flags) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<msync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msync>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @msync(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @msync(i8* nocapture readnone %0, i64 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printk(const char *msg) {
  int c;
  while ((c = *msg++) != 0) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<printk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1147 <printk+0x37>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    111c <printk+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printk(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hlt();
void idle_main(void) {
  for (;;) {
    hlt();
  }
}


x86 assembly (clang, -O0):
<idle_main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <idle_main+0x9>
mov    $0x0,%al
call   1030 <hlt@plt>
jmp    1119 <idle_main+0x9>

x86 assembly (clang, -O2):
<idle_main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <hlt@plt>
jmp    1120 <idle_main+0x10>

LLVM IR (-O0):
define void @idle_main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @hlt()
br label %1
}

LLVM IR (-O2):
define void @idle_main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @hlt()
br label %1
}
char *getenv(name)
char *name;
{
  int len = namelength(name);
  char **envp = findenv(name, len);
  return (envp ? *envp + len + 1 : 0);
}


x86 assembly (clang, -O0):
<getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <namelength@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <findenv@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <getenv+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    117f <getenv+0x5f>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    117f <getenv+0x5f>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <namelength@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <findenv@plt>
test   %eax,%eax
je     1153 <getenv+0x33>
cltq
mov    (%rax),%rax
movslq %ebp,%rcx
lea    (%rax,%rcx,1),%r14
add    $0x1,%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @namelength to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @findenv to i32 (i8*, i32, ...)*)(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = inttoptr i64 %6 to i8**
%8 = load i8*, i8** %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
br label %12
12: ; preds = %1, %5
%13 = phi i8* [ %11, %5 ], [ null, %1 ]
ret i8* %13
}
void replay_decode_data() {}


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

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

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

LLVM IR (-O2):
define void @replay_decode_data() {
ret void
}
/* Variables and functions */
scalar_t__ exp(double);
long double expl(long double x) { return (long double)exp((double)x); }


x86 assembly (clang, -O0):
<expl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @expl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @exp(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @expl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @exp(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int Selective_GetTimeOfDay(struct timeval *t) { return gettimeofday(t, NULL); }


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

x86 assembly (clang, -O2):
<Selective_GetTimeOfDay>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @Selective_GetTimeOfDay(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @Selective_GetTimeOfDay(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_help(void) {
  printf("Usage:\n"
         "\t-h Display help\n"
         "\t-i input_file\t(Required)\n"
         "\t-o output_file\t(Optional)\n"
         "\t-v print information out to std_err\n");
}


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

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

LLVM IR (-O0):
@.str = [115 x i8] c"Usage:\0A\09-h Display help\0A\09-i input_file\09(Required)\0A\09-o output_file\09(Optional)\0A\09-v print information out to std_err\0A\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [114 x i8] c"Usage:\0A\09-h Display help\0A\09-i input_file\09(Required)\0A\09-o output_file\09(Optional)\0A\09-v print information out to std_err\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str, i64 0, i64 0))
ret void
}
void RB_SurfaceSkip(void *surf) { return; }


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

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

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

LLVM IR (-O2):
define void @RB_SurfaceSkip(i8* nocapture %0) {
ret void
}
unsigned xrop3_37_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & T;
  stk3 = ~stk3;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_37_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_37_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
and    %edi,%esi
not    %sil
movzbl %sil,%eax
xor    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_37_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %7
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_37_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i8 %1, %0
%8 = xor i8 %7, -1
%9 = zext i8 %8 to i32
%10 = xor i32 %6, %9
%11 = or i32 %10, %4
%12 = xor i32 %11, -1
%13 = or i32 %12, %3
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ shError(char *, int);
void *shMalloc(int nbytes) {
  void *vptr;
  if ((vptr = (void *)malloc(nbytes)) == NULL) {
    shError("shMalloc: failed to allocate for %d bytes", nbytes);
    exit(1);
  }
  return (vptr);
}


x86 assembly (clang, -O0):
<shMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116a <shMalloc+0x3a>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <shError@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shMalloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <shMalloc+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <shError@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"shMalloc: failed to allocate for %d bytes\00"
define i8* @shMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @shError(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [42 x i8] c"shMalloc: failed to allocate for %d bytes\00"
define i8* @shMalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @shError(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
void RTLogFormatV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogFormatV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ leak_memory();
void leak_memory_test(void **state) {
  (void)state;
  leak_memory();
}


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

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

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

LLVM IR (-O2):
define void @leak_memory_test(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @leak_memory()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 10.0, 0.0, 10.0, -1.0, 1.0);
}


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

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

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

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(double 0.000000e+00, double 1.000000e+01, double 0.000000e+00, double 1.000000e+01, double -1.000000e+00, double 1.000000e+00)
ret void
}
double atof(p)
register char *p;
{ return strtod(p, (char **)0); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i8** null)
ret double %4
}

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vecfree(void *memblock) { free(memblock); }


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

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

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

LLVM IR (-O2):
define void @vecfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int f(void (*g)(), enum {AA, BB} h) { return AA; }


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

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

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

LLVM IR (-O2):
define i32 @f(void (...)* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct yamc_pub_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ yamc_pub_cmd_parser_required2(struct yamc_pub_args_info *,
                                         char const *, int /*<<< orphan*/);
int yamc_pub_cmd_parser_required(struct yamc_pub_args_info *args_info,
                                 const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (yamc_pub_cmd_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<yamc_pub_cmd_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <yamc_pub_cmd_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <yamc_pub_cmd_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yamc_pub_cmd_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <yamc_pub_cmd_parser_required2@plt>
test   %rax,%rax
jle    112f <yamc_pub_cmd_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.yamc_pub_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @yamc_pub_cmd_parser_required(%struct.yamc_pub_args_info* %0, i8* %1) {
%3 = alloca %struct.yamc_pub_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.yamc_pub_args_info* %0, %struct.yamc_pub_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.yamc_pub_args_info*, %struct.yamc_pub_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @yamc_pub_cmd_parser_required2(%struct.yamc_pub_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.yamc_pub_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @yamc_pub_cmd_parser_required(%struct.yamc_pub_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @yamc_pub_cmd_parser_required2(%struct.yamc_pub_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
void RTUuidCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUuidCreate() {
ret void
}
extern void broken_strcpy(char *Target, char *Source) {
  char C;
  do {
    C = *Source;
    *Target = C;
    Source++;
    Target++;
  } while (C != 0);
}


x86 assembly (clang, -O0):
<broken_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    110c <broken_strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<broken_strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <broken_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @broken_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
store i8 %6, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = icmp eq i8 %6, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}