#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 */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ ACS_BTEE;
int /*<<< orphan*/ ACS_LTEE;
int /*<<< orphan*/ ACS_PLUS;
int /*<<< orphan*/ ACS_RTEE;
int /*<<< orphan*/ ACS_TTEE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ draw_numbers(int /*<<< orphan*/ *);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ mvwhline(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/,
                            int);
int /*<<< orphan*/ mvwvline(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/,
                            int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void draw_board(WINDOW *board, int board_ystart, int board_xstart,
                bool numbered) {
  box(board, 0, 0);
  mvwhline(board, (3 * 8 + 1) / 3, 1, 0, (3 * 16 + 1) - 2);
  mvwaddch(board, (3 * 8 + 1) / 3, 0, ACS_LTEE);
  mvwaddch(board, (3 * 8 + 1) / 3, (3 * 16 + 1) - 1, ACS_RTEE);
  mvwhline(board, 2 * (3 * 8 + 1) / 3, 1, 0, (3 * 16 + 1) - 2);
  mvwaddch(board, 2 * (3 * 8 + 1) / 3, 0, ACS_LTEE);
  mvwaddch(board, 2 * (3 * 8 + 1) / 3, (3 * 16 + 1) - 1, ACS_RTEE);
  mvwvline(board, 1, (3 * 16 + 1) / 3, 0, (3 * 8 + 1) - 2);
  mvwaddch(board, 0, (3 * 16 + 1) / 3, ACS_TTEE);
  mvwaddch(board, (3 * 8 + 1) - 1, (3 * 16 + 1) / 3, ACS_BTEE);
  mvwvline(board, 1, 2 * (3 * 16 + 1) / 3, 0, (3 * 8 + 1) - 2);
  mvwaddch(board, 0, 2 * (3 * 16 + 1) / 3, ACS_TTEE);
  mvwaddch(board, (3 * 8 + 1) - 1, 2 * (3 * 16 + 1) / 3, ACS_BTEE);
  mvwaddch(board, (3 * 8 + 1) / 3, (3 * 16 + 1) / 3, ACS_PLUS);
  mvwaddch(board, 2 * (3 * 8 + 1) / 3, (3 * 16 + 1) / 3, ACS_PLUS);
  mvwaddch(board, (3 * 8 + 1) / 3, 2 * (3 * 16 + 1) / 3, ACS_PLUS);
  mvwaddch(board, 2 * (3 * 8 + 1) / 3, 2 * (3 * 16 + 1) / 3, ACS_PLUS);
  if (numbered)
    draw_numbers(board);
  wrefresh(board);
}


x86 assembly (clang, -O0):
<draw_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x2f,%r8d
call   1060 <mvwhline@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e40(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2dff(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
mov    $0x30,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x2f,%r8d
call   1060 <mvwhline@plt>
mov    -0x8(%rbp),%rdi
mov    0x2df0(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2daf(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%esi
mov    $0x30,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x10,%edx
xor    %ecx,%ecx
mov    $0x17,%r8d
call   1080 <mvwvline@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d88(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d7f(%rip),%rax
mov    (%rax),%ecx
mov    $0x18,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
xor    %ecx,%ecx
mov    $0x17,%r8d
call   1080 <mvwvline@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d38(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d2f(%rip),%rax
mov    (%rax),%ecx
mov    $0x18,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cfb(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cdf(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%edx
mov    %edx,%esi
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cc6(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2caa(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
cmpl   $0x0,-0x14(%rbp)
je     1342 <draw_board+0x1e2>
mov    -0x8(%rbp),%rdi
call   1040 <draw_numbers@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_board>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x2f,%r8d
call   1060 <mvwhline@plt>
mov    0x2e51(%rip),%r15
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    0x2e10(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x30,%edx
call   1070 <mvwaddch@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x2f,%r8d
call   1060 <mvwhline@plt>
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x30,%edx
call   1070 <mvwaddch@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
xor    %ecx,%ecx
mov    $0x17,%r8d
call   1080 <mvwvline@plt>
mov    0x2da9(%rip),%r15
mov    (%r15),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    0x2da0(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x18,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
xor    %ecx,%ecx
mov    $0x17,%r8d
call   1080 <mvwvline@plt>
mov    (%r15),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x18,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    0x2d2b(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
test   %r14d,%r14d
je     12fe <draw_board+0x19e>
mov    %rbx,%rdi
call   1040 <draw_numbers@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
@ACS_LTEE = global i32 0
@ACS_RTEE = global i32 0
@ACS_TTEE = global i32 0
@ACS_BTEE = global i32 0
@ACS_PLUS = global i32 0
define void @draw_board(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 @box(i32* %9, i32 0, i32 0)
%11 = load i32*, i32** %5
%12 = call i32 @mvwhline(i32* %11, i32 8, i32 1, i32 0, i32 47)
%13 = load i32*, i32** %5
%14 = load i32, i32* @ACS_LTEE
%15 = call i32 @mvwaddch(i32* %13, i32 8, i32 0, i32 %14)
%16 = load i32*, i32** %5
%17 = load i32, i32* @ACS_RTEE
%18 = call i32 @mvwaddch(i32* %16, i32 8, i32 48, i32 %17)
%19 = load i32*, i32** %5
%20 = call i32 @mvwhline(i32* %19, i32 16, i32 1, i32 0, i32 47)
%21 = load i32*, i32** %5
%22 = load i32, i32* @ACS_LTEE
%23 = call i32 @mvwaddch(i32* %21, i32 16, i32 0, i32 %22)
%24 = load i32*, i32** %5
%25 = load i32, i32* @ACS_RTEE
%26 = call i32 @mvwaddch(i32* %24, i32 16, i32 48, i32 %25)
%27 = load i32*, i32** %5
%28 = call i32 @mvwvline(i32* %27, i32 1, i32 16, i32 0, i32 23)
%29 = load i32*, i32** %5
%30 = load i32, i32* @ACS_TTEE
%31 = call i32 @mvwaddch(i32* %29, i32 0, i32 16, i32 %30)
%32 = load i32*, i32** %5
%33 = load i32, i32* @ACS_BTEE
%34 = call i32 @mvwaddch(i32* %32, i32 24, i32 16, i32 %33)
%35 = load i32*, i32** %5
%36 = call i32 @mvwvline(i32* %35, i32 1, i32 32, i32 0, i32 23)
%37 = load i32*, i32** %5
%38 = load i32, i32* @ACS_TTEE
%39 = call i32 @mvwaddch(i32* %37, i32 0, i32 32, i32 %38)
%40 = load i32*, i32** %5
%41 = load i32, i32* @ACS_BTEE
%42 = call i32 @mvwaddch(i32* %40, i32 24, i32 32, i32 %41)
%43 = load i32*, i32** %5
%44 = load i32, i32* @ACS_PLUS
%45 = call i32 @mvwaddch(i32* %43, i32 8, i32 16, i32 %44)
%46 = load i32*, i32** %5
%47 = load i32, i32* @ACS_PLUS
%48 = call i32 @mvwaddch(i32* %46, i32 16, i32 16, i32 %47)
%49 = load i32*, i32** %5
%50 = load i32, i32* @ACS_PLUS
%51 = call i32 @mvwaddch(i32* %49, i32 8, i32 32, i32 %50)
%52 = load i32*, i32** %5
%53 = load i32, i32* @ACS_PLUS
%54 = call i32 @mvwaddch(i32* %52, i32 16, i32 32, i32 %53)
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %4
%58 = load i32*, i32** %5
%59 = call i32 @draw_numbers(i32* %58)
br label %60
60: ; preds = %57, %4
%61 = load i32*, i32** %5
%62 = call i32 @wrefresh(i32* %61)
ret void
}

LLVM IR (-O2):
@ACS_LTEE = global i32 0
@ACS_RTEE = global i32 0
@ACS_TTEE = global i32 0
@ACS_BTEE = global i32 0
@ACS_PLUS = global i32 0
define void @draw_board(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @box(i32* %0, i32 0, i32 0)
%6 = tail call i32 @mvwhline(i32* %0, i32 8, i32 1, i32 0, i32 47)
%7 = load i32, i32* @ACS_LTEE
%8 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 0, i32 %7)
%9 = load i32, i32* @ACS_RTEE
%10 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 48, i32 %9)
%11 = tail call i32 @mvwhline(i32* %0, i32 16, i32 1, i32 0, i32 47)
%12 = load i32, i32* @ACS_LTEE
%13 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 0, i32 %12)
%14 = load i32, i32* @ACS_RTEE
%15 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 48, i32 %14)
%16 = tail call i32 @mvwvline(i32* %0, i32 1, i32 16, i32 0, i32 23)
%17 = load i32, i32* @ACS_TTEE
%18 = tail call i32 @mvwaddch(i32* %0, i32 0, i32 16, i32 %17)
%19 = load i32, i32* @ACS_BTEE
%20 = tail call i32 @mvwaddch(i32* %0, i32 24, i32 16, i32 %19)
%21 = tail call i32 @mvwvline(i32* %0, i32 1, i32 32, i32 0, i32 23)
%22 = load i32, i32* @ACS_TTEE
%23 = tail call i32 @mvwaddch(i32* %0, i32 0, i32 32, i32 %22)
%24 = load i32, i32* @ACS_BTEE
%25 = tail call i32 @mvwaddch(i32* %0, i32 24, i32 32, i32 %24)
%26 = load i32, i32* @ACS_PLUS
%27 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 16, i32 %26)
%28 = load i32, i32* @ACS_PLUS
%29 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 16, i32 %28)
%30 = load i32, i32* @ACS_PLUS
%31 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 32, i32 %30)
%32 = load i32, i32* @ACS_PLUS
%33 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 32, i32 %32)
%34 = icmp eq i32 %3, 0
br i1 %34, label %37, label %35
35: ; preds = %4
%36 = tail call i32 @draw_numbers(i32* %0)
br label %37
37: ; preds = %35, %4
%38 = tail call i32 @wrefresh(i32* %0)
ret void
}