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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x28(%rsp),%rsi
  lea    D39(%rip),%rdi
  call   <scanf@plt>
  mov    0x28(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,0x28(%rsp)
  test   %rax,%rax
  je     L138
  lea    D39(%rip),%r12
  lea    D22(%rip),%r13
  jmp    L109
L85:
  mov    0x0(%rbp),%rax
  lea    (%rax,%rbx,8),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  cmp    %rbx,0x20(%rsp)
  jg     L85
L174:
  add    $0x1,%r14
  add    $0x8,%r15
  cmp    %r14,0x20(%rsp)
  jle    L130
L177:
  mov    %r15,%rbp
  mov    $0x0,%ebx
  cmpq   $0x0,0x20(%rsp)
  jg     L85
  jmp    L174
L130:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x30(%rsp),%rdx
  lea    0x18(%rsp),%rsi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x30(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <mod_pow@plt>
  mov    %rax,%rbp
  mov    $0xa,%edi
  call   <putchar@plt>
  cmpq   $0x0,0x20(%rsp)
  jle    L39
  mov    $0x0,%r14d
  jmp    L129
L28:
  mov    0x0(%rbp),%rax
  mov    (%rax,%rbx,8),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,0x20(%rsp)
  jg     L28
L145:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r14
  add    $0x8,%rbp
  cmp    %r14,0x20(%rsp)
  jle    L39
L129:
  mov    $0x0,%ebx
  cmpq   $0x0,0x20(%rsp)
  jg     L28
  jmp    L145
L39:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x28(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,0x28(%rsp)
  test   %rax,%rax
  je     L138
L109:
  lea    0x20(%rsp),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x20(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    0x20(%rsp),%rdi
  test   %rdi,%rdi
  jle    L130
  mov    %rax,%r15
  mov    %rax,%rbp
  mov    $0x0,%ebx
L7:
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  add    $0x1,%rbx
  mov    0x20(%rsp),%rdi
  add    $0x8,%rbp
  cmp    %rbx,%rdi
  jg     L7
  test   %rdi,%rdi
  jle    L130
  mov    $0x0,%r14d
  jmp    L177
L138:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L73
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L73:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D39
data_type: string
name: disassemble_data
arguments: data_label: D22
data_type: string
name: disassemble_data
arguments: data_label: D0
data_type: string

tool: D39: %lld

tool: D22: %lld 

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