xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};
typedef int __useconds_t;

/* Variables and functions */
int nanosleep(struct timespec const *, int /*<<< orphan*/ *);
int usleep(__useconds_t usec) {
  const struct timespec ts = {.tv_sec = (long int)(usec / 1000000),
                              .tv_nsec = (long int)(usec % 1000000) * 1000ul};
  return (nanosleep(&ts, NULL));
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
cltq
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 1000
store i64 %12, i64* %8
%13 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i32 %0, 1000000
%6 = sext i32 %5 to i64
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%8 = srem i32 %0, 1000000
%9 = mul nsw i32 %8, 1000
%10 = sext i32 %9 to i64
store i64 %10, i64* %7
%11 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf_verbose(char *);
int snd_pcm_open_fallback(void) {
  printf_verbose("snd_pcm_open_fallback(...) = BLOCKED;");
  return -1;
}


x86 assembly (clang, -O0):
<snd_pcm_open_fallback>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_pcm_open_fallback>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"snd_pcm_open_fallback(...) = BLOCKED;\00"
define i32 @snd_pcm_open_fallback() {
%1 = call i32 @printf_verbose(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [38 x i8] c"snd_pcm_open_fallback(...) = BLOCKED;\00"
define i32 @snd_pcm_open_fallback() {
%1 = tail call i32 @printf_verbose(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void _mesa_locale_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @_mesa_locale_fini() {
ret void
}
/* Type definitions */
struct tm {
  int tm_mday;
  scalar_t__ tm_year;
  int /*<<< orphan*/ tm_mon;
};

/* Variables and functions */
int mdays_(int /*<<< orphan*/, scalar_t__);
int mday_(const struct tm *tm) {
  int last = mdays_(tm->tm_mon, tm->tm_year + 1900) - 1;
  return last < tm->tm_mday ? last : tm->tm_mday;
}


x86 assembly (clang, -O0):
<mday_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
add    $0x76c,%rsi
call   1030 <mdays_@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1157 <mday_+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <mday_+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mday_>:
push   %rbx
mov    %rdi,%rbx
mov    0x10(%rdi),%edi
mov    $0x76c,%esi
add    0x8(%rbx),%rsi
call   1030 <mdays_@plt>
mov    (%rbx),%edx
lea    -0x1(%rax),%ecx
cmp    %edx,%eax
cmovg  %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i32 }
define i32 @mday_(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
%6 = load i32, i32* %5
%7 = load %struct.tm*, %struct.tm** %2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, 1900
%11 = call i32 @mdays_(i32 %6, i64 %10)
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load %struct.tm*, %struct.tm** %2
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = icmp slt i32 %13, %16
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = load i32, i32* %3
br label %24
20: ; preds = %1
%21 = load %struct.tm*, %struct.tm** %2
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 0
%23 = load i32, i32* %22
br label %24
24: ; preds = %20, %18
%25 = phi i32 [ %19, %18 ], [ %23, %20 ]
ret i32 %25
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i32 }
define i32 @mday_(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 1900
%7 = tail call i32 @mdays_(i32 %3, i64 %6)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%9 = load i32, i32* %8
%10 = icmp sgt i32 %7, %9
%11 = add nsw i32 %7, -1
%12 = select i1 %10, i32 %9, i32 %11
ret i32 %12
}
unsigned int LOS_EvbGetKeyVal(int KeyNum) {
  unsigned int KeyVal = 0xFF;
  return KeyVal;
}


x86 assembly (clang, -O0):
<LOS_EvbGetKeyVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @LOS_EvbGetKeyVal(i32 %0) {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void fldcw_m16(unsigned short *m16) {
  put8(0xD9);
  put8(0x2D);
  put32((unsigned long)(m16));
}


x86 assembly (clang, -O0):
<fldcw_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldcw_m16>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @fldcw_m16(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call i32 @put8(i32 217)
%4 = call i32 @put8(i32 45)
%5 = load i16*, i16** %2
%6 = ptrtoint i16* %5 to i64
%7 = call i32 @put32(i64 %6)
ret void
}

LLVM IR (-O2):
define void @fldcw_m16(i16* %0) {
%2 = tail call i32 @put8(i32 217)
%3 = tail call i32 @put8(i32 45)
%4 = ptrtoint i16* %0 to i64
%5 = tail call i32 @put32(i64 %4)
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ errno_exit(char *);
char *ptsname(int);
const char *slave_pseudo_terminal_name(int master_fd) {
  errno = 0;
  const char *name = ptsname(master_fd);
  if (name == NULL)
    errno_exit("cannot name slave pseudo-terminal");
  return name;
}


x86 assembly (clang, -O0):
<slave_pseudo_terminal_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <ptsname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <slave_pseudo_terminal_name+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <errno_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slave_pseudo_terminal_name>:
push   %rbx
mov    0x2eb8(%rip),%rax
movq   $0x0,(%rax)
call   1030 <ptsname@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <slave_pseudo_terminal_name+0x28>
lea    0xebd(%rip),%rdi
call   1040 <errno_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [34 x i8] c"cannot name slave pseudo-terminal\00"
define i8* @slave_pseudo_terminal_name(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i64 0, i64* @errno
%4 = load i32, i32* %2
%5 = call i8* @ptsname(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @errno_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [34 x i8] c"cannot name slave pseudo-terminal\00"
define i8* @slave_pseudo_terminal_name(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i8* @ptsname(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errno_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 "
         "CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri May 31 14:36:08 KST "
         "2013 BUILD=release TARGET_PLATFORM=pegasus-m400 "
         "MALI_PLATFORM=pegasus-m400 KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [359 x i8] c"malidrv: API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri May 31 14:36:08 KST 2013 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([359 x i8], [359 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [359 x i8] c"malidrv: API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri May 31 14:36:08 KST 2013 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([359 x i8], [359 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(void) {
  printf("usage: %s [-d] [hosts_file]\n", "tnamed");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"usage: %s [-d] [hosts_file]\0A\00"
@.str.1 = [7 x i8] c"tnamed\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: %s [-d] [hosts_file]\0A\00"
@.str.1 = [7 x i8] c"tnamed\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void FLCTL_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<FLCTL_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FLCTL_IRQHandler+0x9>
jmp    1109 <FLCTL_IRQHandler+0x9>

x86 assembly (clang, -O2):
<FLCTL_IRQHandler>:
jmp    1100 <FLCTL_IRQHandler>

LLVM IR (-O0):
define void @FLCTL_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @FLCTL_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
quicksort(p, r) int p, r;
{
  int q;
  if (p < r) {
    q = partition(p, r);
    quicksort(p, q);
    quicksort(q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <quicksort+0x43>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <quicksort@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1040 <quicksort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1151 <quicksort+0x31>
mov    %esi,%r14d
mov    %edi,%ebx
nopl   (%rax)
mov    %ebx,%edi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @quicksort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @partition to i32 (i32, i32, ...)*)(i32 %5, i32 %1)
%7 = tail call i32 @quicksort(i32 %5, i32 %6)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
int dwarf_get_children_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_children_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_children_name(val_in, &v);
  return ellipname(res, val_in, v, "children", printonerr);
}


x86 assembly (clang, -O0):
<get_children_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <dwarf_get_children_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1030 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_children_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1040 <dwarf_get_children_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1030 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"children\00"
define i8* @get_children_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_children_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"children\00"
define i8* @get_children_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_children_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Type definitions */
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ throw(char *);
void nsleep(int nanoseconds) {
  struct timespec time = {0, nanoseconds};
  if (nanosleep(&time, NULL) == -1) {
    throw("Sleep was interrupted");
  }
}


x86 assembly (clang, -O0):
<nsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
jne    115a <nsleep+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <throw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsleep>:
push   %rax
movl   $0x0,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
cmp    $0xffffffff,%eax
je     113d <nsleep+0x1d>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <throw@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@.str = [22 x i8] c"Sleep was interrupted\00"
define void @nsleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%6 = load i32, i32* %2
store i32 %6, i32* %5
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @throw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@.str = [22 x i8] c"Sleep was interrupted\00"
define void @nsleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %0, i32* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @throw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void i2d_RSAPublicKey_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_RSAPublicKey_bio() {
ret void
}
void *t_fun(void *arg) { return (void *)7; }


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

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

LLVM IR (-O0):
define i8* @t_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* inttoptr (i64 7 to i8*)
}

LLVM IR (-O2):
define i8* @t_fun(i8* nocapture readnone %0) {
ret i8* inttoptr (i64 7 to i8*)
}
void foo409(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo409(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_exit(char *, char const *);
void binhelp(const char *progname) {
  err_exit("Usage: %s [-Ssn] file1 file2\n"
           "    -S        Output diff parts to suffix '.diff' file.\n"
           "    -s offset Set the offset of where to start diff.\n"
           "    -n length Set the match length from the offset.\n"
           "    -l list   Find and list all mismatch.\n",
           progname);
}


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

x86 assembly (clang, -O2):
<binhelp>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <err_exit@plt>

LLVM IR (-O0):
@.str = [233 x i8] c"Usage: %s [-Ssn] file1 file2\0A -S Output diff parts to suffix '.diff' file.\0A -s offset Set the offset of where to start diff.\0A -n length Set the match length from the offset.\0A -l list Find and list all mismatch.\0A\00"
define void @binhelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @err_exit(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [233 x i8] c"Usage: %s [-Ssn] file1 file2\0A -S Output diff parts to suffix '.diff' file.\0A -s offset Set the offset of where to start diff.\0A -n length Set the match length from the offset.\0A -l list Find and list all mismatch.\0A\00"
define void @binhelp(i8* %0) {
%2 = tail call i32 @err_exit(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void init_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @init_timer() {
ret void
}
/* Variables and functions */
int gcd(int, int);
int lcm(int a, int b) {
  int g = gcd(a, b);
  return (a / g) * b;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
imul   %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lcm(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 = call i32 @gcd(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = tail call i32 @gcd(i32 %0, i32 %1)
%4 = sdiv i32 %0, %3
%5 = mul nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ show_double(double);
int /*<<< orphan*/ show_int(int);
int /*<<< orphan*/ show_long(long);
int /*<<< orphan*/ show_pointer(int *);
int /*<<< orphan*/ show_short(short);
int main(void) {
  int x = 12345;
  show_int(x);
  double d = 12345.0;
  show_double(d);
  short s = 12345;
  show_short(s);
  long l = 12345L;
  show_long(l);
  int *p = &x;
  show_pointer(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3039,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <show_int@plt>
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <show_double@plt>
movw   $0x3039,-0x12(%rbp)
movswl -0x12(%rbp),%edi
call   1040 <show_short@plt>
movq   $0x3039,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <show_long@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <show_pointer@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3039,0x4(%rsp)
mov    $0x3039,%edi
call   1050 <show_int@plt>
movsd  0xe95(%rip),%xmm0
call   1070 <show_double@plt>
mov    $0x3039,%edi
call   1040 <show_short@plt>
mov    $0x3039,%edi
call   1030 <show_long@plt>
lea    0x4(%rsp),%rdi
call   1060 <show_pointer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca i16
%5 = alloca i64
%6 = alloca i32*
store i32 0, i32* %1
store i32 12345, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @show_int(i32 %7)
store double 1.234500e+04, double* %3
%9 = load double, double* %3
%10 = call i32 @show_double(double %9)
store i16 12345, i16* %4
%11 = load i16, i16* %4
%12 = call i32 @show_short(i16 signext %11)
store i64 12345, i64* %5
%13 = load i64, i64* %5
%14 = call i32 @show_long(i64 %13)
store i32* %2, i32** %6
%15 = load i32*, i32** %6
%16 = call i32 @show_pointer(i32* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12345, i32* %1
%3 = tail call i32 @show_int(i32 12345)
%4 = tail call i32 @show_double(double 1.234500e+04)
%5 = tail call i32 @show_short(i16 signext 12345)
%6 = tail call i32 @show_long(i64 12345)
%7 = call i32 @show_pointer(i32* %1)
ret i32 0
}
unsigned long strlen(const char *string) {
  int length = 0;
  while (string[length] != '\0')
    ++length;
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
__attribute__((no, noclone)) int foo(int i) {
  volatile int v[4];
  int *p;
  v[i] = 6;
  p = (int *)&v[i];
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x6,-0x20(%rbp,%rax,4)
movslq -0x4(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edi,%rax
movl   $0x6,-0x18(%rsp,%rax,4)
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %6
store volatile i32 6, i32* %7
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %9
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %4
store volatile i32 6, i32* %5
ret i32 6
}
/* Variables and functions */
scalar_t__ _get_sysfs_numeric(char *, char *, unsigned short *);
unsigned short get_sysfs_shex(char *sysfs_attr) {
  unsigned short number;
  if (_get_sysfs_numeric(sysfs_attr, "%hx", &number) == 0)
    return number;
  else
    return ((unsigned short)-1);
}


x86 assembly (clang, -O0):
<get_sysfs_shex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x12(%rbp),%rdx
call   1030 <_get_sysfs_numeric@plt>
cmp    $0x0,%rax
jne    1147 <get_sysfs_shex+0x37>
mov    -0x12(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    114d <get_sysfs_shex+0x3d>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysfs_shex>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x6(%rsp),%rdx
call   1030 <_get_sysfs_numeric@plt>
neg    %rax
sbb    %eax,%eax
or     0x6(%rsp),%ax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%hx\00"
define zeroext i16 @get_sysfs_shex(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i64 @_get_sysfs_numeric(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%5 = icmp eq i64 %4, 0
%6 = load i16, i16* %2
%7 = select i1 %5, i16 %6, i16 -1
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ IO_get_le16();
int /*<<< orphan*/ put_argument4(char *, int /*<<< orphan*/, char *);
int am_indirect16(void) {
  put_argument4(" (L", IO_get_le16(), ")");
  return 3;
}


x86 assembly (clang, -O0):
<am_indirect16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <IO_get_le16@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
lea    0xec9(%rip),%rdx
call   1040 <put_argument4@plt>
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_indirect16>:
push   %rax
xor    %eax,%eax
call   1030 <IO_get_le16@plt>
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rdx
mov    %eax,%esi
call   1040 <put_argument4@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" (L\00"
@.str.1 = [2 x i8] c")\00"
define i32 @am_indirect16() {
%1 = call i32 (...) @IO_get_le16()
%2 = call i32 @put_argument4(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
@.str = [4 x i8] c" (L\00"
@.str.1 = [2 x i8] c")\00"
define i32 @am_indirect16() {
%1 = tail call i32 (...) @IO_get_le16()
%2 = tail call i32 @put_argument4(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
int sys$resume(unsigned int *pidadr, void *prcnam) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(prcnam);
    register long int _a1 asm("rdi") = (long)(pidadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(20), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$resume>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x14,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$resume>:
mov    $0x14,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$resume"(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i32*, i32** %3
%12 = ptrtoint i32* %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 20, i64 %13, i64 %14)
store i64 %15, i64* %5
%16 = load i64, i64* %5
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @"sys$resume"(i32* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i32* %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 20, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash(uint32_t input, uint32_t size) {
  uint32_t x = input;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x);
  return x % size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = ashr i32 %7, 16
%9 = load i32, i32* %5
%10 = xor i32 %8, %9
%11 = mul nsw i32 %10, 73244475
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = ashr i32 %12, 16
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
%16 = mul nsw i32 %15, 73244475
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = ashr i32 %17, 16
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = xor i32 %3, %0
%5 = mul nsw i32 %4, 73244475
%6 = ashr i32 %5, 16
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 73244475
%9 = ashr i32 %8, 16
%10 = xor i32 %9, %8
%11 = srem i32 %10, %1
ret i32 %11
}
/* Variables and functions */
int EVP_read_pw_string_min(char *, int /*<<< orphan*/, int, char const *, int);
int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) {
  return EVP_read_pw_string_min(buf, 0, len, prompt, verify);
}


x86 assembly (clang, -O0):
<EVP_read_pw_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %esi,%esi
call   1030 <EVP_read_pw_string_min@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_read_pw_string>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <EVP_read_pw_string_min@plt>

LLVM IR (-O0):
define i32 @EVP_read_pw_string(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @EVP_read_pw_string_min(i8* %9, i32 0, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @EVP_read_pw_string(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @EVP_read_pw_string_min(i8* %0, i32 0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ return_union_het_fp();
int /*<<< orphan*/ take_union_het_fp(int /*<<< orphan*/);
void test_union_het_fp() { take_union_het_fp(return_union_het_fp()); }


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

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

LLVM IR (-O0):
define void @test_union_het_fp() {
%1 = call i32 (...) @return_union_het_fp()
%2 = call i32 @take_union_het_fp(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_union_het_fp() {
%1 = tail call i32 (...) @return_union_het_fp()
%2 = tail call i32 @take_union_het_fp(i32 %1)
ret void
}
/* Variables and functions */
int WSTOPSIG(int);
int goose_WSTOPSIG(int status) { return WSTOPSIG(status); }


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

x86 assembly (clang, -O2):
<goose_WSTOPSIG>:
jmp    1030 <WSTOPSIG@plt>

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

LLVM IR (-O2):
define i32 @goose_WSTOPSIG(i32 %0) {
%2 = tail call i32 @WSTOPSIG(i32 %0)
ret i32 %2
}
unsigned int fiolSWriteChar(char *dst, char val) {
  if (dst) {
    dst[0] = val;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fiolSWriteChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112e <fiolSWriteChar+0x2e>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1135 <fiolSWriteChar+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiolSWriteChar>:
test   %rdi,%rdi
je     110e <fiolSWriteChar+0xe>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fiolSWriteChar(i8* writeonly %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8 %1, i8* %0
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %6
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
struct timespec nsec_to_ts(long long ns) {
  struct timespec ts;
  ts.tv_sec = ns / 1000000000LL;
  ts.tv_nsec = ns % 1000000000LL;
  return ts;
}


x86 assembly (clang, -O0):
<nsec_to_ts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x1a,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x1a,%rcx
add    %rdx,%rcx
imul   $0x3b9aca00,%rcx,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsec_to_ts>:
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rdx,%rax
imul   $0x3b9aca00,%rax,%rcx
sub    %rcx,%rdi
mov    %rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @nsec_to_ts(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = srem i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %8, i64* %9
%10 = bitcast %struct.timespec* %2 to { i64, i64 }*
%11 = load { i64, i64 }, { i64, i64 }* %10
ret { i64, i64 } %11
}

LLVM IR (-O2):
define { i64, i64 } @nsec_to_ts(i64 %0) {
%2 = sdiv i64 %0, 1000000000
%3 = srem i64 %0, 1000000000
%4 = insertvalue { i64, i64 } poison, i64 %2, 0
%5 = insertvalue { i64, i64 } %4, i64 %3, 1
ret { i64, i64 } %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kallsyms [--all-symbols] "
                  "[--symbol-prefix=<prefix char>] "
                  "[--base-relative] < in.map > out.S\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [100 x i8] c"Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [100 x i8] c"Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _PATH_BSHELL;
int /*<<< orphan*/ execl(int /*<<< orphan*/, int /*<<< orphan*/, char *, char *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void *tf(void *arg) {
  execl(_PATH_BSHELL, _PATH_BSHELL, "-c", "echo $$", NULL);
  puts("execl failed");
  exit(1);
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdx
lea    0xea7(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <execl@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<tf>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rdx
lea    0xebb(%rip),%rcx
mov    %edi,%esi
xor    %r8d,%r8d
call   1050 <execl@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@_PATH_BSHELL = global i32 0
@.str = [3 x i8] c"-c\00"
@.str.1 = [8 x i8] c"echo $$\00"
@.str.2 = [13 x i8] c"execl failed\00"
define i8* @tf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @_PATH_BSHELL
%4 = load i32, i32* @_PATH_BSHELL
%5 = call i32 @execl(i32 %3, i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@_PATH_BSHELL = global i32 0
@.str = [3 x i8] c"-c\00"
@.str.1 = [8 x i8] c"echo $$\00"
@.str.2 = [13 x i8] c"execl failed\00"
define noalias i8* @tf(i8* nocapture readnone %0) {
%2 = load i32, i32* @_PATH_BSHELL
%3 = tail call i32 @execl(i32 %2, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f();
void bar(void) { f(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @f()
ret void
}
int isLittleEndian(void) {
  union {
    int testWord;
    char testByte[sizeof(int)];
  } endianTest;
  endianTest.testWord = 1;
  if (endianTest.testByte[0] == 1)
    return 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
void BN_rand(void) {}


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

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

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

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