#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*/ gerase(int /*<<< orphan*/);
int /*<<< orphan*/ gmove(int, int);
int /*<<< orphan*/ gputs(char *);
void readerscr(int mode) {
  gerase(0);
  gmove(20, 2);
  if (mode)
    gputs("Mail:  (v)iew current  (d)elete  ");
  else
    gputs("News:  (v)iew current  ");
  gputs("(j)down  (k)up  (n)ext  (p)revious");
  gmove(21, 2);
  gputs("Press SPACE to Exit.");
}


x86 assembly (clang, -O0):
<readerscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <gerase@plt>
mov    $0x14,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
cmpl   $0x0,-0x4(%rbp)
je     116c <readerscr+0x3c>
lea    0xe9e(%rip),%rdi
call   1040 <gputs@plt>
jmp    1178 <readerscr+0x48>
lea    0xeaf(%rip),%rdi
call   1040 <gputs@plt>
lea    0xebb(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
lea    0xec3(%rip),%rdi
call   1040 <gputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readerscr>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <gerase@plt>
mov    $0x14,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
test   %ebx,%ebx
lea    0xed0(%rip),%rax
lea    0xea7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <gputs@plt>
lea    0xed1(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
lea    0xed9(%rip),%rdi
pop    %rbx
jmp    1040 <gputs@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Mail: (v)iew current (d)elete \00"
@.str.1 = [24 x i8] c"News: (v)iew current \00"
@.str.2 = [35 x i8] c"(j)down (k)up (n)ext (p)revious\00"
@.str.3 = [21 x i8] c"Press SPACE to Exit.\00"
define void @readerscr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gerase(i32 0)
%4 = call i32 @gmove(i32 20, i32 2)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @gputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @gputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = call i32 @gputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @gmove(i32 21, i32 2)
%14 = call i32 @gputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Mail: (v)iew current (d)elete \00"
@.str.1 = [24 x i8] c"News: (v)iew current \00"
@.str.2 = [35 x i8] c"(j)down (k)up (n)ext (p)revious\00"
@.str.3 = [21 x i8] c"Press SPACE to Exit.\00"
define void @readerscr(i32 %0) {
%2 = tail call i32 @gerase(i32 0)
%3 = tail call i32 @gmove(i32 20, i32 2)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @gputs(i8* %5)
%7 = tail call i32 @gputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @gmove(i32 21, i32 2)
%9 = tail call i32 @gputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret void
}