xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nf_cmd(int);
int /*<<< orphan*/ nf_ncs0(int);
int /*<<< orphan*/ nf_wait_rb();
void nf_reset(void) {
  ;
  nf_ncs0(0);
  nf_cmd(0xFF);
  nf_wait_rb();
  nf_ncs0(1);
  ;
}


x86 assembly (clang, -O0):
<nf_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <nf_ncs0@plt>
mov    $0xff,%edi
call   1030 <nf_cmd@plt>
mov    $0x0,%al
call   1050 <nf_wait_rb@plt>
mov    $0x1,%edi
call   1040 <nf_ncs0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_reset>:
push   %rax
xor    %edi,%edi
call   1040 <nf_ncs0@plt>
mov    $0xff,%edi
call   1030 <nf_cmd@plt>
xor    %eax,%eax
call   1050 <nf_wait_rb@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <nf_ncs0@plt>

LLVM IR (-O0):
define void @nf_reset() {
%1 = call i32 @nf_ncs0(i32 0)
%2 = call i32 @nf_cmd(i32 255)
%3 = call i32 (...) @nf_wait_rb()
%4 = call i32 @nf_ncs0(i32 1)
ret void
}

LLVM IR (-O2):
define void @nf_reset() {
%1 = tail call i32 @nf_ncs0(i32 0)
%2 = tail call i32 @nf_cmd(i32 255)
%3 = tail call i32 (...) @nf_wait_rb()
%4 = tail call i32 @nf_ncs0(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mark(uintptr_t, int /*<<< orphan*/);
void pmm_free(void *pptr) { mark((uintptr_t)pptr, 0); }


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

x86 assembly (clang, -O2):
<pmm_free>:
xor    %esi,%esi
jmp    1030 <mark@plt>

LLVM IR (-O0):
define void @pmm_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @mark(i64 %4, i32 0)
ret void
}

LLVM IR (-O2):
define void @pmm_free(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @mark(i64 %2, i32 0)
ret void
}
float kg_to_lb(float value) { return value * 2.2046226218f; }


x86 assembly (clang, -O0):
<kg_to_lb>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kg_to_lb>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @kg_to_lb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x4001A31120000000
ret float %4
}

LLVM IR (-O2):
define float @kg_to_lb(float %0) {
%2 = fmul float %0, 0x4001A31120000000
ret float %2
}
void mystrncpy(char *s, char *t, int n) {
  while (n > 0) {
    if (*t == '\0')
      return;
    *s++ = *t++;
    n--;
  }
  *s = '\0';
  return;
}


x86 assembly (clang, -O0):
<mystrncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115e <mystrncpy+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112e <mystrncpy+0x2e>
jmp    1165 <mystrncpy+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <mystrncpy+0xf>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrncpy>:
test   %edx,%edx
jle    1129 <mystrncpy+0x29>
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%eax
test   %al,%al
je     112c <mystrncpy+0x2c>
add    $0x1,%rsi
mov    %al,(%rdi)
add    $0x1,%rdi
add    $0xffffffff,%edx
cmp    $0x1,%edx
jg     1110 <mystrncpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mystrncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %11
%6 = phi i32 [ %14, %11 ], [ %2, %3 ]
%7 = phi i8* [ %12, %11 ], [ %1, %3 ]
%8 = phi i8* [ %13, %11 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %8
%14 = add nsw i32 %6, -1
%15 = icmp sgt i32 %6, 1
br i1 %15, label %5, label %16
16: ; preds = %11, %3
%17 = phi i8* [ %0, %3 ], [ %13, %11 ]
store i8 0, i8* %17
br label %18
18: ; preds = %5, %16
ret void
}
int sp_dim_get(int var_num) {
  return ((2 * var_num) + 1) * ((var_num + 2) / 3) + (6 * var_num) + 2;
}


