xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  double d = 7.7;
  int i = 3;
  d = d + i;
  i = d * i;
  printf("d = %lf\n", d);
  printf("i = %i\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvttsd2si -0x10(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"d = %lf\0A\00"
@.str.1 = [8 x i8] c"i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 7.700000e+00, double* %2
store i32 3, i32* %3
%4 = load double, double* %2
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fadd double %4, %6
store double %7, double* %2
%8 = load double, double* %2
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = fptosi double %11 to i32
store i32 %12, i32* %3
%13 = load double, double* %2
%14 = fptosi double %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"d = %lf\0A\00"
@.str.1 = [8 x i8] c"i = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 32)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int pthread_spin_unlock(int /*<<< orphan*/ *);
int __attribute__((unused))
___pthread_spin_unlock(pthread_spinlock_t *spin, char *lname, char *fn,
                       int ln) {
  return pthread_spin_unlock(spin);
}


x86 assembly (clang, -O0):
<___pthread_spin_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_spin_unlock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___pthread_spin_unlock>:
jmp    1030 <pthread_spin_unlock@plt>

LLVM IR (-O0):
define i32 @___pthread_spin_unlock(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 @pthread_spin_unlock(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @___pthread_spin_unlock(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @pthread_spin_unlock(i32* %0)
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
char *allouerchaine(int nbChar) {
  char *ptr = malloc(nbChar * sizeof(char));
  return ptr;
}


x86 assembly (clang, -O0):
<allouerchaine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allouerchaine>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @allouerchaine(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @allouerchaine(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int grades[3];
  int average;
  grades[0] = 80;
  grades[2] = 90;
  grades[1] = 100;
  average = (grades[0] + grades[1] + grades[2]) / 3;
  printf("The average of the 3 grades is: %d", average);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0x10(%rbp)
movl   $0x5a,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The average of the 3 grades is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 80, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 90, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 100, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
%15 = sdiv i32 %14, 3
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The average of the 3 grades is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 90)
ret i32 0
}
void SobelXRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SobelXRow_NEON() {
ret void
}
/* Variables and functions */
long long read_rdtsc();
void GetPerformanceCounter(long long *now) { *now = read_rdtsc(); }


x86 assembly (clang, -O0):
<GetPerformanceCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <read_rdtsc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPerformanceCounter>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <read_rdtsc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @GetPerformanceCounter(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @read_rdtsc()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @GetPerformanceCounter(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @read_rdtsc()
store i64 %2, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ccopy(int const *, void const *, int const *, void *,
                         int const *);
void c_ccopy(const int N, const void *X, const int strideX, void *Y,
             const int strideY) {
  ccopy(&N, X, &strideX, Y, &strideY);
}


x86 assembly (clang, -O0):
<c_ccopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <ccopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ccopy>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <ccopy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @c_ccopy(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %7
%12 = load i8*, i8** %9
%13 = call i32 @ccopy(i32* %6, i8* %11, i32* %8, i8* %12, i32* %10)
ret void
}

LLVM IR (-O2):
define void @c_ccopy(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @ccopy(i32* %6, i8* %1, i32* %7, i8* %3, i32* %8)
ret void
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_pause(int session) { return (ap_do_command_only(session, 0xcc04)); }


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

x86 assembly (clang, -O2):
<ap_pause>:
mov    $0xcc04,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_pause(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52228)
ret i32 %2
}
void av_aes_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_aes_alloc() {
ret void
}
/* Variables and functions */
char const *remote_n1();
const char *call_remote_n1(void) { return remote_n1() + 1; }


x86 assembly (clang, -O0):
<call_remote_n1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_n1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_n1>:
push   %rax
xor    %eax,%eax
call   1030 <remote_n1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_n1() {
%1 = call i8* (...) @remote_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_n1() {
%1 = tail call i8* (...) @remote_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int);
uint32_t _Nios2_Get_ctlreg_mpuacc(void) {
  return (uint32_t)__builtin_rdctl(15);
}


x86 assembly (clang, -O0):
<_Nios2_Get_ctlreg_mpuacc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <__builtin_rdctl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Get_ctlreg_mpuacc>:
mov    $0xf,%edi
jmp    1030 <__builtin_rdctl@plt>

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_mpuacc() {
%1 = call i32 @__builtin_rdctl(i32 15)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_mpuacc() {
%1 = tail call i32 @__builtin_rdctl(i32 15)
ret i32 %1
}
void arch_perfc_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_perfc_reset() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;
typedef int int16_t;

/* Variables and functions */
int8_t u8s8(uint8_t v) { return (v & 0x80) ? ((int16_t)v) - 0x100 : v; }


x86 assembly (clang, -O0):
<u8s8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1128 <u8s8+0x28>
mov    -0x4(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <u8s8+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8s8>:
lea    -0x100(%rdi),%eax
test   $0x80,%dil
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @u8s8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 256
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @u8s8(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, -256
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void take(volatile int *spinlock) {
  int old;
  do {
    asm volatile("xchg %%eax, %2\n\t" : "=a"(old) : "a"(1), "m"(*spinlock));
  } while (old != 0);
}


x86 assembly (clang, -O0):
<take>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
xchg   %eax,(%rcx)
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1108 <take+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<take>:
mov    $0x1,%eax
xchg   %eax,(%rdi)
test   %eax,%eax
jne    1100 <take>
ret

LLVM IR (-O0):
define void @take(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = call i32 asm sideeffect "xchg %eax, $2\0A\09", "={ax},{ax},*m,~{dirflag},~{fpsr},~{flags}"(i32 1, i32* elementtype(i32) %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @take(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 asm sideeffect "xchg %eax, $2\0A\09", "={ax},{ax},*m,~{dirflag},~{fpsr},~{flags}"(i32 1, i32* elementtype(i32) %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle30() { kprintf("ISR %d.\n", 30); }


x86 assembly (clang, -O0):
<isrHandle30>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1e,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle30>:
lea    0xee9(%rip),%rdi
mov    $0x1e,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle30() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 30)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle30() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 30)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void int28(void) { usleep(1); }


x86 assembly (clang, -O0):
<int28>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int28>:
mov    $0x1,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @int28() {
%1 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @int28() {
%1 = tail call i32 @usleep(i32 1)
ret void
}
void strcat1(char *dest, char *source) {
  while (*dest++)
    ;
  dest--;
  while (*dest++ = *source++)
    ;
}


x86 assembly (clang, -O0):
<strcat1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <strcat1+0x29>
jmp    110c <strcat1+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1164 <strcat1+0x64>
jmp    1135 <strcat1+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat1>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat1>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat1+0x10>
ret

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

LLVM IR (-O2):
define void @strcat1(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_di(void) { op_write1(0xf3); }


x86 assembly (clang, -O0):
<op_enc_di>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf3,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_di>:
mov    $0xf3,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_di() {
%1 = call i32 @op_write1(i32 243)
ret void
}

LLVM IR (-O2):
define void @op_enc_di() {
%1 = tail call i32 @op_write1(i32 243)
ret void
}
/* Variables and functions */
float const fabs(float const);
int m3dCloseEnough(const float fCandidate, const float fCompare,
                   const float fEpsilon) {
  return (fabs(fCandidate - fCompare) < fEpsilon);
}


x86 assembly (clang, -O0):
<m3dCloseEnough>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3dCloseEnough>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @m3dCloseEnough(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call float @fabs(float %9)
%11 = load float, float* %6
%12 = fcmp olt float %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @m3dCloseEnough(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fcmp olt float %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ TAB_Fct(char);
void IF_TABMinMax(void) { TAB_Fct('E'); }


x86 assembly (clang, -O0):
<IF_TABMinMax>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <TAB_Fct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_TABMinMax>:
mov    $0x45,%edi
jmp    1030 <TAB_Fct@plt>

LLVM IR (-O0):
define void @IF_TABMinMax() {
%1 = call i32 @TAB_Fct(i8 signext 69)
ret void
}

LLVM IR (-O2):
define void @IF_TABMinMax() {
%1 = tail call i32 @TAB_Fct(i8 signext 69)
ret void
}
void EVP_PKEY2PKCS8_broken(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY2PKCS8_broken() {
ret void
}
void I2CSlaveIntRawStatusClearEx(unsigned int baseAdd, unsigned int intFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x24)))) = intFlag;
}


x86 assembly (clang, -O0):
<I2CSlaveIntRawStatusClearEx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntRawStatusClearEx>:
add    $0x24,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntRawStatusClearEx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 36
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntRawStatusClearEx(i32 %0, i32 %1) {
%3 = add i32 %0, 36
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_big(int number) {
  if (number > 10) {
    printf("%d is big\n", number);
  }
}


x86 assembly (clang, -O0):
<print_big>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    1134 <print_big+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_big>:
cmp    $0xb,%edi
jl     1123 <print_big+0x13>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d is big\0A\00"
define void @print_big(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int real_fstat(int, void *);
scalar_t__ smbw_fd(int);
int smbw_fstat(int, void *);
int fstat(int fd, void *st) {
  if (smbw_fd(fd)) {
    return smbw_fstat(fd, st);
  }
  return real_fstat(fd, st);
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <smbw_fd@plt>
cmp    $0x0,%rax
je     1165 <fstat+0x35>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <smbw_fstat@plt>
mov    %eax,-0x4(%rbp)
jmp    1174 <fstat+0x44>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <real_fstat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <smbw_fd@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1152 <fstat+0x22>
pop    %rbx
pop    %rbp
jmp    1030 <smbw_fstat@plt>
pop    %rbx
pop    %rbp
jmp    1050 <real_fstat@plt>

LLVM IR (-O0):
define i32 @fstat(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = call i64 @smbw_fd(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i32 @smbw_fstat(i32 %10, i8* %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = call i32 @real_fstat(i32 %14, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @fstat(i32 %0, i8* %1) {
%3 = tail call i64 @smbw_fd(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @smbw_fstat(i32 %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @real_fstat(i32 %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_clear(int *);
oof() {
  int live_head;
  int *live = &live_head;
  if (live)
    bitmap_clear(live);
}


x86 assembly (clang, -O0):
<oof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <oof+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <bitmap_clear@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oof>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <bitmap_clear@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @oof() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32*, i32** %3
%8 = call i32 @bitmap_clear(i32* %7)
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @oof() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @bitmap_clear(i32* %1)
ret i32 undef
}
int main() { return 3 * 4 + 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xe,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 14
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CLOEXEC;
int /*<<< orphan*/ close(int);
int epoll_create1(int /*<<< orphan*/);
int main(void) {
  int ep = epoll_create1(EPOLL_CLOEXEC);
  close(ep);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <epoll_create1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <epoll_create1@plt>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EPOLL_CLOEXEC = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @EPOLL_CLOEXEC
%3 = call i32 @epoll_create1(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @close(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@EPOLL_CLOEXEC = global i32 0
define i32 @main() {
%1 = load i32, i32* @EPOLL_CLOEXEC
%2 = tail call i32 @epoll_create1(i32 %1)
%3 = tail call i32 @close(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outl(unsigned int, int);
void spd_set_drb(void) {
  unsigned end_of_memory;
  unsigned device;
  end_of_memory = 0;
  device = 0x50;
  while (device <= 0x53) {
    unsigned side1_bits;
    side1_bits = -1;
    if (side1_bits < 8) {
      end_of_memory += (1 << side1_bits);
    }
    outl(end_of_memory, 0x1234);
  }
}


x86 assembly (clang, -O0):
<spd_set_drb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0x8(%rbp)
cmpl   $0x53,-0x8(%rbp)
ja     1163 <spd_set_drb+0x53>
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jae    1151 <spd_set_drb+0x41>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1234,%esi
call   1030 <outl@plt>
jmp    1126 <spd_set_drb+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spd_set_drb>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    $0x1234,%esi
call   1030 <outl@plt>
jmp    1120 <spd_set_drb+0x10>

LLVM IR (-O0):
define void @spd_set_drb() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 80, i32* %2
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %2
%6 = icmp ule i32 %5, 83
br i1 %6, label %7, label %18
7: ; preds = %4
store i32 -1, i32* %3
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 8
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = shl i32 1, %11
%13 = load i32, i32* %1
%14 = add i32 %13, %12
store i32 %14, i32* %1
br label %15
15: ; preds = %10, %7
%16 = load i32, i32* %1
%17 = call i32 @outl(i32 %16, i32 4660)
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @spd_set_drb() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @outl(i32 0, i32 4660)
br label %1
}
unsigned char ReadByte(const unsigned char **p) {
  unsigned char c = *(*p);
  (*p) += 1;
  return c;
}


x86 assembly (clang, -O0):
<ReadByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadByte>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i8 @ReadByte(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @ReadByte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
void f105(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    goto a;
  a:
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f105>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f105() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %1
store i32 0, i32* %2
%8 = load i32, i32* %2
store i32 0, i32* %3
%9 = load i32, i32* %3
br label %10
10: ; preds = %0
store i32 0, i32* %4
%11 = load i32, i32* %4
store i32 0, i32* %5
%12 = load i32, i32* %5
store i32 0, i32* %6
%13 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @f105() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(778, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_container_to_start_system>:
mov    $0x30a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 778, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void bfuncddb_add(struct bfunc *func) { return; }


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

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

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

LLVM IR (-O2):
%struct.bfunc = type opaque
define void @bfuncddb_add(%struct.bfunc* nocapture %0) {
ret void
}
unsigned int autofs_type_offset(unsigned int type) { return (type == 4U); }


x86 assembly (clang, -O0):
<autofs_type_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<autofs_type_offset>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @autofs_type_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @autofs_type_offset(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
int strlength(char *s) {
  int n;
  for (n = 0; *s != '\0'; s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlength+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
cmpb   $0x0,(%rdi)
je     111c <strlength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
void init(double *a1, double *a2) {
  double s = -1;
  int i;
  for (i = 0; i < 100000; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x186a0,-0x1c(%rbp)
jge    1180 <init+0x80>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <init+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
xor    %eax,%eax
movabs $0xbff0000000000000,%r8
movabs $0x3ff0000000000000,%rdx
cs nopw 0x0(%rax,%rax,1)
mov    %r8,(%rdi,%rax,8)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsi,%rax,8)
lea    0x1(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mov    %rdx,0x8(%rdi,%rax,8)
movsd  %xmm0,0x8(%rsi,%rax,8)
add    $0x2,%rax
cmp    $0x186a0,%rax
jne    1120 <init+0x20>
ret

LLVM IR (-O0):
define void @init(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double -1.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %24, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 100000
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load double, double* %5
%12 = load double*, double** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = load double*, double** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double %17, double* %21
%22 = load double, double* %5
%23 = fneg double %22
store double %23, double* %5
br label %24
24: ; preds = %10
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @init(double* nocapture writeonly %0, double* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %14, %3 ]
%5 = getelementptr inbounds double, double* %0, i64 %4
store double -1.000000e+00, double* %5
%6 = trunc i64 %4 to i32
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds double, double* %1, i64 %4
store double %7, double* %8
%9 = or i64 %4, 1
%10 = getelementptr inbounds double, double* %0, i64 %9
store double 1.000000e+00, double* %10
%11 = trunc i64 %9 to i32
%12 = sitofp i32 %11 to double
%13 = getelementptr inbounds double, double* %1, i64 %9
store double %12, double* %13
%14 = add nuw nsw i64 %4, 2
%15 = icmp eq i64 %14, 100000
br i1 %15, label %16, label %3
16: ; preds = %3
ret void
}
void tachyon_display_delete(struct anon$3 *dh) { ; }


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

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

LLVM IR (-O0):
%"struct.anon$3" = type opaque
define void @tachyon_display_delete(%"struct.anon$3"* %0) {
%2 = alloca %"struct.anon$3"*
store %"struct.anon$3"* %0, %"struct.anon$3"** %2
ret void
}

LLVM IR (-O2):
%"struct.anon$3" = type opaque
define void @tachyon_display_delete(%"struct.anon$3"* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_15964() {
  Assert_real((isqrt(15964) == 126),
              "/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/stdlib/isqrt.c",
              1620, ("Integer square root of 15964 should be 126"));
}


x86 assembly (clang, -O0):
<t_sqrt_15964>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e5c,%edi
call   1030 <isqrt@plt>
cmp    $0x7e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x654,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_15964>:
push   %rax
mov    $0x3e5c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7e,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x654,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 15964 should be 126\00"
define void @t_sqrt_15964() {
%1 = call i32 @isqrt(i32 15964)
%2 = icmp eq i32 %1, 126
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1620, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 15964 should be 126\00"
define void @t_sqrt_15964() {
%1 = tail call i32 @isqrt(i32 15964)
%2 = icmp eq i32 %1, 126
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1620, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_ACuint16_mem(unsigned short *val) {
  return ((*val) & (0xAC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ACuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_ACuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 172
%7 = icmp ne i32 %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_ACuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 172
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_messages {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_messages *_Locale_messages_create(const char *name,
                                                 struct _Locale_name_hint *hint
                                                 __attribute__((__unused__)),
                                                 int *__err_code) {
  return (struct _Locale_messages *)_Locale_create(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_messages_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_Locale_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_messages_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_messages = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_messages* @_Locale_messages_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_messages*
ret %struct._Locale_messages* %10
}

LLVM IR (-O2):
%struct._Locale_messages = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_messages* @_Locale_messages_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_messages*
ret %struct._Locale_messages* %5
}
/* Variables and functions */
int /*<<< orphan*/ jwArr_raw(char *);
void jwArr_null() { jwArr_raw("null"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define void @jwArr_null() {
%1 = tail call i32 @jwArr_raw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float exp2f(int);
float testimg_val_to_exp(const float val) { return exp2f(15 * (val - 1.0f)); }


x86 assembly (clang, -O0):
<testimg_val_to_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeda(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xeca(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <exp2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testimg_val_to_exp>:
addss  0xee8(%rip),%xmm0
mulss  0xee4(%rip),%xmm0
cvttss2si %xmm0,%edi
jmp    1030 <exp2f@plt>

LLVM IR (-O0):
define float @testimg_val_to_exp(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.000000e+00
%5 = fmul float 1.500000e+01, %4
%6 = fptosi float %5 to i32
%7 = call float @exp2f(i32 %6)
ret float %7
}

LLVM IR (-O2):
define float @testimg_val_to_exp(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, 1.500000e+01
%4 = fptosi float %3 to i32
%5 = tail call float @exp2f(i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int do_an_allocation() {
  int *a = malloc(sizeof(int));
  int *b = a;
  free(a);
  *b = 4;
  return 48;
}


x86 assembly (clang, -O0):
<do_an_allocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
mov    $0x30,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_an_allocation>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x30,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_an_allocation() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %2
store i32 4, i32* %7
ret i32 48
}

LLVM IR (-O2):
define i32 @do_an_allocation() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @free(i32* %1)
ret i32 48
}
int divi(int x, int y) {
  int z;
  z = x / y;
  return z;
}


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

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

LLVM IR (-O0):
define i32 @divi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @divi(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_signal(pthread_cond_t *__cond) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* nocapture readnone %0) {
ret i32 0
}
void gtk_image_new_from_pixmap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_new_from_pixmap() {
ret void
}