#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 */

/* Variables and functions */
int /*<<< orphan*/ A_STANDOUT;
int /*<<< orphan*/ COLOR_PAIR(int);
unsigned short COLS;
scalar_t__ LINES;
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int getch();
int /*<<< orphan*/ move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(unsigned char, unsigned short, char const *, ...);
unsigned short strlen(char *);
void runCreditsMenu() {
  clear();
  attron(COLOR_PAIR(1));
  move(LINES - 1, 0);
  for (unsigned short i = 0; i < COLS; ++i)
    addch(' ');
  attron(A_STANDOUT);
  mvprintw(LINES - 1, (COLS - strlen("Back")) / 2, "Back");
  attroff(A_STANDOUT);
  attroff(COLOR_PAIR(1));
  const char *credits[] = {
      "NetTic %s",
      "An online CLI Tic-Tac-Toe game.",
      "Copyright (c) 2016 Nicolas A. Ortega",
      "License: AGPLv3",
      "Source-Code: https://github.com/Deathsbreed/NetTic",
      "",
      "A special thanks to the NCurses, ENet, and Cereal libraries, as they",
      "were a very important part in the development of this project.",
      0};
  for (unsigned char i = 0; credits[i] != 0; ++i) {
    mvprintw(i + 1, (COLS - 64) / 2, credits[i], "v0.1");
  }
  while (true) {
    int ch = getch();
    if (ch == ' ' || ch == '\n')
      break;
  }
}


