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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x5000(%rsp),%r11
L218:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L218
  sub    $0x668,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x5658(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  lea    D13(%rip),%rdi
  call   <scanf@plt>
  mov    0x10(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x10(%rsp)
  test   %eax,%eax
  je     L96
  lea    0xf3(%rsp),%rax
  mov    %rax,(%rsp)
  jmp    L408
L53:
  cmpb   $0x50,0x1(%rcx)
  je     L184
  cmpb   $0x50,0x1(%rdi)
  je     L184
  cmpb   $0x50,0x2(%rax)
  je     L184
  cmpb   $0x50,(%rax)
  je     L184
  movb   $0x52,(%rsi)
  jmp    L243
L184:
  movb   $0x50,(%rsi)
L243:
  add    $0x1,%rax
  add    $0x1,%rsi
  add    $0x1,%rcx
  add    $0x1,%rdi
  cmp    %r9,%rcx
  je     L15
L325:
  movzbl 0x1(%rax),%edx
  cmp    $0x52,%dl
  je     L53
  cmp    $0x53,%dl
  je     L360
  cmp    $0x50,%dl
  jne    L243
  cmpb   $0x53,0x1(%rcx)
  je     L130
  cmpb   $0x53,0x1(%rdi)
  je     L130
  cmpb   $0x53,0x2(%rax)
  je     L130
  cmpb   $0x53,(%rax)
  je     L130
  movb   $0x50,(%rsi)
  jmp    L243
L360:
  cmpb   $0x52,0x1(%rcx)
  je     L203
  cmpb   $0x52,0x1(%rdi)
  je     L203
  cmpb   $0x52,0x2(%rax)
  je     L203
  cmpb   $0x52,(%rax)
  je     L203
  movb   $0x53,(%rsi)
  jmp    L243
L203:
  movb   $0x52,(%rsi)
  jmp    L243
L130:
  movb   $0x53,(%rsi)
  jmp    L243
L15:
  add    $0x69,%r9
  add    $0x69,%rbx
  add    $0x69,%rbp
  cmp    %r13,%r9
  je     L37
L233:
  test   %r12d,%r12d
  jle    L15
  lea    0x69(%rbx),%rcx
  lea    -0x69(%rbx),%rdi
  mov    %rbp,%rsi
  mov    %rbx,%rax
  jmp    L325
L37:
  lea    0x6a(%r15),%rcx
  jmp    L31
L199:
  movzbl (%r10,%rax,1),%edx
  mov    %dl,(%r11,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L199
L161:
  add    $0x69,%rcx
  cmp    %r14,%rcx
  je     L170
L31:
  mov    %rcx,%rax
  sub    %r15,%rax
  sub    $0x1,%rax
  test   %r12d,%r12d
  jg     L199
  jmp    L161
L170:
  subl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    $0xffffffff,%eax
  je     L172
L95:
  mov    (%rsp),%rax
  lea    (%rax,%r15,1),%r9
  lea    0x89(%rsp),%rbx
  lea    0x2baa(%rsp),%rbp
  cmpl   $0x0,0xc(%rsp)
  jg     L233
  jmp    L170
L172:
  movl   $0xffffffff,0x1c(%rsp)
L13:
  cmpl   $0x0,0x14(%rsp)
  jle    L245
  lea    0x8a(%rsp),%rbp
  mov    $0x1,%ebx
L210:
  mov    %rbp,%rdi
  call   <puts@plt>
  add    $0x1,%ebx
  add    $0x69,%rbp
  cmp    %ebx,0x14(%rsp)
  jge    L210
L245:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x10(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x10(%rsp)
  test   %eax,%eax
  je     L96
L408:
  lea    0x1c(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  lea    0x14(%rsp),%rsi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%r15d
  test   %r15d,%r15d
  jle    L111
  lea    0x8a(%rsp),%rbp
  mov    $0x1,%ebx
  lea    D1(%rip),%r12
L239:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    0x14(%rsp),%r15d
  add    $0x69,%rbp
  cmp    %ebx,%r15d
  jge    L239
L111:
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%ebx
  mov    %ebx,0x8(%rsp)
  mov    %ebx,0x1c(%rsp)
  test   %eax,%eax
  je     L13
  mov    0x18(%rsp),%r12d
  lea    -0x1(%r12),%ebx
  lea    -0x1(%r15),%eax
  lea    (%rax,%rax,2),%rdx
  lea    (%rax,%rdx,4),%rdx
  lea    (%rax,%rdx,8),%rax
  lea    0x15c(%rsp,%rbx,1),%r13
  add    %rax,%r13
  lea    0xd3(%rbx,%rax,1),%r14
  lea    0x21(%rsp),%r11
  lea    0x2b41(%rsp),%r10
  mov    %r15d,0xc(%rsp)
  mov    %rbx,%r15
  jmp    L95
L96:
  mov    0x5658(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L169
  mov    $0x0,%eax
  add    $0x5668,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L169:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D13
type: string
name: unpack_data
arguments: label: D11
type: string
name: unpack_data
arguments: label: D1
type: string

tool: D13: %d

tool: D11: %d %d %d

tool: D1: %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;
}
```