int pscreen(screen)
char *screen[];
{
  int line;
  int dbline;
  (void)move(1, 0);
  (void)clrtobot();
  dbline = 1;
  for (line = 0; screen[line]; line++) {
    (void)move(dbline++, 4);
    (void)addstr(screen[line]);
    (void)clrtoeol();
  }
  (void)move(0, 0);
  (void)printw("Which Screen? [a-n, q]");
  (void)clrtoeol();
  (void)refresh();
  return (nmgetch());
}


x86 assembly (clang, -O0):
<pscreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1090 <move@plt>
mov    $0x0,%al
call   1030 <clrtobot@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11f1 <pscreen+0x81>
mov    -0x10(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x4,%esi
mov    $0x0,%al
call   1090 <move@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1080 <addstr@plt>
mov    $0x0,%al
call   1070 <clrtoeol@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <pscreen+0x2f>
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1090 <move@plt>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    $0x0,%al
call   1070 <clrtoeol@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <nmgetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pscreen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1090 <move@plt>
xor    %eax,%eax
call   1030 <clrtobot@plt>
cmpq   $0x0,(%r14)
je     11cc <pscreen+0x5c>
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x4,%esi
xor    %eax,%eax
call   1090 <move@plt>
mov    -0x8(%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1080 <addstr@plt>
xor    %eax,%eax
call   1070 <clrtoeol@plt>
cmpq   $0x0,(%r14,%rbx,8)
lea    0x1(%rbx),%rbx
jne    11a0 <pscreen+0x30>
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1090 <move@plt>
lea    0xe22(%rip),%rdi
xor    %eax,%eax
call   1040 <printw@plt>
xor    %eax,%eax
call   1070 <clrtoeol@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <nmgetch@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Which Screen? [a-n, q]\00"
define i32 @pscreen(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 1, i32 0)
%6 = call i32 (...) @clrtobot()
store i32 1, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %25, %1
%8 = load i8**, i8*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %28
14: ; preds = %7
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %15, i32 4)
%18 = load i8**, i8*** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @addstr to i32 (i8*, ...)*)(i8* %22)
%24 = call i32 (...) @clrtoeol()
br label %25
25: ; preds = %14
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %7
28: ; preds = %7
%29 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%31 = call i32 (...) @clrtoeol()
%32 = call i32 (...) @refresh()
%33 = call i32 (...) @nmgetch()
ret i32 %33
}

LLVM IR (-O2):
@.str = [23 x i8] c"Which Screen? [a-n, q]\00"
define i32 @pscreen(i8** nocapture %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 1, i32 0)
%3 = tail call i32 (...) @clrtobot()
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %19, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %15, %6 ], [ 0, %1 ]
%8 = phi i8** [ %16, %6 ], [ %0, %1 ]
%9 = phi i32 [ %10, %6 ], [ 1, %1 ]
%10 = add nuw nsw i32 %9, 1
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %9, i32 4)
%12 = load i8*, i8** %8
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @addstr to i32 (i8*, ...)*)(i8* %12)
%14 = tail call i32 (...) @clrtoeol()
%15 = add nuw i64 %7, 1
%16 = getelementptr inbounds i8*, i8** %0, i64 %15
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %6
19: ; preds = %6, %1
%20 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
%21 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%22 = tail call i32 (...) @clrtoeol()
%23 = tail call i32 (...) @refresh()
%24 = tail call i32 (...) @nmgetch()
ret i32 %24
}