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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x44(%rbp),%rsi
  lea    D8(%rip),%rdi
  call   <scanf@plt>
  mov    -0x44(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x44(%rbp)
  test   %eax,%eax
  jne    L72
L128:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L50:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L184
  orq    $0x0,-0x8(%rsp,%rdx,1)
L184:
  mov    %rsp,%r14
  test   %ecx,%ecx
  jle    L175
  mov    -0x78(%rbp),%r13
  shr    $0x3,%r13
  mov    $0x0,%r15d
  mov    %r13,-0x58(%rbp)
  mov    %r14,%r13
  jmp    L65
L97:
  mov    %r12,%rsi
  lea    D28(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  add    $0x8,%r12
  cmp    %ebx,-0x3c(%rbp)
  jg     L97
L56:
  add    $0x1,%r15d
  mov    -0x40(%rbp),%eax
  add    -0x78(%rbp),%r13
  cmp    %r15d,%eax
  jle    L158
L65:
  mov    %r13,%r12
  mov    $0x0,%ebx
  cmpl   $0x0,-0x3c(%rbp)
  jg     L97
  jmp    L56
L158:
  mov    -0x58(%rbp),%r13
  test   %eax,%eax
  jle    L108
  movq   $0x0,-0x68(%rbp)
  mov    $0x0,%r15d
  mov    $0x0,%ebx
  jmp    L87
L108:
  mov    $0x0,%ebx
  jmp    L31
L24:
  add    $0x1,%r12d
  mov    -0x3c(%rbp),%esi
  addq   $0x8,-0x58(%rbp)
  cmp    %r12d,%esi
  jle    L58
L18:
  sub    %r12d,%esi
  mov    -0x40(%rbp),%edi
  sub    %r15d,%edi
  call   <min@plt>
  mov    %eax,-0x5c(%rbp)
  mov    %r12d,%esi
  mov    %r15d,%edi
  call   <min@plt>
  mov    %eax,%edi
  mov    -0x5c(%rbp),%esi
  sub    $0x1,%esi
  call   <min@plt>
  mov    %eax,%r9d
  test   %eax,%eax
  js     L24
  mov    -0x70(%rbp),%rsi
  mov    -0x58(%rbp),%rdi
  add    %rdi,%rsi
  mov    %rbx,%rax
  neg    %rax
  lea    (%rdi,%rax,8),%r8
  add    -0x68(%rbp),%r8
  add    %r14,%r8
  mov    $0x0,%ecx
  movslq %r12d,%rdi
L106:
  lea    (%rcx,%r15,1),%edx
  movslq %edx,%rdx
  imul   %r13,%rdx
  add    %rdi,%rdx
  mov    %r15d,%eax
  sub    %ecx,%eax
  cltq
  imul   %r13,%rax
  add    %rdi,%rax
  mov    (%r14,%rax,8),%rax
  cmp    %rax,(%r14,%rdx,8)
  jne    L24
  mov    (%rsi),%rax
  cmp    %rax,(%r8,%rbx,8)
  jne    L24
  add    $0x1,%rbx
  add    $0x1,%ecx
  sub    $0x8,%rsi
  cmp    %ecx,%r9d
  jge    L106
  jmp    L24
L58:
  add    $0x1,%r15d
  mov    -0x78(%rbp),%rdi
  add    %rdi,-0x68(%rbp)
  cmp    %r15d,-0x40(%rbp)
  jle    L31
L87:
  mov    -0x3c(%rbp),%eax
  movq   $0x0,-0x58(%rbp)
  mov    $0x0,%r12d
  mov    -0x68(%rbp),%rdi
  lea    (%r14,%rdi,1),%rsi
  mov    %rsi,-0x70(%rbp)
  mov    %eax,%esi
  test   %eax,%eax
  jg     L18
  jmp    L58
L175:
  mov    $0x0,%ebx
L31:
  mov    %rbx,%rsi
  lea    D32(%rip),%rdi
  call   <printf@plt>
  mov    -0x80(%rbp),%rsp
  mov    -0x44(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x44(%rbp)
  test   %eax,%eax
  je     L128
L72:
  mov    %rsp,-0x80(%rbp)
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%ecx
  movslq -0x3c(%rbp),%rdx
  lea    0x0(,%rdx,8),%rax
  mov    %rax,-0x78(%rbp)
  movslq %ecx,%rax
  imul   %rdx,%rax
  lea    0xf(,%rax,8),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffffff0,%rax
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L187:
  cmp    %rsi,%rsp
  je     L50
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L187
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D8
type_infered: string
name: disassemble_data
arguments: tag: D28
type_infered: string
name: disassemble_data
arguments: tag: D32
type_infered: string
name: disassemble_data
arguments: tag: D14
type_infered: string

tool: D8: %d

tool: D28: %zu

tool: D32: %zu


tool: D14: %d %d

assistant: ```c
int main() {
  int t, n, m;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d", &n, &m);
    size_t a[n][m];
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j)
        scanf("%zu", a[i] + j);
    size_t count = 0;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) {
        int max = min(min(i, j), min(n - i, m - j) - 1);
        for (int k = 0; k <= max && a[i + k][j] == a[i - k][j] && a[i][j + k] == a[i][j - k]; count++, ++k)
          ;
      }
    printf("%zu\n", count);
  }
  return 0;
}
```