x86 assembly (clang, -O0):
<runCreditsMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x0,%al
call   10a0 <clear@plt>
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   10c0 <move@plt>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    0x2dfa(%rip),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jge    120c <runCreditsMenu+0x6c>
mov    $0x20,%edi
call   1080 <addch@plt>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    11db <runCreditsMenu+0x3b>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   1050 <attron@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%rax
sub    $0x1,%rax
mov    %al,-0x5d(%rbp)
mov    0x2dae(%rip),%rax
movzwl (%rax),%eax
mov    %eax,-0x5c(%rbp)
lea    0xdc1(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x5d(%rbp),%cl
mov    %ax,%dx
mov    -0x5c(%rbp),%eax
movzwl %dx,%edx
sub    %edx,%eax
mov    $0x2,%esi
cltd
idiv   %esi
lea    0xd9f(%rip),%rdx
movzbl %cl,%edi
movzwl %ax,%esi
mov    $0x0,%al
call   10b0 <mvprintw@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x1,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
lea    -0x50(%rbp),%rdi
lea    0x2b28(%rip),%rsi
mov    $0x48,%edx
call   1060 <memcpy@plt>
movb   $0x0,-0x51(%rbp)
movzbl -0x51(%rbp),%eax
cmpq   $0x0,-0x50(%rbp,%rax,8)
je     1300 <runCreditsMenu+0x160>
movzbl -0x51(%rbp),%eax
add    $0x1,%eax
mov    %al,%sil
mov    0x2d19(%rip),%rax
movzwl (%rax),%eax
sub    $0x40,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movzbl -0x51(%rbp),%ecx
mov    -0x50(%rbp,%rcx,8),%rdx
lea    0xe36(%rip),%rcx
movzbl %sil,%edi
movzwl %ax,%esi
mov    $0x0,%al
call   10b0 <mvprintw@plt>
mov    -0x51(%rbp),%al
add    $0x1,%al
mov    %al,-0x51(%rbp)
jmp    12a6 <runCreditsMenu+0x106>
jmp    1305 <runCreditsMenu+0x165>
mov    $0x0,%al
call   1090 <getch@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0x20,-0x58(%rbp)
je     1323 <runCreditsMenu+0x183>
cmpl   $0xa,-0x58(%rbp)
jne    1328 <runCreditsMenu+0x188>
jmp    132d <runCreditsMenu+0x18d>
jmp    1305 <runCreditsMenu+0x165>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runCreditsMenu>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1090 <clear@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    0x2e31(%rip),%r14
mov    (%r14),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   10b0 <move@plt>
mov    0x2e14(%rip),%r12
cmpw   $0x0,(%r12)
je     11f4 <runCreditsMenu+0x64>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1070 <addch@plt>
add    $0x1,%ebp
cmp    (%r12),%bp
jb     11e0 <runCreditsMenu+0x50>
mov    0x2dd5(%rip),%r15
mov    (%r15),%edi
call   1050 <attron@plt>
mov    (%r14),%bl
add    $0xff,%bl
movzwl (%r12),%ebp
lea    0xdeb(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
movzwl %ax,%eax
sub    %eax,%ebp
mov    %ebp,%eax
shr    $0x1f,%eax
add    %ebp,%eax
shr    %eax
movzwl %ax,%esi
movzbl %bl,%edi
mov    %r14,%rdx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
mov    (%r15),%edi
call   1030 <attroff@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd93(%rip),%rdx
lea    0xea2(%rip),%r14
mov    $0x1,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd69(%rip),%rdx
mov    $0x2,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd5c(%rip),%rdx
mov    $0x3,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd54(%rip),%rdx
mov    $0x4,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd37(%rip),%rdx
mov    $0x5,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xcd4(%rip),%rdx
mov    $0x6,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd10(%rip),%rdx
mov    $0x7,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
movzwl (%r12),%eax
mov    %eax,%ecx
add    $0xffffffc0,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffc0,%eax
shr    %eax
movzwl %ax,%esi
lea    0xd28(%rip),%rdx
mov    $0x8,%edi
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <mvprintw@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1080 <getch@plt>
cmp    $0x20,%eax
je     13e1 <runCreditsMenu+0x251>
cmp    $0xa,%eax
jne    13d0 <runCreditsMenu+0x240>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LINES = global i64 0
@COLS = global i16 0
@A_STANDOUT = global i32 0
@.str = [5 x i8] c"Back\00"
@.str.1 = [10 x i8] c"NetTic %s\00"
@.str.2 = [32 x i8] c"An online CLI Tic-Tac-Toe game.\00"
@.str.3 = [37 x i8] c"Copyright (c) 2016 Nicolas A. Ortega\00"
@.str.4 = [16 x i8] c"License: AGPLv3\00"
@.str.5 = [51 x i8] c"Source-Code: https://github.com/Deathsbreed/NetTic\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [69 x i8] c"A special thanks to the NCurses, ENet, and Cereal libraries, as they\00"
@.str.8 = [63 x i8] c"were a very important part in the development of this project.\00"
@__const.runCreditsMenu.credits = [9 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i32 0, i32 0), i8* null]
@.str.9 = [5 x i8] c"v0.1\00"
define void @runCreditsMenu() {
%1 = alloca i16
%2 = alloca [9 x i8*]
%3 = alloca i8
%4 = alloca i32
%5 = call i32 (...) @clear()
%6 = call i32 @COLOR_PAIR(i32 1)
%7 = call i32 @attron(i32 %6)
%8 = load i64, i64* @LINES
%9 = sub nsw i64 %8, 1
%10 = call i32 @move(i64 %9, i32 0)
store i16 0, i16* %1
br label %11
11: ; preds = %19, %0
%12 = load i16, i16* %1
%13 = zext i16 %12 to i32
%14 = load i16, i16* @COLS
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = call i32 @addch(i8 signext 32)
br label %19
19: ; preds = %17
%20 = load i16, i16* %1
%21 = add i16 %20, 1
store i16 %21, i16* %1
br label %11
22: ; preds = %11
%23 = load i32, i32* @A_STANDOUT
%24 = call i32 @attron(i32 %23)
%25 = load i64, i64* @LINES
%26 = sub nsw i64 %25, 1
%27 = trunc i64 %26 to i8
%28 = load i16, i16* @COLS
%29 = zext i16 %28 to i32
%30 = call zeroext i16 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%31 = zext i16 %30 to i32
%32 = sub nsw i32 %29, %31
%33 = sdiv i32 %32, 2
%34 = trunc i32 %33 to i16
%35 = call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext %27, i16 zeroext %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%36 = load i32, i32* @A_STANDOUT
%37 = call i32 @attroff(i32 %36)
%38 = call i32 @COLOR_PAIR(i32 1)
%39 = call i32 @attroff(i32 %38)
%40 = bitcast [9 x i8*]* %2 to i8*
store i8 0, i8* %3
br label %41
41: ; preds = %62, %22
%42 = load i8, i8* %3
%43 = zext i8 %42 to i64
%44 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %65
47: ; preds = %41
%48 = load i8, i8* %3
%49 = zext i8 %48 to i32
%50 = add nsw i32 %49, 1
%51 = trunc i32 %50 to i8
%52 = load i16, i16* @COLS
%53 = zext i16 %52 to i32
%54 = sub nsw i32 %53, 64
%55 = sdiv i32 %54, 2
%56 = trunc i32 %55 to i16
%57 = load i8, i8* %3
%58 = zext i8 %57 to i64
%59 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext %51, i16 zeroext %56, i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %62
62: ; preds = %47
%63 = load i8, i8* %3
%64 = add i8 %63, 1
store i8 %64, i8* %3
br label %41
65: ; preds = %41
br label %66
66: ; preds = %65, %74
%67 = call i32 (...) @getch()
store i32 %67, i32* %4
%68 = load i32, i32* %4
%69 = icmp eq i32 %68, 32
br i1 %69, label %73, label %70
70: ; preds = %66
%71 = load i32, i32* %4
%72 = icmp eq i32 %71, 10
br i1 %72, label %73, label %74
73: ; preds = %70, %66
br label %75
74: ; preds = %70
br label %66
75: ; preds = %73
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@COLS = global i16 0
@A_STANDOUT = global i32 0
@.str = [5 x i8] c"Back\00"
@.str.1 = [10 x i8] c"NetTic %s\00"
@.str.2 = [32 x i8] c"An online CLI Tic-Tac-Toe game.\00"
@.str.3 = [37 x i8] c"Copyright (c) 2016 Nicolas A. Ortega\00"
@.str.4 = [16 x i8] c"License: AGPLv3\00"
@.str.5 = [51 x i8] c"Source-Code: https://github.com/Deathsbreed/NetTic\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [69 x i8] c"A special thanks to the NCurses, ENet, and Cereal libraries, as they\00"
@.str.8 = [63 x i8] c"were a very important part in the development of this project.\00"
@.str.9 = [5 x i8] c"v0.1\00"
define void @runCreditsMenu() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @COLOR_PAIR(i32 1)
%3 = tail call i32 @attron(i32 %2)
%4 = load i64, i64* @LINES
%5 = add nsw i64 %4, -1
%6 = tail call i32 @move(i64 %5, i32 0)
%7 = load i16, i16* @COLS
%8 = icmp eq i16 %7, 0
br i1 %8, label %9, label %75
9: ; preds = %75, %0
%10 = load i32, i32* @A_STANDOUT
%11 = tail call i32 @attron(i32 %10)
%12 = load i64, i64* @LINES
%13 = trunc i64 %12 to i8
%14 = add i8 %13, -1
%15 = load i16, i16* @COLS
%16 = zext i16 %15 to i32
%17 = tail call zeroext i16 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = zext i16 %17 to i32
%19 = sub nsw i32 %16, %18
%20 = sdiv i32 %19, 2
%21 = trunc i32 %20 to i16
%22 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext %14, i16 zeroext %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = load i32, i32* @A_STANDOUT
%24 = tail call i32 @attroff(i32 %23)
%25 = tail call i32 @COLOR_PAIR(i32 1)
%26 = tail call i32 @attroff(i32 %25)
%27 = load i16, i16* @COLS
%28 = zext i16 %27 to i32
%29 = add nsw i32 %28, -64
%30 = sdiv i32 %29, 2
%31 = trunc i32 %30 to i16
%32 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 1, i16 zeroext %31, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%33 = load i16, i16* @COLS
%34 = zext i16 %33 to i32
%35 = add nsw i32 %34, -64
%36 = sdiv i32 %35, 2
%37 = trunc i32 %36 to i16
%38 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 2, i16 zeroext %37, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%39 = load i16, i16* @COLS
%40 = zext i16 %39 to i32
%41 = add nsw i32 %40, -64
%42 = sdiv i32 %41, 2
%43 = trunc i32 %42 to i16
%44 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 3, i16 zeroext %43, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%45 = load i16, i16* @COLS
%46 = zext i16 %45 to i32
%47 = add nsw i32 %46, -64
%48 = sdiv i32 %47, 2
%49 = trunc i32 %48 to i16
%50 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 4, i16 zeroext %49, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%51 = load i16, i16* @COLS
%52 = zext i16 %51 to i32
%53 = add nsw i32 %52, -64
%54 = sdiv i32 %53, 2
%55 = trunc i32 %54 to i16
%56 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 5, i16 zeroext %55, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%57 = load i16, i16* @COLS
%58 = zext i16 %57 to i32
%59 = add nsw i32 %58, -64
%60 = sdiv i32 %59, 2
%61 = trunc i32 %60 to i16
%62 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 6, i16 zeroext %61, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%63 = load i16, i16* @COLS
%64 = zext i16 %63 to i32
%65 = add nsw i32 %64, -64
%66 = sdiv i32 %65, 2
%67 = trunc i32 %66 to i16
%68 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 7, i16 zeroext %67, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%69 = load i16, i16* @COLS
%70 = zext i16 %69 to i32
%71 = add nsw i32 %70, -64
%72 = sdiv i32 %71, 2
%73 = trunc i32 %72 to i16
%74 = tail call i32 (i8, i16, i8*, ...) @mvprintw(i8 zeroext 8, i16 zeroext %73, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %81
75: ; preds = %0, %75
%76 = phi i16 [ %78, %75 ], [ 0, %0 ]
%77 = tail call i32 @addch(i8 signext 32)
%78 = add nuw i16 %76, 1
%79 = load i16, i16* @COLS
%80 = icmp ult i16 %78, %79
br i1 %80, label %75, label %9
81: ; preds = %9, %81
%82 = tail call i32 (...) @getch()
switch i32 %82, label %81 [
i32 32, label %83
i32 10, label %83
]
83: ; preds = %81, %81
ret void
}