#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*/ COLS;
int LINES;
int /*<<< orphan*/ mvwhline(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                             char *);
int /*<<< orphan*/ *newwin(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ print_archive(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *print_archive_window() {
  WINDOW *win = newwin(LINES, COLS, 0, 0);
  mvwprintw(win, 0, 0, "Archive");
  mvwhline(win, 1, 0, 0, COLS);
  mvwprintw(win, 2, 0, "Day");
  mvwhline(win, 3, 0, 0, COLS);
  print_archive(win);
  mvwhline(win, LINES - 2, 0, 0, COLS);
  print_new(win);
  wrefresh(win);
  return win;
}


x86 assembly (clang, -O0):
<print_archive_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <newwin@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
lea    0xe6c(%rip),%rcx
mov    %edx,%esi
call   1070 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e3a(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <mvwhline@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
lea    0xe3f(%rip),%rcx
call   1070 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e07(%rip),%rax
mov    (%rax),%r8d
mov    $0x3,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <mvwhline@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print_archive@plt>
mov    -0x8(%rbp),%rdi
mov    0x2dea(%rip),%rax
mov    (%rax),%esi
sub    $0x2,%esi
mov    0x2dd6(%rip),%rax
mov    (%rax),%r8d
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <mvwhline@plt>
mov    -0x8(%rbp),%rdi
call   1080 <print_new@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_archive_window>:
push   %r15
push   %r14
push   %rbx
mov    0x2e7c(%rip),%r15
mov    (%r15),%edi
mov    0x2e6a(%rip),%r14
mov    (%r14),%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <newwin@plt>
mov    %rax,%rbx
lea    0xe74(%rip),%rcx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mvwprintw@plt>
mov    (%r14),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <mvwhline@plt>
lea    0xe55(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1070 <mvwprintw@plt>
mov    (%r14),%r8d
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <mvwhline@plt>
mov    %rbx,%rdi
call   1050 <print_archive@plt>
mov    (%r15),%esi
add    $0xfffffffe,%esi
mov    (%r14),%r8d
mov    %rbx,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <mvwhline@plt>
mov    %rbx,%rdi
call   1080 <print_new@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LINES = global i32 0
@COLS = global i32 0
@.str = [8 x i8] c"Archive\00"
@.str.1 = [4 x i8] c"Day\00"
define i32* @print_archive_window() {
%1 = alloca i32*
%2 = load i32, i32* @LINES
%3 = load i32, i32* @COLS
%4 = call i32* @newwin(i32 %2, i32 %3, i32 0, i32 0)
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32 @mvwprintw(i32* %5, i32 0, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %1
%8 = load i32, i32* @COLS
%9 = call i32 @mvwhline(i32* %7, i32 1, i32 0, i32 0, i32 %8)
%10 = load i32*, i32** %1
%11 = call i32 @mvwprintw(i32* %10, i32 2, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32*, i32** %1
%13 = load i32, i32* @COLS
%14 = call i32 @mvwhline(i32* %12, i32 3, i32 0, i32 0, i32 %13)
%15 = load i32*, i32** %1
%16 = call i32 @print_archive(i32* %15)
%17 = load i32*, i32** %1
%18 = load i32, i32* @LINES
%19 = sub nsw i32 %18, 2
%20 = load i32, i32* @COLS
%21 = call i32 @mvwhline(i32* %17, i32 %19, i32 0, i32 0, i32 %20)
%22 = load i32*, i32** %1
%23 = call i32 @print_new(i32* %22)
%24 = load i32*, i32** %1
%25 = call i32 @wrefresh(i32* %24)
%26 = load i32*, i32** %1
ret i32* %26
}

LLVM IR (-O2):
@LINES = global i32 0
@COLS = global i32 0
@.str = [8 x i8] c"Archive\00"
@.str.1 = [4 x i8] c"Day\00"
define i32* @print_archive_window() {
%1 = load i32, i32* @LINES
%2 = load i32, i32* @COLS
%3 = tail call i32* @newwin(i32 %1, i32 %2, i32 0, i32 0)
%4 = tail call i32 @mvwprintw(i32* %3, i32 0, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @COLS
%6 = tail call i32 @mvwhline(i32* %3, i32 1, i32 0, i32 0, i32 %5)
%7 = tail call i32 @mvwprintw(i32* %3, i32 2, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @COLS
%9 = tail call i32 @mvwhline(i32* %3, i32 3, i32 0, i32 0, i32 %8)
%10 = tail call i32 @print_archive(i32* %3)
%11 = load i32, i32* @LINES
%12 = add nsw i32 %11, -2
%13 = load i32, i32* @COLS
%14 = tail call i32 @mvwhline(i32* %3, i32 %12, i32 0, i32 0, i32 %13)
%15 = tail call i32 @print_new(i32* %3)
%16 = tail call i32 @wrefresh(i32* %3)
ret i32* %3
}