#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_LTEE;
int /*<<< orphan*/ ACS_RARROW;
int /*<<< orphan*/ ACS_UARROW;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ COLOR_PAIR(int);
int COLS;
int LINES;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(int, int, int /*<<< orphan*/);
void nc_axes(void) {
  attron(COLOR_PAIR(2));
  for (int i = 0; i < COLS - 2 * 2; i++) {
    mvaddch(LINES / 2, i + 2, ACS_HLINE);
  }
  mvaddch(LINES / 2, COLS - 2, ACS_RARROW);
  for (int i = 0; i < LINES / 2; i++) {
    mvaddch(2 + i, 2, ACS_VLINE);
  }
  mvaddch(LINES / 2, 2, ACS_LTEE);
  mvaddch(2, 2, ACS_UARROW);
  attroff(COLOR_PAIR(2));
}


x86 assembly (clang, -O0):
<nc_axes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e5e(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    11ac <nc_axes+0x6c>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x4(%rbp),%esi
add    $0x2,%esi
mov    0x2e21(%rip),%rax
mov    (%rax),%edx
call   1060 <mvaddch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <nc_axes+0x20>
mov    0x2e25(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
sub    $0x2,%esi
mov    0x2dfe(%rip),%rax
mov    (%rax),%edx
call   1060 <mvaddch@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jge    122b <nc_axes+0xeb>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
mov    0x2d9f(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1060 <mvaddch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e0 <nc_axes+0xa0>
mov    0x2da6(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    0x2d9b(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1060 <mvaddch@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
mov    %esi,%edi
call   1060 <mvaddch@plt>
mov    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_axes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    0x2e68(%rip),%r14
mov    (%r14),%esi
cmp    $0x5,%esi
jl     11a5 <nc_axes+0x65>
xor    %ebx,%ebx
mov    0x2e67(%rip),%r15
mov    0x2e40(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    (%r15),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
lea    0x2(%rbx),%esi
mov    (%r12),%edx
call   1060 <mvaddch@plt>
add    $0x1,%ebx
mov    (%r14),%esi
lea    -0x4(%rsi),%eax
cmp    %eax,%ebx
jl     1180 <nc_axes+0x40>
mov    0x2e2c(%rip),%r14
mov    (%r14),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
add    $0xfffffffe,%esi
mov    0x2e0e(%rip),%rax
mov    (%rax),%edx
call   1060 <mvaddch@plt>
mov    (%r14),%eax
cmp    $0x2,%eax
jl     1205 <nc_axes+0xc5>
xor    %ebx,%ebx
mov    0x2dd6(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x2(%rbx),%edi
mov    (%r15),%edx
mov    $0x2,%esi
call   1060 <mvaddch@plt>
add    $0x1,%ebx
mov    (%r14),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
cmp    %edi,%ebx
jl     11e0 <nc_axes+0xa0>
jmp    120e <nc_axes+0xce>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
mov    0x2dcb(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1060 <mvaddch@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
mov    $0x2,%esi
call   1060 <mvaddch@plt>
mov    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <attroff@plt>

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

LLVM IR (-O2):
@COLS = global i32 0
@LINES = global i32 0
@ACS_HLINE = global i32 0
@ACS_RARROW = global i32 0
@ACS_VLINE = global i32 0
@ACS_LTEE = global i32 0
@ACS_UARROW = global i32 0
define void @nc_axes() {
%1 = tail call i32 @COLOR_PAIR(i32 2)
%2 = tail call i32 @attron(i32 %1)
%3 = load i32, i32* @COLS
%4 = icmp sgt i32 %3, 4
br i1 %4, label %15, label %5
5: ; preds = %15, %0
%6 = phi i32 [ %3, %0 ], [ %23, %15 ]
%7 = load i32, i32* @LINES
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %6, -2
%10 = load i32, i32* @ACS_RARROW
%11 = tail call i32 @mvaddch(i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* @LINES
%13 = sdiv i32 %12, 2
%14 = icmp sgt i32 %12, 1
br i1 %14, label %34, label %26
15: ; preds = %0, %15
%16 = phi i32 [ %22, %15 ], [ 0, %0 ]
%17 = load i32, i32* @LINES
%18 = sdiv i32 %17, 2
%19 = add nuw nsw i32 %16, 2
%20 = load i32, i32* @ACS_HLINE
%21 = tail call i32 @mvaddch(i32 %18, i32 %19, i32 %20)
%22 = add nuw nsw i32 %16, 1
%23 = load i32, i32* @COLS
%24 = add nsw i32 %23, -4
%25 = icmp slt i32 %22, %24
br i1 %25, label %15, label %5
26: ; preds = %34, %5
%27 = phi i32 [ %13, %5 ], [ %41, %34 ]
%28 = load i32, i32* @ACS_LTEE
%29 = tail call i32 @mvaddch(i32 %27, i32 2, i32 %28)
%30 = load i32, i32* @ACS_UARROW
%31 = tail call i32 @mvaddch(i32 2, i32 2, i32 %30)
%32 = tail call i32 @COLOR_PAIR(i32 2)
%33 = tail call i32 @attroff(i32 %32)
ret void
34: ; preds = %5, %34
%35 = phi i32 [ %39, %34 ], [ 0, %5 ]
%36 = add nuw nsw i32 %35, 2
%37 = load i32, i32* @ACS_VLINE
%38 = tail call i32 @mvaddch(i32 %36, i32 2, i32 %37)
%39 = add nuw nsw i32 %35, 1
%40 = load i32, i32* @LINES
%41 = sdiv i32 %40, 2
%42 = icmp slt i32 %39, %41
br i1 %42, label %34, label %26
}