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

```asm
<multiplica>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x5c(%rbp)
  mov    %r8d,-0x60(%rbp)
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    $0x180,%edx
  mov    $0x3e8,%esi
  mov    %eax,%edi
  call   <shmget@plt>
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L2
L1:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x30(%rbp),%eax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <shmat@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x3c(%rbp)
L2:
  mov    -0x3c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L1
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  mov    $0x180,%edx
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <shmget@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <shmat@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x5c(%rbp),%eax
  cltd
  idivl  -0x60(%rbp)
  mov    %eax,-0x28(%rbp)
  mov    -0x5c(%rbp),%eax
  cltd
  idivl  -0x60(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x60(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  je     L40
  mov    -0x60(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jge    L36
L40:
  movl   $0x0,-0x38(%rbp)
  jmp    L66
L159:
  call   <fork@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jne    L8
  mov    -0x38(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L115
L97:
  movl   $0x0,-0x3c(%rbp)
  jmp    L26
L119:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x50(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x58(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L26:
  mov    -0x3c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L119
  addl   $0x1,-0x34(%rbp)
L115:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L97
  mov    $0x1,%edi
  call   <exit@plt>
L8:
  addl   $0x1,-0x38(%rbp)
L66:
  mov    -0x38(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L159
  cmpl   $0x0,-0x24(%rbp)
  je     L109
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L12
L68:
  movl   $0x0,-0x3c(%rbp)
  jmp    L53
L105:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x50(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x58(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L53:
  mov    -0x3c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L105
  addl   $0x1,-0x34(%rbp)
L12:
  mov    -0x34(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L68
L109:
  movl   $0x0,-0x38(%rbp)
  jmp    L47
L87:
  mov    $0x0,%edi
  call   <wait@plt>
  addl   $0x1,-0x38(%rbp)
L47:
  mov    -0x38(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L87
L36:
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void multiplica(int **m1, int **m2, int **m3, int tam, int nthreads) {
  int min, *max, i, l, c;
  int mrId = shmget(IPC_PRIVATE, 1000, 0600);
  for (i = 0; i < tam; i++)
    m3[i] = shmat(mrId, NULL, NULL);
  int maxId = shmget(IPC_PRIVATE, sizeof(int), 0600);
  max = shmat(maxId, NULL, NULL);
  int num = tam / nthreads;
  int resto = tam % nthreads;
  if (nthreads == tam || nthreads < tam) {
    for (l = 0; l < nthreads; l++) {
      int thread = fork();
      if (thread == 0) {
        min = l * num;
        *max = num * (l + 1);
        for (c = min; c < *max; c++)
          for (i = 0; i < tam; i++)
            m3[l][c] = m3[l][c] + (m1[l][i] * m2[i][c]);
        exit(1);
      }
    }
    if (resto != 0)
      for (c = *max; c < tam; c++)
        for (i = 0; i < tam; i++)
          m3[l][c] = m3[l][c] + (m1[l][i] * m2[i][c]);
    for (l = 0; l < nthreads; l++)
      wait(NULL);
  }
}
```