user: Translate the below assembly code into C programming language:

```asm
<vis5d_unlink_slice>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rdx
  mov    -0x44(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <vis5d_get_ctx_numvars@plt>
  cmpl   $0x4,-0x48(%rbp)
  jg     L1
  cmpl   $0x0,-0x48(%rbp)
  jg     L11
  jmp    L25
L1:
  mov    -0x48(%rbp),%eax
  sub    $0x6,%eax
  cmp    $0x3,%eax
  ja     L25
  jmp    L112
L11:
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  jmp    L189
L112:
  movl   $0x2,-0x30(%rbp)
  jmp    L189
L25:
  mov    $0xfffffffe,%eax
  jmp    L224
L189:
  cmpl   $0x0,-0x4c(%rbp)
  js     L17
  mov    -0x4c(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L69
L17:
  mov    $0xfffffffb,%eax
  jmp    L224
L69:
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  jmp    L133
L168:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x48(%rbp)
  jne    L217
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jne    L217
  mov    -0x3c(%rbp),%eax
  cmp    %eax,-0x44(%rbp)
  je     L102
L217:
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L133:
  lea    -0x34(%rbp),%rdx
  lea    -0x38(%rbp),%rcx
  lea    -0x3c(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <follow_slice_link@plt>
  test   %rax,%rax
  jne    L168
  jmp    L13
L102:
  nop
L13:
  lea    -0x18(%rbp),%r8
  lea    -0x20(%rbp),%rdi
  lea    -0x10(%rbp),%rcx
  mov    -0x4c(%rbp),%edx
  mov    -0x48(%rbp),%esi
  mov    -0x44(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <vis5d_get_slice_link@plt>
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x20(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    -0x28(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jne    L184
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jne    L184
  mov    -0x2c(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  je     L167
L184:
  lea    -0x18(%rbp),%r8
  lea    -0x20(%rbp),%rdi
  lea    -0x10(%rbp),%rcx
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <vis5d_get_slice_link@plt>
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x28(%rbp)
  jne    L47
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jne    L47
  mov    -0x3c(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L47
  movl   $0xffffffff,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x38(%rbp)
L47:
  mov    -0x20(%rbp),%rax
  mov    -0x38(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x34(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    -0x3c(%rbp),%edx
  mov    %edx,(%rax)
L167:
  mov    $0x0,%eax
L224:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L32
  call   <__stack_chk_fail@plt>
L32:
  leave
  ret
```

assistant: ```c
int vis5d_unlink_slice(int vindex, int type, int number) {
  int numvar, nmax;
  int cur_vindex, end_vindex, cur_type, cur_num, end_type, end_num;
  int *p_type, *p_num, *p_vindex;
  vis5d_get_ctx_numvars(vindex, &numvar);
  switch (type) {
  case 1:
  case 2:
  case 3:
  case 4:
    nmax = numvar;
    break;
  case 6:
  case 7:
  case 8:
  case 9:
    nmax = 2;
    break;
  default:
    return -2;
  }
  if ((number < 0) || (number >= nmax))
    return -5;
  end_type = type;
  end_num = number;
  end_vindex = vindex;
  cur_type = type;
  cur_num = number;
  cur_vindex = vindex;
  while (follow_slice_link(&cur_vindex, &cur_type, &cur_num)) {
    if ((cur_type == type) && (cur_num == number) && (cur_vindex == vindex)) {
      break;
    }
    end_type = cur_type;
    end_num = cur_num;
    end_vindex = cur_vindex;
  }
  vis5d_get_slice_link(vindex, type, number, &p_vindex, &p_type, &p_num);
  cur_type = *p_type;
  cur_num = *p_num;
  cur_vindex = *p_vindex;
  *p_type = -1;
  *p_num = -1;
  *p_vindex = -1;
  if ((end_type != type) || (end_num != number) || (end_vindex != vindex)) {
    vis5d_get_slice_link(end_vindex, end_type, end_num, &p_vindex, &p_type, &p_num);
    if ((cur_type == end_type) && (cur_num == end_num) && (cur_vindex == end_vindex)) {
      cur_type = cur_num = cur_vindex = -1;
    }
    *p_type = cur_type;
    *p_num = cur_num;
    *p_vindex = cur_vindex;
  }
  return 0;
}
```