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

```asm
<iTlvCheckTlvObject>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <_iTlvCheckTlvObj@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L128
  mov    $0xffffd8eb,%eax
  jmp    L107
L128:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <_uiTlvGetValueLen@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0xffff,-0x1c(%rbp)
  jne    L106
  mov    $0xffffd8eb,%eax
  jmp    L107
L106:
  mov    -0x1c(%rbp),%eax
  cwtl
  mov    %eax,-0x18(%rbp)
  lea    -0x24(%rbp),%rdx
  lea    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <uiTagAttrGetRange@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0xff,-0x14(%rbp)
  je     L108
  cmpl   $0xff,-0x14(%rbp)
  ja     L265
  cmpl   $0x0,-0x14(%rbp)
  je     L5
  cmpl   $0x1,-0x14(%rbp)
  je     L99
  jmp    L265
L5:
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jl     L1
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jle    L164
L1:
  mov    $0xffffd8e8,%eax
  jmp    L107
L164:
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jne    L219
  mov    -0x24(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L219
  lea    -0x10(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <iTlvValue@plt>
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf0,%eax
  test   %eax,%eax
  je     L219
  mov    $0xffffd8e8,%eax
  jmp    L107
L99:
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jl     L292
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jle    L45
L292:
  mov    $0xffffd8e8,%eax
  jmp    L107
L45:
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x18(%rbp)
  jne    L12
  mov    -0x24(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L12
  lea    -0x10(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <iTlvValue@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf,%eax
  cmp    $0xf,%eax
  je     L12
  mov    $0xffffd8e8,%eax
  jmp    L107
L108:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <_uiTlvGetObjLen@plt>
  jmp    L107
L265:
  mov    -0x28(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jl     L203
  mov    -0x24(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jle    L255
L203:
  mov    $0xffffd8e8,%eax
  jmp    L107
L219:
  nop
  jmp    L170
L12:
  nop
  jmp    L170
L255:
  nop
L170:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <_uiTlvGetObjLen@plt>
L107:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L226
  call   <__stack_chk_fail@plt>
L226:
  leave
  ret
```

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));
}
```