#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 */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ waddch(int /*<<< orphan*/ *, char);
void print_table_row(WINDOW *w, bool empty) {
  assert(w);
  waddch(w, empty ? '|' : '+');
  for (size_t cell = 0; cell < 4; ++cell) {
    for (size_t ch = 0; ch < 8; ++ch) {
      waddch(w, empty ? ' ' : '-');
    }
    waddch(w, empty ? '|' : '+');
  }
}


x86 assembly (clang, -O0):
<print_table_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2b,%eax
mov    $0x7c,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%esi
call   1030 <waddch@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x4,-0x18(%rbp)
jae    11dd <print_table_row+0xbd>
movq   $0x0,-0x20(%rbp)
cmpq   $0x8,-0x20(%rbp)
jae    11ad <print_table_row+0x8d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2d,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%esi
call   1030 <waddch@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1172 <print_table_row+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2b,%eax
mov    $0x7c,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%esi
call   1030 <waddch@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115f <print_table_row+0x3f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table_row>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <assert@plt>
test   %ebp,%ebp
mov    $0x2b,%eax
mov    $0x7c,%r14d
cmove  %eax,%r14d
mov    $0x2d,%eax
mov    $0x20,%ebp
cmove  %eax,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <waddch@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <waddch@plt>

LLVM IR (-O0):
define void @print_table_row(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 124, i32 43
%14 = trunc i32 %13 to i8
%15 = call i32 @waddch(i32* %9, i8 signext %14)
store i64 0, i64* %5
br label %16
16: ; preds = %42, %2
%17 = load i64, i64* %5
%18 = icmp ult i64 %17, 4
br i1 %18, label %19, label %45
19: ; preds = %16
store i64 0, i64* %6
br label %20
20: ; preds = %31, %19
%21 = load i64, i64* %6
%22 = icmp ult i64 %21, 8
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = load i32*, i32** %3
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 32, i32 45
%29 = trunc i32 %28 to i8
%30 = call i32 @waddch(i32* %24, i8 signext %29)
br label %31
31: ; preds = %23
%32 = load i64, i64* %6
%33 = add i64 %32, 1
store i64 %33, i64* %6
br label %20
34: ; preds = %20
%35 = load i32*, i32** %3
%36 = load i32, i32* %4
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i64
%39 = select i1 %37, i32 124, i32 43
%40 = trunc i32 %39 to i8
%41 = call i32 @waddch(i32* %35, i8 signext %40)
br label %42
42: ; preds = %34
%43 = load i64, i64* %5
%44 = add i64 %43, 1
store i64 %44, i64* %5
br label %16
45: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @print_table_row(i32* %0, i32 %1) {
%3 = tail call i32 @assert(i32* %0)
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8 43, i8 124
%6 = tail call i32 @waddch(i32* %0, i8 signext %5)
%7 = select i1 %4, i8 45, i8 32
%8 = tail call i32 @waddch(i32* %0, i8 signext %7)
%9 = tail call i32 @waddch(i32* %0, i8 signext %7)
%10 = tail call i32 @waddch(i32* %0, i8 signext %7)
%11 = tail call i32 @waddch(i32* %0, i8 signext %7)
%12 = tail call i32 @waddch(i32* %0, i8 signext %7)
%13 = tail call i32 @waddch(i32* %0, i8 signext %7)
%14 = tail call i32 @waddch(i32* %0, i8 signext %7)
%15 = tail call i32 @waddch(i32* %0, i8 signext %7)
%16 = tail call i32 @waddch(i32* %0, i8 signext %5)
%17 = tail call i32 @waddch(i32* %0, i8 signext %7)
%18 = tail call i32 @waddch(i32* %0, i8 signext %7)
%19 = tail call i32 @waddch(i32* %0, i8 signext %7)
%20 = tail call i32 @waddch(i32* %0, i8 signext %7)
%21 = tail call i32 @waddch(i32* %0, i8 signext %7)
%22 = tail call i32 @waddch(i32* %0, i8 signext %7)
%23 = tail call i32 @waddch(i32* %0, i8 signext %7)
%24 = tail call i32 @waddch(i32* %0, i8 signext %7)
%25 = tail call i32 @waddch(i32* %0, i8 signext %5)
%26 = tail call i32 @waddch(i32* %0, i8 signext %7)
%27 = tail call i32 @waddch(i32* %0, i8 signext %7)
%28 = tail call i32 @waddch(i32* %0, i8 signext %7)
%29 = tail call i32 @waddch(i32* %0, i8 signext %7)
%30 = tail call i32 @waddch(i32* %0, i8 signext %7)
%31 = tail call i32 @waddch(i32* %0, i8 signext %7)
%32 = tail call i32 @waddch(i32* %0, i8 signext %7)
%33 = tail call i32 @waddch(i32* %0, i8 signext %7)
%34 = tail call i32 @waddch(i32* %0, i8 signext %5)
%35 = tail call i32 @waddch(i32* %0, i8 signext %7)
%36 = tail call i32 @waddch(i32* %0, i8 signext %7)
%37 = tail call i32 @waddch(i32* %0, i8 signext %7)
%38 = tail call i32 @waddch(i32* %0, i8 signext %7)
%39 = tail call i32 @waddch(i32* %0, i8 signext %7)
%40 = tail call i32 @waddch(i32* %0, i8 signext %7)
%41 = tail call i32 @waddch(i32* %0, i8 signext %7)
%42 = tail call i32 @waddch(i32* %0, i8 signext %7)
%43 = tail call i32 @waddch(i32* %0, i8 signext %5)
ret void
}