xunge/DecIR huggingface dataset:
/* Variables and functions */
long double logl(scalar_t__);
scalar_t__ sqrtl(long double);
long double asinhl(long double x) { return logl(x + sqrtl(x * x + 1.L)); }


x86 assembly (clang, -O0):
<asinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x30(%rbp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <sqrtl@plt>
fldt   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
faddp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x22(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <logl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
fstpt  (%rsp)
call   1040 <sqrtl@plt>
mov    %rax,0x18(%rsp)
fildll 0x18(%rsp)
fldt   0x2c(%rsp)
faddp  %st,%st(1)
fnstcw 0x14(%rsp)
movzwl 0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x16(%rsp)
fldcw  0x16(%rsp)
fistpll 0x20(%rsp)
fldcw  0x14(%rsp)
mov    0x20(%rsp),%rdi
add    $0x38,%rsp
jmp    1030 <logl@plt>

LLVM IR (-O0):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 %5, x86_fp80 0xK3FFF8000000000000000)
%7 = call i64 @sqrtl(x86_fp80 %6)
%8 = sitofp i64 %7 to x86_fp80
%9 = fadd x86_fp80 %3, %8
%10 = fptosi x86_fp80 %9 to i64
%11 = call x86_fp80 @logl(i64 %10)
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%3 = tail call i64 @sqrtl(x86_fp80 %2)
%4 = sitofp i64 %3 to x86_fp80
%5 = fadd x86_fp80 %4, %0
%6 = fptosi x86_fp80 %5 to i64
%7 = tail call x86_fp80 @logl(i64 %6)
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ glColor4bv(char *);
void Color4bv(signed char v[4]) { glColor4bv(v); }


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

x86 assembly (clang, -O2):
<Color4bv>:
jmp    1030 <glColor4bv@plt>

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

LLVM IR (-O2):
define void @Color4bv(i8* %0) {
%2 = tail call i32 @glColor4bv(i8* %0)
ret void
}
float __max_float(float x, float y) { return ((x) > (y) ? (x) : (y)); }


x86 assembly (clang, -O0):
<__max_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <__max_float+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <__max_float+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_float>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__max_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @__max_float(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int get_bit(int in, int bit) { return (in & (1 << bit)) >> bit; }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = ashr i32 %4, %1
ret i32 %5
}
_Complex long long f25(void) {}


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

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

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

LLVM IR (-O2):
define { i64, i64 } @f25() {
ret { i64, i64 } undef
}
/* Type definitions */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest_w_filter(struct kdtree *, double const *,
                                  int /*<<< orphan*/ *);
struct kdres *kd_nearest(struct kdtree *kd, const double *pos) {
  return kd_nearest_w_filter(kd, pos, NULL);
}


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

x86 assembly (clang, -O2):
<kd_nearest>:
xor    %edx,%edx
jmp    1030 <kd_nearest_w_filter@plt>

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest(%struct.kdtree* %0, double* %1) {
%3 = alloca %struct.kdtree*
%4 = alloca double*
store %struct.kdtree* %0, %struct.kdtree** %3
store double* %1, double** %4
%5 = load %struct.kdtree*, %struct.kdtree** %3
%6 = load double*, double** %4
%7 = call %struct.kdres* @kd_nearest_w_filter(%struct.kdtree* %5, double* %6, i32* null)
ret %struct.kdres* %7
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest(%struct.kdtree* %0, double* %1) {
%3 = tail call %struct.kdres* @kd_nearest_w_filter(%struct.kdtree* %0, double* %1, i32* null)
ret %struct.kdres* %3
}
int bit_population_count2(unsigned int n) {
  unsigned int i = 0;
  for (i = 0; n; i++)
    n &= (n - 1);
  return i;
}


x86 assembly (clang, -O0):
<bit_population_count2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <bit_population_count2+0x39>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bit_population_count2+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_population_count2>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bit_population_count2+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bit_population_count2+0x10>
ret

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

LLVM IR (-O2):
define i32 @bit_population_count2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
void jpeg_idct_4x4(void) {}


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

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

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

LLVM IR (-O2):
define void @jpeg_idct_4x4() {
ret void
}
double f4_cb_send_pre_int_int_int_int_short(double (*cb)(int, int, int, int,
                                                         short)) {
  short r = -22;
  return cb(8, 9, 10, 11, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0xffea,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
movswl -0xa(%rbp),%r8d
call   *%rax
movsd  0xec7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_short>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xffffffea,%r8d
call   *%rax
addsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_short(double (i32, i32, i32, i32, i16)* %0) {
%2 = alloca double (i32, i32, i32, i32, i16)*
%3 = alloca i16
store double (i32, i32, i32, i32, i16)* %0, double (i32, i32, i32, i32, i16)** %2
store i16 -22, i16* %3
%4 = load double (i32, i32, i32, i32, i16)*, double (i32, i32, i32, i32, i16)** %2
%5 = load i16, i16* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, i16 signext %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_short(double (i32, i32, i32, i32, i16)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, i16 signext -22)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Section4Fourth(int number) { printf(" %d |\n", number % 10); }


x86 assembly (clang, -O0):
<Section4Fourth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section4Fourth>:
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    0xecb(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c" %d |\0A\00"
define void @Section4Fourth(i32 %0) {
%2 = srem i32 %0, 10
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ usage();
int isDirectory(char *filename) {
  struct stat status;
  int rc = stat(filename, &status);
  if (rc) {
    perror(filename);
    usage();
  } else {
    return S_ISDIR(status.st_mode);
  }
  return 0;
}


x86 assembly (clang, -O0):
<isDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     117b <isDirectory+0x3b>
mov    -0x10(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    118b <isDirectory+0x4b>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
jmp    1192 <isDirectory+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDirectory>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %eax,%eax
jne    1164 <isDirectory+0x24>
mov    0x8(%rsp),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <S_ISDIR@plt>
mov    %rbx,%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @perror(i8* %11)
%13 = call i32 (...) @usage()
br label %18
14: ; preds = %1
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @S_ISDIR(i32 %16)
store i32 %17, i32* %2
br label %19
18: ; preds = %10
store i32 0, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 (...) @usage()
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = tail call i32 @S_ISDIR(i32 %11)
br label %13
13: ; preds = %6, %9
%14 = phi i32 [ 0, %6 ], [ %12, %9 ]
ret i32 %14
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hide(struct graph *, int);
void hide2(struct graph *g, int a, int b) {
  hide(g, a);
  hide(g, b);
}


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

x86 assembly (clang, -O2):
<hide2>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <hide@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hide@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @hide2(%struct.graph* %0, i32 %1, i32 %2) {
%4 = alloca %struct.graph*
%5 = alloca i32
%6 = alloca i32
store %struct.graph* %0, %struct.graph** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.graph*, %struct.graph** %4
%8 = load i32, i32* %5
%9 = call i32 @hide(%struct.graph* %7, i32 %8)
%10 = load %struct.graph*, %struct.graph** %4
%11 = load i32, i32* %6
%12 = call i32 @hide(%struct.graph* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @hide2(%struct.graph* %0, i32 %1, i32 %2) {
%4 = tail call i32 @hide(%struct.graph* %0, i32 %1)
%5 = tail call i32 @hide(%struct.graph* %0, i32 %2)
ret void
}
void __attribute__((warning(
    "curl_easy_setopt expects a curl_write_callback argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_write_callback(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_write_callback() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t5() {
  int a[] = {20, 30, 40};
  int *b = a + 1;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c",
          32, 30, *b);
  ;
}


x86 assembly (clang, -O0):
<t5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec7(%rip),%rdi
mov    $0x20,%esi
mov    $0x1e,%edx
call   1030 <fexpect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t5>:
lea    0xee9(%rip),%rdi
mov    $0x20,%esi
mov    $0x1e,%edx
mov    $0x1e,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@__const.t5.a = [3 x i32] [i32 20, i32 30, i32 40]
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t5() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 32, i32 30, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t5() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 32, i32 30, i32 30)
ret void
}
/* Type definitions */
struct vlc_h2_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UINT64_C(int);
struct vlc_h2_frame *vlc_h2_frame_ping(int /*<<< orphan*/);
struct vlc_h2_frame *ping(void) {
  return vlc_h2_frame_ping(UINT64_C(0x1122334455667788));
}


x86 assembly (clang, -O0):
<ping>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55667788,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edi
call   1040 <vlc_h2_frame_ping@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ping>:
push   %rax
mov    $0x55667788,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <vlc_h2_frame_ping@plt>

LLVM IR (-O0):
%struct.vlc_h2_frame = type { i32 }
define %struct.vlc_h2_frame* @ping() {
%1 = call i32 @UINT64_C(i32 1432778632)
%2 = call %struct.vlc_h2_frame* @vlc_h2_frame_ping(i32 %1)
ret %struct.vlc_h2_frame* %2
}

LLVM IR (-O2):
%struct.vlc_h2_frame = type { i32 }
define %struct.vlc_h2_frame* @ping() {
%1 = tail call i32 @UINT64_C(i32 1432778632)
%2 = tail call %struct.vlc_h2_frame* @vlc_h2_frame_ping(i32 %1)
ret %struct.vlc_h2_frame* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void uint32_to_uint64(int negative, uint8_t *buffer) {
  if (negative) {
    buffer[4] = 0xff;
    buffer[5] = 0xff;
    buffer[6] = 0xff;
    buffer[7] = 0xff;
  } else {
    buffer[4] = 0;
    buffer[5] = 0;
    buffer[6] = 0;
    buffer[7] = 0;
  }
}


x86 assembly (clang, -O0):
<uint32_to_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <uint32_to_uint64+0x46>
mov    -0x10(%rbp),%rax
movl   $0xff,0x10(%rax)
mov    -0x10(%rbp),%rax
movl   $0xff,0x14(%rax)
mov    -0x10(%rbp),%rax
movl   $0xff,0x18(%rax)
mov    -0x10(%rbp),%rax
movl   $0xff,0x1c(%rax)
jmp    1172 <uint32_to_uint64+0x72>
mov    -0x10(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x18(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_to_uint64>:
test   %edi,%edi
mov    $0xff,%eax
cmove  %edi,%eax
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @uint32_to_uint64(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32 255, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 5
store i32 255, i32* %11
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 6
store i32 255, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 7
store i32 255, i32* %15
br label %25
16: ; preds = %2
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 4
store i32 0, i32* %18
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 5
store i32 0, i32* %20
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 6
store i32 0, i32* %22
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 7
store i32 0, i32* %24
br label %25
25: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
define void @uint32_to_uint64(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 0, i32 255
%5 = getelementptr inbounds i32, i32* %1, i64 4
%6 = insertelement <4 x i32> poison, i32 %4, i64 0
%7 = shufflevector <4 x i32> %6, <4 x i32> poison, <4 x i32> zeroinitializer
%8 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> %7, <4 x i32>* %8
ret void
}
unsigned long factorial(char n) {
  if (n <= 1) {
    return 1;
  } else if (n > 20) {
    return 0;
  }
  return n * factorial(n - 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jg     1138 <factorial+0x28>
movq   $0x1,-0x8(%rbp)
jmp    117e <factorial+0x6e>
movsbl -0x9(%rbp),%eax
cmp    $0x14,%eax
jle    1152 <factorial+0x42>
movq   $0x0,-0x8(%rbp)
jmp    117e <factorial+0x6e>
jmp    1157 <factorial+0x47>
movsbq -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
sub    $0x1,%eax
movsbl %al,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%dil
jl     1140 <factorial+0x40>
movzbl %dil,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    $0x14,%rdx
ja     113c <factorial+0x3c>
imul   %rdx,%rax
lea    -0x1(%rdx),%rsi
cmp    $0x2,%rdx
mov    %rsi,%rdx
ja     1120 <factorial+0x20>
mov    $0x1,%ecx
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @factorial(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 1, i64* %2
br label %23
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sgt i32 %10, 20
br i1 %11, label %12, label %13
12: ; preds = %8
store i64 0, i64* %2
br label %23
13: ; preds = %8
br label %14
14: ; preds = %13
%15 = load i8, i8* %3
%16 = sext i8 %15 to i64
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 1
%20 = trunc i32 %19 to i8
%21 = call i64 @factorial(i8 signext %20)
%22 = mul i64 %16, %21
store i64 %22, i64* %2
br label %23
23: ; preds = %14, %12, %7
%24 = load i64, i64* %2
ret i64 %24
}

LLVM IR (-O2):
define i64 @factorial(i8 signext %0) {
%2 = icmp slt i8 %0, 2
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = zext i8 %0 to i64
br label %5
5: ; preds = %3, %9
%6 = phi i64 [ %4, %3 ], [ %10, %9 ]
%7 = phi i64 [ 1, %3 ], [ %11, %9 ]
%8 = icmp ugt i64 %6, 20
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = add nsw i64 %6, -1
%11 = mul i64 %7, %6
%12 = icmp ult i64 %6, 3
br i1 %12, label %13, label %5
13: ; preds = %5, %9
%14 = phi i64 [ %11, %9 ], [ %7, %5 ]
%15 = phi i64 [ 1, %9 ], [ 0, %5 ]
%16 = mul nuw nsw i64 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i64 [ %16, %13 ], [ 1, %1 ]
ret i64 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int vfwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
             int /*<<< orphan*/);
int __isoc99_vfwscanf(FILE *restrict stream, const wchar_t *restrict format,
                      va_list args) {
  return vfwscanf(stream, format, args);
}


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

x86 assembly (clang, -O2):
<__isoc99_vfwscanf>:
jmp    1030 <vfwscanf@plt>

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

LLVM IR (-O2):
define i32 @__isoc99_vfwscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = tail call i32 @vfwscanf(i32* %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_high(int, int);
int /*<<< orphan*/ gpio_low(int, int);
void c2_pulse(void) {
  gpio_low(4, 11);
  gpio_high(4, 11);
}


x86 assembly (clang, -O0):
<c2_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0xb,%esi
call   1030 <gpio_low@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1040 <gpio_high@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2_pulse>:
push   %rax
mov    $0x4,%edi
mov    $0xb,%esi
call   1030 <gpio_low@plt>
mov    $0x4,%edi
mov    $0xb,%esi
pop    %rax
jmp    1040 <gpio_high@plt>

LLVM IR (-O0):
define void @c2_pulse() {
%1 = call i32 @gpio_low(i32 4, i32 11)
%2 = call i32 @gpio_high(i32 4, i32 11)
ret void
}

LLVM IR (-O2):
define void @c2_pulse() {
%1 = tail call i32 @gpio_low(i32 4, i32 11)
%2 = tail call i32 @gpio_high(i32 4, i32 11)
ret void
}
/* Type definitions */
struct token {
  int dummy;
};
struct decl_state {
  int dummy;
};

/* Variables and functions */
struct token *direct_declarator(struct token *, struct decl_state *);
struct token *pointer(struct token *, struct decl_state *);
struct token *declarator(struct token *token, struct decl_state *ctx) {
  token = pointer(token, ctx);
  return direct_declarator(token, ctx);
}


x86 assembly (clang, -O0):
<declarator>:
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   1040 <pointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <direct_declarator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declarator>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pointer@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <direct_declarator@plt>

LLVM IR (-O0):
%struct.token = type { i32 }
%struct.decl_state = type { i32 }
define %struct.token* @declarator(%struct.token* %0, %struct.decl_state* %1) {
%3 = alloca %struct.token*
%4 = alloca %struct.decl_state*
store %struct.token* %0, %struct.token** %3
store %struct.decl_state* %1, %struct.decl_state** %4
%5 = load %struct.token*, %struct.token** %3
%6 = load %struct.decl_state*, %struct.decl_state** %4
%7 = call %struct.token* @pointer(%struct.token* %5, %struct.decl_state* %6)
store %struct.token* %7, %struct.token** %3
%8 = load %struct.token*, %struct.token** %3
%9 = load %struct.decl_state*, %struct.decl_state** %4
%10 = call %struct.token* @direct_declarator(%struct.token* %8, %struct.decl_state* %9)
ret %struct.token* %10
}

LLVM IR (-O2):
%struct.token = type { i32 }
%struct.decl_state = type { i32 }
define %struct.token* @declarator(%struct.token* %0, %struct.decl_state* %1) {
%3 = tail call %struct.token* @pointer(%struct.token* %0, %struct.decl_state* %1)
%4 = tail call %struct.token* @direct_declarator(%struct.token* %3, %struct.decl_state* %1)
ret %struct.token* %4
}
void Rename_IntegritySetAllObjectsModified() { ; }


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

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

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

LLVM IR (-O2):
define void @Rename_IntegritySetAllObjectsModified() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ my_strncpy(char *, char *, int);
void my_alloc_cpy_set(char **s1, char *s2, int *n, int *i) {
  *s1 = malloc(sizeof(char) * (*n + 1));
  my_strncpy(*s1, s2, *n);
  *n = 0;
  (*i)++;
}


x86 assembly (clang, -O0):
<my_alloc_cpy_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <my_strncpy@plt>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_alloc_cpy_set>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
mov    (%rdx),%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,(%r12)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <my_strncpy@plt>
movl   $0x0,0x0(%r13)
addl   $0x1,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @my_alloc_cpy_set(i8** %0, i8* %1, i32* %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %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 i8* @malloc(i32 %14)
%16 = load i8**, i8*** %5
store i8* %15, i8** %16
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = load i8*, i8** %6
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = call i32 @my_strncpy(i8* %18, i8* %19, i32 %21)
%23 = load i32*, i32** %7
store i32 0, i32* %23
%24 = load i32*, i32** %8
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @my_alloc_cpy_set(i8** nocapture writeonly %0, i8* %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = tail call i8* @malloc(i32 %6)
store i8* %7, i8** %0
%8 = tail call i32 @my_strncpy(i8* %7, i8* %1, i32 %5)
store i32 0, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
ret void
}
char *imalloc(n) {
  if (n == 0)
    n = 1;
  return malloc((unsigned)n);
}


x86 assembly (clang, -O0):
<imalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <imalloc+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imalloc>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @imalloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 1, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @malloc(i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @imalloc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = zext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun(void) { printf("void fun(void)\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"void fun(void)\00"
define void @fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntoh32(int /*<<< orphan*/ const *);
int ptls_decode32(uint32_t *value, const uint8_t **src, const uint8_t *end) {
  if (end - *src < 4)
    return 50;
  *value = ntoh32(*src);
  *src += 4;
  return 0;
}


x86 assembly (clang, -O0):
<ptls_decode32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x4,%rax
jge    114c <ptls_decode32+0x3c>
movl   $0x32,-0x4(%rbp)
jmp    1175 <ptls_decode32+0x65>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ntoh32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptls_decode32>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%rdi
sub    %rdi,%rdx
mov    $0x32,%eax
cmp    $0x10,%rdx
jl     1139 <ptls_decode32+0x29>
mov    %rsi,%rbx
call   1030 <ntoh32@plt>
mov    %eax,(%r14)
addq   $0x10,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ptls_decode32(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 = load i32**, i32*** %6
%10 = load i32*, i32** %9
%11 = ptrtoint i32* %8 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = icmp slt i64 %14, 4
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 50, i32* %4
br label %25
17: ; preds = %3
%18 = load i32**, i32*** %6
%19 = load i32*, i32** %18
%20 = call i32 @ntoh32(i32* %19)
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32**, i32*** %6
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 4
store i32* %24, i32** %22
store i32 0, i32* %4
br label %25
25: ; preds = %17, %16
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @ptls_decode32(i32* nocapture writeonly %0, i32** nocapture %1, i32* %2) {
%4 = load i32*, i32** %1
%5 = ptrtoint i32* %2 to i64
%6 = ptrtoint i32* %4 to i64
%7 = sub i64 %5, %6
%8 = icmp slt i64 %7, 16
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = tail call i32 @ntoh32(i32* %4)
store i32 %10, i32* %0
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32* %12, i32** %1
br label %13
13: ; preds = %3, %9
%14 = phi i32 [ 0, %9 ], [ 50, %3 ]
ret i32 %14
}
/* Variables and functions */
char *jsonPlug(int, char *, int /*<<< orphan*/ *, int, char *, int, int, int,
               int, int);
char *jsonPlugCmd(char *mac, char *cmd) {
  return (jsonPlug(-1, mac, NULL, -1, cmd, -1, -1, -1, -1, -1));
}


x86 assembly (clang, -O0):
<jsonPlugCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%r8
mov    $0xffffffff,%r9d
xor    %eax,%eax
mov    %eax,%edx
mov    %r9d,%edi
mov    %r9d,%ecx
movl   $0xffffffff,(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
movl   $0xffffffff,0x18(%rsp)
ff
call   1030 <jsonPlug@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonPlugCmd>:
push   %rax
mov    %rsi,%r8
mov    %rdi,%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r9d
push   $0xffffffffffffffff
push   $0xffffffffffffffff
push   $0xffffffffffffffff
push   $0xffffffffffffffff
call   1030 <jsonPlug@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @jsonPlugCmd(i8* %0, i8* %1) {
%3 = tail call i8* @jsonPlug(i32 -1, i8* %0, i32* null, i32 -1, i8* %1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memimport_new() {
  printf("NOT IMPLEMENTED:"
         "pa_memimport_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_memimport_new\0A\00"
define i32 @pa_memimport_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_memimport_new\00"
define i32 @pa_memimport_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *strchr(char const *, char);
int CountNumCommas(const char *s) {
  int count = 0;
  while ((s = strchr(s, ',')) != NULL) {
    ++count;
    ++s;
  }
  return count;
}


x86 assembly (clang, -O0):
<CountNumCommas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1159 <CountNumCommas+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <CountNumCommas+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountNumCommas>:
push   %rbx
mov    $0x2c,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <CountNumCommas+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <CountNumCommas+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CountNumCommas(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 44)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ pic14_programregion(int, int, int);
int /*<<< orphan*/ pic14_standby();
int /*<<< orphan*/ pic14_write_config();
void pic14_program_end(int config) {
  pic14_programregion((0xFFFF), (1), (0xFFFF));
  pic14_standby();
  if (config)
    pic14_write_config();
}


x86 assembly (clang, -O0):
<pic14_program_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <pic14_programregion@plt>
mov    $0x0,%al
call   1040 <pic14_standby@plt>
cmpl   $0x0,-0x4(%rbp)
je     1164 <pic14_program_end+0x34>
mov    $0x0,%al
call   1050 <pic14_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic14_program_end>:
push   %rbx
mov    %edi,%ebx
mov    $0xffff,%edi
mov    $0x1,%esi
mov    $0xffff,%edx
call   1030 <pic14_programregion@plt>
xor    %eax,%eax
call   1040 <pic14_standby@plt>
test   %ebx,%ebx
je     115a <pic14_program_end+0x2a>
xor    %eax,%eax
pop    %rbx
jmp    1050 <pic14_write_config@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @pic14_program_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pic14_programregion(i32 65535, i32 1, i32 65535)
%4 = call i32 (...) @pic14_standby()
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @pic14_write_config()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @pic14_program_end(i32 %0) {
%2 = tail call i32 @pic14_programregion(i32 65535, i32 1, i32 65535)
%3 = tail call i32 (...) @pic14_standby()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @pic14_write_config()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
float exp(float);
float Float_exp(float x) { return exp(x); }


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

x86 assembly (clang, -O2):
<Float_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define float @Float_exp(float %0) {
%2 = tail call float @exp(float %0)
ret float %2
}
/* Variables and functions */
int __semi_call(int, void *);
int semi_reportexc(int reason) { return __semi_call(0x18, (void *)reason); }


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

x86 assembly (clang, -O2):
<semi_reportexc>:
movslq %edi,%rsi
mov    $0x18,%edi
jmp    1030 <__semi_call@plt>

LLVM IR (-O0):
define i32 @semi_reportexc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @__semi_call(i32 24, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @semi_reportexc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @__semi_call(i32 24, i8* %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
void not_prune_multiple3_Bad() {
  int a[5];
  int *m = (int *)malloc(sizeof(int) * 2);
  m[0] = 0;
  m[1] = 10;
  if (*m < 5) {
    m++;
    a[*m] = 0;
  }
}


x86 assembly (clang, -O0):
<not_prune_multiple3_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0xa,0x4(%rax)
mov    -0x28(%rbp),%rax
cmpl   $0x5,(%rax)
jge    1163 <not_prune_multiple3_Bad+0x53>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_prune_multiple3_Bad>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0xa00000000,%rcx
mov    %rcx,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @not_prune_multiple3_Bad() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 10, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %19
12: ; preds = %0
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %2
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %17
store i32 0, i32* %18
br label %19
19: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
define void @not_prune_multiple3_Bad() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 10, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ bar2();
void foo2(void) {
#pragma omp target teams
  {
#pragma omp parallel
    {}
    bar1();
    bar2();
#pragma omp parallel
    {}
    bar1();
    bar2();
  }
}


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

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

LLVM IR (-O0):
define void @foo2() {
%1 = call i32 (...) @bar1()
%2 = call i32 (...) @bar2()
%3 = call i32 (...) @bar1()
%4 = call i32 (...) @bar2()
ret void
}

LLVM IR (-O2):
define void @foo2() {
%1 = tail call i32 (...) @bar1()
%2 = tail call i32 (...) @bar2()
%3 = tail call i32 (...) @bar1()
%4 = tail call i32 (...) @bar2()
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_3__ {
  int si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int sigwaitinfo(int /*<<< orphan*/ const *, TYPE_1__ *);
int sigwait(const sigset_t *set, int *sig) {
  siginfo_t si;
  int r = sigwaitinfo(set, &si);
  if (r != -1)
    *sig = si.si_signo;
  return r;
}


x86 assembly (clang, -O0):
<sigwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <sigwaitinfo@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     1143 <sigwait+0x33>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwait>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <sigwaitinfo@plt>
cmp    $0xffffffff,%eax
je     112d <sigwait+0x1d>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @sigwait(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_3__
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = call i32 @sigwaitinfo(i32* %7, %struct.TYPE_3__* %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
store i32 %13, i32* %14
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @sigwait(i32* %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = call i32 @sigwaitinfo(i32* %0, %struct.TYPE_3__* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %2
ret i32 %5
}