user: Converte this assembly snippet into its equivalent C code:

```asm
<findIndex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x28(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L30
  mov    $0xffffffff,%eax
  jmp    L162
L30:
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L171
L190:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L172
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L171
L172:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L109
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L171
L109:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L205
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L171
L205:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L22
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L171
L22:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L171:
  mov    -0x18(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0x5,%eax
  jg     L190
  mov    -0x18(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0x5,%eax
  jg     L50
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L207
L27:
  addl   $0x1,-0x1c(%rbp)
  addq   $0x4,-0x8(%rbp)
L207:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jge    L4
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jg     L27
L4:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
L50:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L115
  mov    -0x1c(%rbp),%eax
  jmp    L162
L115:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L104
  mov    -0x1c(%rbp),%eax
  neg    %eax
  jmp    L162
L104:
  mov    -0x34(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L2
  mov    -0x18(%rbp),%eax
  not    %eax
  jmp    L162
L2:
  mov    -0x1c(%rbp),%eax
  not    %eax
L162:
  pop    %rbp
  ret
```

assistant: ```c
int findIndex(int target, int *attributes, int count, int offset) {
  int focusPos, beginPos, endPos;
  int focusAttrib, beginAttrib, endAttrib;
  beginPos = offset;
  endPos = beginPos + count - 1;
  if (endPos < beginPos)
    return (-1);
  focusPos = (beginPos + endPos) / 2;
  beginAttrib = attributes[beginPos];
  focusAttrib = attributes[focusPos];
  endAttrib = attributes[endPos];
  while (endPos - beginPos > 5) {
    if (beginAttrib == target) {
      focusAttrib = beginAttrib;
      endPos = beginPos;
    } else if (endAttrib == target) {
      focusAttrib = endAttrib;
      beginPos = endPos;
    } else if (focusAttrib < target) {
      beginPos = focusPos + 1;
      beginAttrib = attributes[beginPos];
      focusPos = (beginPos + endPos) / 2;
      focusAttrib = attributes[focusPos];
    } else if (focusAttrib > target) {
      endPos = focusPos - 1;
      endAttrib = attributes[endPos];
      focusPos = (beginPos + endPos) / 2;
      focusAttrib = attributes[focusPos];
    } else {
      beginPos = focusPos;
      endPos = focusPos;
    }
  }
  if (endPos - beginPos <= 5) {
    int *attptr = attributes + beginPos;
    while ((beginPos < endPos) && ((*attptr) < target)) {
      beginPos++;
      attptr++;
    }
    focusAttrib = (*attptr);
  }
  if (focusAttrib == target)
    return (beginPos);
  else if (focusAttrib > target)
    return (-beginPos);
  else if (beginPos > offset + count - 1)
    return (-(endPos + 1));
  else
    return (-(beginPos + 1));
}
```