xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_repr(char *, int, int /*<<< orphan*/ *);
int list_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_repr(val, vallen, fp);
  fputc(',', fp);
  return 0;
}


x86 assembly (clang, -O0):
<list_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fwrite_repr@plt>
mov    -0x20(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_val>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <fwrite_repr@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @list_val(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite_repr(i8* %10, i32 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fputc(i8 signext 44, i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @list_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_repr(i8* %1, i32 %2, i32* %4)
%6 = tail call i32 @fputc(i8 signext 44, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fB() { printf("Hey! What's up? I'm fB.\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Hey! What's up? I'm fB.\0A\00"
define void @fB() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Hey! What's up? I'm fB.\00"
define void @fB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
float psi2(x, sigma2)
float x, sigma2;
{
  float result;
  result = (2.0 * x) / (sigma2 + (x * x));
  return (result);
}


x86 assembly (clang, -O0):
<psi2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x18(%rbp)
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi2>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm0,%xmm2
addsd  %xmm2,%xmm2
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @psi2(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = fptrunc double %0 to float
%7 = fptrunc double %1 to float
store float %6, float* %3
store float %7, float* %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fmul double 2.000000e+00, %9
%11 = load float, float* %4
%12 = load float, float* %3
%13 = load float, float* %3
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float %11)
%15 = fpext float %14 to double
%16 = fdiv double %10, %15
%17 = fptrunc double %16 to float
store float %17, float* %5
%18 = load float, float* %5
ret float %18
}

LLVM IR (-O2):
define float @psi2(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fpext float %3 to double
%6 = fmul double %5, 2.000000e+00
%7 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %4)
%8 = fpext float %7 to double
%9 = fdiv double %6, %8
%10 = fptrunc double %9 to float
ret float %10
}
double apply(double(f)(int), int x) { return f(x); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define double @apply(double (i32)* nocapture %0, i32 %1) {
%3 = tail call double %0(i32 %1)
ret double %3
}
void print_last_error() {}


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

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

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

LLVM IR (-O2):
define void @print_last_error() {
ret void
}
/* Variables and functions */
int create_new_version_generic(char const *, int /*<<< orphan*/, int,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int create_new_version(const char *vpath) {
  return create_new_version_generic(vpath, 0, 1, 0, 0, 0);
}


x86 assembly (clang, -O0):
<create_new_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %r9d,%r9d
mov    $0x1,%edx
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <create_new_version_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_new_version>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <create_new_version_generic@plt>

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

LLVM IR (-O2):
define i32 @create_new_version(i8* %0) {
%2 = tail call i32 @create_new_version_generic(i8* %0, i32 0, i32 1, i32 0, i32 0, i32 0)
ret i32 %2
}
int determinant2d(int const a, int const b, int const c, int const d) {
  return a * d - c * b;
}


x86 assembly (clang, -O0):
<determinant2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant2d>:
mov    %edi,%eax
imul   %ecx,%eax
imul   %edx,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @determinant2d(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @determinant2d(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = mul nsw i32 %2, %1
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *l_do_topipe(char *, char *, int /*<<< orphan*/);
char *mactopipe(char *arg) { return l_do_topipe(arg, "topipe", 0); }


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

x86 assembly (clang, -O2):
<mactopipe>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <l_do_topipe@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"topipe\00"
define i8* @mactopipe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @l_do_topipe(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"topipe\00"
define i8* @mactopipe(i8* %0) {
%2 = tail call i8* @l_do_topipe(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xd1() {
  Assert_real((isodigit(209) == 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",
              1050, ("isodigit should be 0 for 0xd1"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xd1>:
push   %rax
mov    $0xd1,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x41a,%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 = [30 x i8] c"isodigit should be 0 for 0xd1\00"
define void @t_isodigit_0xd1() {
%1 = call i64 @isodigit(i32 209)
%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 1050, i8* getelementptr inbounds ([30 x i8], [30 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 = [30 x i8] c"isodigit should be 0 for 0xd1\00"
define void @t_isodigit_0xd1() {
%1 = tail call i64 @isodigit(i32 209)
%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 1050, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(int argc, char *argv[]) {
  int a;
  __asm("mov %%ebp, %0" : "+m"(a));
  printf("EBP: %x\n", a);
  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)
mov    %ebp,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"EBP: %x\0A\00"
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 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"EBP: %x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WriteSlaveSyncFile();
void SlaveExit(void) { WriteSlaveSyncFile(); }


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

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

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

LLVM IR (-O2):
define void @SlaveExit() {
%1 = tail call i32 (...) @WriteSlaveSyncFile()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void minipack_pack_map16(void *ptr, uint16_t count, size_t *sz) {
  *sz = 3;
  *((uint8_t *)ptr) = 0xDE;
  *((uint16_t *)(ptr + 1)) = htons(count);
}


x86 assembly (clang, -O0):
<minipack_pack_map16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xde,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_map16>:
push   %rbx
mov    %rdi,%rbx
movq   $0x3,(%rdx)
movl   $0xde,(%rdi)
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @minipack_pack_map16(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 3, i64* %7
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 222, i32* %9
%10 = load i32, i32* %5
%11 = call i32 @htons(i32 %10)
%12 = load i8*, i8** %4
%13 = getelementptr i8, i8* %12, i64 1
%14 = bitcast i8* %13 to i32*
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @minipack_pack_map16(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 3, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 222, i32* %4
%5 = tail call i32 @htons(i32 %1)
%6 = getelementptr i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *BuildOneTwoThree();
int Count(struct node *, int);
int /*<<< orphan*/ assert(int);
void CountTest() {
  struct node *list;
  list = BuildOneTwoThree();
  int count = Count(list, 2);
  assert(count == 1);
}


x86 assembly (clang, -O0):
<CountTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <BuildOneTwoThree@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <Count@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountTest>:
push   %rax
xor    %eax,%eax
call   1030 <BuildOneTwoThree@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1040 <Count@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1050 <assert@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @CountTest() {
%1 = alloca %struct.node*
%2 = alloca i32
%3 = call %struct.node* (...) @BuildOneTwoThree()
store %struct.node* %3, %struct.node** %1
%4 = load %struct.node*, %struct.node** %1
%5 = call i32 @Count(%struct.node* %4, i32 2)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @CountTest() {
%1 = tail call %struct.node* (...) @BuildOneTwoThree()
%2 = tail call i32 @Count(%struct.node* %1, i32 2)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
void RGB0255toRGB01(double r, double g, double b, double *r2, double *g2,
                    double *b2) {
  *r2 = r / 255.;
  *g2 = g / 255.;
  *b2 = b / 255.;
}


x86 assembly (clang, -O0):
<RGB0255toRGB01>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB0255toRGB01>:
movsd  0xef8(%rip),%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
divsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
divsd  %xmm3,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @RGB0255toRGB01(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = fdiv double %13, 2.550000e+02
%15 = load double*, double** %10
store double %14, double* %15
%16 = load double, double* %8
%17 = fdiv double %16, 2.550000e+02
%18 = load double*, double** %11
store double %17, double* %18
%19 = load double, double* %9
%20 = fdiv double %19, 2.550000e+02
%21 = load double*, double** %12
store double %20, double* %21
ret void
}

LLVM IR (-O2):
define void @RGB0255toRGB01(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fdiv double %0, 2.550000e+02
store double %7, double* %3
%8 = fdiv double %1, 2.550000e+02
store double %8, double* %4
%9 = fdiv double %2, 2.550000e+02
store double %9, double* %5
ret void
}
int search(int vc[], int key, int no) {
  int i = 0;
  vc[no] = key;
  for (i = 0; vc[i] != key; i++)
    ;
  return (i == no ? -1 : i);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
je     1151 <search+0x51>
jmp    1143 <search+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <search+0x2a>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    116a <search+0x6a>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1170 <search+0x70>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
movslq %edx,%rax
mov    %esi,(%rdi,%rax,4)
mov    $0xffffffff,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
lea    0x4(%rdi),%rax
cmp    %esi,(%rdi)
mov    %rax,%rdi
jne    1110 <search+0x10>
cmp    %ecx,%edx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %1, i32* %5
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, %1
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
%13 = trunc i64 %7 to i32
%14 = icmp eq i32 %13, %2
%15 = select i1 %14, i32 -1, i32 %13
ret i32 %15
}
/* Variables and functions */
scalar_t__ abs(char);
int max(scalar_t__, scalar_t__);
int getMin(char x, char y) { return max(abs(x - y), 26 - abs(x - y)); }


x86 assembly (clang, -O0):
<getMin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1a,%esi
sub    %rax,%rsi
call   1040 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMin>:
push   %r14
push   %rbx
push   %rax
sub    %sil,%dil
movsbl %dil,%ebx
mov    %ebx,%edi
call   1030 <abs@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <abs@plt>
mov    $0x1a,%esi
sub    %rax,%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <max@plt>

LLVM IR (-O0):
define i32 @getMin(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = trunc i32 %9 to i8
%11 = call i64 @abs(i8 signext %10)
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = trunc i32 %16 to i8
%18 = call i64 @abs(i8 signext %17)
%19 = sub nsw i64 26, %18
%20 = call i32 @max(i64 %11, i64 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @getMin(i8 signext %0, i8 signext %1) {
%3 = sub i8 %0, %1
%4 = tail call i64 @abs(i8 signext %3)
%5 = tail call i64 @abs(i8 signext %3)
%6 = sub nsw i64 26, %5
%7 = tail call i32 @max(i64 %4, i64 %6)
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t roundup_pow2_u32(uint32_t value) {
  --value;
  value |= value >> 1;
  value |= value >> 2;
  value |= value >> 4;
  value |= value >> 8;
  value |= value >> 16;
  ++value;
  return value;
}


x86 assembly (clang, -O0):
<roundup_pow2_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_pow2_u32>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @roundup_pow2_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @roundup_pow2_u32(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ PKCS5_PBKDF2_HMAC_SHA1(char *, int, unsigned char *, int,
                                          int, int, unsigned char *);
void pbkdf2(char *pass, unsigned char *salt, unsigned char *out) {
  PKCS5_PBKDF2_HMAC_SHA1(pass, -1, salt, 128, 100000, 32, out);
}


x86 assembly (clang, -O0):
<pbkdf2>:
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    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    $0xffffffff,%esi
mov    $0x80,%ecx
mov    $0x186a0,%r8d
mov    $0x20,%r9d
mov    %rax,(%rsp)
call   1030 <PKCS5_PBKDF2_HMAC_SHA1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbkdf2>:
push   %rax
mov    %rsi,%rax
mov    %rdx,(%rsp)
mov    $0xffffffff,%esi
mov    %rax,%rdx
mov    $0x80,%ecx
mov    $0x186a0,%r8d
mov    $0x20,%r9d
call   1030 <PKCS5_PBKDF2_HMAC_SHA1@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pbkdf2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %7, i32 -1, i8* %8, i32 128, i32 100000, i32 32, i8* %9)
ret void
}

LLVM IR (-O2):
define void @pbkdf2(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %0, i32 -1, i8* %1, i32 128, i32 100000, i32 32, i8* %2)
ret void
}
/* Type definitions */
struct statement {
  int dummy;
};

/* Variables and functions */
struct statement *stmt_void();
struct statement *stmt_default(struct statement *stmt) {
  return stmt_void();
}


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

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

LLVM IR (-O0):
%struct.statement = type { i32 }
define %struct.statement* @stmt_default(%struct.statement* %0) {
%2 = alloca %struct.statement*
store %struct.statement* %0, %struct.statement** %2
%3 = call %struct.statement* (...) @stmt_void()
ret %struct.statement* %3
}

LLVM IR (-O2):
%struct.statement = type { i32 }
define %struct.statement* @stmt_default(%struct.statement* nocapture readnone %0) {
%2 = tail call %struct.statement* (...) @stmt_void()
ret %struct.statement* %2
}
int test_imm_84int64_highword_reg(long long val) {
  return ((val >> 32) & (0x84 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_84int64_highword_reg>:
movabs $0x8400000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84int64_highword_reg(i64 %0) {
%2 = and i64 %0, 566935683072
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float _d2f(int /*<<< orphan*/);
int /*<<< orphan*/ _dsub(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _f2d(int);
float _fsub(int a, int b) { return _d2f(_dsub(_f2d(a), _f2d(b))); }


x86 assembly (clang, -O0):
<_fsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <_f2d@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <_f2d@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <_dsub@plt>
mov    %eax,%edi
call   1030 <_d2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fsub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <_f2d@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <_f2d@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <_dsub@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_d2f@plt>

LLVM IR (-O0):
define float @_fsub(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 = call i32 @_f2d(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @_f2d(i32 %7)
%9 = call i32 @_dsub(i32 %6, i32 %8)
%10 = call float @_d2f(i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @_fsub(i32 %0, i32 %1) {
%3 = tail call i32 @_f2d(i32 %0)
%4 = tail call i32 @_f2d(i32 %1)
%5 = tail call i32 @_dsub(i32 %3, i32 %4)
%6 = tail call float @_d2f(i32 %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char buf[4];
  gets(buf);
  printf(buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcstombs(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                int /*<<< orphan*/);
size_t multibyte_len(const wchar_t wide[]) { return wcstombs(NULL, wide, 0); }


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

x86 assembly (clang, -O2):
<multibyte_len>:
mov    %rdi,%rsi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <wcstombs@plt>

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

LLVM IR (-O2):
define i64 @multibyte_len(i32* %0) {
%2 = tail call i64 @wcstombs(i32* null, i32* %0, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc7() {
  Assert_real((isprint(199) == 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_isprint.c",
              1000, ("isprint should be 0 for 0xc7"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc7\00"
define void @t_isprint_0xc7() {
%1 = call i64 @isprint(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc7\00"
define void @t_isprint_0xc7() {
%1 = tail call i64 @isprint(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_init();
int /*<<< orphan*/ eeprom_init();
int /*<<< orphan*/ leds_init();
int /*<<< orphan*/ scan_char();
void init_shell(void) {
  debug_init();
  leds_init();
  eeprom_init();
  scan_char();
}


x86 assembly (clang, -O0):
<init_shell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <debug_init@plt>
mov    $0x0,%al
call   1050 <leds_init@plt>
mov    $0x0,%al
call   1060 <eeprom_init@plt>
mov    $0x0,%al
call   1030 <scan_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_shell>:
push   %rax
xor    %eax,%eax
call   1040 <debug_init@plt>
xor    %eax,%eax
call   1050 <leds_init@plt>
xor    %eax,%eax
call   1060 <eeprom_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <scan_char@plt>

LLVM IR (-O0):
define void @init_shell() {
%1 = call i32 (...) @debug_init()
%2 = call i32 (...) @leds_init()
%3 = call i32 (...) @eeprom_init()
%4 = call i32 (...) @scan_char()
ret void
}

LLVM IR (-O2):
define void @init_shell() {
%1 = tail call i32 (...) @debug_init()
%2 = tail call i32 (...) @leds_init()
%3 = tail call i32 (...) @eeprom_init()
%4 = tail call i32 (...) @scan_char()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void stack_smash_test(void) {
  char buffer[15];
  memcpy(buffer, "Stack smash fucntion.\n", 22);
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<stack_smash_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xf(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x16,%edx
call   1040 <memcpy@plt>
lea    -0xf(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_smash_test>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x16,%edx
call   1040 <memcpy@plt>
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Stack smash fucntion.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @stack_smash_test() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @memcpy(i8* %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 22)
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Stack smash fucntion.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @stack_smash_test() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @memcpy(i8* %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 22)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sll_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sll_epi64(__m128i A, __m128i B) { return _mm_sll_epi64(A, B); }


x86 assembly (clang, -O0):
<test_mm_sll_epi64>:
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 <_mm_sll_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_sll_epi64>:
jmp    1030 <_mm_sll_epi64@plt>

LLVM IR (-O0):
define i32 @test_mm_sll_epi64(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 @_mm_sll_epi64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sll_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sll_epi64(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_mqtt_run();
int main(void) {
  iothub_client_sample_mqtt_run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_mqtt_run()
ret i32 0
}
/* Variables and functions */
float coscalc(unsigned int);
float ai(unsigned i) { return -0.5f * coscalc(i); }


x86 assembly (clang, -O0):
<ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <coscalc@plt>
movaps %xmm0,%xmm1
movss  0xed2(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai>:
push   %rax
call   1030 <coscalc@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ai(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call float @coscalc(i32 %3)
%5 = fmul float -5.000000e-01, %4
ret float %5
}

LLVM IR (-O2):
define float @ai(i32 %0) {
%2 = tail call float @coscalc(i32 %0)
%3 = fmul float %2, -5.000000e-01
ret float %3
}
int addNumbers(int firstNumber, int secondNumber) {
  return firstNumber + secondNumber;
}


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

x86 assembly (clang, -O2):
<addNumbers>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addNumbers(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addNumbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
char *o_filename(const char *filename) {
  char *o_fn = calloc(strlen(filename) + sizeof(".o"), sizeof(char));
  sprintf(o_fn, "%s.o", filename);
  return o_fn;
}


x86 assembly (clang, -O0):
<o_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
add    $0x3,%rax
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x3(%rax),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s.o\00"
define i8* @o_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = add i64 %6, 3
%8 = trunc i64 %7 to i32
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s.o\00"
define noalias i8* @o_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 3
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %4
}
/* Variables and functions */
unsigned int Get_DSP_CPUID();
unsigned int Get_Ethernet_DSP_ID(void) { return Get_DSP_CPUID(); }


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

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

LLVM IR (-O0):
define i32 @Get_Ethernet_DSP_ID() {
%1 = call i32 (...) @Get_DSP_CPUID()
ret i32 %1
}

LLVM IR (-O2):
define i32 @Get_Ethernet_DSP_ID() {
%1 = tail call i32 (...) @Get_DSP_CPUID()
ret i32 %1
}
int test_imm_E0uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xE0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E0uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14680064
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct atm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ date_time(struct atm *, struct atm *, int /*<<< orphan*/);
void date_midnight(struct atm *tm, struct atm *now, int *num) {
  date_time(tm, now, 0);
}


x86 assembly (clang, -O0):
<date_midnight>:
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    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <date_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.atm = type { i32 }
define void @date_midnight(%struct.atm* %0, %struct.atm* %1, i32* %2) {
%4 = alloca %struct.atm*
%5 = alloca %struct.atm*
%6 = alloca i32*
store %struct.atm* %0, %struct.atm** %4
store %struct.atm* %1, %struct.atm** %5
store i32* %2, i32** %6
%7 = load %struct.atm*, %struct.atm** %4
%8 = load %struct.atm*, %struct.atm** %5
%9 = call i32 @date_time(%struct.atm* %7, %struct.atm* %8, i32 0)
ret void
}

LLVM IR (-O2):
%struct.atm = type { i32 }
define void @date_midnight(%struct.atm* %0, %struct.atm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @date_time(%struct.atm* %0, %struct.atm* %1, i32 0)
ret void
}
void rs780_before_pci_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rs780_before_pci_init() {
ret void
}
/* Variables and functions */
int rand();
long int Rnd(int x) {
  return (((long)(rand() & 0x7fff) * (long)(x)) / (long)(0x8000));
}


x86 assembly (clang, -O0):
<Rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cltq
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    $0x8000,%ecx
cqto
idiv   %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
movslq %ebx,%rcx
imul   %rcx,%rax
lea    0x7fff(%rax),%rcx
test   %rax,%rax
cmovs  %rcx,%rax
sar    $0xf,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @Rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = and i32 %3, 32767
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %5, %7
%9 = sdiv i64 %8, 32768
ret i64 %9
}

LLVM IR (-O2):
define i64 @Rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 32767
%4 = zext i32 %3 to i64
%5 = sext i32 %0 to i64
%6 = mul nsw i64 %4, %5
%7 = sdiv i64 %6, 32768
ret i64 %7
}
/* Type definitions */
struct RNALalifold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
RNALalifold_cmdline_parser_release(struct RNALalifold_args_info *);
void RNALalifold_cmdline_parser_free(struct RNALalifold_args_info *args_info) {
  RNALalifold_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNALalifold_cmdline_parser_free>:
jmp    1030 <RNALalifold_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.RNALalifold_args_info = type { i32 }
define void @RNALalifold_cmdline_parser_free(%struct.RNALalifold_args_info* %0) {
%2 = alloca %struct.RNALalifold_args_info*
store %struct.RNALalifold_args_info* %0, %struct.RNALalifold_args_info** %2
%3 = load %struct.RNALalifold_args_info*, %struct.RNALalifold_args_info** %2
%4 = call i32 @RNALalifold_cmdline_parser_release(%struct.RNALalifold_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.RNALalifold_args_info = type { i32 }
define void @RNALalifold_cmdline_parser_free(%struct.RNALalifold_args_info* %0) {
%2 = tail call i32 @RNALalifold_cmdline_parser_release(%struct.RNALalifold_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __dealloc_free(void *cc, void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<__dealloc_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__dealloc_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}