user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fmt2str>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x8,%rsp
  and    $0x1,%edi
  je     L55
  lea    D65(%rip),%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <snprintf@plt>
  movslq %eax,%rbx
  mov    %r13d,%eax
  and    $0x38,%eax
  je     L103
L80:
  cmp    $0x18,%eax
  je     L83
  jg     L65
  cmp    $0x8,%eax
  je     L59
  cmp    $0x10,%eax
  jne    L44
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D97(%rip),%rdx
  sub    %rbx,%rsi
  call   <snprintf@plt>
L44:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L55:
  lea    D95(%rip),%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <snprintf@plt>
  movslq %eax,%rbx
  mov    %r13d,%eax
  and    $0x38,%eax
  jne    L80
L103:
  movslq %ebx,%rax
  lea    (%r12,%rax,1),%rdi
  test   $0x4,%r13b
  jne    L15
  mov    %rbp,%rsi
  sub    %rax,%rsi
  and    $0x2,%r13d
  jne    L36
  lea    D38(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
L96:
  movslq %edi,%rdi
  mov    %rbp,%rsi
  lea    D87(%rip),%rdx
  add    %r12,%rdi
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L65:
  cmp    $0x20,%eax
  jne    L44
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D31(%rip),%rdx
  sub    %rbx,%rsi
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L36:
  lea    D49(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
  jmp    L96
  nopl   0x0(%rax)
L83:
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D7(%rip),%rdx
  sub    %rbx,%rsi
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L15:
  mov    %rbp,%rsi
  lea    D86(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L59:
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D22(%rip),%rdx
  sub    %rbx,%rsi
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: read_data
arguments: data_label: D65
type: string
name: read_data
arguments: data_label: D97
type: string
name: read_data
arguments: data_label: D95
type: string
name: read_data
arguments: data_label: D38
type: string
name: read_data
arguments: data_label: D87
type: string
name: read_data
arguments: data_label: D31
type: string
name: read_data
arguments: data_label: D49
type: string
name: read_data
arguments: data_label: D7
type: string
name: read_data
arguments: data_label: D86
type: string
name: read_data
arguments: data_label: D22
type: string

tool: D65: little endian 

tool: D97: A law 

tool: D95: big endian 

tool: D38: signed 

tool: D87: int 

tool: D31: AC3 

tool: D49: unsigned 

tool: D7: MPEG 2 

tool: D86: float 

tool: D22: mu law 

assistant: ```c
char *fmt2str(int format, char *str, size_t size) {
  int i = 0;
  if ((1 << 0) == (format & (1 << 0)))
    i += snprintf(str, size, "little endian ");
  else
    i += snprintf(str, size, "big endian ");
  if (format & (7 << 3)) {
    switch (format & (7 << 3)) {
    case ((1 << 3)):
      i += snprintf(&str[i], size - i, "mu law ");
      break;
    case ((2 << 3)):
      i += snprintf(&str[i], size - i, "A law ");
      break;
    case ((3 << 3)):
      i += snprintf(&str[i], size - i, "MPEG 2 ");
      break;
    case ((4 << 3)):
      i += snprintf(&str[i], size - i, "AC3 ");
      break;
    }
  } else {
    if ((1 << 2) == (format & (1 << 2)))
      i += snprintf(&str[i], size, "float ");
    else {
      if ((1 << 1) == (format & (1 << 1)))
        i += snprintf(&str[i], size - i, "unsigned ");
      else
        i += snprintf(&str[i], size - i, "signed ");
      i += snprintf(&str[i], size, "int ");
    }
  }
  return str;
}
```