#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_BTEE;
int /*<<< orphan*/ ACS_TTEE;
int /*<<< orphan*/ ACS_VLINE;
scalar_t__ LINES;
int /*<<< orphan*/ box(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(scalar_t__, int, int /*<<< orphan*/);
int /*<<< orphan*/ mvvline(int, int, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ stdscr;
void draw_borders(void) {
  box(stdscr, 0, 0);
  mvaddch(0, 16 + 6 + 2, ACS_TTEE);
  mvvline(1, 16 + 6 + 2, ACS_VLINE, LINES - 2);
  mvaddch(LINES - 1, 16 + 6 + 2, ACS_BTEE);
}


x86 assembly (clang, -O0):
<draw_borders>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <box@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x18,%esi
call   1050 <mvaddch@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edx
mov    0x2e7b(%rip),%rax
mov    (%rax),%rcx
sub    $0x2,%rcx
mov    $0x1,%edi
mov    $0x18,%esi
call   1040 <mvvline@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    0x2e48(%rip),%rax
mov    (%rax),%edx
mov    $0x18,%esi
call   1050 <mvaddch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_borders>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <box@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
mov    $0x18,%esi
call   1050 <mvaddch@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edx
mov    0x2e80(%rip),%rbx
mov    (%rbx),%rcx
add    $0xfffffffffffffffe,%rcx
mov    $0x1,%edi
mov    $0x18,%esi
call   1040 <mvvline@plt>
mov    (%rbx),%rdi
add    $0xffffffffffffffff,%rdi
mov    0x2e54(%rip),%rax
mov    (%rax),%edx
mov    $0x18,%esi
pop    %rbx
jmp    1050 <mvaddch@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@ACS_TTEE = global i32 0
@ACS_VLINE = global i32 0
@LINES = global i64 0
@ACS_BTEE = global i32 0
define void @draw_borders() {
%1 = load i32, i32* @stdscr
%2 = call i32 @box(i32 %1, i32 0, i32 0)
%3 = load i32, i32* @ACS_TTEE
%4 = call i32 @mvaddch(i64 0, i32 24, i32 %3)
%5 = load i32, i32* @ACS_VLINE
%6 = load i64, i64* @LINES
%7 = sub nsw i64 %6, 2
%8 = call i32 @mvvline(i32 1, i32 24, i32 %5, i64 %7)
%9 = load i64, i64* @LINES
%10 = sub nsw i64 %9, 1
%11 = load i32, i32* @ACS_BTEE
%12 = call i32 @mvaddch(i64 %10, i32 24, i32 %11)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@ACS_TTEE = global i32 0
@ACS_VLINE = global i32 0
@LINES = global i64 0
@ACS_BTEE = global i32 0
define void @draw_borders() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @box(i32 %1, i32 0, i32 0)
%3 = load i32, i32* @ACS_TTEE
%4 = tail call i32 @mvaddch(i64 0, i32 24, i32 %3)
%5 = load i32, i32* @ACS_VLINE
%6 = load i64, i64* @LINES
%7 = add nsw i64 %6, -2
%8 = tail call i32 @mvvline(i32 1, i32 24, i32 %5, i64 %7)
%9 = load i64, i64* @LINES
%10 = add nsw i64 %9, -1
%11 = load i32, i32* @ACS_BTEE
%12 = tail call i32 @mvaddch(i64 %10, i32 24, i32 %11)
ret void
}