xunge/DecIR huggingface dataset:
int motion_test1(int data, int data_0, int data_3, int v) {
  int i;
  int t, u;
  if (data)
    i = data_0 + data_3;
  else {
    v = 2;
    i = 5;
  }
  t = data_0 + data_3;
  u = i;
  return v * t * u;
}


x86 assembly (clang, -O0):
<motion_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1128 <motion_test1+0x28>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <motion_test1+0x36>
movl   $0x2,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_test1>:
add    %esi,%edx
test   %edi,%edi
mov    $0x5,%esi
cmovne %edx,%esi
mov    $0x2,%eax
cmovne %ecx,%eax
imul   %edx,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @motion_test1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 0
%6 = add nsw i32 %2, %1
%7 = select i1 %5, i32 5, i32 %6
%8 = select i1 %5, i32 2, i32 %3
%9 = mul nsw i32 %8, %6
%10 = mul nsw i32 %9, %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int c, a, b;
  while (scanf("%d %d", &a, &b) == 2) {
    printf("%d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    116a <main+0x4a>
mov    -0x18(%rbp),%esi
add    -0x1c(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1182 <main+0x62>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2, %9
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%15 = icmp eq i32 %14, 2
br i1 %15, label %9, label %16
16: ; preds = %9, %2
ret i32 0
}
int y(double i) { return i <= (i + 2.0); }


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<y>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @y(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.000000e+00
%6 = fcmp ole double %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @y(double %0) {
%2 = fadd double %0, 2.000000e+00
%3 = fcmp oge double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void quit(er) char *er;
{
  printf("0\n%s\n", er);
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"0\0A%s\0A\00"
define void @quit(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
double ceil(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a, b;
  printf("Input a real number:");
  scanf("%lf", &a);
  b = ceil(a);
  printf("\t    Integer:%f\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <ceil@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"\09 Integer:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.ceil.f64(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"\09 Integer:%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.ceil.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
scalar_t__ ASRT_Ptr(int *, int /*<<< orphan*/ *);
int test_PtrAndNull() {
  int x;
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              110,
              "&x"
              " == "
              "NULL");
    if (ASRT_Ptr(&x, NULL)) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_PtrAndNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x6e,%esi
lea    0xf55(%rip),%rdx
call   1040 <ASRT_Mark@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ASRT_Ptr@plt>
cmp    $0x0,%rax
je     1163 <test_PtrAndNull+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116f <test_PtrAndNull+0x4f>
jmp    1168 <test_PtrAndNull+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_PtrAndNull>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x6e,%esi
call   1040 <ASRT_Mark@plt>
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <ASRT_Ptr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [11 x i8] c"&x == NULL\00"
define i32 @test_PtrAndNull() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0
%4 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i64 @ASRT_Ptr(i32* %2, i32* null)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 1, i32* %1
br label %10
8: ; preds = %3
br label %9
9: ; preds = %8
store i32 0, i32* %1
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [11 x i8] c"&x == NULL\00"
define i32 @test_PtrAndNull() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 @ASRT_Ptr(i32* %1, i32* null)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t Function1Int32(int32_t x) { return x + 42; }


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

x86 assembly (clang, -O2):
<Function1Int32>:
lea    0x2a(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @Function1Int32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 42
ret i64 %4
}

LLVM IR (-O2):
define i64 @Function1Int32(i64 %0) {
%2 = add nsw i64 %0, 42
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int factorial(int n) {
  printf("local variable n at %p has value %d\n", &n, n);
  if (n == 0) {
    return 1;
  } else {
    int res = factorial(n - 1);
    return n * res;
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1154 <factorial+0x34>
movl   $0x1,-0x4(%rbp)
jmp    116c <factorial+0x4c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
mov    %edi,%edx
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     114f <factorial+0x2f>
add    $0xffffffff,%edi
call   1030 <factorial@plt>
imul   0x4(%rsp),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"local variable n at %p has value %d\0A\00"
define i32 @factorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %3, i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @factorial(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [37 x i8] c"local variable n at %p has value %d\0A\00"
define i32 @factorial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %2, i32 %0)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = add nsw i32 %4, -1
%8 = call i32 @factorial(i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
br label %11
11: ; preds = %1, %6
%12 = phi i32 [ %10, %6 ], [ 1, %1 ]
ret i32 %12
}
float nsvg__absf(float x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<nsvg__absf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <nsvg__absf+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <nsvg__absf+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__absf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @nsvg__absf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xb5() {
  Assert_real((iscntrl(181) == 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",
              910, ("iscntrl should be 0 for 0xb5"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xb5>:
push   %rax
mov    $0xb5,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x38e,%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 0xb5\00"
define void @t_iscntrl_0xb5() {
%1 = call i64 @iscntrl(i32 181)
%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 910, 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 0xb5\00"
define void @t_iscntrl_0xb5() {
%1 = tail call i64 @iscntrl(i32 181)
%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 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int remove_trailing_spaces(char *fname) {
  printf("%s", fname);
  return 0;
}


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

x86 assembly (clang, -O2):
<remove_trailing_spaces>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @remove_trailing_spaces(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int strB(const char *s, int c) {
  int ret;
  if (c == s[0]) {
    ret = 1;
  } else {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1129 <strB+0x29>
movl   $0x1,-0x10(%rbp)
jmp    1130 <strB+0x30>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strB>:
movsbl (%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @strB(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %6, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %5
br label %14
13: ; preds = %2
store i32 0, i32* %5
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @strB(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t strlen(char *);
char *str_dup(char *source) {
  size_t len = strlen(source);
  char *dest = malloc((len + 1) * sizeof(char));
  memcpy(dest, source, len + 1);
  return dest;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 %8, 1
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = call i32 @memcpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int get_tc();
int /*<<< orphan*/ putl_k(int);
int /*<<< orphan*/ puts_k(char *);
void timer() {
  puts_k("!!!");
  putl_k(get_tc() & 0xffffffff);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <puts_k@plt>
mov    $0x0,%al
call   1050 <get_tc@plt>
mov    %eax,%edi
and    $0xffffffff,%edi
call   1040 <putl_k@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts_k@plt>
xor    %eax,%eax
call   1050 <get_tc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <putl_k@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"!!!\00"
define void @timer() {
%1 = call i32 @puts_k(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @get_tc()
%3 = and i32 %2, -1
%4 = call i32 @putl_k(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"!!!\00"
define void @timer() {
%1 = tail call i32 @puts_k(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @get_tc()
%3 = tail call i32 @putl_k(i32 %2)
ret void
}
shutdown() {}


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

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

LLVM IR (-O0):
define i32 @shutdown() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @shutdown() {
ret i32 undef
}
void oled_rgb(unsigned char r, unsigned char g, unsigned char b,
              unsigned char color[3]) {
  color[0] = b / 4;
  color[1] = g / 4;
  color[2] = r / 4;
}


x86 assembly (clang, -O0):
<oled_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rcx,-0x10(%rbp)
movzbl -0x3(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x2(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movzbl -0x1(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_rgb>:
shr    $0x2,%dl
mov    %dl,(%rcx)
shr    $0x2,%sil
mov    %sil,0x1(%rcx)
shr    $0x2,%dil
mov    %dil,0x2(%rcx)
ret

LLVM IR (-O0):
define void @oled_rgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %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* %7
%10 = zext i8 %9 to i32
%11 = sdiv i32 %10, 4
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %8
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = sdiv i32 %16, 4
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %8
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 %18, i8* %20
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = sdiv i32 %22, 4
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %8
%26 = getelementptr inbounds i8, i8* %25, i64 2
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @oled_rgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* nocapture writeonly %3) {
%5 = lshr i8 %2, 2
store i8 %5, i8* %3
%6 = lshr i8 %1, 2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %6, i8* %7
%8 = lshr i8 %0, 2
%9 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %8, i8* %9
ret void
}
/* Type definitions */
struct HashItrCons {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct HashItrCons *);
void HashDeleteItrCons(struct HashItrCons *Itr) { free(Itr); }


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

x86 assembly (clang, -O2):
<HashDeleteItrCons>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.HashItrCons = type { i32 }
define void @HashDeleteItrCons(%struct.HashItrCons* nocapture %0) {
%2 = tail call i32 @free(%struct.HashItrCons* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_clear(void) { printf("\033[2J\033[1;1H"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @term_clear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @term_clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
double nearest_planet(stell_mass_ratio)
double stell_mass_ratio;
{ return (0.3 * pow(stell_mass_ratio, (1.0 / 3.0))); }


x86 assembly (clang, -O0):
<nearest_planet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearest_planet>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nearest_planet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 3.000000e-01, %4
ret double %5
}

LLVM IR (-O2):
define double @nearest_planet(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 3.000000e-01
ret double %3
}
int main() {
  int i = 0;
  int sum = 0;
  for (i = 0; i < 10; i++) {
    if (i < 5) {
      continue;
    }
    sum++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1150 <main+0x50>
cmpl   $0x5,-0x8(%rbp)
jge    1139 <main+0x39>
jmp    1142 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <main+0x20>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ printf(char *);
int main() {
  char *arglist[2];
  arglist[0] = "ls";
  arglist[1] = NULL;
  printf("*** About to exec ls - l\n");
  execvp("ls", arglist);
  printf("*** ls is done. bye\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <execvp@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
mov    %rbx,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <execvp@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [26 x i8] c"*** About to exec ls - l\0A\00"
@.str.2 = [21 x i8] c"*** ls is done. bye\0A\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@str = [25 x i8] c"*** About to exec ls - l\00"
@str.3 = [20 x i8] c"*** ls is done. bye\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/"
               "heads/master/include/h2o/memory.h"
               ":"
               "320"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/heads/master/include/h2o/memory.h:320:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/heads/master/include/h2o/memory.h:320:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}
extern int stat(void) {}


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

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

LLVM IR (-O0):
define i32 @stat() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @stat() {
ret i32 undef
}
void x1(void) {
  extern void x2(void);
  x2();
}


x86 assembly (clang, -O0):
<x1>:
push   %rbp
mov    %rsp,%rbp
call   1030 <x2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1>:
jmp    1030 <x2@plt>

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

LLVM IR (-O2):
define void @x1() {
tail call void @x2()
ret void
}
unsigned char crc(unsigned char data) {
  unsigned char crc = data & 1;
  unsigned int i;
  for (i = 1; i < 8; i++)
    crc ^= (data >> i) & 1;
  return crc;
}


x86 assembly (clang, -O0):
<crc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x2(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jae    114a <crc+0x4a>
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
and    $0x1,%ecx
movzbl -0x2(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x2(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <crc+0x1b>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc>:
mov    %edi,%eax
shr    %al
xor    %dil,%al
mov    %edi,%ecx
shr    $0x2,%cl
mov    %edi,%edx
shr    $0x3,%dl
xor    %cl,%dl
xor    %al,%dl
mov    %edi,%eax
shr    $0x4,%al
mov    %edi,%ecx
shr    $0x5,%cl
xor    %al,%cl
mov    %edi,%eax
shr    $0x6,%al
xor    %cl,%al
xor    %dl,%al
and    $0x1,%al
shr    $0x7,%dil
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @crc(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
store i32 1, i32* %4
br label %9
9: ; preds = %22, %1
%10 = load i32, i32* %4
%11 = icmp ult i32 %10, 8
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = and i32 %16, 1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = xor i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %22
22: ; preds = %12
%23 = load i32, i32* %4
%24 = add i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %9
%26 = load i8, i8* %3
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @crc(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = xor i8 %2, %0
%4 = lshr i8 %0, 2
%5 = xor i8 %4, %3
%6 = lshr i8 %0, 3
%7 = xor i8 %6, %5
%8 = lshr i8 %0, 4
%9 = xor i8 %8, %7
%10 = lshr i8 %0, 5
%11 = xor i8 %10, %9
%12 = lshr i8 %0, 6
%13 = xor i8 %12, %11
%14 = and i8 %13, 1
%15 = lshr i8 %0, 7
%16 = xor i8 %15, %14
ret i8 %16
}
/* Variables and functions */
int semget(int, int, int /*<<< orphan*/);
int asociarseSemaforo(int key) { return (semget(key, 1, 0)); }


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

x86 assembly (clang, -O2):
<asociarseSemaforo>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <semget@plt>

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

LLVM IR (-O2):
define i32 @asociarseSemaforo(i32 %0) {
%2 = tail call i32 @semget(i32 %0, i32 1, i32 0)
ret i32 %2
}
void get_cpu_stats(struct sysinfo *info) { (void)info; }


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

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

LLVM IR (-O0):
%struct.sysinfo = type opaque
define void @get_cpu_stats(%struct.sysinfo* %0) {
%2 = alloca %struct.sysinfo*
store %struct.sysinfo* %0, %struct.sysinfo** %2
%3 = load %struct.sysinfo*, %struct.sysinfo** %2
ret void
}

LLVM IR (-O2):
%struct.sysinfo = type opaque
define void @get_cpu_stats(%struct.sysinfo* nocapture %0) {
ret void
}
int device_open() { return -1; }


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

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

LLVM IR (-O0):
define i32 @device_open() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @device_open() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *other_decode_bitfield_value(char *, int /*<<< orphan*/ const,
                                  int /*<<< orphan*/ const, int const);
char *stpcpy(char *, char *);
char *decode_bitfield_value(char *buf, const uint64_t val, const uint64_t mask,
                            const int width) {
  char *p;
  p = other_decode_bitfield_value(buf, val, mask, width);
  p = stpcpy(p, " = ");
  return p;
}


x86 assembly (clang, -O0):
<decode_bitfield_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <other_decode_bitfield_value@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_bitfield_value>:
push   %rax
call   1030 <other_decode_bitfield_value@plt>
movl   $0x203d20,(%rax)
add    $0x3,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" = \00"
define i8* @decode_bitfield_value(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i8* @other_decode_bitfield_value(i8* %10, i32 %11, i32 %12, i32 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = call i8* @stpcpy(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %16, i8** %9
%17 = load i8*, i8** %9
ret i8* %17
}

LLVM IR (-O2):
define i8* @decode_bitfield_value(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i8* @other_decode_bitfield_value(i8* %0, i32 %1, i32 %2, i32 %3)
%6 = getelementptr i8, i8* %5, i64 3
%7 = bitcast i8* %5 to i32*
store i32 2112800, i32* %7
ret i8* %6
}
float stbtt__oversample_shift(int oversample) {
  if (!oversample)
    return 0.0f;
  return (float)-(oversample - 1) / (2.0f * (float)oversample);
}


x86 assembly (clang, -O0):
<stbtt__oversample_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <stbtt__oversample_shift+0x1e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1146 <stbtt__oversample_shift+0x46>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm2
movss  0xec7(%rip),%xmm1
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbtt__oversample_shift>:
test   %edi,%edi
je     111c <stbtt__oversample_shift+0x1c>
mov    $0x1,%eax
sub    %edi,%eax
cvtsi2ss %eax,%xmm0
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm1
divss  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @stbtt__oversample_shift(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = sub nsw i32 0, %9
%11 = sitofp i32 %10 to float
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = fmul float 2.000000e+00, %13
%15 = fdiv float %11, %14
store float %15, float* %2
br label %16
16: ; preds = %7, %6
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @stbtt__oversample_shift(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = sub i32 1, %0
%5 = sitofp i32 %4 to float
%6 = sitofp i32 %0 to float
%7 = fmul float %6, 2.000000e+00
%8 = fdiv float %5, %7
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 0.000000e+00, %1 ]
ret float %10
}
int yodel_finalize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yodel_finalize() {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *sleft(char *str, int len) {
  if (strlen(str) > len) {
    str[len] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<sleft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0xc(%rbp),%eax
jle    113d <sleft+0x2d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleft>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jle    1128 <sleft+0x18>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @sleft(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 = call i32 @strlen(i8* %5)
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %9, %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @sleft(i8* returned %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, %1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %5, %2
ret i8* %0
}
int MBtoByte(int mb) { return (mb * 1048576); }


x86 assembly (clang, -O0):
<MBtoByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x14,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MBtoByte>:
mov    %edi,%eax
shl    $0x14,%eax
ret

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

LLVM IR (-O2):
define i32 @MBtoByte(i32 %0) {
%2 = shl nsw i32 %0, 20
ret i32 %2
}
void RTTimeProgramMicroTS(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeProgramMicroTS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_CHLD(int /*<<< orphan*/);
int gen_CHLD() {
  handle_CHLD(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_CHLD>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_CHLD@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_CHLD() {
%1 = call i32 @handle_CHLD(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_CHLD() {
%1 = tail call i32 @handle_CHLD(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
char *strstr(char *, char *);
int get_cell_nb_spes(void) {
  FILE *f;
  char *s, *pos;
  return -1;
  f = fopen("/proc/cpuinfo", "r");
  if (!f)
    return -1;
  s = calloc(1, 81);
  if (!s) {
    fclose(f);
    return -1;
  }
  while (fgets(s, 80, f)) {
    pos = strstr(s, "Cell Broadband Engine");
    if (pos) {
      fclose(f);
      free(s);
      return 6;
    }
  }
  fclose(f);
  free(s);
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @get_cell_nb_spes() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i8*
ret i32 -1
}

LLVM IR (-O2):
define i32 @get_cell_nb_spes() {
ret i32 -1
}