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

/* Variables and functions */
int strcmp(char const *, char const *);
int __strcoll_l(const char *l, const char *r, locale_t loc) {
  return strcmp(l, r);
}


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

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

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

LLVM IR (-O2):
define i32 @__strcoll_l(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_audit_session_id(void *c, uint32_t *sessionid) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_audit_session_id>:
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_bus_creds_get_audit_session_id>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_audit_session_id(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_bus_creds_get_audit_session_id(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 */
int floor(float);
float numeroArrotondatoAMigliaia(float x) {
  return floor(x * 1000 + .5) / 1000;
}


x86 assembly (clang, -O0):
<numeroArrotondatoAMigliaia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroArrotondatoAMigliaia>:
push   %rax
mulss  0xee7(%rip),%xmm0
addss  0xee3(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @numeroArrotondatoAMigliaia(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+03
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptrunc double %6 to float
%8 = call i32 @floor(float %7)
%9 = sdiv i32 %8, 1000
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @numeroArrotondatoAMigliaia(float %0) {
%2 = fmul float %0, 1.000000e+03
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 1000
%6 = sitofp i32 %5 to float
ret float %6
}
void g_byte_array_sort_with_data() {}


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

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

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

LLVM IR (-O2):
define void @g_byte_array_sort_with_data() {
ret void
}
void handle_PRIO(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_PRIO(i32 %0) {
ret void
}
void foo695() {}


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

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

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

LLVM IR (-O2):
define void @foo695() {
ret void
}
double tanh(x)
double x;
{
  x = exp(x);
  return (x - 1.0 / x) / (x + 1.0 / x);
}


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm2
divsd  -0x8(%rbp),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fdiv double 1.000000e+00, %6
%8 = fsub double %5, %7
%9 = load double, double* %2
%10 = load double, double* %2
%11 = fdiv double 1.000000e+00, %10
%12 = fadd double %9, %11
%13 = fdiv double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fsub double %2, %3
%5 = fadd double %2, %3
%6 = fdiv double %4, %5
ret double %6
}
/* Type definitions */
struct rtc_time {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RTC_SET_TIME;
int tst_rtc_ioctl(char const *, int /*<<< orphan*/, struct rtc_time *);
int tst_rtc_settime(const char *rtc_dev, struct rtc_time *rtc_tm) {
  return tst_rtc_ioctl(rtc_dev, RTC_SET_TIME, rtc_tm);
}


x86 assembly (clang, -O0):
<tst_rtc_settime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <tst_rtc_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_rtc_settime>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tst_rtc_ioctl@plt>

LLVM IR (-O0):
%struct.rtc_time = type { i32 }
@RTC_SET_TIME = global i32 0
define i32 @tst_rtc_settime(i8* %0, %struct.rtc_time* %1) {
%3 = alloca i8*
%4 = alloca %struct.rtc_time*
store i8* %0, i8** %3
store %struct.rtc_time* %1, %struct.rtc_time** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @RTC_SET_TIME
%7 = load %struct.rtc_time*, %struct.rtc_time** %4
%8 = call i32 @tst_rtc_ioctl(i8* %5, i32 %6, %struct.rtc_time* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.rtc_time = type { i32 }
@RTC_SET_TIME = global i32 0
define i32 @tst_rtc_settime(i8* %0, %struct.rtc_time* %1) {
%3 = load i32, i32* @RTC_SET_TIME
%4 = tail call i32 @tst_rtc_ioctl(i8* %0, i32 %3, %struct.rtc_time* %1)
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *dest, const char *src, size_t num) {
  int l = strlen(dest);
  strncpy(dest + l, src, num);
  *(dest + l + num) = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
movslq %eax,%rbx
add    %r12,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i64 %2)
%8 = getelementptr inbounds i8, i8* %6, i64 %2
store i8 0, i8* %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int /*<<< orphan*/ *);
void *realloc(void *, size_t);
void *sort_realloc(void *ptr, size_t size) {
  if ((ptr = realloc(ptr, size)) == NULL)
    err(2, NULL);
  return (ptr);
}


x86 assembly (clang, -O0):
<sort_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1159 <sort_realloc+0x39>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <sort_realloc+0x1a>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @sort_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 2, i32* null)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ isupper(int);
int toupper(int c) {
  c &= 0xff;
  if (isupper(c))
    return c ^= 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1149 <toupper+0x39>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    114f <toupper+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
movzbl %dil,%ebx
mov    %ebx,%edi
call   1030 <isupper@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i64 @isupper(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = xor i32 %2, 32
%6 = select i1 %4, i32 %2, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popbooleanarray_(char *x, unsigned int *n) { popNarray(x, (*n * 4)); }


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

x86 assembly (clang, -O2):
<popbooleanarray_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popbooleanarray_(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 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @popNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popbooleanarray_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
int bar(int a, int b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cook();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void done() {
  cook();
  exit(0);
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cook@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %eax,%eax
call   1030 <cook@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @done() {
%1 = call i32 (...) @cook()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @done() {
%1 = tail call i32 (...) @cook()
%2 = tail call i32 @exit(i32 0)
unreachable
}
_Bool test1(int a, int b) { return a ? b : 0; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <test1+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <test1+0x29>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <test1+0x29>
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %edi,%edi
setne  %cl
test   %esi,%esi
setne  %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @test1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %4
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ 0, %9 ]
%12 = icmp ne i32 %11, 0
ret i1 %12
}

LLVM IR (-O2):
define zeroext i1 @test1(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
ret i1 %5
}
/* Variables and functions */
int /*<<< orphan*/ core9_print(char *, char const *);
void U_EMRPIE_print(const char *contents) { core9_print("U_EMRPIE", contents); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"U_EMRPIE\00"
define void @U_EMRPIE_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core9_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"U_EMRPIE\00"
define void @U_EMRPIE_print(i8* %0) {
%2 = tail call i32 @core9_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int absi(int val) { return val > 0 ? val : -val; }


x86 assembly (clang, -O0):
<absi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <absi+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absi+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absi>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absi(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettext(char *);
void print_usage(FILE *stream) {
  fputs(gettext("Usage: ypcat [-kt] [-d domain] [-h hostname] mapname | -x\n"),
        stream);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: ypcat [-kt] [-d domain] [-h hostname] mapname | -x\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @gettext(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Usage: ypcat [-kt] [-d domain] [-h hostname] mapname | -x\0A\00"
define void @print_usage(i32* %0) {
%2 = tail call i32 @gettext(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fputs(i32 %2, i32* %0)
ret void
}
/* Variables and functions */
float acos(float);
float _acos(float s) { return acos(s); }


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

x86 assembly (clang, -O2):
<_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define float @_acos(float %0) {
%2 = tail call float @acos(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
com() {
  ol("comb");
  ol("coma");
}


x86 assembly (clang, -O0):
<com>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xeda(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"comb\00"
@.str.1 = [5 x i8] c"coma\00"
define i32 @com() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"comb\00"
@.str.1 = [5 x i8] c"coma\00"
define i32 @com() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread(void *arg) {
  printf("thread terminating\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"thread terminating\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [19 x i8] c"thread terminating\00"
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
double M_PI;
double pow(double, double);
double area_circle(double radius) { return M_PI * pow(radius, 2.0); }


x86 assembly (clang, -O0):
<area_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_circle>:
mov    0x2ee1(%rip),%rax
mulsd  %xmm0,%xmm0
mulsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @area_circle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = call double @pow(double %4, double 2.000000e+00)
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @area_circle(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %0, %0
%4 = fmul double %3, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ DrawBMP221(unsigned long, unsigned long, unsigned long,
                              unsigned long, unsigned long, unsigned long,
                              unsigned long);
void drawbmp(unsigned long xs, unsigned long ys, unsigned long xd,
             unsigned long yd, unsigned long w, unsigned long h,
             unsigned long c) {
  DrawBMP221(xs, ys, xd, yd, w, h, c);
}


x86 assembly (clang, -O0):
<drawbmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <DrawBMP221@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawbmp>:
jmp    1030 <DrawBMP221@plt>

LLVM IR (-O0):
define void @drawbmp(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = load i64, i64* %13
%21 = load i64, i64* %14
%22 = call i32 @DrawBMP221(i64 %15, i64 %16, i64 %17, i64 %18, i64 %19, i64 %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @drawbmp(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i32 @DrawBMP221(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 2;
  int pow = 7;
  int result = x;
  while (pow > 1) {
    if (pow % 2 == 0) {
      result = result * x * x;
    } else {
      result = result * x * x * x;
    }
    pow /= 2;
  }
  printf("%d \n", result);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1189 <main+0x79>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x54>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1176 <main+0x66>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
mov    -0x10(%rbp),%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 128)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mul_m32(void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0xF7);
  put8(0x25);
  put32((unsigned long)(m32));
}


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

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

LLVM IR (-O0):
define void @mul_m32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = call i32 @put8(i32 247)
%7 = call i32 @put8(i32 37)
%8 = load i64*, i64** %3
%9 = ptrtoint i64* %8 to i64
%10 = call i32 @put32(i64 %9)
ret void
}

LLVM IR (-O2):
define void @mul_m32(i8* %0) {
%2 = tail call i32 @put8(i32 247)
%3 = tail call i32 @put8(i32 37)
%4 = ptrtoint i8* %0 to i64
%5 = tail call i32 @put32(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int number;
  printf("Termcast loaded, please enter a command.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Termcast loaded, please enter a command.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Termcast loaded, please enter a command.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float __ccv_mod_2pi(float x) {
  while (x > 2 * (3.141592653589793))
    x -= 2 * (3.141592653589793);
  while (x < 0)
    x += 2 * (3.141592653589793);
  return x;
}


x86 assembly (clang, -O0):
<__ccv_mod_2pi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1147 <__ccv_mod_2pi+0x47>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1109 <__ccv_mod_2pi+0x9>
jmp    114c <__ccv_mod_2pi+0x4c>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    117c <__ccv_mod_2pi+0x7c>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114c <__ccv_mod_2pi+0x4c>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccv_mod_2pi>:
cvtss2sd %xmm0,%xmm1
ucomisd 0xef4(%rip),%xmm1
jbe    1138 <__ccv_mod_2pi+0x38>
movsd  0xef2(%rip),%xmm2
movsd  0xee2(%rip),%xmm3
xchg   %ax,%ax
addsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd %xmm3,%xmm1
ja     1120 <__ccv_mod_2pi+0x20>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1161 <__ccv_mod_2pi+0x61>
movsd  0xeb8(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
cvtss2sd %xmm0,%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss %xmm0,%xmm1
ja     1150 <__ccv_mod_2pi+0x50>
ret

LLVM IR (-O0):
define float @__ccv_mod_2pi(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %7, %1
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0x401921FB54442D18
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fsub double %9, 0x401921FB54442D18
%11 = fptrunc double %10 to float
store float %11, float* %2
br label %3
12: ; preds = %3
br label %13
13: ; preds = %16, %12
%14 = load float, float* %2
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fadd double %18, 0x401921FB54442D18
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %13
21: ; preds = %13
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @__ccv_mod_2pi(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt double %2, 0x401921FB54442D18
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = phi float [ %0, %1 ], [ %10, %7 ]
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %13, label %19
7: ; preds = %1, %7
%8 = phi double [ %11, %7 ], [ %2, %1 ]
%9 = fadd double %8, 0xC01921FB54442D18
%10 = fptrunc double %9 to float
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 0x401921FB54442D18
br i1 %12, label %7, label %4
13: ; preds = %4, %13
%14 = phi float [ %17, %13 ], [ %5, %4 ]
%15 = fpext float %14 to double
%16 = fadd double %15, 0x401921FB54442D18
%17 = fptrunc double %16 to float
%18 = fcmp olt float %17, 0.000000e+00
br i1 %18, label %13, label %19
19: ; preds = %13, %4
%20 = phi float [ %5, %4 ], [ %17, %13 ]
ret float %20
}
void uart_flush(int fd) {}


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

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

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

LLVM IR (-O2):
define void @uart_flush(i32 %0) {
ret void
}
void genor() {}


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

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

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

LLVM IR (-O2):
define void @genor() {
ret void
}
void nmi(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @nmi() {
br label %1
1: ; preds = %1, %0
br label %1
}
f() { return 3; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 3
}

LLVM IR (-O2):
define i32 @f() {
ret i32 3
}
/* Variables and functions */
scalar_t__ rom_present(char *);
int esdi_available(void) {
  return (rom_present(L"roms/hdd/esdi/90x8969.bin") &&
          rom_present(L"roms/hdd/esdi/90x8970.bin"));
}


x86 assembly (clang, -O0):
<esdi_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     114c <esdi_available+0x3c>
lea    0xf2b(%rip),%rdi
call   1030 <rom_present@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esdi_available>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <rom_present@plt>
test   %rax,%rax
je     113b <esdi_available+0x2b>
lea    0xf3f(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 101, i32 115, i32 100, i32 105, i32 47, i32 57, i32 48, i32 120, i32 56, i32 57, i32 54, i32 57, i32 46, i32 98, i32 105, i32 110, i32 0]
@.str.1 = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 101, i32 115, i32 100, i32 105, i32 47, i32 57, i32 48, i32 120, i32 56, i32 57, i32 55, i32 48, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @esdi_available() {
%1 = call i64 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @rom_present(i8* bitcast ([26 x i32]* @.str.1 to i8*))
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 101, i32 115, i32 100, i32 105, i32 47, i32 57, i32 48, i32 120, i32 56, i32 57, i32 54, i32 57, i32 46, i32 98, i32 105, i32 110, i32 0]
@.str.1 = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 101, i32 115, i32 100, i32 105, i32 47, i32 57, i32 48, i32 120, i32 56, i32 57, i32 55, i32 48, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @esdi_available() {
%1 = tail call i64 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @rom_present(i8* bitcast ([26 x i32]* @.str.1 to i8*))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a;
  for (a = 0; a <= 256; a++)
    printf("%d - %c\n", a, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x101,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 257
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
__attribute__((no)) void sb_stats() {}


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

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

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

LLVM IR (-O2):
define void @sb_stats() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *buf;
  buf = malloc(size);
  if (buf == NULL)
    err(1, "malloc");
  return (buf);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %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 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 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):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void __f() { ; }


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

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

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

LLVM IR (-O2):
define void @__f() {
ret void
}
void back_extdom_evict_user(struct nss_ops_ctx *nss_context, const char *name) {
}


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

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

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

LLVM IR (-O2):
%struct.nss_ops_ctx = type opaque
define void @back_extdom_evict_user(%struct.nss_ops_ctx* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calibration();
void main() {
  calibration();
  return;
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @calibration()
ret void
}
double delta_S(double *path, double g, double delta, int path_index) {
  return delta * (delta + 2 * path[path_index] -
                  g * (path[path_index - 1] + path[path_index + 1]));
}


x86 assembly (clang, -O0):
<delta_S>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_S>:
movslq %esi,%rax
movsd  -0x8(%rdi,%rax,8),%xmm3
movsd  (%rdi,%rax,8),%xmm2
addsd  %xmm2,%xmm2
addsd  0x8(%rdi,%rax,8),%xmm3
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @delta_S(double* %0, double %1, double %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%9 = load double, double* %7
%10 = load double, double* %7
%11 = load double*, double** %5
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %15, double %10)
%17 = load double, double* %6
%18 = load double*, double** %5
%19 = load i32, i32* %8
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %18, i64 %21
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %24, i64 %27
%29 = load double, double* %28
%30 = fadd double %23, %29
%31 = fneg double %17
%32 = call double @llvm.fmuladd.f64(double %31, double %30, double %16)
%33 = fmul double %9, %32
ret double %33
}

LLVM IR (-O2):
define double @delta_S(double* nocapture %0, double %1, double %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %2)
%9 = add nsw i32 %3, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
%13 = add nsw i32 %3, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = fadd double %12, %16
%18 = fneg double %1
%19 = tail call double @llvm.fmuladd.f64(double %18, double %17, double %8)
%20 = fmul double %19, %2
ret double %20
}
int divisable(int first, int second) {
  if (first % second != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<divisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1126 <divisable+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    112d <divisable+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisable>:
mov    %edi,%eax
cltd
idiv   %esi
neg    %edx
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @divisable(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp ne i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogging(char *, char *);
void send_command(char *cmd, char *recvBuf, int *recvSize) {
  DebugLogging("Send command %s unimplemented\n", cmd);
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Send command %s unimplemented\0A\00"
define void @send_command(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = call i32 @DebugLogging(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Send command %s unimplemented\0A\00"
define void @send_command(i8* %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @DebugLogging(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}