user: 请将以下的汇编代码转换成C语言代码:

```asm
<walking>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L7
L134:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  je     L176
  cmp    $0x4,%eax
  jg     L99
  cmp    $0x3,%eax
  je     L48
  cmp    $0x3,%eax
  jg     L99
  cmp    $0x1,%eax
  je     L170
  cmp    $0x2,%eax
  je     L12
  jmp    L99
L170:
  addl   $0x1,-0x4(%rbp)
  jmp    L99
L12:
  addl   $0x1,-0x8(%rbp)
  jmp    L99
L48:
  subl   $0x1,-0x4(%rbp)
  jmp    L99
L176:
  subl   $0x1,-0x8(%rbp)
  nop
L99:
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <validate_position@plt>
  test   %rax,%rax
  je     L131
  mov    -0x20(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  cmp    $0x37,%al
  je     L123
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  cmp    $0x35,%al
  je     L123
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  movb   $0x33,(%rdx,%rax,1)
  jmp    L7
L123:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  cmp    $0x35,%al
  je     L7
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <change_path@plt>
  jmp    L7
L131:
  mov    -0x20(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  jle    L7
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movl   $0x1,(%rax)
L7:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L134
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L134
  nop
  nop
  leave
  ret
```

assistant: ```c
void walking(char maze[23][30], int ghost[3], int target[2]) {
  int x, y;
  y = ghost[0];
  x = ghost[1];
  while (target[0] != ghost[0] || target[1] != ghost[1]) {
    switch (ghost[2]) {
    case 1:
      y = y + 1;
      break;
    case 2:
      x = x + 1;
      break;
    case 3:
      y = y - 1;
      break;
    case 4:
      x = x - 1;
      break;
    }
    if (validate_position(maze, y, x)) {
      ghost[0] = y;
      ghost[1] = x;
      if (maze[y][x] != '7' && maze[y][x] != '5') {
        maze[y][x] = '3';
      } else {
        if (maze[y][x] != '5') {
          change_path(maze, ghost, target);
        }
      }
    } else {
      x = ghost[1];
      y = ghost[0];
      ghost[2] += 1;
      if (ghost[2] > 4) {
        ghost[2] = 1;
      }
    }
  }
}
```