xunge/DecIR huggingface dataset:
int lower_bound(int v[], int n, int x) {
  int low = 0;
  int high = n;
  while (low < high) {
    int mid = (low + high) / 2;
    if (v[mid] >= x)
      high = mid;
    else
      low = mid + 1;
  }
  return (low);
}


x86 assembly (clang, -O0):
<lower_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1165 <lower_bound+0x65>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jl     1157 <lower_bound+0x57>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1160 <lower_bound+0x60>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <lower_bound+0x1b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_bound>:
xor    %eax,%eax
test   %esi,%esi
jg     1117 <lower_bound+0x17>
jmp    113b <lower_bound+0x3b>
nopl   0x0(%rax,%rax,1)
mov    %r9d,%esi
cmp    %esi,%eax
jge    113b <lower_bound+0x3b>
lea    (%rax,%rsi,1),%r8d
mov    %r8d,%r9d
shr    $0x1f,%r9d
add    %r8d,%r9d
sar    %r9d
movslq %r9d,%rcx
cmp    %edx,(%rdi,%rcx,4)
jge    1110 <lower_bound+0x10>
add    $0x1,%r9d
mov    %r9d,%eax
cmp    %esi,%eax
jl     1117 <lower_bound+0x17>
ret

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

LLVM IR (-O2):
define i32 @lower_bound(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3, %5
%6 = phi i32 [ %16, %5 ], [ 0, %3 ]
%7 = phi i32 [ %15, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %2
%14 = add nsw i32 %9, 1
%15 = select i1 %13, i32 %7, i32 %9
%16 = select i1 %13, i32 %14, i32 %6
%17 = icmp slt i32 %16, %15
br i1 %17, label %5, label %18
18: ; preds = %5, %3
%19 = phi i32 [ 0, %3 ], [ %16, %5 ]
ret i32 %19
}
int test_imm_D8int16_reg(short val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D8int16_reg>:
test   $0xd8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 216
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D8int16_reg(i16 signext %0) {
%2 = and i16 %0, 216
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ toupper(char);
void strtoup(char *s) {
  if (s != 0)
    while (*s) {
      *s = (char)toupper(*s);
      s++;
    }
}


x86 assembly (clang, -O0):
<strtoup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <strtoup+0x53>
jmp    112c <strtoup+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <strtoup+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strtoup+0x1c>
jmp    1163 <strtoup+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoup>:
push   %rbx
test   %rdi,%rdi
je     1146 <strtoup+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <strtoup+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtoup+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtoup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = tail call i64 @toupper(i8 signext %7)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
bool fspath_is_block(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_is_block(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
int files_getTmpMapFlags(int, int);
void *mmap(int /*<<< orphan*/ *, size_t, int, int, int, int /*<<< orphan*/);
void *initialzeTryMapHugeTLB(int fd, size_t sz) {
  int initflags = MAP_SHARED;
  int mflags = files_getTmpMapFlags(initflags, true);
  void *ret = mmap(NULL, sz, PROT_READ | PROT_WRITE, mflags, fd, 0);
  return ret;
}


x86 assembly (clang, -O0):
<initialzeTryMapHugeTLB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1040 <files_getTmpMapFlags@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    0x2e71(%rip),%rax
or     (%rax),%edx
mov    -0x18(%rbp),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialzeTryMapHugeTLB>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <files_getTmpMapFlags@plt>
mov    0x2eb6(%rip),%rcx
mov    0x2e87(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%ecx
mov    %ebp,%r8d
xor    %r9d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@MAP_SHARED = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define i8* @initialzeTryMapHugeTLB(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%8 = load i32, i32* @MAP_SHARED
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @files_getTmpMapFlags(i32 %9, i32 1)
store i32 %10, i32* %6
%11 = load i64, i64* %4
%12 = load i32, i32* @PROT_READ
%13 = load i32, i32* @PROT_WRITE
%14 = or i32 %12, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %3
%17 = call i8* @mmap(i32* null, i64 %11, i32 %14, i32 %15, i32 %16, i32 0)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@MAP_SHARED = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define i8* @initialzeTryMapHugeTLB(i32 %0, i64 %1) {
%3 = load i32, i32* @MAP_SHARED
%4 = tail call i32 @files_getTmpMapFlags(i32 %3, i32 1)
%5 = load i32, i32* @PROT_READ
%6 = load i32, i32* @PROT_WRITE
%7 = or i32 %6, %5
%8 = tail call i8* @mmap(i32* null, i64 %1, i32 %7, i32 %4, i32 %0, i32 0)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t s) {
  void *result = malloc(s);
  if (NULL == result) {
    fprintf(stderr, "Error Allocating memory. Problem==lots. Exiting... \n");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1178 <emalloc+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Error Allocating memory. Problem==lots. Exiting... \0A\00"
@EXIT_FAILURE = global i32 0
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Error Allocating memory. Problem==lots. Exiting... \0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double math_acosh(double x) { return log(x + sqrt(x * x - 1)); }


x86 assembly (clang, -O0):
<math_acosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_acosh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @math_acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @math_acosh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %0
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
void SysCtlWakeUpPinEnable(void) {
  (*((volatile unsigned long *)(0x40007004))) |= 0x00000100;
}


x86 assembly (clang, -O0):
<SysCtlWakeUpPinEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007004,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x40007004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlWakeUpPinEnable>:
orq    $0x100,0x40007004
ret

LLVM IR (-O0):
define void @SysCtlWakeUpPinEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073770500 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlWakeUpPinEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073770500 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073770500 to i64*)
ret void
}
/* Variables and functions */
float DBETWEEN(double, double);
int /*<<< orphan*/ DSENSITIVITY(float);
float sqrt(float);
int main(void) {
  float x, r;
  x = DBETWEEN(1.0, 1000.0);
  r = sqrt(x + 1) - sqrt(x);
  DSENSITIVITY(r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xec8(%rip),%xmm0
movsd  0xec8(%rip),%xmm1
call   1030 <DBETWEEN@plt>
movss  %xmm0,-0x4(%rbp)
movss  0xea6(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1040 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <DSENSITIVITY@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
call   1030 <DBETWEEN@plt>
movaps %xmm0,%xmm2
movss  0xebf(%rip),%xmm0
addss  %xmm2,%xmm0
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm0
jb     117f <main+0x4f>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
ucomiss %xmm3,%xmm2
jae    119b <main+0x6b>
movaps %xmm2,%xmm0
movss  %xmm1,0x4(%rsp)
call   1040 <sqrt@plt>
movss  0x4(%rsp),%xmm1
jmp    11a2 <main+0x72>
movss  %xmm2,0x4(%rsp)
call   1040 <sqrt@plt>
xorps  %xmm3,%xmm3
movss  0x4(%rsp),%xmm2
movaps %xmm0,%xmm1
ucomiss %xmm3,%xmm2
jb     1169 <main+0x39>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1050 <DSENSITIVITY@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call float @DBETWEEN(double 1.000000e+00, double 1.000000e+03)
store float %3, float* %1
%4 = load float, float* %1
%5 = fadd float %4, 1.000000e+00
%6 = call float @sqrt(float %5)
%7 = load float, float* %1
%8 = call float @sqrt(float %7)
%9 = fsub float %6, %8
store float %9, float* %2
%10 = load float, float* %2
%11 = call i32 @DSENSITIVITY(float %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @DBETWEEN(double 1.000000e+00, double 1.000000e+03)
%2 = fadd float %1, 1.000000e+00
%3 = tail call float @sqrt(float %2)
%4 = tail call float @sqrt(float %1)
%5 = fsub float %3, %4
%6 = tail call i32 @DSENSITIVITY(float %5)
ret i32 0
}
int __CmpLong__(long _val1, long _val2) {
  return ((_val1) < (_val2) ? -1 : (_val1) > (_val2) ? 1 : 0);
}


x86 assembly (clang, -O0):
<__CmpLong__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <__CmpLong__+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <__CmpLong__+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__CmpLong__>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__CmpLong__(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp sgt i64 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @__CmpLong__(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = icmp sgt i64 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int colour_to_blue(int colour) {
  int return_val = 0;
  switch (colour) {
  case 0:
  case 1:
  case 2:
  case 3:
    return_val = 255;
    break;
  }
  return return_val;
}


x86 assembly (clang, -O0):
<colour_to_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x3,%eax
ja     1126 <colour_to_blue+0x26>
jmp    111f <colour_to_blue+0x1f>
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colour_to_blue>:
xor    %ecx,%ecx
cmp    $0x4,%edi
mov    $0xff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @colour_to_blue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 255, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @colour_to_blue(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = select i1 %2, i32 255, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xf4() {
  Assert_real((iscntrl(244) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1225, ("iscntrl should be 0 for 0xf4"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf4\00"
define void @t_iscntrl_0xf4() {
%1 = call i64 @iscntrl(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf4\00"
define void @t_iscntrl_0xf4() {
%1 = tail call i64 @iscntrl(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int divisor_sum(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int result = divisor_sum(1000);
  printf("%d", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1040 <divisor_sum@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @divisor_sum(i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void gnttab_grant_access() {}


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

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

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

LLVM IR (-O2):
define void @gnttab_grant_access() {
ret void
}
/* Variables and functions */
bool digit(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned short __attribute__((no, noclone, hot)) bar(unsigned char *x) {
  unsigned int a;
  unsigned short b;
  __builtin_memcpy(&a, &x[0], sizeof(a));
  a ^= 0x80808080U;
  __builtin_memcpy(&x[0], &a, sizeof(a));
  __builtin_memcpy(&b, &x[2], sizeof(b));
  return foo(b);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0x80808080,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%ax
mov    %ax,-0xe(%rbp)
movzwl -0xe(%rbp),%edi
mov    $0x0,%al
call   1030 <foo@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    $0x80808080,%eax
xor    (%rdi),%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
mov    %eax,%edi
xor    %eax,%eax
call   1030 <foo@plt>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define zeroext i16 @bar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i16
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i32, i32* %3
%9 = xor i32 %8, -2139062144
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = bitcast i32* %3 to i8*
%13 = bitcast i16* %4 to i8*
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 %17)
%19 = trunc i32 %18 to i16
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @bar(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = xor i32 %3, -2139062144
store i32 %4, i32* %2
%5 = lshr i32 %4, 16
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 %5)
%7 = trunc i32 %6 to i16
ret i16 %7
}
/* Type definitions */
struct testlog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tlog_putc(struct testlog *, char);
void tlog_putstr(struct testlog *log, const char *str) {
  char c;
  while ((c = *str++))
    tlog_putc(log, c);
}


x86 assembly (clang, -O0):
<tlog_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     114e <tlog_putstr+0x3e>
mov    -0x8(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <tlog_putc@plt>
jmp    1120 <tlog_putstr+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlog_putstr>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <tlog_putstr+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <tlog_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <tlog_putstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.testlog = type { i32 }
define void @tlog_putstr(%struct.testlog* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @tlog_putc(%struct.testlog* %0, i8 signext %6)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blit(int, int, int);
int main() {
  int i = 0;
  blit(17, 29, 1000 * 32);
  blit(29, 17, 1000 * 32);
  for (i = 0; i < 1000; i++) {
    blit(17, 29, 1000 * 32);
    blit(29, 17, 1000 * 32);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x11,%edi
mov    $0x1d,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    $0x1d,%edi
mov    $0x11,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1198 <main+0x88>
mov    $0x11,%edi
mov    $0x1d,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    $0x1d,%edi
mov    $0x11,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x45>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x11,%edi
mov    $0x1d,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    $0x1d,%edi
mov    $0x11,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    $0x3e8,%ebx
xchg   %ax,%ax
mov    $0x11,%edi
mov    $0x1d,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
mov    $0x1d,%edi
mov    $0x11,%esi
mov    $0x7d00,%edx
call   1030 <blit@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @blit(i32 17, i32 29, i32 32000)
%2 = tail call i32 @blit(i32 29, i32 17, i32 32000)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i32 @blit(i32 17, i32 29, i32 32000)
%6 = tail call i32 @blit(i32 29, i32 17, i32 32000)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int ffi_regs_remove_index(struct ffi_regs_t *result, int idx) {}


x86 assembly (clang, -O0):
<ffi_regs_remove_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ffi_regs_t = type opaque
define i32 @ffi_regs_remove_index(%struct.ffi_regs_t* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.ffi_regs_t*
%5 = alloca i32
store %struct.ffi_regs_t* %0, %struct.ffi_regs_t** %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.ffi_regs_t = type opaque
define i32 @ffi_regs_remove_index(%struct.ffi_regs_t* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_byte(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeconfig_update_debug(uint8_t val) {
  eeprom_update_byte((uint8_t *)2, val);
}


x86 assembly (clang, -O0):
<eeconfig_update_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <eeprom_update_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_update_debug>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <eeprom_update_byte@plt>

LLVM IR (-O0):
define void @eeconfig_update_debug(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eeprom_update_byte(i32* inttoptr (i64 2 to i32*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_debug(i32 %0) {
%2 = tail call i32 @eeprom_update_byte(i32* inttoptr (i64 2 to i32*), i32 %0)
ret void
}
int inbyte(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @inbyte() {
ret i32 -1
}
void rcu_init_sched(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_init_sched() {
ret void
}
int mlt_version_get_int() { return ((0 << 16) + (9 << 8) + 9); }


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

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

LLVM IR (-O0):
define i32 @mlt_version_get_int() {
ret i32 2313
}

LLVM IR (-O2):
define i32 @mlt_version_get_int() {
ret i32 2313
}
int hash2(void *key) {
  char *str = (char *)key;
  int i;
  int r = 0;
  for (i = 0; str[i] != '\0'; i++)
    r += (i + 1) * str[i];
  return r;
}


x86 assembly (clang, -O0):
<hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <hash2+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <hash2+0x1e>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <hash2+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash2+0x10>
ret

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

LLVM IR (-O2):
define i32 @hash2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, %8
%12 = add nsw i32 %11, %7
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %17
}
/* Variables and functions */
int f397(int *);
int f398(int *p) { return f397(p); }


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

x86 assembly (clang, -O2):
<f398>:
jmp    1030 <f397@plt>

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

LLVM IR (-O2):
define i32 @f398(i32* %0) {
%2 = tail call i32 @f397(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ CC_SPI_Transfer(int, char *, char *, int);
char TI_CC_SPIReadStatus(int fd, char addr) {
  uint8_t txBuf[2];
  uint8_t rxBuf[2];
  txBuf[0] = (addr | 0xC0);
  txBuf[1] = 0;
  CC_SPI_Transfer(fd, txBuf, rxBuf, 2);
  return (char)rxBuf[1];
}


x86 assembly (clang, -O0):
<TI_CC_SPIReadStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
or     $0xc0,%eax
mov    %al,-0x7(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
lea    -0x9(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <CC_SPI_Transfer@plt>
movsbl -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TI_CC_SPIReadStatus>:
push   %rax
or     $0xc0,%sil
mov    %sil,0x4(%rsp)
movb   $0x0,0x5(%rsp)
lea    0x4(%rsp),%rsi
lea    0x6(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <CC_SPI_Transfer@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TI_CC_SPIReadStatus(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [2 x i8]
%6 = alloca [2 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = or i32 %8, 192
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %12
%13 = load i32, i32* %3
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%16 = call i32 @CC_SPI_Transfer(i32 %13, i8* %14, i8* %15, i32 2)
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
%18 = load i8, i8* %17
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @TI_CC_SPIReadStatus(i32 %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = or i8 %1, -64
store i8 %7, i8* %5
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %8
%9 = call i32 @CC_SPI_Transfer(i32 %0, i8* %5, i8* %6, i32 2)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%11 = load i8, i8* %10
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assume(int);
int main() {
  int i;
  __VERIFIER_assume(i == 2);
  if (i != 2) {
  ERROR:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assume@plt>
cmpl   $0x2,-0x8(%rbp)
je     114b <main+0x3b>
jmp    113f <main+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1152 <main+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assume(i32 0)
ret i32 0
}
/* Variables and functions */
int bounce(int);
int foo(int k, int j, int z) {
  if (k > z) {
    if (j > k) {
      if (j > bounce(z))
        return j;
    }
  }
  return j + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1169 <foo+0x59>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1164 <foo+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <bounce@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    115f <foo+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <foo+0x62>
jmp    1164 <foo+0x54>
jmp    1169 <foo+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %esi,%ebx
cmp    %edi,%esi
jle    1126 <foo+0x16>
cmp    %edx,%edi
jle    1126 <foo+0x16>
mov    %edx,%edi
call   1030 <bounce@plt>
cmp    %ebx,%eax
jl     1129 <foo+0x19>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(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* %5
%9 = load i32, i32* %7
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @bounce(i32 %17)
%19 = icmp sgt i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %6
store i32 %21, i32* %4
br label %27
22: ; preds = %15
br label %23
23: ; preds = %22, %11
br label %24
24: ; preds = %23, %3
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp sgt i32 %1, %0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @bounce(i32 %2)
%9 = icmp slt i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7, %3
%11 = add nsw i32 %1, 1
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ %1, %7 ]
ret i32 %13
}
/* Variables and functions */
long double sind(long double);
long double sind_neg(long double x) { return -sind(x); }


x86 assembly (clang, -O0):
<sind_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sind@plt>
fchs
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sind_neg>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <sind@plt>
fchs
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sind_neg(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sind(x86_fp80 %3)
%5 = fneg x86_fp80 %4
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sind_neg(x86_fp80 %0) {
%2 = tail call x86_fp80 @sind(x86_fp80 %0)
%3 = fneg x86_fp80 %2
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ LSR_();
int /*<<< orphan*/ c64_memZeroX();
void LSR_zpx(void) {
  c64_memZeroX();
  LSR_();
}


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

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

LLVM IR (-O0):
define void @LSR_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @LSR_()
ret void
}

LLVM IR (-O2):
define void @LSR_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @LSR_()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int create_phold(const char *file) {
  FILE *out;
  if ((out = fopen(file, "w+x")) == NULL) {
    return -1;
  } else {
    (void)fclose(out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<create_phold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1156 <create_phold+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <create_phold+0x46>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_phold>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <create_phold+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"w+x\00"
define i32 @create_phold(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello world"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int get_cpu_count() {
  int count = 1;
  return count < 1 ? 1 : count;
}


x86 assembly (clang, -O0):
<get_cpu_count>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1122 <get_cpu_count+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <get_cpu_count+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_cpu_count() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
br label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %7
7: ; preds = %5, %4
%8 = phi i32 [ 1, %4 ], [ %6, %5 ]
ret i32 %8
}

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