xunge/DecIR huggingface dataset:
/* Variables and functions */
int f1(int *, int *);
int f_p(int (*)(int *, int *), int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  int b = 13;
  int rez = f1(&a, &b);
  printf("after f1 rez = %d;\n", rez);
  rez = f_p(f1, &a, &b);
  printf("after f2 rez = %d;\n", rez);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xd,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <f1@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e85(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <f_p@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
movl   $0xd,0x8(%rsp)
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <f1@plt>
mov    0x2e93(%rip),%r15
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <f_p@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"after f1 rez = %d;\0A\00"
@.str.1 = [20 x i8] c"after f2 rez = %d;\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 13, i32* %3
%5 = call i32 @f1(i32* %2, i32* %3)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @f_p(i32 (i32*, i32*)* @f1, i32* %2, i32* %3)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"after f1 rez = %d;\0A\00"
@.str.1 = [20 x i8] c"after f2 rez = %d;\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 13, i32* %2
%5 = call i32 @f1(i32* %1, i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @f_p(i32 (i32*, i32*)* @f1, i32* %1, i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x97() {
  Assert_real((islower(151) == 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_islower.c",
              760, ("islower should be 0 for 0x97"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x97\00"
define void @t_islower_0x97() {
%1 = tail call i64 @islower(i32 151)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 760, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test26(__m64 a, __m64 b) { return _mm_avg_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test26>:
jmp    1030 <_mm_avg_pu8@plt>

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

LLVM IR (-O2):
define i32 @test26(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_pu8(i32 %0, i32 %1)
ret i32 %3
}
int test_imm_5Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x5F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 408021893120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned short CP4RGBA_0(unsigned short BGR) {
  unsigned short s;
  if (!BGR)
    return 6;
  s = (((((BGR & 0x1e) << 11)) | ((BGR & 0x7800) >> 7) |
        ((BGR & 0x3c0) << 2))) |
      0xf;
  if (s == 0x0fff)
    s = 0x000f;
  return s;
}


x86 assembly (clang, -O0):
<CP4RGBA_0>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
cmpw   $0x0,-0x4(%rbp)
jne    1121 <CP4RGBA_0+0x21>
movw   $0x6,-0x2(%rbp)
jmp    116d <CP4RGBA_0+0x6d>
movzwl -0x4(%rbp),%eax
and    $0x1e,%eax
shl    $0xb,%eax
movzwl -0x4(%rbp),%ecx
and    $0x7800,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
and    $0x3c0,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
or     $0xf,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0xfff,%eax
jne    1165 <CP4RGBA_0+0x65>
movw   $0xf,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CP4RGBA_0>:
test   %edi,%edi
je     1133 <CP4RGBA_0+0x33>
movzwl %di,%eax
mov    %eax,%ecx
shl    $0xb,%ecx
shr    $0x7,%eax
or     %ecx,%eax
and    $0x3c0,%edi
and    $0xfffff0f0,%eax
lea    (%rax,%rdi,4),%ecx
add    $0xf,%ecx
movzwl %cx,%eax
cmp    $0xfff,%eax
mov    $0xf,%eax
cmovne %ecx,%eax
ret
mov    $0x6,%ax
ret

LLVM IR (-O0):
define zeroext i16 @CP4RGBA_0(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = icmp ne i16 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i16 6, i16* %2
br label %31
8: ; preds = %1
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = and i32 %10, 30
%12 = shl i32 %11, 11
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = and i32 %14, 30720
%16 = ashr i32 %15, 7
%17 = or i32 %12, %16
%18 = load i16, i16* %3
%19 = zext i16 %18 to i32
%20 = and i32 %19, 960
%21 = shl i32 %20, 2
%22 = or i32 %17, %21
%23 = or i32 %22, 15
%24 = trunc i32 %23 to i16
store i16 %24, i16* %4
%25 = load i16, i16* %4
%26 = zext i16 %25 to i32
%27 = icmp eq i32 %26, 4095
br i1 %27, label %28, label %29
28: ; preds = %8
store i16 15, i16* %4
br label %29
29: ; preds = %28, %8
%30 = load i16, i16* %4
store i16 %30, i16* %2
br label %31
31: ; preds = %29, %7
%32 = load i16, i16* %2
ret i16 %32
}

LLVM IR (-O2):
define zeroext i16 @CP4RGBA_0(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = shl i16 %0, 11
%5 = and i16 %4, -4096
%6 = lshr i16 %0, 7
%7 = and i16 %6, 240
%8 = shl i16 %0, 2
%9 = and i16 %8, 3840
%10 = or i16 %7, %5
%11 = or i16 %10, %9
%12 = or i16 %11, 15
%13 = icmp eq i16 %12, 4095
%14 = select i1 %13, i16 15, i16 %12
br label %15
15: ; preds = %1, %3
%16 = phi i16 [ %14, %3 ], [ 6, %1 ]
ret i16 %16
}
int checkSort(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    if (a[i] > a[i + 1])
      return 1;
    else
      return 0;
}


x86 assembly (clang, -O0):
<checkSort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1152 <checkSort+0x52>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114b <checkSort+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <checkSort+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSort>:
test   %esi,%esi
jle    110f <checkSort+0xf>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    0x4(%rdi),%ecx
setg   %al
ret
ret

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

LLVM IR (-O2):
define i32 @checkSort(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp sgt i32 %5, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ undef, %2 ]
ret i32 %11
}
unsigned long readVIC(unsigned long add) {
  return ((*((unsigned long *)(((0xFFFC0000 | add) >> 2) | 0xB0000000))) &
          0xFF);
}


x86 assembly (clang, -O0):
<readVIC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xfffc0000,%rax
or     -0x8(%rbp),%rax
shr    $0x2,%rax
movabs $0xb0000000,%rcx
or     %rcx,%rax
mov    (%rax),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readVIC>:
shr    $0x2,%rdi
mov    $0xbfff0000,%eax
or     %rdi,%rax
movzbl (%rax),%eax
ret

LLVM IR (-O0):
define i64 @readVIC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 4294705152, %3
%5 = lshr i64 %4, 2
%6 = or i64 %5, 2952790016
%7 = inttoptr i64 %6 to i64*
%8 = load i64, i64* %7
%9 = and i64 %8, 255
ret i64 %9
}

LLVM IR (-O2):
define i64 @readVIC(i64 %0) {
%2 = lshr i64 %0, 2
%3 = or i64 %2, 3221159936
%4 = inttoptr i64 %3 to i64*
%5 = load i64, i64* %4
%6 = and i64 %5, 255
ret i64 %6
}
/* Variables and functions */
int *ivector(size_t const);
int /*<<< orphan*/ memcpy(int *, int const *, size_t const);
int *clone_ivector(const int *v, const size_t n) {
  int *clone = ivector(n);
  memcpy(clone, v, n * sizeof(int));
  return clone;
}


x86 assembly (clang, -O0):
<clone_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ivector@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone_ivector>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <ivector@plt>
mov    %rax,%r15
shl    $0x2,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @clone_ivector(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i32* @ivector(i64 %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = mul i64 %10, 4
%12 = call i32 @memcpy(i32* %8, i32* %9, i64 %11)
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
define i32* @clone_ivector(i32* %0, i64 %1) {
%3 = tail call i32* @ivector(i64 %1)
%4 = shl i64 %1, 2
%5 = tail call i32 @memcpy(i32* %3, i32* %0, i64 %4)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ sort_partition(int *, int /*<<< orphan*/, int);
void quicksort(int *array, int length) { sort_partition(array, 0, length - 1); }


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

x86 assembly (clang, -O2):
<quicksort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <sort_partition@plt>

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @sort_partition(i32* %0, i32 0, i32 %3)
ret void
}
int compare_int(const void *l, const void *r) {
  int l_ = *(int *)l;
  int r_ = *(int *)r;
  return l_ - r_;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_standard_tracker(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(509, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @clear_standard_tracker() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 509, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int quat_is_equal(float *, float *);
__attribute__((always_)) bool psquat_is_equal(struct quat *a, struct quat *b) {
  return quat_is_equal((float *)a, (float *)b);
}


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

x86 assembly (clang, -O2):
<psquat_is_equal>:
jmp    1030 <quat_is_equal@plt>

LLVM IR (-O0):
%struct.quat = type { i32 }
define i32 @psquat_is_equal(%struct.quat* %0, %struct.quat* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %3
store %struct.quat* %1, %struct.quat** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = call i32 @quat_is_equal(float* %6, float* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define i32 @psquat_is_equal(%struct.quat* %0, %struct.quat* %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = bitcast %struct.quat* %1 to float*
%5 = tail call i32 @quat_is_equal(float* %3, float* %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ubitmap_set_bit(void *b, size_t num) {
  ((uint8_t *)b)[(num) / 8] |= (0x80 >> ((num) % 8));
}


x86 assembly (clang, -O0):
<ubitmap_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubitmap_set_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x80,%eax
shr    %cl,%eax
shr    $0x3,%rsi
or     %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @ubitmap_set_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = urem i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = ashr i32 128, %7
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i64, i64* %4
%12 = udiv i64 %11, 8
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @ubitmap_set_bit(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 7
%5 = lshr i32 128, %4
%6 = bitcast i8* %0 to i32*
%7 = lshr i64 %1, 3
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
char *stdc_8AB0ABC6(char *, char const *, size_t);
char *strncpy(char *dest, const char *src, size_t num) {
  return stdc_8AB0ABC6(dest, src, num);
}


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

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <stdc_8AB0ABC6@plt>

LLVM IR (-O0):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @stdc_8AB0ABC6(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @stdc_8AB0ABC6(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello, Nerves\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 = [15 x i8] c"Hello, Nerves\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, Nerves\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
char *strncpy_nul(char *dst, const char *src, size_t n) {
  strncpy(dst, src, n - 1)[n - 1] = '\0';
  return dst;
}


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

x86 assembly (clang, -O2):
<strncpy_nul>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strncpy_nul(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ CG_SelectPrevPlayer();
void CG_PrevTeamMember_f(void) { CG_SelectPrevPlayer(); }


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

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

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

LLVM IR (-O2):
define void @CG_PrevTeamMember_f() {
%1 = tail call i32 (...) @CG_SelectPrevPlayer()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char const *);
__attribute__((no, noclone)) char *fn1(char *p, const char *q) {
  strcpy(p, q);
  return strchr(p, '\0');
}


x86 assembly (clang, -O0):
<fn1>:
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>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @fn1(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)
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 0)
ret i8* %9
}

LLVM IR (-O2):
define i8* @fn1(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ X_OK;
int access(char const *, int /*<<< orphan*/);
int check_thatbinary(const char *name) {
  if (access(name, F_OK) == -1 || access(name, X_OK) == -1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<check_thatbinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1152 <check_thatbinary+0x42>
mov    -0x10(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
jne    115e <check_thatbinary+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <check_thatbinary+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_thatbinary>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1144 <check_thatbinary+0x34>
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <access@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_OK = global i32 0
@X_OK = global i32 0
define i32 @check_thatbinary(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i32, i32* @X_OK
%11 = call i32 @access(i8* %9, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %8, %1
store i32 1, i32* %2
br label %15
14: ; preds = %8
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@F_OK = global i32 0
@X_OK = global i32 0
define i32 @check_thatbinary(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @X_OK
%7 = tail call i32 @access(i8* %0, i32 %6)
%8 = icmp eq i32 %7, -1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
int test_170_10(int *mem) {
  int expected = 1;
  int desired = 5;
  return __atomic_compare_exchange(mem + 0, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test_170_10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x19(%rbp)
mov    %ecx,-0x18(%rbp)
test   $0x1,%al
jne    113d <test_170_10+0x3d>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_10>:
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x1,%eax
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_170_10(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %2
store i32 1, i32* %3
store i32 5, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = cmpxchg i32* %7, i32 %8, i32 %9 acq_rel monotonic
%11 = extractvalue { i32, i1 } %10, 0
%12 = extractvalue { i32, i1 } %10, 1
br i1 %12, label %14, label %13
13: ; preds = %1
store i32 %11, i32* %3
br label %14
14: ; preds = %13, %1
%15 = zext i1 %12 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = trunc i8 %16 to i1
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_170_10(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 1, i32 5 acq_rel monotonic
%3 = extractvalue { i32, i1 } %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *cmd) {
  fprintf(stderr,
          "Usage %s [ -n iterations ] [ -d delay ] [ -c cpu ] [ -m ] [ -h ]\n"
          "    -n num  Updates to show before exiting.\n"
          "    -d num  Seconds to wait between updates.\n"
          "    -m      Display minimal output.\n"
          "    -h      Display this help screen.\n",
          cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [229 x i8] c"Usage %s [ -n iterations ] [ -d delay ] [ -c cpu ] [ -m ] [ -h ]\0A -n num Updates to show before exiting.\0A -d num Seconds to wait between updates.\0A -m Display minimal output.\0A -h Display this help screen.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [229 x i8] c"Usage %s [ -n iterations ] [ -d delay ] [ -c cpu ] [ -m ] [ -h ]\0A -n num Updates to show before exiting.\0A -d num Seconds to wait between updates.\0A -m Display minimal output.\0A -h Display this help screen.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tag_power(int);
void tag_enable(int on) {
  if (on) {
    tag_power(1);
  } else {
  }
}


x86 assembly (clang, -O0):
<tag_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <tag_enable+0x24>
mov    $0x1,%edi
call   1030 <tag_power@plt>
jmp    1139 <tag_enable+0x29>
jmp    1139 <tag_enable+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_enable>:
test   %edi,%edi
je     111e <tag_enable+0xe>
mov    $0x1,%edi
jmp    1030 <tag_power@plt>
ret

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

LLVM IR (-O2):
define void @tag_enable(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @tag_power(i32 1)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void syntax(void) {
  extern char *__progname;
  printf("Usage: %s [options]\n"
         "\n"
         "Options:\n"
         "  -c, --nocolor         Disable colours\n"
         "  -f, --classic         Use the \"classic\" board layout\n"
         "  -n, --nonum           Disable numbers\n"
         "  -p, --printmoves      Print a list of moves at end of game\n"
         "  -w, --nowait          Disable input buffering\n"
         "\n"
         "  -h, --help            Show this help screen\n"
         "  -v, --version         Show version information\n"
         "  -l, --license         Show license information\n"
         "\n"
         "Report bugs to <bugs@cyphar.com>\n",
         __progname);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [454 x i8] c"Usage: %s [options]\0A\0AOptions:\0A -c, --nocolor Disable colours\0A -f, --classic Use the \22classic\22 board layout\0A -n, --nonum Disable numbers\0A -p, --printmoves Print a list of moves at end of game\0A -w, --nowait Disable input buffering\0A\0A -h, --help Show this help screen\0A -v, --version Show version information\0A -l, --license Show license information\0A\0AReport bugs to <bugs@cyphar.com>\0A\00"
@__progname = external global i8*
define void @syntax() {
%1 = load i8*, i8** @__progname
%2 = call i32 @printf(i8* getelementptr inbounds ([454 x i8], [454 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [454 x i8] c"Usage: %s [options]\0A\0AOptions:\0A -c, --nocolor Disable colours\0A -f, --classic Use the \22classic\22 board layout\0A -n, --nonum Disable numbers\0A -p, --printmoves Print a list of moves at end of game\0A -w, --nowait Disable input buffering\0A\0A -h, --help Show this help screen\0A -v, --version Show version information\0A -l, --license Show license information\0A\0AReport bugs to <bugs@cyphar.com>\0A\00"
@__progname = external global i8*
define void @syntax() {
%1 = load i8*, i8** @__progname
%2 = tail call i32 @printf(i8* getelementptr inbounds ([454 x i8], [454 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void CompElementDeriv(float pp, float p, float pn, float *ds, float *dd,
                      float ksm, float ksp, float kdm, float kdp) {
  float delm, delp;
  delm = p - pp;
  delp = pn - p;
  *ds = ksm * delm + ksp * delp;
  *dd = kdm * delm + kdp * delp;
}


x86 assembly (clang, -O0):
<CompElementDeriv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movss  %xmm3,-0x24(%rbp)
movss  %xmm4,-0x28(%rbp)
movss  %xmm5,-0x2c(%rbp)
movss  %xmm6,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x34(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
mulss  -0x38(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm0
movss  -0x34(%rbp),%xmm2
movss  -0x30(%rbp),%xmm1
mulss  -0x38(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompElementDeriv>:
subss  %xmm1,%xmm2
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm4
mulss  %xmm1,%xmm3
addss  %xmm4,%xmm3
movss  %xmm3,(%rdi)
mulss  %xmm6,%xmm2
mulss  %xmm5,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @CompElementDeriv(float %0, float %1, float %2, float* %3, float* %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float*
%14 = alloca float*
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float* %3, float** %13
store float* %4, float** %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%21 = load float, float* %11
%22 = load float, float* %10
%23 = fsub float %21, %22
store float %23, float* %19
%24 = load float, float* %12
%25 = load float, float* %11
%26 = fsub float %24, %25
store float %26, float* %20
%27 = load float, float* %15
%28 = load float, float* %19
%29 = load float, float* %16
%30 = load float, float* %20
%31 = fmul float %29, %30
%32 = call float @llvm.fmuladd.f32(float %27, float %28, float %31)
%33 = load float*, float** %13
store float %32, float* %33
%34 = load float, float* %17
%35 = load float, float* %19
%36 = load float, float* %18
%37 = load float, float* %20
%38 = fmul float %36, %37
%39 = call float @llvm.fmuladd.f32(float %34, float %35, float %38)
%40 = load float*, float** %14
store float %39, float* %40
ret void
}

LLVM IR (-O2):
define void @CompElementDeriv(float %0, float %1, float %2, float* nocapture writeonly %3, float* nocapture writeonly %4, float %5, float %6, float %7, float %8) {
%10 = fsub float %1, %0
%11 = fsub float %2, %1
%12 = fmul float %11, %6
%13 = tail call float @llvm.fmuladd.f32(float %5, float %10, float %12)
store float %13, float* %3
%14 = fmul float %11, %8
%15 = tail call float @llvm.fmuladd.f32(float %7, float %10, float %14)
store float %15, float* %4
ret void
}
void music_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @music_stop() {
ret void
}
unsigned int hash_from_key(void *k) {
  int *id = (int *)k;
  return (unsigned int)*id;
}


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

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

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

LLVM IR (-O2):
define i32 @hash_from_key(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int foo1() {}


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

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

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

LLVM IR (-O2):
define i32 @foo1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("Version: %s\n", "0.1"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *calloc(int, long);
void *midi_mem_calloc(int count, long nbytes, const char *file, int line) {
  void *p;
  assert(count > 0);
  assert(nbytes > 0);
  p = calloc(count, nbytes);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<midi_mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_mem_calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setg   %dil
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @midi_mem_calloc(i32 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %6
%15 = icmp sgt i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %5
%19 = load i64, i64* %6
%20 = call i8* @calloc(i32 %18, i64 %19)
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = icmp ne i8* %21, null
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i8*, i8** %9
ret i8* %25
}

LLVM IR (-O2):
define i8* @midi_mem_calloc(i32 %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp sgt i64 %1, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* @calloc(i32 %0, i64 %1)
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
ret i8* %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int disaslen(uint16_t m) {
  if (((m & 027) == 027) || ((m & 060) == 060)) {
    return 2;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<disaslen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x17,%eax
cmp    $0x17,%eax
je     1125 <disaslen+0x25>
mov    -0x8(%rbp),%eax
and    $0x30,%eax
cmp    $0x30,%eax
jne    1131 <disaslen+0x31>
movl   $0x2,-0x4(%rbp)
jmp    1138 <disaslen+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<disaslen>:
not    %edi
test   $0x17,%dil
sete   %al
test   $0x30,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @disaslen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 23
%6 = icmp eq i32 %5, 23
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 48
%10 = icmp eq i32 %9, 48
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 2, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @disaslen(i32 %0) {
%2 = and i32 %0, 23
%3 = icmp eq i32 %2, 23
%4 = and i32 %0, 48
%5 = icmp eq i32 %4, 48
%6 = or i1 %3, %5
%7 = select i1 %6, i32 2, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int access(char *, int /*<<< orphan*/);
int file_is_readable(char *filename) {
  if (access(filename, R_OK) != -1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_is_readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <file_is_readable+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <file_is_readable+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_is_readable>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@R_OK = global i32 0
define i32 @file_is_readable(i8* nocapture %0) {
%2 = load i32, i32* @R_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ randomqtdPayer(int *);
void test_randomqtdPayer() {
  printf("Teste of randomqtdPayer()...\n");
  int qtd = 0;
  randomqtdPayer(&qtd);
  printf("Found: %d\n", qtd);
}


x86 assembly (clang, -O0):
<test_randomqtdPayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <randomqtdPayer@plt>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_randomqtdPayer>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <randomqtdPayer@plt>
mov    0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Teste of randomqtdPayer()...\0A\00"
@.str.1 = [11 x i8] c"Found: %d\0A\00"
define void @test_randomqtdPayer() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%3 = call i32 @randomqtdPayer(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Found: %d\0A\00"
@str = [29 x i8] c"Teste of randomqtdPayer()...\00"
define void @test_randomqtdPayer() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = call i32 @randomqtdPayer(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void endpost(void) { fprintf(stderr, "\n"); }


x86 assembly (clang, -O0):
<endpost>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endpost>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @endpost() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @endpost() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}