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

```asm
<__edivm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    -0x50(%rbp),%rbx
  mov    %rbx,%rax
  lea    0x2(%rax),%rbx
  mov    -0x80(%rbp),%rdx
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  mov    %rbx,%rax
  lea    0x2(%rax),%rbx
  mov    -0x80(%rbp),%rdx
  movzwl 0x2(%rdx),%edx
  mov    %dx,(%rax)
  movl   $0x2,-0x5c(%rbp)
  jmp    L138
L20:
  mov    %rbx,%rax
  lea    0x2(%rax),%rbx
  movw   $0x0,(%rax)
  addl   $0x1,-0x5c(%rbp)
L138:
  cmpl   $0x8,-0x5c(%rbp)
  jle    L20
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <__eshdn1@plt>
  mov    -0x78(%rbp),%rax
  movzwl 0x6(%rax),%eax
  mov    %ax,-0x5e(%rbp)
  movl   $0x2,-0x5c(%rbp)
  jmp    L58
L48:
  mov    -0x80(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  shl    $0x10,%rax
  mov    %rax,%rdx
  mov    -0x80(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  movzwl -0x5e(%rbp),%edx
  mov    %rdx,%rax
  shl    $0x10,%rax
  sub    %rdx,%rax
  cmp    %rax,-0x58(%rbp)
  jbe    L91
  movw   $0xffff,-0x60(%rbp)
  jmp    L111
L91:
  movzwl -0x5e(%rbp),%ecx
  mov    -0x58(%rbp),%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %ax,-0x60(%rbp)
L111:
  movzwl -0x60(%rbp),%eax
  lea    -0x30(%rbp),%rdx
  mov    -0x78(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <__m16m@plt>
  mov    -0x80(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__ecmpm@plt>
  test   %rax,%rax
  jle    L4
  subw   $0x1,-0x60(%rbp)
  lea    -0x30(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__esubm@plt>
  mov    -0x80(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__ecmpm@plt>
  test   %rax,%rax
  jle    L4
  subw   $0x1,-0x60(%rbp)
  lea    -0x30(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__esubm@plt>
L4:
  mov    -0x80(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__esubm@plt>
  mov    -0x5c(%rbp),%eax
  cltq
  movzwl -0x60(%rbp),%edx
  mov    %dx,-0x50(%rbp,%rax,2)
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <__eshup6@plt>
  addl   $0x1,-0x5c(%rbp)
L58:
  cmpl   $0x8,-0x5c(%rbp)
  jle    L48
  mov    -0x80(%rbp),%rax
  lea    0x4(%rax),%rbx
  movw   $0x0,-0x62(%rbp)
  movl   $0x2,-0x5c(%rbp)
  jmp    L90
L24:
  mov    %rbx,%rax
  lea    0x2(%rax),%rbx
  movzwl (%rax),%eax
  or     %ax,-0x62(%rbp)
  addl   $0x1,-0x5c(%rbp)
L90:
  cmpl   $0x8,-0x5c(%rbp)
  jle    L24
  cmpw   $0x0,-0x62(%rbp)
  je     L124
  movw   $0x1,-0x62(%rbp)
L124:
  movl   $0x0,-0x5c(%rbp)
  jmp    L27
L120:
  mov    -0x5c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x80(%rbp),%rax
  add    %rax,%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  movzwl -0x50(%rbp,%rax,2),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x5c(%rbp)
L27:
  cmpl   $0x8,-0x5c(%rbp)
  jle    L120
  movzwl -0x62(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L113
  call   <__stack_chk_fail@plt>
L113:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int __edivm(short unsigned int *den, short unsigned int *num) {
  int i;
  register unsigned short *p;
  unsigned long tnum;
  unsigned short j, tdenm, tquot;
  unsigned short tprod[(6 + 3) + 1];
  unsigned short equot[(6 + 3)];
  p = &equot[0];
  *p++ = num[0];
  *p++ = num[1];
  for (i = 2; i < (6 + 3); i++) {
    *p++ = 0;
  }
  __eshdn1(num);
  tdenm = den[2 + 1];
  for (i = 2; i < (6 + 3); i++) {
    tnum = (((unsigned long)num[2]) << 16) + num[2 + 1];
    if ((tdenm * 0xffffUL) < tnum)
      tquot = 0xffff;
    else
      tquot = tnum / tdenm;
    __m16m(tquot, den, tprod);
    if (__ecmpm(tprod, num) > 0) {
      tquot -= 1;
      __esubm(den, tprod);
      if (__ecmpm(tprod, num) > 0) {
        tquot -= 1;
        __esubm(den, tprod);
      }
    }
    __esubm(tprod, num);
    equot[i] = tquot;
    __eshup6(num);
  }
  p = &num[2];
  j = 0;
  for (i = 2; i < (6 + 3); i++) {
    j |= *p++;
  }
  if (j)
    j = 1;
  for (i = 0; i < (6 + 3); i++)
    num[i] = equot[i];
  return ((int)j);
}
```