user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<iTlvCheckTlvObject>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <_iTlvCheckTlvObj@plt>
  test   %eax,%eax
  js     L11
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <_uiTlvGetValueLen@plt>
  mov    %eax,%ebx
  cmp    $0xffff,%eax
  je     L11
  movswl %ax,%r12d
  lea    0xc(%rsp),%rdx
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    0x8(%rsp),%rsi
  call   <uiTagAttrGetRange@plt>
  cmp    $0x1,%eax
  je     L27
  cmp    $0xff,%eax
  je     L85
  test   %eax,%eax
  je     L39
  cmp    %r12d,0x8(%rsp)
  jg     L69
  cmp    %r12d,0xc(%rsp)
  jl     L69
L85:
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <_uiTlvGetObjLen@plt>
L50:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L143
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  mov    0x8(%rsp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %r12d,%eax
  jg     L69
  mov    0xc(%rsp),%ecx
  lea    0x1(%rcx),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %r12d,%eax
  jl     L69
  jne    L85
  and    $0x1,%ecx
  je     L85
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <iTlvValue@plt>
  mov    0x10(%rsp),%rax
  testb  $0xf0,(%rax)
  je     L85
  nopw   0x0(%rax,%rax,1)
L69:
  mov    $0xffffd8e8,%eax
  jmp    L50
  nopw   0x0(%rax,%rax,1)
L27:
  mov    0x8(%rsp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %r12d,%eax
  jg     L69
  mov    0xc(%rsp),%ecx
  lea    0x1(%rcx),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %r12d,%eax
  jl     L69
  jne    L85
  and    $0x1,%ecx
  je     L85
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  movswq %bx,%rbx
  call   <iTlvValue@plt>
  mov    0x10(%rsp),%rax
  movzbl -0x1(%rax,%rbx,1),%eax
  and    $0xf,%eax
  cmp    $0xf,%al
  je     L85
  jmp    L69
  nopl   0x0(%rax,%rax,1)
L11:
  mov    $0xffffd8eb,%eax
  jmp    L50
L143:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int iTlvCheckTlvObject(unsigned char *psTlvObj) {
  int iRet, iValueLen;
  unsigned char *psTlvObjValue;
  unsigned int uiRet;
  unsigned int uiTagType;
  int iLeast, iMost;
  iRet = _iTlvCheckTlvObj(psTlvObj);
  if (iRet < 0)
    return (-10005);
  uiRet = _uiTlvGetValueLen(psTlvObj);
  if (uiRet == 0xffff)
    return (-10005);
  iValueLen = (short)uiRet;
  uiTagType = uiTagAttrGetRange(psTlvObj, &iLeast, &iMost);
  switch (uiTagType) {
  case 0:
    if (iValueLen < (iLeast + 1) / 2 || iValueLen > (iMost + 1) / 2)
      return (-10008);
    if (iValueLen == (iMost + 1) / 2 && iMost % 2) {
      iTlvValue(psTlvObj, &psTlvObjValue);
      if ((psTlvObjValue[0] & 0xF0) != 0x00)
        return (-10008);
    }
    break;
  case 1:
    if (iValueLen < (iLeast + 1) / 2 || iValueLen > (iMost + 1) / 2)
      return (-10008);
    if (iValueLen == (iMost + 1) / 2 && iMost % 2) {
      iTlvValue(psTlvObj, &psTlvObjValue);
      if ((psTlvObjValue[iValueLen - 1] & 0x0F) != 0x0F)
        return (-10008);
    }
    break;
  case 0xff:
    return (_uiTlvGetObjLen(psTlvObj));
  default:
    if (iValueLen < iLeast || iValueLen > iMost)
      return (-10008);
    break;
  }
  return (_uiTlvGetObjLen(psTlvObj));
}
```