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     L63
  lea    D52(%rip),%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <snprintf@plt>
  movslq %eax,%rbx
  mov    %r13d,%eax
  and    $0x38,%eax
  je     L35
L13:
  cmp    $0x18,%eax
  je     L87
  jg     L44
  cmp    $0x8,%eax
  je     L99
  cmp    $0x10,%eax
  jne    L48
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D43(%rip),%rdx
  sub    %rbx,%rsi
  call   <snprintf@plt>
L48:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L63:
  lea    D5(%rip),%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <snprintf@plt>
  movslq %eax,%rbx
  mov    %r13d,%eax
  and    $0x38,%eax
  jne    L13
L35:
  movslq %ebx,%rax
  lea    (%r12,%rax,1),%rdi
  test   $0x4,%r13b
  jne    L104
  mov    %rbp,%rsi
  sub    %rax,%rsi
  and    $0x2,%r13d
  jne    L32
  lea    D45(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
L24:
  movslq %edi,%rdi
  mov    %rbp,%rsi
  lea    D88(%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)
L44:
  cmp    $0x20,%eax
  jne    L48
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D69(%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)
L32:
  lea    D47(%rip),%rdx
  call   <snprintf@plt>
  lea    (%rbx,%rax,1),%edi
  jmp    L24
  nopl   0x0(%rax)
L87:
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D2(%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)
L104:
  mov    %rbp,%rsi
  lea    D37(%rip),%rdx
  call   <snprintf@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L99:
  mov    %rbp,%rsi
  lea    (%r12,%rbx,1),%rdi
  lea    D48(%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: unpack_data
arguments: data_label: D52
type_infered: string
name: unpack_data
arguments: data_label: D43
type_infered: string
name: unpack_data
arguments: data_label: D5
type_infered: string
name: unpack_data
arguments: data_label: D45
type_infered: string
name: unpack_data
arguments: data_label: D88
type_infered: string
name: unpack_data
arguments: data_label: D69
type_infered: string
name: unpack_data
arguments: data_label: D47
type_infered: string
name: unpack_data
arguments: data_label: D2
type_infered: string
name: unpack_data
arguments: data_label: D37
type_infered: string
name: unpack_data
arguments: data_label: D48
type_infered: string

tool: D52: little endian 

tool: D43: A law 

tool: D5: big endian 

tool: D45: signed 

tool: D88: int 

tool: D69: AC3 

tool: D47: unsigned 

tool: D2: MPEG 2 

tool: D37: float 

tool: D48: 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;
}
```