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

```asm
<iTlvMakeObject>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L67
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xff,%al
  jne    L40
L67:
  mov    $0xffffd509,%eax
  jmp    L122
L40:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  cmp    $0x1f,%eax
  jne    L179
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L179
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xdf,%al
  je     L179
  mov    $0xffffd509,%eax
  jmp    L122
L179:
  cmpl   $0xff,-0x1c(%rbp)
  jbe    L55
  mov    $0xffffd509,%eax
  jmp    L122
L55:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  cmp    $0x1f,%eax
  jne    L170
  movl   $0x2,-0x4(%rbp)
  jmp    L120
L170:
  movl   $0x1,-0x4(%rbp)
L120:
  mov    -0x4(%rbp),%eax
  sub    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L143
  mov    $0xffffd8ef,%eax
  jmp    L122
L143:
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
  cmpl   $0x7f,-0x1c(%rbp)
  jbe    L53
  subl   $0x1,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L153
  mov    $0xffffd8ef,%eax
  jmp    L122
L153:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x81,(%rax)
  addl   $0x1,-0x4(%rbp)
L53:
  subl   $0x1,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L174
  mov    $0xffffd8ef,%eax
  jmp    L122
L174:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L41
  mov    $0xffffd8ef,%eax
  jmp    L122
L41:
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
L122:
  leave
  ret
```

assistant: ```c
int iTlvMakeObject(unsigned char *psTag, unsigned int uiLength, unsigned char *psValue, unsigned char *psTlvObject, int iTlvObjectBufSize) {
  int iObjLen;
  if (psTag[0] == 0x00 || psTag[0] == 0xff)
    return (-10999);
  if ((psTag[0] & 0x1f) == 0x1f && (psTag[1] & 0x80) == 0x80) {
    if (psTag[0] != 0xDF)
      return (-10999);
  }
  if (uiLength > 255)
    return (-10999);
  if ((psTag[0] & 0x1f) == 0x1f)
    iObjLen = 2;
  else
    iObjLen = 1;
  iTlvObjectBufSize -= iObjLen;
  if (iTlvObjectBufSize < 0)
    return (-10001);
  memcpy(psTlvObject, psTag, iObjLen);
  psTlvObject += iObjLen;
  if (uiLength > 127) {
    iTlvObjectBufSize--;
    if (iTlvObjectBufSize < 0)
      return (-10001);
    *psTlvObject++ = 0x81;
    iObjLen++;
  }
  iTlvObjectBufSize--;
  if (iTlvObjectBufSize < 0)
    return (-10001);
  *psTlvObject++ = (unsigned char)uiLength;
  iObjLen++;
  iTlvObjectBufSize -= uiLength;
  if (iTlvObjectBufSize < 0)
    return (-10001);
  memcpy(psTlvObject, psValue, (int)uiLength);
  iObjLen += uiLength;
  return (iObjLen);
}
```