#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*/ page_init();
int print_lines(char *, int);
int help_page() {
  int cmd;
  page_init();
  if ((cmd = print_lines("Paging commands:\n", 1)) ||
      (cmd = print_lines(
           "\nSP	Display the next page.\nx	Display the next page "
           "decrypted (rot13).\nd	Display half a page more.\nCR	"
           "Display one more line.\n^R,v,^X	Restart the current article "
           "(v=verbose header, ^X=rot13).\n",
           0)) ||
      (cmd = print_lines(
           "^B	Back up one page.\n^L,X	Refresh the screen (X=rot13).\ng "
           "pat	Go to (search forward within article for) pattern.\nG	Search "
           "again for current pattern within article.\n^G	Search for "
           "next line beginning with \"Subject:\".\nTAB	Search for next line "
           "beginning with a different character.\nq	Quit the pager, go to "
           "end of article.  Leave article read or unread.\nj	Junk this "
           "article (mark it read).  Goes to end of article.\n\n",
           0)) ||
      (cmd = print_lines("The following commands skip the rest of the current "
                         "article, then behave\njust as if typed to the 'What "
                         "next?' prompt at the end of the article:\n",
                         1)) ||
      (cmd = print_lines(
           "\nn	Scan forward for next unread article.\nN	Go to next "
           "article.\n^N	Scan forward for next unread article with same "
           "title.\np,P,^P	Same as n,N,^N, only going "
           "backwards.\n-	Go to previously displayed article.\n\n",
           0)) ||
      (cmd = print_lines("The following commands also take you to the end of "
                         "the article.\nType h at end of article for a "
                         "description of these commands:\n",
                         1)) ||
      (cmd = print_lines("	# $ & / = ? c C f F k K ^K m M number r R ^R s "
                         "S u v w W Y ^ |\n\n(To return to the middle of the "
                         "article after one of these commands, type ^L.)\n",
                         0)))
    return cmd;
  return 0;
}


