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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x5000(%rsp),%r11
L181:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L181
  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     L292
  lea    0x3c(%rsp),%rax
  mov    %rax,0x28(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x34(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0xaa(%rsp),%rax
  mov    %rax,0x10(%rsp)
L16:
  mov    0x28(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  mov    0x18(%rsp),%rsi
  call   <scanf@plt>
  mov    0x34(%rsp),%r13d
  test   %r13d,%r13d
  jle    L82
  lea    0xaa(%rsp),%rbp
  mov    $0x1,%ebx
  nopl   0x0(%rax)
L52:
  mov    %rbp,%rsi
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <scanf@plt>
  mov    0x34(%rsp),%r13d
  add    $0x69,%rbp
  cmp    %ebx,%r13d
  jge    L52
L82:
  mov    0x3c(%rsp),%eax
  lea    -0x1(%rax),%r14d
  mov    %r14d,0x3c(%rsp)
  test   %eax,%eax
  je     L1
  mov    0x38(%rsp),%r15d
  lea    -0x1(%r13),%eax
  mov    %r13d,0x4(%rsp)
  lea    0x113(%rsp),%rbx
  lea    (%rax,%rax,2),%rdx
  lea    -0x1(%r15),%edi
  lea    (%rax,%rdx,4),%rdx
  mov    %rdi,0x8(%rsp)
  lea    (%rax,%rdx,8),%rax
  lea    (%rbx,%rdi,1),%rbp
  add    %rax,%rbp
  add    %rax,%rbx
  lea    0x1(%rdi),%r12
  nopl   0x0(%rax,%rax,1)
L71:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L68
  lea    0x2bca(%rsp),%r13
  mov    0x10(%rsp),%r9
  lea    0xa9(%rsp),%r10
  add    0x8(%rsp),%r9
  mov    %r13,%r11
  nopl   0x0(%rax)
L54:
  test   %r15d,%r15d
  jle    L19
  lea    -0x69(%r10),%rdi
  lea    0x6a(%r10),%rsi
  mov    %r11,%rcx
  mov    %r10,%rax
  jmp    L150
  nopl   0x0(%rax)
L327:
  cmp    $0x50,%dl
  je     L326
L310:
  add    $0x1,%rax
  add    $0x1,%rcx
  add    $0x1,%rdi
  add    $0x1,%rsi
  cmp    %r9,%rax
  je     L19
L150:
  movzbl 0x1(%rax),%edx
  cmp    $0x52,%dl
  je     L273
  cmp    $0x53,%dl
  jne    L327
  cmpb   $0x52,(%rsi)
  je     L132
  cmpb   $0x52,0x1(%rdi)
  je     L132
  cmpb   $0x52,0x2(%rax)
  je     L132
  cmpb   $0x52,(%rax)
  je     L132
  xchg   %ax,%ax
L176:
  movb   $0x53,(%rcx)
  jmp    L310
  nopl   (%rax)
L273:
  cmpb   $0x50,(%rsi)
  je     L121
  cmpb   $0x50,0x1(%rdi)
  je     L121
  cmpb   $0x50,0x2(%rax)
  je     L121
  cmpb   $0x50,(%rax)
  je     L121
  xchg   %ax,%ax
L132:
  movb   $0x52,(%rcx)
  jmp    L310
  nopl   (%rax)
L326:
  cmpb   $0x53,(%rsi)
  je     L176
  cmpb   $0x53,0x1(%rdi)
  je     L176
  cmpb   $0x53,0x2(%rax)
  je     L176
  cmpb   $0x53,(%rax)
  je     L176
  xchg   %ax,%ax
L121:
  movb   $0x50,(%rcx)
  jmp    L310
  nopl   (%rax)
L19:
  add    $0x69,%r9
  add    $0x69,%r10
  add    $0x69,%r11
  cmp    %rbp,%r9
  jne    L54
  lea    0xaa(%rsp),%rcx
  nopl   (%rax)
L211:
  test   %r15d,%r15d
  jle    L169
  mov    %rcx,%rdi
  mov    %r12,%rdx
  mov    %r13,%rsi
  call   <memcpy@plt>
  mov    %rax,%rcx
L169:
  add    $0x69,%rcx
  add    $0x69,%r13
  cmp    %rcx,%rbx
  jne    L211
L68:
  sub    $0x1,%r14d
  jae    L71
  movl   $0xffffffff,0x3c(%rsp)
  mov    0x4(%rsp),%r13d
L1:
  lea    0xaa(%rsp),%rbp
  mov    $0x1,%ebx
  test   %r13d,%r13d
  jle    L83
  nopl   0x0(%rax)
L142:
  mov    %rbp,%rdi
  add    $0x1,%ebx
  add    $0x69,%rbp
  call   <puts@plt>
  cmp    %ebx,0x34(%rsp)
  jge    L142
L83:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x30(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x30(%rsp)
  test   %eax,%eax
  jne    L16
L292:
  mov    0x5678(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L297
  add    $0x5688,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L297:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D29
datatype: string
name: unpack_data
arguments: label: D3
datatype: string
name: unpack_data
arguments: label: D17
datatype: string

tool: D29: %d

tool: D3: %d %d %d

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