user: 请将以下的汇编代码转换成C语言代码:

```asm
<LongDiv>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  mov    %rcx,%rsi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0xfe8,%rsp
  mov    %rdx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xfd8(%rsp)
  xor    %eax,%eax
  call   <Copy@plt>
  mov    %rbx,%rdi
  call   <Initialize@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0xffffffff,%eax
  je     L158
  mov    %r14,%rdi
  xor    %r15d,%r15d
  call   <Degree@plt>
  mov    %eax,0x28(%rsp)
  cltq
  lea    (%r14,%rax,4),%rax
  mov    %rax,0x20(%rsp)
  mov    (%rax),%eax
  test   $0x80,%ah
  jne    L90
  nopl   0x0(%rax,%rax,1)
L46:
  add    %eax,%eax
  add    $0x1,%r15d
  test   $0x80,%ah
  je     L46
L90:
  mov    %r15d,%esi
  mov    %rbp,%rdi
  lea    0x30(%rsp),%rbx
  call   <LeftShift@plt>
  mov    %r15d,%esi
  mov    %r14,%rdi
  lea    0x800(%rsp),%r13
  call   <LeftShift@plt>
  mov    0x28(%rsp),%eax
  lea    0x4(,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  jmp    L35
  nopl   0x0(%rax)
L137:
  mov    %rbx,%rdi
  call   <Initialize@plt>
  mov    0x8(%rsp),%ecx
  mov    0x28(%rsp),%eax
  sub    %eax,%ecx
  mov    %ecx,%r12d
  test   %eax,%eax
  js     L57
  movslq %ecx,%rax
  mov    0x18(%rsp),%rdx
  mov    %r14,%rsi
  lea    (%rbx,%rax,4),%rdi
  mov    %rax,0x8(%rsp)
  call   <memcpy@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0x1,%eax
  ja     L53
L174:
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  movl   $0x1,(%rax,%rdx,4)
  call   <Sub@plt>
L17:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0xffffffff,%eax
  je     L65
L35:
  mov    %rbp,%rdi
  call   <Degree@plt>
  mov    0x20(%rsp),%rsi
  mov    %eax,%ecx
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    (%rsi),%esi
  mov    0x0(%rbp,%rax,4),%eax
  mov    %ecx,0x8(%rsp)
  cmp    %esi,%eax
  jae    L137
  shl    $0x10,%eax
  add    -0x4(%rbp,%rdx,1),%eax
  xor    %edx,%edx
  mov    %rbx,%rdi
  div    %esi
  mov    %eax,0x2c(%rsp)
  mov    %eax,%r12d
  call   <Initialize@plt>
  mov    %r13,%rdi
  call   <Initialize@plt>
  mov    0x8(%rsp),%ecx
  mov    0x28(%rsp),%eax
  sub    %eax,%ecx
  mov    %ecx,0x8(%rsp)
  test   %eax,%eax
  js     L155
  mov    %ecx,%eax
  mov    0x18(%rsp),%rdx
  mov    %r14,%rsi
  sub    $0x1,%eax
  cltq
  lea    (%rbx,%rax,4),%rdi
  call   <memcpy@plt>
L155:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <Copy@plt>
  mov    0x2c(%rsp),%esi
  mov    %rbx,%rdi
  call   <Mul@plt>
  jmp    L127
  nopw   0x0(%rax,%rax,1)
L106:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  sub    $0x1,%r12d
  call   <Sub@plt>
L127:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0x1,%eax
  ja     L106
  movslq 0x8(%rsp),%rax
  mov    0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %r12d,-0x4(%rdx,%rax,4)
  call   <Sub@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0xffffffff,%eax
  jne    L35
L65:
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <RightShift@plt>
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <RightShift@plt>
L158:
  mov    0xfd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0xfe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L53:
  mov    %rbx,%rdi
  sub    $0x1,%r12d
  call   <Initialize@plt>
  mov    %r13,%rdi
  movslq %r12d,%r12
  call   <Initialize@plt>
  mov    0x18(%rsp),%rdx
  lea    (%rbx,%r12,4),%rdi
  mov    %r14,%rsi
  call   <memcpy@plt>
L140:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  mov    $0xffff,%r12d
  call   <Copy@plt>
  mov    $0xffff,%esi
  mov    %rbx,%rdi
  call   <Mul@plt>
  jmp    L99
L163:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  sub    $0x1,%r12d
  call   <Sub@plt>
L99:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  cmp    $0x1,%eax
  ja     L163
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %r12d,-0x4(%rax,%rdx,4)
  call   <Sub@plt>
  jmp    L17
  xchg   %ax,%ax
L57:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <Compare@plt>
  movslq %r12d,%rdx
  mov    %rdx,0x8(%rsp)
  cmp    $0x1,%eax
  jbe    L174
  mov    %rbx,%rdi
  call   <Initialize@plt>
  mov    %r13,%rdi
  call   <Initialize@plt>
  jmp    L140
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void LongDiv(unsigned a[], unsigned b[], unsigned quot[], unsigned res[]) {
  int s, t, k, sh;
  int i;
  unsigned x, D, Q;
  unsigned c[500], d[500];
  Copy(a, res);
  Initialize(quot);
  if (Compare(res, b) == -1)
    return;
  t = Degree(b);
  sh = 0;
  x = b[t];
  while ((x & (0x8000)) == 0) {
    x = x << 1;
    sh++;
  }
  LeftShift(res, sh);
  LeftShift(b, sh);
  while (1) {
    s = Degree(res);
    if (res[s] >= b[t]) {
      Initialize(c);
      for (i = 0; i <= t; i++)
        c[s - t + i] = b[i];
      k = Compare(res, c);
      if (k == 1 || k == 0) {
        quot[s - t] = 1;
        Sub(res, c);
      } else {
        Initialize(c);
        Initialize(d);
        for (i = 0; i <= t; i++)
          c[s - t - 1 + i] = b[i];
        Copy(c, d);
        D = 0xffff;
        Mul(c, D);
        while (1) {
          k = Compare(res, c);
          if (k == 1 || k == 0)
            break;
          Sub(c, d);
          D--;
        }
        quot[s - t - 1] = D;
        Sub(res, c);
      }
    } else {
      x = (res[s] << 16) + res[s - 1];
      Q = x / b[t];
      Initialize(c);
      Initialize(d);
      for (i = 0; i <= t; i++)
        c[s - t - 1 + i] = b[i];
      Copy(c, d);
      Mul(c, Q);
      while (1) {
        k = Compare(res, c);
        if (k == 1 || k == 0)
          break;
        Sub(c, d);
        Q--;
      }
      quot[s - t - 1] = Q;
      Sub(res, c);
    }
    k = Compare(res, b);
    if (k == -1)
      break;
  }
  RightShift(res, sh);
  RightShift(b, sh);
}
```