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

```asm
<sys_audiodevnametonumber>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0xa000(%rsp),%r11
L117:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L117
  sub    $0x40,%rsp
  mov    %edi,-0xa034(%rbp)
  mov    %rsi,-0xa040(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xa02c(%rbp)
  movl   $0x0,-0xa028(%rbp)
  lea    -0xa020(%rbp),%r8
  lea    -0xa024(%rbp),%rdi
  lea    -0xa028(%rbp),%rcx
  lea    -0x5010(%rbp),%rdx
  lea    -0xa02c(%rbp),%rsi
  lea    -0xa010(%rbp),%rax
  push   $0x400
  push   $0x14
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <sys_get_audio_devs@plt>
  add    $0x10,%rsp
  cmpl   $0x0,-0xa034(%rbp)
  je     L124
  movl   $0x0,-0xa01c(%rbp)
  jmp    L85
L95:
  mov    -0xa040(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xa018(%rbp)
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0xa018(%rbp)
  jbe    L103
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xa018(%rbp)
L103:
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0xa018(%rbp),%edx
  mov    -0xa040(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L52
  mov    -0xa01c(%rbp),%eax
  jmp    L16
L52:
  addl   $0x1,-0xa01c(%rbp)
L85:
  mov    -0xa028(%rbp),%eax
  cmp    %eax,-0xa01c(%rbp)
  jl     L95
  jmp    L17
L124:
  movl   $0x0,-0xa01c(%rbp)
  jmp    L93
L74:
  mov    -0xa040(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xa014(%rbp)
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0xa014(%rbp)
  jbe    L58
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xa014(%rbp)
L58:
  mov    -0xa01c(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0xa014(%rbp),%edx
  mov    -0xa040(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L100
  mov    -0xa01c(%rbp),%eax
  jmp    L16
L100:
  addl   $0x1,-0xa01c(%rbp)
L93:
  mov    -0xa02c(%rbp),%eax
  cmp    %eax,-0xa01c(%rbp)
  jl     L74
L17:
  mov    $0xffffffff,%eax
L16:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L20
  call   <__stack_chk_fail@plt>
L20:
  leave
  ret
```

assistant: ```c
int sys_audiodevnametonumber(int output, const char *name) {
  char indevlist[20 * 1024], outdevlist[20 * 1024];
  int nindevs = 0, noutdevs = 0, i, canmulti, cancallback;
  sys_get_audio_devs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, &cancallback, 20, 1024);
  if (output) {
    for (i = 0; i < noutdevs; i++) {
      unsigned int comp = strlen(name);
      if (comp > strlen(outdevlist + i * 1024))
        comp = strlen(outdevlist + i * 1024);
      if (!strncmp(name, outdevlist + i * 1024, comp))
        return (i);
    }
  } else {
    for (i = 0; i < nindevs; i++) {
      unsigned int comp = strlen(name);
      if (comp > strlen(indevlist + i * 1024))
        comp = strlen(indevlist + i * 1024);
      if (!strncmp(name, indevlist + i * 1024, comp))
        return (i);
    }
  }
  return (-1);
}
```