user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x810,%rsp
  mov    %edi,-0x804(%rbp)
  mov    %rsi,-0x810(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L38
L71:
  lea    -0x7e0(%rbp),%rax
  mov    $0x190,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x650(%rbp),%rax
  mov    $0x640,%edx
  mov    $0xffffffff,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x7f0(%rbp)
  jmp    L76
L98:
  lea    -0x7e0(%rbp),%rcx
  mov    -0x7f0(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0x7f0(%rbp)
L76:
  mov    -0x7fc(%rbp),%eax
  cmp    %eax,-0x7f0(%rbp)
  jl     L98
  movl   $0x0,-0x7ec(%rbp)
  mov    -0x7f4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x7e8(%rbp)
  movl   $0x0,-0x7e4(%rbp)
L62:
  mov    -0x7e4(%rbp),%edx
  lea    0x1(%rdx),%eax
  mov    %eax,-0x7e4(%rbp)
  mov    -0x7e8(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x7ec(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    %edx,-0x650(%rbp,%rax,4)
  mov    -0x7e8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x7ec(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x7e0,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x57,%eax
  je     L96
  cmp    $0x57,%eax
  jg     L64
  cmp    $0x53,%eax
  je     L190
  cmp    $0x53,%eax
  jg     L64
  cmp    $0x45,%eax
  je     L84
  cmp    $0x4e,%eax
  jne    L64
  subl   $0x1,-0x7ec(%rbp)
  jmp    L64
L190:
  addl   $0x1,-0x7ec(%rbp)
  jmp    L64
L84:
  addl   $0x1,-0x7e8(%rbp)
  jmp    L64
L96:
  subl   $0x1,-0x7e8(%rbp)
  nop
L64:
  cmpl   $0x0,-0x7ec(%rbp)
  js     L3
  mov    -0x7fc(%rbp),%eax
  cmp    %eax,-0x7ec(%rbp)
  je     L3
  cmpl   $0x0,-0x7e8(%rbp)
  js     L3
  mov    -0x7f8(%rbp),%eax
  cmp    %eax,-0x7e8(%rbp)
  jne    L165
L3:
  mov    -0x7e4(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L38
L165:
  mov    -0x7e8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x7ec(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    -0x650(%rbp,%rax,4),%eax
  cmp    $0xffffffff,%eax
  je     L62
  mov    -0x7e8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x7ec(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    -0x650(%rbp,%rax,4),%ecx
  mov    -0x7e4(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x7e8(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x7ec(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    -0x650(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L38:
  lea    -0x7f4(%rbp),%rcx
  lea    -0x7f8(%rbp),%rdx
  lea    -0x7fc(%rbp),%rax
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  test   %eax,%eax
  je     L16
  mov    -0x7fc(%rbp),%eax
  test   %eax,%eax
  jne    L71
L16:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L19
  call   <__stack_chk_fail@plt>
L19:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D39
datatype: string
name: extract_symbolic_data
arguments: data_tag: D36
datatype: string
name: extract_symbolic_data
arguments: data_tag: D34
datatype: string
name: extract_symbolic_data
arguments: data_tag: D11
datatype: string

tool: D39: %s

tool: D36: %d step(s) to exit


tool: D34: %d step(s) before a loop of %d step(s)


tool: D11: %d%d%d

assistant: ```c
int main(int argc, char const *argv[]) {
  int r, c, p, graph[20][20];
  char grid[20][20];
  while (scanf("%d%d%d", &r, &c, &p) && r) {
    memset(grid, 0, sizeof(grid));
    memset(graph, -1, sizeof(graph));
    for (int i = 0; i < r; i++)
      scanf("%s", grid[i]);
    int x = 0, y = p - 1, cnt = 0;
    while (1) {
      graph[x][y] = cnt++;
      switch (grid[x][y]) {
      case 'N':
        x--;
        break;
      case 'S':
        x++;
        break;
      case 'E':
        y++;
        break;
      case 'W':
        y--;
        break;
      }
      if (x < 0 || x == r || y < 0 || y == c) {
        printf("%d step(s) to exit\n", cnt);
        break;
      }
      if (graph[x][y] != -1) {
        printf("%d step(s) before a loop of %d step(s)\n", graph[x][y], cnt - graph[x][y]);
        break;
      }
    }
  }
  return 0;
}
```