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


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa0\00"
define void @t_iscntrl_0xa0() {
%1 = tail call i64 @iscntrl(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int modulo(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_quaddobl_size(int *nbt) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(722, nbt, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<numbtrop_quaddobl_size>:
mov    %rdi,%rsi
mov    $0x2d2,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 722, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foo_internal();
int /*<<< orphan*/ foo_weak();
int main(void) {
  foo();
  foo_internal();
  foo_weak();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @foo_internal()
%4 = call i32 (...) @foo_weak()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo_internal()
%3 = tail call i32 (...) @foo_weak()
ret i32 0
}
int iscntrl(int c) {
  switch (c) {
  case '\a':
  case '\b':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
  case '\\':
  case '\'':
  case '\"':
  case '\?':
    return 1;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x55,%eax
ja     113c <iscntrl+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1143 <iscntrl+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
add    $0xfffffff9,%edi
cmp    $0x55,%edi
ja     111e <iscntrl+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 7, label %5
i32 8, label %5
i32 12, label %5
i32 10, label %5
i32 13, label %5
i32 9, label %5
i32 11, label %5
i32 92, label %5
i32 39, label %5
i32 34, label %5
i32 63, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
switch i32 %0, label %2 [
i32 7, label %3
i32 8, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
i32 92, label %3
i32 39, label %3
i32 34, label %3
i32 63, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int xacc(int *A, int x0, int x1) {
  if (x1 > 32767)
    x1 = 32767;
  if (x0 <= 0) {
    return (A[x1]);
  } else {
    return (A[x1] - A[x0 - 1]);
  }
}


x86 assembly (clang, -O0):
<xacc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x7fff,-0x18(%rbp)
jle    1122 <xacc+0x22>
movl   $0x7fff,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     113f <xacc+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <xacc+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xacc>:
cmp    $0x7fff,%edx
mov    $0x7fff,%eax
cmovl  %edx,%eax
cltq
mov    (%rdi,%rax,4),%eax
test   %esi,%esi
jle    111d <xacc+0x1d>
add    $0xffffffff,%esi
sub    (%rdi,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @xacc(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 32767
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 32767, i32* %7
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %6
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %4
br label %33
20: ; preds = %11
%21 = load i32*, i32** %5
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32*, i32** %5
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = sub nsw i32 %25, %31
store i32 %32, i32* %4
br label %33
33: ; preds = %20, %14
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @xacc(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 32767
%5 = select i1 %4, i32 %2, i32 32767
%6 = icmp slt i32 %1, 1
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
br i1 %6, label %16, label %10
10: ; preds = %3
%11 = add nsw i32 %1, -1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = sub nsw i32 %9, %14
br label %16
16: ; preds = %3, %10
%17 = phi i32 [ %15, %10 ], [ %9, %3 ]
ret i32 %17
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32_b_load(uint32_t *in) {
  uint32_t a;
  a = (*in << 16) | (*in >> 16);
  a = ((a & 0x00ff00ff) << 8) | ((a & 0xff00ff00) >> 8);
  return a;
}


x86 assembly (clang, -O0):
<swap32_b_load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0xc(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32_b_load>:
mov    (%rdi),%eax
mov    %eax,%ecx
shl    $0x10,%ecx
sar    $0x10,%eax
or     %ecx,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @swap32_b_load(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = ashr i32 %8, 16
%10 = or i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = and i32 %11, 16711935
%13 = shl i32 %12, 8
%14 = load i32, i32* %3
%15 = and i32 %14, -16711936
%16 = lshr i32 %15, 8
%17 = or i32 %13, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @swap32_b_load(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr i32 %2, 16
%5 = or i32 %3, %4
%6 = shl i32 %5, 8
%7 = and i32 %6, -16711936
%8 = lshr i32 %5, 8
%9 = and i32 %8, 16711935
%10 = or i32 %7, %9
ret i32 %10
}
void willusgui_thread_exit(int exitcode) {}


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

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

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

LLVM IR (-O2):
define void @willusgui_thread_exit(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_jcvt(double);
int32_t jcvt(double v) { return __builtin_arm_jcvt(v); }


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

x86 assembly (clang, -O2):
<jcvt>:
jmp    1030 <__builtin_arm_jcvt@plt>

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

LLVM IR (-O2):
define i32 @jcvt(double %0) {
%2 = tail call i32 @__builtin_arm_jcvt(double %0)
ret i32 %2
}
/* Variables and functions */
double copysign(double const, double const);
double const fabs(double const);
double determineVector(const double ds, const double size) {
  return (fabs(ds) > size / 2) ? (ds - copysign(size, ds)) : ds;
}


x86 assembly (clang, -O0):
<determineVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    117e <determineVector+0x6e>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movaps 0xeb3(%rip),%xmm3
pand   %xmm3,%xmm2
movaps 0xeb8(%rip),%xmm3
pand   %xmm3,%xmm1
por    %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1188 <determineVector+0x78>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determineVector>:
movapd 0xef8(%rip),%xmm2
movapd %xmm0,%xmm3
andpd  %xmm2,%xmm3
movsd  0xef8(%rip),%xmm4
mulsd  %xmm1,%xmm4
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
cmpltsd %xmm3,%xmm4
andpd  %xmm2,%xmm4
subsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @determineVector(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @fabs(double %5)
%7 = load double, double* %4
%8 = fdiv double %7, 2.000000e+00
%9 = fcmp ogt double %6, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %3
%14 = call double @llvm.copysign.f64(double %12, double %13)
%15 = fsub double %11, %14
br label %18
16: ; preds = %2
%17 = load double, double* %3
br label %18
18: ; preds = %16, %10
%19 = phi double [ %15, %10 ], [ %17, %16 ]
ret double %19
}

LLVM IR (-O2):
define double @determineVector(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fmul double %1, 5.000000e-01
%5 = fcmp ogt double %3, %4
%6 = tail call double @llvm.copysign.f64(double %1, double %0)
%7 = select i1 %5, double %6, double 0.000000e+00
%8 = fsub double %0, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((destructor)) dtor() { printf("dtor()\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"dtor()\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
define void @dtor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
@str = [7 x i8] c"dtor()\00"
define void @dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void invlpg(void *a) { __asm volatile("invlpg (%0)" : : "r"(a) : "memory"); }


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

LLVM IR (-O0):
define void @invlpg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ MikMod_malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *__s) {
  char *charptr;
  if (!__s)
    return NULL;
  charptr = (char *)MikMod_malloc(sizeof(char) * (strlen(__s) + 1));
  if (charptr)
    strcpy(charptr, __s);
  return charptr;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1191 <strdup+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <MikMod_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1189 <strdup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115e <strdup+0x2e>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <MikMod_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1160 <strdup+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1160 <strdup+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @MikMod_malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
int open(const char *path, int oflag, int mode) {
  long code = 0x2000005;
  unsigned long ret = 0;
  int set_mode = 0;
  if (oflag & 0x0200) {
    set_mode = mode;
  }
  __asm__("movq %1, %%rax;\n"
          "movq %2, %%rdi;\n"
          "movq %3, %%rsi;\n"
          "movq %4, %%rdx;\n"
          "syscall;\n"
          "movq %%rax, %0;\n"
          : "=g"(ret)
          : "g"(code), "g"(path), "g"(oflag), "g"(set_mode)
          :);
  if (ret == 2)
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movq   $0x2000005,-0x20(%rbp)
02
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     113c <open+0x3c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x2c(%rbp),%eax
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %ecx,-0x44(%rbp)
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%rsi
mov    -0x48(%rbp),%rdx
syscall
mov    %rax,-0x28(%rbp)
cmpq   $0x2,-0x28(%rbp)
jne    1185 <open+0x85>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <open+0x8c>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 33554437, i64* %8
store i64 0, i64* %9
store i32 0, i32* %10
%11 = load i32, i32* %6
%12 = and i32 %11, 512
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %7
store i32 %15, i32* %10
br label %16
16: ; preds = %14, %3
%17 = load i64, i64* %8
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = load i32, i32* %10
%21 = load i64, i64* %9
%22 = icmp eq i64 %21, 2
br i1 %22, label %23, label %24
23: ; preds = %16
store i32 -1, i32* %4
br label %27
24: ; preds = %16
%25 = load i64, i64* %9
%26 = trunc i64 %25 to i32
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %23
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
int fun_aa_int_release_so(int x[][5], int y[][5]) {
  return 20 + x[0][0] + y[0][0];
}


x86 assembly (clang, -O0):
<fun_aa_int_release_so>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x14,%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_aa_int_release_so>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
add    %ecx,%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_aa_int_release_so([5 x i32]* %0, [5 x i32]* %1) {
%3 = alloca [5 x i32]*
%4 = alloca [5 x i32]*
store [5 x i32]* %0, [5 x i32]** %3
store [5 x i32]* %1, [5 x i32]** %4
%5 = load [5 x i32]*, [5 x i32]** %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%8 = load i32, i32* %7
%9 = add nsw i32 20, %8
%10 = load [5 x i32]*, [5 x i32]** %4
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%13 = load i32, i32* %12
%14 = add nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fun_aa_int_release_so([5 x i32]* nocapture %0, [5 x i32]* nocapture %1) {
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 20
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void xl() {
  FILE *f;
  f = fopen("irina.log", "at");
  fputs("\n", f);
  fclose(f);
}


x86 assembly (clang, -O0):
<xl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xl>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"irina.log\00"
@.str.1 = [3 x i8] c"at\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @xl() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"irina.log\00"
@.str.1 = [3 x i8] c"at\00"
define void @xl() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fputc(i32 10, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
int Cyc_Tcutil_is_arithmetic_type(void *t) {
  return ({ Cyc_Tcutil_is_integral_type(t); }) ||
         ({ Cyc_Tcutil_is_any_float_type(t); });
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_is_arithmetic_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <Cyc_Tcutil_is_integral_type@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1161 <Cyc_Tcutil_is_arithmetic_type+0x41>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <Cyc_Tcutil_is_any_float_type@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_is_arithmetic_type>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Cyc_Tcutil_is_integral_type@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1138 <Cyc_Tcutil_is_arithmetic_type+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <Cyc_Tcutil_is_any_float_type@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cyc_Tcutil_is_arithmetic_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Tcutil_is_integral_type to i32 (i8*, ...)*)(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Tcutil_is_any_float_type to i32 (i8*, ...)*)(i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ true, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @Cyc_Tcutil_is_arithmetic_type(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Tcutil_is_integral_type to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Tcutil_is_any_float_type to i32 (i8*, ...)*)(i8* %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int iommu_calculate_max_sagaw(struct intel_iommu *iommu) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.intel_iommu = type opaque
define i32 @iommu_calculate_max_sagaw(%struct.intel_iommu* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_InitColormaps();
int /*<<< orphan*/ R_InitFlats();
int /*<<< orphan*/ R_InitSpriteLumps();
int /*<<< orphan*/ R_InitTextures();
int /*<<< orphan*/ printf(char *);
void R_InitData(void) {
  R_InitTextures();
  printf(".");
  R_InitFlats();
  printf(".");
  R_InitSpriteLumps();
  printf(".");
  R_InitColormaps();
}


x86 assembly (clang, -O0):
<R_InitData>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <R_InitTextures@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <R_InitFlats@plt>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <R_InitSpriteLumps@plt>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <R_InitColormaps@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_InitData>:
push   %rax
xor    %eax,%eax
call   1070 <R_InitTextures@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <R_InitFlats@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <R_InitSpriteLumps@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <R_InitColormaps@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define void @R_InitData() {
%1 = call i32 (...) @R_InitTextures()
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @R_InitFlats()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @R_InitSpriteLumps()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @R_InitColormaps()
ret void
}

LLVM IR (-O2):
define void @R_InitData() {
%1 = tail call i32 (...) @R_InitTextures()
%2 = tail call i32 @putchar(i32 46)
%3 = tail call i32 (...) @R_InitFlats()
%4 = tail call i32 @putchar(i32 46)
%5 = tail call i32 (...) @R_InitSpriteLumps()
%6 = tail call i32 @putchar(i32 46)
%7 = tail call i32 (...) @R_InitColormaps()
ret void
}
void CpuException() {}


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

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

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

LLVM IR (-O2):
define void @CpuException() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS] [[HOURS:][MINUTES:]SECONDS]\n"
          "\n"
          "alarm(1) is a timer based on alarm(3p).\n"
          "\n"
          "Options:\n"
          " -t or --timeout SEC   Set timeout in sec [default=5].\n"
          " -h or --help          Display this message.\n"
          " -V or --version       Display the version.\n"
          "\n"
          "Signals:\n"
          "SIGTERM                Terminate.\n"
          "SIGUSR1                Increment timeout by 1 sec.\n"
          "SIGUSR2                Decrement timeout by 1 sec.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [390 x i8] c"Usage: %s [OPTIONS] [[HOURS:][MINUTES:]SECONDS]\0A\0Aalarm(1) is a timer based on alarm(3p).\0A\0AOptions:\0A -t or --timeout SEC Set timeout in sec [default=5].\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\0ASignals:\0ASIGTERM Terminate.\0ASIGUSR1 Increment timeout by 1 sec.\0ASIGUSR2 Decrement timeout by 1 sec.\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [390 x i8] c"Usage: %s [OPTIONS] [[HOURS:][MINUTES:]SECONDS]\0A\0Aalarm(1) is a timer based on alarm(3p).\0A\0AOptions:\0A -t or --timeout SEC Set timeout in sec [default=5].\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\0ASignals:\0ASIGTERM Terminate.\0ASIGUSR1 Increment timeout by 1 sec.\0ASIGUSR2 Decrement timeout by 1 sec.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int resolve_addr(struct sockaddr *, char *);
int /*<<< orphan*/ stderr;
void resolve(struct sockaddr *addr, char *hostname) {
  if (resolve_addr(addr, hostname) == -1) {
    fprintf(stderr, "Unable to resolve '%s'\n", hostname);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <resolve_addr@plt>
cmp    $0xffffffff,%eax
jne    1179 <resolve+0x49>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
push   %rbx
mov    %rsi,%rbx
call   1030 <resolve_addr@plt>
cmp    $0xffffffff,%eax
je     1140 <resolve+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [24 x i8] c"Unable to resolve '%s'\0A\00"
define void @resolve(%struct.sockaddr* %0, i8* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i8*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i8* %1, i8** %4
%5 = load %struct.sockaddr*, %struct.sockaddr** %3
%6 = load i8*, i8** %4
%7 = call i32 @resolve_addr(%struct.sockaddr* %5, i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [24 x i8] c"Unable to resolve '%s'\0A\00"
define void @resolve(%struct.sockaddr* %0, i8* %1) {
%3 = tail call i32 @resolve_addr(%struct.sockaddr* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ *strchr(char *, int);
int get_ok_char(void) {
  int c;
  while ((c = getchar()) != EOF && strchr("yYnN", c) == NULL)
    continue;
  return c;
}


x86 assembly (clang, -O0):
<get_ok_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2eab(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1161 <get_ok_char+0x41>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1171 <get_ok_char+0x51>
jmp    1176 <get_ok_char+0x56>
jmp    1128 <get_ok_char+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ok_char>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ebd(%rip),%rbx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    (%rbx),%eax
je     115c <get_ok_char+0x3c>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1140 <get_ok_char+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"yYnN\00"
define i32 @get_ok_char() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp eq i32* %8, null
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"yYnN\00"
define i32 @get_ok_char() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = icmp eq i32* %6, null
br i1 %7, label %1, label %8
8: ; preds = %1, %5
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = atoi(argv[1]);
  printf("%d", ((((3 * x + 2) * x - 5) * x - 1) * x + 7) * x - 6);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x14(%rbp),%esi
add    $0x2,%esi
imul   -0x14(%rbp),%esi
sub    $0x5,%esi
imul   -0x14(%rbp),%esi
sub    $0x1,%esi
imul   -0x14(%rbp),%esi
add    $0x7,%esi
imul   -0x14(%rbp),%esi
sub    $0x6,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
lea    (%rax,%rax,2),%esi
add    $0x2,%esi
imul   %eax,%esi
add    $0xfffffffb,%esi
imul   %eax,%esi
add    $0xffffffff,%esi
imul   %eax,%esi
add    $0x7,%esi
imul   %eax,%esi
add    $0xfffffffa,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = mul nsw i32 3, %11
%13 = add nsw i32 %12, 2
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = sub nsw i32 %15, 5
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* %6
%21 = mul nsw i32 %19, %20
%22 = add nsw i32 %21, 7
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = sub nsw i32 %24, 6
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = mul nsw i32 %5, 3
%7 = add nsw i32 %6, 2
%8 = mul nsw i32 %7, %5
%9 = add nsw i32 %8, -5
%10 = mul nsw i32 %9, %5
%11 = add nsw i32 %10, -1
%12 = mul nsw i32 %11, %5
%13 = add nsw i32 %12, 7
%14 = mul nsw i32 %13, %5
%15 = add nsw i32 %14, -6
%16 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_mutex_destroy(int /*<<< orphan*/ *);
int my_pthread_mutex_destroy(pthread_mutex_t *__mutex) {
  int ret;
  pthread_mutex_t *realmutex = (pthread_mutex_t *)*(int *)__mutex;
  ret = pthread_mutex_destroy(realmutex);
  free(realmutex);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_mutex_destroy>:
push   %rbp
push   %rbx
push   %rax
movslq (%rdi),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_pthread_mutex_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_mutex_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_mutex_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_mutex_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void CONV_OUT_32(uint8_t *buf, uint32_t i) {
  buf[0] = (i >> 24) & 0xFF;
  buf[1] = (i >> 16) & 0xFF;
  buf[2] = (i >> 8) & 0xFF;
  buf[3] = i & 0xFF;
}


x86 assembly (clang, -O0):
<CONV_OUT_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONV_OUT_32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @CONV_OUT_32(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @CONV_OUT_32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_open(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int len;
  my_open(argc, argv);
  printf("httpd server\n");
  while (1)
    ;
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <my_open@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <my_open@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [14 x i8] c"httpd server\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @my_open(i32 %7, i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %2, %11
br label %11
}

LLVM IR (-O2):
@str = [13 x i8] c"httpd server\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @my_open(i32 %0, i8** %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %5, %2
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ m_free_(void *, char *, int);
void m_free_compat(void *memptr) {
  m_free_(memptr,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/"
          "z88dk/src/z80asm/lib/alloc.c",
          372);
}


x86 assembly (clang, -O0):
<m_free_compat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x174,%edx
call   1030 <m_free_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_free_compat>:
lea    0xee9(%rip),%rsi
mov    $0x174,%edx
jmp    1030 <m_free_@plt>

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/src/z80asm/lib/alloc.c\00"
define void @m_free_compat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @m_free_(i8* %3, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 372)
ret void
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/src/z80asm/lib/alloc.c\00"
define void @m_free_compat(i8* %0) {
%2 = tail call i32 @m_free_(i8* %0, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 372)
ret void
}
unsigned int reg_read32(unsigned int address) {
  unsigned int *mem = (unsigned int *)address;
  return *mem;
}


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

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

LLVM IR (-O0):
define i32 @reg_read32(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @reg_read32(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
void NullTextC(struct ADrawTag *ctx __attribute__((unused)),
               unsigned int x __attribute__((unused)),
               unsigned int y __attribute__((unused)),
               const char *string __attribute__((unused))) {}


x86 assembly (clang, -O0):
<NullTextC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define void @NullTextC(%struct.ADrawTag* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.ADrawTag*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.ADrawTag* %0, %struct.ADrawTag** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define void @NullTextC(%struct.ADrawTag* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}