user: 下面的汇编指令对应的C源代码是什么：

```asm
<hex2str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L2
  mov    -0x14(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L54
L2:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    $0x1,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L69
  mov    $0x0,%eax
  jmp    L54
L69:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L17
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L17:
  movl   $0x0,-0x18(%rbp)
  jmp    L33
L8:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jne    L3
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L54
L3:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <hex2int@plt>
  mov    %ax,-0x1c(%rbp)
  cmpw   $0x0,-0x1c(%rbp)
  js     L100
  movzwl -0x1c(%rbp),%eax
  mov    %ax,-0x1a(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <hex2int@plt>
  mov    %ax,-0x1c(%rbp)
  cmpw   $0x0,-0x1c(%rbp)
  js     L65
  movzwl -0x1a(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  movzwl -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x1a(%rbp)
  jmp    L13
L65:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L54
L100:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L54
L13:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzwl -0x1a(%rbp),%edx
  mov    %dl,(%rax)
  addl   $0x2,-0x18(%rbp)
L33:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L8
  mov    -0x8(%rbp),%rax
L54:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D15
type_infered: string
name: unpack_data
arguments: data_tag: D0
type_infered: string

tool: D15: hex2str(): Malformed hexstring: %s (length: %d)


tool: D0: Can't optimize polymorphic signature.

assistant: ```c
char *hex2str(const char *hex, int howmany) {
  short int val, c;
  int i, len;
  char *str, *ptr;
  len = strlen(hex);
  if (len % 2 != 0) {
    printf("hex2str(): Malformed hexstring: %s (length: %d)\n", hex, len);
    return NULL;
  }
  str = calloc((howmany / 2) + 1, sizeof(char));
  if (!str)
    return NULL;
  ptr = str;
  if (howmany > len)
    howmany = len;
  for (i = 0; i < howmany; i += 2) {
    if (hex[i] == '?') {
      printf("Can't optimize polymorphic signature.\n");
      free(str);
      return NULL;
    } else {
      if ((c = hex2int(hex[i])) >= 0) {
        val = c;
        if ((c = hex2int(hex[i + 1])) >= 0) {
          val = (val << 4) + c;
        } else {
          free(str);
          return NULL;
        }
      } else {
        free(str);
        return NULL;
      }
    }
    *ptr++ = val;
  }
  return str;
}
```