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

```asm
<fmt2str>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r13d
  mov    %rsi,%rbp
  mov    %rdx,%r12
  test   $0x1,%dil
  je     L133
  lea    D17(%rip),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %eax,%ebx
L103:
  mov    %r13d,%eax
  and    $0x38,%eax
  je     L143
  cmp    $0x18,%eax
  je     L145
  jg     L151
  cmp    $0x8,%eax
  je     L97
  cmp    $0x10,%eax
  jne    L42
  movslq %ebx,%rbx
  mov    %r12,%rsi
  sub    %rbx,%rsi
  lea    0x0(%rbp,%rbx,1),%rdi
  lea    D93(%rip),%rdx
  call   <snprintf@plt>
  jmp    L42
L133:
  lea    D67(%rip),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %eax,%ebx
  jmp    L103
L151:
  cmp    $0x20,%eax
  jne    L42
  movslq %ebx,%rbx
  mov    %r12,%rsi
  sub    %rbx,%rsi
  lea    0x0(%rbp,%rbx,1),%rdi
  lea    D18(%rip),%rdx
  call   <snprintf@plt>
  jmp    L42
L97:
  movslq %ebx,%rbx
  mov    %r12,%rsi
  sub    %rbx,%rsi
  lea    0x0(%rbp,%rbx,1),%rdi
  lea    D36(%rip),%rdx
  call   <snprintf@plt>
  jmp    L42
L145:
  movslq %ebx,%rbx
  mov    %r12,%rsi
  sub    %rbx,%rsi
  lea    0x0(%rbp,%rbx,1),%rdi
  lea    D71(%rip),%rdx
  call   <snprintf@plt>
  jmp    L42
L143:
  test   $0x4,%r13b
  jne    L66
  test   $0x2,%r13b
  je     L155
  movslq %ebx,%rdi
  mov    %r12,%rsi
  sub    %rdi,%rsi
  add    %rbp,%rdi
  lea    D45(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
L101:
  movslq %edi,%rdi
  add    %rbp,%rdi
  lea    D98(%rip),%rdx
  mov    %r12,%rsi
  call   <snprintf@plt>
L42:
  mov    %rbp,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L66:
  movslq %ebx,%rdi
  add    %rbp,%rdi
  lea    D28(%rip),%rdx
  mov    %r12,%rsi
  call   <snprintf@plt>
  jmp    L42
L155:
  movslq %ebx,%rdi
  mov    %r12,%rsi
  sub    %rdi,%rsi
  add    %rbp,%rdi
  lea    D20(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
  jmp    L101
```

tool_calls: name: read_data
arguments: label: D17
datatype: string
name: read_data
arguments: label: D93
datatype: string
name: read_data
arguments: label: D67
datatype: string
name: read_data
arguments: label: D18
datatype: string
name: read_data
arguments: label: D36
datatype: string
name: read_data
arguments: label: D71
datatype: string
name: read_data
arguments: label: D45
datatype: string
name: read_data
arguments: label: D98
datatype: string
name: read_data
arguments: label: D28
datatype: string
name: read_data
arguments: label: D20
datatype: string

tool: D17: little endian 

tool: D93: A law 

tool: D67: big endian 

tool: D18: AC3 

tool: D36: mu law 

tool: D71: MPEG 2 

tool: D45: unsigned 

tool: D98: int 

tool: D28: float 

tool: D20: signed 

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;
}
```