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

```asm
<mp_base_mul>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  je     L92
  mov    -0x40(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x48(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%rax
  shr    $0x10,%rax
  mov    %ax,-0x22(%rbp)
  movq   $0x1,-0x18(%rbp)
  jmp    L10
L29:
  mov    -0x40(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %rax,%rdx
  movzwl -0x22(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%rdx
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%rax
  shr    $0x10,%rax
  mov    %ax,-0x22(%rbp)
  addq   $0x1,-0x18(%rbp)
L10:
  mov    -0x18(%rbp),%rax
  cmp    %rax,-0x58(%rbp)
  ja     L29
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x22(%rbp),%eax
  mov    %ax,(%rdx)
L92:
  movq   $0x1,-0x20(%rbp)
  jmp    L97
L28:
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  je     L85
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x48(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %rax,%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%rdx
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%rax
  shr    $0x10,%rax
  mov    %ax,-0x22(%rbp)
  movq   $0x1,-0x18(%rbp)
  jmp    L52
L83:
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %rax,%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %rax,%rdx
  movzwl -0x22(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%rdx
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%rax
  shr    $0x10,%rax
  mov    %ax,-0x22(%rbp)
  addq   $0x1,-0x18(%rbp)
L52:
  mov    -0x18(%rbp),%rax
  cmp    %rax,-0x58(%rbp)
  ja     L83
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x22(%rbp),%eax
  mov    %ax,(%rdx)
L85:
  addq   $0x1,-0x20(%rbp)
L97:
  mov    -0x20(%rbp),%rax
  cmp    %rax,-0x50(%rbp)
  ja     L28
  cmpq   $0x1,-0x10(%rbp)
  jle    L74
  mov    -0x10(%rbp),%rax
  add    %rax,%rax
  lea    -0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  test   %ax,%ax
  jne    L74
  subq   $0x1,-0x10(%rbp)
L74:
  mov    -0x10(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
long mp_base_mul(unsigned short *rop, unsigned short *op1, unsigned short *op2, unsigned long len1, unsigned long len2) {
  long i, j;
  unsigned long value;
  unsigned short carry;
  long size = len1 + len2;
  if (op1[0]) {
    value = (unsigned long)(op1[0]) * op2[0];
    rop[0] = value;
    carry = (unsigned short)(value >> 16);
    for (j = 1; j < len2; j++) {
      value = (unsigned long)(op1[0]) * op2[j] + carry;
      rop[j] = value;
      carry = (unsigned short)(value >> 16);
    }
    rop[j] = carry;
  }
  for (i = 1; i < len1; i++) {
    if (op1[i]) {
      value = (unsigned long)(op1[i]) * op2[0] + rop[i];
      rop[i] = value;
      carry = (unsigned short)(value >> 16);
      for (j = 1; j < len2; j++) {
        value = (unsigned long)(op1[i]) * op2[j] + rop[i + j] + carry;
        rop[i + j] = value;
        carry = (unsigned short)(value >> 16);
      }
      rop[i + j] = carry;
    }
  }
  if (size > 1 && rop[size - 1] == 0)
    --size;
  return (size);
}
```