xunge/DecIR huggingface dataset:
/* Variables and functions */
double bar(double, double, double, double, double);
double foo(double a) {
  return bar(1.0 / a, 2.0 / a, 4.0 / a, 8.0 / a, 16.0 / a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xefb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
divsd  -0x8(%rbp),%xmm2
movsd  0xebc(%rip),%xmm3
divsd  -0x8(%rbp),%xmm3
movsd  0xea7(%rip),%xmm4
divsd  -0x8(%rbp),%xmm4
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xee8(%rip),%xmm5
divsd  %xmm0,%xmm5
movsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  0xedc(%rip),%xmm3
divsd  %xmm0,%xmm3
movsd  0xed8(%rip),%xmm4
divsd  %xmm0,%xmm4
movapd %xmm5,%xmm0
jmp    1030 <bar@plt>

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fdiv double 2.000000e+00, %5
%7 = load double, double* %2
%8 = fdiv double 4.000000e+00, %7
%9 = load double, double* %2
%10 = fdiv double 8.000000e+00, %9
%11 = load double, double* %2
%12 = fdiv double 1.600000e+01, %11
%13 = call double @bar(double %4, double %6, double %8, double %10, double %12)
ret double %13
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fdiv double 2.000000e+00, %0
%4 = fdiv double 4.000000e+00, %0
%5 = fdiv double 8.000000e+00, %0
%6 = fdiv double 1.600000e+01, %0
%7 = tail call double @bar(double %2, double %3, double %4, double %5, double %6)
ret double %7
}
/* Variables and functions */
scalar_t__ isupper(int);
int toupper(int c) {
  if (isupper(c))
    return c;
  else
    return c - 32;
}


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

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmovne %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 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ pageins;

/* Variables and functions */
scalar_t__ sysctlbyname(char *, int /*<<< orphan*/ *, size_t *,
                        int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ warnx(char *);
u_int get_pageins(void) {
  u_int pageins;
  size_t len;
  len = sizeof(pageins);
  if (sysctlbyname("vm.stats.vm.v_swappgsin", &pageins, &len, NULL, 0) != 0) {
    warnx("v_swappgsin");
    return (0);
  }
  return pageins;
}


x86 assembly (clang, -O0):
<get_pageins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
cmp    $0x0,%rax
je     116d <get_pageins+0x4d>
lea    0xeb0(%rip),%rdi
call   1030 <warnx@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <get_pageins+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pageins>:
push   %rbx
sub    $0x10,%rsp
movq   $0x4,0x8(%rsp)
lea    0xecb(%rip),%rdi
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
test   %rax,%rax
je     115e <get_pageins+0x3e>
lea    0xeb5(%rip),%rdi
call   1030 <warnx@plt>
jmp    1162 <get_pageins+0x42>
mov    0x4(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"vm.stats.vm.v_swappgsin\00"
@.str.1 = [12 x i8] c"v_swappgsin\00"
define i32 @get_pageins() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 4, i64* %2
%5 = call i64 @sysctlbyname(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %1, i64* %2, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @warnx(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = load i32, i32* %1
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 0, %7 ], [ %10, %9 ]
ret i32 %12
}
int isascii(int c) { return (((c) & ~0x7f) == 0); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
float Ds18b20GetTemperatureFromInt(int temprInt) {
  int result;
  if (temprInt < 0) {
    result = temprInt - 1;
    result = ~temprInt;
    result = 0.0 - ((float)result * 0.0625);
  } else {
    result = (float)temprInt * 0.0625;
  }
  return result;
}


x86 assembly (clang, -O0):
<Ds18b20GetTemperatureFromInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1162 <Ds18b20GetTemperatureFromInt+0x62>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <Ds18b20GetTemperatureFromInt+0x7e>
cvtsi2ssl -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ds18b20GetTemperatureFromInt>:
test   %edi,%edi
js     1116 <Ds18b20GetTemperatureFromInt+0x16>
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
jmp    112f <Ds18b20GetTemperatureFromInt+0x2f>
not    %edi
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm1
mulsd  0xee0(%rip),%xmm1
xorps  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Ds18b20GetTemperatureFromInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = xor i32 %9, -1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %14, double 6.250000e-02, double 0.000000e+00)
%16 = fptosi double %15 to i32
store i32 %16, i32* %3
br label %23
17: ; preds = %1
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to float
%20 = fpext float %19 to double
%21 = fmul double %20, 6.250000e-02
%22 = fptosi double %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %17, %6
%24 = load i32, i32* %3
%25 = sitofp i32 %24 to float
ret float %25
}

LLVM IR (-O2):
define float @Ds18b20GetTemperatureFromInt(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 6.250000e-02, double 0.000000e+00)
br label %13
9: ; preds = %1
%10 = sitofp i32 %0 to float
%11 = fpext float %10 to double
%12 = fmul double %11, 6.250000e-02
br label %13
13: ; preds = %9, %3
%14 = phi double [ %8, %3 ], [ %12, %9 ]
%15 = fptosi double %14 to i32
%16 = sitofp i32 %15 to float
ret float %16
}
int apply(int (*opb)(int, int), int x, int y) { return opb(x, y); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @apply(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
void ice_s16s16(int x) {
  register long reg __asm("20");
  __asm volatile(" " ::"r"(reg = (long)x * x));
}


x86 assembly (clang, -O0):
<ice_s16s16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_s16s16>:
movslq %edi,%rax
imul   %rax,%rax
ret

LLVM IR (-O0):
define void @ice_s16s16(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %5, %7
store i64 %8, i64* %3
ret void
}

LLVM IR (-O2):
define void @ice_s16s16(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, %2
tail call void asm sideeffect " ", "r,~{dirflag},~{fpsr},~{flags}"(i64 %3)
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_epoll_context();
int /*<<< orphan*/ poll_inner(int /*<<< orphan*/, struct pollfd *,
                              int /*<<< orphan*/, unsigned long long,
                              int /*<<< orphan*/ *);
void doSleep(unsigned long long timeout_ms) {
  struct pollfd fds[1];
  poll_inner(get_epoll_context(), fds, 0, timeout_ms, NULL);
}


x86 assembly (clang, -O0):
<doSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_epoll_context@plt>
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <poll_inner@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSleep>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_epoll_context@plt>
lea    0x8(%rsp),%rsi
mov    %eax,%edi
xor    %edx,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1030 <poll_inner@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
define void @doSleep(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x %struct.pollfd]
store i64 %0, i64* %2
%4 = call i32 (...) @get_epoll_context()
%5 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i32 @poll_inner(i32 %4, %struct.pollfd* %5, i32 0, i64 %6, i32* null)
ret void
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define void @doSleep(i64 %0) {
%2 = alloca [1 x %struct.pollfd]
%3 = bitcast [1 x %struct.pollfd]* %2 to i8*
%4 = tail call i32 (...) @get_epoll_context()
%5 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %2, i64 0, i64 0
%6 = call i32 @poll_inner(i32 %4, %struct.pollfd* %5, i32 0, i64 %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ complement_dna(char *);
int /*<<< orphan*/ reverse(char *);
void revcomp_dna(char *seq) {
  complement_dna(seq);
  reverse(seq);
}


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

x86 assembly (clang, -O2):
<revcomp_dna>:
push   %rbx
mov    %rdi,%rbx
call   1040 <complement_dna@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @revcomp_dna(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @complement_dna(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @reverse(i8* %5)
ret void
}

LLVM IR (-O2):
define void @revcomp_dna(i8* %0) {
%2 = tail call i32 @complement_dna(i8* %0)
%3 = tail call i32 @reverse(i8* %0)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec bench_begin() {
  struct timespec ret;
  clock_gettime(CLOCK_MONOTONIC_RAW, &ret);
  return ret;
}


x86 assembly (clang, -O0):
<bench_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_begin>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @bench_begin() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @bench_begin() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ first_column(long **, long **);
int /*<<< orphan*/ transpose(long **);
void first_one_loop(long A[3][3], long P[3][3], long Q[3][3]) {
  first_column(A, P);
  transpose(A);
  first_column(A, Q);
  transpose(A);
}


x86 assembly (clang, -O0):
<first_one_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <first_column@plt>
mov    -0x8(%rbp),%rdi
call   1040 <transpose@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <first_column@plt>
mov    -0x8(%rbp),%rdi
call   1040 <transpose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_one_loop>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <first_column@plt>
mov    %rbx,%rdi
call   1040 <transpose@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <first_column@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <transpose@plt>

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

LLVM IR (-O2):
define void @first_one_loop([3 x i64]* %0, [3 x i64]* %1, [3 x i64]* %2) {
%4 = bitcast [3 x i64]* %0 to i64**
%5 = bitcast [3 x i64]* %1 to i64**
%6 = tail call i32 @first_column(i64** %4, i64** %5)
%7 = tail call i32 @transpose(i64** %4)
%8 = bitcast [3 x i64]* %2 to i64**
%9 = tail call i32 @first_column(i64** %4, i64** %8)
%10 = tail call i32 @transpose(i64** %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tprintf(char *, double, double, char *, double, double,
                           char *, char *);
void putBoxTextPictureHead(double px, double py, char *box, double sx,
                           double sy, char *boxPos, char *position) {
  tprintf("\\put(%3.4f,%3.4f){\\%s(%3.4f,%3.4f)%s{\\shortstack%s{\n", px, py,
          box, sx, sy, boxPos, position);
}


x86 assembly (clang, -O0):
<putBoxTextPictureHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
lea    0xea1(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putBoxTextPictureHead>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <tprintf@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\\put(%3.4f,%3.4f){\\%s(%3.4f,%3.4f)%s{\\shortstack%s{\0A\00"
define void @putBoxTextPictureHead(double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca i8*
%14 = alloca i8*
store double %0, double* %8
store double %1, double* %9
store i8* %2, i8** %10
store double %3, double* %11
store double %4, double* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load double, double* %8
%16 = load double, double* %9
%17 = load i8*, i8** %10
%18 = load double, double* %11
%19 = load double, double* %12
%20 = load i8*, i8** %13
%21 = load i8*, i8** %14
%22 = call i32 @tprintf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), double %15, double %16, i8* %17, double %18, double %19, i8* %20, i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"\\put(%3.4f,%3.4f){\\%s(%3.4f,%3.4f)%s{\\shortstack%s{\0A\00"
define void @putBoxTextPictureHead(double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6) {
%8 = tail call i32 @tprintf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6)
ret void
}
int intcompare(void *a, void *b) { return *((int *)a) == *((int *)b); }


x86 assembly (clang, -O0):
<intcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcompare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @intcompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @intcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int);
void heapsort(int arr[], int size) {
  int i;
  for (i = 0; i < size - 2; ++i)
    heapify(arr + i, size - i);
}


x86 assembly (clang, -O0):
<heapsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    115f <heapsort+0x4f>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <heapsort+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapsort>:
push   %r15
push   %r14
push   %rbx
cmp    $0x3,%esi
jl     1149 <heapsort+0x39>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x2(%r14),%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <heapify@plt>
add    $0xffffffff,%r14d
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <heapsort+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @heapsort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 2
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = add nsw i32 %1, -2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = trunc i64 %8 to i32
%11 = sub nsw i32 %1, %10
%12 = tail call i32 @heapify(i32* %9, i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _checked_write(int, int /*<<< orphan*/ *, int);
int _write_char(int fd, uint8_t c) { return _checked_write(fd, &c, 1); }


x86 assembly (clang, -O0):
<_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_checked_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_char>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_checked_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_write_char(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 = call i32 @_checked_write(i32 %5, i32* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @_write_char(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @_checked_write(i32 %0, i32* %3, i32 1)
ret i32 %4
}
void dl_G_SETKEYGB() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_SETKEYGB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
char *malloc(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char *mystr = malloc(sizeof(char) * 100);
  puts("> ");
  gets(mystr);
  puts(mystr);
  puts("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @gets(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @puts(i8* %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @gets(i8* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long microseconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000LL + tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<microseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @microseconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @microseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
long max_l(long n1, long n2) {
  if (n1 > n2)
    return n1;
  else
    return n2;
}


x86 assembly (clang, -O0):
<max_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max_l+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max_l+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_l>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_l(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int tagBitsTest() { return 0; }


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

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

LLVM IR (-O0):
define i32 @tagBitsTest() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tagBitsTest() {
ret i32 0
}
/* Variables and functions */
float sinf(float);
float _sinf(float x) { return sinf(x); }


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

x86 assembly (clang, -O2):
<_sinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @_sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ delay();
void nand_wait_idle(void) {
  int i = 0;
  while (!((*(volatile unsigned long *)(0x70200000 + 0x28)) & 0x1))
    delay();
}


x86 assembly (clang, -O0):
<nand_wait_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x70200028,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1141 <nand_wait_idle+0x31>
jmp    114d <nand_wait_idle+0x3d>
mov    $0x0,%al
call   1030 <delay@plt>
jmp    111f <nand_wait_idle+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_wait_idle>:
push   %rax
mov    0x70200028,%rax
70
test   $0x1,%al
jne    1135 <nand_wait_idle+0x25>
nopl   (%rax)
xor    %eax,%eax
call   1030 <delay@plt>
testq  $0x1,0x70200028
je     1120 <nand_wait_idle+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @nand_wait_idle() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load volatile i64, i64* inttoptr (i64 1881145384 to i64*)
%4 = and i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @delay()
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @nand_wait_idle() {
%1 = load volatile i64, i64* inttoptr (i64 1881145384 to i64*)
%2 = and i64 %1, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @delay()
%6 = load volatile i64, i64* inttoptr (i64 1881145384 to i64*)
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *p = 0;
  printf("pid = %d\n", getpid());
  printf("char = %c\n", *p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
movsbl %al,%esi
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pid = %d\0A\00"
@.str.1 = [11 x i8] c"char = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i32 (...) @getpid()
%4 = trunc i32 %3 to i8
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid = %d\0A\00"
@.str.1 = [11 x i8] c"char = %c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = trunc i32 %1 to i8
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void log_start(void) { openlog("mountd", LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<log_start>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_start>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"mountd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_start() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"mountd\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_start() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_DAEMON
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int no() {
  printf("No, It is not Possible to make a Profit!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"No, It is not Possible to make a Profit!\0A\00"
define i32 @no() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"No, It is not Possible to make a Profit!\00"
define i32 @no() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int has_altivec(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @has_altivec() {
ret i32 1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ psprio();
int main(int argc, char **argv) {
  psprio();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <psprio@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <psprio@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @psprio()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ flags;

/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              void *, int);
int setup_socket(int fd) {
  int flags = 1;
  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
  return (fcntl(fd, F_SETFL, O_NONBLOCK) != -1);
}


x86 assembly (clang, -O0):
<setup_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    -0x4(%rbp),%edi
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_socket>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1040 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setup_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
%9 = load i32, i32* %2
%10 = load i32, i32* @F_SETFL
%11 = load i32, i32* @O_NONBLOCK
%12 = call i32 @fcntl(i32 %9, i32 %10, i32 %11)
%13 = icmp ne i32 %12, -1
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setup_socket(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* @O_NONBLOCK
%9 = call i32 @fcntl(i32 %0, i32 %7, i32 %8)
%10 = icmp ne i32 %9, -1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
float atanhf(float);
float __ocl_atanh_float(float src) { return atanhf(src); }


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

x86 assembly (clang, -O2):
<__ocl_atanh_float>:
jmp    1030 <atanhf@plt>

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

LLVM IR (-O2):
define float @__ocl_atanh_float(float %0) {
%2 = tail call float @atanhf(float %0)
ret float %2
}
int func4() { return 4; }


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

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

LLVM IR (-O0):
define i32 @func4() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func4() {
ret i32 4
}
__attribute__((no_address_safety_analysis)) int f1(int *p, int *q) {
  *p = 42;
  return *q;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movl   $0x2a,(%rdi)
mov    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @f1(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
store i32 42, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1(i32* nocapture writeonly %0, i32* nocapture %1) {
store i32 42, i32* %0
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putrest() {
  printf("\033*rB");
  printf("\033E");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B*rB\00"
@.str.1 = [3 x i8] c"\1BE\00"
define void @putrest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B*rB\00"
@.str.1 = [3 x i8] c"\1BE\00"
define void @putrest() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int min(int a, int b, int c) {
  int m = a;
  if (m > b)
    m = b;
  if (m > c)
    m = c;
  return m;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1125 <min+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1137 <min+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
int main(int argc, char *argv[]) { yyparse(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @yyparse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
ret i32 0
}
void deallocateDoubleMatrix(double **Matrix, long RowStartIndex,
                            long RowEndIndex, long ColStartIndex,
                            long ColEndIndex) {
  free(Matrix[RowStartIndex] + ColStartIndex - 1);
  free(Matrix + RowStartIndex - 1);
}


x86 assembly (clang, -O0):
<deallocateDoubleMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocateDoubleMatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocateDoubleMatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds double*, double** %6, i64 -1
%12 = bitcast double** %11 to i8*
tail call void @free(i8* %12)
ret void
}