xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_182() {
  Assert_real((isqrt(182) == 13),
              "/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",
              915, ("Integer square root of 182 should be 13"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_182>:
push   %rax
mov    $0xb6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x393,%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 = [40 x i8] c"Integer square root of 182 should be 13\00"
define void @t_sqrt_182() {
%1 = call i32 @isqrt(i32 182)
%2 = icmp eq i32 %1, 13
%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 915, i8* getelementptr inbounds ([40 x i8], [40 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 = [40 x i8] c"Integer square root of 182 should be 13\00"
define void @t_sqrt_182() {
%1 = tail call i32 @isqrt(i32 182)
%2 = icmp eq i32 %1, 13
%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 915, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ ext();
void foo() {
  bar();
  ext();
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @bar()
%2 = call i32 (...) @ext()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @ext()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_exit(char *);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *mem = malloc(size);
  if (!mem)
    error_exit("Out of memory!\n");
  return mem;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error_exit(i8* getelementptr inbounds ([16 x i8], [16 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 = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
size_t digit_count(long n) {
  size_t i;
  i = 1;
  if (n < 0)
    n = -n;
  while (n >= 10) {
    i++;
    n /= 10;
  }
  return (i);
}


x86 assembly (clang, -O0):
<digit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1125 <digit_count+0x25>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <digit_count+0x2a>
cmpq   $0xa,-0x8(%rbp)
jl     1158 <digit_count+0x58>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    112a <digit_count+0x2a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_count>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
mov    $0x1,%esi
cmp    $0xa,%rcx
jb     1147 <digit_count+0x47>
mov    $0x1,%esi
movabs $0xcccccccccccccccd,%rdi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rsi
mov    %rcx,%rax
mul    %rdi
shr    $0x3,%rdx
cmp    $0x63,%rcx
mov    %rdx,%rcx
ja     1130 <digit_count+0x30>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @digit_count(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub nsw i64 0, %7
store i64 %8, i64* %2
br label %9
9: ; preds = %6, %1
br label %10
10: ; preds = %13, %9
%11 = load i64, i64* %2
%12 = icmp sge i64 %11, 10
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i64, i64* %3
%15 = add i64 %14, 1
store i64 %15, i64* %3
%16 = load i64, i64* %2
%17 = sdiv i64 %16, 10
store i64 %17, i64* %2
br label %10
18: ; preds = %10
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @digit_count(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%3 = icmp ugt i64 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 1, %1 ]
%6 = phi i64 [ %8, %4 ], [ %2, %1 ]
%7 = add i64 %5, 1
%8 = udiv i64 %6, 10
%9 = icmp ugt i64 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i64 [ 1, %1 ], [ %7, %4 ]
ret i64 %11
}
int main() {
  int a, b, sum;
  scanf("%d %d", &a, &b);
  sum = a + b;
  printf(sum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
movslq (%rsp),%rdi
add    %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %10)
ret i32 0
}
void quaternion_set(float out[4], float x, float y, float z, float w) {
  out[0] = x;
  out[1] = y;
  out[2] = z;
  out[3] = w;
}


x86 assembly (clang, -O0):
<quaternion_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaternion_set>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
movss  %xmm3,0xc(%rdi)
ret

LLVM IR (-O0):
define void @quaternion_set(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %8
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %9
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %10
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @quaternion_set(float* nocapture writeonly %0, float %1, float %2, float %3, float %4) {
store float %1, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret void
}
int getFather(int idx) { return idx / 2; }


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

x86 assembly (clang, -O2):
<getFather>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @getFather(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
void fc229(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
  a : {
    typedef int(*g)[n];
    0;
  };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    goto a;
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc229>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc229+0x7>

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

LLVM IR (-O0):
define void @fc229(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %13, %1
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %13
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc229(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_16hi8(int /*<<< orphan*/);
int /*<<< orphan*/ endian_16lo8(int /*<<< orphan*/);
void endian_little16(uint8_t ptr[2], uint_least16_t word) {
  ptr[0] = endian_16lo8(word);
  ptr[1] = endian_16hi8(word);
}


x86 assembly (clang, -O0):
<endian_little16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <endian_16lo8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
call   1040 <endian_16hi8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_little16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <endian_16lo8@plt>
mov    %eax,(%r14)
mov    %ebx,%edi
call   1040 <endian_16hi8@plt>
mov    %eax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @endian_little16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @endian_16lo8(i32 %1)
store i32 %3, i32* %0
%4 = tail call i32 @endian_16hi8(i32 %1)
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
void do_something_exit(void) { pr_alert("%s\n", __func__); }


x86 assembly (clang, -O0):
<do_something_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_alert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something_exit>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
jmp    1030 <pr_alert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.do_something_exit = [18 x i8] c"do_something_exit\00"
define void @do_something_exit() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_exit, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@__func__.do_something_exit = [18 x i8] c"do_something_exit\00"
define void @do_something_exit() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_exit, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void copia(char *dest, char *orig) { strcpy(dest, orig); }


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

x86 assembly (clang, -O2):
<copia>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @copia(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 = load i8*, i8** %4
%7 = call i32 @strcpy(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @copia(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_32(void) {
  if ((((*(uint32_t *)0xF0000FE0) & 0x000000FF) == 0x6) &&
      (((*(uint32_t *)0xF0000FE4) & 0x0000000F) == 0x0)) {
    if (((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x30) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_32>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0000fe0,%eax
mov    (%rax),%eax
and    $0xff,%eax
cmp    $0x6,%eax
jne    1152 <errata_32+0x52>
mov    $0xf0000fe4,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1152 <errata_32+0x52>
mov    $0xf0000fe8,%eax
mov    (%rax),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    114d <errata_32+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <errata_32+0x59>
jmp    1152 <errata_32+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_32>:
mov    $0xf0000fe0,%eax
cmpb   $0x6,(%rax)
jne    1122 <errata_32+0x22>
testb  $0xf,0x4(%rax)
jne    1122 <errata_32+0x22>
mov    $0xf0,%ecx
and    0x8(%rax),%ecx
mov    $0x1,%eax
cmp    $0x30,%ecx
je     1124 <errata_32+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_32() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%3 = and i32 %2, 255
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%7 = and i32 %6, 15
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%11 = and i32 %10, 240
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %16
14: ; preds = %9
br label %15
15: ; preds = %14, %5, %0
store i32 0, i32* %1
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @errata_32() {
%1 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %12
4: ; preds = %0
%5 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%6 = and i32 %5, 15
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%10 = and i32 %9, 240
%11 = icmp eq i32 %10, 48
br i1 %11, label %13, label %12
12: ; preds = %8, %4, %0
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int /*<<< orphan*/, int);
void ExitShift() {
  send_cmd(0, 1);
  send_cmd(0, 0);
}


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

x86 assembly (clang, -O2):
<ExitShift>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <send_cmd@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <send_cmd@plt>

LLVM IR (-O0):
define void @ExitShift() {
%1 = call i32 @send_cmd(i32 0, i32 1)
%2 = call i32 @send_cmd(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @ExitShift() {
%1 = tail call i32 @send_cmd(i32 0, i32 1)
%2 = tail call i32 @send_cmd(i32 0, i32 0)
ret void
}
int test_imm_86uint16_reg(unsigned short val) {
  return ((val) & (0x86 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_86uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 134
%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_86uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 134
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int FtoC(int F) { return (5.0 / 9.0) * (F - 32.0); }


x86 assembly (clang, -O0):
<FtoC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FtoC>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @FtoC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @FtoC(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void f(void *val) { printf("%s ", (char *)(val)); }


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @f(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
f() { return (unsigned char)("\377"[0]); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movzbl 0xef5(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"\FF\00"
define i32 @f() {
%1 = load i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%2 = zext i8 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @f() {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("the cake is a lie\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"the cake is a lie\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"the cake is a lie\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1e() {
  Assert_real((isxdigit(30) == 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_isxdigit.c",
              155, ("isxdigit should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x9b,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1e\00"
define void @t_isxdigit_0x1e() {
%1 = call i64 @isxdigit(i32 30)
%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 155, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1e\00"
define void @t_isxdigit_0x1e() {
%1 = tail call i64 @isxdigit(i32 30)
%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 155, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int qsort_compare(const void *a, const void *b) {
  const char **str1 = (const char **)a;
  const char **str2 = (const char **)b;
  if (*str1 == NULL) {
    return 1;
  }
  if (*str2 == NULL) {
    return -1;
  }
  return strcmp(*str1, *str2);
}


x86 assembly (clang, -O0):
<qsort_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114a <qsort_compare+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    117a <qsort_compare+0x6a>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1164 <qsort_compare+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <qsort_compare+0x6a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_compare>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1125 <qsort_compare+0x15>
mov    (%rsi),%rsi
test   %rsi,%rsi
je     112b <qsort_compare+0x1b>
jmp    1030 <strcmp@plt>
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @qsort_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i8**
store i8** %11, i8*** %7
%12 = load i8**, i8*** %6
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %27
16: ; preds = %2
%17 = load i8**, i8*** %7
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 -1, i32* %3
br label %27
21: ; preds = %16
%22 = load i8**, i8*** %6
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %7
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %23, i8* %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %21, %20, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @qsort_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = bitcast i8* %1 to i8**
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @strcmp(i8* %4, i8* %8)
br label %12
12: ; preds = %6, %2, %10
%13 = phi i32 [ %11, %10 ], [ 1, %2 ], [ -1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ hex2int(char *, int /*<<< orphan*/);
int /*<<< orphan*/ l_askNbytes(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                               int);
char *long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ s_len(char *);
char *macwhichPID(char *arg) {
  l_askNbytes(get_string(arg), "5f", 0, -1);
  return long2str(arg, hex2int(arg, s_len(arg)));
}


x86 assembly (clang, -O0):
<macwhichPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_string@plt>
mov    %eax,%edi
lea    0xe92(%rip),%rsi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <l_askNbytes@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <s_len@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <hex2int@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1070 <long2str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macwhichPID>:
push   %rbx
mov    %rdi,%rbx
call   1050 <get_string@plt>
lea    0xea0(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <l_askNbytes@plt>
mov    %rbx,%rdi
call   1040 <s_len@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <hex2int@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1070 <long2str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"5f\00"
define i8* @macwhichPID(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_string(i8* %3)
%5 = call i32 @l_askNbytes(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1)
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @s_len(i8* %8)
%10 = call i32 @hex2int(i8* %7, i32 %9)
%11 = call i8* @long2str(i8* %6, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"5f\00"
define i8* @macwhichPID(i8* %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i32 @l_askNbytes(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1)
%4 = tail call i32 @s_len(i8* %0)
%5 = tail call i32 @hex2int(i8* %0, i32 %4)
%6 = tail call i8* @long2str(i8* %0, i32 %5)
ret i8* %6
}
/* Variables and functions */
scalar_t__ CompareResult(char *, char *);
int /*<<< orphan*/ exit(int);
int main(int argc, char *argv[]) {
  if (CompareResult(argv[1], argv[2]) != 0)
    exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <CompareResult@plt>
cmp    $0x0,%rax
je     115f <main+0x3f>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <CompareResult@plt>
test   %rax,%rax
jne    1137 <main+0x17>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i64 @CompareResult(i8* %4, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i32 0
}
/* Type definitions */
struct libipc_conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ conn_free(struct libipc_conn *);
int libipc_close(struct libipc_conn *conn) {
  if (!conn) {
    return -1;
  }
  conn_free(conn);
  return 0;
}


x86 assembly (clang, -O0):
<libipc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <libipc_close+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <libipc_close+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <conn_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libipc_close>:
test   %rdi,%rdi
je     1122 <libipc_close+0x12>
push   %rax
call   1030 <conn_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.libipc_conn = type { i32 }
define i32 @libipc_close(%struct.libipc_conn* %0) {
%2 = icmp eq %struct.libipc_conn* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @conn_free(%struct.libipc_conn* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
float *Float_array(int size) {
  return ((float *)malloc((unsigned)(size * sizeof(float))));
}


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

x86 assembly (clang, -O2):
<Float_array>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define float* @Float_array(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to float*
ret float* %4
}
void clean_app() {}


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

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

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

LLVM IR (-O2):
define void @clean_app() {
ret void
}
int do_569() { return 569; }


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

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

LLVM IR (-O0):
define i32 @do_569() {
ret i32 569
}

LLVM IR (-O2):
define i32 @do_569() {
ret i32 569
}
int read_int32(const char *buffer) {
  unsigned char *point = (unsigned char *)buffer;
  return (point[0] << 24) | (point[1] << 16) | (point[2] << 8) |
         (point[3] << 0);
}


x86 assembly (clang, -O0):
<read_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int32>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @read_int32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void *ssSpectralSpeedCalc() {}


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

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

LLVM IR (-O0):
define i8* @ssSpectralSpeedCalc() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @ssSpectralSpeedCalc() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  printf("%u\n", sizeof(int));
  printf("%u\n", sizeof(short));
  int integer1 = 61680;
  int integer2 = 3855;
  short short_integer1 = 1;
  short short_integer2 = 2;
  printf("%hd %hd %hd %hd\n", integer1, integer2, short_integer1,
         short_integer2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xf0f0,-0x8(%rbp)
movl   $0xf0f,-0xc(%rbp)
movw   $0x1,-0xe(%rbp)
movw   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movswl -0xe(%rbp),%ecx
movswl -0x10(%rbp),%r8d
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0xf0f0,%esi
mov    $0xf0f,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [17 x i8] c"%hd %hd %hd %hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i32 0, i32* %1
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 61680, i32* %2
store i32 3855, i32* %3
store i16 1, i16* %4
store i16 2, i16* %5
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [17 x i8] c"%hd %hd %hd %hd\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 61680, i32 3855, i32 1, i32 2)
ret i32 0
}
printstatistics() {}


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

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

LLVM IR (-O0):
define i32 @printstatistics() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @printstatistics() {
ret i32 undef
}
void possessive2ONEMORE() {}


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

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

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

LLVM IR (-O2):
define void @possessive2ONEMORE() {
ret void
}
/* Variables and functions */
long random();
int dgx_rnd_range(int min, int max) {
  return min + (int)(random() % (long)(max - min));
}


x86 assembly (clang, -O0):
<dgx_rnd_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
movslq %ecx,%rcx
cqto
idiv   %rcx
mov    -0xc(%rbp),%eax
mov    %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgx_rnd_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
sub    %ebx,%ebp
movslq %ebp,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1139 <dgx_rnd_range+0x29>
cqto
idiv   %rcx
mov    %rdx,%rax
jmp    113f <dgx_rnd_range+0x2f>
xor    %edx,%edx
div    %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dgx_rnd_range(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 i64 (...) @random()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sext i32 %9 to i64
%11 = srem i64 %6, %10
%12 = trunc i64 %11 to i32
%13 = add nsw i32 %5, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @dgx_rnd_range(i32 %0, i32 %1) {
%3 = tail call i64 (...) @random()
%4 = sub nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = srem i64 %3, %5
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
int normalize(int number) {
  if (number < 0)
    return number *= -1;
  else
    return number;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <normalize+0x20>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1126 <normalize+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @normalize(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int eval_from_tt(const int eval, const int ply) {
  if (eval > 1000000 - 128) {
    return eval - ply;
  }
  if (eval < -1000000 + 128) {
    return eval + ply;
  }
  return eval;
}


x86 assembly (clang, -O0):
<eval_from_tt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf41c0,-0x8(%rbp)
jle    1125 <eval_from_tt+0x25>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <eval_from_tt+0x46>
cmpl   $0xfff0be40,-0x8(%rbp)
jge    1140 <eval_from_tt+0x40>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <eval_from_tt+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_from_tt>:
xor    %eax,%eax
cmp    $0xfff0be40,%edi
cmovl  %esi,%eax
neg    %esi
cmp    $0xf41c1,%edi
cmovge %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @eval_from_tt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 999872
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %3
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, -999872
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %21
19: ; preds = %12
%20 = load i32, i32* %4
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %15, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @eval_from_tt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 999872
%4 = icmp slt i32 %0, -999872
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %1
%7 = select i1 %3, i32 %6, i32 %5
%8 = add i32 %7, %0
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(int *);
void free_with_check(void *mem) {
  uint32_t *buf = (uint32_t *)mem - 2;
  assert(buf[1] == 0xDEADBEEF);
  assert(buf[buf[0] - 1] == 0xBADBAD);
  free(buf);
}


x86 assembly (clang, -O0):
<free_with_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xdeadbeef,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0xbadbad,(%rax,%rcx,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_with_check>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x8(%rdi),%r14
xor    %edi,%edi
cmpl   $0xdeadbeef,-0x4(%rbx)
sete   %dil
call   1040 <assert@plt>
movslq -0x8(%rbx),%rax
xor    %edi,%edi
cmpl   $0xbadbad,-0xc(%rbx,%rax,4)
sete   %dil
call   1040 <assert@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_with_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -2
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, -559038737
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %3
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %13, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 12245933
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i32*, i32** %3
%25 = call i32 @free(i32* %24)
ret void
}

LLVM IR (-O2):
define void @free_with_check(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -559038737
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %3, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 12245933
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @free(i32* %3)
ret void
}