#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*/ mvwhline(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/,
                            int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, ...);
void yatzy_ui_scoreboard_print_score(WINDOW *win, int y, int x, int score) {
  switch (score) {
  case -1:
    mvwprintw(win, y, x, "   ");
    break;
  case 0:
    mvwhline(win, y, x, 0, 3);
    break;
  default:
    mvwprintw(win, y, x, "%3d", score);
    break;
  }
}


x86 assembly (clang, -O0):
<yatzy_ui_scoreboard_print_score>:
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    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xffffffff,%eax
je     1159 <yatzy_ui_scoreboard_print_score+0x39>
jmp    1149 <yatzy_ui_scoreboard_print_score+0x29>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     1176 <yatzy_ui_scoreboard_print_score+0x56>
jmp    1192 <yatzy_ui_scoreboard_print_score+0x72>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe96(%rip),%rcx
mov    $0x0,%al
call   1040 <mvwprintw@plt>
jmp    11ae <yatzy_ui_scoreboard_print_score+0x8e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
call   1030 <mvwhline@plt>
jmp    11ae <yatzy_ui_scoreboard_print_score+0x8e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
lea    0xe5d(%rip),%rcx
mov    $0x0,%al
call   1040 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yatzy_ui_scoreboard_print_score>:
test   %ecx,%ecx
je     113a <yatzy_ui_scoreboard_print_score+0x1a>
mov    %ecx,%r8d
cmp    $0xffffffff,%ecx
jne    1147 <yatzy_ui_scoreboard_print_score+0x27>
lea    0xecd(%rip),%rcx
xor    %eax,%eax
jmp    1040 <mvwprintw@plt>
xor    %ecx,%ecx
mov    $0x3,%r8d
jmp    1030 <mvwhline@plt>
lea    0xeb6(%rip),%rcx
xor    %eax,%eax
jmp    1040 <mvwprintw@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c"%3d\00"
define void @yatzy_ui_scoreboard_print_score(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* %8
switch i32 %9, label %20 [
i32 -1, label %10
i32 0, label %15
]
10: ; preds = %4
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %11, i32 %12, i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %26
15: ; preds = %4
%16 = load i32*, i32** %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i32 @mvwhline(i32* %16, i32 %17, i32 %18, i32 0, i32 3)
br label %26
20: ; preds = %4
%21 = load i32*, i32** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %21, i32 %22, i32 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %20, %15, %10
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c"%3d\00"
define void @yatzy_ui_scoreboard_print_score(i32* %0, i32 %1, i32 %2, i32 %3) {
switch i32 %3, label %9 [
i32 -1, label %5
i32 0, label %7
]
5: ; preds = %4
%6 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %4
%8 = tail call i32 @mvwhline(i32* %0, i32 %1, i32 %2, i32 0, i32 3)
br label %11
9: ; preds = %4
%10 = tail call i32 (i32*, i32, i32, i8*, ...) @mvwprintw(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %11
11: ; preds = %9, %7, %5
ret void
}