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

```asm
<vis5d_link_slices>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %edx,-0x6c(%rbp)
  mov    %ecx,-0x70(%rbp)
  mov    %r8d,-0x74(%rbp)
  mov    %r9d,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x64(%rbp),%eax
  cmp    -0x70(%rbp),%eax
  jne    L320
  mov    -0x68(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jne    L320
  mov    -0x6c(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jne    L320
  mov    $0xfffffffc,%eax
  jmp    L92
L320:
  lea    -0x54(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <vis5d_get_ctx_numvars@plt>
  movl   $0x0,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  cmpl   $0x9,-0x68(%rbp)
  ja     L114
  mov    -0x68(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D7(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D7(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  addl   $0x1,-0x44(%rbp)
  jmp    L149
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  addl   $0x1,-0x40(%rbp)
  jmp    L149
  movl   $0x2,-0x3c(%rbp)
  addl   $0x1,-0x44(%rbp)
  jmp    L149
  movl   $0x2,-0x3c(%rbp)
  addl   $0x1,-0x40(%rbp)
  jmp    L149
L114:
  mov    $0xfffffffe,%eax
  jmp    L92
L149:
  cmpl   $0x0,-0x6c(%rbp)
  js     L136
  mov    -0x6c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L155
L136:
  mov    $0xfffffffb,%eax
  jmp    L92
L155:
  lea    -0x54(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <vis5d_get_ctx_numvars@plt>
  cmpl   $0x9,-0x74(%rbp)
  ja     L20
  mov    -0x74(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D38(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D38(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  addl   $0x1,-0x44(%rbp)
  jmp    L148
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  addl   $0x1,-0x40(%rbp)
  jmp    L148
  movl   $0x2,-0x3c(%rbp)
  addl   $0x1,-0x44(%rbp)
  jmp    L148
  movl   $0x2,-0x3c(%rbp)
  addl   $0x1,-0x40(%rbp)
  jmp    L148
L20:
  mov    $0xfffffffe,%eax
  jmp    L92
L148:
  cmpl   $0x0,-0x78(%rbp)
  js     L401
  mov    -0x78(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L11
L401:
  mov    $0xfffffffb,%eax
  jmp    L92
L11:
  cmpl   $0x2,-0x44(%rbp)
  je     L293
  cmpl   $0x2,-0x40(%rbp)
  je     L293
  mov    $0xfffffffc,%eax
  jmp    L92
L293:
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x6c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x6c(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  jmp    L26
L257:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x68(%rbp)
  jne    L25
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jne    L25
  mov    -0x48(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  je     L313
L25:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x74(%rbp)
  jne    L214
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x78(%rbp)
  jne    L214
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  test   %eax,%eax
  je     L214
  mov    $0x1,%eax
  jmp    L92
L214:
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x28(%rbp)
L26:
  lea    -0x4c(%rbp),%rdx
  lea    -0x50(%rbp),%rcx
  lea    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <follow_slice_link@plt>
  test   %rax,%rax
  jne    L257
  jmp    L213
L313:
  nop
L213:
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x78(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x78(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  jmp    L308
L82:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x74(%rbp)
  jne    L236
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x78(%rbp)
  jne    L236
  mov    -0x48(%rbp),%eax
  cmp    %eax,-0x70(%rbp)
  je     L196
L236:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x68(%rbp)
  jne    L454
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jne    L454
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  test   %eax,%eax
  je     L454
  mov    $0x1,%eax
  jmp    L92
L454:
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L308:
  lea    -0x4c(%rbp),%rdx
  lea    -0x50(%rbp),%rcx
  lea    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <follow_slice_link@plt>
  test   %rax,%rax
  jne    L82
  jmp    L443
L196:
  nop
L443:
  lea    -0x18(%rbp),%r8
  lea    -0x20(%rbp),%rdi
  lea    -0x10(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    -0x38(%rbp),%esi
  mov    -0x28(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <vis5d_get_slice_link@plt>
  mov    -0x20(%rbp),%rax
  mov    -0x74(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x78(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    -0x70(%rbp),%edx
  mov    %edx,(%rax)
  lea    -0x18(%rbp),%r8
  lea    -0x20(%rbp),%rdi
  lea    -0x10(%rbp),%rcx
  mov    -0x2c(%rbp),%edx
  mov    -0x30(%rbp),%esi
  mov    -0x24(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <vis5d_get_slice_link@plt>
  mov    -0x20(%rbp),%rax
  mov    -0x68(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x6c(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    -0x64(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0x0,%eax
L92:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L147
  call   <__stack_chk_fail@plt>
L147:
  leave
  ret
```

