xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ setenv(char *, char *, int);
int main() {
  setenv("MallocScribble", "1", 1);
  long **buf = (long **)malloc(12);
  long *ptr = buf[0];
  long l = ptr[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0xc,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"MallocScribble\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @main() {
%1 = alloca i64**
%2 = alloca i64*
%3 = alloca i64
%4 = call i32 @setenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = call i64 @malloc(i32 12)
%6 = inttoptr i64 %5 to i64**
store i64** %6, i64*** %1
%7 = load i64**, i64*** %1
%8 = getelementptr inbounds i64*, i64** %7, i64 0
%9 = load i64*, i64** %8
store i64* %9, i64** %2
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
store i64 %12, i64* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"MallocScribble\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i64 @malloc(i32 12)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hola Nicolas!!!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"!!!Hola Nicolas!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [19 x i8] c"!!!Hola Nicolas!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ realloc(int /*<<< orphan*/ *, int);
void extend_buffer_if_needed(wchar_t **buffer, int *buffer_size, int pos) {
  if (pos >= *buffer_size - 1) {
    *buffer_size *= 2;
    *buffer = (wchar_t *)realloc(*buffer, *buffer_size * sizeof(wchar_t));
  }
}


x86 assembly (clang, -O0):
<extend_buffer_if_needed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     1165 <extend_buffer_if_needed+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_buffer_if_needed>:
push   %rbx
mov    %rsi,%rax
mov    (%rsi),%esi
lea    -0x1(%rsi),%ecx
cmp    %edx,%ecx
jg     1133 <extend_buffer_if_needed+0x23>
mov    %rdi,%rbx
lea    (%rsi,%rsi,1),%ecx
mov    %ecx,(%rax)
mov    (%rdi),%rdi
shl    $0x3,%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @extend_buffer_if_needed(i32** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
%6 = icmp sgt i32 %5, %2
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = shl nsw i32 %4, 1
store i32 %8, i32* %1
%9 = load i32*, i32** %0
%10 = shl i32 %4, 3
%11 = tail call i64 @realloc(i32* %9, i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %0
br label %13
13: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int v[], int length) {
  for (int i = 0; i < length; i++) {
    printf("%-3d", v[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%-3d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
long random();
long rbetween(long a, long b) {
  long r, ret, diff;
  double rf, r2, r3;
  r = random();
  rf = (double)r / (double)2147483647;
  diff = b - a + 1;
  r2 = rf * (double)diff;
  r3 = r2 + (double)a;
  ret = (long)r3;
  return ret;
}


x86 assembly (clang, -O0):
<rbetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdq -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cvttsd2si -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbetween>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
divsd  0xed2(%rip),%xmm0
sub    %r14,%rbx
add    $0x1,%rbx
cvtsi2sd %rbx,%xmm1
cvtsi2sd %r14,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @rbetween(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%11 = call i64 (...) @random()
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 0x41DFFFFFFFC00000
store double %14, double* %8
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = sub nsw i64 %15, %16
%18 = add nsw i64 %17, 1
store i64 %18, i64* %7
%19 = load double, double* %8
%20 = load i64, i64* %7
%21 = sitofp i64 %20 to double
%22 = fmul double %19, %21
store double %22, double* %9
%23 = load double, double* %9
%24 = load i64, i64* %3
%25 = sitofp i64 %24 to double
%26 = fadd double %23, %25
store double %26, double* %10
%27 = load double, double* %10
%28 = fptosi double %27 to i64
store i64 %28, i64* %6
%29 = load i64, i64* %6
ret i64 %29
}

LLVM IR (-O2):
define i64 @rbetween(i64 %0, i64 %1) {
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 0x41DFFFFFFFC00000
%6 = sub i64 1, %0
%7 = add i64 %6, %1
%8 = sitofp i64 %7 to double
%9 = fmul double %5, %8
%10 = sitofp i64 %0 to double
%11 = fadd double %9, %10
%12 = fptosi double %11 to i64
ret i64 %12
}
regx0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[x0]) = (((float *)(11111111 & ~(__alignof__(float) - 1)))[x1]); }


x86 assembly (clang, -O0):
<regx0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac4,%eax
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac4(,%rax,4),%xmm0
movslq %edi,%rax
movss  %xmm0,(%rdx,%rax,4)
ret

LLVM IR (-O0):
define i32 @regx0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %17
%19 = load float, float* %18
%20 = load float*, float** %12
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float %19, float* %23
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @regx0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %7
%9 = load float, float* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds float, float* %4, i64 %10
store float %9, float* %11
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __cxa_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ _fini();
int /*<<< orphan*/ _init();
int /*<<< orphan*/ exit(int);
int main(int, char **);
void _start(int argc, char *argv[]) {
  _init();
  int ret = main(argc, argv);
  _fini();
  __cxa_finalize(NULL);
  exit(ret);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1000 <_init>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1160 <_fini>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <__cxa_finalize@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1000 <_init>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <main@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1150 <_fini>
xor    %edi,%edi
call   1050 <__cxa_finalize@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @_init()
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @main(i32 %7, i8** %8)
store i32 %9, i32* %5
%10 = call i32 (...) @_fini()
%11 = call i32 @__cxa_finalize(i32* null)
%12 = load i32, i32* %5
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 (...) @_init()
%4 = tail call i32 @main(i32 %0, i8** %1)
%5 = tail call i32 (...) @_fini()
%6 = tail call i32 @__cxa_finalize(i32* null)
%7 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_good() { printf("Accepted!\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Accepted!\00"
define void @print_good() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x48() {
  Assert_real((isodigit(72) == 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_isodigit.c",
              365, ("isodigit should be 0 for H"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x48>:
push   %rax
mov    $0x48,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x16d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for H\00"
define void @t_isodigit_0x48() {
%1 = call i64 @isodigit(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for H\00"
define void @t_isodigit_0x48() {
%1 = tail call i64 @isodigit(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast8_t;

/* Variables and functions */
int /*<<< orphan*/ con_force_goto(int /*<<< orphan*/, int /*<<< orphan*/);
void con_goto(uint_fast8_t y, uint_fast8_t x) { con_force_goto(y, x); }


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

x86 assembly (clang, -O2):
<con_goto>:
jmp    1030 <con_force_goto@plt>

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

LLVM IR (-O2):
define void @con_goto(i32 %0, i32 %1) {
%3 = tail call i32 @con_force_goto(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __atomic_fetch_add_2(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint16_t var;
  __atomic_fetch_add_2(&var, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <__atomic_fetch_add_2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <__atomic_fetch_add_2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @__atomic_fetch_add_2(i32* %3, i32 1, i32 0)
ret i32 0
}
void opNOP(void) {}


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

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

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

LLVM IR (-O2):
define void @opNOP() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_morph(int, char **);
int main(int argc, char *argv[]) {
  gmx_morph(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_morph@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_morph(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display_int(int);
int /*<<< orphan*/ display_str(char *);
void spurous_irq(int irq) {
  display_str("spurous_irq: ");
  display_int(irq);
  display_str("\n");
}


x86 assembly (clang, -O0):
<spurous_irq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <display_str@plt>
mov    -0x4(%rbp),%edi
call   1030 <display_int@plt>
lea    0xec8(%rip),%rdi
call   1040 <display_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spurous_irq>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <display_str@plt>
mov    %ebx,%edi
call   1030 <display_int@plt>
lea    0xed1(%rip),%rdi
pop    %rbx
jmp    1040 <display_str@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"spurous_irq: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @spurous_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @display_str(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @display_int(i32 %4)
%6 = call i32 @display_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"spurous_irq: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @spurous_irq(i32 %0) {
%2 = tail call i32 @display_str(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @display_int(i32 %0)
%4 = tail call i32 @display_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void os_set_colour(int x, int y) {}


x86 assembly (clang, -O0):
<os_set_colour>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @os_set_colour(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @os_set_colour(i32 %0, i32 %1) {
ret void
}
int myHashCodeChar(void *a) {
  char *aa = (char *)a;
  return *aa;
}


x86 assembly (clang, -O0):
<myHashCodeChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myHashCodeChar>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @myHashCodeChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @myHashCodeChar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR58_get(void) { return U_WMRCORENONE_get("U_WMR58"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR58\00"
define i32 @U_WMR58_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR58\00"
define i32 @U_WMR58_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int fll1(int j, char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll1>:
movsbl (%rsi,%rdx,1),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fll1(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @fll1(i32 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int percent(long long a, long long b) {
  if (b <= 0 || a <= 0)
    return 0;
  if (a >= b)
    return 100;
  return (a * 100 / b);
}


x86 assembly (clang, -O0):
<percent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    1122 <percent+0x22>
cmpq   $0x0,-0x10(%rbp)
jg     112e <percent+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1156 <percent+0x56>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1148 <percent+0x48>
movl   $0x64,-0x4(%rbp)
jmp    1156 <percent+0x56>
imul   $0x64,-0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<percent>:
xor    %eax,%eax
test   %rdi,%rdi
jle    112b <percent+0x2b>
test   %rsi,%rsi
jle    112b <percent+0x2b>
mov    $0x64,%eax
cmp    %rsi,%rdi
jae    112b <percent+0x2b>
imul   $0x64,%rdi,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     112c <percent+0x2c>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i32 @percent(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 1
%4 = icmp slt i64 %0, 1
%5 = or i1 %4, %3
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = icmp ult i64 %0, %1
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = mul nsw i64 %0, 100
%10 = sdiv i64 %9, %1
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %6, %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ], [ 100, %6 ]
ret i32 %13
}
int foo(void *pointer) {
  *((int *)pointer) = 0;
  return 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,(%rdi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
store i32 0, i32* %4
ret i32 3
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t time(time_t *tloc) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  if (tloc) {
    *tloc = tv.tv_sec;
  }
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmpq   $0x0,-0x8(%rbp)
je     113d <time+0x2d>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     112f <time+0x1f>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = icmp eq i32* %0, null
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i32, i32* %6
br i1 %5, label %9, label %8
8: ; preds = %1
store i32 %7, i32* %0
br label %9
9: ; preds = %1, %8
ret i32 %7
}
float n_saturate(float val) {
  if (val < 0.0f)
    return 0.0f;
  else if (val > 1.0f)
    return 1.0f;
  else
    return val;
}


x86 assembly (clang, -O0):
<n_saturate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <n_saturate+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <n_saturate+0x55>
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <n_saturate+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <n_saturate+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_saturate>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @n_saturate(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %13
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store float 1.000000e+00, float* %2
br label %13
11: ; preds = %7
%12 = load float, float* %3
store float %12, float* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @n_saturate(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
void initneighbourhoodshape() {}


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

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

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

LLVM IR (-O2):
define void @initneighbourhoodshape() {
ret void
}
int main() {
  int x = 0, y = 0, N;
  while (1) {
    x *= 2;
    y /= 2;
    y += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 2
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ platform_outb(int /*<<< orphan*/, unsigned long);
void __outsb(unsigned long port, const void *src, unsigned long count) {
  const unsigned char *sp = src;
  while (count--)
    platform_outb(*sp++, port);
}


x86 assembly (clang, -O0):
<__outsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <__outsb+0x55>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <platform_outb@plt>
jmp    112c <__outsb+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outsb>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1146 <__outsb+0x36>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <platform_outb@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <__outsb+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__outsb(i64 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %9, %5 ], [ %1, %3 ]
%7 = phi i64 [ %8, %5 ], [ %2, %3 ]
%8 = add i64 %7, -1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = tail call i32 @platform_outb(i32 %11, i64 %0)
%13 = icmp eq i64 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *charesc(int);
int /*<<< orphan*/ printf(char *, char *);
int warterm_putch(int c) {
  printf("P\01%s\01\n", charesc(c));
  return 0;
}


x86 assembly (clang, -O0):
<warterm_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <charesc@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"P\01%s\01\0A\00"
define i32 @warterm_putch(i32 %0) {
%2 = tail call i8* @charesc(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
double cos(double);
double cosine(double x) {
  x = cos(x);
  return x;
}


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

x86 assembly (clang, -O2):
<cosine>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cosine(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @cosine(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int random();
int randint(int n) { return random() % n; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @randint(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
ret i32 %3
}
void foo499() {}


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

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

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

LLVM IR (-O2):
define void @foo499() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void uninitvar_fputs(void) {
  char *string;
  FILE *stream;
  (void)fputs(string, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fputs>:
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define void @uninitvar_fputs() {
%1 = alloca i8*
%2 = alloca i32*
%3 = load i8*, i8** %1
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i8* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fputs() {
%1 = tail call i32 @fputs(i8* undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _itoa(int, char *, int *);
void itoa(int n, char s[]) {
  int idx = 0;
  _itoa(n, s, &idx);
  s[idx] = '\0';
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <_itoa@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <_itoa@plt>
movslq 0xc(%rsp),%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @itoa(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @_itoa(i32 %6, i8* %7, i32* %5)
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @itoa(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @_itoa(i32 %0, i8* %1, i32* %3)
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_func() { printf("hello there\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello there\00"
define void @hello_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int max_path_length() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @max_path_length() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ cfftf1(int, float *, float *, float *, int *, int);
void cfftf(int n, float c[], float wsave[]) {
  int iw1, iw2;
  if (n == 1)
    return;
  iw1 = 2 * n;
  iw2 = iw1 + 2 * n;
  cfftf1(n, c, wsave, wsave + iw1, (int *)(wsave + iw2), -1);
}


x86 assembly (clang, -O0):
<cfftf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1132 <cfftf+0x22>
jmp    117d <cfftf+0x6d>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x18(%rbp),%r8
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
mov    $0xffffffff,%r9d
call   1030 <cfftf1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfftf>:
cmp    $0x1,%edi
jne    1116 <cfftf+0x6>
ret
lea    (%rdi,%rdi,1),%eax
lea    0x0(,%rdi,4),%r8d
cltq
lea    (%rdx,%rax,4),%rcx
movslq %r8d,%rax
lea    (%rdx,%rax,4),%r8
mov    $0xffffffff,%r9d
jmp    1030 <cfftf1@plt>

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

LLVM IR (-O2):
define void @cfftf(i32 %0, float* %1, float* %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = shl nsw i32 %0, 1
%7 = shl nsw i32 %0, 2
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds float, float* %2, i64 %8
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds float, float* %2, i64 %10
%12 = bitcast float* %11 to i32*
%13 = tail call i32 @cfftf1(i32 %0, float* %1, float* %2, float* %9, i32* %12, i32 -1)
br label %14
14: ; preds = %3, %5
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerRTCEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<TimerRTCEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerRTCEnable>:
movslq %edi,%rax
orl    $0x10,0xc(%rax)
ret

LLVM IR (-O0):
define void @TimerRTCEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 16
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @TimerRTCEnable(i32 %0) {
%2 = add nsw i32 %0, 12
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 16
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int libtest_main();
int main() { return libtest_main(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <libtest_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libtest_main()
ret i32 %1
}
int risupper(int c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<risupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <risupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<risupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @risupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int mbtowc(int /*<<< orphan*/ *, char const *, size_t);
int mblen(const char *s, size_t size) { return mbtowc(NULL, s, size); }


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

x86 assembly (clang, -O2):
<mblen>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <mbtowc@plt>

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

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = tail call i32 @mbtowc(i32* null, i8* %0, i64 %1)
ret i32 %3
}