xunge/DecIR huggingface dataset:
/* Variables and functions */
int cos(double);
int sin(double);
double fz(double *y, double t, double *par) {
  return -sin(y[0]) / (1. + cos(y[0]) * cos(y[0]));
}


x86 assembly (clang, -O0):
<fz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <cos@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <cos@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe79(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <sin@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rbx),%xmm0
call   1040 <cos@plt>
mov    %eax,%ebp
movsd  (%rbx),%xmm0
call   1040 <cos@plt>
imul   %ebp,%eax
cvtsi2sd %eax,%xmm1
addsd  0xea0(%rip),%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @fz(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 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = call i32 @sin(double %9)
%11 = sub nsw i32 0, %10
%12 = sitofp i32 %11 to double
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = call i32 @cos(double %15)
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = call i32 @cos(double %19)
%21 = mul nsw i32 %16, %20
%22 = sitofp i32 %21 to double
%23 = fadd double 1.000000e+00, %22
%24 = fdiv double %12, %23
ret double %24
}

LLVM IR (-O2):
define double @fz(double* nocapture %0, double %1, double* nocapture readnone %2) {
%4 = load double, double* %0
%5 = tail call i32 @sin(double %4)
%6 = sub nsw i32 0, %5
%7 = sitofp i32 %6 to double
%8 = load double, double* %0
%9 = tail call i32 @cos(double %8)
%10 = load double, double* %0
%11 = tail call i32 @cos(double %10)
%12 = mul nsw i32 %11, %9
%13 = sitofp i32 %12 to double
%14 = fadd double %13, 1.000000e+00
%15 = fdiv double %7, %14
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_SETFPREGS;
int errno;
scalar_t__ ptrace(int /*<<< orphan*/, long, int /*<<< orphan*/,
                  unsigned long *);
int ptrace_setfpregs(long pid, unsigned long *regs) {
  if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_setfpregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1155 <ptrace_setfpregs+0x45>
xor    %eax,%eax
mov    0x2e95(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <ptrace_setfpregs+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_setfpregs>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ptrace@plt>
mov    0x2eb0(%rip),%rcx
sub    (%rcx),%ebx
sar    $0x3f,%rax
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PTRACE_SETFPREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_setfpregs(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i32, i32* @PTRACE_SETFPREGS
%7 = load i64, i64* %4
%8 = load i64*, i64** %5
%9 = call i64 @ptrace(i32 %6, i64 %7, i32 0, i64* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@PTRACE_SETFPREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_setfpregs(i64 %0, i64* %1) {
%3 = load i32, i32* @PTRACE_SETFPREGS
%4 = tail call i64 @ptrace(i32 %3, i64 %0, i32 0, i64* %1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fftss_cleanup_threads();
void fftss_cleanup_threads_(void) { fftss_cleanup_threads(); }


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

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

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

LLVM IR (-O2):
define void @fftss_cleanup_threads_() {
%1 = tail call i32 (...) @fftss_cleanup_threads()
ret void
}
void psync_pagecache_resize_cache() {}


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

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

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

LLVM IR (-O2):
define void @psync_pagecache_resize_cache() {
ret void
}
char num_to_char(int num) { return num + 48; }


x86 assembly (clang, -O0):
<num_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_char>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @num_to_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @num_to_char(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
double exp(double);
double rndt2();
double rndlogt2(double loc, double s) {
  double t2 = rndt2(), logt2 = 1E300;
  if (t2 < 800)
    logt2 = exp(loc + s * t2);
  return (logt2);
}


x86 assembly (clang, -O0):
<rndlogt2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rndt2@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xead(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117f <rndlogt2+0x5f>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndlogt2>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <rndt2@plt>
movsd  0xec1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1162 <rndlogt2+0x42>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>
movsd  0xe9e(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rndlogt2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @rndt2()
store double %7, double* %5
store double 1.000000e+300, double* %6
%8 = load double, double* %5
%9 = fcmp olt double %8, 8.000000e+02
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %5
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %11)
%15 = call double @exp(double %14)
store double %15, double* %6
br label %16
16: ; preds = %10, %2
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @rndlogt2(double %0, double %1) {
%3 = tail call double (...) @rndt2()
%4 = fcmp olt double %3, 8.000000e+02
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
%7 = tail call double @exp(double %6)
br label %8
8: ; preds = %5, %2
%9 = phi double [ %7, %5 ], [ 1.000000e+300, %2 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_regt_op();
int /*<<< orphan*/ arm_memio_strbt(int /*<<< orphan*/);
void arm_strbt_reg() { arm_memio_strbt(arm_memio_regt_op()); }


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

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

LLVM IR (-O0):
define void @arm_strbt_reg() {
%1 = call i32 (...) @arm_memio_regt_op()
%2 = call i32 @arm_memio_strbt(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_strbt_reg() {
%1 = tail call i32 (...) @arm_memio_regt_op()
%2 = tail call i32 @arm_memio_strbt(i32 %1)
ret void
}
void EXTI4_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @EXTI4_IRQHandler() {
ret void
}
void fancy_svg_text(int x, int y, char *str, int size, int font) {}


x86 assembly (clang, -O0):
<fancy_svg_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fancy_svg_text(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @fancy_svg_text(i32 %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void __print_padding(uint64_t size, char c) {
  uint64_t i;
  for (i = 0; i < size; i++) {
    printf("%c", c);
  }
}


x86 assembly (clang, -O0):
<__print_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1159 <__print_padding+0x49>
lea    0xec1(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <__print_padding+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__print_padding>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
jle    1140 <__print_padding+0x30>
mov    %rdi,%rbx
movsbl %sil,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <__print_padding+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @__print_padding(i64 %0, i8 signext %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
void child(void) {
  printf("Child running...\n");
  while (1) {
    pause();
    printf("Continued...\n");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1130 <child+0x10>

x86 assembly (clang, -O2):
<child>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <pause@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <child+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"Child running...\0A\00"
@.str.1 = [14 x i8] c"Continued...\0A\00"
define void @child() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @pause()
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [17 x i8] c"Child running...\00"
@str.2 = [13 x i8] c"Continued...\00"
define void @child() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @pause()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
br label %2
}
long math__Int__bin_xor(long self, long p0) {
  long var;
  long var1;
  var1 = (self ^ p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

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

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

LLVM IR (-O2):
define i64 @math__Int__bin_xor(i64 %0, i64 %1) {
%3 = xor i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int n;
  int sum;
  assume(i == 0 && n >= 0 && n <= 100 && sum == 0);
  while (i < n) {
    sum = sum + i;
    i++;
  }
  assert(sum >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1166 <main+0x46>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jl     1166 <main+0x46>
xor    %eax,%eax
cmpl   $0x64,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jg     1166 <main+0x46>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1196 <main+0x76>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <main+0x53>
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 100
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %13, %10, %7, %0
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assume(i32 %18)
br label %20
20: ; preds = %24, %16
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = add nsw i32 %25, %26
store i32 %27, i32* %4
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %20
30: ; preds = %20
%31 = load i32, i32* %4
%32 = icmp sge i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *path_ending(char *path) {
  char *c = path + strlen(path);
  while (*(c - 1) != '/' && c > path)
    c--;
  return c;
}


x86 assembly (clang, -O0):
<path_ending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x19(%rbp)
je     1161 <path_ending+0x51>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1171 <path_ending+0x61>
jmp    1182 <path_ending+0x72>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <path_ending+0x2d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_ending>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
add    %rbx,%rcx
nop
lea    -0x1(%rcx),%rax
cmpb   $0x2f,-0x1(%rcx)
je     1132 <path_ending+0x22>
cmp    %rbx,%rcx
mov    %rax,%rcx
ja     1120 <path_ending+0x10>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @path_ending(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %4, %1 ], [ %7, %5 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 47
%10 = icmp ugt i8* %6, %0
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %5, label %12
12: ; preds = %5
ret i8* %6
}
int ukvm_gdb_enable_ss(struct ukvm_hv *hv) { return -1; }


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

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

LLVM IR (-O0):
%struct.ukvm_hv = type opaque
define i32 @ukvm_gdb_enable_ss(%struct.ukvm_hv* %0) {
%2 = alloca %struct.ukvm_hv*
store %struct.ukvm_hv* %0, %struct.ukvm_hv** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.ukvm_hv = type opaque
define i32 @ukvm_gdb_enable_ss(%struct.ukvm_hv* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ closeobj();
void closeobj_() { closeobj(); }


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

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

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

LLVM IR (-O2):
define void @closeobj_() {
%1 = tail call i32 (...) @closeobj()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
main() { exit(L'1' != L'1'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ func(char *, char *);
int main(void) {
  func("tete", "tetefenife");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"tete\00"
@.str.1 = [11 x i8] c"tetefenife\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"tete\00"
@.str.1 = [11 x i8] c"tetefenife\00"
define i32 @main() {
%1 = tail call i32 @func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _abort(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
void abort() { _abort(errno); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <_abort@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <_abort@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @abort() {
%1 = load i32, i32* @errno
%2 = call i32 @_abort(i32 %1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
define void @abort() {
%1 = load i32, i32* @errno
%2 = tail call i32 @_abort(i32 %1)
unreachable
}
int uwsgi_cheaper_algo_manual(int can_spawn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uwsgi_cheaper_algo_manual(i32 %0) {
ret i32 0
}
int __android_log_print(int prio, const char *tag, const char *fmt, ...) {
  return 1;
}


x86 assembly (clang, -O0):
<__android_log_print>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__android_log_print(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 1
}

LLVM IR (-O2):
define i32 @__android_log_print(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, ...) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free_all(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
void cleanup(SSL_CTX *ctx, BIO *bio) {
  SSL_CTX_free(ctx);
  BIO_free_all(bio);
}


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

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %rsi,%rbx
call   1030 <SSL_CTX_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <BIO_free_all@plt>

LLVM IR (-O0):
define void @cleanup(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 @SSL_CTX_free(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @BIO_free_all(i32* %7)
ret void
}

LLVM IR (-O2):
define void @cleanup(i32* %0, i32* %1) {
%3 = tail call i32 @SSL_CTX_free(i32* %0)
%4 = tail call i32 @BIO_free_all(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpb_clear_screen();
int /*<<< orphan*/ mpb_recreate_passwd();
int mpb_preference(void) {
  mpb_clear_screen();
  mpb_recreate_passwd();
  return 0;
}


x86 assembly (clang, -O0):
<mpb_preference>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mpb_clear_screen@plt>
mov    $0x0,%al
call   1030 <mpb_recreate_passwd@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpb_preference>:
push   %rax
xor    %eax,%eax
call   1040 <mpb_clear_screen@plt>
xor    %eax,%eax
call   1030 <mpb_recreate_passwd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mpb_preference() {
%1 = call i32 (...) @mpb_clear_screen()
%2 = call i32 (...) @mpb_recreate_passwd()
ret i32 0
}

LLVM IR (-O2):
define i32 @mpb_preference() {
%1 = tail call i32 (...) @mpb_clear_screen()
%2 = tail call i32 (...) @mpb_recreate_passwd()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *unique_device_id(void) {
  const uint8_t *addr = (const uint8_t *)0x1ffff7e8;
  return addr;
}


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

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

LLVM IR (-O0):
define i32* @unique_device_id() {
%1 = alloca i32*
store i32* inttoptr (i64 536868840 to i32*), i32** %1
%2 = load i32*, i32** %1
ret i32* %2
}

LLVM IR (-O2):
define i32* @unique_device_id() {
ret i32* inttoptr (i64 536868840 to i32*)
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ lcd_port_config();
int /*<<< orphan*/ lcd_set_4bit();
int /*<<< orphan*/ lcd_wr_command(int);
void lcd_init() {
  lcd_port_config();
  lcd_set_4bit();
  _delay_ms(1);
  lcd_wr_command(0x28);
  lcd_wr_command(0x01);
  lcd_wr_command(0x06);
  lcd_wr_command(0x0E);
  lcd_wr_command(0x80);
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lcd_port_config@plt>
mov    $0x0,%al
call   1030 <lcd_set_4bit@plt>
mov    $0x1,%edi
call   1050 <_delay_ms@plt>
mov    $0x28,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1060 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x80,%edi
call   1060 <lcd_wr_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
xor    %eax,%eax
call   1040 <lcd_port_config@plt>
xor    %eax,%eax
call   1030 <lcd_set_4bit@plt>
mov    $0x1,%edi
call   1050 <_delay_ms@plt>
mov    $0x28,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1060 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x80,%edi
pop    %rax
jmp    1060 <lcd_wr_command@plt>

LLVM IR (-O0):
define void @lcd_init() {
%1 = call i32 (...) @lcd_port_config()
%2 = call i32 (...) @lcd_set_4bit()
%3 = call i32 @_delay_ms(i32 1)
%4 = call i32 @lcd_wr_command(i32 40)
%5 = call i32 @lcd_wr_command(i32 1)
%6 = call i32 @lcd_wr_command(i32 6)
%7 = call i32 @lcd_wr_command(i32 14)
%8 = call i32 @lcd_wr_command(i32 128)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 (...) @lcd_port_config()
%2 = tail call i32 (...) @lcd_set_4bit()
%3 = tail call i32 @_delay_ms(i32 1)
%4 = tail call i32 @lcd_wr_command(i32 40)
%5 = tail call i32 @lcd_wr_command(i32 1)
%6 = tail call i32 @lcd_wr_command(i32 6)
%7 = tail call i32 @lcd_wr_command(i32 14)
%8 = tail call i32 @lcd_wr_command(i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xc3() {
  Assert_real((isxdigit(195) == 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_isxdigit.c",
              980, ("isxdigit should be 0 for 0xc3"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3d4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc3\00"
define void @t_isxdigit_0xc3() {
%1 = call i64 @isxdigit(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc3\00"
define void @t_isxdigit_0xc3() {
%1 = tail call i64 @isxdigit(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void drop(int dropstatus, char *dropdesc) {
  if (dropstatus == -1) {
    perror(dropdesc);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    114c <drop+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop>:
cmp    $0xffffffff,%edi
je     1126 <drop+0x6>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @drop(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int close(int);
int minstack_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<minstack_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @minstack_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void send_success_message_to_wcm() {
  fprintf(stderr, "INFO: sending success message to WCM\n");
}


x86 assembly (clang, -O0):
<send_success_message_to_wcm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_success_message_to_wcm>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"INFO: sending success message to WCM\0A\00"
define void @send_success_message_to_wcm() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"INFO: sending success message to WCM\0A\00"
define void @send_success_message_to_wcm() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
char trace_char(char x) {
  printf("%c\n", x);
  return x;
}


x86 assembly (clang, -O0):
<trace_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_char>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define signext i8 @trace_char(i8 returned signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret i8 %0
}
/* Type definitions */
struct sembuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Error(char *);
int semop(int, struct sembuf *, unsigned int);
int Semop(int semid, struct sembuf *sops, unsigned nsops) {
  int x = semop(semid, sops, nsops);
  if (x < 0) {
    Error("Error on semop");
  }
  return x;
}


x86 assembly (clang, -O0):
<Semop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <semop@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <Semop+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <Error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Semop>:
push   %rbx
call   1040 <semop@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Semop+0x18>
lea    0xecd(%rip),%rdi
call   1030 <Error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sembuf = type { i32 }
@.str = [15 x i8] c"Error on semop\00"
define i32 @Semop(i32 %0, %struct.sembuf* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sembuf*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sembuf* %1, %struct.sembuf** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sembuf*, %struct.sembuf** %5
%10 = load i32, i32* %6
%11 = call i32 @semop(i32 %8, %struct.sembuf* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @Error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.sembuf = type { i32 }
@.str = [15 x i8] c"Error on semop\00"
define i32 @Semop(i32 %0, %struct.sembuf* %1, i32 %2) {
%4 = tail call i32 @semop(i32 %0, %struct.sembuf* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @Error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int test_imm_BEint8_mem(signed char *val) {
  return ((*val) & (0xBE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -66
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int close_inherited_fds(int start, int end) {
  int fd = 0;
  for (fd = start; fd <= end; fd++) {
    close(fd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_inherited_fds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114d <close_inherited_fds+0x3d>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <close_inherited_fds+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_inherited_fds>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jg     112e <close_inherited_fds+0x1e>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <close@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <close_inherited_fds+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @close_inherited_fds(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
%6 = load i32, i32* %3
store i32 %6, i32* %5
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @close_inherited_fds(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @close(i32 %5)
%7 = add i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void add_reg32_reg32(unsigned long reg1, unsigned long reg2) {
  put8(0x01);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<add_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
or     $0xc0,%rax
or     -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg32_reg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <put8@plt>
shl    $0x3,%r14d
or     %r14d,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_reg32_reg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 1)
%6 = load i64, i64* %4
%7 = shl i64 %6, 3
%8 = or i64 192, %7
%9 = load i64, i64* %3
%10 = or i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @add_reg32_reg32(i64 %0, i64 %1) {
%3 = tail call i32 @put8(i32 1)
%4 = shl i64 %1, 3
%5 = or i64 %4, %0
%6 = trunc i64 %5 to i32
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo();
int main() {
  if (!foo())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%eax
jne    1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
void ft_swap(char **tab, size_t i, size_t j) {
  char *str;
  str = tab[i];
  tab[i] = tab[j];
  tab[j] = str;
}


x86 assembly (clang, -O0):
<ft_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_swap>:
mov    (%rdi,%rsi,8),%rax
mov    (%rdi,%rdx,8),%rcx
mov    %rcx,(%rdi,%rsi,8)
mov    %rax,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @ft_swap(i8** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8*, i8** %0, i64 %1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %0, i64 %2
%7 = load i8*, i8** %6
store i8* %7, i8** %4
store i8* %5, i8** %6
ret void
}
/* Variables and functions */
int ***calloc(int, int);
int (**hnew())[2] { return calloc(sizeof(int **), 1024); }


x86 assembly (clang, -O0):
<hnew>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x400,%esi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hnew>:
mov    $0x8,%edi
mov    $0x400,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define [2 x i32]** @hnew() {
%1 = call i32*** @calloc(i32 8, i32 1024)
%2 = bitcast i32*** %1 to [2 x i32]**
ret [2 x i32]** %2
}

LLVM IR (-O2):
define noalias [2 x i32]** @hnew() {
%1 = tail call i32*** @calloc(i32 8, i32 1024)
%2 = bitcast i32*** %1 to [2 x i32]**
ret [2 x i32]** %2
}
/* Variables and functions */
int M_PI;
double sin(int);
int main() {
  double sinTable[256];
#pragma omp parallel for
  for (int n = 0; n < 256; ++n)
    sinTable[n] = sin(2 * M_PI * n / 256);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x814(%rbp)
cmpl   $0x100,-0x814(%rbp)
jge    1182 <main+0x72>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
imul   -0x814(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sin@plt>
movslq -0x814(%rbp),%rax
movsd  %xmm0,-0x810(%rbp,%rax,8)
ff ff
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    112c <main+0x1c>
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    0x2ecb(%rip),%r14
nopl   (%rax)
mov    (%r14),%eax
imul   %ebx,%eax
lea    0xff(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x8,%edi
call   1030 <sin@plt>
lea    0x2(%rbx),%eax
imul   (%r14),%eax
lea    0xff(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x8,%edi
call   1030 <sin@plt>
add    $0x4,%ebx
cmp    $0x200,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x double]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* @M_PI
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = sdiv i32 %11, 256
%13 = call double @sin(i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [256 x double], [256 x double]* %2, i64 0, i64 %15
store double %13, double* %16
br label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %15, %2 ]
%4 = load i32, i32* @M_PI
%5 = shl nuw i32 %3, 1
%6 = mul i32 %5, %4
%7 = sdiv i32 %6, 256
%8 = tail call double @sin(i32 %7)
%9 = load i32, i32* @M_PI
%10 = shl nuw i32 %3, 1
%11 = or i32 %10, 2
%12 = mul i32 %11, %9
%13 = sdiv i32 %12, 256
%14 = tail call double @sin(i32 %13)
%15 = add nuw nsw i32 %3, 2
%16 = icmp eq i32 %15, 256
br i1 %16, label %1, label %2
}