#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*/ ACS_HLINE;
int /*<<< orphan*/ COLS;
int LINES;
int /*<<< orphan*/ color_set(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ hline(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvhline(int, int /*<<< orphan*/, char, int);
int base_mask(void) {
  register int i;
  int pos;
  color_set(1, NULL);
  move(2, 0);
  hline(ACS_HLINE, COLS);
  move(LINES - 4, 0);
  hline(ACS_HLINE, COLS);
  move(LINES - 2, 0);
  hline(ACS_HLINE, COLS);
  color_set(0, NULL);
  for (i = 3; i < (LINES - 4); i++) {
    mvhline(i, 0, ' ', 80);
  }
  return 0;
}


x86 assembly (clang, -O0):
<base_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <color_set@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
call   1040 <hline@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
sub    $0x4,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    0x2e44(%rip),%rax
mov    (%rax),%esi
call   1040 <hline@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
sub    $0x2,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
call   1040 <hline@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <color_set@plt>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2dff(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    1218 <base_mask+0xd8>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x50,%ecx
call   1030 <mvhline@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11df <base_mask+0x9f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_mask>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <color_set@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e6c(%rip),%r15
mov    (%r15),%edi
mov    0x2e72(%rip),%rbx
mov    (%rbx),%esi
call   1040 <hline@plt>
mov    0x2e6c(%rip),%r14
mov    (%r14),%edi
add    $0xfffffffc,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    (%r15),%edi
mov    (%rbx),%esi
call   1040 <hline@plt>
mov    (%r14),%edi
add    $0xfffffffe,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    (%r15),%edi
mov    (%rbx),%esi
call   1040 <hline@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <color_set@plt>
cmpl   $0x8,(%r14)
jl     11e0 <base_mask+0xa0>
mov    $0x3,%ebx
xchg   %ax,%ax
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x20,%edx
mov    $0x50,%ecx
call   1030 <mvhline@plt>
add    $0x1,%ebx
mov    (%r14),%eax
add    $0xfffffffc,%eax
cmp    %eax,%ebx
jl     11c0 <base_mask+0x80>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@ACS_HLINE = global i32 0
@COLS = global i32 0
@LINES = global i32 0
define i32 @base_mask() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @color_set(i32 1, i32* null)
%4 = call i32 @move(i32 2, i32 0)
%5 = load i32, i32* @ACS_HLINE
%6 = load i32, i32* @COLS
%7 = call i32 @hline(i32 %5, i32 %6)
%8 = load i32, i32* @LINES
%9 = sub nsw i32 %8, 4
%10 = call i32 @move(i32 %9, i32 0)
%11 = load i32, i32* @ACS_HLINE
%12 = load i32, i32* @COLS
%13 = call i32 @hline(i32 %11, i32 %12)
%14 = load i32, i32* @LINES
%15 = sub nsw i32 %14, 2
%16 = call i32 @move(i32 %15, i32 0)
%17 = load i32, i32* @ACS_HLINE
%18 = load i32, i32* @COLS
%19 = call i32 @hline(i32 %17, i32 %18)
%20 = call i32 @color_set(i32 0, i32* null)
store i32 3, i32* %1
br label %21
21: ; preds = %29, %0
%22 = load i32, i32* %1
%23 = load i32, i32* @LINES
%24 = sub nsw i32 %23, 4
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %32
26: ; preds = %21
%27 = load i32, i32* %1
%28 = call i32 @mvhline(i32 %27, i32 0, i8 signext 32, i32 80)
br label %29
29: ; preds = %26
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %21
32: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@ACS_HLINE = global i32 0
@COLS = global i32 0
@LINES = global i32 0
define i32 @base_mask() {
%1 = tail call i32 @color_set(i32 1, i32* null)
%2 = tail call i32 @move(i32 2, i32 0)
%3 = load i32, i32* @ACS_HLINE
%4 = load i32, i32* @COLS
%5 = tail call i32 @hline(i32 %3, i32 %4)
%6 = load i32, i32* @LINES
%7 = add nsw i32 %6, -4
%8 = tail call i32 @move(i32 %7, i32 0)
%9 = load i32, i32* @ACS_HLINE
%10 = load i32, i32* @COLS
%11 = tail call i32 @hline(i32 %9, i32 %10)
%12 = load i32, i32* @LINES
%13 = add nsw i32 %12, -2
%14 = tail call i32 @move(i32 %13, i32 0)
%15 = load i32, i32* @ACS_HLINE
%16 = load i32, i32* @COLS
%17 = tail call i32 @hline(i32 %15, i32 %16)
%18 = tail call i32 @color_set(i32 0, i32* null)
%19 = load i32, i32* @LINES
%20 = icmp sgt i32 %19, 7
br i1 %20, label %21, label %28
21: ; preds = %0, %21
%22 = phi i32 [ %24, %21 ], [ 3, %0 ]
%23 = tail call i32 @mvhline(i32 %22, i32 0, i8 signext 32, i32 80)
%24 = add nuw nsw i32 %22, 1
%25 = load i32, i32* @LINES
%26 = add nsw i32 %25, -4
%27 = icmp slt i32 %24, %26
br i1 %27, label %21, label %28
28: ; preds = %21, %0
ret i32 0
}