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

```asm
<_glp_bigdiv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  movslq %edi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  test   %r12d,%r12d
  js     L116
L198:
  movslq %ebx,%r14
  lea    (%r14,%r14,1),%rax
  mov    %rax,(%rsp)
  lea    -0x2(%rbp,%rax,1),%r15
  test   %ebx,%ebx
  jle    L12
  cmpw   $0x0,(%r15)
  lea    D50(%rip),%rsi
  je     L212
  cmp    $0x1,%ebx
  je     L321
L8:
  movzwl (%r15),%ecx
L5:
  add    $0x1,%ecx
  mov    $0x10000,%eax
  xor    %edx,%edx
  div    %ecx
  mov    %eax,%r8d
  lea    (%r12,%rbx,1),%eax
  movslq %eax,%rdx
  lea    0x0(%r13,%rdx,2),%r9
  cmp    $0x1,%r8w
  je     L30
  test   %eax,%eax
  jle    L265
  sub    $0x1,%eax
  movzwl %r8w,%edi
  mov    %r13,%rcx
  lea    0x2(%r13,%rax,2),%rsi
  xor    %eax,%eax
  nopl   0x0(%rax)
L329:
  movzwl (%rcx),%edx
  add    $0x2,%rcx
  imul   %edi,%edx
  add    %edx,%eax
  mov    %ax,-0x2(%rcx)
  shr    $0x10,%eax
  cmp    %rcx,%rsi
  jne    L329
L253:
  mov    %ax,(%r9)
  test   %ebx,%ebx
  jle    L404
  lea    -0x1(%rbx),%eax
  movzwl %r8w,%edi
  mov    %rbp,%rcx
  lea    0x2(%rbp,%rax,2),%rsi
  xor    %eax,%eax
  nopl   0x0(%rax)
L144:
  movzwl (%rcx),%edx
  add    $0x2,%rcx
  imul   %edi,%edx
  add    %edx,%eax
  mov    %ax,-0x2(%rcx)
  shr    $0x10,%eax
  cmp    %rcx,%rsi
  jne    L144
L404:
  test   %r12d,%r12d
  js     L168
  movzwl (%r9),%r9d
L25:
  movslq %r12d,%rax
  lea    (%rax,%r14,1),%rdx
  lea    0x0(%r13,%rax,2),%rsi
  lea    0x0(%r13,%rdx,2),%rdi
L27:
  movzwl (%r15),%r10d
  movzwl -0x2(%rdi),%eax
  mov    %r10d,%ecx
  mov    %eax,%edx
  cmp    %r9w,%r10w
  jbe    L21
  shl    $0x10,%r9d
  xor    %edx,%edx
  add    %r9d,%eax
  div    %r10d
  mov    %eax,%r10d
  test   %ax,%ax
  jne    L386
L148:
  sub    $0x1,%r12d
  mov    %r10w,(%rdi)
  sub    $0x2,%rsi
  sub    $0x2,%rdi
  cmp    $0xffffffff,%r12d
  je     L168
  movzwl (%rdi),%r9d
  jmp    L27
  nopl   (%rax)
L12:
  lea    D50(%rip),%rsi
  mov    $0x88,%edx
  lea    D24(%rip),%rdi
  mov    %rsi,0x8(%rsp)
  call   <glp_assert_@plt>
  movzwl (%r15),%ecx
  mov    0x8(%rsp),%rsi
  test   %cx,%cx
  jne    L5
L212:
  mov    $0x89,%edx
  lea    D0(%rip),%rdi
  call   <glp_assert_@plt>
  cmp    $0x1,%ebx
  jne    L8
L321:
  test   %r12d,%r12d
  js     L85
  movzwl 0x0(%rbp),%esi
  lea    0x0(%r13,%r12,2),%rdi
  lea    -0x2(%r13),%r8
  xor    %edx,%edx
  nopl   0x0(%rax)
L311:
  movzwl (%rdi),%ecx
  shl    $0x10,%edx
  sub    $0x2,%rdi
  add    %edx,%ecx
  xor    %edx,%edx
  mov    %ecx,%eax
  div    %esi
  xor    %edx,%edx
  mov    %ax,0x4(%rdi)
  movzwl 0x0(%rbp),%esi
  mov    %ecx,%eax
  div    %esi
  cmp    %rdi,%r8
  jne    L311
L4:
  mov    %dx,0x0(%r13)
L375:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L21:
  add    %r10d,%eax
  cmp    $0xffff,%eax
  ja     L235
  add    %r10d,%edx
  mov    $0xffffffff,%r10d
L386:
  mov    (%rsp),%rax
  movzwl -0x4(%rbp,%rax,1),%r9d
L64:
  movzwl %r10w,%eax
  imul   %r9d,%eax
  mov    %eax,%r11d
  shr    $0x10,%r11d
  cmp    %dx,%r11w
  ja     L142
  jb     L399
  cmp    %ax,-0x4(%rdi)
  jae    L399
L142:
  sub    $0x1,%r10d
  add    %cx,%dx
  jae    L64
L399:
  test   %r10w,%r10w
  je     L148
  test   %ebx,%ebx
  jle    L148
  nopl   0x0(%rax)
L342:
  movzwl %r10w,%r11d
  xor    %edx,%edx
  xor    %r9d,%r9d
  nopl   0x0(%rax)
L336:
  movzwl 0x0(%rbp,%rdx,2),%eax
  imul   %r11d,%eax
  add    %eax,%r9d
  movzwl (%rsi,%rdx,2),%eax
  mov    %r9d,%ecx
  cmp    %r9w,%ax
  jae    L181
  add    $0x10000,%r9d
  mov    %r9d,%ecx
L181:
  sub    %ecx,%eax
  shr    $0x10,%r9d
  mov    %ax,(%rsi,%rdx,2)
  add    $0x1,%rdx
  cmp    %rdx,%r14
  jne    L336
  cmp    %r9w,(%rdi)
  jae    L148
  sub    $0x1,%r10d
  xor    %ecx,%ecx
  xor    %eax,%eax
L291:
  movzwl (%rsi,%rcx,2),%edx
  movzwl 0x0(%rbp,%rcx,2),%r9d
  add    %r9d,%edx
  add    %edx,%eax
  mov    %ax,(%rsi,%rcx,2)
  add    $0x1,%rcx
  shr    $0x10,%eax
  cmp    %rcx,%r14
  jne    L291
  jmp    L148
  nopl   0x0(%rax)
L30:
  xor    %eax,%eax
  mov    %ax,(%r9)
  xor    %r9d,%r9d
  test   %r12d,%r12d
  jns    L25
  jmp    L375
  nop
L116:
  mov    $0x87,%edx
  lea    D50(%rip),%rsi
  lea    D49(%rip),%rdi
  call   <glp_assert_@plt>
  jmp    L198
  nopl   (%rax)
L235:
  mov    $0xffffffff,%r10d
  test   %ebx,%ebx
  jg     L342
  jmp    L148
  nopl   0x0(%rax,%rax,1)
L265:
  xor    %eax,%eax
  jmp    L253
  nop
L168:
  cmp    $0x1,%r8w
  jbe    L375
  sub    $0x1,%ebx
  js     L375
  movslq %ebx,%rbx
  movzwl %r8w,%ecx
  xor    %edx,%edx
  mov    %rbx,%rsi
L221:
  movzwl 0x0(%r13,%rsi,2),%eax
  shl    $0x10,%edx
  add    %edx,%eax
  xor    %edx,%edx
  div    %ecx
  mov    %ax,0x0(%r13,%rsi,2)
  sub    $0x1,%rsi
  test   %esi,%esi
  jns    L221
  xor    %edx,%edx
  nop
L185:
  movzwl 0x0(%rbp,%rbx,2),%eax
  shl    $0x10,%edx
  add    %edx,%eax
  xor    %edx,%edx
  div    %ecx
  mov    %ax,0x0(%rbp,%rbx,2)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jns    L185
  jmp    L375
L85:
  xor    %edx,%edx
  jmp    L4
```

