#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*/ cbreak();
int /*<<< orphan*/ general_help();
char getch();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ setup_screen();
char tolower(char);
help() {
  char tmp_char, lch;
  setup_screen();
  move(4, 0);
  printw("%s\n",
         "This is the main bibcursed screen. You can choose from four main");
  printw("%s\n",
         "options. Press 's' to search for key words in your BibTeX file.");
  printw("%s\n",
         "You will be given a list of entry names containing the search");
  printw("%s\n", "term. You can then display these by using the 'C' option on");
  printw("%s\n\n", "this screen.");
  printw("%s\n", "The Add option will ask you for details about your new");
  printw("%s\n",
         "reference, then add it to the database. The delete option will");
  printw("%s\n",
         "remove a reference with the ID you supply from the database.");
  move(14, 5);
  printw("%s", "Press a key to continue, or H for more help");
  refresh();
  cbreak();
  tmp_char = getch();
  lch = tolower(tmp_char);
  if (lch == 'h')
    general_help();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <setup_screen@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   10a0 <move@plt>
lea    0xe5e(%rip),%rdi
lea    0xe5b(%rip),%rsi
call   1060 <printw@plt>
lea    0xe4b(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1060 <printw@plt>
lea    0xe38(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1060 <printw@plt>
lea    0xe25(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1060 <printw@plt>
lea    0xf11(%rip),%rdi
lea    0xf0f(%rip),%rsi
call   1060 <printw@plt>
lea    0xdff(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1060 <printw@plt>
lea    0xdec(%rip),%rdi
lea    0xf2d(%rip),%rsi
call   1060 <printw@plt>
lea    0xdd9(%rip),%rdi
lea    0xf59(%rip),%rsi
call   1060 <printw@plt>
mov    $0xe,%edi
mov    $0x5,%esi
call   10a0 <move@plt>
lea    0xf7b(%rip),%rdi
lea    0xf77(%rip),%rsi
call   1060 <printw@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1090 <getch@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1070 <tolower@plt>
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x68,%eax
jne    128d <help+0x10d>
mov    $0x0,%al
call   1040 <general_help@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
xor    %eax,%eax
call   1050 <setup_screen@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   10a0 <move@plt>
lea    0xe65(%rip),%rbx
lea    0xe62(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xef4(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xf21(%rip),%rdi
lea    0xf1f(%rip),%rsi
call   1060 <printw@plt>
lea    0xf20(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xf48(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
lea    0xf78(%rip),%rsi
mov    %rbx,%rdi
call   1060 <printw@plt>
mov    $0xe,%edi
mov    $0x5,%esi
call   10a0 <move@plt>
lea    0xf97(%rip),%rdi
lea    0xf93(%rip),%rsi
call   1060 <printw@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1090 <getch@plt>
movsbl %al,%edi
call   1070 <tolower@plt>
cmp    $0x68,%al
jne    1261 <help+0xe1>
xor    %eax,%eax
call   1040 <general_help@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [65 x i8] c"This is the main bibcursed screen. You can choose from four main\00"
@.str.2 = [64 x i8] c"options. Press 's' to search for key words in your BibTeX file.\00"
@.str.3 = [62 x i8] c"You will be given a list of entry names containing the search\00"
@.str.4 = [60 x i8] c"term. You can then display these by using the 'C' option on\00"
@.str.5 = [5 x i8] c"%s\0A\0A\00"
@.str.6 = [13 x i8] c"this screen.\00"
@.str.7 = [55 x i8] c"The Add option will ask you for details about your new\00"
@.str.8 = [63 x i8] c"reference, then add it to the database. The delete option will\00"
@.str.9 = [61 x i8] c"remove a reference with the ID you supply from the database.\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [44 x i8] c"Press a key to continue, or H for more help\00"
define i32 @help() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = call i32 (...) @setup_screen()
%5 = call i32 @move(i32 4, i32 0)
%6 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 @move(i32 14, i32 5)
%15 = call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 (...) @refresh()
%17 = call i32 (...) @cbreak()
%18 = call signext i8 (...) @getch()
store i8 %18, i8* %2
%19 = load i8, i8* %2
%20 = call signext i8 @tolower(i8 signext %19)
store i8 %20, i8* %3
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 104
br i1 %23, label %24, label %26
24: ; preds = %0
%25 = call i32 (...) @general_help()
br label %26
26: ; preds = %24, %0
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [65 x i8] c"This is the main bibcursed screen. You can choose from four main\00"
@.str.2 = [64 x i8] c"options. Press 's' to search for key words in your BibTeX file.\00"
@.str.3 = [62 x i8] c"You will be given a list of entry names containing the search\00"
@.str.4 = [60 x i8] c"term. You can then display these by using the 'C' option on\00"
@.str.5 = [5 x i8] c"%s\0A\0A\00"
@.str.6 = [13 x i8] c"this screen.\00"
@.str.7 = [55 x i8] c"The Add option will ask you for details about your new\00"
@.str.8 = [63 x i8] c"reference, then add it to the database. The delete option will\00"
@.str.9 = [61 x i8] c"remove a reference with the ID you supply from the database.\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [44 x i8] c"Press a key to continue, or H for more help\00"
define i32 @help() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 @move(i32 4, i32 0)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i32 @move(i32 14, i32 5)
%12 = tail call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 (...) @refresh()
%14 = tail call i32 (...) @cbreak()
%15 = tail call signext i8 (...) @getch()
%16 = tail call signext i8 @tolower(i8 signext %15)
%17 = icmp eq i8 %16, 104
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = tail call i32 (...) @general_help()
br label %20
20: ; preds = %18, %0
ret i32 undef
}