user: 请将以下的汇编代码转换成C语言代码:

```asm
<decode_text_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1d(%rbp)
  movb   $0x0,-0x19(%rbp)
  movl   $0x0,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x28,%al
  jne    L2
  mov    -0x50(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <safe_calloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x28(%rbp),%rax
  jmp    L9
L2:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3c,%al
  jne    L51
  movl   $0x1,-0x34(%rbp)
  addl   $0x1,-0x38(%rbp)
L51:
  cmpl   $0x0,-0x34(%rbp)
  je     L101
  cmpq   $0x5,-0x50(%rbp)
  jbe    L101
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jne    L101
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  jne    L101
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jne    L101
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jne    L101
  movl   $0x1,-0x2c(%rbp)
  addl   $0x4,-0x38(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <safe_calloc@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L8
L101:
  mov    $0x0,%eax
  jmp    L9
L99:
  mov    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  mov    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1c(%rbp)
  mov    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1b(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1a(%rbp)
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  lea    -0x1d(%rbp),%rax
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %al,(%rbx)
  addl   $0x1,-0x38(%rbp)
L8:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  ja     L99
  mov    -0x28(%rbp),%rax
L9:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L63
  call   <__stack_chk_fail@plt>
L63:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *decode_text_string(const char *str, size_t str_len) {
  int idx, is_hex, is_utf16be, ascii_idx;
  char *ascii, hex_buf[5] = {0};
  is_hex = is_utf16be = idx = ascii_idx = 0;
  if (str[0] == '(') {
    ascii = safe_calloc(str_len + 1);
    strncpy(ascii, str, str_len + 1);
    return ascii;
  } else if (str[0] == '<') {
    is_hex = 1;
    ++idx;
  }
  if (is_hex && (str_len > 5) && (str[idx] == 'F') && (str[idx + 1] == 'E') && (str[idx + 2] == 'F') && (str[idx + 3] == 'F')) {
    is_utf16be = 1;
    idx += 4;
  } else
    return NULL;
  ascii = safe_calloc(str_len);
  for (; idx < str_len; ++idx) {
    hex_buf[0] = str[idx++];
    hex_buf[1] = str[idx++];
    hex_buf[2] = str[idx++];
    hex_buf[3] = str[idx];
    ascii[ascii_idx++] = strtol(hex_buf, NULL, 16);
  }
  return ascii;
}
```