#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*/ dump_board(char **, int, int);
int /*<<< orphan*/ find_e2w(char *, char **, int, int);
int /*<<< orphan*/ find_n2s(char *, char **, int, int);
int /*<<< orphan*/ find_ne2sw(char *, char **, int, int);
int /*<<< orphan*/ find_nw2se(char *, char **, int, int);
int /*<<< orphan*/ find_s2n(char *, char **, int, int);
int /*<<< orphan*/ find_se2nw(char *, char **, int, int);
int /*<<< orphan*/ find_sw2ne(char *, char **, int, int);
int /*<<< orphan*/ find_w2e(char *, char **, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *get_string();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_puzzle(char **, char *, int *, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char board[40][40], board_copy[40][40];
  int nrows, ncols, i, j;
  char *input;
  if (argc != 2) {
    fprintf(stderr, "expected single cmd-line arg (filename)\n");
    return 0;
  }
  if (!read_puzzle(board, argv[1], &nrows, &ncols))
    fprintf(stderr, "ERROR in reading board %s\n", argv[1]);
  else {
    printf("successfully read board\n");
    dump_board(board, nrows, ncols);
    while (*(input = get_string()) != '.') {
      for (i = 0; i < nrows; i++) {
        for (j = 0; j < ncols; j++) {
          board_copy[i][j] = board[i][j];
        }
      }
      find_w2e(input, board_copy, nrows, ncols);
      find_e2w(input, board_copy, nrows, ncols);
      find_n2s(input, board_copy, nrows, ncols);
      find_s2n(input, board_copy, nrows, ncols);
      find_nw2se(input, board_copy, nrows, ncols);
      find_se2nw(input, board_copy, nrows, ncols);
      find_sw2ne(input, board_copy, nrows, ncols);
      find_ne2sw(input, board_copy, nrows, ncols);
      dump_board(board_copy, nrows, ncols);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xcb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1216 <main+0x46>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1460 <main+0x290>
lea    -0x650(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0xc94(%rbp),%rdx
lea    -0xc98(%rbp),%rcx
call   10e0 <read_puzzle@plt>
cmp    $0x0,%eax
jne    1265 <main+0x95>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdd0(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    1460 <main+0x290>
lea    0xdd8(%rip),%rdi
call   1080 <printf@plt>
lea    -0x650(%rbp),%rdi
mov    -0xc94(%rbp),%esi
mov    -0xc98(%rbp),%edx
call   10b0 <dump_board@plt>
mov    $0x0,%al
call   1070 <get_string@plt>
mov    %rax,-0xca8(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     145b <main+0x28b>
movl   $0x0,-0xc9c(%rbp)
mov    -0xc9c(%rbp),%eax
cmp    -0xc94(%rbp),%eax
jge    1346 <main+0x176>
movl   $0x0,-0xca0(%rbp)
mov    -0xca0(%rbp),%eax
cmp    -0xc98(%rbp),%eax
jge    132d <main+0x15d>
movslq -0xc9c(%rbp),%rcx
lea    -0x650(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xca0(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0xc9c(%rbp),%rcx
lea    -0xc90(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xca0(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xca0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xca0(%rbp)
jmp    12c9 <main+0xf9>
jmp    1332 <main+0x162>
mov    -0xc9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc9c(%rbp)
jmp    12ad <main+0xdd>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   1090 <find_w2e@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   1060 <find_e2w@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   1030 <find_n2s@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   1040 <find_s2n@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   1050 <find_nw2se@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   10f0 <find_se2nw@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   10c0 <find_sw2ne@plt>
mov    -0xca8(%rbp),%rdi
lea    -0xc90(%rbp),%rsi
mov    -0xc94(%rbp),%edx
mov    -0xc98(%rbp),%ecx
call   10a0 <find_ne2sw@plt>
lea    -0xc90(%rbp),%rdi
mov    -0xc94(%rbp),%esi
mov    -0xc98(%rbp),%edx
call   10b0 <dump_board@plt>
jmp    1289 <main+0xb9>
jmp    1460 <main+0x290>
mov    -0x4(%rbp),%eax
add    $0xcb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc98,%rsp
cmp    $0x2,%edi
jne    13df <main+0x1ff>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   10f0 <read_puzzle@plt>
test   %eax,%eax
je     13f8 <main+0x218>
lea    0xe20(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
call   10b0 <dump_board@plt>
xor    %eax,%eax
call   1080 <get_string@plt>
cmpb   $0x2e,(%rax)
je     1413 <main+0x233>
mov    %rax,%r12
jmp    1321 <main+0x141>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
lea    0x650(%rsp),%rbx
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13d,%ecx
call   1090 <find_w2e@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <find_e2w@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <find_n2s@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <find_s2n@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <find_nw2se@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1100 <find_se2nw@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   10c0 <find_sw2ne@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <find_ne2sw@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   10b0 <dump_board@plt>
xor    %eax,%eax
call   1080 <get_string@plt>
mov    %rax,%r12
cmpb   $0x2e,(%rax)
je     1413 <main+0x233>
mov    0xc(%rsp),%r15d
mov    0x8(%rsp),%r13d
test   %r15d,%r15d
jle    1260 <main+0x80>
cmp    $0x1,%r15d
jne    1380 <main+0x1a0>
xor    %ebx,%ebx
test   $0x1,%r15b
je     1260 <main+0x80>
test   %r13d,%r13d
jle    1260 <main+0x80>
shl    $0x3,%rbx
lea    (%rbx,%rbx,4),%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
lea    (%rsp,%rax,1),%rdi
add    $0x650,%rdi
mov    %r13,%rdx
call   10e0 <memcpy@plt>
jmp    1260 <main+0x80>
nopw   0x0(%rax,%rax,1)
mov    %r15d,%ebp
and    $0xfffffffe,%ebp
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    139d <main+0x1bd>
nopl   (%rax)
add    $0x2,%rbx
add    $0x50,%r14
cmp    %rbx,%rbp
je     133c <main+0x15c>
test   %r13d,%r13d
jle    13bd <main+0x1dd>
lea    (%rsp,%r14,1),%rsi
add    $0x10,%rsi
lea    (%rsp,%r14,1),%rdi
add    $0x650,%rdi
mov    %r13,%rdx
call   10e0 <memcpy@plt>
test   %r13d,%r13d
jle    1390 <main+0x1b0>
lea    (%rsp,%r14,1),%rsi
add    $0x38,%rsi
lea    (%rsp,%r14,1),%rdi
add    $0x678,%rdi
mov    %r13,%rdx
call   10e0 <memcpy@plt>
jmp    1390 <main+0x1b0>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xc11(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    1413 <main+0x233>
mov    0x2be1(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xc1d(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %eax,%eax
add    $0xc98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"expected single cmd-line arg (filename)\0A\00"
@.str.1 = [27 x i8] c"ERROR in reading board %s\0A\00"
@.str.2 = [25 x i8] c"successfully read board\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [40 x [40 x i8]]
%7 = alloca [40 x [40 x i8]]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %130
18: ; preds = %2
%19 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %6, i64 0, i64 0
%20 = bitcast [40 x i8]* %19 to i8**
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @read_puzzle(i8** %20, i8* %23, i32* %8, i32* %9)
%25 = icmp ne i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %18
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %130
32: ; preds = %18
%33 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%34 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %6, i64 0, i64 0
%35 = bitcast [40 x i8]* %34 to i8**
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = call i32 @dump_board(i8** %35, i32 %36, i32 %37)
br label %39
39: ; preds = %75, %32
%40 = call i8* (...) @get_string()
store i8* %40, i8** %12
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 46
br i1 %43, label %44, label %129
44: ; preds = %39
store i32 0, i32* %10
br label %45
45: ; preds = %72, %44
%46 = load i32, i32* %10
%47 = load i32, i32* %8
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %75
49: ; preds = %45
store i32 0, i32* %11
br label %50
50: ; preds = %68, %49
%51 = load i32, i32* %11
%52 = load i32, i32* %9
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %71
54: ; preds = %50
%55 = load i32, i32* %10
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %6, i64 0, i64 %56
%58 = load i32, i32* %11
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [40 x i8], [40 x i8]* %57, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = load i32, i32* %10
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 %63
%65 = load i32, i32* %11
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [40 x i8], [40 x i8]* %64, i64 0, i64 %66
store i8 %61, i8* %67
br label %68
68: ; preds = %54
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 1
store i32 %70, i32* %11
br label %50
71: ; preds = %50
br label %72
72: ; preds = %71
%73 = load i32, i32* %10
%74 = add nsw i32 %73, 1
store i32 %74, i32* %10
br label %45
75: ; preds = %45
%76 = load i8*, i8** %12
%77 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%78 = bitcast [40 x i8]* %77 to i8**
%79 = load i32, i32* %8
%80 = load i32, i32* %9
%81 = call i32 @find_w2e(i8* %76, i8** %78, i32 %79, i32 %80)
%82 = load i8*, i8** %12
%83 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%84 = bitcast [40 x i8]* %83 to i8**
%85 = load i32, i32* %8
%86 = load i32, i32* %9
%87 = call i32 @find_e2w(i8* %82, i8** %84, i32 %85, i32 %86)
%88 = load i8*, i8** %12
%89 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%90 = bitcast [40 x i8]* %89 to i8**
%91 = load i32, i32* %8
%92 = load i32, i32* %9
%93 = call i32 @find_n2s(i8* %88, i8** %90, i32 %91, i32 %92)
%94 = load i8*, i8** %12
%95 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%96 = bitcast [40 x i8]* %95 to i8**
%97 = load i32, i32* %8
%98 = load i32, i32* %9
%99 = call i32 @find_s2n(i8* %94, i8** %96, i32 %97, i32 %98)
%100 = load i8*, i8** %12
%101 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%102 = bitcast [40 x i8]* %101 to i8**
%103 = load i32, i32* %8
%104 = load i32, i32* %9
%105 = call i32 @find_nw2se(i8* %100, i8** %102, i32 %103, i32 %104)
%106 = load i8*, i8** %12
%107 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%108 = bitcast [40 x i8]* %107 to i8**
%109 = load i32, i32* %8
%110 = load i32, i32* %9
%111 = call i32 @find_se2nw(i8* %106, i8** %108, i32 %109, i32 %110)
%112 = load i8*, i8** %12
%113 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%114 = bitcast [40 x i8]* %113 to i8**
%115 = load i32, i32* %8
%116 = load i32, i32* %9
%117 = call i32 @find_sw2ne(i8* %112, i8** %114, i32 %115, i32 %116)
%118 = load i8*, i8** %12
%119 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%120 = bitcast [40 x i8]* %119 to i8**
%121 = load i32, i32* %8
%122 = load i32, i32* %9
%123 = call i32 @find_ne2sw(i8* %118, i8** %120, i32 %121, i32 %122)
%124 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %7, i64 0, i64 0
%125 = bitcast [40 x i8]* %124 to i8**
%126 = load i32, i32* %8
%127 = load i32, i32* %9
%128 = call i32 @dump_board(i8** %125, i32 %126, i32 %127)
br label %39
129: ; preds = %39
br label %130
130: ; preds = %15, %129, %26
%131 = load i32, i32* %3
ret i32 %131
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"expected single cmd-line arg (filename)\0A\00"
@.str.1 = [27 x i8] c"ERROR in reading board %s\0A\00"
@str = [24 x i8] c"successfully read board\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [40 x [40 x i8]]
%4 = alloca [40 x [40 x i8]]
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %3, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [40 x [40 x i8]], [40 x [40 x i8]]* %4, i64 0, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = icmp eq i32 %0, 2
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %100
15: ; preds = %2
%16 = bitcast [40 x [40 x i8]]* %3 to i8**
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @read_puzzle(i8** %16, i8* %18, i32* %5, i32* %6)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %17
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %100
25: ; preds = %15
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = call i32 @dump_board(i8** %16, i32 %27, i32 %28)
%30 = call i8* (...) @get_string()
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 46
br i1 %32, label %100, label %33
33: ; preds = %25
%34 = bitcast [40 x [40 x i8]]* %4 to i8**
br label %35
35: ; preds = %33, %71
%36 = phi i8* [ %30, %33 ], [ %97, %71 ]
%37 = load i32, i32* %5
%38 = icmp sgt i32 %37, 0
%39 = load i32, i32* %6
br i1 %38, label %40, label %71
40: ; preds = %35
%41 = icmp sgt i32 %39, 0
%42 = zext i32 %39 to i64
%43 = zext i32 %37 to i64
%44 = and i64 %43, 1
%45 = icmp eq i32 %37, 1
br i1 %45, label %63, label %46
46: ; preds = %40
%47 = and i64 %43, 4294967294
br label %48
48: ; preds = %59, %46
%49 = phi i64 [ 0, %46 ], [ %60, %59 ]
%50 = phi i64 [ 0, %46 ], [ %61, %59 ]
br i1 %41, label %51, label %54
51: ; preds = %48
%52 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %3, i64 0, i64 %49, i64 0
%53 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %4, i64 0, i64 %49, i64 0
br label %54
54: ; preds = %51, %48
%55 = or i64 %49, 1
br i1 %41, label %56, label %59
56: ; preds = %54
%57 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %3, i64 0, i64 %55, i64 0
%58 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %4, i64 0, i64 %55, i64 0
br label %59
59: ; preds = %56, %54
%60 = add nuw nsw i64 %49, 2
%61 = add i64 %50, 2
%62 = icmp eq i64 %61, %47
br i1 %62, label %63, label %48
63: ; preds = %59, %40
%64 = phi i64 [ 0, %40 ], [ %60, %59 ]
%65 = icmp eq i64 %44, 0
%66 = xor i1 %41, true
%67 = select i1 %65, i1 true, i1 %66
br i1 %67, label %71, label %68
68: ; preds = %63
%69 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %3, i64 0, i64 %64, i64 0
%70 = getelementptr [40 x [40 x i8]], [40 x [40 x i8]]* %4, i64 0, i64 %64, i64 0
br label %71
71: ; preds = %63, %68, %35
%72 = call i32 @find_w2e(i8* %36, i8** %34, i32 %37, i32 %39)
%73 = load i32, i32* %5
%74 = load i32, i32* %6
%75 = call i32 @find_e2w(i8* %36, i8** %34, i32 %73, i32 %74)
%76 = load i32, i32* %5
%77 = load i32, i32* %6
%78 = call i32 @find_n2s(i8* %36, i8** %34, i32 %76, i32 %77)
%79 = load i32, i32* %5
%80 = load i32, i32* %6
%81 = call i32 @find_s2n(i8* %36, i8** %34, i32 %79, i32 %80)
%82 = load i32, i32* %5
%83 = load i32, i32* %6
%84 = call i32 @find_nw2se(i8* %36, i8** %34, i32 %82, i32 %83)
%85 = load i32, i32* %5
%86 = load i32, i32* %6
%87 = call i32 @find_se2nw(i8* %36, i8** %34, i32 %85, i32 %86)
%88 = load i32, i32* %5
%89 = load i32, i32* %6
%90 = call i32 @find_sw2ne(i8* %36, i8** %34, i32 %88, i32 %89)
%91 = load i32, i32* %5
%92 = load i32, i32* %6
%93 = call i32 @find_ne2sw(i8* %36, i8** %34, i32 %91, i32 %92)
%94 = load i32, i32* %5
%95 = load i32, i32* %6
%96 = call i32 @dump_board(i8** %34, i32 %94, i32 %95)
%97 = call i8* (...) @get_string()
%98 = load i8, i8* %97
%99 = icmp eq i8 %98, 46
br i1 %99, label %100, label %35
100: ; preds = %71, %25, %21, %12
ret i32 0
}