#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char field[10][10] = {};
  char direction;
  int robotX = 0;
  int robotY = 0;
  int wrongmove = 0;
  int resetarray = 0;
  int i = 0, j = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      field[i][j] = '.';
    }
  }
  field[0][0] = 'A';
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      printf("%c", field[i][j]);
    }
    printf("\n");
  }
  for (char ch = 'A'; ch <= 'Z'; ch++) {
    if (robotX == 0 && robotY == 0) {
      ch = 'B';
    }
    if (resetarray == 1) {
      ch = 'A';
      resetarray = 0;
    }
    printf("Enter direction command: ");
    scanf(" %c", &direction);
    printf("\n");
    switch (direction) {
    case ('n'):
      if (robotX == 0 || field[robotX - 1][robotY] != '.') {
        printf("You cannot go there!\n");
        wrongmove = 1;
      } else {
        robotX -= 1;
      }
      break;
    case ('e'):
      if (robotY == 9 || field[robotX][robotY + 1] != '.') {
        printf("You cannot go there!\n");
        wrongmove = 1;
      } else {
        robotY += 1;
      }
      break;
    case ('s'):
      if (robotX == 9 || field[robotX + 1][robotY] != '.') {
        printf("You cannot go there!\n");
        wrongmove = 1;
      } else {
        robotX += 1;
      }
      break;
    case ('w'):
      if (robotY == 0 || field[robotX][robotY - 1] != '.') {
        printf("You cannot go there!\n");
        wrongmove = 1;
      } else {
        robotY -= 1;
      }
      break;
    case ('x'):
      exit(0);
      break;
    }
    if (wrongmove != 1) {
      for (i = 0; i < 10; i++) {
        for (j = 0; j < 10; j++) {
          if (i == robotX && j == robotY) {
            field[i][j] = ch;
          }
          printf("%c", field[i][j]);
        }
        printf("\n");
      }
    } else {
      ch--;
    }
    wrongmove = 0;
    if (ch == 'Z') {
      ch = 'A';
      resetarray = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0xa,-0x88(%rbp)
jge    120d <main+0xcd>
movl   $0x0,-0x8c(%rbp)
cmpl   $0xa,-0x8c(%rbp)
jge    11f4 <main+0xb4>
movslq -0x88(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x8c(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    11b6 <main+0x76>
jmp    11f9 <main+0xb9>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    119f <main+0x5f>
movb   $0x41,-0x70(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0xa,-0x88(%rbp)
jge    12a0 <main+0x160>
movl   $0x0,-0x8c(%rbp)
cmpl   $0xa,-0x8c(%rbp)
jge    127e <main+0x13e>
movslq -0x88(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1232 <main+0xf2>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    121b <main+0xdb>
movb   $0x41,-0x8d(%rbp)
movsbl -0x8d(%rbp),%eax
cmp    $0x5a,%eax
jg     15e5 <main+0x4a5>
cmpl   $0x0,-0x78(%rbp)
jne    12d2 <main+0x192>
cmpl   $0x0,-0x7c(%rbp)
jne    12d2 <main+0x192>
movb   $0x42,-0x8d(%rbp)
cmpl   $0x1,-0x84(%rbp)
jne    12f0 <main+0x1b0>
movb   $0x41,-0x8d(%rbp)
movl   $0x0,-0x84(%rbp)
lea    0xd59(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x99(%rbp)
call   1030 <printf@plt>
lea    0xd5f(%rip),%rdi
lea    -0x71(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x99(%rbp),%al
lea    0xd61(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x71(%rbp),%eax
add    $0xffffff9b,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x13,%eax
ja     14b9 <main+0x379>
mov    -0x98(%rbp),%rax
lea    0xcb3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x78(%rbp)
je     1385 <main+0x245>
mov    -0x78(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x7c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     139f <main+0x25f>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x80(%rbp)
jmp    13a8 <main+0x268>
mov    -0x78(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    14b9 <main+0x379>
cmpl   $0x9,-0x7c(%rbp)
je     13dc <main+0x29c>
movslq -0x78(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
mov    -0x7c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     13f6 <main+0x2b6>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x80(%rbp)
jmp    13ff <main+0x2bf>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    14b9 <main+0x379>
cmpl   $0x9,-0x78(%rbp)
je     1433 <main+0x2f3>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x7c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     144d <main+0x30d>
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x80(%rbp)
jmp    1456 <main+0x316>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    14b9 <main+0x379>
cmpl   $0x0,-0x7c(%rbp)
je     148a <main+0x34a>
movslq -0x78(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
mov    -0x7c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     14a4 <main+0x364>
lea    0xbdd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x80(%rbp)
jmp    14ad <main+0x36d>
mov    -0x7c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    14b9 <main+0x379>
xor    %edi,%edi
call   1060 <exit@plt>
cmpl   $0x1,-0x80(%rbp)
je     1597 <main+0x457>
movl   $0x0,-0x88(%rbp)
cmpl   $0xa,-0x88(%rbp)
jge    1592 <main+0x452>
movl   $0x0,-0x8c(%rbp)
cmpl   $0xa,-0x8c(%rbp)
jge    1570 <main+0x430>
mov    -0x88(%rbp),%eax
cmp    -0x78(%rbp),%eax
jne    1531 <main+0x3f1>
mov    -0x8c(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jne    1531 <main+0x3f1>
mov    -0x8d(%rbp),%dl
movslq -0x88(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x8c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movslq -0x88(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xb16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    14e4 <main+0x3a4>
lea    0xb0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    14cd <main+0x38d>
jmp    15a5 <main+0x465>
mov    -0x8d(%rbp),%al
add    $0xff,%al
mov    %al,-0x8d(%rbp)
movl   $0x0,-0x80(%rbp)
movsbl -0x8d(%rbp),%eax
cmp    $0x5a,%eax
jne    15cd <main+0x48d>
movb   $0x41,-0x8d(%rbp)
movl   $0x1,-0x84(%rbp)
jmp    15d2 <main+0x492>
mov    -0x8d(%rbp),%al
add    $0x1,%al
mov    %al,-0x8d(%rbp)
jmp    12a7 <main+0x167>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movl   $0x2e2e2e2e,0x70(%rsp)
2e
movb   $0x41,0x10(%rsp)
mov    $0x41,%al
mov    $0xa,%ebx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movsbl 0x7(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x8(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0x9(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xa(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xb(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xc(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xd(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xe(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl 0xf(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x64,%rbx
je     121d <main+0xcd>
movzbl 0x10(%rsp,%rbx,1),%eax
add    $0xa,%rbx
jmp    11a0 <main+0x50>
mov    $0x41,%al
mov    $0x42,%ebx
mov    $0x41,%r14d
lea    0xe2f(%rip),%r12
lea    0xe42(%rip),%rbp
xor    %ecx,%ecx
xor    %r13d,%r13d
xor    %edx,%edx
mov    %rdx,0x8(%rsp)
jmp    127b <main+0x12b>
cs nopw 0x0(%rax,%rax,1)
lea    0xe27(%rip),%rdi
call   1040 <puts@plt>
add    $0xff,%r15b
lea    0x1(%r15),%eax
xor    %ecx,%ecx
cmp    $0x5a,%r15b
sete   %cl
movzbl %al,%eax
cmove  %ebx,%eax
cmp    $0x5b,%al
jge    14ee <main+0x39e>
movzbl %al,%r15d
mov    0x8(%rsp),%rax
or     %r13d,%eax
cmove  %ebx,%r15d
cmp    $0x1,%ecx
cmove  %r14d,%r15d
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
lea    0x7(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsbl 0x7(%rsp),%eax
add    $0xffffff9b,%eax
cmp    $0x13,%eax
ja     1380 <main+0x230>
lea    0xd45(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x9,%r13d
je     1250 <main+0x100>
movslq 0x8(%rsp),%rax
movslq %r13d,%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,2),%rax
add    $0x10,%rax
cmpb   $0x2e,0x1(%rcx,%rax,1)
jne    1250 <main+0x100>
add    $0x1,%r13d
jmp    1380 <main+0x230>
cmpl   $0x0,0x8(%rsp)
je     1250 <main+0x100>
mov    0x8(%rsp),%rax
add    $0xffffffff,%eax
jmp    132b <main+0x1db>
cmpl   $0x9,0x8(%rsp)
je     1250 <main+0x100>
mov    0x8(%rsp),%rax
add    $0x1,%eax
movslq %eax,%rcx
movslq %r13d,%rdx
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,2),%rcx
add    $0x10,%rcx
cmpb   $0x2e,(%rdx,%rcx,1)
jne    1250 <main+0x100>
mov    %rax,0x8(%rsp)
jmp    1380 <main+0x230>
test   %r13d,%r13d
je     1250 <main+0x100>
movslq 0x8(%rsp),%rax
movslq %r13d,%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,2),%rax
add    $0x10,%rax
cmpb   $0x2e,-0x1(%rcx,%rax,1)
jne    1250 <main+0x100>
add    $0xffffffff,%r13d
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%eax
add    %rax,%rax
lea    (%rax,%rax,4),%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
mov    %r12,%rbp
or     $0x1,%rbp
xor    %r14d,%r14d
jmp    13c3 <main+0x273>
nop
movsbl 0x19(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xa,%r14
cmp    $0x64,%r14
je     14d0 <main+0x380>
cmp    %r14,%rbx
jne    13d1 <main+0x281>
test   %r13d,%r13d
jne    13d1 <main+0x281>
mov    %r15b,(%r12)
movsbl 0x10(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    13eb <main+0x29b>
cmp    $0x1,%r13d
jne    13eb <main+0x29b>
mov    %r15b,0x0(%rbp)
movsbl 0x11(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    1406 <main+0x2b6>
cmp    $0x2,%r13d
jne    1406 <main+0x2b6>
mov    %r15b,0x2(%r12)
movsbl 0x12(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    1421 <main+0x2d1>
cmp    $0x3,%r13d
jne    1421 <main+0x2d1>
mov    %r15b,0x3(%r12)
movsbl 0x13(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    143c <main+0x2ec>
cmp    $0x4,%r13d
jne    143c <main+0x2ec>
mov    %r15b,0x4(%r12)
movsbl 0x14(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    1457 <main+0x307>
cmp    $0x5,%r13d
jne    1457 <main+0x307>
mov    %r15b,0x5(%r12)
movsbl 0x15(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    1472 <main+0x322>
cmp    $0x6,%r13d
jne    1472 <main+0x322>
mov    %r15b,0x6(%r12)
movsbl 0x16(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    148d <main+0x33d>
cmp    $0x7,%r13d
jne    148d <main+0x33d>
mov    %r15b,0x7(%r12)
movsbl 0x17(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    14a8 <main+0x358>
cmp    $0x8,%r13d
jne    14a8 <main+0x358>
mov    %r15b,0x8(%r12)
movsbl 0x18(%rsp,%r14,1),%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jne    13a0 <main+0x250>
cmp    $0x9,%r13d
jne    13a0 <main+0x250>
mov    %r15b,0x9(%r12)
jmp    13a0 <main+0x250>
mov    $0x42,%ebx
mov    $0x41,%r14d
lea    0xb7e(%rip),%r12
lea    0xb91(%rip),%rbp
jmp    1260 <main+0x110>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [26 x i8] c"Enter direction command: \00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [22 x i8] c"You cannot go there!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i8]]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %1
%11 = bitcast [10 x [10 x i8]]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %8
br label %12
12: ; preds = %30, %0
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %33
15: ; preds = %12
store i32 0, i32* %9
br label %16
16: ; preds = %26, %15
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %21
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %22, i64 0, i64 %24
store i8 46, i8* %25
br label %26
26: ; preds = %19
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %16
29: ; preds = %16
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %12
33: ; preds = %12
%34 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 0
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %34, i64 0, i64 0
store i8 65, i8* %35
store i32 0, i32* %8
br label %36
36: ; preds = %58, %33
%37 = load i32, i32* %8
%38 = icmp slt i32 %37, 10
br i1 %38, label %39, label %61
39: ; preds = %36
store i32 0, i32* %9
br label %40
40: ; preds = %53, %39
%41 = load i32, i32* %9
%42 = icmp slt i32 %41, 10
br i1 %42, label %43, label %56
43: ; preds = %40
%44 = load i32, i32* %8
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %45
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i8], [10 x i8]* %46, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %43
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %40
56: ; preds = %40
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %8
%60 = add nsw i32 %59, 1
store i32 %60, i32* %8
br label %36
61: ; preds = %36
store i8 65, i8* %10
br label %62
62: ; preds = %220, %61
%63 = load i8, i8* %10
%64 = sext i8 %63 to i32
%65 = icmp sle i32 %64, 90
br i1 %65, label %66, label %223
66: ; preds = %62
%67 = load i32, i32* %4
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = load i32, i32* %5
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %69
store i8 66, i8* %10
br label %73
73: ; preds = %72, %69, %66
%74 = load i32, i32* %7
%75 = icmp eq i32 %74, 1
br i1 %75, label %76, label %77
76: ; preds = %73
store i8 65, i8* %10
store i32 0, i32* %7
br label %77
77: ; preds = %76, %73
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%79 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%81 = load i8, i8* %3
%82 = sext i8 %81 to i32
switch i32 %82, label %165 [
i32 110, label %83
i32 101, label %103
i32 115, label %123
i32 119, label %143
i32 120, label %163
]
83: ; preds = %77
%84 = load i32, i32* %4
%85 = icmp eq i32 %84, 0
br i1 %85, label %97, label %86
86: ; preds = %83
%87 = load i32, i32* %4
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %89
%91 = load i32, i32* %5
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %90, i64 0, i64 %92
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp ne i32 %95, 46
br i1 %96, label %97, label %99
97: ; preds = %86, %83
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %6
br label %102
99: ; preds = %86
%100 = load i32, i32* %4
%101 = sub nsw i32 %100, 1
store i32 %101, i32* %4
br label %102
102: ; preds = %99, %97
br label %165
103: ; preds = %77
%104 = load i32, i32* %5
%105 = icmp eq i32 %104, 9
br i1 %105, label %117, label %106
106: ; preds = %103
%107 = load i32, i32* %4
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %108
%110 = load i32, i32* %5
%111 = add nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [10 x i8], [10 x i8]* %109, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp ne i32 %115, 46
br i1 %116, label %117, label %119
117: ; preds = %106, %103
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %6
br label %122
119: ; preds = %106
%120 = load i32, i32* %5
%121 = add nsw i32 %120, 1
store i32 %121, i32* %5
br label %122
122: ; preds = %119, %117
br label %165
123: ; preds = %77
%124 = load i32, i32* %4
%125 = icmp eq i32 %124, 9
br i1 %125, label %137, label %126
126: ; preds = %123
%127 = load i32, i32* %4
%128 = add nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %129
%131 = load i32, i32* %5
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [10 x i8], [10 x i8]* %130, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp ne i32 %135, 46
br i1 %136, label %137, label %139
137: ; preds = %126, %123
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %6
br label %142
139: ; preds = %126
%140 = load i32, i32* %4
%141 = add nsw i32 %140, 1
store i32 %141, i32* %4
br label %142
142: ; preds = %139, %137
br label %165
143: ; preds = %77
%144 = load i32, i32* %5
%145 = icmp eq i32 %144, 0
br i1 %145, label %157, label %146
146: ; preds = %143
%147 = load i32, i32* %4
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %148
%150 = load i32, i32* %5
%151 = sub nsw i32 %150, 1
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [10 x i8], [10 x i8]* %149, i64 0, i64 %152
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp ne i32 %155, 46
br i1 %156, label %157, label %159
157: ; preds = %146, %143
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %6
br label %162
159: ; preds = %146
%160 = load i32, i32* %5
%161 = sub nsw i32 %160, 1
store i32 %161, i32* %5
br label %162
162: ; preds = %159, %157
br label %165
163: ; preds = %77
%164 = call i32 @exit(i32 0)
unreachable
165: ; preds = %77, %162, %142, %122, %102
%166 = load i32, i32* %6
%167 = icmp ne i32 %166, 1
br i1 %167, label %168, label %211
168: ; preds = %165
store i32 0, i32* %8
br label %169
169: ; preds = %207, %168
%170 = load i32, i32* %8
%171 = icmp slt i32 %170, 10
br i1 %171, label %172, label %210
172: ; preds = %169
store i32 0, i32* %9
br label %173
173: ; preds = %202, %172
%174 = load i32, i32* %9
%175 = icmp slt i32 %174, 10
br i1 %175, label %176, label %205
176: ; preds = %173
%177 = load i32, i32* %8
%178 = load i32, i32* %4
%179 = icmp eq i32 %177, %178
br i1 %179, label %180, label %192
180: ; preds = %176
%181 = load i32, i32* %9
%182 = load i32, i32* %5
%183 = icmp eq i32 %181, %182
br i1 %183, label %184, label %192
184: ; preds = %180
%185 = load i8, i8* %10
%186 = load i32, i32* %8
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %187
%189 = load i32, i32* %9
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [10 x i8], [10 x i8]* %188, i64 0, i64 %190
store i8 %185, i8* %191
br label %192
192: ; preds = %184, %180, %176
%193 = load i32, i32* %8
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %194
%196 = load i32, i32* %9
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [10 x i8], [10 x i8]* %195, i64 0, i64 %197
%199 = load i8, i8* %198
%200 = sext i8 %199 to i32
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %200)
br label %202
202: ; preds = %192
%203 = load i32, i32* %9
%204 = add nsw i32 %203, 1
store i32 %204, i32* %9
br label %173
205: ; preds = %173
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %207
207: ; preds = %205
%208 = load i32, i32* %8
%209 = add nsw i32 %208, 1
store i32 %209, i32* %8
br label %169
210: ; preds = %169
br label %214
211: ; preds = %165
%212 = load i8, i8* %10
%213 = add i8 %212, -1
store i8 %213, i8* %10
br label %214
214: ; preds = %211, %210
store i32 0, i32* %6
%215 = load i8, i8* %10
%216 = sext i8 %215 to i32
%217 = icmp eq i32 %216, 90
br i1 %217, label %218, label %219
218: ; preds = %214
store i8 65, i8* %10
store i32 1, i32* %7
br label %219
219: ; preds = %218, %214
br label %220
220: ; preds = %219
%221 = load i8, i8* %10
%222 = add i8 %221, 1
store i8 %222, i8* %10
br label %62
223: ; preds = %62
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [26 x i8] c"Enter direction command: \00"
@.str.3 = [4 x i8] c" %c\00"
@str.7 = [21 x i8] c"You cannot go there!\00"
define i32 @main() {
%1 = alloca [10 x [10 x i8]]
%2 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = alloca i8
%4 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 0, i64 0
store i8 65, i8* %4
br label %5
5: ; preds = %49, %0
%6 = phi i8 [ 65, %0 ], [ %51, %49 ]
%7 = phi i64 [ 0, %0 ], [ %47, %49 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 @putchar(i32 %16)
%18 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = tail call i32 @putchar(i32 %20)
%22 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 @putchar(i32 %24)
%26 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = tail call i32 @putchar(i32 %28)
%30 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 6
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = tail call i32 @putchar(i32 %32)
%34 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 7
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = tail call i32 @putchar(i32 %36)
%38 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 8
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = tail call i32 @putchar(i32 %40)
%42 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %7, i64 9
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = tail call i32 @putchar(i32 %44)
%46 = tail call i32 @putchar(i32 10)
%47 = add nuw nsw i64 %7, 1
%48 = icmp eq i64 %47, 10
br i1 %48, label %53, label %49
49: ; preds = %5
%50 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %47, i64 0
%51 = load i8, i8* %50
br label %5
52: ; preds = %209
ret i32 0
53: ; preds = %5, %209
%54 = phi i8 [ %216, %209 ], [ 65, %5 ]
%55 = phi i32 [ %214, %209 ], [ 0, %5 ]
%56 = phi i32 [ %210, %209 ], [ 0, %5 ]
%57 = phi i32 [ %211, %209 ], [ 0, %5 ]
%58 = icmp eq i32 %57, 0
%59 = icmp eq i32 %56, 0
%60 = select i1 %58, i1 %59, i1 false
%61 = select i1 %60, i8 66, i8 %54
%62 = icmp eq i32 %55, 1
%63 = select i1 %62, i8 65, i8 %61
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%65 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%66 = call i32 @putchar(i32 10)
%67 = load i8, i8* %3
%68 = sext i8 %67 to i32
switch i32 %68, label %105 [
i32 110, label %69
i32 101, label %77
i32 115, label %86
i32 119, label %95
i32 120, label %103
]
69: ; preds = %53
br i1 %58, label %205, label %70
70: ; preds = %69
%71 = add nsw i32 %57, -1
%72 = sext i32 %71 to i64
%73 = sext i32 %56 to i64
%74 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %72, i64 %73
%75 = load i8, i8* %74
%76 = icmp eq i8 %75, 46
br i1 %76, label %105, label %205
77: ; preds = %53
%78 = icmp eq i32 %56, 9
br i1 %78, label %205, label %79
79: ; preds = %77
%80 = sext i32 %57 to i64
%81 = add nsw i32 %56, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %80, i64 %82
%84 = load i8, i8* %83
%85 = icmp eq i8 %84, 46
br i1 %85, label %105, label %205
86: ; preds = %53
%87 = icmp eq i32 %57, 9
br i1 %87, label %205, label %88
88: ; preds = %86
%89 = add nsw i32 %57, 1
%90 = sext i32 %89 to i64
%91 = sext i32 %56 to i64
%92 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %90, i64 %91
%93 = load i8, i8* %92
%94 = icmp eq i8 %93, 46
br i1 %94, label %105, label %205
95: ; preds = %53
br i1 %59, label %205, label %96
96: ; preds = %95
%97 = sext i32 %57 to i64
%98 = add nsw i32 %56, -1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %97, i64 %99
%101 = load i8, i8* %100
%102 = icmp eq i8 %101, 46
br i1 %102, label %105, label %205
103: ; preds = %53
%104 = call i32 @exit(i32 0)
unreachable
105: ; preds = %96, %88, %79, %70, %53
%106 = phi i32 [ %57, %53 ], [ %71, %70 ], [ %57, %79 ], [ %89, %88 ], [ %57, %96 ]
%107 = phi i32 [ %56, %53 ], [ %56, %70 ], [ %81, %79 ], [ %56, %88 ], [ %98, %96 ]
%108 = zext i32 %106 to i64
%109 = icmp eq i32 %107, 0
%110 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 0
%111 = icmp eq i32 %107, 1
%112 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 1
%113 = icmp eq i32 %107, 2
%114 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 2
%115 = icmp eq i32 %107, 3
%116 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 3
%117 = icmp eq i32 %107, 4
%118 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 4
%119 = icmp eq i32 %107, 5
%120 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 5
%121 = icmp eq i32 %107, 6
%122 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 6
%123 = icmp eq i32 %107, 7
%124 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 7
%125 = icmp eq i32 %107, 8
%126 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 8
%127 = icmp eq i32 %107, 9
%128 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %108, i64 9
br label %129
129: ; preds = %105, %197
%130 = phi i64 [ 0, %105 ], [ %203, %197 ]
%131 = icmp eq i64 %130, %108
%132 = select i1 %131, i1 %109, i1 false
br i1 %132, label %133, label %134
133: ; preds = %129
store i8 %63, i8* %110
br label %134
134: ; preds = %133, %129
%135 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 0
%136 = load i8, i8* %135
%137 = sext i8 %136 to i32
%138 = call i32 @putchar(i32 %137)
%139 = select i1 %131, i1 %111, i1 false
br i1 %139, label %140, label %141
140: ; preds = %134
store i8 %63, i8* %112
br label %141
141: ; preds = %140, %134
%142 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 1
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = call i32 @putchar(i32 %144)
%146 = select i1 %131, i1 %113, i1 false
br i1 %146, label %147, label %148
147: ; preds = %141
store i8 %63, i8* %114
br label %148
148: ; preds = %147, %141
%149 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 2
%150 = load i8, i8* %149
%151 = sext i8 %150 to i32
%152 = call i32 @putchar(i32 %151)
%153 = select i1 %131, i1 %115, i1 false
br i1 %153, label %154, label %155
154: ; preds = %148
store i8 %63, i8* %116
br label %155
155: ; preds = %154, %148
%156 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 3
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = call i32 @putchar(i32 %158)
%160 = select i1 %131, i1 %117, i1 false
br i1 %160, label %161, label %162
161: ; preds = %155
store i8 %63, i8* %118
br label %162
162: ; preds = %161, %155
%163 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 4
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = call i32 @putchar(i32 %165)
%167 = select i1 %131, i1 %119, i1 false
br i1 %167, label %168, label %169
168: ; preds = %162
store i8 %63, i8* %120
br label %169
169: ; preds = %168, %162
%170 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 5
%171 = load i8, i8* %170
%172 = sext i8 %171 to i32
%173 = call i32 @putchar(i32 %172)
%174 = select i1 %131, i1 %121, i1 false
br i1 %174, label %175, label %176
175: ; preds = %169
store i8 %63, i8* %122
br label %176
176: ; preds = %175, %169
%177 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 6
%178 = load i8, i8* %177
%179 = sext i8 %178 to i32
%180 = call i32 @putchar(i32 %179)
%181 = select i1 %131, i1 %123, i1 false
br i1 %181, label %182, label %183
182: ; preds = %176
store i8 %63, i8* %124
br label %183
183: ; preds = %182, %176
%184 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 7
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = call i32 @putchar(i32 %186)
%188 = select i1 %131, i1 %125, i1 false
br i1 %188, label %189, label %190
189: ; preds = %183
store i8 %63, i8* %126
br label %190
190: ; preds = %189, %183
%191 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 8
%192 = load i8, i8* %191
%193 = sext i8 %192 to i32
%194 = call i32 @putchar(i32 %193)
%195 = select i1 %131, i1 %127, i1 false
br i1 %195, label %196, label %197
196: ; preds = %190
store i8 %63, i8* %128
br label %197
197: ; preds = %196, %190
%198 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 %130, i64 9
%199 = load i8, i8* %198
%200 = sext i8 %199 to i32
%201 = call i32 @putchar(i32 %200)
%202 = call i32 @putchar(i32 10)
%203 = add nuw nsw i64 %130, 1
%204 = icmp eq i64 %203, 10
br i1 %204, label %209, label %129
205: ; preds = %95, %96, %86, %88, %77, %79, %69, %70
%206 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %70 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %69 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %79 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %77 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %88 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %86 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %96 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), %95 ]
%207 = call i32 @puts(i8* dereferenceable(1) %206)
%208 = add i8 %63, -1
br label %209
209: ; preds = %197, %205
%210 = phi i32 [ %56, %205 ], [ %107, %197 ]
%211 = phi i32 [ %57, %205 ], [ %106, %197 ]
%212 = phi i8 [ %208, %205 ], [ %63, %197 ]
%213 = icmp eq i8 %212, 90
%214 = zext i1 %213 to i32
%215 = add i8 %212, 1
%216 = select i1 %213, i8 66, i8 %215
%217 = icmp slt i8 %216, 91
br i1 %217, label %53, label %52
}