x86 assembly (clang, -O0):
<help_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <page_init@plt>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0xebf(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0xf64(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0x10e6(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0x115a(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0x120d(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    11ee <help_page+0xce>
lea    0x126f(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11f9 <help_page+0xd9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1200 <help_page+0xe0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_page>:
push   %rax
xor    %eax,%eax
call   1040 <page_init@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
jne    119d <help_page+0x7d>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
jne    119d <help_page+0x7d>
lea    0xf7b(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
jne    119d <help_page+0x7d>
lea    0x1105(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
jne    119d <help_page+0x7d>
lea    0x1181(%rip),%rdi
xor    %esi,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
jne    119d <help_page+0x7d>
lea    0x123c(%rip),%rdi
mov    $0x1,%esi
call   1030 <print_lines@plt>
test   %eax,%eax
je     119f <help_page+0x7f>
pop    %rcx
ret
lea    0x12a4(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <print_lines@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Paging commands:\0A\00"
@.str.1 = [191 x i8] c"\0ASP\09Display the next page.\0Ax\09Display the next page decrypted (rot13).\0Ad\09Display half a page more.\0ACR\09Display one more line.\0A^R,v,^X\09Restart the current article (v=verbose header, ^X=rot13).\0A\00"
@.str.2 = [412 x i8] c"^B\09Back up one page.\0A^L,X\09Refresh the screen (X=rot13).\0Ag pat\09Go to (search forward within article for) pattern.\0AG\09Search again for current pattern within article.\0A^G\09Search for next line beginning with \22Subject:\22.\0ATAB\09Search for next line beginning with a different character.\0Aq\09Quit the pager, go to end of article. Leave article read or unread.\0Aj\09Junk this article (mark it read). Goes to end of article.\0A\0A\00"
@.str.3 = [145 x i8] c"The following commands skip the rest of the current article, then behave\0Ajust as if typed to the 'What next?' prompt at the end of the article:\0A\00"
@.str.4 = [205 x i8] c"\0An\09Scan forward for next unread article.\0AN\09Go to next article.\0A^N\09Scan forward for next unread article with same title.\0Ap,P,^P\09Same as n,N,^N, only going backwards.\0A-\09Go to previously displayed article.\0A\0A\00"
@.str.5 = [127 x i8] c"The following commands also take you to the end of the article.\0AType h at end of article for a description of these commands:\0A\00"
@.str.6 = [145 x i8] c"\09# $ & / = ? c C f F k K ^K m M number r R ^R s S u v w W Y ^ |\0A\0A(To return to the middle of the article after one of these commands, type ^L.)\0A\00"
define i32 @help_page() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @page_init()
%4 = call i32 @print_lines(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %0
%7 = call i32 @print_lines(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str.1, i64 0, i64 0), i32 0)
store i32 %7, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %24, label %9
9: ; preds = %6
%10 = call i32 @print_lines(i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 %10, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %24, label %12
12: ; preds = %9
%13 = call i32 @print_lines(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.3, i64 0, i64 0), i32 1)
store i32 %13, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = call i32 @print_lines(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str.4, i64 0, i64 0), i32 0)
store i32 %16, i32* %2
%17 = icmp ne i32 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = call i32 @print_lines(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.5, i64 0, i64 0), i32 1)
store i32 %19, i32* %2
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = call i32 @print_lines(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.6, i64 0, i64 0), i32 0)
store i32 %22, i32* %2
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21, %18, %15, %12, %9, %6, %0
%25 = load i32, i32* %2
store i32 %25, i32* %1
br label %27
26: ; preds = %21
store i32 0, i32* %1
br label %27
27: ; preds = %26, %24
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [18 x i8] c"Paging commands:\0A\00"
@.str.1 = [191 x i8] c"\0ASP\09Display the next page.\0Ax\09Display the next page decrypted (rot13).\0Ad\09Display half a page more.\0ACR\09Display one more line.\0A^R,v,^X\09Restart the current article (v=verbose header, ^X=rot13).\0A\00"
@.str.2 = [412 x i8] c"^B\09Back up one page.\0A^L,X\09Refresh the screen (X=rot13).\0Ag pat\09Go to (search forward within article for) pattern.\0AG\09Search again for current pattern within article.\0A^G\09Search for next line beginning with \22Subject:\22.\0ATAB\09Search for next line beginning with a different character.\0Aq\09Quit the pager, go to end of article. Leave article read or unread.\0Aj\09Junk this article (mark it read). Goes to end of article.\0A\0A\00"
@.str.3 = [145 x i8] c"The following commands skip the rest of the current article, then behave\0Ajust as if typed to the 'What next?' prompt at the end of the article:\0A\00"
@.str.4 = [205 x i8] c"\0An\09Scan forward for next unread article.\0AN\09Go to next article.\0A^N\09Scan forward for next unread article with same title.\0Ap,P,^P\09Same as n,N,^N, only going backwards.\0A-\09Go to previously displayed article.\0A\0A\00"
@.str.5 = [127 x i8] c"The following commands also take you to the end of the article.\0AType h at end of article for a description of these commands:\0A\00"
@.str.6 = [145 x i8] c"\09# $ & / = ? c C f F k K ^K m M number r R ^R s S u v w W Y ^ |\0A\0A(To return to the middle of the article after one of these commands, type ^L.)\0A\00"
define i32 @help_page() {
%1 = tail call i32 (...) @page_init()
%2 = tail call i32 @print_lines(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %21
4: ; preds = %0
%5 = tail call i32 @print_lines(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = tail call i32 @print_lines(i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str.2, i64 0, i64 0), i32 0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = tail call i32 @print_lines(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.3, i64 0, i64 0), i32 1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = tail call i32 @print_lines(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str.4, i64 0, i64 0), i32 0)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = tail call i32 @print_lines(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.5, i64 0, i64 0), i32 1)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @print_lines(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %21
21: ; preds = %19, %0, %4, %7, %10, %13, %16
%22 = phi i32 [ %2, %0 ], [ %5, %4 ], [ %8, %7 ], [ %11, %10 ], [ %14, %13 ], [ %17, %16 ], [ %20, %19 ]
ret i32 %22
}