x86 assembly (clang, -O0):
<sp_dim_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
imul   $0x6,-0x4(%rbp),%ecx
add    %ecx,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_dim_get>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
lea    (%rdi,%rdi,2),%ecx
mov    %edi,%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x55555556,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
add    %esi,%edx
imul   %eax,%edx
lea    (%rdx,%rcx,2),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @sp_dim_get(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
%4 = add nsw i32 %0, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %3, %5
%7 = mul nsw i32 %0, 6
%8 = add i32 %7, 2
%9 = add i32 %8, %6
ret i32 %9
}
/* Type definitions */
struct tm {
  int tm_hour;
};

/* Variables and functions */
char *out_dec(char *, char *, int, int, int /*<<< orphan*/);
char *out_hour_12H(char *buf, char *end, const struct tm *t) {
  int hour = t->tm_hour % 12;
  return out_dec(buf, end, 2, hour ? hour : 12, '0');
}


x86 assembly (clang, -O0):
<out_hour_12H>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     115a <out_hour_12H+0x4a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1167 <out_hour_12H+0x57>
mov    $0xc,%eax
mov    %eax,-0x34(%rbp)
jmp    1167 <out_hour_12H+0x57>
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%ecx
mov    $0x2,%edx
mov    $0x30,%r8d
call   1030 <out_dec@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_hour_12H>:
movslq (%rdx),%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    $0xc,%ecx
cmovne %eax,%ecx
mov    $0x2,%edx
mov    $0x30,%r8d
jmp    1030 <out_dec@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @out_hour_12H(i8* %0, i8* %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.tm*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.tm* %2, %struct.tm** %6
%8 = load %struct.tm*, %struct.tm** %6
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = srem i32 %10, 12
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i32, i32* %7
br label %19
18: ; preds = %3
br label %19
19: ; preds = %18, %16
%20 = phi i32 [ %17, %16 ], [ 12, %18 ]
%21 = call i8* @out_dec(i8* %12, i8* %13, i32 2, i32 %20, i32 48)
ret i8* %21
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @out_hour_12H(i8* %0, i8* %1, %struct.tm* nocapture %2) {
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 12
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 12, i32 %6
%9 = tail call i8* @out_dec(i8* %0, i8* %1, i32 2, i32 %8, i32 48)
ret i8* %9
}
void setval_318(unsigned *p) { *p = 3284633944U; }


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

x86 assembly (clang, -O2):
<setval_318>:
movl   $0xc3c78958,(%rdi)
ret

LLVM IR (-O0):
define void @setval_318(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 -1010333352, i32* %3
ret void
}

LLVM IR (-O2):
define void @setval_318(i32* nocapture writeonly %0) {
store i32 -1010333352, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int /*<<< orphan*/ emsFacer(char *, int);
void ems_facer_(char *const token, int *const fstat, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsFacer(ctok, *fstat);
  return;
}


x86 assembly (clang, -O0):
<ems_facer_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0xf,%edx
call   1030 <cnfImpn@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <emsFacer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_facer_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   1030 <cnfImpn@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1040 <emsFacer@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ems_facer_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = call i32 @cnfImpn(i8* %8, i32 %9, i32 15, i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @emsFacer(i8* %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @ems_facer_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @cnfImpn(i8* %0, i32 %2, i32 15, i8* %5)
%7 = load i32, i32* %1
%8 = call i32 @emsFacer(i8* %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void swapp(int *x, int *y) {
  int temp;
  printf("Inside pointer based swap Function\n");
  temp = *y;
  *y = *x;
  *x = temp;
  printf("Exiting pointer based swap Function x = %d, y = %d\n", *x, *y);
}


x86 assembly (clang, -O0):
<swapp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
mov    (%r14),%eax
mov    %eax,(%rbx)
mov    %esi,(%r14)
mov    (%rbx),%edx
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Inside pointer based swap Function\0A\00"
@.str.1 = [52 x i8] c"Exiting pointer based swap Function x = %d, y = %d\0A\00"
define void @swapp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
store i32 %12, i32* %13
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17)
ret void
}

LLVM IR (-O2):
@.str.1 = [52 x i8] c"Exiting pointer based swap Function x = %d, y = %d\0A\00"
@str = [35 x i8] c"Inside pointer based swap Function\00"
define void @swapp(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = load i32, i32* %0
store i32 %5, i32* %1
store i32 %4, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret void
}
int test_imm_7Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x7C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 124
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_6821() {
  Assert_real((isqrt(6821) == 82),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1415, ("Integer square root of 6821 should be 82"));
}


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

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

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

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 6821 should be 82\00"
define void @t_sqrt_6821() {
%1 = tail call i32 @isqrt(i32 6821)
%2 = icmp eq i32 %1, 82
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1415, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) time_t softboundmpx_time(time_t *t) {
  return time(t);
}


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

x86 assembly (clang, -O2):
<softboundmpx_time>:
jmp    1030 <time@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_time(i32* %0) {
%2 = tail call i32 @time(i32* %0)
ret i32 %2
}
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpa_supplicant_dbus_notify_scan_results(%struct.wpa_supplicant* nocapture %0) {
ret void
}
/* Variables and functions */
char *calloc(int, size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *copy_init_n(char *str, size_t len) {
  char *ret;
  ret = calloc(1, len);
  ret[0] = '\0';
  strncpy(ret, str, len);
  return ret;
}


x86 assembly (clang, -O0):
<copy_init_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_init_n>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copy_init_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @calloc(i32 1, i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @copy_init_n(i8* %0, i64 %1) {
%3 = tail call i8* @calloc(i32 1, i64 %1)
store i8 0, i8* %3
%4 = tail call i32 @strncpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test(int, int /*<<< orphan*/);
int main(void) {
  test(1, 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 1, i32 0)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1, i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  if (*(int *)test != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
            *(int *)test);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2efa(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cmp    %ecx,%eax
je     117d <traps+0x4d>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    0x2ed1(%rip),%edx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    1144 <traps+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x464e4f43,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = load i32, i32* bitcast ([5 x i8]* @traps.test to i32*)
%2 = call i32 @ntohl(i32 1129270854)
%3 = icmp ne i32 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = load i32, i32* bitcast ([5 x i8]* @traps.test to i32*)
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 2)
unreachable
9: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1179537219)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
double log(double);
double e(double x) { return x * x * log(x); }


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

x86 assembly (clang, -O2):
<e>:
push   %rax
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @e(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = call double @log(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @e(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @log(double %0)
%4 = fmul double %2, %3
ret double %4
}
void radio_leave_powersave(void) {}


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

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

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

LLVM IR (-O2):
define void @radio_leave_powersave() {
ret void
}
int get_sockid(int shmid) { return shmid / 0x10000; }


x86 assembly (clang, -O0):
<get_sockid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sockid>:
lea    0xffff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @get_sockid(i32 %0) {
%2 = sdiv i32 %0, 65536
ret i32 %2
}
/* Variables and functions */
int Bank_Transfer(int, int, int, char const *);
int /*<<< orphan*/ _CanTransfer(int, int, int);
int _Transfer(int Source, int Destination, int Ammount, const char *Reason) {
  if (!_CanTransfer(Source, Destination, Ammount))
    return 1;
  return Bank_Transfer(Source, Destination, Ammount, Reason);
}


x86 assembly (clang, -O0):
<_Transfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <_CanTransfer@plt>
cmp    $0x0,%eax
jne    1158 <_Transfer+0x38>
movl   $0x1,-0x4(%rbp)
jmp    116d <_Transfer+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <Bank_Transfer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Transfer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_CanTransfer@plt>
test   %eax,%eax
je     1153 <_Transfer+0x33>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <Bank_Transfer@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_Transfer(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @_CanTransfer(i32 %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @Bank_Transfer(i32 %0, i32 %1, i32 %2, i8* %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ raiseerror(char *);
void *xmalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (p == NULL)
    raiseerror("malloc returned NULL");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <raiseerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <raiseerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"malloc returned NULL\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @raiseerror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"malloc returned NULL\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @raiseerror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
bool zmul_is_oor(size_t a, size_t b) { return (a * b < a); }


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

x86 assembly (clang, -O2):
<zmul_is_oor>:
imul   %rdi,%rsi
xor    %eax,%eax
cmp    %rdi,%rsi
setb   %al
ret

LLVM IR (-O0):
define i32 @zmul_is_oor(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = load i64, i64* %3
%9 = icmp ult i64 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @zmul_is_oor(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = icmp ult i64 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void network_init() {}


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

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

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

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

/* Variables and functions */
int EVP_CIPHER_CTX_cleanup(int /*<<< orphan*/ *);
int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) {
  return EVP_CIPHER_CTX_cleanup(ctx);
}


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

x86 assembly (clang, -O2):
<EVP_CIPHER_CTX_reset>:
jmp    1030 <EVP_CIPHER_CTX_cleanup@plt>

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

LLVM IR (-O2):
define i32 @EVP_CIPHER_CTX_reset(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_CTX_cleanup(i32* %0)
ret i32 %2
}
double summation_electric_field(double q, double radius) {
  return (q) / (radius * radius);
}


x86 assembly (clang, -O0):
<summation_electric_field>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<summation_electric_field>:
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @summation_electric_field(double %0, double %1) {
%3 = fmul double %1, %1
%4 = fdiv double %0, %3
ret double %4
}
unsigned long SystemVMA() {
  unsigned long vma = (unsigned long)__builtin_frame_address(0);
  return 64 - __builtin_clzll(vma);
}


x86 assembly (clang, -O0):
<SystemVMA>:
push   %rbp
mov    %rsp,%rbp
mov    %rbp,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
mov    %eax,%ecx
mov    $0x40,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemVMA>:
push   %rbp
mov    %rsp,%rbp
bsr    %rbp,%rax
xor    $0xffffffffffffffc0,%rax
add    $0x41,%rax
pop    %rbp
ret

LLVM IR (-O0):
define i64 @SystemVMA() {
%1 = alloca i64
%2 = call i8* @llvm.frameaddress.p0i8(i32 0)
%3 = ptrtoint i8* %2 to i64
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = call i64 @llvm.ctlz.i64(i64 %4, i1 true)
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 64, %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @SystemVMA() {
%1 = tail call i8* @llvm.frameaddress.p0i8(i32 0)
%2 = ptrtoint i8* %1 to i64
%3 = tail call i64 @llvm.ctlz.i64(i64 %2, i1 true)
%4 = sub nuw nsw i64 64, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void main() {
  char string[100];
  int c = 0;
  int i = 0;
  int j = 0;
  int sum = 0;
  int len = 0;
  char first[100];
  char second[200];
  i = 1;
  j = 2;
  sum = i | j;
  printf("i = %d; j = %d;\ni & j = %d; i | j = %d;\n", i, j, i & j, i | j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x1,-0x78(%rbp)
movl   $0x2,-0x7c(%rbp)
mov    -0x78(%rbp),%eax
or     -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x78(%rbp),%esi
mov    -0x7c(%rbp),%edx
mov    -0x78(%rbp),%ecx
and    -0x7c(%rbp),%ecx
mov    -0x78(%rbp),%r8d
or     -0x7c(%rbp),%r8d
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"i = %d; j = %d;\0Ai & j = %d; i | j = %d;\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca [200 x i8]
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 1, i32* %3
store i32 2, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = or i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = and i32 %14, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = or i32 %17, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %16, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"i = %d; j = %d;\0Ai & j = %d; i | j = %d;\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mm(int);
int main() {
  int i;
  for (i = 0; i < 10; i++)
    Mm(i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <Mm@plt>
mov    $0x1,%edi
call   1030 <Mm@plt>
mov    $0x2,%edi
call   1030 <Mm@plt>
mov    $0x3,%edi
call   1030 <Mm@plt>
mov    $0x4,%edi
call   1030 <Mm@plt>
mov    $0x5,%edi
call   1030 <Mm@plt>
mov    $0x6,%edi
call   1030 <Mm@plt>
mov    $0x7,%edi
call   1030 <Mm@plt>
mov    $0x8,%edi
call   1030 <Mm@plt>
mov    $0x9,%edi
call   1030 <Mm@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Mm(i32 0)
%2 = tail call i32 @Mm(i32 1)
%3 = tail call i32 @Mm(i32 2)
%4 = tail call i32 @Mm(i32 3)
%5 = tail call i32 @Mm(i32 4)
%6 = tail call i32 @Mm(i32 5)
%7 = tail call i32 @Mm(i32 6)
%8 = tail call i32 @Mm(i32 7)
%9 = tail call i32 @Mm(i32 8)
%10 = tail call i32 @Mm(i32 9)
ret i32 0
}
double Abs(double x) {
  if (x < 0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <Abs+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @Abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
double soundio_double_max(double a, double b) { return (a >= b) ? a : b; }


x86 assembly (clang, -O0):
<soundio_double_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112d <soundio_double_max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <soundio_double_max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundio_double_max>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @soundio_double_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @soundio_double_max(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ datestr_version();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ prtdVersion();
int /*<<< orphan*/ prtfVersion();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setargv_version();
int /*<<< orphan*/ valstr_version();
void rifuVersion() {
  puts("@"
       "(#)"
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/rifu.c"
       " "
       "Sat Jan 22 08:19:10 2022"
       " compiled: "
       "Mar 15 2022"
       " "
       "22:26:31");
  datestr_version();
  valstr_version();
  prtdVersion();
  prtfVersion();
  setargv_version();
  exit(0);
}


x86 assembly (clang, -O0):
<rifuVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1060 <datestr_version@plt>
mov    $0x0,%al
call   1070 <valstr_version@plt>
mov    $0x0,%al
call   1080 <prtdVersion@plt>
mov    $0x0,%al
call   1030 <prtfVersion@plt>
mov    $0x0,%al
call   1050 <setargv_version@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<rifuVersion>:
push   %rax
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <datestr_version@plt>
xor    %eax,%eax
call   1070 <valstr_version@plt>
xor    %eax,%eax
call   1080 <prtdVersion@plt>
xor    %eax,%eax
call   1030 <prtfVersion@plt>
xor    %eax,%eax
call   1050 <setargv_version@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [193 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/rifu.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:26:31\00"
define void @rifuVersion() {
%1 = call i32 @puts(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @datestr_version()
%3 = call i32 (...) @valstr_version()
%4 = call i32 (...) @prtdVersion()
%5 = call i32 (...) @prtfVersion()
%6 = call i32 (...) @setargv_version()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [193 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/rifu.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:26:31\00"
define void @rifuVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @datestr_version()
%3 = tail call i32 (...) @valstr_version()
%4 = tail call i32 (...) @prtdVersion()
%5 = tail call i32 (...) @prtfVersion()
%6 = tail call i32 (...) @setargv_version()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int _put_line(int, char *, int /*<<< orphan*/);
int fd_put_line(int fd, char *line) { return _put_line(fd, line, 0); }


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

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

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

LLVM IR (-O2):
define i32 @fd_put_line(i32 %0, i8* %1) {
%3 = tail call i32 @_put_line(i32 %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_baz(void) { assert(0); }


x86 assembly (clang, -O0):
<test_baz>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_baz>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_baz() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_baz() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int list_comparator_int64_t(const void *a, const void *b) {
  return (*(int64_t *)a < *(int64_t *)b) - (*(int64_t *)a > *(int64_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_int64_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_int64_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_int64_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
adrreg0reg1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[10000000]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl 0x989680(%rax),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     1141 <adrreg0reg1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <adrreg0reg1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1>:
movsbl 0x989680(%r8),%ecx
movsbl %sil,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = shl i32 %1, 24
%11 = ashr exact i32 %10, 24
%12 = icmp sge i32 %11, %9
%13 = zext i1 %12 to i32
ret i32 %13
}
void dl_G_RDPLOADSYNC() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_RDPLOADSYNC() {
ret void
}
void f1(char *p) { __builtin_memcpy(p, "12345", 5); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xeee(%rip),%ecx
mov    %ecx,(%rax)
mov    0xeea(%rip),%cl
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movb   $0x35,0x4(%rdi)
movl   $0x34333231,(%rdi)
ret

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
define void @f1(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}