user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L93
L30:
  lea    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x38(%rbp),%rax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L102
L94:
  mov    -0x38(%rbp),%rax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x20(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addq   $0x1,-0x20(%rbp)
L102:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x20(%rbp)
  jl     L94
  movq   $0x0,-0x20(%rbp)
  jmp    L41
L50:
  movq   $0x0,-0x18(%rbp)
  jmp    L52
L13:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addq   $0x1,-0x18(%rbp)
L52:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x18(%rbp)
  jl     L13
  addq   $0x1,-0x20(%rbp)
L41:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x20(%rbp)
  jl     L50
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    -0x28(%rbp),%rdx
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <mod_pow@plt>
  mov    %rax,-0x10(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
  movq   $0x0,-0x20(%rbp)
  jmp    L98
L74:
  movq   $0x0,-0x18(%rbp)
  jmp    L23
L91:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0x18(%rbp)
L23:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x18(%rbp)
  jl     L91
  mov    $0xa,%edi
  call   <putchar@plt>
  addq   $0x1,-0x20(%rbp)
L98:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x20(%rbp)
  jl     L74
  mov    $0xa,%edi
  call   <putchar@plt>
L93:
  mov    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  test   %rax,%rax
  jne    L30
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D16
type_guessed: string
name: disassemble_data
arguments: tag: D36
type_guessed: string
name: disassemble_data
arguments: tag: D37
type_guessed: string

tool: D16: %lld

tool: D36: %lld %lld

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