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

```asm
<mp_unsgn_idiv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  movsd  %xmm0,-0x30(%rbp)
  mov    %rsi,-0x38(%rbp)
  movsd  %xmm1,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movsd  D9(%rip),%xmm0
  divsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L65:
  addl   $0x1,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jg     L66
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L66:
  movsd  -0x40(%rbp),%xmm0
  movsd  D20(%rip),%xmm1
  subsd  %xmm1,%xmm0
  comisd -0x10(%rbp),%xmm0
  ja     L65
  movsd  -0x10(%rbp),%xmm1
  movsd  D20(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x8(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x48(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  subl   $0x1,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L29
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
L29:
  movl   $0x2,-0x20(%rbp)
  jmp    L46
L2:
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1c(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D20(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x8(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L46:
  mov    -0x24(%rbp),%eax
  sub    -0x18(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jle    L2
  mov    -0x24(%rbp),%eax
  sub    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L49
L0:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1c(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x30(%rbp),%xmm1
  movsd  D20(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x8(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L49:
  mov    -0x20(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L0
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
type: byte[8]
name: unpack_data
arguments: data_tag: D20
type: f64

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D20: 0.5

assistant: ```c
void mp_unsgn_idiv(int n, double dradix, int in1[], double din2, int out[]) {
  int j, ix, carry, shift;
  double x, d1_in2;
  d1_in2 = ((double)1) / din2;
  shift = 0;
  x = 0;
  do {
    shift++;
    x *= dradix;
    if (shift <= n) {
      x += in1[shift];
    }
  } while (x < din2 - ((double)0.5));
  x += ((double)0.5);
  ix = (int)(d1_in2 * x);
  carry = (int)(x - din2 * ix);
  out[1] = ix;
  shift--;
  out[0] = in1[0] - shift;
  if (shift >= n) {
    shift = n - 1;
  }
  for (j = 2; j <= n - shift; j++) {
    x = in1[j + shift] + dradix * carry + ((double)0.5);
    ix = (int)(d1_in2 * x);
    carry = (int)(x - din2 * ix);
    out[j] = ix;
  }
  for (j = n - shift + 1; j <= n; j++) {
    x = dradix * carry + ((double)0.5);
    ix = (int)(d1_in2 * x);
    carry = (int)(x - din2 * ix);
    out[j] = ix;
  }
}
```