#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_BOLD;
int /*<<< orphan*/ COLS;
int LINES;
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
main() {
  initscr();
  move(LINES / 2, 0);
  attrset(A_BOLD);
  printw("lines = %d, columns = %d", LINES, COLS);
  refresh();
  sleep(2);
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
xor    %esi,%esi
call   10a0 <move@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
call   1070 <attrset@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%esi
mov    0x2e12(%rip),%rax
mov    (%rax),%edx
lea    0xe29(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x2,%edi
call   1090 <sleep@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e59(%rip),%rbx
mov    (%rbx),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
xor    %esi,%esi
call   10a0 <move@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1070 <attrset@plt>
mov    (%rbx),%esi
mov    0x2e28(%rip),%rax
mov    (%rax),%edx
lea    0xe3f(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    $0x2,%edi
call   1090 <sleep@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@LINES = global i32 0
@A_BOLD = global i32 0
@.str = [25 x i8] c"lines = %d, columns = %d\00"
@COLS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = load i32, i32* @LINES
%4 = sdiv i32 %3, 2
%5 = call i32 @move(i32 %4, i32 0)
%6 = load i32, i32* @A_BOLD
%7 = call i32 @attrset(i32 %6)
%8 = load i32, i32* @LINES
%9 = load i32, i32* @COLS
%10 = call i32 @printw(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 (...) @refresh()
%12 = call i32 @sleep(i32 2)
%13 = call i32 (...) @endwin()
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LINES = global i32 0
@A_BOLD = global i32 0
@.str = [25 x i8] c"lines = %d, columns = %d\00"
@COLS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @LINES
%3 = sdiv i32 %2, 2
%4 = tail call i32 @move(i32 %3, i32 0)
%5 = load i32, i32* @A_BOLD
%6 = tail call i32 @attrset(i32 %5)
%7 = load i32, i32* @LINES
%8 = load i32, i32* @COLS
%9 = tail call i32 @printw(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = tail call i32 (...) @refresh()
%11 = tail call i32 @sleep(i32 2)
%12 = tail call i32 (...) @endwin()
%13 = tail call i32 @exit(i32 0)
unreachable
}