#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);
scalar_t__ LINES;
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/, scalar_t__, int /*<<< orphan*/,
                             char const *);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wattrset(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wbkgdset(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/);
void ncurses_print_help(char const *help) {
  wattrset(stdscr, COLOR_PAIR(3));
  wbkgdset(stdscr, COLOR_PAIR(3));
  mvwaddstr(stdscr, LINES - 1, 0, help);
  wclrtoeol(stdscr);
  wattrset(stdscr, COLOR_PAIR(1));
  wbkgdset(stdscr, COLOR_PAIR(1));
}


x86 assembly (clang, -O0):
<ncurses_print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <wbkgdset@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    0x2e3c(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1070 <mvwaddstr@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
call   1040 <wclrtoeol@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <wbkgdset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_print_help>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e82(%rip),%r14
mov    (%r14),%ebp
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    (%r14),%ebp
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <wbkgdset@plt>
mov    (%r14),%edi
mov    0x2e54(%rip),%rax
mov    (%rax),%rsi
add    $0xffffffffffffffff,%rsi
xor    %edx,%edx
mov    %rbx,%rcx
call   1070 <mvwaddstr@plt>
mov    (%r14),%edi
call   1040 <wclrtoeol@plt>
mov    (%r14),%ebx
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    (%r14),%ebx
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <wbkgdset@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@LINES = global i64 0
define void @ncurses_print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdscr
%4 = call i32 @COLOR_PAIR(i32 3)
%5 = call i32 @wattrset(i32 %3, i32 %4)
%6 = load i32, i32* @stdscr
%7 = call i32 @COLOR_PAIR(i32 3)
%8 = call i32 @wbkgdset(i32 %6, i32 %7)
%9 = load i32, i32* @stdscr
%10 = load i64, i64* @LINES
%11 = sub nsw i64 %10, 1
%12 = load i8*, i8** %2
%13 = call i32 @mvwaddstr(i32 %9, i64 %11, i32 0, i8* %12)
%14 = load i32, i32* @stdscr
%15 = call i32 @wclrtoeol(i32 %14)
%16 = load i32, i32* @stdscr
%17 = call i32 @COLOR_PAIR(i32 1)
%18 = call i32 @wattrset(i32 %16, i32 %17)
%19 = load i32, i32* @stdscr
%20 = call i32 @COLOR_PAIR(i32 1)
%21 = call i32 @wbkgdset(i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@LINES = global i64 0
define void @ncurses_print_help(i8* %0) {
%2 = load i32, i32* @stdscr
%3 = tail call i32 @COLOR_PAIR(i32 3)
%4 = tail call i32 @wattrset(i32 %2, i32 %3)
%5 = load i32, i32* @stdscr
%6 = tail call i32 @COLOR_PAIR(i32 3)
%7 = tail call i32 @wbkgdset(i32 %5, i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i64, i64* @LINES
%10 = add nsw i64 %9, -1
%11 = tail call i32 @mvwaddstr(i32 %8, i64 %10, i32 0, i8* %0)
%12 = load i32, i32* @stdscr
%13 = tail call i32 @wclrtoeol(i32 %12)
%14 = load i32, i32* @stdscr
%15 = tail call i32 @COLOR_PAIR(i32 1)
%16 = tail call i32 @wattrset(i32 %14, i32 %15)
%17 = load i32, i32* @stdscr
%18 = tail call i32 @COLOR_PAIR(i32 1)
%19 = tail call i32 @wbkgdset(i32 %17, i32 %18)
ret void
}