#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*/ mvprintw(int, int, char *);
void draw_grid(int y, int x) {
  mvprintw(y++, x, "#####################################");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#-----------------------------------#");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#-----------------------------------#");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#-----------------------------------#");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#        |        |        |        #");
  mvprintw(y++, x, "#####################################");
  mvprintw(y + 2, x, "Control: wasd  Exit: q");
}


x86 assembly (clang, -O0):
<draw_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed9(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe71(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe57(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe3d(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe49(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe09(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdef(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdd5(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xde1(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xda1(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd87(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd6d(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd2d(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
lea    0xd8a(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x1(%rbx),%r12d
lea    0xed6(%rip),%rdx
call   1030 <mvprintw@plt>
lea    0x2(%rbx),%r13d
lea    0xeec(%rip),%r15
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x3(%rbx),%r12d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x4(%rbx),%r13d
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x5(%rbx),%r14d
lea    0xed8(%rip),%r12
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12,%rdx
call   1030 <mvprintw@plt>
lea    0x6(%rbx),%r13d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x7(%rbx),%r14d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x8(%rbx),%r13d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x9(%rbx),%r14d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12,%rdx
call   1030 <mvprintw@plt>
lea    0xa(%rbx),%r13d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0xb(%rbx),%r14d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0xc(%rbx),%r13d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0xd(%rbx),%r14d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12,%rdx
call   1030 <mvprintw@plt>
lea    0xe(%rbx),%r12d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0xf(%rbx),%r14d
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
lea    0x10(%rbx),%r12d
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
mov    %r12d,%edi
mov    %ebp,%esi
lea    0xdb8(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x13,%ebx
lea    0xe1b(%rip),%rdx
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"#####################################\00"
@.str.1 = [38 x i8] c"# | | | #\00"
@.str.2 = [38 x i8] c"#-----------------------------------#\00"
@.str.3 = [23 x i8] c"Control: wasd Exit: q\00"
define void @draw_grid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @mvprintw(i32 %5, i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @mvprintw(i32 %9, i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @mvprintw(i32 %13, i32 %15, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @mvprintw(i32 %17, i32 %19, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @mvprintw(i32 %21, i32 %23, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @mvprintw(i32 %25, i32 %27, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
%31 = load i32, i32* %4
%32 = call i32 @mvprintw(i32 %29, i32 %31, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
%35 = load i32, i32* %4
%36 = call i32 @mvprintw(i32 %33, i32 %35, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
%39 = load i32, i32* %4
%40 = call i32 @mvprintw(i32 %37, i32 %39, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
%43 = load i32, i32* %4
%44 = call i32 @mvprintw(i32 %41, i32 %43, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
%47 = load i32, i32* %4
%48 = call i32 @mvprintw(i32 %45, i32 %47, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
%51 = load i32, i32* %4
%52 = call i32 @mvprintw(i32 %49, i32 %51, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
%55 = load i32, i32* %4
%56 = call i32 @mvprintw(i32 %53, i32 %55, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
%59 = load i32, i32* %4
%60 = call i32 @mvprintw(i32 %57, i32 %59, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
%63 = load i32, i32* %4
%64 = call i32 @mvprintw(i32 %61, i32 %63, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
%67 = load i32, i32* %4
%68 = call i32 @mvprintw(i32 %65, i32 %67, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%69 = load i32, i32* %3
%70 = add nsw i32 %69, 1
store i32 %70, i32* %3
%71 = load i32, i32* %4
%72 = call i32 @mvprintw(i32 %69, i32 %71, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 2
%75 = load i32, i32* %4
%76 = call i32 @mvprintw(i32 %74, i32 %75, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"#####################################\00"
@.str.1 = [38 x i8] c"# | | | #\00"
@.str.2 = [38 x i8] c"#-----------------------------------#\00"
@.str.3 = [23 x i8] c"Control: wasd Exit: q\00"
define void @draw_grid(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i32 %0, 2
%6 = tail call i32 @mvprintw(i32 %3, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%7 = add nsw i32 %0, 3
%8 = tail call i32 @mvprintw(i32 %5, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%9 = add nsw i32 %0, 4
%10 = tail call i32 @mvprintw(i32 %7, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%11 = add nsw i32 %0, 5
%12 = tail call i32 @mvprintw(i32 %9, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%13 = add nsw i32 %0, 6
%14 = tail call i32 @mvprintw(i32 %11, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%15 = add nsw i32 %0, 7
%16 = tail call i32 @mvprintw(i32 %13, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%17 = add nsw i32 %0, 8
%18 = tail call i32 @mvprintw(i32 %15, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%19 = add nsw i32 %0, 9
%20 = tail call i32 @mvprintw(i32 %17, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%21 = add nsw i32 %0, 10
%22 = tail call i32 @mvprintw(i32 %19, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%23 = add nsw i32 %0, 11
%24 = tail call i32 @mvprintw(i32 %21, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%25 = add nsw i32 %0, 12
%26 = tail call i32 @mvprintw(i32 %23, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%27 = add nsw i32 %0, 13
%28 = tail call i32 @mvprintw(i32 %25, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%29 = add nsw i32 %0, 14
%30 = tail call i32 @mvprintw(i32 %27, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%31 = add nsw i32 %0, 15
%32 = tail call i32 @mvprintw(i32 %29, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%33 = add nsw i32 %0, 16
%34 = tail call i32 @mvprintw(i32 %31, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%35 = tail call i32 @mvprintw(i32 %33, i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%36 = add nsw i32 %0, 19
%37 = tail call i32 @mvprintw(i32 %36, i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}