#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*/ move(int /*<<< orphan*/, 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, 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);
  move(0, 0);
  wrefresh(board);
}


x86 assembly (clang, -O0):
<draw_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%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    0x2e36(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2df5(%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    0x2de6(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2da5(%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    0x2d7e(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d75(%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    0x2d2e(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d25(%rip),%rax
mov    (%rax),%ecx
mov    $0x18,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cf1(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cd5(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%edx
mov    %edx,%esi
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cbc(%rip),%rax
mov    (%rax),%ecx
mov    $0x8,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ca0(%rip),%rax
mov    (%rax),%ecx
mov    $0x10,%esi
mov    $0x20,%edx
call   1070 <mvwaddch@plt>
cmpl   $0x0,-0xc(%rbp)
je     134c <draw_board+0x1dc>
mov    -0x8(%rbp),%rdi
call   1040 <draw_numbers@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1090 <move@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_board>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%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    0x2e41(%rip),%r15
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    0x2e00(%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    0x2d99(%rip),%r15
mov    (%r15),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <mvwaddch@plt>
mov    0x2d90(%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    0x2d1b(%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     130e <draw_board+0x19e>
mov    %rbx,%rdi
call   1040 <draw_numbers@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <move@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) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @box(i32* %5, i32 0, i32 0)
%7 = load i32*, i32** %3
%8 = call i32 @mvwhline(i32* %7, i32 8, i32 1, i32 0, i32 47)
%9 = load i32*, i32** %3
%10 = load i32, i32* @ACS_LTEE
%11 = call i32 @mvwaddch(i32* %9, i32 8, i32 0, i32 %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* @ACS_RTEE
%14 = call i32 @mvwaddch(i32* %12, i32 8, i32 48, i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @mvwhline(i32* %15, i32 16, i32 1, i32 0, i32 47)
%17 = load i32*, i32** %3
%18 = load i32, i32* @ACS_LTEE
%19 = call i32 @mvwaddch(i32* %17, i32 16, i32 0, i32 %18)
%20 = load i32*, i32** %3
%21 = load i32, i32* @ACS_RTEE
%22 = call i32 @mvwaddch(i32* %20, i32 16, i32 48, i32 %21)
%23 = load i32*, i32** %3
%24 = call i32 @mvwvline(i32* %23, i32 1, i32 16, i32 0, i32 23)
%25 = load i32*, i32** %3
%26 = load i32, i32* @ACS_TTEE
%27 = call i32 @mvwaddch(i32* %25, i32 0, i32 16, i32 %26)
%28 = load i32*, i32** %3
%29 = load i32, i32* @ACS_BTEE
%30 = call i32 @mvwaddch(i32* %28, i32 24, i32 16, i32 %29)
%31 = load i32*, i32** %3
%32 = call i32 @mvwvline(i32* %31, i32 1, i32 32, i32 0, i32 23)
%33 = load i32*, i32** %3
%34 = load i32, i32* @ACS_TTEE
%35 = call i32 @mvwaddch(i32* %33, i32 0, i32 32, i32 %34)
%36 = load i32*, i32** %3
%37 = load i32, i32* @ACS_BTEE
%38 = call i32 @mvwaddch(i32* %36, i32 24, i32 32, i32 %37)
%39 = load i32*, i32** %3
%40 = load i32, i32* @ACS_PLUS
%41 = call i32 @mvwaddch(i32* %39, i32 8, i32 16, i32 %40)
%42 = load i32*, i32** %3
%43 = load i32, i32* @ACS_PLUS
%44 = call i32 @mvwaddch(i32* %42, i32 16, i32 16, i32 %43)
%45 = load i32*, i32** %3
%46 = load i32, i32* @ACS_PLUS
%47 = call i32 @mvwaddch(i32* %45, i32 8, i32 32, i32 %46)
%48 = load i32*, i32** %3
%49 = load i32, i32* @ACS_PLUS
%50 = call i32 @mvwaddch(i32* %48, i32 16, i32 32, i32 %49)
%51 = load i32, i32* %4
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %2
%54 = load i32*, i32** %3
%55 = call i32 @draw_numbers(i32* %54)
br label %56
56: ; preds = %53, %2
%57 = call i32 @move(i32 0, i32 0)
%58 = load i32*, i32** %3
%59 = call i32 @wrefresh(i32* %58)
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) {
%3 = tail call i32 @box(i32* %0, i32 0, i32 0)
%4 = tail call i32 @mvwhline(i32* %0, i32 8, i32 1, i32 0, i32 47)
%5 = load i32, i32* @ACS_LTEE
%6 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 0, i32 %5)
%7 = load i32, i32* @ACS_RTEE
%8 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 48, i32 %7)
%9 = tail call i32 @mvwhline(i32* %0, i32 16, i32 1, i32 0, i32 47)
%10 = load i32, i32* @ACS_LTEE
%11 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 0, i32 %10)
%12 = load i32, i32* @ACS_RTEE
%13 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 48, i32 %12)
%14 = tail call i32 @mvwvline(i32* %0, i32 1, i32 16, i32 0, i32 23)
%15 = load i32, i32* @ACS_TTEE
%16 = tail call i32 @mvwaddch(i32* %0, i32 0, i32 16, i32 %15)
%17 = load i32, i32* @ACS_BTEE
%18 = tail call i32 @mvwaddch(i32* %0, i32 24, i32 16, i32 %17)
%19 = tail call i32 @mvwvline(i32* %0, i32 1, i32 32, i32 0, i32 23)
%20 = load i32, i32* @ACS_TTEE
%21 = tail call i32 @mvwaddch(i32* %0, i32 0, i32 32, i32 %20)
%22 = load i32, i32* @ACS_BTEE
%23 = tail call i32 @mvwaddch(i32* %0, i32 24, i32 32, i32 %22)
%24 = load i32, i32* @ACS_PLUS
%25 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 16, i32 %24)
%26 = load i32, i32* @ACS_PLUS
%27 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 16, i32 %26)
%28 = load i32, i32* @ACS_PLUS
%29 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 32, i32 %28)
%30 = load i32, i32* @ACS_PLUS
%31 = tail call i32 @mvwaddch(i32* %0, i32 16, i32 32, i32 %30)
%32 = icmp eq i32 %1, 0
br i1 %32, label %35, label %33
33: ; preds = %2
%34 = tail call i32 @draw_numbers(i32* %0)
br label %35
35: ; preds = %33, %2
%36 = tail call i32 @move(i32 0, i32 0)
%37 = tail call i32 @wrefresh(i32* %0)
ret void
}