xunge/DecIR huggingface dataset:
float f(float x) { return ((x * x * x) - (2 * x) - 5); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee4(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xebe(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm0,%xmm0
subss  %xmm0,%xmm1
addss  0xee5(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float 2.000000e+00, %7
%9 = fneg float %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = fsub float %10, 5.000000e+00
ret float %11
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %0, -2.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %3)
%5 = fadd float %4, -5.000000e+00
ret float %5
}
/* Variables and functions */
int write(int, void const *, size_t);
int fastio_write(int fd, const void *buf, size_t count) {
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<fastio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastio_write>:
jmp    1030 <write@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ glTexCoord2dv(int /*<<< orphan*/ *);
int /*<<< orphan*/ glVertex3dv(int /*<<< orphan*/ *);
void glu_vertex(GLdouble *xyz) {
  glTexCoord2dv(xyz + 3);
  glVertex3dv(xyz);
}


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

x86 assembly (clang, -O2):
<glu_vertex>:
push   %rbx
mov    %rdi,%rbx
add    $0xc,%rdi
call   1030 <glTexCoord2dv@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <glVertex3dv@plt>

LLVM IR (-O0):
define void @glu_vertex(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = call i32 @glTexCoord2dv(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @glVertex3dv(i32* %6)
ret void
}

LLVM IR (-O2):
define void @glu_vertex(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = tail call i32 @glTexCoord2dv(i32* %2)
%4 = tail call i32 @glVertex3dv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgbool();
int /*<<< orphan*/ gentext();
void genbool(void) {
  gentext();
  cgbool();
}


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

x86 assembly (clang, -O2):
<genbool>:
push   %rax
xor    %eax,%eax
call   1030 <gentext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cgbool@plt>

LLVM IR (-O0):
define void @genbool() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgbool()
ret void
}

LLVM IR (-O2):
define void @genbool() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgbool()
ret void
}
/* Variables and functions */
int pow(double, int);
double fx(double x) { return (1 / (25 * pow(x, 2) + 1)); }


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x19,%eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%ecx
add    $0x1,%ecx
lea    (%rax,%rax,4),%eax
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fx(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = mul nsw i32 25, %4
%6 = add nsw i32 %5, 1
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @fx(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = mul nsw i32 %2, 25
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void intentional2(char *name) {
  char *new_name = (char *)malloc(strlen(name + 2));
}


x86 assembly (clang, -O0):
<intentional2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intentional2>:
push   %rax
add    $0x2,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define void @intentional2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
ret void
}

LLVM IR (-O2):
define void @intentional2(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i64 @malloc(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void a() { puts("a1.c"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"a1.c\00"
define void @a() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"a1.c\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ num(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  int state = 1;
  while (state == 1) {
    scanf("%d", &i);
    if (i > 0) {
      num(i);
    } else {
      state = 0;
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    118f <main+0x5f>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1177 <main+0x47>
mov    -0x8(%rbp),%edi
call   1030 <num@plt>
jmp    117e <main+0x4e>
movl   $0x0,-0xc(%rbp)
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jle    1182 <main+0x52>
lea    0xeac(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
call   1030 <num@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jg     1160 <main+0x30>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ %4, %0 ]
%8 = call i32 @num(i32 %7)
%9 = call i32 @putchar(i32 10)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %0
%14 = call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ fun(char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char a[] = "dsljfldfg";
  fun(a);
  int res = sizeof(a) / sizeof(a[0]);
  printf("%d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <fun@plt>
movl   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x66646c666a6c7364,%rax
6c 64 66
mov    %rax,0x8(%rsp)
movw   $0x67,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <fun@plt>
lea    0xebf(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"dsljfldfg\00"
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = bitcast [10 x i8]* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @fun(i8* %4)
store i32 10, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.main.a = [10 x i8] c"dsljfldfg\00"
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @fun(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
int get_time_step(void *self, double *dt) {
  *dt = -1.;
  return (0);
}


x86 assembly (clang, -O0):
<get_time_step>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_step>:
movabs $0xbff0000000000000,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_time_step(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load double*, double** %4
store double -1.000000e+00, double* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @get_time_step(i8* nocapture readnone %0, double* nocapture writeonly %1) {
store double -1.000000e+00, double* %1
ret i32 0
}
void DefCanDownDriver(void) {}


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

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

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

LLVM IR (-O2):
define void @DefCanDownDriver() {
ret void
}
/* Variables and functions */
scalar_t__ memcpy(void *, char const *, size_t);
size_t strlen(char const *);
void *xmalloc_inc(size_t, int);
char *xstrdup(const char *s) {
  size_t len = strlen(s);
  void *new;
  new = xmalloc_inc(len, 1);
  if (new == NULL)
    return NULL;
  return (char *)memcpy(new, s, len + 1);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <xmalloc_inc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <xstrdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    118c <xstrdup+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <xmalloc_inc@plt>
test   %rax,%rax
je     1165 <xstrdup+0x35>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
jmp    1167 <xstrdup+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i8* @xmalloc_inc(i64 %2, i32 1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = add i64 %2, 1
%7 = tail call i64 @memcpy(i8* %3, i8* %0, i64 %6)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushbooleanarray(char *x, int n) { pushNarray(x, (unsigned int)(n * 4)); }


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

x86 assembly (clang, -O2):
<pushbooleanarray>:
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushbooleanarray(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_write(int, void const *, size_t);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
ssize_t __attribute__((weak)) write(int fd, const void *buf, size_t n) {
  ssize_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_write(fd, buf, n);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__libc_write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <__libc_write@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @__libc_write(i32 %11, i8* %12, i64 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_write(i32 %0, i8* %1, i64 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char *);
FILE *xfopen(const char *file, const char *mode) {
  FILE *fp;
  if (!(fp = fopen(file, mode))) {
    perror("could not open input file");
    exit(0);
  }
  return fp;
}


x86 assembly (clang, -O0):
<xfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116e <xfopen+0x3e>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %rax
call   1030 <fopen@plt>
test   %rax,%rax
je     113d <xfopen+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"could not open input file\00"
define i32* @xfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [26 x i8] c"could not open input file\00"
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void intro() {
  printf(
      "\nPick Up Pile\n------\n"
      "Pick Up Pile is a game with many variations on the same idea.\n"
      "You and the computer each take turns picking up items from an\n"
      "imaginary pile of objects. Depending on the type of game you choose\n"
      "to play you will have different restrictions on how much you can\n"
      "pick up at a time, and whether you want to be the one to pick up the\n"
      "last piece or not.\n"
      "The traditional setup is 23 matches, but you can play any variation.\n");
}


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

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

LLVM IR (-O0):
@.str = [436 x i8] c"\0APick Up Pile\0A------\0APick Up Pile is a game with many variations on the same idea.\0AYou and the computer each take turns picking up items from an\0Aimaginary pile of objects. Depending on the type of game you choose\0Ato play you will have different restrictions on how much you can\0Apick up at a time, and whether you want to be the one to pick up the\0Alast piece or not.\0AThe traditional setup is 23 matches, but you can play any variation.\0A\00"
define void @intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [435 x i8] c"\0APick Up Pile\0A------\0APick Up Pile is a game with many variations on the same idea.\0AYou and the computer each take turns picking up items from an\0Aimaginary pile of objects. Depending on the type of game you choose\0Ato play you will have different restrictions on how much you can\0Apick up at a time, and whether you want to be the one to pick up the\0Alast piece or not.\0AThe traditional setup is 23 matches, but you can play any variation.\00"
define void @intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([435 x i8], [435 x i8]* @str, i64 0, i64 0))
ret void
}
void soru_4(int *a, int *b) {}


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

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

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

LLVM IR (-O2):
define void @soru_4(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int standardize_cell(double **, double **, int *, int const, double const,
                     double);
int spg_refine_cell(double lattice[3][3], double position[][3], int types[],
                    const int num_atom, const double symprec) {
  return standardize_cell(lattice, position, types, num_atom, symprec, -1.0);
}


x86 assembly (clang, -O0):
<spg_refine_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <standardize_cell@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_refine_cell>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <standardize_cell@plt>

LLVM IR (-O0):
define i32 @spg_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4) {
%6 = alloca [3 x double]*
%7 = alloca [3 x double]*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca double
store [3 x double]* %0, [3 x double]** %6
store [3 x double]* %1, [3 x double]** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load [3 x double]*, [3 x double]** %6
%12 = bitcast [3 x double]* %11 to double**
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load i32*, i32** %8
%16 = load i32, i32* %9
%17 = load double, double* %10
%18 = call i32 @standardize_cell(double** %12, double** %14, i32* %15, i32 %16, double %17, double -1.000000e+00)
ret i32 %18
}

LLVM IR (-O2):
define i32 @spg_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4) {
%6 = bitcast [3 x double]* %0 to double**
%7 = bitcast [3 x double]* %1 to double**
%8 = tail call i32 @standardize_cell(double** %6, double** %7, i32* %2, i32 %3, double %4, double -1.000000e+00)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t gettime_ns(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000UL * 1000 * 1000 + ts.tv_nsec;
}


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

x86 assembly (clang, -O2):
<gettime_ns>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gettime_ns() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = mul i64 %6, 1000
%8 = mul i64 %7, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gettime_ns() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
int tegra_dvfs_set_rate(struct clk *c, unsigned long rate) { return 0; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i32 @tegra_dvfs_set_rate(%struct.clk* %0, i64 %1) {
%3 = alloca %struct.clk*
%4 = alloca i64
store %struct.clk* %0, %struct.clk** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @tegra_dvfs_set_rate(%struct.clk* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void GPIO_toggleDio(uint32_t dioNumber) {
  ;
  (*((volatile unsigned long *)(0x40022000 + 0x000000B0))) = (1 << dioNumber);
}


x86 assembly (clang, -O0):
<GPIO_toggleDio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400220b0,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_toggleDio>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400220b0
40
ret

LLVM IR (-O0):
define void @GPIO_toggleDio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 1073881264 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIO_toggleDio(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 1073881264 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_nonblock(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void gui_cleanup() {
  printf("%c[m", 27);
  gui_nonblock(0);
}


x86 assembly (clang, -O0):
<gui_cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <gui_nonblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <gui_nonblock@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c[m\00"
define void @gui_cleanup() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27)
%2 = tail call i32 @gui_nonblock(i32 0)
ret void
}
int valid_char(char c) {
  if (((c)&0x7F) < 0x20 || ((c)&0x7F) > 0x7E)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x7f,%eax
cmp    $0x20,%eax
jl     112a <valid_char+0x2a>
movsbl -0x5(%rbp),%eax
and    $0x7f,%eax
cmp    $0x7e,%eax
jle    1136 <valid_char+0x36>
movl   $0x0,-0x4(%rbp)
jmp    113d <valid_char+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_char>:
and    $0x7f,%dil
cmp    $0x20,%dil
setae  %al
cmp    $0x7f,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @valid_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 127
%7 = icmp slt i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = and i32 %10, 127
%12 = icmp sgt i32 %11, 126
br i1 %12, label %13, label %14
13: ; preds = %8, %1
store i32 0, i32* %2
br label %15
14: ; preds = %8
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @valid_char(i8 signext %0) {
%2 = and i8 %0, 127
%3 = icmp ugt i8 %2, 31
%4 = icmp ne i8 %2, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M0_f(char *s) {
  debug("M0_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M0_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M0_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M0_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M0_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M0_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M0_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
unsigned short dj_set_mixing_freq(unsigned short freq) { return freq; }


x86 assembly (clang, -O0):
<dj_set_mixing_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @dj_set_mixing_freq(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @dj_set_mixing_freq(i16 returned zeroext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int die(const char *str) {
  fprintf(stderr, "\nError: %s\n\n", str);
  return 1;
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"\0AError: %s\0A\0A\00"
define i32 @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ myWrite(int, int *, int);
void setDigitalIO(int fd, uint8_t value) {
  uint8_t data[2] = {147, value};
  myWrite(fd, data, 2);
}


x86 assembly (clang, -O0):
<setDigitalIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x93,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <myWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDigitalIO>:
push   %rax
movl   $0x93,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <myWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setDigitalIO(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 147, i32* %6
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call i32 @myWrite(i32 %9, i32* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @setDigitalIO(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 147, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @myWrite(i32 %0, i32* %5, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pindef_init();
int keypad_init() {
  pindef_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @keypad_init() {
%1 = call i32 (...) @pindef_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @keypad_init() {
%1 = tail call i32 (...) @pindef_init()
ret i32 0
}
/* Variables and functions */
int fh_strsplit_sep(char *, char *, char **, size_t);
int fh_strsplit(char *string, char **fields, size_t size) {
  return fh_strsplit_sep(string, " \t", fields, size);
}


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

x86 assembly (clang, -O2):
<fh_strsplit>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fh_strsplit_sep@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i32 @fh_strsplit(i8* %0, i8** %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i32 @fh_strsplit_sep(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i32 @fh_strsplit(i8* %0, i8** %1, i64 %2) {
%4 = tail call i32 @fh_strsplit_sep(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1, i64 %2)
ret i32 %4
}
void check_zero(const char *x) {
  if (*x == '\0')
    internal_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/"
                   "heads/lyrics/playlist.c",
                   463, __FUNCTION__, "Unexpected end of title expression!");
}


x86 assembly (clang, -O0):
<check_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114d <check_zero+0x3d>
lea    0xecd(%rip),%rdi
mov    $0x1cf,%esi
lea    0xf4b(%rip),%rdx
lea    0xf4f(%rip),%rcx
mov    $0x0,%al
call   1030 <internal_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_zero>:
cmpb   $0x0,(%rdi)
je     1116 <check_zero+0x6>
ret
lea    0xee3(%rip),%rdi
lea    0xf66(%rip),%rdx
lea    0xf6a(%rip),%rcx
mov    $0x1cf,%esi
xor    %eax,%eax
jmp    1030 <internal_fatal@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/playlist.c\00"
@__FUNCTION__.check_zero = [11 x i8] c"check_zero\00"
@.str.1 = [36 x i8] c"Unexpected end of title expression!\00"
define void @check_zero(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_fatal to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 463, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.check_zero, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/playlist.c\00"
@__FUNCTION__.check_zero = [11 x i8] c"check_zero\00"
@.str.1 = [36 x i8] c"Unexpected end of title expression!\00"
define void @check_zero(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_fatal to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 463, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.check_zero, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_filename_extension(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int is_a_cgi_file(char *f) {
  return (strcmp(get_filename_extension(f), "cgi") == 0);
}


x86 assembly (clang, -O0):
<is_a_cgi_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_filename_extension@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a_cgi_file>:
push   %rax
call   1040 <get_filename_extension@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cgi\00"
define i32 @is_a_cgi_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_filename_extension(i8* %3)
%5 = call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"cgi\00"
define i32 @is_a_cgi_file(i8* %0) {
%2 = tail call i32 @get_filename_extension(i8* %0)
%3 = tail call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGWINCH;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("begin\n");
  kill(getpid(), SIGWINCH);
  printf("end\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"begin\0A\00"
@SIGWINCH = global i32 0
@.str.1 = [5 x i8] c"end\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getpid()
%4 = load i32, i32* @SIGWINCH
%5 = call i32 @kill(i32 %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
@str = [6 x i8] c"begin\00"
@str.2 = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGWINCH
%4 = tail call i32 @kill(i32 %2, i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int gca_cmp2_int(const void *aa, const void *bb, void *p) {
  (void)p;
  const int a = *(const int *)aa;
  const int b = *(const int *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%ecx
cmp    -0x1c(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_int>:
mov    (%rdi),%ecx
mov    (%rsi),%edx
xor    %eax,%eax
xor    %esi,%esi
cmp    %edx,%ecx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_int(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp sgt i32 %16, %17
%19 = zext i1 %18 to i32
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = icmp sgt i32 %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_int(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp sgt i32 %5, %7
%9 = zext i1 %8 to i32
%10 = icmp sgt i32 %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ core(unsigned char *, unsigned char const *,
                        unsigned char const *, unsigned char const *, int);
int crypto_core_hsalsa20_tweet(unsigned char *out, const unsigned char *in,
                               const unsigned char *k, const unsigned char *c) {
  core(out, in, k, c, 1);
  return 0;
}


x86 assembly (clang, -O0):
<crypto_core_hsalsa20_tweet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <core@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_core_hsalsa20_tweet>:
push   %rax
mov    $0x1,%r8d
call   1030 <core@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_core_hsalsa20_tweet(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @core(i8* %9, i8* %10, i8* %11, i8* %12, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_core_hsalsa20_tweet(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @core(i8* %0, i8* %1, i8* %2, i8* %3, i32 1)
ret i32 0
}
int main(void) {
  int counter;
  for (counter = 0; 1; counter++) {
    if (4 == counter) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1121 <main+0x21>
jmp    1147 <main+0x47>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    1134 <main+0x34>
jmp    1147 <main+0x47>
jmp    1139 <main+0x39>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}