#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*/ console_box(int, int, int, int);
int /*<<< orphan*/ console_clear();
int /*<<< orphan*/ console_move(int, int);
int /*<<< orphan*/ console_style(int);
int /*<<< orphan*/ console_write(char *);
int /*<<< orphan*/ update_key();
void startup_layout(void) {
  console_clear();
  console_style(1);
  console_box((80 / 2 - 64 / 2 - 1) - 1, 2 - 1, 64 + 2, (1024 / 64) + 2);
  update_key();
  console_move(5, 2 + (1024 / 64) + 2);
  console_style(1);
  console_write("Ctrl-X=cut   ");
  console_write("Ctrl-C=copy   ");
  console_write("Ctrl-V=paste   ");
  console_move(5, 2 + (1024 / 64) + 3);
  console_write("Ctrl-G=goto   ");
  console_write("Ctrl-R=run   ");
  console_write("Ctrl-Q=quit   ");
}


x86 assembly (clang, -O0):
<startup_layout>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <console_clear@plt>
mov    $0x1,%edi
call   1050 <console_style@plt>
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x42,%edx
mov    $0x12,%ecx
call   1070 <console_box@plt>
mov    $0x0,%al
call   1030 <update_key@plt>
mov    $0x5,%edi
mov    $0x14,%esi
call   1060 <console_move@plt>
mov    $0x1,%edi
call   1050 <console_style@plt>
lea    0xe4b(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe4d(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe50(%rip),%rdi
call   1080 <console_write@plt>
mov    $0x5,%edi
mov    $0x15,%esi
call   1060 <console_move@plt>
lea    0xe45(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe48(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe4a(%rip),%rdi
call   1080 <console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup_layout>:
push   %rax
xor    %eax,%eax
call   1040 <console_clear@plt>
mov    $0x1,%edi
call   1050 <console_style@plt>
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x42,%edx
mov    $0x12,%ecx
call   1070 <console_box@plt>
xor    %eax,%eax
call   1030 <update_key@plt>
mov    $0x5,%edi
mov    $0x14,%esi
call   1060 <console_move@plt>
mov    $0x1,%edi
call   1050 <console_style@plt>
lea    0xe4e(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe50(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe53(%rip),%rdi
call   1080 <console_write@plt>
mov    $0x5,%edi
mov    $0x15,%esi
call   1060 <console_move@plt>
lea    0xe48(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe4b(%rip),%rdi
call   1080 <console_write@plt>
lea    0xe4d(%rip),%rdi
pop    %rax
jmp    1080 <console_write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Ctrl-X=cut \00"
@.str.1 = [15 x i8] c"Ctrl-C=copy \00"
@.str.2 = [16 x i8] c"Ctrl-V=paste \00"
@.str.3 = [15 x i8] c"Ctrl-G=goto \00"
@.str.4 = [14 x i8] c"Ctrl-R=run \00"
@.str.5 = [15 x i8] c"Ctrl-Q=quit \00"
define void @startup_layout() {
%1 = call i32 (...) @console_clear()
%2 = call i32 @console_style(i32 1)
%3 = call i32 @console_box(i32 6, i32 1, i32 66, i32 18)
%4 = call i32 (...) @update_key()
%5 = call i32 @console_move(i32 5, i32 20)
%6 = call i32 @console_style(i32 1)
%7 = call i32 @console_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @console_write(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @console_move(i32 5, i32 21)
%11 = call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @console_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Ctrl-X=cut \00"
@.str.1 = [15 x i8] c"Ctrl-C=copy \00"
@.str.2 = [16 x i8] c"Ctrl-V=paste \00"
@.str.3 = [15 x i8] c"Ctrl-G=goto \00"
@.str.4 = [14 x i8] c"Ctrl-R=run \00"
@.str.5 = [15 x i8] c"Ctrl-Q=quit \00"
define void @startup_layout() {
%1 = tail call i32 (...) @console_clear()
%2 = tail call i32 @console_style(i32 1)
%3 = tail call i32 @console_box(i32 6, i32 1, i32 66, i32 18)
%4 = tail call i32 (...) @update_key()
%5 = tail call i32 @console_move(i32 5, i32 20)
%6 = tail call i32 @console_style(i32 1)
%7 = tail call i32 @console_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @console_write(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @console_move(i32 5, i32 21)
%11 = tail call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @console_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 @console_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
ret void
}