assistant: ```c
int vis5d_link_slices(int vindex1, int type1, int number1, int vindex2, int type2, int number2) {
  int numvar, numh, numv, nmax;
  int cur_type, cur_num, end1_type, end1_num, end2_type, end2_num;
  int *p_type, *p_num, *p_vindex, cur_vindex, end1_vindex, end2_vindex;
  if ((vindex1 == vindex2) && (type1 == type2) && (number1 == number2))
    return -4;
  vis5d_get_ctx_numvars(vindex1, &numvar);
  numh = numv = 0;
  switch (type1) {
  case 1:
  case 3:
    nmax = numvar;
    numh++;
    break;
  case 2:
  case 4:
    nmax = numvar;
    numv++;
    break;
  case 6:
  case 8:
    nmax = 2;
    numh++;
    break;
  case 7:
  case 9:
    nmax = 2;
    numv++;
    break;
  default:
    return -2;
  }
  if ((number1 < 0) || (number1 >= nmax))
    return -5;
  vis5d_get_ctx_numvars(vindex2, &numvar);
  switch (type2) {
  case 1:
  case 3:
    nmax = numvar;
    numh++;
    break;
  case 2:
  case 4:
    nmax = numvar;
    numv++;
    break;
  case 6:
  case 8:
    nmax = 2;
    numh++;
    break;
  case 7:
  case 9:
    nmax = 2;
    numv++;
    break;
  default:
    return -2;
  }
  if ((number2 < 0) || (number2 >= nmax))
    return -5;
  if ((numh != 2) && (numv != 2))
    return -4;
  end1_type = type1;
  end1_num = number1;
  end1_vindex = vindex1;
  cur_type = type1;
  cur_num = number1;
  cur_vindex = vindex1;
  while (follow_slice_link(&cur_vindex, &cur_type, &cur_num)) {
    if ((cur_type == type1) && (cur_num == number1) && (cur_vindex == vindex1)) {
      break;
    }
    if ((cur_type == type2) && (cur_num == number2) && (cur_vindex = vindex2)) {
      return 1;
    }
    end1_type = cur_type;
    end1_num = cur_num;
    end1_vindex = cur_vindex;
  }
  end2_type = type2;
  end2_num = number2;
  end2_vindex = vindex2;
  cur_type = type2;
  cur_num = number2;
  cur_vindex = vindex2;
  while (follow_slice_link(&cur_vindex, &cur_type, &cur_num)) {
    if ((cur_type == type2) && (cur_num == number2) && (cur_vindex == vindex2)) {
      break;
    }
    if ((cur_type == type1) && (cur_num == number1) && (cur_vindex = vindex1)) {
      return 1;
    }
    end2_type = cur_type;
    end2_num = cur_num;
    end2_vindex = cur_vindex;
  }
  vis5d_get_slice_link(end1_vindex, end1_type, end1_num, &p_vindex, &p_type, &p_num);
  *p_type = type2;
  *p_num = number2;
  *p_vindex = vindex2;
  vis5d_get_slice_link(end2_vindex, end2_type, end2_num, &p_vindex, &p_type, &p_num);
  *p_type = type1;
  *p_num = number1;
  *p_vindex = vindex1;
  return 0;
}
```