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

```asm
<fmt_to_str>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movb   $0x0,0xe(%rsp)
  lea    -0x3(%rdi),%eax
  cmp    $0x6,%eax
  ja     L40
  mov    %esi,%edx
  mov    %eax,%eax
  lea    D24(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  add    $0x1,%edx
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D35(%rip),%rdx
L32:
  lea    0xe(%rsp),%rcx
  lea    D16(%rip),%rsi
  lea    D20(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rax
L33:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0x20,%rsp
  pop    %rbx
  ret
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D68(%rip),%rdx
  jmp    L32
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D142(%rip),%rdx
  jmp    L32
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D46(%rip),%rdx
  jmp    L32
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D137(%rip),%rdx
  jmp    L32
  lea    D62(%rip),%rax
  test   %esi,%esi
  je     L33
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D122(%rip),%rdx
  jmp    L32
  lea    0xe(%rsp),%rdi
  lea    D27(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D158(%rip),%rdx
  jmp    L32
L40:
  mov    %edi,%edx
  mov    %edi,%esi
  lea    D30(%rip),%rdi
  call   <io_error_msg@plt>
  lea    D193(%rip),%rdx
  jmp    L32
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D27
datatype: string
name: parse_data
arguments: data_tag: D35
datatype: string
name: parse_data
arguments: data_tag: D16
datatype: string
name: parse_data
arguments: data_tag: D68
datatype: string
name: parse_data
arguments: data_tag: D142
datatype: string
name: parse_data
arguments: data_tag: D46
datatype: string
name: parse_data
arguments: data_tag: D137
datatype: string
name: parse_data
arguments: data_tag: D62
datatype: string
name: parse_data
arguments: data_tag: D122
datatype: string
name: parse_data
arguments: data_tag: D158
datatype: string
name: parse_data
arguments: data_tag: D30
datatype: string
name: parse_data
arguments: data_tag: D193
datatype: string

tool: D27: %d

tool: D35: user-

tool: D16: %s%s

tool: D68: general.

tool: D142: dollar.

tool: D46: comma.

tool: D137: percent.

tool: D62: integer

tool: D122: fixed.

tool: D158: exponent.

tool: D30: Unknown format %d (%x)

tool: D193: UNKNOWN

assistant: ```c
char *fmt_to_str(int format, int precision) {
  char *ptr;
  static char buf[30];
  char nbuf[10];
  nbuf[0] = '\0';
  switch (format) {
  case 6:
    ptr = "user-";
    sprintf(nbuf, "%d", precision + 1);
    break;
  case 9:
    ptr = "general.";
    sprintf(nbuf, "%d", precision);
    break;
  case 3:
    ptr = "dollar.";
    sprintf(nbuf, "%d", precision);
    break;
  case 4:
    ptr = "comma.";
    sprintf(nbuf, "%d", precision);
    break;
  case 5:
    ptr = "percent.";
    sprintf(nbuf, "%d", precision);
    break;
  case 7:
    if (precision == 0)
      return "integer";
    ptr = "fixed.";
    sprintf(nbuf, "%d", precision);
    break;
  case 8:
    ptr = "exponent.";
    sprintf(nbuf, "%d", precision);
    break;
  default:
    io_error_msg("Unknown format %d (%x)", format, format);
    ptr = "UNKNOWN";
    break;
  }
  sprintf(buf, "%s%s", ptr, nbuf);
  return buf;
}
```