xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x8f() {
  Assert_real((isalnum(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              720, ("isalnum should be 0 for 0x8f"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x8f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8f,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8f\00"
define void @t_isalnum_0x8f() {
%1 = call i64 @isalnum(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8f\00"
define void @t_isalnum_0x8f() {
%1 = tail call i64 @isalnum(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ICCalculateDeputyWealth(int, int);
int main(int argc, const char *argv[]) {
  ICCalculateDeputyWealth(1000, 1200000);
  return 0;
}


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    $0x3e8,%edi
mov    $0x124f80,%esi
call   1030 <ICCalculateDeputyWealth@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
mov    $0x124f80,%esi
call   1030 <ICCalculateDeputyWealth@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICCalculateDeputyWealth(i32 1000, i32 1200000)
ret i32 0
}
/* Variables and functions */
double const fabs(double const);
int coco_double_almost_equal(const double a, const double b,
                             const double precision) {
  return (fabs(a - b) < precision);
}


x86 assembly (clang, -O0):
<coco_double_almost_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_double_almost_equal>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @coco_double_almost_equal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @fabs(double %9)
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @coco_double_almost_equal(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
signed long signedlong_ignoring_unsignedchar(signed long x, unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlong_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedlong_ignoring_unsignedchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlong_ignoring_unsignedchar(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
double InGamma(long, double);
double cdfPoisson(double m, long x) { return (1.0 - InGamma(x + 1, m)); }


x86 assembly (clang, -O0):
<cdfPoisson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
movsd  -0x8(%rbp),%xmm0
call   1030 <InGamma@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfPoisson>:
push   %rax
add    $0x1,%rdi
call   1030 <InGamma@plt>
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cdfPoisson(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 1
%7 = load double, double* %3
%8 = call double @InGamma(i64 %6, double %7)
%9 = fsub double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @cdfPoisson(double %0, i64 %1) {
%3 = add nsw i64 %1, 1
%4 = tail call double @InGamma(i64 %3, double %0)
%5 = fsub double 1.000000e+00, %4
ret double %5
}
/* Type definitions */
struct mloop_work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__ref_any(struct mloop_work *);
__attribute__((visibility("default"))) void
mloop_work_ref(struct mloop_work *self) {
  mloop__ref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_work_ref>:
jmp    1030 <mloop__ref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_work = type { i32 }
define void @mloop_work_ref(%struct.mloop_work* %0) {
%2 = tail call i32 @mloop__ref_any(%struct.mloop_work* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int match_exe(const char *a, const char *b) {
  if (!a || !b)
    return 0;
  return strcmp(a, b) == 0;
}


x86 assembly (clang, -O0):
<match_exe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <match_exe+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <match_exe+0x32>
movl   $0x0,-0x4(%rbp)
jmp    115e <match_exe+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_exe>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <match_exe+0x21>
test   %rsi,%rsi
je     1131 <match_exe+0x21>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @match_exe(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
int main() {
  struct timespec tim, tim2;
  tim.tv_sec = 1;
  tim.tv_nsec = 500;
  nanosleep(&tim, &tim2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1f4,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x1f400000001,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <nanosleep@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 500, i32* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @main() {
%1 = alloca %struct.timespec
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %1 to i8*
%4 = bitcast %struct.timespec* %2 to i8*
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 500, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %1, %struct.timespec* %2)
ret i32 0
}
void foo813(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo813(i32 %0) {
ret void
}
float divide_by_10(int i) { return (float)i / 10; }


x86 assembly (clang, -O0):
<divide_by_10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xeec(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_by_10>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @divide_by_10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fdiv float %4, 1.000000e+01
ret float %5
}

LLVM IR (-O2):
define float @divide_by_10(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fdiv float %2, 1.000000e+01
ret float %3
}
int c024(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c024() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Nokia5110_Clear();
void Output_Clear(void) { Nokia5110_Clear(); }


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

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

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

LLVM IR (-O2):
define void @Output_Clear() {
%1 = tail call i32 (...) @Nokia5110_Clear()
ret void
}
char *_Locale_extract_ctype_name(const char *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_extract_ctype_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_extract_ctype_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, int *, int);
int getchar(void) {
  int c = 0;
  read(0, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getchar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @read(i32 0, i32* %1, i32 1)
%4 = load i32, i32* %1
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_qpel_hv64_12_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @mach_tegra_reset() {
ret void
}
OP(ed, ef) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (!p) {
    fprintf(stderr, "Memory is too low\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


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    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Memory is too low\0A\00"
@EXIT_FAILURE = global i32 0
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 ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Memory is too low\0A\00"
@EXIT_FAILURE = global i32 0
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 %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void serial_init() {
  outb(0x3F8 + 1, 0x00);
  outb(0x3F8 + 3, 0x80);
  outb(0x3F8 + 0, 0x03);
  outb(0x3F8 + 1, 0x00);
  outb(0x3F8 + 3, 0x03);
  outb(0x3F8 + 2, 0xC7);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rax
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_init() {
%1 = call i32 @outb(i32 1017, i32 0)
%2 = call i32 @outb(i32 1019, i32 128)
%3 = call i32 @outb(i32 1016, i32 3)
%4 = call i32 @outb(i32 1017, i32 0)
%5 = call i32 @outb(i32 1019, i32 3)
%6 = call i32 @outb(i32 1018, i32 199)
ret void
}

LLVM IR (-O2):
define void @serial_init() {
%1 = tail call i32 @outb(i32 1017, i32 0)
%2 = tail call i32 @outb(i32 1019, i32 128)
%3 = tail call i32 @outb(i32 1016, i32 3)
%4 = tail call i32 @outb(i32 1017, i32 0)
%5 = tail call i32 @outb(i32 1019, i32 3)
%6 = tail call i32 @outb(i32 1018, i32 199)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int bt_malloc(void **ptr, size_t size) {
  *ptr = malloc(size);
  if (*ptr || !size)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<bt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114c <bt_malloc+0x3c>
cmpq   $0x0,-0x18(%rbp)
jne    1158 <bt_malloc+0x48>
movl   $0x0,-0x4(%rbp)
jmp    115f <bt_malloc+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
sete   %al
test   %rbx,%rbx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @bt_malloc(i8** nocapture writeonly %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
store i8* %3, i8** %0
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
double erf(double);
int /*<<< orphan*/ printf(char *, double);
double sqrt(int);
int main(int argc, char *argv[]) {
  printf("The integral of Normal(0, 1) distribution"
         "bettween -1.96 and 1.96 is %g\n",
         erf(1.96 * sqrt(1 / 2.)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <erf@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <sqrt@plt>
mulsd  0xec0(%rip),%xmm0
call   1050 <erf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"The integral of Normal(0, 1) distributionbettween -1.96 and 1.96 is %g\0A\00"
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 double @sqrt(i32 0)
%6 = fmul double 1.960000e+00, %5
%7 = call double @erf(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"The integral of Normal(0, 1) distributionbettween -1.96 and 1.96 is %g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @sqrt(i32 0)
%4 = fmul double %3, 1.960000e+00
%5 = tail call double @erf(double %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ noqiflush();
void wrap_noqiflush(void) { noqiflush(); }


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

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

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

LLVM IR (-O2):
define void @wrap_noqiflush() {
%1 = tail call i32 (...) @noqiflush()
ret void
}
int jac_chain_nm9_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm9_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <jac_chain_nm9_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm9_alloc>:
test   %rdi,%rdi
je     110c <jac_chain_nm9_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm9_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
char *pckt_fix_path(char *path) {
  char *dirsep;
  if (path) {
    while ((dirsep = strchr(path, '\\')))
      *dirsep = '/';
  }
  return path;
}


x86 assembly (clang, -O0):
<pckt_fix_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <pckt_fix_path+0x49>
jmp    112c <pckt_fix_path+0x1c>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1154 <pckt_fix_path+0x44>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
jmp    112c <pckt_fix_path+0x1c>
jmp    1159 <pckt_fix_path+0x49>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pckt_fix_path>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1137 <pckt_fix_path+0x27>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1137 <pckt_fix_path+0x27>
movb   $0x2f,(%rax)
jmp    1120 <pckt_fix_path+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @pckt_fix_path(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strchr(i8* %0, i8 signext 92)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %4, %3 ]
store i8 47, i8* %7
%8 = tail call i8* @strchr(i8* %0, i8 signext 92)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int newDbGetLastupdateDevicesDev(int, int);
int newDbGetLastupdatePlug(void) { return newDbGetLastupdateDevicesDev(7, 7); }


x86 assembly (clang, -O0):
<newDbGetLastupdatePlug>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%esi
mov    %esi,%edi
call   1030 <newDbGetLastupdateDevicesDev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbGetLastupdatePlug>:
mov    $0x7,%edi
mov    $0x7,%esi
jmp    1030 <newDbGetLastupdateDevicesDev@plt>

LLVM IR (-O0):
define i32 @newDbGetLastupdatePlug() {
%1 = call i32 @newDbGetLastupdateDevicesDev(i32 7, i32 7)
ret i32 %1
}

LLVM IR (-O2):
define i32 @newDbGetLastupdatePlug() {
%1 = tail call i32 @newDbGetLastupdateDevicesDev(i32 7, i32 7)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dimacs_find_next_character(int /*<<< orphan*/);
int /*<<< orphan*/ get_symbol();
void dimacs_get_symbol() {
  dimacs_find_next_character(0);
  get_symbol();
}


x86 assembly (clang, -O0):
<dimacs_get_symbol>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <dimacs_find_next_character@plt>
mov    $0x0,%al
call   1040 <get_symbol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dimacs_get_symbol>:
push   %rax
xor    %edi,%edi
call   1030 <dimacs_find_next_character@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_symbol@plt>

LLVM IR (-O0):
define void @dimacs_get_symbol() {
%1 = call i32 @dimacs_find_next_character(i32 0)
%2 = call i32 (...) @get_symbol()
ret void
}

LLVM IR (-O2):
define void @dimacs_get_symbol() {
%1 = tail call i32 @dimacs_find_next_character(i32 0)
%2 = tail call i32 (...) @get_symbol()
ret void
}
void pdri_(x, y, z) int *x, *y, *z;
{ pdr((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<pdri_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
cvtsi2ssl (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pdr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdri_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtsi2ssl (%rdx),%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pdr@plt>

LLVM IR (-O0):
define void @pdri_(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to double
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @pdri_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %6, double %9, double %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void ft_print_alphabet(void) {
  char c;
  c = '0';
  while (c <= '9') {
    putchar(c);
    c++;
  }
  return;
}


x86 assembly (clang, -O0):
<ft_print_alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     113f <ft_print_alphabet+0x2f>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <ft_print_alphabet+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_alphabet>:
push   %rax
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
mov    $0x35,%edi
call   1030 <putchar@plt>
mov    $0x36,%edi
call   1030 <putchar@plt>
mov    $0x37,%edi
call   1030 <putchar@plt>
mov    $0x38,%edi
call   1030 <putchar@plt>
mov    $0x39,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @ft_print_alphabet() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i8, i8* %1
%8 = call i32 @putchar(i8 signext %7)
%9 = load i8, i8* %1
%10 = add i8 %9, 1
store i8 %10, i8* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ft_print_alphabet() {
%1 = tail call i32 @putchar(i8 signext 48)
%2 = tail call i32 @putchar(i8 signext 49)
%3 = tail call i32 @putchar(i8 signext 50)
%4 = tail call i32 @putchar(i8 signext 51)
%5 = tail call i32 @putchar(i8 signext 52)
%6 = tail call i32 @putchar(i8 signext 53)
%7 = tail call i32 @putchar(i8 signext 54)
%8 = tail call i32 @putchar(i8 signext 55)
%9 = tail call i32 @putchar(i8 signext 56)
%10 = tail call i32 @putchar(i8 signext 57)
ret void
}
/* Type definitions */
struct mspack_system {
  int dummy;
};

/* Variables and functions */
void *appMalloc(size_t);
void *mspack_alloc(struct mspack_system *self, size_t bytes) {
  (void)self;
  return appMalloc(bytes);
}


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

x86 assembly (clang, -O2):
<mspack_alloc>:
mov    %rsi,%rdi
jmp    1030 <appMalloc@plt>

LLVM IR (-O0):
%struct.mspack_system = type { i32 }
define i8* @mspack_alloc(%struct.mspack_system* %0, i64 %1) {
%3 = alloca %struct.mspack_system*
%4 = alloca i64
store %struct.mspack_system* %0, %struct.mspack_system** %3
store i64 %1, i64* %4
%5 = load %struct.mspack_system*, %struct.mspack_system** %3
%6 = load i64, i64* %4
%7 = call i8* @appMalloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.mspack_system = type { i32 }
define i8* @mspack_alloc(%struct.mspack_system* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @appMalloc(i64 %1)
ret i8* %3
}
void pkg_argv_free(char **argv) {
  free(argv[0]);
  free(argv);
}


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

x86 assembly (clang, -O2):
<pkg_argv_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pkg_argv_free(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = bitcast i8** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @pkg_argv_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = bitcast i8** %0 to i8*
tail call void @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_run_from_build_tree() {
  printf("NOT IMPLEMENTED:"
         "pa_run_from_build_tree"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_run_from_build_tree\0A\00"
define i32 @pa_run_from_build_tree() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_run_from_build_tree\00"
define i32 @pa_run_from_build_tree() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  free(*ap);
  *ap = (NULL);
}


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

x86 assembly (clang, -O2):
<ft_memdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_memdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int get_char_utf8(char const **);
int peek_char_utf8(const char *_src) {
  const char *src = _src;
  return get_char_utf8(&src);
}


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

x86 assembly (clang, -O2):
<peek_char_utf8>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <get_char_utf8@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @peek_char_utf8(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 @get_char_utf8(i8** %2)
ret i32 %4
}
int test_imm_45int64_lowword_mem(long long *val) {
  return ((*val) & (0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x45,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45int64_lowword_mem>:
testb  $0x45,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 69
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_45int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 69
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int lock_fn(void *handle) {
  pthread_mutex_t *mutex = (pthread_mutex_t *)handle;
  if (mutex)
    return pthread_mutex_lock(mutex);
  else
    return 0;
}


x86 assembly (clang, -O0):
<lock_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <lock_fn+0x30>
mov    -0x18(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <lock_fn+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_fn>:
test   %rdi,%rdi
je     111a <lock_fn+0xa>
jmp    1030 <pthread_mutex_lock@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lock_fn(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @pthread_mutex_lock(i32* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
int get_command_len(const char *norm_str) {
  int len = 0;
  const char *pin = norm_str;
  while ((*pin) && (*pin != ' ')) {
    len++;
    pin++;
  }
  return len;
}


x86 assembly (clang, -O0):
<get_command_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <get_command_len+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <get_command_len+0x4c>
jmp    1166 <get_command_len+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <get_command_len+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_command_len>:
xor    %eax,%eax
testb  $0xdf,(%rdi,%rax,1)
je     111a <get_command_len+0x1a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
testb  $0xdf,(%rdi,%rax,1)
jne    1110 <get_command_len+0x10>
ret

LLVM IR (-O0):
define i32 @get_command_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %18, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 32
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %23
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %6
23: ; preds = %16
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_command_len(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %7, %6 ]
%4 = phi i8* [ %0, %1 ], [ %8, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %9
i8 32, label %9
]
6: ; preds = %2
%7 = add nuw nsw i32 %3, 1
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
9: ; preds = %2, %2
ret i32 %3
}
int count_one_bits(unsigned value) {
  int ones;
  for (ones = 0; value != 0; value = value >> 1)
    if (value % 2 != 0)
      ones = ones + 1;
  return ones;
}


x86 assembly (clang, -O0):
<count_one_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <count_one_bits+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <count_one_bits+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <count_one_bits+0x35>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_one_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_one_bits>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <count_one_bits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_one_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_one_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
int do_sub(int av1, int av3) { return (av1 - av3); }


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

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

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

LLVM IR (-O2):
define i32 @do_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ rbyte(int);
uint8_t rb(uint16_t *addr) {
  uint8_t val = rbyte(*addr);
  *addr += 1;
  return val;
}


x86 assembly (clang, -O0):
<rb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <rbyte@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <rbyte@plt>
addl   $0x1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rb(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @rbyte(i32 %2)
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
store i32 %5, i32* %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ vmi_cpuid(unsigned int, unsigned int *, unsigned int *,
                             unsigned int *, unsigned int *);
unsigned int cpuid_ebx(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  vmi_cpuid(op, &eax, &ebx, &ecx, &edx);
  return ebx;
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <vmi_cpuid@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <vmi_cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @vmi_cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %3
ret i32 %11
}