user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<maze_solve_helper_2>:
  endbr64
  push   %rbp
  mov    %rdi,%r10
  push   %rbx
L366:
  mov    %r10,%r11
  xor    %r9d,%r9d
  xor    %ebp,%ebp
  nopl   0x0(%rax)
L130:
  mov    %r11,%rcx
  lea    -0x51(%r11),%rbx
  xor    %eax,%eax
  add    $0x51,%r11
  test   %ebp,%ebp
  jne    L9
  jmp    L57
  xchg   %ax,%ax
L502:
  add    $0x1,%rax
  cmp    $0x51,%rax
  je     L402
L9:
  cmpb   $0x20,(%rcx,%rax,1)
  jne    L502
  movzbl (%rbx,%rax,1),%esi
  cmp    $0x23,%sil
  sete   %dl
  cmp    $0x2a,%sil
  sete   %sil
  or     %esi,%edx
  movzbl %dl,%edx
  test   %rax,%rax
  je     L442
  movzbl -0x1(%rcx,%rax,1),%esi
  cmp    $0x23,%sil
  je     L376
  cmp    $0x2a,%sil
  je     L376
L442:
  movzbl 0x1(%rcx,%rax,1),%edi
  movzbl (%r11,%rax,1),%r8d
  cmp    $0x23,%dil
  sete   %sil
  cmp    $0x2a,%dil
  sete   %dil
  or     %edi,%esi
  cmp    $0x23,%r8b
  je     L58
  cmp    $0x2a,%r8b
  je     L58
  test   %sil,%sil
  je     L502
L359:
  add    $0x1,%edx
L115:
  cmp    $0x2,%edx
  jle    L502
  movb   $0x2a,(%rcx,%rax,1)
  add    $0x1,%rax
  mov    $0x1,%r9d
  cmp    $0x51,%rax
  jne    L9
L402:
  add    $0x1,%ebp
  cmp    $0x29,%ebp
  jne    L130
  test   %r9d,%r9d
  jne    L366
  lea    0x51(%r10),%rcx
  lea    0xd4a(%r10),%rsi
L190:
  lea    -0x51(%rcx),%rax
  jmp    L450
  nopl   0x0(%rax)
L453:
  cmp    $0x2a,%dl
  jne    L117
  movb   $0x20,(%rax)
L117:
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L207
L450:
  movzbl (%rax),%edx
  cmp    $0x20,%dl
  jne    L453
  movb   $0x2e,(%rax)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L450
L207:
  add    $0x51,%rcx
  cmp    %rcx,%rsi
  jne    L190
  xor    %edi,%edi
  xor    %r8d,%r8d
  xor    %edx,%edx
  mov    $0x1,%eax
L426:
  test   %edx,%edx
  je     L427
  lea    -0x1(%rdx),%esi
  cmp    %r8d,%esi
  jne    L287
  cmp    %eax,%edi
  jne    L287
L427:
  cmp    %edx,%r8d
  lea    -0x1(%rax),%ecx
  setne  %r11b
  cmp    %edi,%ecx
  jne    L356
  test   %r11b,%r11b
  jne    L356
L124:
  lea    0x1(%rdx),%esi
  cmp    %r8d,%esi
  jne    L343
  cmp    %eax,%edi
  jne    L343
L337:
  lea    0x1(%rax),%ecx
  cmp    %edi,%ecx
  jne    L270
  test   %r11b,%r11b
  je     L371
L270:
  movslq %edx,%rsi
  movslq %ecx,%rdi
  lea    (%rsi,%rsi,8),%rsi
  lea    (%rsi,%rsi,8),%rsi
  add    %r10,%rsi
  cmpb   $0x2e,(%rsi,%rdi,1)
  je     L373
L371:
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L38:
  test   %rax,%rax
  je     L289
  movzbl -0x1(%rcx,%rax,1),%esi
  cmp    $0x2a,%sil
  sete   %dl
  cmp    $0x23,%sil
  sete   %sil
  or     %esi,%edx
  movzbl %dl,%edx
L424:
  movzbl 0x1(%rcx,%rax,1),%edi
  movzbl (%r11,%rax,1),%r8d
  cmp    $0x2a,%dil
  sete   %sil
  cmp    $0x23,%dil
  sete   %dil
  or     %edi,%esi
  cmp    $0x2a,%r8b
  je     L107
  cmp    $0x23,%r8b
  jne    L461
L107:
  test   %sil,%sil
  je     L461
  cmp    $0x1,%edx
  jne    L461
  movb   $0x2a,(%rcx,%rax,1)
  mov    $0x1,%r9d
