user: 请从给定的汇编指令推导出C源代码:

```asm
<maze_solve_helper_2>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    $0x0,%r13d
  mov    $0x1,%ebx
  jmp    L190
L436:
  add    $0x1,%edx
  jmp    L0
L249:
  add    $0x1,%edx
  cmp    $0x51,%r8d
  jne    L206
  cmp    $0x2,%edx
  jg     L147
L350:
  add    $0x1,%esi
  add    $0x51,%rbp
  cmp    $0x29,%esi
  je     L533
L289:
  lea    -0x51(%rbp),%rcx
  lea    -0xa2(%rbp),%r10
  mov    %rbp,%r9
  mov    $0x0,%eax
  jmp    L293
L533:
  test   %r11d,%r11d
  je     L104
L190:
  lea    0x51(%r12),%rbp
  mov    %r13d,%r11d
  mov    $0x0,%esi
  jmp    L289
L507:
  movb   $0x2e,(%rax)
L341:
  add    $0x1,%rax
  cmp    %rax,%rsi
  je     L246
L511:
  movzbl (%rax),%edx
  cmp    $0x20,%dl
  je     L507
  cmp    $0x2a,%dl
  jne    L341
  movb   $0x20,(%rax)
  jmp    L341
L246:
  add    $0x51,%rsi
  cmp    %rsi,%rdi
  je     L85
L455:
  lea    -0x51(%rsi),%rax
  jmp    L511
L85:
  mov    %r11d,%edi
  mov    %r11d,%r8d
  mov    %r11d,%edx
  mov    $0x1,%eax
L235:
  test   %edx,%edx
  je     L333
  lea    -0x1(%rdx),%esi
  cmp    %r8d,%esi
  jne    L143
  cmp    %edi,%eax
  jne    L143
L333:
  lea    -0x1(%rax),%ecx
  cmp    %r8d,%edx
  setne  %r9b
  cmp    %edi,%ecx
  jne    L165
  test   %r9b,%r9b
  jne    L165
L312:
  lea    0x1(%rdx),%esi
  cmp    %r8d,%esi
  jne    L523
  cmp    %edi,%eax
  jne    L523
L212:
  lea    0x1(%rax),%ecx
  cmp    %edi,%ecx
  jne    L8
  test   %r9b,%r9b
  je     L478
L8:
  movslq %edx,%rsi
  lea    (%rsi,%rsi,8),%rsi
  lea    (%rsi,%rsi,8),%rsi
  add    %r12,%rsi
  movslq %ecx,%rdi
  cmpb   $0x2e,(%rsi,%rdi,1)
  je     L496
L478:
  mov    %r11d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L104:
  lea    0x51(%r12),%rsi
  lea    0xd4a(%r12),%rdi
  jmp    L455
L496:
  mov    %edx,%esi
L378:
  mov    %edx,%r8d
  mov    %eax,%edi
  cmp    $0x28,%esi
  jne    L258
  cmp    $0x4f,%ecx
  je     L277
L258:
  mov    %ecx,%eax
  mov    %esi,%edx
  jmp    L235
L143:
  movslq %esi,%rcx
  lea    (%rcx,%rcx,8),%rcx
  lea    (%rcx,%rcx,8),%rcx
  add    %r12,%rcx
  movslq %eax,%r9
  cmpb   $0x2e,(%rcx,%r9,1)
  jne    L333
  mov    %eax,%ecx
  jmp    L378
L165:
  movslq %edx,%rsi
  lea    (%rsi,%rsi,8),%rsi
  lea    (%rsi,%rsi,8),%rsi
  add    %r12,%rsi
  movslq %ecx,%r10
  cmpb   $0x2e,(%rsi,%r10,1)
  jne    L312
  mov    %edx,%esi
  jmp    L378
L523:
  movslq %esi,%rcx
  lea    (%rcx,%rcx,8),%rcx
  lea    (%rcx,%rcx,8),%rcx
  add    %r12,%rcx
  movslq %eax,%r8
  cmpb   $0x2e,(%rcx,%r8,1)
  jne    L212
  mov    %eax,%ecx
  jmp    L378
L277:
  mov    $0x1,%r11d
  jmp    L478
L21:
  cmp    $0x29,%esi
  jne    L464
  movzbl 0x1(%rcx,%rax,1),%edi
  cmp    $0x23,%dil
  je     L383
  cmp    $0x2a,%dil
  jne    L245
L383:
  add    $0x1,%edx
L306:
  cmp    $0x2,%edx
  jle    L245
L147:
  movb   $0x2a,(%rcx,%rax,1)
  mov    %ebx,%r11d
L245:
  add    $0x1,%rax
  cmp    $0x51,%rax
  je     L350
L293:
  cmpb   $0x20,(%rcx,%rax,1)
  jne    L245
  test   %esi,%esi
  je     L413
  movzbl (%r10,%rax,1),%edi
  cmp    $0x23,%dil
  sete   %dl
  cmp    $0x2a,%dil
  sete   %dil
  or     %edi,%edx
  movzbl %dl,%edx
  mov    %eax,%r8d
  test   %eax,%eax
  je     L21
L416:
  movzbl -0x1(%rcx,%rax,1),%edi
  cmp    $0x23,%dil
  je     L436
  cmp    $0x2a,%dil
  je     L436
L0:
  cmp    $0x29,%esi
  je     L278
L464:
  movzbl (%r9,%rax,1),%edi
  cmp    $0x23,%dil
  je     L249
  cmp    $0x2a,%dil
  je     L249
L278:
  cmp    $0x51,%r8d
  je     L350
L206:
  movzbl 0x1(%rcx,%rax,1),%edi
  cmp    $0x23,%dil
  je     L383
  cmp    $0x2a,%dil
  jne    L306
  jmp    L383
L413:
  mov    %eax,%r8d
  mov    %esi,%edx
  test   %eax,%eax
  jne    L416
  mov    %eax,%edx
  jmp    L464
```

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;
}
```