xunge/DecIR huggingface dataset:
/* Variables and functions */
int sse(double *, double *, int, double, double);
double mse(double *x, double *y, int n, double slope, double intcp) {
  return sse(x, y, n, slope, intcp) / (n - 2);
}


x86 assembly (clang, -O0):
<mse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <sse@plt>
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mse>:
push   %rbx
mov    %edx,%ebx
call   1030 <sse@plt>
add    $0xfffffffe,%ebx
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @mse(double* %0, double* %1, i32 %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load i32, i32* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call i32 @sse(double* %11, double* %12, i32 %13, double %14, double %15)
%17 = load i32, i32* %8
%18 = sub nsw i32 %17, 2
%19 = sdiv i32 %16, %18
%20 = sitofp i32 %19 to double
ret double %20
}

LLVM IR (-O2):
define double @mse(double* %0, double* %1, i32 %2, double %3, double %4) {
%6 = tail call i32 @sse(double* %0, double* %1, i32 %2, double %3, double %4)
%7 = add nsw i32 %2, -2
%8 = sdiv i32 %6, %7
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int main() {
  if (!fork()) {
    exit(0);
  } else {
    while (1)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%eax
jne    1146 <main+0x26>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    114b <main+0x2b>
jmp    114b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1132 <main+0x12>
nopl   0x0(%rax)
jmp    1130 <main+0x10>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0, %5
br label %5
}
/* Variables and functions */
int mlock(const void *addr, size_t len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mlock(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int xyzToLabPreproc(double);
double xyzToLabL(double xin, double yin, double zin) {
  return (116 * xyzToLabPreproc(yin)) - 16;
}


x86 assembly (clang, -O0):
<xyzToLabL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <xyzToLabPreproc@plt>
imul   $0x74,%eax,%eax
sub    $0x10,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyzToLabL>:
push   %rax
movaps %xmm1,%xmm0
call   1030 <xyzToLabPreproc@plt>
imul   $0x74,%eax,%eax
add    $0xfffffff0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xyzToLabL(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* %5
%8 = call i32 @xyzToLabPreproc(double %7)
%9 = mul nsw i32 116, %8
%10 = sub nsw i32 %9, 16
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @xyzToLabL(double %0, double %1, double %2) {
%4 = tail call i32 @xyzToLabPreproc(double %1)
%5 = mul nsw i32 %4, 116
%6 = add nsw i32 %5, -16
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
scalar_t__ isblank(char const);
const char *skip_blank(const char *p) {
  while (isblank(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     1143 <skip_blank+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_blank+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blank>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isblank@plt>
test   %rax,%rax
jne    1120 <skip_blank+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_blank(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isblank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
double UINT32_MAX;
unsigned int hash2filenum(uint32_t hashcode, unsigned int numfiles) {
  return (unsigned int)(((double)hashcode) / (UINT32_MAX + 1.0) * numfiles);
}


x86 assembly (clang, -O0):
<hash2filenum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
mov    0x2ee0(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2filenum>:
cvtsi2sd %rdi,%xmm0
mov    0x2eec(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xee8(%rip),%xmm1
mov    %esi,%eax
cvtsi2sd %rax,%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%rax
ret

LLVM IR (-O0):
@UINT32_MAX = global double 0.000000e+00
define i32 @hash2filenum(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load double, double* @UINT32_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = load i32, i32* %4
%11 = uitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = fptoui double %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@UINT32_MAX = global double 0.000000e+00
define i32 @hash2filenum(i64 %0, i32 %1) {
%3 = sitofp i64 %0 to double
%4 = load double, double* @UINT32_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = uitofp i32 %1 to double
%8 = fmul double %6, %7
%9 = fptoui double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a, b;
  a = 1;
  b = 2;
  if (b > a) {
    printf("right %d\n", a + b);
  } else {
    printf("left  %d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1157 <main+0x47>
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x59>
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"right %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SerialInit();
void console_init(void) { SerialInit(); }


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

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

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

LLVM IR (-O2):
define void @console_init() {
%1 = tail call i32 (...) @SerialInit()
ret void
}
/* Variables and functions */
char *strdup(char *);
char *kapi_pchCopy(char *pch) {
  if (pch == NULL) {
    return (NULL);
  } else {
    return (strdup(pch));
  }
}


x86 assembly (clang, -O0):
<kapi_pchCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <kapi_pchCopy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <kapi_pchCopy+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @kapi_pchCopy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gzfree(void *x, void *addr) { free(addr); }


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

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

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

LLVM IR (-O2):
define void @gzfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
char *fz_strsep(char **stringp, const char *delim) {
  char *ret = *stringp;
  if (ret == ((void *)0))
    return ((void *)0);
  if ((*stringp = strpbrk(*stringp, delim)) != ((void *)0))
    *((*stringp)++) = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<fz_strsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <fz_strsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1180 <fz_strsep+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1178 <fz_strsep+0x68>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_strsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113c <fz_strsep+0x2c>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     113c <fz_strsep+0x2c>
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,(%r14)
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @fz_strsep(i8** %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %25
12: ; preds = %2
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = load i8*, i8** %5
%16 = call i8* @strpbrk(i8* %14, i8* %15)
%17 = load i8**, i8*** %4
store i8* %16, i8** %17
%18 = icmp ne i8* %16, null
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = load i8**, i8*** %4
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
store i8 0, i8* %21
br label %23
23: ; preds = %19, %12
%24 = load i8*, i8** %6
store i8* %24, i8** %3
br label %25
25: ; preds = %23, %11
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @fz_strsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
store i8* %6, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %9, i8** %0
store i8 0, i8* %6
br label %10
10: ; preds = %5, %8, %2
ret i8* %3
}
int ft_count_if(char **tab, int (*f)(char *)) {
  int total;
  int i;
  total = 0;
  i = 0;
  while (tab[i])
    if (f(tab[i++]))
      total++;
  return (total);
}


x86 assembly (clang, -O0):
<ft_count_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1164 <ft_count_if+0x64>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x0,%eax
je     115f <ft_count_if+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <ft_count_if+0x1e>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_count_if>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <ft_count_if+0x37>
mov    %rsi,%r14
add    $0x8,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
call   *%r14
cmp    $0x1,%eax
sbb    $0xffffffff,%ebp
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <ft_count_if+0x20>
jmp    1139 <ft_count_if+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_count_if(i8** %0, i32 (i8*)* %1) {
%3 = alloca i8**
%4 = alloca i32 (i8*)*
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %3
store i32 (i8*)* %1, i32 (i8*)** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8**, i8*** %3
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %28
14: ; preds = %7
%15 = load i32 (i8*)*, i32 (i8*)** %4
%16 = load i8**, i8*** %3
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8*, i8** %16, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 %15(i8* %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %27
27: ; preds = %24, %14
br label %7
28: ; preds = %7
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @ft_count_if(i8** nocapture %0, i32 (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %15, %5 ], [ %3, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = add nuw i64 %6, 1
%10 = tail call i32 %1(i8* %7)
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = getelementptr inbounds i8*, i8** %0, i64 %9
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
char fpeek(FILE *f) {
  char x = '\0';
  x = fgetc(f);
  ungetc(x, f);
  return x;
}


x86 assembly (clang, -O0):
<fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @fpeek(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = tail call i32 @ungetc(i8 signext %2, i32* %0)
ret i8 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCComparatorConfigure(uint32_t ui32Base, uint32_t ui32Comp,
                            uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  ASSERT(ui32Comp < 8);
  (*((volatile uint32_t *)(ui32Base + 0x00000E00 + (ui32Comp * 4)))) =
      ui32Config;
}


x86 assembly (clang, -O0):
<ADCComparatorConfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1140 <ADCComparatorConfigure+0x30>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xe00,%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorConfigure>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x8,%ebp
setl   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movslq %ebp,%rcx
mov    %r14d,0xe00(%rax,%rcx,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCComparatorConfigure(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 = icmp eq i32 %7, 1073971200
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1073975296
br label %12
12: ; preds = %9, %3
%13 = phi i1 [ true, %3 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @ASSERT(i32 %14)
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 8
%18 = zext i1 %17 to i32
%19 = call i32 @ASSERT(i32 %18)
%20 = load i32, i32* %6
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 3584
%23 = load i32, i32* %5
%24 = mul nsw i32 %23, 4
%25 = add nsw i32 %22, %24
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
store volatile i32 %20, i32* %27
ret void
}

LLVM IR (-O2):
define void @ADCComparatorConfigure(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, -4097
%5 = icmp eq i32 %4, 1073971200
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = icmp slt i32 %1, 8
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
%11 = add nsw i32 %0, 3584
%12 = shl nsw i32 %1, 2
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %2, i32* %15
ret void
}
char *strerror(errnum)
int errnum;
{
  extern int sys_nerr;
  extern char *sys_errlist[];
  static char ebuf[20];
  if ((unsigned int)errnum < sys_nerr)
    return (sys_errlist[errnum]);
  (void)sprintf(ebuf, "Unknown error: %d", errnum);
  return (ebuf);
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jae    1145 <strerror+0x35>
movslq -0xc(%rbp),%rcx
mov    0x2ec0(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <strerror+0x58>
mov    -0xc(%rbp),%edx
lea    0x2ef1(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2edc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
push   %rbx
mov    %edi,%edx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jbe    112e <strerror+0x1e>
movslq %edx,%rax
mov    0x2ed0(%rip),%rcx
mov    (%rcx,%rax,8),%rbx
jmp    1146 <strerror+0x36>
lea    0x2f0b(%rip),%rbx
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strerror.ebuf = internal global [20 x i8] zeroinitializer
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [18 x i8] c"Unknown error: %d\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @sys_nerr
%6 = icmp ult i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %9
%11 = load i8*, i8** %10
store i8* %11, i8** %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.ebuf, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.ebuf, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %12, %7
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@strerror.ebuf = internal global [20 x i8] zeroinitializer
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [18 x i8] c"Unknown error: %d\00"
define i8* @strerror(i32 %0) {
%2 = load i32, i32* @sys_nerr
%3 = icmp ugt i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.ebuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %4
%11 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.ebuf, i64 0, i64 0), %8 ]
ret i8* %11
}
/* Type definitions */
typedef char GLubyte;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *gluErrorString(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void errorCallback(GLenum errorCode) {
  const GLubyte *estring;
  estring = gluErrorString(errorCode);
  fprintf(stderr, "Quadric Error: %s\n", estring);
  exit(0);
}


x86 assembly (clang, -O0):
<errorCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gluErrorString@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errorCallback>:
push   %rax
call   1040 <gluErrorString@plt>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeba(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Quadric Error: %s\0A\00"
define void @errorCallback(i32 %0) {
%2 = tail call i8* @gluErrorString(i32 %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
SIGNI(statlink, n) int *statlink;
int n;
{ return (n < 0 ? -1 : n == 0 ? 0 : 1); }


x86 assembly (clang, -O0):
<SIGNI>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1122 <SIGNI+0x22>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <SIGNI+0x35>
mov    -0xc(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGNI>:
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @SIGNI(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
br label %13
13: ; preds = %8, %7
%14 = phi i32 [ -1, %7 ], [ %12, %8 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @SIGNI(i32* nocapture readnone %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = icmp sgt i32 %1, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void printerr_ex(int cond, char *msg, int ret) {
  if (cond) {
    perror(msg);
    exit(ret);
  }
}


x86 assembly (clang, -O0):
<printerr_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <printerr_ex+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr_ex>:
test   %edi,%edi
jne    1125 <printerr_ex+0x5>
ret
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @printerr_ex(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @perror(i8* %1)
%7 = tail call i32 @exit(i32 %2)
unreachable
8: ; preds = %3
ret void
}
void g_object_get_valist() {}


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

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

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

LLVM IR (-O2):
define void @g_object_get_valist() {
ret void
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ free(char *);
char *mfm_read_line(int, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void mfm_input_goto(int h, int w) {
  printf("\e[%i;1H\e[33;41m\e[1K", h);
  char *dir = mfm_read_line(h, 1, w, NULL);
  if (dir) {
    int res = chdir(dir);
    free(dir);
  }
}


x86 assembly (clang, -O0):
<mfm_input_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <mfm_read_line@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1195 <mfm_input_goto+0x55>
mov    -0x10(%rbp),%rdi
call   1050 <chdir@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfm_input_goto>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
call   1060 <printf@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1040 <mfm_read_line@plt>
test   %rax,%rax
je     1183 <mfm_input_goto+0x43>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <chdir@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\1B[%i;1H\1B[33;41m\1B[1K\00"
define void @mfm_input_goto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i8* @mfm_read_line(i32 %9, i32 1, i32 %10, i32* null)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = call i32 @chdir(i8* %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
br label %19
19: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\1B[%i;1H\1B[33;41m\1B[1K\00"
define void @mfm_input_goto(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i8* @mfm_read_line(i32 %0, i32 1, i32 %1, i32* null)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @chdir(i8* %4)
%8 = tail call i32 @free(i8* %4)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, long);
int free_aligned(void *addr, long size) { munmap(addr, size); }


x86 assembly (clang, -O0):
<free_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_aligned>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define i32 @free_aligned(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 i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i32 @munmap(i8* %6, i64 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @free_aligned(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ draw_msg_at_color(int, int, int /*<<< orphan*/, int);
void hilite_msg_at(int x, int y) { draw_msg_at_color(x, y, 0, 85); }


x86 assembly (clang, -O0):
<hilite_msg_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x55,%ecx
call   1030 <draw_msg_at_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hilite_msg_at>:
xor    %edx,%edx
mov    $0x55,%ecx
jmp    1030 <draw_msg_at_color@plt>

LLVM IR (-O0):
define void @hilite_msg_at(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 = call i32 @draw_msg_at_color(i32 %5, i32 %6, i32 0, i32 85)
ret void
}

LLVM IR (-O2):
define void @hilite_msg_at(i32 %0, i32 %1) {
%3 = tail call i32 @draw_msg_at_color(i32 %0, i32 %1, i32 0, i32 85)
ret void
}
double fabs(double n) {
  if (n < 0.0) {
    return -n;
  } else {
    return n;
  }
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct snd_pcm_hw_params {
  struct snd_mask *masks;
};
struct snd_mask {
  int dummy;
};

/* Variables and functions */
int SNDRV_PCM_HW_PARAM_FIRST_MASK;
struct snd_mask *param_to_mask(struct snd_pcm_hw_params *p, int n) {
  return &(p->masks[n - SNDRV_PCM_HW_PARAM_FIRST_MASK]);
}


x86 assembly (clang, -O0):
<param_to_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
mov    0x2ec4(%rip),%rdx
sub    (%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_to_mask>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rcx
movslq %esi,%rax
sub    %rcx,%rax
shl    $0x2,%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.snd_mask = type { i32 }
%struct.snd_pcm_hw_params = type { %struct.snd_mask* }
@SNDRV_PCM_HW_PARAM_FIRST_MASK = global i32 0
define %struct.snd_mask* @param_to_mask(%struct.snd_pcm_hw_params* %0, i32 %1) {
%3 = alloca %struct.snd_pcm_hw_params*
%4 = alloca i32
store %struct.snd_pcm_hw_params* %0, %struct.snd_pcm_hw_params** %3
store i32 %1, i32* %4
%5 = load %struct.snd_pcm_hw_params*, %struct.snd_pcm_hw_params** %3
%6 = getelementptr inbounds %struct.snd_pcm_hw_params, %struct.snd_pcm_hw_params* %5, i32 0, i32 0
%7 = load %struct.snd_mask*, %struct.snd_mask** %6
%8 = load i32, i32* %4
%9 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_MASK
%10 = sub nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.snd_mask, %struct.snd_mask* %7, i64 %11
ret %struct.snd_mask* %12
}

LLVM IR (-O2):
%struct.snd_mask = type { i32 }
%struct.snd_pcm_hw_params = type { %struct.snd_mask* }
@SNDRV_PCM_HW_PARAM_FIRST_MASK = global i32 0
define %struct.snd_mask* @param_to_mask(%struct.snd_pcm_hw_params* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.snd_pcm_hw_params, %struct.snd_pcm_hw_params* %0, i64 0, i32 0
%4 = load %struct.snd_mask*, %struct.snd_mask** %3
%5 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_MASK
%6 = sub nsw i32 %1, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.snd_mask, %struct.snd_mask* %4, i64 %7
ret %struct.snd_mask* %8
}
/* Variables and functions */
int /*<<< orphan*/ nxtDisplayCenteredBigTextLine(int, char *);
int /*<<< orphan*/ nxtDisplayCenteredTextLine(int, char *);
void showMenu() {
  nxtDisplayCenteredBigTextLine(1, "Waschen?");
  nxtDisplayCenteredTextLine(3, "Ich bin bereit");
  nxtDisplayCenteredTextLine(6, "START");
}


x86 assembly (clang, -O0):
<showMenu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x3,%edi
lea    0xec8(%rip),%rsi
call   1040 <nxtDisplayCenteredTextLine@plt>
mov    $0x6,%edi
lea    0xec6(%rip),%rsi
call   1040 <nxtDisplayCenteredTextLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showMenu>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
lea    0xed0(%rip),%rsi
mov    $0x3,%edi
call   1040 <nxtDisplayCenteredTextLine@plt>
lea    0xece(%rip),%rsi
mov    $0x6,%edi
pop    %rax
jmp    1040 <nxtDisplayCenteredTextLine@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Waschen?\00"
@.str.1 = [15 x i8] c"Ich bin bereit\00"
@.str.2 = [6 x i8] c"START\00"
define void @showMenu() {
%1 = call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @nxtDisplayCenteredTextLine(i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Waschen?\00"
@.str.1 = [15 x i8] c"Ich bin bereit\00"
@.str.2 = [6 x i8] c"START\00"
define void @showMenu() {
%1 = tail call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @nxtDisplayCenteredTextLine(i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_cancel_with_status() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_call_cancel_with_status>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_cancel_with_status() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_cancel_with_status() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t load32(const uint8_t *p) { return (*((uint32_t *)p)); }


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

x86 assembly (clang, -O2):
<load32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @load32(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skip_ws(const char *s) {
  while (isspace(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_ws+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_ws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_ws(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 255; i++) {
    printf("ASCCI char: %c value %d\n", i, i);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"ASCCI char: %c value %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
short dois() { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @dois() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @dois() {
ret i16 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ subwindow_mode;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_subwindow_mode(void *_p) {
  return (int)((XGCValues *)_p)->subwindow_mode;
}


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

x86 assembly (clang, -O2):
<get_XGCValues_subwindow_mode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGCValues_subwindow_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGCValues_subwindow_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct avifIO {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ avifFree(struct avifIO *);
void avifIOTestReaderDestroy(struct avifIO *io) { avifFree(io); }


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

x86 assembly (clang, -O2):
<avifIOTestReaderDestroy>:
jmp    1030 <avifFree@plt>

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

LLVM IR (-O2):
%struct.avifIO = type { i32 }
define void @avifIOTestReaderDestroy(%struct.avifIO* %0) {
%2 = tail call i32 @avifFree(%struct.avifIO* %0)
ret void
}
int some_normal_function(int a) { return a * a * a; }


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

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

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

LLVM IR (-O2):
define i32 @some_normal_function(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}