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

```asm
<convert_hex_long>:
  endbr64
  push   %rbp
  mov    %ecx,%r10d
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  mov    %r9,%r12
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rcx
  mov    %rcx,-0x28(%rbp)
  xor    %ecx,%ecx
  test   %edx,%edx
  mov    %rsp,%r13
  cmovg  %edx,%ebx
  test   %rsi,%rsi
  je     L47
  lea    0x16(%rbx),%r9d
  mov    %rsi,%rax
  mov    %rsp,%rsi
  movslq %r9d,%rdx
  add    $0xf,%rdx
  mov    %rdx,%rcx
  and    $0xfffffffffffff000,%rdx
  sub    %rdx,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L146
L86:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L86
L146:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  je     L35
  orq    $0x0,-0x8(%rsp,%rcx,1)
L35:
  lea    0x15(%rbx),%edx
  lea    0x14(%rbx),%ecx
  mov    %rsp,%rsi
  movslq %edx,%rdx
  movslq %ecx,%rcx
  movb   $0x0,(%rsp,%rdx,1)
  nopl   0x0(%rax)
L55:
  mov    %rax,%r11
  movslq %ecx,%rdx
  and    $0xf,%r11d
  movzbl (%r8,%r11,1),%r11d
  mov    %r11b,(%rsi,%rcx,1)
  sub    $0x1,%rcx
  shr    $0x4,%rax
  jne    L55
  mov    %r9d,%r14d
  sub    %edx,%r14d
  cmp    %r14d,%ebx
  jl     L147
  lea    -0x1(%rdx),%eax
  mov    %r9d,%ecx
  lea    0x1(%rbx),%r11d
  mov    $0x1,%r14d
  sub    %eax,%ecx
  mov    %ebx,%eax
  sub    %ecx,%eax
  cmp    %r11d,%ecx
  lea    0x2(%rax),%r8d
  cmovg  %r14d,%r8d
  add    $0x1,%eax
  cmp    $0xe,%eax
  jbe    L175
  cmp    %r11d,%ecx
  jg     L175
  movslq %edx,%rax
  movd   %r10d,%xmm2
  movd   %edx,%xmm7
  mov    %r8d,%r11d
  shr    $0x4,%r11d
  lea    -0x10(%rsi,%rax,1),%rcx
  punpcklbw %xmm2,%xmm2
  movdqa D1(%rip),%xmm5
  lea    -0x1(%r11),%r14d
  lea    -0x10(%rcx),%rax
  punpcklwd %xmm2,%xmm2
  movdqa D29(%rip),%xmm4
  pshufd $0x0,%xmm7,%xmm1
  shl    $0x4,%r14
  movd   %r9d,%xmm7
  mov    %rax,%r11
  paddd  D21(%rip),%xmm1
  pshufd $0x0,%xmm2,%xmm2
  pshufd $0x0,%xmm7,%xmm6
  sub    %r14,%r11
  jmp    L180
  nopw   0x0(%rax,%rax,1)
L24:
  sub    $0x10,%rax
L180:
  movdqa %xmm1,%xmm0
  movdqa %xmm6,%xmm3
  movups %xmm2,(%rcx)
  paddd  %xmm5,%xmm1
  paddd  %xmm4,%xmm0
  mov    %rax,%rcx
  psubd  %xmm0,%xmm3
  cmp    %r11,%rax
  jne    L24
  mov    %r8d,%r11d
  pshufd $0xff,%xmm3,%xmm3
  pshufd $0xff,%xmm0,%xmm0
  mov    %edx,%ecx
  and    $0xfffffff0,%r11d
  movd   %xmm3,%r14d
  movd   %xmm0,%eax
  sub    %r11d,%ecx
  cmp    %r11d,%r8d
  je     L51
L10:
  sub    %r11d,%r8d
  lea    -0x1(%r8),%eax
  cmp    $0x6,%eax
  jbe    L160
  lea    -0x1(%rcx),%eax
  movd   %ecx,%xmm0
  movzbl %r10b,%r14d
  sub    $0x8,%rdx
  movd   %eax,%xmm7
  mov    %r10d,%eax
  movd   %r9d,%xmm4
  sub    %r11,%rdx
  movq   D5(%rip),%xmm1
  shl    $0x8,%eax
  punpckldq %xmm7,%xmm0
  or     %r14d,%eax
  paddd  %xmm1,%xmm0
  movd   %eax,%xmm7
  mov    %r8d,%eax
  pshuflw $0x0,%xmm7,%xmm1
  and    $0xfffffff8,%eax
  movq   %xmm1,(%rsi,%rdx,1)
  pshufd $0xe0,%xmm4,%xmm1
  sub    %eax,%ecx
  psubd  %xmm0,%xmm1
  pshufd $0xe5,%xmm0,%xmm6
  movd   %xmm6,%edx
  pshufd $0xe5,%xmm1,%xmm5
  movd   %xmm5,%r14d
  cmp    %eax,%r8d
  je     L147
L160:
  lea    -0x1(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x2(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x3(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x4(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x5(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x6(%rcx),%edx
  mov    %r9d,%r14d
  movslq %edx,%rax
  sub    %edx,%r14d
  mov    %r10b,(%rsi,%rax,1)
  cmp    %r14d,%ebx
  jl     L73
  lea    -0x7(%rcx),%edx
  movslq %edx,%rax
  sub    %edx,%r9d
  mov    %r10b,(%rsi,%rax,1)
  mov    %r9d,%r14d
L73:
  mov    %r14d,%edx
  add    %rax,%rsi
  sub    $0x1,%r14d
  call   <memcpy@plt>
  mov    %r14d,(%r12)
  mov    %r13,%rsp
  jmp    L182
  nopl   0x0(%rax)
L47:
  cmp    $0x1,%edx
  jle    L203
  lea    -0x2(%rbx),%edx
  movsbl %r10b,%esi
  add    $0x1,%rdx
  call   <memset@plt>
  mov    %rax,%rdi
L203:
  movslq %ebx,%rax
  movb   $0x30,-0x1(%rdi,%rax,1)
  movb   $0x0,(%rdi,%rax,1)
  mov    %ebx,(%r12)
  mov    %r13,%rsp
L182:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L195
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L147:
  movslq %edx,%rax
  jmp    L73
L175:
  mov    %edx,%ecx
  xor    %r11d,%r11d
  jmp    L10
L51:
  cltq
  jmp    L73
L195:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D1
type_infered: byte[16]
name: unpack_data
arguments: tag: D29
type_infered: byte[16]
name: unpack_data
arguments: tag: D21
type_infered: byte[16]
name: unpack_data
arguments: tag: D5
type_infered: byte[8]

tool: {"D1": [0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff]}

tool: {"D29": [0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff]}

tool: {"D21": [0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfd,0xff,0xff,0xff]}

tool: {"D5": [0xf9,0xff,0xff,0xff,0xf9,0xff,0xff,0xff]}

assistant: ```c
void convert_hex_long(char *buf, unsigned long long val, int width, char pad, const char *digits, int *count_p) {
  if (width < 1)
    width = 1;
  if (val == 0) {
    for (int i = 0; i < width - 1; i++)
      buf[i] = pad;
    buf[width - 1] = '0';
    buf[width] = '\0';
    *count_p = width;
    return;
  }
  const int tmplen = width + 22;
  char tmp[tmplen];
  tmp[tmplen - 1] = '\0';
  int pos = tmplen - 1;
  while (val > 0) {
    tmp[--pos] = digits[val & 15];
    val >>= 4;
  }
  while (tmplen - pos - 1 < width)
    tmp[--pos] = pad;
  int count = tmplen - pos;
  memcpy(buf, &tmp[pos], count);
  *count_p = count - 1;
}
```