#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*/ A_BOLD;
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ mvhline(int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ mvvline(int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void limbs_create_border(int stop_h, int stop_w, int start_h, int start_w) {
  int max_h, max_w, center_h, center_w;
  init_pair(8, COLOR_BLACK, COLOR_BLACK);
  getmaxyx(stdscr, max_h, max_w);
  attron(COLOR_PAIR(8));
  attron(A_BOLD);
  mvaddch(start_h, start_w, ACS_ULCORNER);
  mvaddch(start_h, stop_w, ACS_URCORNER);
  mvaddch(stop_h, start_w, ACS_LLCORNER);
  mvaddch(stop_h, stop_w, ACS_LRCORNER);
  mvhline(start_h, (start_w + 1), ACS_HLINE, (stop_w - start_w - 1));
  mvhline(stop_h, (start_w + 1), ACS_HLINE, (stop_w - start_w - 1));
  mvvline((start_h + 1), start_w, ACS_VLINE, (stop_h - start_h - 1));
  mvvline((start_h + 1), stop_w, ACS_VLINE, (stop_h - start_h - 1));
  attroff(COLOR_PAIR(8));
  attroff(A_BOLD);
  refresh();
}


x86 assembly (clang, -O0):
<limbs_create_border>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2e25(%rip),%rax
mov    (%rax),%esi
mov    0x2e1c(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
call   1040 <init_pair@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1060 <getmaxyx@plt>
mov    $0x8,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
call   1050 <attron@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x2de8(%rip),%rax
mov    (%rax),%edx
call   10b0 <mvaddch@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2dac(%rip),%rax
mov    (%rax),%edx
call   10b0 <mvaddch@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x2d70(%rip),%rax
mov    (%rax),%edx
call   10b0 <mvaddch@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2da4(%rip),%rax
mov    (%rax),%edx
call   10b0 <mvaddch@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    0x2d65(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
sub    $0x1,%ecx
call   1090 <mvhline@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    0x2d45(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
sub    $0x1,%ecx
call   1090 <mvhline@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%esi
mov    0x2d15(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
call   10a0 <mvvline@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    0x2cf5(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
call   10a0 <mvvline@plt>
mov    $0x8,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limbs_create_border>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%r15d
mov    0x2e23(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
mov    %edx,%esi
call   1040 <init_pair@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
call   1060 <getmaxyx@plt>
mov    $0x8,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
call   1050 <attron@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edx
mov    %r14d,%edi
mov    %r12d,%esi
call   10b0 <mvaddch@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
mov    %r14d,%edi
mov    %ebx,0x4(%rsp)
mov    %ebx,%esi
call   10b0 <mvaddch@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    %r12d,%esi
call   10b0 <mvaddch@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    %ebx,%esi
call   10b0 <mvaddch@plt>
lea    0x1(%r12),%r13d
mov    0x2d72(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%ebp
not    %ebp
add    %ebx,%ebp
mov    %r14d,%edi
mov    %r13d,%esi
mov    %ebp,%ecx
call   1090 <mvhline@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    %r13d,%esi
mov    %ebp,%ecx
call   1090 <mvhline@plt>
lea    0x1(%r14),%ebp
mov    0x2d2b(%rip),%rbx
mov    (%rbx),%edx
not    %r14d
add    %r15d,%r14d
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r14d,%ecx
call   10a0 <mvvline@plt>
mov    (%rbx),%edx
mov    %ebp,%edi
mov    0x4(%rsp),%esi
mov    %r14d,%ecx
call   10a0 <mvvline@plt>
mov    $0x8,%edi
call   1070 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <refresh@plt>

LLVM IR (-O0):
@COLOR_BLACK = global i32 0
@stdscr = global i32 0
@A_BOLD = global i32 0
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
@ACS_HLINE = global i32 0
@ACS_VLINE = global i32 0
define void @limbs_create_border(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* @COLOR_BLACK
%14 = load i32, i32* @COLOR_BLACK
%15 = call i32 @init_pair(i32 8, i32 %13, i32 %14)
%16 = load i32, i32* @stdscr
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @getmaxyx(i32 %16, i32 %17, i32 %18)
%20 = call i32 @COLOR_PAIR(i32 8)
%21 = call i32 @attron(i32 %20)
%22 = load i32, i32* @A_BOLD
%23 = call i32 @attron(i32 %22)
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = load i32, i32* @ACS_ULCORNER
%27 = call i32 @mvaddch(i32 %24, i32 %25, i32 %26)
%28 = load i32, i32* %7
%29 = load i32, i32* %6
%30 = load i32, i32* @ACS_URCORNER
%31 = call i32 @mvaddch(i32 %28, i32 %29, i32 %30)
%32 = load i32, i32* %5
%33 = load i32, i32* %8
%34 = load i32, i32* @ACS_LLCORNER
%35 = call i32 @mvaddch(i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = load i32, i32* @ACS_LRCORNER
%39 = call i32 @mvaddch(i32 %36, i32 %37, i32 %38)
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
%43 = load i32, i32* @ACS_HLINE
%44 = load i32, i32* %6
%45 = load i32, i32* %8
%46 = sub nsw i32 %44, %45
%47 = sub nsw i32 %46, 1
%48 = call i32 @mvhline(i32 %40, i32 %42, i32 %43, i32 %47)
%49 = load i32, i32* %5
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
%52 = load i32, i32* @ACS_HLINE
%53 = load i32, i32* %6
%54 = load i32, i32* %8
%55 = sub nsw i32 %53, %54
%56 = sub nsw i32 %55, 1
%57 = call i32 @mvhline(i32 %49, i32 %51, i32 %52, i32 %56)
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
%60 = load i32, i32* %8
%61 = load i32, i32* @ACS_VLINE
%62 = load i32, i32* %5
%63 = load i32, i32* %7
%64 = sub nsw i32 %62, %63
%65 = sub nsw i32 %64, 1
%66 = call i32 @mvvline(i32 %59, i32 %60, i32 %61, i32 %65)
%67 = load i32, i32* %7
%68 = add nsw i32 %67, 1
%69 = load i32, i32* %6
%70 = load i32, i32* @ACS_VLINE
%71 = load i32, i32* %5
%72 = load i32, i32* %7
%73 = sub nsw i32 %71, %72
%74 = sub nsw i32 %73, 1
%75 = call i32 @mvvline(i32 %68, i32 %69, i32 %70, i32 %74)
%76 = call i32 @COLOR_PAIR(i32 8)
%77 = call i32 @attroff(i32 %76)
%78 = load i32, i32* @A_BOLD
%79 = call i32 @attroff(i32 %78)
%80 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@COLOR_BLACK = global i32 0
@stdscr = global i32 0
@A_BOLD = global i32 0
@ACS_ULCORNER = global i32 0
@ACS_URCORNER = global i32 0
@ACS_LLCORNER = global i32 0
@ACS_LRCORNER = global i32 0
@ACS_HLINE = global i32 0
@ACS_VLINE = global i32 0
define void @limbs_create_border(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @COLOR_BLACK
%6 = tail call i32 @init_pair(i32 8, i32 %5, i32 %5)
%7 = load i32, i32* @stdscr
%8 = tail call i32 @getmaxyx(i32 %7, i32 undef, i32 undef)
%9 = tail call i32 @COLOR_PAIR(i32 8)
%10 = tail call i32 @attron(i32 %9)
%11 = load i32, i32* @A_BOLD
%12 = tail call i32 @attron(i32 %11)
%13 = load i32, i32* @ACS_ULCORNER
%14 = tail call i32 @mvaddch(i32 %2, i32 %3, i32 %13)
%15 = load i32, i32* @ACS_URCORNER
%16 = tail call i32 @mvaddch(i32 %2, i32 %1, i32 %15)
%17 = load i32, i32* @ACS_LLCORNER
%18 = tail call i32 @mvaddch(i32 %0, i32 %3, i32 %17)
%19 = load i32, i32* @ACS_LRCORNER
%20 = tail call i32 @mvaddch(i32 %0, i32 %1, i32 %19)
%21 = add nsw i32 %3, 1
%22 = load i32, i32* @ACS_HLINE
%23 = xor i32 %3, -1
%24 = add i32 %23, %1
%25 = tail call i32 @mvhline(i32 %2, i32 %21, i32 %22, i32 %24)
%26 = load i32, i32* @ACS_HLINE
%27 = tail call i32 @mvhline(i32 %0, i32 %21, i32 %26, i32 %24)
%28 = add nsw i32 %2, 1
%29 = load i32, i32* @ACS_VLINE
%30 = xor i32 %2, -1
%31 = add i32 %30, %0
%32 = tail call i32 @mvvline(i32 %28, i32 %3, i32 %29, i32 %31)
%33 = load i32, i32* @ACS_VLINE
%34 = tail call i32 @mvvline(i32 %28, i32 %1, i32 %33, i32 %31)
%35 = tail call i32 @COLOR_PAIR(i32 8)
%36 = tail call i32 @attroff(i32 %35)
%37 = load i32, i32* @A_BOLD
%38 = tail call i32 @attroff(i32 %37)
%39 = tail call i32 (...) @refresh()
ret void
}