#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 viewerscr(int mode) {
  gerase(0);
  gmove(20, 2);
  if (mode)
    gputs("Mail:  (d)elete  ");
  else
    gputs("News:  ");
  gputs("(j)down  (k)up");
  gmove(21, 2);
  gputs("Press SPACE to Exit.");
  gmove(21, 70);
  gputs("< >");
}


x86 assembly (clang, -O0):
<viewerscr>:
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 <viewerscr+0x3c>
lea    0xe9e(%rip),%rdi
call   1040 <gputs@plt>
jmp    1178 <viewerscr+0x48>
lea    0xe9f(%rip),%rdi
call   1040 <gputs@plt>
lea    0xe9b(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
lea    0xe8f(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x46,%esi
call   1050 <gmove@plt>
lea    0xe89(%rip),%rdi
call   1040 <gputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewerscr>:
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    0xec0(%rip),%rax
lea    0xea7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <gputs@plt>
lea    0xeb1(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x2,%esi
call   1050 <gmove@plt>
lea    0xea5(%rip),%rdi
call   1040 <gputs@plt>
mov    $0x15,%edi
mov    $0x46,%esi
call   1050 <gmove@plt>
lea    0xe9f(%rip),%rdi
pop    %rbx
jmp    1040 <gputs@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Mail: (d)elete \00"
@.str.1 = [8 x i8] c"News: \00"
@.str.2 = [15 x i8] c"(j)down (k)up\00"
@.str.3 = [21 x i8] c"Press SPACE to Exit.\00"
@.str.4 = [4 x i8] c"< >\00"
define void @viewerscr(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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @gputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 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))
%15 = call i32 @gmove(i32 21, i32 70)
%16 = call i32 @gputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Mail: (d)elete \00"
@.str.1 = [8 x i8] c"News: \00"
@.str.2 = [15 x i8] c"(j)down (k)up\00"
@.str.3 = [21 x i8] c"Press SPACE to Exit.\00"
@.str.4 = [4 x i8] c"< >\00"
define void @viewerscr(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 ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @gputs(i8* %5)
%7 = tail call i32 @gputs(i8* getelementptr inbounds ([15 x i8], [15 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))
%10 = tail call i32 @gmove(i32 21, i32 70)
%11 = tail call i32 @gputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}