L461:
  add    $0x1,%rax
  cmp    $0x51,%rax
  je     L340
L57:
  cmpb   $0x20,(%rcx,%rax,1)
  je     L38
  add    $0x1,%rax
  cmp    $0x51,%rax
  jne    L57
L340:
  mov    $0x1,%ebp
  jmp    L130
  nopw   0x0(%rax,%rax,1)
L58:
  add    $0x1,%edx
  test   %sil,%sil
  je     L115
  jmp    L359
  nopl   0x0(%rax)
L376:
  add    $0x1,%edx
  jmp    L442
  nopl   0x0(%rax,%rax,1)
L289:
  xor    %edx,%edx
  jmp    L424
L356:
  movslq %edx,%rsi
  movslq %ecx,%rbx
  lea    (%rsi,%rsi,8),%rsi
  lea    (%rsi,%rsi,8),%rsi
  add    %r10,%rsi
  cmpb   $0x2e,(%rsi,%rbx,1)
  jne    L124
L373:
  mov    %edx,%esi
  jmp    L247
L343:
  movslq %esi,%rcx
  movslq %eax,%r8
  lea    (%rcx,%rcx,8),%rcx
  lea    (%rcx,%rcx,8),%rcx
  add    %r10,%rcx
  cmpb   $0x2e,(%rcx,%r8,1)
  jne    L337
L162:
  mov    %eax,%ecx
L247:
  mov    %edx,%r8d
  mov    %eax,%edi
  cmp    $0x28,%esi
  jne    L320
  cmp    $0x4f,%ecx
  je     L235
L320:
  mov    %ecx,%eax
  mov    %esi,%edx
  jmp    L426
L287:
  movslq %esi,%rcx
  movslq %eax,%r11
  lea    (%rcx,%rcx,8),%rcx
  lea    (%rcx,%rcx,8),%rcx
  add    %r10,%rcx
  cmpb   $0x2e,(%rcx,%r11,1)
  jne    L427
  jmp    L162
L235:
  mov    $0x1,%r9d
  jmp    L371
```

assistant: ```c
int maze_solve_helper_2(char maze[41][81]) {
  int r = 0, c = 0, walls = 0, reloop = 1, old_r = 0, old_c = 0, new_r = 0, new_c = 0;
  while (reloop) {
    reloop = 0;
    r = 0;
    c = 0;
    walls = 0;
    while (r < 41) {
      walls = 0;
      c = 0;
      while (c < 81) {
        walls = 0;
        if (maze[r][c] == ' ') {
          if (r != 0)
            if (maze[r - 1][c] == '#' || maze[r - 1][c] == '*')
              walls++;
          if (c != 0)
            if (maze[r][c - 1] == '#' || maze[r][c - 1] == '*')
              walls++;
          if (r != 41)
            if (maze[r + 1][c] == '#' || maze[r + 1][c] == '*')
              walls++;
          if (c != 81)
            if (maze[r][c + 1] == '#' || maze[r][c + 1] == '*')
              walls++;
          if (walls >= 3) {
            maze[r][c] = '*';
            reloop = 1;
          }
        }
        c++;
      }
      r++;
    }
  }
  r = 0;
  c = 0;
  while (r < 41) {
    c = 0;
    while (c < 81) {
      if (maze[r][c] == ' ')
        maze[r][c] = '.';
      if (maze[r][c] == '*')
        maze[r][c] = ' ';
      c++;
    }
    r++;
  }
  r = 0;
  c = 1;
  while (1) {
    if (r == 40 && c == 79)
      goto success;
    if (r != 0) {
      new_r = r - 1;
      new_c = c;
      if (!(new_r == old_r && new_c == old_c) && maze[new_r][new_c] == '.') {
        old_r = r;
        old_c = c;
        r = new_r;
        c = new_c;
        continue;
      }
    }
    new_r = r;
    new_c = c - 1;
    if (!(new_r == old_r && new_c == old_c) && maze[new_r][new_c] == '.') {
      old_r = r;
      old_c = c;
      r = new_r;
      c = new_c;
      continue;
    }
    new_r = r + 1;
    new_c = c;
    if (!(new_r == old_r && new_c == old_c) && maze[new_r][new_c] == '.') {
      old_r = r;
      old_c = c;
      r = new_r;
      c = new_c;
      continue;
    }
    new_r = r;
    new_c = c + 1;
    if (!(new_r == old_r && new_c == old_c) && maze[new_r][new_c] == '.') {
      old_r = r;
      old_c = c;
      r = new_r;
      c = new_c;
      continue;
    }
    return 0;
  }
success:
  return 1;
}
```