user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D0(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x38(%rsp),%rsi
  call   <scanf@plt>
  mov    0x38(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,0x38(%rsp)
  test   %rax,%rax
  je     L62
  lea    0x30(%rsp),%rax
  lea    D29(%rip),%r12
  mov    %rax,0x18(%rsp)
  lea    0x40(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x28(%rsp),%rax
  mov    %rax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L31:
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x30(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    0x30(%rsp),%rdi
  mov    %rax,%r14
  test   %rdi,%rdi
  jle    L83
  mov    %rax,%rbx
  mov    %rax,%r15
  xor    %r13d,%r13d
  nopl   (%rax)
L85:
  shl    $0x3,%edi
  add    $0x1,%r13
  add    $0x8,%r15
  call   <malloc@plt>
  mov    0x30(%rsp),%rdi
  mov    %rax,-0x8(%r15)
  cmp    %r13,%rdi
  jg     L85
  test   %rdi,%rdi
  jle    L83
  xor    %r13d,%r13d
  cs nopw 0x0(%rax,%rax,1)
L16:
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L96:
  mov    (%rbx),%rax
  mov    %rbp,%rdi
  lea    (%rax,%r15,8),%rsi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <scanf@plt>
  mov    0x30(%rsp),%rax
  cmp    %r15,%rax
  jg     L96
  add    $0x1,%r13
  cmp    %r13,%rax
  jle    L83
  add    $0x8,%rbx
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L83:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    D4(%rip),%rdi
  call   <scanf@plt>
  mov    0x40(%rsp),%rcx
  mov    0x30(%rsp),%rdx
  mov    %r14,%rdi
  mov    0x28(%rsp),%rsi
  call   <mod_pow@plt>
  mov    $0xa,%edi
  mov    %rax,%rbx
  call   <putchar@plt>
  cmpq   $0x0,0x30(%rsp)
  jle    L12
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L81:
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L3:
  mov    (%rbx),%rax
  mov    %r12,%rdi
  mov    (%rax,%r14,8),%rsi
  xor    %eax,%eax
  add    $0x1,%r14
  call   <printf@plt>
  cmp    %r14,0x30(%rsp)
  jg     L3
  mov    $0xa,%edi
  add    $0x1,%r13
  add    $0x8,%rbx
  call   <putchar@plt>
  cmp    %r13,0x30(%rsp)
  jg     L81
L12:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x38(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,0x38(%rsp)
  test   %rax,%rax
  jne    L31
L62:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D0
type_guessed: string
name: retrieve_data
arguments: tag: D29
type_guessed: string
name: retrieve_data
arguments: tag: D4
type_guessed: string

tool: D0: %lld

tool: D29: %lld 

tool: D4: %lld %lld

assistant: ```c
int main() {
  long long int i, j, k, p;
  long long int **matrix;
  long long int n, t;
  long long int mod;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    matrix = (long long int **)malloc(sizeof(long long int) * n);
    for (i = 0; i < n; i++) {
      matrix[i] = (long long int *)malloc(sizeof(long long int) * n);
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        scanf("%lld", &matrix[i][j]);
      }
    }
    printf("\n");
    scanf("%lld %lld", &p, &mod);
    matrix = mod_pow(matrix, p, n, mod);
    printf("\n");
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        printf("%lld ", matrix[i][j]);
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}
```