#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_VLINE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, int);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void show_score_win(int score) {
  int x, y;
  int sty, stx;
  getmaxyx(stdscr, y, x);
  WINDOW *score_win =
      newwin(20, 40, sty = (y / 2) - (20 / 2), stx = (x / 2) - (40 / 2));
  box(score_win, ACS_VLINE, ACS_HLINE);
  mvwprintw(score_win, (20 / 2) - 1, (40 / 2) - 10, "Your Score: %d", score);
  wrefresh(score_win);
  sleep(3);
  delwin(score_win);
}


x86 assembly (clang, -O0):
<show_score_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1050 <getmaxyx@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0xa,%eax
mov    %eax,-0x24(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
sub    $0x14,%ecx
mov    %ecx,-0x14(%rbp)
mov    $0x14,%edi
mov    $0x28,%esi
call   1040 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2df9(%rip),%rax
mov    (%rax),%esi
mov    0x2df8(%rip),%rax
mov    (%rax),%edx
call   1060 <box@plt>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%r8d
mov    $0x9,%esi
mov    $0xa,%edx
lea    0xe00(%rip),%rcx
call   1080 <mvwprintw@plt>
mov    -0x20(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    $0x3,%edi
call   1090 <sleep@plt>
mov    -0x20(%rbp),%rdi
call   1070 <delwin@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_score_win>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <getmaxyx@plt>
mov    $0x14,%edi
mov    $0x28,%esi
mov    $0xfffffff6,%edx
mov    $0xffffffec,%ecx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
mov    0x2e29(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1060 <box@plt>
lea    0xe40(%rip),%rcx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
mov    %ebp,%r8d
call   1080 <mvwprintw@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    $0x3,%edi
call   1090 <sleep@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <delwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [15 x i8] c"Your Score: %d\00"
define void @show_score_win(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %2
%8 = load i32, i32* @stdscr
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @getmaxyx(i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 2
%14 = sub nsw i32 %13, 10
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 2
%17 = sub nsw i32 %16, 20
store i32 %17, i32* %6
%18 = call i32* @newwin(i32 20, i32 40, i32 %14, i32 %17)
store i32* %18, i32** %7
%19 = load i32*, i32** %7
%20 = load i32, i32* @ACS_VLINE
%21 = load i32, i32* @ACS_HLINE
%22 = call i32 @box(i32* %19, i32 %20, i32 %21)
%23 = load i32*, i32** %7
%24 = load i32, i32* %2
%25 = call i32 @mvwprintw(i32* %23, i32 9, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32*, i32** %7
%27 = call i32 @wrefresh(i32* %26)
%28 = call i32 @sleep(i32 3)
%29 = load i32*, i32** %7
%30 = call i32 @delwin(i32* %29)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [15 x i8] c"Your Score: %d\00"
define void @show_score_win(i32 %0) {
%2 = load i32, i32* @stdscr
%3 = tail call i32 @getmaxyx(i32 %2, i32 undef, i32 undef)
%4 = tail call i32* @newwin(i32 20, i32 40, i32 -10, i32 -20)
%5 = load i32, i32* @ACS_VLINE
%6 = load i32, i32* @ACS_HLINE
%7 = tail call i32 @box(i32* %4, i32 %5, i32 %6)
%8 = tail call i32 @mvwprintw(i32* %4, i32 9, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%9 = tail call i32 @wrefresh(i32* %4)
%10 = tail call i32 @sleep(i32 3)
%11 = tail call i32 @delwin(i32* %4)
ret void
}