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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x5000(%rsp),%r11
L51:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L51
  sub    $0x688,%rsp
  lea    D29(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x5678(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rsi
  call   <scanf@plt>
  mov    0x30(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x30(%rsp)
  test   %eax,%eax
  je     L54
  lea    0x3c(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x34(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0xaa(%rsp),%rax
  mov    %rax,0x28(%rsp)
L302:
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%rdx
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  mov    0x10(%rsp),%rsi
  call   <scanf@plt>
  mov    0x34(%rsp),%r13d
  test   %r13d,%r13d
  jle    L227
  lea    0xaa(%rsp),%rbp
  mov    $0x1,%ebx
  nopl   0x0(%rax)
L172:
  mov    %rbp,%rsi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <scanf@plt>
  mov    0x34(%rsp),%r13d
  add    $0x69,%rbp
  cmp    %ebx,%r13d
  jge    L172
L227:
  mov    0x3c(%rsp),%eax
  lea    -0x1(%rax),%r14d
  mov    %r14d,0x3c(%rsp)
  test   %eax,%eax
  je     L170
  lea    -0x1(%r13),%eax
  mov    0x38(%rsp),%ebx
  mov    %r13d,0x4(%rsp)
  lea    (%rax,%rax,2),%rdx
  lea    (%rax,%rdx,4),%rdx
  mov    %ebx,(%rsp)
  sub    $0x1,%ebx
  lea    (%rax,%rdx,8),%rax
  lea    0x2c33(%rsp,%rax,1),%r12
  lea    0x113(%rsp,%rax,1),%rbp
  mov    0x28(%rsp),%rax
  add    %rbx,%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L89:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L274
  mov    (%rsp),%edx
  test   %edx,%edx
  jle    L274
  lea    0x2bca(%rsp),%r10
  mov    $0x69,%r11d
  mov    0x8(%rsp),%r8
  mov    $0xffffffffffffff96,%r15
  mov    %r10,%r9
  sub    %rbx,%r15
  sub    %rbx,%r11
  nopw   0x0(%rax,%rax,1)
L282:
  mov    %r8,%rax
  lea    (%r15,%r8,1),%rdi
  lea    (%r11,%r8,1),%rsi
  mov    %r9,%rcx
  sub    %rbx,%rax
  sub    $0x1,%rax
  jmp    L159
  nopw   0x0(%rax,%rax,1)
L192:
  cmp    $0x50,%dl
  je     L288
L321:
  add    $0x1,%rax
  add    $0x1,%rcx
  add    $0x1,%rdi
  add    $0x1,%rsi
  cmp    %r8,%rax
  je     L290
L159:
  movzbl 0x1(%rax),%edx
  cmp    $0x52,%dl
  je     L188
  cmp    $0x53,%dl
  jne    L192
  cmpb   $0x52,(%rsi)
  je     L202
  cmpb   $0x52,0x1(%rdi)
  je     L202
  cmpb   $0x52,0x2(%rax)
  je     L202
  cmpb   $0x52,(%rax)
  je     L202
  xchg   %ax,%ax
L61:
  movb   $0x53,(%rcx)
  jmp    L321
  nopl   (%rax)
L188:
  cmpb   $0x50,(%rsi)
  je     L334
  cmpb   $0x50,0x1(%rdi)
  je     L334
  cmpb   $0x50,0x2(%rax)
  je     L334
  cmpb   $0x50,(%rax)
  je     L334
  xchg   %ax,%ax
L202:
  movb   $0x52,(%rcx)
  jmp    L321
  nopl   (%rax)
L288:
  cmpb   $0x53,(%rsi)
  je     L61
  cmpb   $0x53,0x1(%rdi)
  je     L61
  cmpb   $0x53,0x2(%rax)
  je     L61
  cmpb   $0x53,(%rax)
  je     L61
  xchg   %ax,%ax
L334:
  movb   $0x50,(%rcx)
  jmp    L321
  nopl   (%rax)
L290:
  add    $0x69,%r9
  lea    0x69(%rax),%r8
  cmp    %r12,%r9
  jne    L282
  movslq (%rsp),%r15
  lea    0xaa(%rsp),%rcx
  mov    %r10,%r13
  nopl   0x0(%rax,%rax,1)
L246:
  mov    %r13,%rsi
  mov    %rcx,%rdi
  mov    %r15,%rdx
  add    $0x69,%r13
  call   <memcpy@plt>
  mov    %rax,%rcx
  add    $0x69,%rcx
  cmp    %rbp,%rcx
  jne    L246
L274:
  sub    $0x1,%r14d
  jae    L89
  movl   $0xffffffff,0x3c(%rsp)
  mov    0x4(%rsp),%r13d
L170:
  lea    0xaa(%rsp),%rbp
  mov    $0x1,%ebx
  test   %r13d,%r13d
  jle    L102
  nopw   0x0(%rax,%rax,1)
L169:
  mov    %rbp,%rdi
  add    $0x1,%ebx
  add    $0x69,%rbp
  call   <puts@plt>
  cmp    %ebx,0x34(%rsp)
  jge    L169
L102:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x30(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x30(%rsp)
  test   %eax,%eax
  jne    L302
L54:
  mov    0x5678(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L233
  add    $0x5688,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L233:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D29
type_infered: string
name: retrieve_data
arguments: data_label: D11
type_infered: string
name: retrieve_data
arguments: data_label: D14
type_infered: string

tool: D29: %d

tool: D11: %d %d %d

tool: D14: %s

assistant: ```c
int main(int argc, char *argv[]) {
  int cnt, i, j, a, b, c;
  char m[105][105], m2[105][105];
  scanf("%d", &cnt);
  while (cnt--) {
    scanf("%d %d %d", &a, &b, &c);
    for (i = 1; i <= a; ++i)
      scanf("%s", m[i] + 1);
    while (c--) {
      for (i = 1; i <= a; ++i) {
        for (j = 1; j <= b; ++j) {
          switch (m[i][j]) {
          case 'R':
            if (m[i + 1][j] == 'P' || m[i - 1][j] == 'P' || m[i][j + 1] == 'P' || m[i][j - 1] == 'P')
              m2[i][j] = 'P';
            else
              m2[i][j] = 'R';
            break;
          case 'S':
            if (m[i + 1][j] == 'R' || m[i - 1][j] == 'R' || m[i][j + 1] == 'R' || m[i][j - 1] == 'R')
              m2[i][j] = 'R';
            else
              m2[i][j] = 'S';
            break;
          case 'P':
            if (m[i + 1][j] == 'S' || m[i - 1][j] == 'S' || m[i][j + 1] == 'S' || m[i][j - 1] == 'S')
              m2[i][j] = 'S';
            else
              m2[i][j] = 'P';
            break;
          }
        }
      }
      for (i = 1; i <= a; ++i)
        for (j = 1; j <= b; ++j)
          m[i][j] = m2[i][j];
    }
    for (i = 1; i <= a; ++i) {
      printf("%s\n", m[i] + 1);
    }
    printf("\n");
  }
  return 0;
}
```