xunge/DecIR huggingface dataset:
/* Variables and functions */
int ceil(double);
int ipercentile_ordered(const int *v, int len, double percentile) {
  if (percentile == 0) {
    return v[0];
  }
  int rank = ceil(percentile * len) - 1;
  return v[rank];
}


x86 assembly (clang, -O0):
<ipercentile_ordered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114a <ipercentile_ordered+0x3a>
jp     114a <ipercentile_ordered+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <ipercentile_ordered+0x61>
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <ceil@plt>
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipercentile_ordered>:
push   %rbx
mov    %rdi,%rbx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1120 <ipercentile_ordered+0x10>
jnp    113e <ipercentile_ordered+0x2e>
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
cltq
lea    (%rbx,%rax,4),%rbx
add    $0xfffffffffffffffc,%rbx
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ipercentile_ordered(i32* %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store double %2, double* %7
%9 = load double, double* %7
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
store i32 %14, i32* %4
br label %27
15: ; preds = %3
%16 = load double, double* %7
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = call i32 @ceil(double %19)
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %8
%22 = load i32*, i32** %5
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
store i32 %26, i32* %4
br label %27
27: ; preds = %15, %11
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @ipercentile_ordered(i32* nocapture %0, i32 %1, double %2) {
%4 = fcmp oeq double %2, 0.000000e+00
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sitofp i32 %1 to double
%7 = fmul double %6, %2
%8 = tail call i32 @ceil(double %7)
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
br label %12
12: ; preds = %3, %5
%13 = phi i32* [ %11, %5 ], [ %0, %3 ]
%14 = load i32, i32* %13
ret i32 %14
}
/* Variables and functions */
unsigned char inb(unsigned int);
int /*<<< orphan*/ outb(unsigned char, unsigned int);
int smbus_ack(unsigned smbus_io_base, int state) {
  unsigned char val = inb(smbus_io_base + 0x03);
  if (state)
    outb(val | (0x01 << 4), smbus_io_base + 0x03);
  else
    outb(val & ~(0x01 << 4), smbus_io_base + 0x03);
  return 0;
}


x86 assembly (clang, -O0):
<smbus_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
call   1040 <inb@plt>
mov    %al,-0x9(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1160 <smbus_ack+0x40>
movzbl -0x9(%rbp),%eax
or     $0x10,%eax
mov    -0x4(%rbp),%esi
add    $0x3,%esi
movzbl %al,%edi
call   1030 <outb@plt>
jmp    1175 <smbus_ack+0x55>
movzbl -0x9(%rbp),%eax
and    $0xffffffef,%eax
mov    -0x4(%rbp),%esi
add    $0x3,%esi
movzbl %al,%edi
call   1030 <outb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_ack>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
setne  %bl
lea    0x3(%rdi),%ebp
mov    %ebp,%edi
call   1040 <inb@plt>
and    $0xef,%al
shl    $0x4,%bl
or     %al,%bl
movzbl %bl,%edi
mov    %ebp,%esi
call   1030 <outb@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @smbus_ack(i32 %0, i32 %1) {
%3 = add i32 %0, 3
%4 = tail call zeroext i8 @inb(i32 %3)
%5 = icmp eq i32 %1, 0
%6 = and i8 %4, -17
%7 = select i1 %5, i8 0, i8 16
%8 = or i8 %6, %7
%9 = tail call i32 @outb(i8 zeroext %8, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ MD4_CTX;

/* Variables and functions */
int /*<<< orphan*/ md4_block_data_order(int /*<<< orphan*/ *,
                                        unsigned char const *, int);
void MD4_Transform(MD4_CTX *c, const unsigned char *data) {
  md4_block_data_order(c, data, 1);
}


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

x86 assembly (clang, -O2):
<MD4_Transform>:
mov    $0x1,%edx
jmp    1030 <md4_block_data_order@plt>

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

LLVM IR (-O2):
define void @MD4_Transform(i32* %0, i8* %1) {
%3 = tail call i32 @md4_block_data_order(i32* %0, i8* %1, i32 1)
ret void
}
int main(void) {
  float x = 5;
  float *p = (float *)&x;
  *p;
  int y = 5;
  *((int *)&y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float*
%4 = alloca i32
store i32 0, i32* %1
store float 5.000000e+00, float* %2
store float* %2, float** %3
%5 = load float*, float** %3
%6 = load float, float* %5
store i32 5, i32* %4
%7 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
float fmaxf(float, float);
float fminf(float, float);
float fabsmaxf(float n, float max) {
  return n > 0.0f ? fmaxf(n, max) : fminf(n, -max);
}


x86 assembly (clang, -O0):
<fabsmaxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1151 <fabsmaxf+0x51>
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    118b <fabsmaxf+0x8b>
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsmaxf>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jbe    111c <fabsmaxf+0x1c>
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
jmp    1135 <fabsmaxf+0x35>
xorps  0xedd(%rip),%xmm1
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fabsmaxf(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 = fcmp ogt float %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call float @llvm.maxnum.f32(float %8, float %9)
br label %16
11: ; preds = %2
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fneg float %13
%15 = call float @llvm.minnum.f32(float %12, float %14)
br label %16
16: ; preds = %11, %7
%17 = phi float [ %10, %7 ], [ %15, %11 ]
ret float %17
}

LLVM IR (-O2):
define float @fabsmaxf(float %0, float %1) {
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call float @llvm.maxnum.f32(float %0, float %1)
br label %9
6: ; preds = %2
%7 = fneg float %1
%8 = tail call float @llvm.minnum.f32(float %0, float %7)
br label %9
9: ; preds = %6, %4
%10 = phi float [ %5, %4 ], [ %8, %6 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello\n");
  f();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
float f(int, double);
main() {
  float x = f(2, (double)5);
  if (x != 5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
movsd  0xecc(%rip),%xmm0
call   1040 <f@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xead(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1167 <main+0x47>
jp     1167 <main+0x47>
jmp    116e <main+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <f@plt>
ucomiss 0xece(%rip),%xmm0
jne    1142 <main+0x22>
jp     1142 <main+0x22>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @f(i32 2, double 5.000000e+00)
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp une float %4, 5.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @f(i32 2, double 5.000000e+00)
%2 = fcmp une float %1, 5.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void hputl(hstring, keyword, lval) char *hstring;
char *keyword;
int lval;
{
  char value[8];
  if (lval)
    strcpy(value, "T");
  else
    strcpy(value, "F");
  hputc(hstring, keyword, value);
  return;
}


x86 assembly (clang, -O0):
<hputl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1152 <hputl+0x32>
lea    -0x1c(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1162 <hputl+0x42>
lea    -0x1c(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <hputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputl>:
push   %rax
test   %edx,%edx
mov    $0x46,%eax
mov    $0x54,%ecx
cmove  %eax,%ecx
mov    %cx,(%rsp)
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <hputc@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"F\00"
define void @hputl(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [8 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%12 = call i8* @strcpy(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
13: ; preds = %3
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%15 = call i8* @strcpy(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %10
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%20 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
define void @hputl(i8* %0, i8* %1, i32 %2) {
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, i16 70, i16 84
%8 = bitcast [8 x i8]* %4 to i16*
store i16 %7, i16* %8
%9 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret void
}
/* Variables and functions */
int sysctlbyname(int *nm, unsigned int nml, void *op, size_t *ol, void *np,
                 size_t nl) {
  return -1;
}


x86 assembly (clang, -O0):
<sysctlbyname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sysctlbyname(i32* %0, i32 %1, i8* %2, i64* %3, i8* %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64*
%11 = alloca i8*
%12 = alloca i64
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i64* %3, i64** %10
store i8* %4, i8** %11
store i64 %5, i64* %12
ret i32 -1
}

LLVM IR (-O2):
define i32 @sysctlbyname(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64* nocapture readnone %3, i8* nocapture readnone %4, i64 %5) {
ret i32 -1
}
void fd144(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  p02A:
    goto p02A;
    goto a;
  a : {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd144>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd144+0x7>

x86 assembly (clang, -O2):
<fd144>:
jmp    1100 <fd144>

LLVM IR (-O0):
define void @fd144(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd144(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int EINVAL;
int pthread_cancel(pthread_t thread) {
  (void)thread;
  return EINVAL;
}


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

x86 assembly (clang, -O2):
<pthread_cancel>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_cancel(i32 %0) {
%2 = load i32, i32* @EINVAL
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned int sleep(unsigned int seconds __attribute__((unused))) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int IsEqualInt(void *a, void *b) { return *(int *)a == *(int *)b; }


x86 assembly (clang, -O0):
<IsEqualInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEqualInt>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @IsEqualInt(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsEqualInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void XwcTextListToTextProperty() {}


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

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

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

LLVM IR (-O2):
define void @XwcTextListToTextProperty() {
ret void
}
double at_perlin_get_1d(struct at_perlin *per, double x) { return 0.0; }


x86 assembly (clang, -O0):
<at_perlin_get_1d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_perlin_get_1d>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.at_perlin = type opaque
define double @at_perlin_get_1d(%struct.at_perlin* %0, double %1) {
%3 = alloca %struct.at_perlin*
%4 = alloca double
store %struct.at_perlin* %0, %struct.at_perlin** %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
%struct.at_perlin = type opaque
define double @at_perlin_get_1d(%struct.at_perlin* nocapture readnone %0, double %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ ERR(char *);
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ itoa(int, char *);
__attribute__((noreturn)) void crash(char *file, int line, char *msg) {
  ERR(file);
  ERR(":");
  char buf[256];
  itoa(line, buf);
  ERR(buf);
  ERR(" ");
  ERR(msg);
  _exit(1);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ERR@plt>
lea    0xeaa(%rip),%rdi
call   1040 <ERR@plt>
mov    -0xc(%rbp),%edi
lea    -0x120(%rbp),%rsi
call   1050 <itoa@plt>
lea    -0x120(%rbp),%rdi
call   1040 <ERR@plt>
lea    0xe85(%rip),%rdi
call   1040 <ERR@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ERR@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
call   1040 <ERR@plt>
lea    0xeb4(%rip),%rdi
call   1040 <ERR@plt>
mov    %rsp,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <itoa@plt>
mov    %rbx,%rdi
call   1040 <ERR@plt>
lea    0xe95(%rip),%rdi
call   1040 <ERR@plt>
mov    %r14,%rdi
call   1040 <ERR@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c" \00"
define void @crash(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [256 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @ERR(i8* %8)
%10 = call i32 @ERR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %5
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%13 = call i32 @itoa(i32 %11, i8* %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%15 = call i32 @ERR(i8* %14)
%16 = call i32 @ERR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = load i8*, i8** %6
%18 = call i32 @ERR(i8* %17)
%19 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c" \00"
define void @crash(i8* %0, i32 %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = tail call i32 @ERR(i8* %0)
%6 = tail call i32 @ERR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = call i32 @itoa(i32 %1, i8* %7)
%9 = call i32 @ERR(i8* %7)
%10 = call i32 @ERR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @ERR(i8* %2)
%12 = call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 1; i <= 5; i++)
    printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int fun887() { return 887; }


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

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

LLVM IR (-O0):
define i32 @fun887() {
ret i32 887
}

LLVM IR (-O2):
define i32 @fun887() {
ret i32 887
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xac() {
  Assert_real((isupper(172) == 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_isupper.c",
              865, ("isupper should be 0 for 0xac"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xac>:
push   %rax
mov    $0xac,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x361,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xac\00"
define void @t_isupper_0xac() {
%1 = call i64 @isupper(i32 172)
%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 865, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xac\00"
define void @t_isupper_0xac() {
%1 = tail call i64 @isupper(i32 172)
%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 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int *test_01(int *s) {
  if (s[0] == 0)
    if (s[3])
      s = 0;
  return s;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1130 <test_01+0x30>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0xc(%rax)
je     112b <test_01+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1130 <test_01+0x30>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
mov    %rdi,%rax
cmpl   $0x0,(%rdi)
je     1109 <test_01+0x9>
ret
xor    %ecx,%ecx
cmpl   $0x0,0xc(%rax)
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i32* @test_01(i32* %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32* %0, i32* null
br label %9
9: ; preds = %4, %1
%10 = phi i32* [ %8, %4 ], [ %0, %1 ]
ret i32* %10
}
/* Variables and functions */
int /*<<< orphan*/ bar();
__attribute__((always_)) void func3(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @func3() {
%1 = tail call i32 (...) @bar()
ret void
}
unsigned int strtoul_charval(unsigned int charval) {
  if (charval >= 'a') {
    charval = (charval - 'a' + 10);
  } else if (charval >= 'A') {
    charval = (charval - 'A' + 10);
  } else if (charval <= '9') {
    charval = (charval - '0');
  }
  return charval;
}


x86 assembly (clang, -O0):
<strtoul_charval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jb     1122 <strtoul_charval+0x22>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <strtoul_charval+0x5a>
cmpl   $0x41,-0x4(%rbp)
jb     113d <strtoul_charval+0x3d>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <strtoul_charval+0x55>
cmpl   $0x39,-0x4(%rbp)
ja     1150 <strtoul_charval+0x50>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <strtoul_charval+0x55>
jmp    115a <strtoul_charval+0x5a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul_charval>:
mov    %edi,%eax
cmp    $0x61,%edi
jb     110b <strtoul_charval+0xb>
add    $0xffffffa9,%eax
ret
cmp    $0x41,%eax
jb     1114 <strtoul_charval+0x14>
add    $0xffffffc9,%eax
ret
lea    -0x30(%rax),%ecx
cmp    $0x3a,%eax
cmovae %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strtoul_charval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 97
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 %6, 97
%8 = add i32 %7, 10
store i32 %8, i32* %2
br label %24
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp uge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sub i32 %13, 65
%15 = add i32 %14, 10
store i32 %15, i32* %2
br label %23
16: ; preds = %9
%17 = load i32, i32* %2
%18 = icmp ule i32 %17, 57
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %2
%21 = sub i32 %20, 48
store i32 %21, i32* %2
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22, %12
br label %24
24: ; preds = %23, %5
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @strtoul_charval(i32 %0) {
%2 = icmp ugt i32 %0, 96
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add i32 %0, -87
br label %13
5: ; preds = %1
%6 = icmp ugt i32 %0, 64
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nsw i32 %0, -55
br label %13
9: ; preds = %5
%10 = icmp ult i32 %0, 58
%11 = add nsw i32 %0, -48
%12 = select i1 %10, i32 %11, i32 %0
br label %13
13: ; preds = %9, %7, %3
%14 = phi i32 [ %4, %3 ], [ %8, %7 ], [ %12, %9 ]
ret i32 %14
}
void drop_caches_sysctl_handler(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<drop_caches_sysctl_handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_caches_sysctl_handler>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.drop_caches_sysctl_handler = [27 x i8] c"drop_caches_sysctl_handler\00"
define void @drop_caches_sysctl_handler() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.drop_caches_sysctl_handler, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.drop_caches_sysctl_handler = [27 x i8] c"drop_caches_sysctl_handler\00"
define void @drop_caches_sysctl_handler() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.drop_caches_sysctl_handler, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
int isRoot() {
  if (geteuid() != 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
je     1135 <isRoot+0x25>
movl   $0x0,-0x4(%rbp)
jmp    113c <isRoot+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRoot>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isRoot() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @isRoot() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *get_platform() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @get_platform() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @get_platform() {
ret i8* null
}
unsigned long hash_string(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_string+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_string+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_string+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int test_imm_3Aint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x3A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Aint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x3a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Aint64_midword_mem>:
testb  $0x3a,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Aint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 58
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_3Aint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3801088
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void not_imp() {
  printf("Not yet implemented\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Not yet implemented\00"
define void @not_imp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
short check_fixed(long);
short mult_fixed(short x, short y) {
  long r = (long)x * (long)y;
  return check_fixed(r >> 4);
}


x86 assembly (clang, -O0):
<mult_fixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswq -0x2(%rbp),%rax
movswq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sar    $0x4,%rdi
call   1030 <check_fixed@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_fixed>:
movslq %edi,%rax
movslq %esi,%rdi
imul   %rax,%rdi
sar    $0x4,%rdi
jmp    1030 <check_fixed@plt>

LLVM IR (-O0):
define signext i16 @mult_fixed(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i64
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i64
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = mul nsw i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = ashr i64 %11, 4
%13 = call signext i16 @check_fixed(i64 %12)
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @mult_fixed(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i64
%4 = sext i16 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = ashr i64 %5, 4
%7 = tail call signext i16 @check_fixed(i64 %6)
ret i16 %7
}
short bigbinary2s(char *binary) {
  short result = 0;
  int len = sizeof(result);
  short exp = 1;
  int i;
  for (i = len - 1; i >= 0; --i) {
    result += binary[i] * exp;
    exp <<= 8;
  }
  return result;
}


x86 assembly (clang, -O0):
<bigbinary2s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movl   $0x2,-0x10(%rbp)
movw   $0x1,-0x12(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1164 <bigbinary2s+0x64>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movswl -0x12(%rbp),%eax
imul   %eax,%ecx
movswl -0xa(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movswl -0x12(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1124 <bigbinary2s+0x24>
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigbinary2s>:
movsbl 0x1(%rdi),%ecx
movzbl (%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @bigbinary2s(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i16
%5 = load i8, i8* %0
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = add i16 %7, %4
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(void) {
  for (int i = 0; i < 10; i++)
    foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
%10 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_char(int /*<<< orphan*/);
int /*<<< orphan*/ update_cursor();
void print_string(const char *s) {
  while (*s != '\0') {
    print_char(*s++);
  }
  update_cursor();
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <print_string+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1040 <print_char@plt>
jmp    112c <print_string+0xc>
mov    $0x0,%al
call   1030 <update_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <print_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <update_cursor@plt>

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @print_char(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (...) @update_cursor()
ret void
}
/* Type definitions */
struct lfs_config {
  int dummy;
};

/* Variables and functions */
int lfs_testbd_rawsync(struct lfs_config const *);
int lfs_testbd_sync(const struct lfs_config *cfg) {
  ;
  int err = lfs_testbd_rawsync(cfg);
  ;
  return err;
}


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

x86 assembly (clang, -O2):
<lfs_testbd_sync>:
jmp    1030 <lfs_testbd_rawsync@plt>

LLVM IR (-O0):
%struct.lfs_config = type { i32 }
define i32 @lfs_testbd_sync(%struct.lfs_config* %0) {
%2 = alloca %struct.lfs_config*
%3 = alloca i32
store %struct.lfs_config* %0, %struct.lfs_config** %2
%4 = load %struct.lfs_config*, %struct.lfs_config** %2
%5 = call i32 @lfs_testbd_rawsync(%struct.lfs_config* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.lfs_config = type { i32 }
define i32 @lfs_testbd_sync(%struct.lfs_config* %0) {
%2 = tail call i32 @lfs_testbd_rawsync(%struct.lfs_config* %0)
ret i32 %2
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_timer_a_get_taiv_addr(void) {
  return cfg_processor_get_addr("timera", "taiv");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"timera\00"
@.str.1 = [5 x i8] c"taiv\00"
define i32 @cfg_timer_a_get_taiv_addr() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"timera\00"
@.str.1 = [5 x i8] c"taiv\00"
define i32 @cfg_timer_a_get_taiv_addr() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}