user: Demonstrate the C code that generates the assembly output below:

```asm
<dump_samprate>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x110,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x88(%rsp)
  movq   $0x0,0x90(%rsp)
  movq   $0x0,0x98(%rsp)
  movq   $0x0,0xa0(%rsp)
  movq   $0x0,0xa8(%rsp)
  movq   $0x0,0xb0(%rsp)
  movq   $0x0,0xb8(%rsp)
  movq   $0x0,0xc0(%rsp)
  movq   $0x0,0xc8(%rsp)
  movq   $0x0,0xd0(%rsp)
  movq   $0x0,0xd8(%rsp)
  movq   $0x0,0xe0(%rsp)
  movq   $0x0,0xe8(%rsp)
  movq   $0x0,0xf0(%rsp)
  movq   $0x0,0xf8(%rsp)
  cmp    $0x2,%ecx
  je     L163
  lea    D57(%rip),%rdx
  call   <snprintf@plt>
L106:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L157
  add    $0x110,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L163:
  movzwl (%rdx),%edi
  call   <ntohs@plt>
  mov    %eax,%r12d
  test   $0x1,%al
  jne    L158
L57:
  test   $0x2,%r12b
  jne    L78
L34:
  test   $0x4,%r12b
  jne    L54
L152:
  test   $0x8,%r12b
  jne    L12
L103:
  test   $0x10,%r12b
  jne    L156
L84:
  test   $0x20,%r12b
  jne    L56
L147:
  cmpb   $0x0,(%rsp)
  je     L74
  lea    -0x1(%rbx),%edx
  lea    0x1(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strncpy@plt>
  jmp    L106
L158:
  mov    %rsp,%rdi
  lea    D29(%rip),%rsi
  call   <strcat@plt>
  jmp    L57
L78:
  mov    %rsp,%rdi
  lea    D14(%rip),%rsi
  call   <strcat@plt>
  jmp    L34
L54:
  mov    %rsp,%rdi
  lea    D41(%rip),%rsi
  call   <strcat@plt>
  jmp    L152
L12:
  mov    %rsp,%rdi
  lea    D8(%rip),%rsi
  call   <strcat@plt>
  jmp    L103
L156:
  mov    %rsp,%rdi
  lea    D75(%rip),%rsi
  call   <strcat@plt>
  jmp    L84
L56:
  mov    %rsp,%rdi
  lea    D12(%rip),%rsi
  call   <strcat@plt>
  jmp    L147
L74:
  lea    -0x1(%rbx),%edx
  lea    D68(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncpy@plt>
  jmp    L106
L157:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D57
datatype: string
name: read_data
arguments: label: D29
datatype: string
name: read_data
arguments: label: D14
datatype: string
name: read_data
arguments: label: D41
datatype: string
name: read_data
arguments: label: D8
datatype: string
name: read_data
arguments: label: D75
datatype: string
name: read_data
arguments: label: D12
datatype: string
name: read_data
arguments: label: D68
datatype: string

tool: D57: Invalid SHORT

tool: D29: ,8khz

tool: D14: ,11.025khz

tool: D41: ,16khz

tool: D8: ,22.05khz

tool: D75: ,44.1khz

tool: D12: ,48khz

tool: D68: None specified!


assistant: ```c
void dump_samprate(char *output, int maxlen, void *value, int len) {
  char tmp[256] = "";
  int sr;
  if (len == (int)sizeof(unsigned short)) {
    sr = ntohs(*((unsigned short *)value));
    if (sr & (1 << 0))
      strcat(tmp, ",8khz");
    if (sr & (1 << 1))
      strcat(tmp, ",11.025khz");
    if (sr & (1 << 2))
      strcat(tmp, ",16khz");
    if (sr & (1 << 3))
      strcat(tmp, ",22.05khz");
    if (sr & (1 << 4))
      strcat(tmp, ",44.1khz");
    if (sr & (1 << 5))
      strcat(tmp, ",48khz");
    if (strlen(tmp))
      strncpy(output, &tmp[1], maxlen - 1);
    else
      strncpy(output, "None specified!\n", maxlen - 1);
  } else
    snprintf(output, maxlen, "Invalid SHORT");
}
```