#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 */
char getchar();
int /*<<< orphan*/ print_screen(char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char **argv) {
  int xpos = 0, ypos = 0;
  int flag = 1;
  int i, j;
  char screen[15][15];
  for (i = 0; i < 15; i++)
    for (j = 0; j < 15; j++)
      screen[i][j] = ' ';
  char c;
  printf("Type:\n\tw to go up\n\ta to go left\n\ts to go down\n\td to go "
         "right\n\n\tx to quit.");
  while (1) {
    if (flag == 1) {
      printf("Enter the initial coordinates of the cursor(Max x= %d and Max y= "
             "%d): ",
             15, 15);
      scanf("%d\n%d", &xpos, &ypos);
      flag = 0;
    }
    printf("\n");
    c = getchar();
    if (c == 'x')
      break;
    else if (c == 'w') {
      xpos--;
      if (xpos == 15)
        xpos = 0;
      else if (xpos < 0)
        xpos = 15 - 1;
      screen[xpos][ypos] = 'x';
    } else if (c == 's') {
      xpos++;
      if (xpos == 15)
        xpos = 0;
      else if (xpos < 0)
        xpos = 15 - 1;
      screen[xpos][ypos] = 'x';
    } else if (c == 'a') {
      ypos--;
      if (ypos == 15)
        ypos = 0;
      else if (ypos < 0)
        ypos = 15 - 1;
      screen[xpos][ypos] = 'x';
    } else if (c == 'd') {
      ypos++;
      if (ypos == 15)
        ypos = 0;
      else if (ypos < 0)
        ypos = 15 - 1;
      screen[xpos][ypos] = 'x';
    } else if (c == 'c') {
      for (i = 0; i < 15; i++)
        for (j = 0; j < 15; j++)
          screen[i][j] = ' ';
      xpos = 0;
      ypos = 0;
      flag = 1;
    } else
      continue;
    print_screen(screen);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xf,-0x20(%rbp)
jge    11cb <main+0x8b>
movl   $0x0,-0x24(%rbp)
cmpl   $0xf,-0x24(%rbp)
jge    11b8 <main+0x78>
movslq -0x20(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1186 <main+0x46>
jmp    11bd <main+0x7d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1175 <main+0x35>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    1213 <main+0xd3>
lea    0xe60(%rip),%rdi
mov    $0xf,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x111(%rbp)
movsbl -0x111(%rbp),%eax
cmp    $0x78,%eax
jne    1243 <main+0x103>
jmp    1489 <main+0x349>
movsbl -0x111(%rbp),%eax
cmp    $0x77,%eax
jne    12a7 <main+0x167>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jne    1272 <main+0x132>
movl   $0x0,-0x14(%rbp)
jmp    1288 <main+0x148>
cmpl   $0x0,-0x14(%rbp)
jge    1283 <main+0x143>
movl   $0xe,-0x14(%rbp)
jmp    1288 <main+0x148>
movslq -0x14(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
jmp    1473 <main+0x333>
movsbl -0x111(%rbp),%eax
cmp    $0x73,%eax
jne    130b <main+0x1cb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jne    12d6 <main+0x196>
movl   $0x0,-0x14(%rbp)
jmp    12ec <main+0x1ac>
cmpl   $0x0,-0x14(%rbp)
jge    12e7 <main+0x1a7>
movl   $0xe,-0x14(%rbp)
jmp    12ec <main+0x1ac>
movslq -0x14(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
jmp    146e <main+0x32e>
movsbl -0x111(%rbp),%eax
cmp    $0x61,%eax
jne    136f <main+0x22f>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jne    133a <main+0x1fa>
movl   $0x0,-0x18(%rbp)
jmp    1350 <main+0x210>
cmpl   $0x0,-0x18(%rbp)
jge    134b <main+0x20b>
movl   $0xe,-0x18(%rbp)
jmp    1350 <main+0x210>
movslq -0x14(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
jmp    1469 <main+0x329>
movsbl -0x111(%rbp),%eax
cmp    $0x64,%eax
jne    13d3 <main+0x293>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jne    139e <main+0x25e>
movl   $0x0,-0x18(%rbp)
jmp    13b4 <main+0x274>
cmpl   $0x0,-0x18(%rbp)
jge    13af <main+0x26f>
movl   $0xe,-0x18(%rbp)
jmp    13b4 <main+0x274>
movslq -0x14(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
jmp    1464 <main+0x324>
movsbl -0x111(%rbp),%eax
cmp    $0x63,%eax
jne    145a <main+0x31a>
movl   $0x0,-0x20(%rbp)
cmpl   $0xf,-0x20(%rbp)
jge    1440 <main+0x300>
movl   $0x0,-0x24(%rbp)
cmpl   $0xf,-0x24(%rbp)
jge    142d <main+0x2ed>
movslq -0x20(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xf,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13fb <main+0x2bb>
jmp    1432 <main+0x2f2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13ea <main+0x2aa>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    145f <main+0x31f>
jmp    11d9 <main+0x99>
jmp    1464 <main+0x324>
jmp    1469 <main+0x329>
jmp    146e <main+0x32e>
jmp    1473 <main+0x333>
jmp    1478 <main+0x338>
lea    -0x110(%rbp),%rdi
call   1050 <print_screen@plt>
jmp    11d9 <main+0x99>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movb   $0x20,0xf0(%rsp)
20
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r14d
lea    0xf0b(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
lea    0xe09(%rip),%rbp
lea    0x10(%rsp),%rbx
jmp    123d <main+0xed>
movl   $0x0,0x8(%rsp)
xor    %eax,%eax
movslq 0xc(%rsp),%rcx
mov    %eax,%eax
lea    (%rcx,%rcx,4),%rcx
lea    (%rcx,%rcx,2),%rcx
add    %rsp,%rcx
add    $0x10,%rcx
movb   $0x78,(%rax,%rcx,1)
xor    %r14d,%r14d
mov    %rbx,%rdi
call   1060 <print_screen@plt>
cmp    $0x1,%r14d
jne    1269 <main+0x119>
lea    0xe70(%rip),%rdi
mov    $0xf,%esi
mov    $0xf,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1070 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x9f,%al
cmp    $0x17,%al
ja     123d <main+0xed>
movzbl %al,%eax
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    0x8(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
cmp    $0xf,%eax
je     120e <main+0xbe>
test   %ecx,%ecx
jg     1218 <main+0xc8>
jmp    1353 <main+0x203>
movaps 0xd48(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movb   $0x20,0xf0(%rsp)
20
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x1,%r14d
jmp    1235 <main+0xe5>
mov    0x8(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
cmp    $0xf,%eax
je     120e <main+0xbe>
cmp    $0xfffffffe,%ecx
jg     1218 <main+0xc8>
movl   $0xe,0x8(%rsp)
mov    $0xe,%eax
jmp    1218 <main+0xc8>
mov    0xc(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0xf,%eax
je     138c <main+0x23c>
cmp    $0xfffffffe,%ecx
jle    139c <main+0x24c>
jmp    13a9 <main+0x259>
mov    0xc(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0xf,%eax
jne    1398 <main+0x248>
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
jmp    13a9 <main+0x259>
test   %ecx,%ecx
jg     13a9 <main+0x259>
movl   $0xe,0xc(%rsp)
mov    $0xe,%eax
mov    %eax,%eax
movslq 0x8(%rsp),%rcx
lea    (%rax,%rax,4),%rax
lea    (%rax,%rax,2),%rax
add    %rsp,%rax
add    $0x10,%rax
movb   $0x78,(%rcx,%rax,1)
jmp    1232 <main+0xe2>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"Type:\0A\09w to go up\0A\09a to go left\0A\09s to go down\0A\09d to go right\0A\0A\09x to quit.\00"
@.str.1 = [71 x i8] c"Enter the initial coordinates of the cursor(Max x= %d and Max y= %d): \00"
@.str.2 = [6 x i8] c"%d\0A%d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [15 x [15 x i8]]
%12 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
store i32 0, i32* %9
br label %13
13: ; preds = %31, %2
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 15
br i1 %15, label %16, label %34
16: ; preds = %13
store i32 0, i32* %10
br label %17
17: ; preds = %27, %16
%18 = load i32, i32* %10
%19 = icmp slt i32 %18, 15
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %22
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [15 x i8], [15 x i8]* %23, i64 0, i64 %25
store i8 32, i8* %26
br label %27
27: ; preds = %20
%28 = load i32, i32* %10
%29 = add nsw i32 %28, 1
store i32 %29, i32* %10
br label %17
30: ; preds = %17
br label %31
31: ; preds = %30
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %13
34: ; preds = %13
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
br label %36
36: ; preds = %34, %164, %170
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 15, i32 15)
%41 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %6, i32* %7)
store i32 0, i32* %8
br label %42
42: ; preds = %39, %36
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = call signext i8 (...) @getchar()
store i8 %44, i8* %12
%45 = load i8, i8* %12
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 120
br i1 %47, label %48, label %49
48: ; preds = %42
br label %174
49: ; preds = %42
%50 = load i8, i8* %12
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 119
br i1 %52, label %53, label %71
53: ; preds = %49
%54 = load i32, i32* %6
%55 = add nsw i32 %54, -1
store i32 %55, i32* %6
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 15
br i1 %57, label %58, label %59
58: ; preds = %53
store i32 0, i32* %6
br label %64
59: ; preds = %53
%60 = load i32, i32* %6
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %59
store i32 14, i32* %6
br label %63
63: ; preds = %62, %59
br label %64
64: ; preds = %63, %58
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %66
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [15 x i8], [15 x i8]* %67, i64 0, i64 %69
store i8 120, i8* %70
br label %169
71: ; preds = %49
%72 = load i8, i8* %12
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 115
br i1 %74, label %75, label %93
75: ; preds = %71
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
%78 = load i32, i32* %6
%79 = icmp eq i32 %78, 15
br i1 %79, label %80, label %81
80: ; preds = %75
store i32 0, i32* %6
br label %86
81: ; preds = %75
%82 = load i32, i32* %6
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %81
store i32 14, i32* %6
br label %85
85: ; preds = %84, %81
br label %86
86: ; preds = %85, %80
%87 = load i32, i32* %6
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %88
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [15 x i8], [15 x i8]* %89, i64 0, i64 %91
store i8 120, i8* %92
br label %168
93: ; preds = %71
%94 = load i8, i8* %12
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 97
br i1 %96, label %97, label %115
97: ; preds = %93
%98 = load i32, i32* %7
%99 = add nsw i32 %98, -1
store i32 %99, i32* %7
%100 = load i32, i32* %7
%101 = icmp eq i32 %100, 15
br i1 %101, label %102, label %103
102: ; preds = %97
store i32 0, i32* %7
br label %108
103: ; preds = %97
%104 = load i32, i32* %7
%105 = icmp slt i32 %104, 0
br i1 %105, label %106, label %107
106: ; preds = %103
store i32 14, i32* %7
br label %107
107: ; preds = %106, %103
br label %108
108: ; preds = %107, %102
%109 = load i32, i32* %6
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %110
%112 = load i32, i32* %7
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [15 x i8], [15 x i8]* %111, i64 0, i64 %113
store i8 120, i8* %114
br label %167
115: ; preds = %93
%116 = load i8, i8* %12
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 100
br i1 %118, label %119, label %137
119: ; preds = %115
%120 = load i32, i32* %7
%121 = add nsw i32 %120, 1
store i32 %121, i32* %7
%122 = load i32, i32* %7
%123 = icmp eq i32 %122, 15
br i1 %123, label %124, label %125
124: ; preds = %119
store i32 0, i32* %7
br label %130
125: ; preds = %119
%126 = load i32, i32* %7
%127 = icmp slt i32 %126, 0
br i1 %127, label %128, label %129
128: ; preds = %125
store i32 14, i32* %7
br label %129
129: ; preds = %128, %125
br label %130
130: ; preds = %129, %124
%131 = load i32, i32* %6
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %132
%134 = load i32, i32* %7
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [15 x i8], [15 x i8]* %133, i64 0, i64 %135
store i8 120, i8* %136
br label %166
137: ; preds = %115
%138 = load i8, i8* %12
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 99
br i1 %140, label %141, label %164
141: ; preds = %137
store i32 0, i32* %9
br label %142
142: ; preds = %160, %141
%143 = load i32, i32* %9
%144 = icmp slt i32 %143, 15
br i1 %144, label %145, label %163
145: ; preds = %142
store i32 0, i32* %10
br label %146
146: ; preds = %156, %145
%147 = load i32, i32* %10
%148 = icmp slt i32 %147, 15
br i1 %148, label %149, label %159
149: ; preds = %146
%150 = load i32, i32* %9
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 %151
%153 = load i32, i32* %10
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [15 x i8], [15 x i8]* %152, i64 0, i64 %154
store i8 32, i8* %155
br label %156
156: ; preds = %149
%157 = load i32, i32* %10
%158 = add nsw i32 %157, 1
store i32 %158, i32* %10
br label %146
159: ; preds = %146
br label %160
160: ; preds = %159
%161 = load i32, i32* %9
%162 = add nsw i32 %161, 1
store i32 %162, i32* %9
br label %142
163: ; preds = %142
store i32 0, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
br label %165
164: ; preds = %137
br label %36
165: ; preds = %163
br label %166
166: ; preds = %165, %130
br label %167
167: ; preds = %166, %108
br label %168
168: ; preds = %167, %86
br label %169
169: ; preds = %168, %64
br label %170
170: ; preds = %169
%171 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %11, i64 0, i64 0
%172 = bitcast [15 x i8]* %171 to i8**
%173 = call i32 @print_screen(i8** %172)
br label %36
174: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"Type:\0A\09w to go up\0A\09a to go left\0A\09s to go down\0A\09d to go right\0A\0A\09x to quit.\00"
@.str.1 = [71 x i8] c"Enter the initial coordinates of the cursor(Max x= %d and Max y= %d): \00"
@.str.2 = [6 x i8] c"%d\0A%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [15 x [15 x i8]]
%6 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 0, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%11 = bitcast [15 x [15 x i8]]* %5 to i8**
br label %12
12: ; preds = %81, %2
%13 = phi i32 [ 1, %2 ], [ %82, %81 ]
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 15, i32 15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4)
br label %18
18: ; preds = %15, %12
%19 = call i32 @putchar(i32 10)
%20 = call signext i8 (...) @getchar()
switch i8 %20, label %81 [
i8 120, label %83
i8 119, label %22
i8 115, label %36
i8 97, label %50
i8 100, label %64
i8 99, label %21
]
21: ; preds = %18
store i32 0, i32* %3
store i32 0, i32* %4
br label %78
22: ; preds = %18
%23 = load i32, i32* %3
%24 = add nsw i32 %23, -1
store i32 %24, i32* %3
%25 = icmp eq i32 %24, 15
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 0, i32* %3
br label %30
27: ; preds = %22
%28 = icmp slt i32 %23, 1
br i1 %28, label %29, label %30
29: ; preds = %27
store i32 14, i32* %3
br label %30
30: ; preds = %27, %29, %26
%31 = phi i32 [ %24, %27 ], [ 14, %29 ], [ 0, %26 ]
%32 = zext i32 %31 to i64
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 %32, i64 %34
store i8 120, i8* %35
br label %78
36: ; preds = %18
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
%39 = icmp eq i32 %38, 15
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 0, i32* %3
br label %44
41: ; preds = %36
%42 = icmp slt i32 %37, -1
br i1 %42, label %43, label %44
43: ; preds = %41
store i32 14, i32* %3
br label %44
44: ; preds = %41, %43, %40
%45 = phi i32 [ %38, %41 ], [ 14, %43 ], [ 0, %40 ]
%46 = zext i32 %45 to i64
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 %46, i64 %48
store i8 120, i8* %49
br label %78
50: ; preds = %18
%51 = load i32, i32* %4
%52 = add nsw i32 %51, -1
store i32 %52, i32* %4
%53 = icmp eq i32 %52, 15
br i1 %53, label %54, label %55
54: ; preds = %50
store i32 0, i32* %4
br label %58
55: ; preds = %50
%56 = icmp slt i32 %51, 1
br i1 %56, label %57, label %58
57: ; preds = %55
store i32 14, i32* %4
br label %58
58: ; preds = %55, %57, %54
%59 = phi i32 [ %52, %55 ], [ 14, %57 ], [ 0, %54 ]
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = zext i32 %59 to i64
%63 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 %61, i64 %62
store i8 120, i8* %63
br label %78
64: ; preds = %18
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
store i32 %66, i32* %4
%67 = icmp eq i32 %66, 15
br i1 %67, label %68, label %69
68: ; preds = %64
store i32 0, i32* %4
br label %72
69: ; preds = %64
%70 = icmp slt i32 %65, -1
br i1 %70, label %71, label %72
71: ; preds = %69
store i32 14, i32* %4
br label %72
72: ; preds = %69, %71, %68
%73 = phi i32 [ %66, %69 ], [ 14, %71 ], [ 0, %68 ]
%74 = load i32, i32* %3
%75 = sext i32 %74 to i64
%76 = zext i32 %73 to i64
%77 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %5, i64 0, i64 %75, i64 %76
store i8 120, i8* %77
br label %78
78: ; preds = %30, %58, %21, %72, %44
%79 = phi i32 [ 0, %30 ], [ 0, %44 ], [ 0, %58 ], [ 0, %72 ], [ 1, %21 ]
%80 = call i32 @print_screen(i8** %11)
br label %81
81: ; preds = %78, %18
%82 = phi i32 [ %79, %78 ], [ 0, %18 ]
br label %12
83: ; preds = %18
ret i32 0
}