void tty_showboard(b) const char *b;
{
  int i;
  int line;
  clear();
  move(0, 0);
  line = 0;
  printw("+---+---+---+---+");
  move(++line, 0);
  for (i = 0; i < 16; i++) {
    if (b[i] == 'q')
      printw("| Qu");
    else
      printw("| %c ", toupper((unsigned char)b[i]));
    if ((i + 1) % 4 == 0) {
      printw("|");
      move(++line, 0);
      printw("+---+---+---+---+");
      move(++line, 0);
    }
  }
  move(0, 20);
  printw("Type '?' for help");
  refresh();
}


x86 assembly (clang, -O0):
<tty_showboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <clear@plt>
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1070 <move@plt>
movl   $0x0,-0x10(%rbp)
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x10(%rbp)
xor    %esi,%esi
mov    $0x0,%al
call   1070 <move@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1259 <tty_showboard+0x109>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x71,%eax
jne    11ce <tty_showboard+0x7e>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
jmp    11ef <tty_showboard+0x9f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1246 <tty_showboard+0xf6>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x10(%rbp)
xor    %esi,%esi
mov    $0x0,%al
call   1070 <move@plt>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x10(%rbp)
xor    %esi,%esi
mov    $0x0,%al
call   1070 <move@plt>
jmp    124b <tty_showboard+0xfb>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119c <tty_showboard+0x4c>
xor    %edi,%edi
mov    $0x14,%esi
mov    $0x0,%al
call   1070 <move@plt>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_showboard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
xor    %eax,%eax
call   1060 <clear@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <move@plt>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printw@plt>
mov    $0x1,%ebx
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <move@plt>
mov    $0x1,%r14d
lea    0xe74(%rip),%r12
lea    0xe78(%rip),%r13
lea    0xe6b(%rip),%rbp
jmp    11ba <tty_showboard+0x6a>
xchg   %ax,%ax
add    $0x1,%r14
cmp    $0x11,%r14
je     122b <tty_showboard+0xdb>
movzbl -0x1(%r15,%r14,1),%edi
cmp    $0x71,%edi
jne    11e0 <tty_showboard+0x90>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printw@plt>
test   $0x3,%r14b
jne    11b0 <tty_showboard+0x60>
jmp    11f7 <tty_showboard+0xa7>
nopw   0x0(%rax,%rax,1)
call   1030 <toupper@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printw@plt>
test   $0x3,%r14b
jne    11b0 <tty_showboard+0x60>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printw@plt>
lea    0x1(%rbx),%edi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <move@plt>
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1040 <printw@plt>
add    $0x2,%ebx
mov    %ebx,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <move@plt>
jmp    11b0 <tty_showboard+0x60>
xor    %edi,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1070 <move@plt>
lea    0xddf(%rip),%rdi
xor    %eax,%eax
call   1040 <printw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"+---+---+---+---+\00"
@.str.1 = [5 x i8] c"| Qu\00"
@.str.2 = [6 x i8] c"| %c \00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [18 x i8] c"Type '?' for help\00"
define void @tty_showboard(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 (...) @clear()
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
store i32 0, i32* %4
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %9, i32 0)
store i32 0, i32* %3
br label %11
11: ; preds = %48, %1
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %51
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 113
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %33
24: ; preds = %14
%25 = load i8*, i8** %2
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = call i32 @toupper(i32 %30)
%32 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @printw to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %24, %22
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
%36 = srem i32 %35, 4
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %47
38: ; preds = %33
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
%42 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %41, i32 0)
%43 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
%46 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %45, i32 0)
br label %47
47: ; preds = %38, %33
br label %48
48: ; preds = %47
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %11
51: ; preds = %11
%52 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 20)
%53 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"+---+---+---+---+\00"
@.str.1 = [5 x i8] c"| Qu\00"
@.str.2 = [6 x i8] c"| %c \00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [18 x i8] c"Type '?' for help\00"
define void @tty_showboard(i8* nocapture %0) {
%2 = tail call i32 (...) @clear()
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 1, i32 0)
br label %6
6: ; preds = %1, %29
%7 = phi i64 [ 0, %1 ], [ %19, %29 ]
%8 = phi i32 [ 1, %1 ], [ %30, %29 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 113
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %18
14: ; preds = %6
%15 = zext i8 %10 to i32
%16 = tail call i32 @toupper(i32 %15)
%17 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @printw to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %12
%19 = add nuw nsw i64 %7, 1
%20 = and i64 %19, 3
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %18
%23 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = add nsw i32 %8, 1
%25 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %24, i32 0)
%26 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%27 = add nsw i32 %8, 2
%28 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %27, i32 0)
br label %29
29: ; preds = %18, %22
%30 = phi i32 [ %27, %22 ], [ %8, %18 ]
%31 = icmp eq i64 %19, 16
br i1 %31, label %32, label %6
32: ; preds = %29
%33 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 20)
%34 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%35 = tail call i32 (...) @refresh()
ret void
}