#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int get_cols();
int get_rows();
int /*<<< orphan*/ move(int, int);
void redraw_boundaries() {
  int rows = get_rows();
  int cols = get_cols();
  clear();
  attron(COLOR_PAIR(1));
  int i;
  for (i = 0; i <= cols; i++) {
    move(0, i);
    addch('+');
    move(rows - 1, i);
    addch('+');
  }
  for (i = 1; i < rows; i++) {
    move(i, 0);
    addch('+');
    move(i, cols - 1);
    addch('+');
  }
  attroff(COLOR_PAIR(1));
}


x86 assembly (clang, -O0):
<redraw_boundaries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <get_rows@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_cols@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1090 <clear@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1201 <redraw_boundaries+0x81>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bb <redraw_boundaries+0x3b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    124e <redraw_boundaries+0xce>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1208 <redraw_boundaries+0x88>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_boundaries>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1080 <get_rows@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <get_cols@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1090 <clear@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
test   %r15d,%r15d
js     11fe <redraw_boundaries+0x7e>
lea    -0x1(%r14),%r12d
lea    0x1(%r15),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %ebp,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    %r12d,%edi
mov    %ebp,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11d0 <redraw_boundaries+0x50>
cmp    $0x2,%r14d
jl     123f <redraw_boundaries+0xbf>
add    $0xffffffff,%r15d
mov    $0x1,%ebx
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
mov    %ebx,%edi
mov    %r15d,%esi
call   10a0 <move@plt>
mov    $0x2b,%edi
call   1070 <addch@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1210 <redraw_boundaries+0x90>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
define void @redraw_boundaries() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @get_rows()
store i32 %4, i32* %1
%5 = call i32 (...) @get_cols()
store i32 %5, i32* %2
%6 = call i32 (...) @clear()
%7 = call i32 @COLOR_PAIR(i32 1)
%8 = call i32 @attron(i32 %7)
store i32 0, i32* %3
br label %9
9: ; preds = %22, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32, i32* %3
%15 = call i32 @move(i32 0, i32 %14)
%16 = call i32 @addch(i8 signext 43)
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, 1
%19 = load i32, i32* %3
%20 = call i32 @move(i32 %18, i32 %19)
%21 = call i32 @addch(i8 signext 43)
br label %22
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %9
25: ; preds = %9
store i32 1, i32* %3
br label %26
26: ; preds = %39, %25
%27 = load i32, i32* %3
%28 = load i32, i32* %1
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %42
30: ; preds = %26
%31 = load i32, i32* %3
%32 = call i32 @move(i32 %31, i32 0)
%33 = call i32 @addch(i8 signext 43)
%34 = load i32, i32* %3
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 1
%37 = call i32 @move(i32 %34, i32 %36)
%38 = call i32 @addch(i8 signext 43)
br label %39
39: ; preds = %30
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %26
42: ; preds = %26
%43 = call i32 @COLOR_PAIR(i32 1)
%44 = call i32 @attroff(i32 %43)
ret void
}

LLVM IR (-O2):
define void @redraw_boundaries() {
%1 = tail call i32 (...) @get_rows()
%2 = tail call i32 (...) @get_cols()
%3 = tail call i32 (...) @clear()
%4 = tail call i32 @COLOR_PAIR(i32 1)
%5 = tail call i32 @attron(i32 %4)
%6 = icmp slt i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = add nsw i32 %1, -1
br label %13
9: ; preds = %13, %0
%10 = icmp sgt i32 %1, 1
br i1 %10, label %11, label %29
11: ; preds = %9
%12 = add nsw i32 %2, -1
br label %21
13: ; preds = %7, %13
%14 = phi i32 [ 0, %7 ], [ %19, %13 ]
%15 = tail call i32 @move(i32 0, i32 %14)
%16 = tail call i32 @addch(i8 signext 43)
%17 = tail call i32 @move(i32 %8, i32 %14)
%18 = tail call i32 @addch(i8 signext 43)
%19 = add nuw i32 %14, 1
%20 = icmp eq i32 %14, %2
br i1 %20, label %9, label %13
21: ; preds = %11, %21
%22 = phi i32 [ 1, %11 ], [ %27, %21 ]
%23 = tail call i32 @move(i32 %22, i32 0)
%24 = tail call i32 @addch(i8 signext 43)
%25 = tail call i32 @move(i32 %22, i32 %12)
%26 = tail call i32 @addch(i8 signext 43)
%27 = add nuw nsw i32 %22, 1
%28 = icmp eq i32 %27, %1
br i1 %28, label %29, label %21
29: ; preds = %21, %9
%30 = tail call i32 @COLOR_PAIR(i32 1)
%31 = tail call i32 @attroff(i32 %30)
ret void
}