user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<rebuildchain>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  sub    $0x50,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rsi
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L117
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x60(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x58(%rbp),%rax
  add    $0x4,%rax
  movl   $0x320,(%rax)
  mov    -0x60(%rbp),%rax
  add    $0x4,%rax
  movl   $0x320,(%rax)
  mov    %rsi,%rsp
  jmp    L111
L117:
  movl   $0x1,-0x50(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %eax,%edx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  mov    %eax,%edx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L25:
  cmp    %rdx,%rsp
  je     L118
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L25
L118:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L27
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L27:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %eax,%edx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  mov    %eax,%edx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L110:
  cmp    %rdx,%rsp
  je     L46
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L110
L46:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L6
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L6:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%ecx
  mov    (%rdx),%edx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%ecx
  mov    %edx,(%rax,%rcx,4)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%ecx
  mov    (%rdx),%edx
  mov    -0x30(%rbp),%rax
  mov    %ecx,%ecx
  mov    %edx,(%rax,%rcx,4)
L19:
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    %ecx,(%rax,%rdx,4)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x50(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x70(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L19
  mov    -0x70(%rbp),%rax
  movl   $0x1,(%rax)
L103:
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    %ecx,(%rax,%rdx,4)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x50(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x70(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jne    L103
  movl   $0x1,-0x50(%rbp)
  mov    -0x70(%rbp),%rax
  movl   $0x1,(%rax)
L114:
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,(%rcx)
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%rax
  mov    -0x50(%rbp),%edx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,(%rcx)
  addl   $0x1,-0x50(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cmp    %eax,-0x50(%rbp)
  jne    L114
  mov    -0x58(%rbp),%rax
  add    $0x4,%rax
  movl   $0x320,(%rax)
  mov    -0x60(%rbp),%rax
  add    $0x4,%rax
  movl   $0x320,(%rax)
  mov    %rsi,%rsp
L111:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  lea    -0x20(%rbp),%rsp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void rebuildchain(unsigned int *x, unsigned int *y, unsigned int *LENGTH, unsigned int *mv) {
  if (*mv == 1) {
    x[*LENGTH] = x[1];
    y[*LENGTH] = y[1];
    x[1] = ((100) * 8);
    y[1] = ((100) * 8);
    return;
  }
  unsigned int count = 1, Nmv = *mv;
  unsigned int xn[*LENGTH], yn[*LENGTH];
  xn[*LENGTH] = x[*mv];
  yn[*LENGTH] = y[*mv];
  do {
    xn[count] = x[*mv];
    yn[count] = y[*mv];
    count++;
    (*mv)++;
  } while (*mv != *LENGTH);
  *mv = 1;
  do {
    xn[count] = x[*mv];
    yn[count] = y[*mv];
    count++;
    (*mv)++;
  } while (*mv != Nmv);
  count = 1;
  *mv = 1;
  do {
    x[count] = xn[count];
    y[count] = yn[count];
    count++;
  } while (count != (*LENGTH + 1));
  x[1] = ((100) * 8);
  y[1] = ((100) * 8);
}
```