user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<getIndex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    -0x14(%rbp),%edx
  mov    %eax,%ecx
  shr    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x14,-0x18(%rbp)
  ja     L13
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D13(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D13(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x0,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x1,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x3,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x7,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x1f,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x7f,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  movzbl %al,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x1ff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x3ff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x7ff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0xfff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x1fff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x3fff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x7fff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  movzwl %ax,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x1ffff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x3ffff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0x7ffff,%eax
  jmp    L171
  mov    -0x4(%rbp),%eax
  and    $0xfffff,%eax
  jmp    L171
L13:
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
L171:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D19
type_guessed: string

tool: D19: *** ERROR: Index should not be greater than 20 (Index size = %d). Returning 0.


assistant: ```c
unsigned int getIndex(unsigned int address, const int indexSize, const int offsetSize) {
  unsigned int tempAddress = address >> offsetSize;
  switch (indexSize) {
  case 0:
    return 0;
  case 1:
    return (tempAddress & 0x1);
  case 2:
    return (tempAddress & 0x3);
  case 3:
    return (tempAddress & 0x7);
  case 4:
    return (tempAddress & 0xF);
  case 5:
    return (tempAddress & 0x1F);
  case 6:
    return (tempAddress & 0x3F);
  case 7:
    return (tempAddress & 0x7F);
  case 8:
    return (tempAddress & 0xFF);
  case 9:
    return (tempAddress & 0x1FF);
  case 10:
    return (tempAddress & 0x3FF);
  case 11:
    return (tempAddress & 0x7FF);
  case 12:
    return (tempAddress & 0xFFF);
  case 13:
    return (tempAddress & 0x1FFF);
  case 14:
    return (tempAddress & 0x3FFF);
  case 15:
    return (tempAddress & 0x7FFF);
  case 16:
    return (tempAddress & 0xFFFF);
  case 17:
    return (tempAddress & 0x1FFFF);
  case 18:
    return (tempAddress & 0x3FFFF);
  case 19:
    return (tempAddress & 0x7FFFF);
  case 20:
    return (tempAddress & 0xFFFFF);
  default:
    printf("*** ERROR: Index should not be greater than 20 (Index size = %d). Returning 0.\n", indexSize);
    return 0;
  }
}
```