#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*/ mvaddch(int, int, int /*<<< orphan*/);
void draw_boarder() {
  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);
}


x86 assembly (clang, -O0):
<draw_boarder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1166 <draw_boarder+0x56>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
mov    $0x4f,%esi
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <draw_boarder+0xf>
movl   $0x1,-0x8(%rbp)
cmpl   $0x4f,-0x8(%rbp)
jge    11b1 <draw_boarder+0xa1>
mov    -0x8(%rbp),%esi
mov    0x2e47(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <mvaddch@plt>
mov    -0x8(%rbp),%esi
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
call   1030 <mvaddch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116d <draw_boarder+0x5d>
mov    0x2e30(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
mov    $0x4f,%esi
call   1030 <mvaddch@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
mov    $0x4f,%esi
call   1030 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_boarder>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
mov    0x2ea0(%rip),%r14
mov    (%r14),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    (%r14),%edx
mov    %ebx,%edi
mov    $0x4f,%esi
call   1030 <mvaddch@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1120 <draw_boarder+0x10>
mov    $0x1,%ebx
mov    0x2e79(%rip),%r14
nop
mov    (%r14),%edx
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <mvaddch@plt>
mov    (%r14),%edx
mov    $0x15,%edi
mov    %ebx,%esi
call   1030 <mvaddch@plt>
add    $0x1,%ebx
cmp    $0x4f,%ebx
jne    1150 <draw_boarder+0x40>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
mov    $0x4f,%esi
call   1030 <mvaddch@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <mvaddch@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edx
mov    $0x15,%edi
mov    $0x4f,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mvaddch@plt>

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

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 void @draw_boarder() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = load i32, i32* @ACS_VLINE
%5 = tail call i32 @mvaddch(i32 %3, i32 0, i32 %4)
%6 = load i32, i32* @ACS_VLINE
%7 = tail call i32 @mvaddch(i32 %3, i32 79, i32 %6)
%8 = icmp eq i32 %3, 20
br i1 %8, label %9, label %1
9: ; preds = %1, %9
%10 = phi i32 [ %15, %9 ], [ 1, %1 ]
%11 = load i32, i32* @ACS_HLINE
%12 = tail call i32 @mvaddch(i32 1, i32 %10, i32 %11)
%13 = load i32, i32* @ACS_HLINE
%14 = tail call i32 @mvaddch(i32 21, i32 %10, i32 %13)
%15 = add nuw nsw i32 %10, 1
%16 = icmp eq i32 %15, 79
br i1 %16, label %17, label %9
17: ; preds = %9
%18 = load i32, i32* @ACS_ULCORNER
%19 = tail call i32 @mvaddch(i32 1, i32 0, i32 %18)
%20 = load i32, i32* @ACS_URCORNER
%21 = tail call i32 @mvaddch(i32 1, i32 79, i32 %20)
%22 = load i32, i32* @ACS_LLCORNER
%23 = tail call i32 @mvaddch(i32 21, i32 0, i32 %22)
%24 = load i32, i32* @ACS_LRCORNER
%25 = tail call i32 @mvaddch(i32 21, i32 79, i32 %24)
ret void
}