tool_calls: name: read_data
arguments: data_tag: D50
type_guessed: string
name: read_data
arguments: data_tag: D24
type_guessed: string
name: read_data
arguments: data_tag: D0
type_guessed: string
name: read_data
arguments: data_tag: D49
type_guessed: string

tool: D50: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MarhesLab/NeeleyThesisCode/refs/heads/master/lib/glpk-4.52/src/misc/bignum.c

tool: D24: m >= 1

tool: D0: y[m-1] != 0

tool: D49: n >= 0

assistant: ```c
void _glp_bigdiv(int n, int m, unsigned short x[], unsigned short y[]) {
  int i, j;
  unsigned int t;
  unsigned short d, q, r;
  ((void)((n >= 0) || (glp_assert_("n >= 0", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MarhesLab/NeeleyThesisCode/refs/heads/master/lib/glpk-4.52/src/misc/bignum.c", 135), 1)));
  ((void)((m >= 1) || (glp_assert_("m >= 1", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MarhesLab/NeeleyThesisCode/refs/heads/master/lib/glpk-4.52/src/misc/bignum.c", 136), 1)));
  ((void)((y[m - 1] != 0) || (glp_assert_("y[m-1] != 0", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MarhesLab/NeeleyThesisCode/refs/heads/master/lib/glpk-4.52/src/misc/bignum.c", 137), 1)));
  if (m == 1) {
    d = 0;
    for (i = n; i >= 0; i--) {
      t = ((unsigned int)d << 16) + (unsigned int)x[i];
      x[i + 1] = (unsigned short)(t / y[0]);
      d = (unsigned short)(t % y[0]);
    }
    x[0] = d;
    goto done;
  }
  d = (unsigned short)(0x10000 / ((unsigned int)y[m - 1] + 1));
  if (d == 1)
    x[n + m] = 0;
  else {
    t = 0;
    for (i = 0; i < n + m; i++) {
      t += (unsigned int)x[i] * (unsigned int)d;
      x[i] = (unsigned short)t;
      t >>= 16;
    }
    x[n + m] = (unsigned short)t;
    t = 0;
    for (j = 0; j < m; j++) {
      t += (unsigned int)y[j] * (unsigned int)d;
      y[j] = (unsigned short)t;
      t >>= 16;
    }
  }
  for (i = n; i >= 0; i--) {
    if (x[i + m] < y[m - 1]) {
      t = ((unsigned int)x[i + m] << 16) + (unsigned int)x[i + m - 1];
      q = (unsigned short)(t / (unsigned int)y[m - 1]);
      r = (unsigned short)(t % (unsigned int)y[m - 1]);
      if (q == 0)
        goto putq;
      else
        goto test;
    }
    q = 0;
    r = x[i + m - 1];
  decr:
    q--;
    t = (unsigned int)r + (unsigned int)y[m - 1];
    r = (unsigned short)t;
    if (t > 0xFFFF)
      goto msub;
  test:
    t = (unsigned int)y[m - 2] * (unsigned int)q;
    if ((unsigned short)(t >> 16) > r)
      goto decr;
    if ((unsigned short)(t >> 16) < r)
      goto msub;
    if ((unsigned short)t > x[i + m - 2])
      goto decr;
  msub:
    if (q == 0)
      goto putq;
    t = 0;
    for (j = 0; j < m; j++) {
      t += (unsigned int)y[j] * (unsigned int)q;
      if (x[i + j] < (unsigned short)t)
        t += 0x10000;
      x[i + j] -= (unsigned short)t;
      t >>= 16;
    }
    if (x[i + m] >= (unsigned short)t)
      goto putq;
    q--;
    t = 0;
    for (j = 0; j < m; j++) {
      t += (unsigned int)x[i + j] + (unsigned int)y[j];
      x[i + j] = (unsigned short)t;
      t >>= 16;
    }
  putq:
    x[i + m] = q;
  }
  if (d > 1) {
    t = 0;
    for (i = m - 1; i >= 0; i--) {
      t = (t << 16) + (unsigned int)x[i];
      x[i] = (unsigned short)(t / (unsigned int)d);
      t %= (unsigned int)d;
    }
    t = 0;
    for (j = m - 1; j >= 0; j--) {
      t = (t << 16) + (unsigned int)y[j];
      y[j] = (unsigned short)(t / (unsigned int)d);
      t %= (unsigned int)d;
    }
  }
done:
  return;
}
```