#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int read_board(char *, int);
int /*<<< orphan*/ stderr;
char *read_phyboard(int pass) {
  static char board[90];
  if (!pass)
    return board;
  if (read_board(board, pass) == -1)
    fprintf(stderr, "warning: unable to read board\n");
  printf("board is read\n");
  return board;
}


x86 assembly (clang, -O0):
<read_phyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1155 <read_phyboard+0x25>
lea    0x2f04(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <read_phyboard+0x69>
mov    -0xc(%rbp),%esi
lea    0x2ef1(%rip),%rdi
call   1030 <read_board@plt>
cmp    $0xffffffff,%eax
jne    1182 <read_phyboard+0x52>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
lea    0x2ebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_phyboard>:
test   %edi,%edi
je     116d <read_phyboard+0x3d>
push   %rax
mov    %edi,%esi
lea    0x2f12(%rip),%rdi
call   1040 <read_board@plt>
cmp    $0xffffffff,%eax
jne    115d <read_phyboard+0x2d>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
lea    0x2edc(%rip),%rax
ret

LLVM IR (-O0):
@read_phyboard.board = internal global [90 x i8] zeroinitializer
@stderr = global i32 0
@.str = [31 x i8] c"warning: unable to read board\0A\00"
@.str.1 = [15 x i8] c"board is read\0A\00"
define i8* @read_phyboard(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* getelementptr inbounds ([90 x i8], [90 x i8]* @read_phyboard.board, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @read_board(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @read_phyboard.board, i64 0, i64 0), i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %7
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([90 x i8], [90 x i8]* @read_phyboard.board, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %14, %6
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@read_phyboard.board = internal global [90 x i8] zeroinitializer
@stderr = global i32 0
@.str = [31 x i8] c"warning: unable to read board\0A\00"
@str = [14 x i8] c"board is read\00"
define i8* @read_phyboard(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @read_board(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @read_phyboard.board, i64 0, i64 0), i32 %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
ret i8* getelementptr inbounds ([90 x i8], [90 x i8]* @read_phyboard.board, i64 0, i64 0)
}