#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*/ A_DIM;
char A_STANDOUT;
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void render_window(int x, int y, int x_len, int y_len) {
  attron(A_DIM);
  move(y, x);
  for (int i = 0; i < x_len; i++)
    addch('-');
  for (int i = 1; i < y_len; i++) {
    move(y + i, x);
    addch('|');
    move(y + i, x + x_len - 1);
    addch('|');
  }
  move(y + y_len, x);
  for (int i = 0; i < x_len; i++)
    addch('-');
  attroff(A_DIM);
  move(45 + 5, 3);
  addch('E' | A_STANDOUT);
  addch('S' | A_STANDOUT);
  addch('C' | A_STANDOUT);
  printw(" Quit   ");
  addch('F' | A_STANDOUT);
  addch('1' | A_STANDOUT);
  printw(" Help   ");
  addch('F' | A_STANDOUT);
  addch('2' | A_STANDOUT);
  printw(" License");
}


x86 assembly (clang, -O0):
<render_window>:
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    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1070 <move@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a8 <render_window+0x58>
mov    $0x2d,%edi
call   1060 <addch@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <render_window+0x34>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ff <render_window+0xaf>
mov    -0x8(%rbp),%edi
add    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1070 <move@plt>
mov    $0x7c,%edi
call   1060 <addch@plt>
mov    -0x8(%rbp),%edi
add    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
add    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1070 <move@plt>
mov    $0x7c,%edi
call   1060 <addch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11af <render_window+0x5f>
mov    -0x8(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1070 <move@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1238 <render_window+0xe8>
mov    $0x2d,%edi
call   1060 <addch@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1214 <render_window+0xc4>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x32,%edi
mov    $0x3,%esi
call   1070 <move@plt>
mov    0x2d84(%rip),%rax
movsbl (%rax),%eax
or     $0x45,%eax
movsbl %al,%edi
call   1060 <addch@plt>
mov    0x2d6f(%rip),%rax
movsbl (%rax),%eax
or     $0x53,%eax
movsbl %al,%edi
call   1060 <addch@plt>
mov    0x2d5a(%rip),%rax
movsbl (%rax),%eax
or     $0x43,%eax
movsbl %al,%edi
call   1060 <addch@plt>
lea    0xd65(%rip),%rdi
call   1050 <printw@plt>
mov    0x2d39(%rip),%rax
movsbl (%rax),%eax
or     $0x46,%eax
movsbl %al,%edi
call   1060 <addch@plt>
mov    0x2d24(%rip),%rax
movsbl (%rax),%eax
or     $0x31,%eax
movsbl %al,%edi
call   1060 <addch@plt>
lea    0xd38(%rip),%rdi
call   1050 <printw@plt>
mov    0x2d03(%rip),%rax
movsbl (%rax),%eax
or     $0x46,%eax
movsbl %al,%edi
call   1060 <addch@plt>
mov    0x2cee(%rip),%rax
movsbl (%rax),%eax
or     $0x32,%eax
movsbl %al,%edi
call   1060 <addch@plt>
lea    0xd0b(%rip),%rdi
call   1050 <printw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_window>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r15d
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
mov    %rbp,(%rsp)
mov    %ebp,%edi
mov    %r15d,%esi
call   1070 <move@plt>
test   %ebx,%ebx
jle    119f <render_window+0x4f>
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1060 <addch@plt>
add    $0xffffffff,%ebp
jne    1190 <render_window+0x40>
cmp    $0x2,%r14d
jl     11f1 <render_window+0xa1>
lea    (%r15,%rbx,1),%r13d
add    $0xffffffff,%r13d
lea    -0x1(%r14),%r12d
mov    (%rsp),%rax
lea    0x1(%rax),%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r15d,%esi
call   1070 <move@plt>
mov    $0x7c,%edi
call   1060 <addch@plt>
mov    %ebp,%edi
mov    %r13d,%esi
call   1070 <move@plt>
mov    $0x7c,%edi
call   1060 <addch@plt>
add    $0x1,%ebp
add    $0xffffffff,%r12d
jne    11c0 <render_window+0x70>
add    (%rsp),%r14d
mov    %r14d,%edi
mov    %r15d,%esi
call   1070 <move@plt>
test   %ebx,%ebx
jle    121f <render_window+0xcf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1060 <addch@plt>
add    $0xffffffff,%ebx
jne    1210 <render_window+0xc0>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x32,%edi
mov    $0x3,%esi
call   1070 <move@plt>
mov    0x2d9d(%rip),%rbx
movsbl (%rbx),%edi
or     $0x45,%edi
call   1060 <addch@plt>
movsbl (%rbx),%edi
or     $0x53,%edi
call   1060 <addch@plt>
movsbl (%rbx),%edi
or     $0x43,%edi
call   1060 <addch@plt>
lea    0xd95(%rip),%rdi
call   1050 <printw@plt>
movsbl (%rbx),%edi
or     $0x46,%edi
call   1060 <addch@plt>
movsbl (%rbx),%edi
or     $0x31,%edi
call   1060 <addch@plt>
lea    0xd7c(%rip),%rdi
call   1050 <printw@plt>
movsbl (%rbx),%edi
or     $0x46,%edi
call   1060 <addch@plt>
movsbl (%rbx),%edi
or     $0x32,%edi
call   1060 <addch@plt>
lea    0xd63(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printw@plt>

LLVM IR (-O0):
@A_DIM = global i32 0
@A_STANDOUT = global i8 0
@.str = [9 x i8] c" Quit \00"
@.str.1 = [9 x i8] c" Help \00"
@.str.2 = [9 x i8] c" License\00"
define void @render_window(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
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* @A_DIM
%13 = call i32 @attron(i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = call i32 @move(i32 %14, i32 %15)
store i32 0, i32* %9
br label %17
17: ; preds = %23, %4
%18 = load i32, i32* %9
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = call i32 @addch(i8 signext 45)
br label %23
23: ; preds = %21
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
br label %17
26: ; preds = %17
store i32 1, i32* %10
br label %27
27: ; preds = %47, %26
%28 = load i32, i32* %10
%29 = load i32, i32* %8
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %50
31: ; preds = %27
%32 = load i32, i32* %6
%33 = load i32, i32* %10
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %5
%36 = call i32 @move(i32 %34, i32 %35)
%37 = call i32 @addch(i8 signext 124)
%38 = load i32, i32* %6
%39 = load i32, i32* %10
%40 = add nsw i32 %38, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = add nsw i32 %41, %42
%44 = sub nsw i32 %43, 1
%45 = call i32 @move(i32 %40, i32 %44)
%46 = call i32 @addch(i8 signext 124)
br label %47
47: ; preds = %31
%48 = load i32, i32* %10
%49 = add nsw i32 %48, 1
store i32 %49, i32* %10
br label %27
50: ; preds = %27
%51 = load i32, i32* %6
%52 = load i32, i32* %8
%53 = add nsw i32 %51, %52
%54 = load i32, i32* %5
%55 = call i32 @move(i32 %53, i32 %54)
store i32 0, i32* %11
br label %56
56: ; preds = %62, %50
%57 = load i32, i32* %11
%58 = load i32, i32* %7
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %65
60: ; preds = %56
%61 = call i32 @addch(i8 signext 45)
br label %62
62: ; preds = %60
%63 = load i32, i32* %11
%64 = add nsw i32 %63, 1
store i32 %64, i32* %11
br label %56
65: ; preds = %56
%66 = load i32, i32* @A_DIM
%67 = call i32 @attroff(i32 %66)
%68 = call i32 @move(i32 50, i32 3)
%69 = load i8, i8* @A_STANDOUT
%70 = sext i8 %69 to i32
%71 = or i32 69, %70
%72 = trunc i32 %71 to i8
%73 = call i32 @addch(i8 signext %72)
%74 = load i8, i8* @A_STANDOUT
%75 = sext i8 %74 to i32
%76 = or i32 83, %75
%77 = trunc i32 %76 to i8
%78 = call i32 @addch(i8 signext %77)
%79 = load i8, i8* @A_STANDOUT
%80 = sext i8 %79 to i32
%81 = or i32 67, %80
%82 = trunc i32 %81 to i8
%83 = call i32 @addch(i8 signext %82)
%84 = call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%85 = load i8, i8* @A_STANDOUT
%86 = sext i8 %85 to i32
%87 = or i32 70, %86
%88 = trunc i32 %87 to i8
%89 = call i32 @addch(i8 signext %88)
%90 = load i8, i8* @A_STANDOUT
%91 = sext i8 %90 to i32
%92 = or i32 49, %91
%93 = trunc i32 %92 to i8
%94 = call i32 @addch(i8 signext %93)
%95 = call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%96 = load i8, i8* @A_STANDOUT
%97 = sext i8 %96 to i32
%98 = or i32 70, %97
%99 = trunc i32 %98 to i8
%100 = call i32 @addch(i8 signext %99)
%101 = load i8, i8* @A_STANDOUT
%102 = sext i8 %101 to i32
%103 = or i32 50, %102
%104 = trunc i32 %103 to i8
%105 = call i32 @addch(i8 signext %104)
%106 = call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@A_DIM = global i32 0
@A_STANDOUT = global i8 0
@.str = [9 x i8] c" Quit \00"
@.str.1 = [9 x i8] c" Help \00"
@.str.2 = [9 x i8] c" License\00"
define void @render_window(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @A_DIM
%6 = tail call i32 @attron(i32 %5)
%7 = tail call i32 @move(i32 %1, i32 %0)
%8 = icmp sgt i32 %2, 0
br i1 %8, label %14, label %9
9: ; preds = %14, %4
%10 = icmp sgt i32 %3, 1
br i1 %10, label %11, label %19
11: ; preds = %9
%12 = add i32 %0, -1
%13 = add i32 %12, %2
br label %22
14: ; preds = %4, %14
%15 = phi i32 [ %17, %14 ], [ 0, %4 ]
%16 = tail call i32 @addch(i8 signext 45)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %2
br i1 %18, label %9, label %14
19: ; preds = %22, %9
%20 = add nsw i32 %3, %1
%21 = tail call i32 @move(i32 %20, i32 %0)
br i1 %8, label %59, label %31
22: ; preds = %11, %22
%23 = phi i32 [ 1, %11 ], [ %29, %22 ]
%24 = add nsw i32 %23, %1
%25 = tail call i32 @move(i32 %24, i32 %0)
%26 = tail call i32 @addch(i8 signext 124)
%27 = tail call i32 @move(i32 %24, i32 %13)
%28 = tail call i32 @addch(i8 signext 124)
%29 = add nuw nsw i32 %23, 1
%30 = icmp eq i32 %29, %3
br i1 %30, label %19, label %22
31: ; preds = %59, %19
%32 = load i32, i32* @A_DIM
%33 = tail call i32 @attroff(i32 %32)
%34 = tail call i32 @move(i32 50, i32 3)
%35 = load i8, i8* @A_STANDOUT
%36 = or i8 %35, 69
%37 = tail call i32 @addch(i8 signext %36)
%38 = load i8, i8* @A_STANDOUT
%39 = or i8 %38, 83
%40 = tail call i32 @addch(i8 signext %39)
%41 = load i8, i8* @A_STANDOUT
%42 = or i8 %41, 67
%43 = tail call i32 @addch(i8 signext %42)
%44 = tail call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%45 = load i8, i8* @A_STANDOUT
%46 = or i8 %45, 70
%47 = tail call i32 @addch(i8 signext %46)
%48 = load i8, i8* @A_STANDOUT
%49 = or i8 %48, 49
%50 = tail call i32 @addch(i8 signext %49)
%51 = tail call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%52 = load i8, i8* @A_STANDOUT
%53 = or i8 %52, 70
%54 = tail call i32 @addch(i8 signext %53)
%55 = load i8, i8* @A_STANDOUT
%56 = or i8 %55, 50
%57 = tail call i32 @addch(i8 signext %56)
%58 = tail call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
59: ; preds = %19, %59
%60 = phi i32 [ %62, %59 ], [ 0, %19 ]
%61 = tail call i32 @addch(i8 signext 45)
%62 = add nuw nsw i32 %60, 1
%63 = icmp eq i32 %62, %2
br i1 %63, label %31, label %59
}