user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<listIndex>:
  endbr64
  push   %rbp
  movslq %edx,%r8
  mov    %rsp,%rbp
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %edx,-0x5c(%rbp)
  mov    %rsi,-0x68(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0xf(,%r8,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L116
L280:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L280
L116:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L283
L198:
  lea    0xf(%r8),%rax
  mov    %rsp,%rsi
  mov    %rsp,%r14
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L238
L14:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L14
L238:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L214
L226:
  mov    %r15,%rdi
  mov    %r8,-0x50(%rbp)
  mov    %rsp,%rbx
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %rax,%r12
  mov    %rdx,%rdi
  mov    %rdx,-0x48(%rbp)
  call   <malloc@plt>
  mov    -0x48(%rbp),%rdx
  mov    %r15,%rsi
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <memcpy@plt>
  mov    -0x50(%rbp),%r8
  xor    %eax,%eax
  jmp    L156
  nopw   0x0(%rax,%rax,1)
L122:
  movzbl 0x0(%r13,%rax,1),%edx
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L8
  add    $0x20,%edx
  mov    %dl,0x0(%r13,%rax,1)
L8:
  add    $0x1,%rax
L156:
  cmp    %rax,%r12
  ja     L122
  mov    -0x5c(%rbp),%ecx
  test   %ecx,%ecx
  jle    L36
  xor    %r12d,%r12d
  xchg   %ax,%ax
L120:
  mov    -0x68(%rbp),%rax
  mov    %r8,-0x58(%rbp)
  mov    (%rax,%r12,8),%rsi
  mov    %rsi,%rdi
  mov    %rsi,-0x50(%rbp)
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %rax,%r15
  mov    %rdx,%rdi
  mov    %rdx,-0x48(%rbp)
  call   <malloc@plt>
  mov    -0x48(%rbp),%rdx
  mov    -0x50(%rbp),%rsi
  mov    %rax,(%r14,%r12,8)
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x58(%rbp),%r8
  mov    %rax,%rdi
  xor    %eax,%eax
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L203:
  movzbl (%rdi,%rax,1),%edx
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L243
  add    $0x20,%edx
  mov    %dl,(%rdi,%rax,1)
L243:
  add    $0x1,%rax
L20:
  cmp    %rax,%r15
  ja     L203
  mov    %r8,-0x48(%rbp)
  call   <strlen@plt>
  mov    %r13,%rdi
  mov    %rax,%r15
  call   <strlen@plt>
  mov    -0x48(%rbp),%r8
  cmp    %rax,%r15
  setae  (%rbx,%r12,1)
  add    $0x1,%r12
  cmp    %r8,%r12
  jne    L120
L36:
  xor    %r12d,%r12d
  nopl   0x0(%rax)
L3:
  mov    %r13,%rdi
  mov    %r8,-0x48(%rbp)
  call   <strlen@plt>
  cmp    %r12,%rax
  jbe    L109
  mov    -0x5c(%rbp),%edx
  xor    %eax,%eax
  mov    -0x48(%rbp),%r8
  test   %edx,%edx
  jle    L113
  xchg   %ax,%ax
L266:
  cmpb   $0x0,(%rbx,%rax,1)
  je     L44
  mov    (%r14,%rax,8),%rdx
  movzbl (%rdx,%r12,1),%ecx
  cmp    %cl,0x0(%r13,%r12,1)
  je     L44
  movb   $0x0,(%rbx,%rax,1)
L44:
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L266
L113:
  add    $0x1,%r12
  jmp    L3
L283:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L198
  nopl   0x0(%rax)
L109:
  mov    -0x5c(%rbp),%eax
  test   %eax,%eax
  jle    L98
  mov    %eax,%edx
  mov    $0xffffffff,%r12d
  xor    %eax,%eax
  nopl   0x0(%rax)
L134:
  cmpb   $0x0,(%rbx,%rax,1)
  je     L208
  cmp    $0xffffffff,%r12d
  jne    L41
  mov    %eax,%r12d
L208:
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L134
L66:
  mov    %r14,%rbx
  lea    (%r14,%rdx,8),%r14
  nop
L79:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbx,%r14
  jne    L79
L284:
  mov    %r13,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L291
  lea    -0x28(%rbp),%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L41:
  mov    $0xffffffff,%r12d
  jmp    L66
L98:
  mov    $0xffffffff,%r12d
  jmp    L284
L214:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L226
L291:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int listIndex(char *input, const char *list[], int count) {
  char *lowerInput;
  char *lowerList[count];
  _Bool isSelectable[count];
  int candidate = -1;
  lowerInput = malloc(strlen(input) + 1);
  strcpy(lowerInput, input);
  for (int i = 0; i < strlen(input); i++) {
    if (lowerInput[i] >= 'A' && lowerInput[i] <= 'Z') {
      lowerInput[i] -= 'A' - 'a';
    }
  }
  for (int i = 0; i < count; i++) {
    lowerList[i] = malloc(strlen(list[i]) + 1);
    strcpy(lowerList[i], list[i]);
    for (int j = 0; j < strlen(list[i]); j++) {
      if (lowerList[i][j] >= 'A' && lowerList[i][j] <= 'Z') {
        lowerList[i][j] -= 'A' - 'a';
      }
    }
    if (strlen(lowerList[i]) >= strlen(lowerInput)) {
      isSelectable[i] = 1;
    } else {
      isSelectable[i] = 0;
    }
  }
  for (int i = 0; i < strlen(lowerInput); i++) {
    for (int j = 0; j < count; j++) {
      if (!isSelectable[j]) {
        continue;
      }
      if (lowerInput[i] != lowerList[j][i]) {
        isSelectable[j] = 0;
      }
    }
  }
  for (int i = 0; i < count; i++) {
    if (isSelectable[i]) {
      if (candidate != -1) {
        candidate = -1;
        break;
      }
      candidate = i;
    }
  }
  for (int i = 0; i < count; i++) {
    free(lowerList[i]);
  }
  free(lowerInput);
  return candidate;
}
```