user: Please show me the C implementation that matches the assembly code listed below:

```asm
<__edivm>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  mov    %rsi,%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  mov    (%rsi),%eax
  movl   $0x0,0x1c(%rsp)
  lea    0x14(%rsp),%rbp
  lea    0x30(%rsp),%rbx
  movq   $0x0,0x14(%rsp)
  mov    %eax,0x10(%rsp)
  xor    %eax,%eax
  mov    %ax,0x20(%rsp)
  call   <__eshdn1@plt>
  movzwl 0x6(%r13),%eax
  mov    %rax,%r14
  mov    %rax,0x8(%rsp)
  shl    $0x10,%r14
  sub    %rax,%r14
  lea    0x22(%rsp),%rax
  mov    %rax,(%rsp)
  jmp    L10
  nopl   (%rax)
L67:
  xor    %edx,%edx
  divq   0x8(%rsp)
  mov    %eax,%r12d
  movzwl %ax,%edi
L24:
  mov    %r13,%rsi
  mov    %rbx,%rdx
  call   <__m16m@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <__ecmpm@plt>
  test   %rax,%rax
  jg     L50
L49:
  mov    %r15,%rsi
  mov    %rbx,%rdi
  add    $0x2,%rbp
  call   <__esubm@plt>
  mov    %r15,%rdi
  mov    %r12w,-0x2(%rbp)
  call   <__eshup6@plt>
  cmp    (%rsp),%rbp
  je     L83
L10:
  movzwl 0x4(%r15),%eax
  movzwl 0x6(%r15),%edx
  shl    $0x10,%rax
  add    %rdx,%rax
  cmp    %rax,%r14
  jae    L67
  mov    $0xffff,%edi
  mov    $0xffffffff,%r12d
  jmp    L24
  nopl   (%rax)
L50:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <__esubm@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <__ecmpm@plt>
  test   %rax,%rax
  jg     L27
  sub    $0x1,%r12d
  jmp    L49
  nopl   0x0(%rax)
L83:
  movq   0x4(%r15),%xmm0
  movdqa 0x10(%rsp),%xmm1
  pextrw $0x0,%xmm0,%edx
  pextrw $0x1,%xmm0,%eax
  or     %edx,%eax
  pextrw $0x2,%xmm0,%edx
  or     %edx,%eax
  pextrw $0x3,%xmm0,%edx
  or     %edx,%eax
  or     0xc(%r15),%ax
  or     0xe(%r15),%ax
  movups %xmm1,(%r15)
  or     0x10(%r15),%ax
  movzwl 0x20(%rsp),%eax
  mov    %ax,0x10(%r15)
  setne  %al
  movzbl %al,%eax
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L81
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L27:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  sub    $0x2,%r12d
  call   <__esubm@plt>
  jmp    L49
L81:
  call   <__stack_chk_fail@plt>
```

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);
}
```