#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/, int, int, char *, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void printline(int starty, int startx, int color, char *string) {
  attron(COLOR_PAIR(color));
  mvwprintw(stdscr, starty, startx, "%s", string);
  refresh();
  attroff(COLOR_PAIR(1));
  (void)color;
}


x86 assembly (clang, -O0):
<printline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%r8
lea    0xe72(%rip),%rcx
call   1070 <mvwprintw@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printline>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edx,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rcx
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%r8
call   1070 <mvwprintw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @printline(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = call i32 @attron(i32 %10)
%12 = load i32, i32* @stdscr
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i8*, i8** %8
%16 = call i32 @mvwprintw(i32 %12, i32 %13, i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 (...) @refresh()
%18 = call i32 @COLOR_PAIR(i32 1)
%19 = call i32 @attroff(i32 %18)
%20 = load i32, i32* %7
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @printline(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @COLOR_PAIR(i32 %2)
%6 = tail call i32 @attron(i32 %5)
%7 = load i32, i32* @stdscr
%8 = tail call i32 @mvwprintw(i32 %7, i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 @COLOR_PAIR(i32 1)
%11 = tail call i32 @attroff(i32 %10)
ret void
}