#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*/ clear_win_char(int /*<<< orphan*/ *);
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int display_help(WINDOW *wp) {
  int y = 0;
  clear_win_char(wp);
  mvwaddstr(wp, y, 1, "h: display this menu");
  ++y;
  mvwaddstr(wp, y, 1, "q: quit");
  ++y;
  mvwaddstr(wp, y, 1, "jk: down,up");
  ++y;
  mvwaddstr(wp, y, 1, "h: display this menu");
  ++y;
  return 0;
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clear_win_char@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
lea    0xeb1(%rip),%rcx
call   1040 <mvwaddstr@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
lea    0xea5(%rip),%rcx
call   1040 <mvwaddstr@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
lea    0xe8c(%rip),%rcx
call   1040 <mvwaddstr@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
lea    0xe4e(%rip),%rcx
call   1040 <mvwaddstr@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_help>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <clear_win_char@plt>
lea    0xecd(%rip),%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <mvwaddstr@plt>
lea    0xec9(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <mvwaddstr@plt>
lea    0xeb8(%rip),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <mvwaddstr@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <mvwaddstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"h: display this menu\00"
@.str.1 = [8 x i8] c"q: quit\00"
@.str.2 = [12 x i8] c"jk: down,up\00"
define i32 @display_help(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @clear_win_char(i32* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = call i32 @mvwaddstr(i32* %6, i32 %7, i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = call i32 @mvwaddstr(i32* %11, i32 %12, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32*, i32** %2
%17 = load i32, i32* %3
%18 = call i32 @mvwaddstr(i32* %16, i32 %17, i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32*, i32** %2
%22 = load i32, i32* %3
%23 = call i32 @mvwaddstr(i32* %21, i32 %22, i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"h: display this menu\00"
@.str.1 = [8 x i8] c"q: quit\00"
@.str.2 = [12 x i8] c"jk: down,up\00"
define i32 @display_help(i32* %0) {
%2 = tail call i32 @clear_win_char(i32* %0)
%3 = tail call i32 @mvwaddstr(i32* %0, i32 0, i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @mvwaddstr(i32* %0, i32 1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @mvwaddstr(i32* %0, i32 2, i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @mvwaddstr(i32* %0, i32 3, i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}