#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bitboard_test(int);
int /*<<< orphan*/ fenio_test(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ use_result(int /*<<< orphan*/, char *, int *);
int main(void) {
  int failures = 0;
  int verbose_errors = 1;
  use_result(fenio_test(verbose_errors), "fenio.c", &failures);
  use_result(bitboard_test(verbose_errors), "bitboard.h", &failures);
  fprintf(stderr, "\nSUMMARY: %d errors.\n", failures);
  return failures;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <fenio_test@plt>
mov    %eax,%edi
lea    0xe92(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1060 <use_result@plt>
mov    -0xc(%rbp),%edi
call   1040 <bitboard_test@plt>
mov    %eax,%edi
lea    0xe80(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1060 <use_result@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe6f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
mov    $0x1,%edi
call   1050 <fenio_test@plt>
lea    0xea2(%rip),%rsi
lea    0xc(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rdx
call   1060 <use_result@plt>
mov    $0x1,%edi
call   1040 <bitboard_test@plt>
lea    0xe8a(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
call   1060 <use_result@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
mov    0xc(%rsp),%edx
lea    0xe77(%rip),%rsi
call   1030 <fprintf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"fenio.c\00"
@.str.1 = [11 x i8] c"bitboard.h\00"
@stderr = global i32 0
@.str.2 = [22 x i8] c"\0ASUMMARY: %d errors.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @fenio_test(i32 %4)
%6 = call i32 @use_result(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %3
%8 = call i32 @bitboard_test(i32 %7)
%9 = call i32 @use_result(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"fenio.c\00"
@.str.1 = [11 x i8] c"bitboard.h\00"
@stderr = global i32 0
@.str.2 = [22 x i8] c"\0ASUMMARY: %d errors.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @fenio_test(i32 1)
%4 = call i32 @use_result(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @bitboard_test(i32 1)
%6 = call i32 @use_result(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* @stderr
%8 = load i32, i32* %1
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
ret i32 %10
}