user: 请从给定的汇编指令推导出C源代码：

```asm
<Encode_Hexa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %rcx,-0x30(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L78
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L78
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <String_Needs_Encoding@plt>
  add    $0x1,%eax
  jmp    L8
L78:
  mov    $0x0,%eax
L8:
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <String_Needs_Encoding@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x58,(%rax)
  mov    -0x8(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  or     %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x5f,(%rax)
  cmpl   $0x1,-0x8(%rbp)
  jne    L88
  mov    -0x18(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x30(%rbp)
  jmp    L37
L88:
  cmpl   $0x2,-0x8(%rbp)
  jne    L37
  mov    -0x30(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Encode_String@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x5f,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x5f,(%rax)
L37:
  cmpl   $0x0,-0x4(%rbp)
  jne    L36
  mov    -0x20(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  lea    D20(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x30(%rbp)
  jmp    L81
L36:
  mov    -0x30(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Encode_String@plt>
  mov    %rax,-0x30(%rbp)
L81:
  cmpl   $0x0,-0x24(%rbp)
  js     L23
  mov    -0x24(%rbp),%edx
  mov    -0x30(%rbp),%rax
  lea    D29(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x30(%rbp)
L23:
  mov    -0x30(%rbp),%rax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D8
datatype: string
name: unpack_data
arguments: data_label: D20
datatype: string
name: unpack_data
arguments: data_label: D29
datatype: string

tool: D8: %s__

tool: D20: %s

tool: D29: __a%d

assistant: ```c
char *Encode_Hexa(char *module, char *pred, int arity, char *str) {
  int module_encode = (module == NULL || *module == '\0') ? 0 : String_Needs_Encoding(module) + 1;
  int pred_encode = String_Needs_Encoding(pred);
  *str++ = 'X';
  *str++ = '0' + ((module_encode << 1) | pred_encode);
  *str++ = '_';
  if (module_encode == 1)
    str += sprintf(str, "%s__", module);
  else if (module_encode == 2) {
    str = Encode_String(module, str);
    *str++ = '_';
    *str++ = '_';
  }
  if (pred_encode == 0)
    str += sprintf(str, "%s", pred);
  else
    str = Encode_String(pred, str);
  if (arity >= 0)
    str += sprintf(str, "__a%d", arity);
  return str;
}
```