user: What would the C source look like for the assembly code provided here?

```asm
<sys_audiodevnametonumber>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0xa000(%rsp),%r11
L3:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L3
  sub    $0x50,%rsp
  mov    %edi,-0xa044(%rbp)
  mov    %rsi,-0xa050(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xa034(%rbp)
  movl   $0x0,-0xa030(%rbp)
  lea    -0xa028(%rbp),%r8
  lea    -0xa02c(%rbp),%rdi
  lea    -0xa030(%rbp),%rcx
  lea    -0x5010(%rbp),%rdx
  lea    -0xa034(%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,-0xa044(%rbp)
  je     L100
  movl   $0x0,-0xa024(%rbp)
  jmp    L43
L130:
  mov    -0xa050(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0xa020(%rbp)
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,-0xa020(%rbp)
  jbe    L110
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0xa020(%rbp)
L110:
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0x5010(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0xa020(%rbp),%rdx
  mov    -0xa050(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L21
  mov    -0xa024(%rbp),%eax
  jmp    L96
L21:
  addl   $0x1,-0xa024(%rbp)
L43:
  mov    -0xa030(%rbp),%eax
  cmp    %eax,-0xa024(%rbp)
  jl     L130
  jmp    L106
L100:
  movl   $0x0,-0xa024(%rbp)
  jmp    L18
L90:
  mov    -0xa050(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0xa018(%rbp)
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,-0xa018(%rbp)
  jbe    L131
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0xa018(%rbp)
L131:
  mov    -0xa024(%rbp),%eax
  shl    $0xa,%eax
  cltq
  lea    -0xa010(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0xa018(%rbp),%rdx
  mov    -0xa050(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L25
  mov    -0xa024(%rbp),%eax
  jmp    L96
L25:
  addl   $0x1,-0xa024(%rbp)
L18:
  mov    -0xa034(%rbp),%eax
  cmp    %eax,-0xa024(%rbp)
  jl     L90
L106:
  mov    $0xffffffff,%eax
L96:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L108
  call   <__stack_chk_fail@plt>
L108:
  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 long 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 long 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);
}
```