#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*/ ACS_LLCORNER;
int /*<<< orphan*/ ACS_LRCORNER;
int /*<<< orphan*/ ACS_ULCORNER;
int /*<<< orphan*/ ACS_URCORNER;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(int, int, int /*<<< orphan*/);
int draw_boarder() {
  attron(COLOR_PAIR(1));
  int i, j;
  for (i = 1; i < 19 + 1; i++) {
    mvaddch(i + 1, 0, ACS_VLINE);
    mvaddch(i + 1, 78 + 1, ACS_VLINE);
  }
  for (j = 1; j < 78 + 1; j++) {
    mvaddch(0 + 1, j, ACS_HLINE);
    mvaddch(19 + 1 + 1, j, ACS_HLINE);
  }
  mvaddch(0 + 1, 0, ACS_ULCORNER);
  mvaddch(0 + 1, 78 + 1, ACS_URCORNER);
  mvaddch(19 + 1 + 1, 0, ACS_LLCORNER);
  mvaddch(19 + 1 + 1, 78 + 1, ACS_LRCORNER);
  attroff(COLOR_PAIR(1));
  return 0;
}


x86 assembly (clang, -O0):
<draw_boarder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    11a7 <draw_boarder+0x67>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2e49(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2e33(%rip),%rax
mov    (%rax),%edx
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <draw_boarder+0x20>
movl   $0x1,-0x8(%rbp)
cmpl   $0x4f,-0x8(%rbp)
jge    11f2 <draw_boarder+0xb2>
mov    -0x8(%rbp),%esi
mov    0x2e06(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1060 <mvaddch@plt>
mov    -0x8(%rbp),%esi
mov    0x2df0(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
call   1060 <mvaddch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ae <draw_boarder+0x6e>
mov    0x2def(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_boarder>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    $0x2,%ebx
mov    0x2e5f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    (%r14),%edx
mov    %ebx,%edi
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1170 <draw_boarder+0x30>
mov    $0x1,%ebx
mov    0x2e29(%rip),%r14
nop
mov    (%r14),%edx
mov    $0x1,%edi
mov    %ebx,%esi
call   1060 <mvaddch@plt>
mov    (%r14),%edx
mov    $0x15,%edi
mov    %ebx,%esi
call   1060 <mvaddch@plt>
add    $0x1,%ebx
cmp    $0x4f,%ebx
jne    11a0 <draw_boarder+0x60>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    0x2dee(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
xor    %esi,%esi
call   1060 <mvaddch@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
mov    $0x4f,%esi
call   1060 <mvaddch@plt>
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
define i32 @draw_boarder() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @COLOR_PAIR(i32 1)
%4 = call i32 @attron(i32 %3)
store i32 1, i32* %1
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
%11 = load i32, i32* @ACS_VLINE
%12 = call i32 @mvaddch(i32 %10, i32 0, i32 %11)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
%15 = load i32, i32* @ACS_VLINE
%16 = call i32 @mvaddch(i32 %14, i32 79, i32 %15)
br label %17
17: ; preds = %8
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %5
20: ; preds = %5
store i32 1, i32* %2
br label %21
21: ; preds = %31, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 79
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load i32, i32* %2
%26 = load i32, i32* @ACS_HLINE
%27 = call i32 @mvaddch(i32 1, i32 %25, i32 %26)
%28 = load i32, i32* %2
%29 = load i32, i32* @ACS_HLINE
%30 = call i32 @mvaddch(i32 21, i32 %28, i32 %29)
br label %31
31: ; preds = %24
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %21
34: ; preds = %21
%35 = load i32, i32* @ACS_ULCORNER
%36 = call i32 @mvaddch(i32 1, i32 0, i32 %35)
%37 = load i32, i32* @ACS_URCORNER
%38 = call i32 @mvaddch(i32 1, i32 79, i32 %37)
%39 = load i32, i32* @ACS_LLCORNER
%40 = call i32 @mvaddch(i32 21, i32 0, i32 %39)
%41 = load i32, i32* @ACS_LRCORNER
%42 = call i32 @mvaddch(i32 21, i32 79, i32 %41)
%43 = call i32 @COLOR_PAIR(i32 1)
%44 = call i32 @attroff(i32 %43)
ret i32 0
}

LLVM IR (-O2):
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
define i32 @draw_boarder() {
%1 = tail call i32 @COLOR_PAIR(i32 1)
%2 = tail call i32 @attron(i32 %1)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = load i32, i32* @ACS_VLINE
%7 = tail call i32 @mvaddch(i32 %5, i32 0, i32 %6)
%8 = load i32, i32* @ACS_VLINE
%9 = tail call i32 @mvaddch(i32 %5, i32 79, i32 %8)
%10 = icmp eq i32 %5, 20
br i1 %10, label %11, label %3
11: ; preds = %3, %11
%12 = phi i32 [ %17, %11 ], [ 1, %3 ]
%13 = load i32, i32* @ACS_HLINE
%14 = tail call i32 @mvaddch(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @ACS_HLINE
%16 = tail call i32 @mvaddch(i32 21, i32 %12, i32 %15)
%17 = add nuw nsw i32 %12, 1
%18 = icmp eq i32 %17, 79
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = load i32, i32* @ACS_ULCORNER
%21 = tail call i32 @mvaddch(i32 1, i32 0, i32 %20)
%22 = load i32, i32* @ACS_URCORNER
%23 = tail call i32 @mvaddch(i32 1, i32 79, i32 %22)
%24 = load i32, i32* @ACS_LLCORNER
%25 = tail call i32 @mvaddch(i32 21, i32 0, i32 %24)
%26 = load i32, i32* @ACS_LRCORNER
%27 = tail call i32 @mvaddch(i32 21, i32 79, i32 %26)
%28 = tail call i32 @COLOR_PAIR(i32 1)
%29 = tail call i32 @attroff(i32 %28)
ret i32 0
}