#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_HLINE;
int /*<<< orphan*/ ACS_LLCORNER;
int /*<<< orphan*/ ACS_LRCORNER;
int /*<<< orphan*/ ACS_ULCORNER;
int /*<<< orphan*/ ACS_URCORNER;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
int player_sprite_creation_draw(WINDOW *win) {
  werase(win);
  box(win, 0, 0);
  int i = 0;
  mvwaddch(win, 1, 32, ACS_ULCORNER);
  mvwaddch(win, 1, 46, ACS_URCORNER);
  for (i = 0; i < 13; i++) {
    mvwaddch(win, 1, 33 + i, ACS_HLINE);
    mvwaddch(win, 9, 33 + i, ACS_HLINE);
  }
  for (i = 0; i < 7; i++) {
    mvwaddch(win, 2 + i, 32, ACS_VLINE);
    mvwaddch(win, 2 + i, 46, ACS_VLINE);
  }
  mvwaddch(win, 9, 32, ACS_LLCORNER);
  mvwaddch(win, 9, 46, ACS_LRCORNER);
  return 0;
}


x86 assembly (clang, -O0):
<player_sprite_creation_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <werase@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <box@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e50(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jge    11ea <player_sprite_creation_draw+0xba>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x21,%edx
mov    0x2e15(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1040 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x21,%edx
mov    0x2df8(%rip),%rax
mov    (%rax),%ecx
mov    $0x9,%esi
call   1040 <mvwaddch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1198 <player_sprite_creation_draw+0x68>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1243 <player_sprite_creation_draw+0x113>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x2,%esi
mov    0x2db4(%rip),%rax
mov    (%rax),%ecx
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x2,%esi
mov    0x2d97(%rip),%rax
mov    (%rax),%ecx
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f1 <player_sprite_creation_draw+0xc1>
mov    -0x8(%rbp),%rdi
mov    0x2d62(%rip),%rax
mov    (%rax),%ecx
mov    $0x9,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2d76(%rip),%rax
mov    (%rax),%ecx
mov    $0x9,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_sprite_creation_draw>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <werase@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <box@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    $0x21,%ebp
mov    0x2e3e(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <mvwaddch@plt>
mov    (%rbx),%ecx
mov    %r14,%rdi
mov    $0x9,%esi
mov    %ebp,%edx
call   1040 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x2e,%ebp
jne    1190 <player_sprite_creation_draw+0x60>
mov    0x2dff(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x6,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x6,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x7,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x7,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    $0x9,%esi
mov    $0x20,%edx
call   1040 <mvwaddch@plt>
mov    0x2cd7(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    $0x9,%esi
mov    $0x2e,%edx
call   1040 <mvwaddch@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_HLINE = global i32 0
@ACS_VLINE = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
define i32 @player_sprite_creation_draw(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @werase(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @box(i32* %6, i32 0, i32 0)
store i32 0, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* @ACS_ULCORNER
%10 = call i32 @mvwaddch(i32* %8, i32 1, i32 32, i32 %9)
%11 = load i32*, i32** %2
%12 = load i32, i32* @ACS_URCORNER
%13 = call i32 @mvwaddch(i32* %11, i32 1, i32 46, i32 %12)
store i32 0, i32* %3
br label %14
14: ; preds = %28, %1
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 13
br i1 %16, label %17, label %31
17: ; preds = %14
%18 = load i32*, i32** %2
%19 = load i32, i32* %3
%20 = add nsw i32 33, %19
%21 = load i32, i32* @ACS_HLINE
%22 = call i32 @mvwaddch(i32* %18, i32 1, i32 %20, i32 %21)
%23 = load i32*, i32** %2
%24 = load i32, i32* %3
%25 = add nsw i32 33, %24
%26 = load i32, i32* @ACS_HLINE
%27 = call i32 @mvwaddch(i32* %23, i32 9, i32 %25, i32 %26)
br label %28
28: ; preds = %17
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %14
31: ; preds = %14
store i32 0, i32* %3
br label %32
32: ; preds = %46, %31
%33 = load i32, i32* %3
%34 = icmp slt i32 %33, 7
br i1 %34, label %35, label %49
35: ; preds = %32
%36 = load i32*, i32** %2
%37 = load i32, i32* %3
%38 = add nsw i32 2, %37
%39 = load i32, i32* @ACS_VLINE
%40 = call i32 @mvwaddch(i32* %36, i32 %38, i32 32, i32 %39)
%41 = load i32*, i32** %2
%42 = load i32, i32* %3
%43 = add nsw i32 2, %42
%44 = load i32, i32* @ACS_VLINE
%45 = call i32 @mvwaddch(i32* %41, i32 %43, i32 46, i32 %44)
br label %46
46: ; preds = %35
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %32
49: ; preds = %32
%50 = load i32*, i32** %2
%51 = load i32, i32* @ACS_LLCORNER
%52 = call i32 @mvwaddch(i32* %50, i32 9, i32 32, i32 %51)
%53 = load i32*, i32** %2
%54 = load i32, i32* @ACS_LRCORNER
%55 = call i32 @mvwaddch(i32* %53, i32 9, i32 46, i32 %54)
ret i32 0
}

LLVM IR (-O2):
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_HLINE = global i32 0
@ACS_VLINE = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
define i32 @player_sprite_creation_draw(i32* %0) {
%2 = tail call i32 @werase(i32* %0)
%3 = tail call i32 @box(i32* %0, i32 0, i32 0)
%4 = load i32, i32* @ACS_ULCORNER
%5 = tail call i32 @mvwaddch(i32* %0, i32 1, i32 32, i32 %4)
%6 = load i32, i32* @ACS_URCORNER
%7 = tail call i32 @mvwaddch(i32* %0, i32 1, i32 46, i32 %6)
br label %8
8: ; preds = %1, %8
%9 = phi i32 [ 0, %1 ], [ %15, %8 ]
%10 = add nuw nsw i32 %9, 33
%11 = load i32, i32* @ACS_HLINE
%12 = tail call i32 @mvwaddch(i32* %0, i32 1, i32 %10, i32 %11)
%13 = load i32, i32* @ACS_HLINE
%14 = tail call i32 @mvwaddch(i32* %0, i32 9, i32 %10, i32 %13)
%15 = add nuw nsw i32 %9, 1
%16 = icmp eq i32 %15, 13
br i1 %16, label %17, label %8
17: ; preds = %8
%18 = load i32, i32* @ACS_VLINE
%19 = tail call i32 @mvwaddch(i32* %0, i32 2, i32 32, i32 %18)
%20 = load i32, i32* @ACS_VLINE
%21 = tail call i32 @mvwaddch(i32* %0, i32 2, i32 46, i32 %20)
%22 = load i32, i32* @ACS_VLINE
%23 = tail call i32 @mvwaddch(i32* %0, i32 3, i32 32, i32 %22)
%24 = load i32, i32* @ACS_VLINE
%25 = tail call i32 @mvwaddch(i32* %0, i32 3, i32 46, i32 %24)
%26 = load i32, i32* @ACS_VLINE
%27 = tail call i32 @mvwaddch(i32* %0, i32 4, i32 32, i32 %26)
%28 = load i32, i32* @ACS_VLINE
%29 = tail call i32 @mvwaddch(i32* %0, i32 4, i32 46, i32 %28)
%30 = load i32, i32* @ACS_VLINE
%31 = tail call i32 @mvwaddch(i32* %0, i32 5, i32 32, i32 %30)
%32 = load i32, i32* @ACS_VLINE
%33 = tail call i32 @mvwaddch(i32* %0, i32 5, i32 46, i32 %32)
%34 = load i32, i32* @ACS_VLINE
%35 = tail call i32 @mvwaddch(i32* %0, i32 6, i32 32, i32 %34)
%36 = load i32, i32* @ACS_VLINE
%37 = tail call i32 @mvwaddch(i32* %0, i32 6, i32 46, i32 %36)
%38 = load i32, i32* @ACS_VLINE
%39 = tail call i32 @mvwaddch(i32* %0, i32 7, i32 32, i32 %38)
%40 = load i32, i32* @ACS_VLINE
%41 = tail call i32 @mvwaddch(i32* %0, i32 7, i32 46, i32 %40)
%42 = load i32, i32* @ACS_VLINE
%43 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 32, i32 %42)
%44 = load i32, i32* @ACS_VLINE
%45 = tail call i32 @mvwaddch(i32* %0, i32 8, i32 46, i32 %44)
%46 = load i32, i32* @ACS_LLCORNER
%47 = tail call i32 @mvwaddch(i32* %0, i32 9, i32 32, i32 %46)
%48 = load i32, i32* @ACS_LRCORNER
%49 = tail call i32 @mvwaddch(i32* %0, i32 9, i32 46, i32 %48)
ret i32 0
}