#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 COLS;
int LINES;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ mvaddch(int, int, char);
void target(void) {
  int n;
  move((LINES / 2 - 1), (COLS / 2 - 1) - 10);
  addstr("-------   +   -------");
  for (n = (LINES / 2 - 1) - 4; n < (LINES / 2 - 1) - 1; n++) {
    mvaddch(n, (COLS / 2 - 1), '|');
    mvaddch(n + 6, (COLS / 2 - 1), '|');
  }
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
sub    $0x1,%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
sub    $0x1,%esi
sub    $0xa,%esi
call   1050 <move@plt>
lea    0xe8d(%rip),%rdi
call   1040 <addstr@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1213 <target+0xe3>
mov    -0x4(%rbp),%edi
mov    0x2e1a(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
sub    $0x1,%esi
mov    $0x7c,%edx
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x6,%edi
mov    0x2df4(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
sub    $0x1,%esi
mov    $0x7c,%edx
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <target+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
push   %r15
push   %r14
push   %rbx
mov    0x2eac(%rip),%r14
mov    (%r14),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
add    $0xffffffff,%edi
mov    0x2e8e(%rip),%r15
mov    (%r15),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
add    $0xfffffff5,%esi
call   1050 <move@plt>
lea    0xe93(%rip),%rdi
call   1040 <addstr@plt>
mov    (%r14),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
add    $0xfffffffb,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
add    $0xffffffff,%esi
mov    %ebx,%edi
mov    $0x7c,%edx
call   1030 <mvaddch@plt>
mov    (%r15),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
add    $0xffffffff,%esi
lea    0x6(%rbx),%edi
mov    $0x7c,%edx
call   1030 <mvaddch@plt>
mov    (%r14),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    $0xfffffffe,%ecx
add    $0x1,%ebx
cmp    %ecx,%ebx
jl     1190 <target+0x60>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LINES = global i32 0
@COLS = global i32 0
@.str = [22 x i8] c"------- + -------\00"
define void @target() {
%1 = alloca i32
%2 = load i32, i32* @LINES
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %3, 1
%5 = load i32, i32* @COLS
%6 = sdiv i32 %5, 2
%7 = sub nsw i32 %6, 1
%8 = sub nsw i32 %7, 10
%9 = call i32 @move(i32 %4, i32 %8)
%10 = call i32 @addstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @LINES
%12 = sdiv i32 %11, 2
%13 = sub nsw i32 %12, 1
%14 = sub nsw i32 %13, 4
store i32 %14, i32* %1
br label %15
15: ; preds = %34, %0
%16 = load i32, i32* %1
%17 = load i32, i32* @LINES
%18 = sdiv i32 %17, 2
%19 = sub nsw i32 %18, 1
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %16, %20
br i1 %21, label %22, label %37
22: ; preds = %15
%23 = load i32, i32* %1
%24 = load i32, i32* @COLS
%25 = sdiv i32 %24, 2
%26 = sub nsw i32 %25, 1
%27 = call i32 @mvaddch(i32 %23, i32 %26, i8 signext 124)
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 6
%30 = load i32, i32* @COLS
%31 = sdiv i32 %30, 2
%32 = sub nsw i32 %31, 1
%33 = call i32 @mvaddch(i32 %29, i32 %32, i8 signext 124)
br label %34
34: ; preds = %22
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %15
37: ; preds = %15
ret void
}

LLVM IR (-O2):
@LINES = global i32 0
@COLS = global i32 0
@.str = [22 x i8] c"------- + -------\00"
define void @target() {
%1 = load i32, i32* @LINES
%2 = sdiv i32 %1, 2
%3 = add nsw i32 %2, -1
%4 = load i32, i32* @COLS
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %5, -11
%7 = tail call i32 @move(i32 %3, i32 %6)
%8 = tail call i32 @addstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @LINES
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %10, -5
br label %12
12: ; preds = %0, %12
%13 = phi i32 [ %23, %12 ], [ %11, %0 ]
%14 = load i32, i32* @COLS
%15 = sdiv i32 %14, 2
%16 = add nsw i32 %15, -1
%17 = tail call i32 @mvaddch(i32 %13, i32 %16, i8 signext 124)
%18 = add nsw i32 %13, 6
%19 = load i32, i32* @COLS
%20 = sdiv i32 %19, 2
%21 = add nsw i32 %20, -1
%22 = tail call i32 @mvaddch(i32 %18, i32 %21, i8 signext 124)
%23 = add nsw i32 %13, 1
%24 = load i32, i32* @LINES
%25 = sdiv i32 %24, 2
%26 = add nsw i32 %25, -2
%27 = icmp slt i32 %23, %26
br i1 %27, label %12, label %28
28: ; preds = %12
ret void
}