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

```asm
<findIndex>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  add    %ecx,%ebx
  lea    -0x1(%rbx),%eax
  cmp    %eax,%ecx
  jg     L20
  mov    %rsi,%r11
  mov    %ecx,%edx
  lea    (%rcx,%rax,1),%esi
  mov    %esi,%ecx
  shr    $0x1f,%ecx
  add    %esi,%ecx
  sar    %ecx
  mov    %ecx,%ebp
  movslq %edx,%rsi
  mov    (%r11,%rsi,4),%esi
  movslq %ecx,%rcx
  mov    (%r11,%rcx,4),%r8d
  movslq %eax,%rcx
  mov    (%r11,%rcx,4),%r12d
L12:
  mov    %esi,%r10d
  mov    %edx,%r9d
L123:
  mov    %eax,%ecx
  sub    %edx,%ecx
  cmp    $0x5,%ecx
  jle    L161
  cmp    %esi,%edi
  jne    L94
  mov    %r10d,%r8d
  mov    %r9d,%eax
  jmp    L123
L94:
  cmp    %r12d,%edi
  je     L158
  cmp    %edi,%r8d
  jge    L50
  lea    0x1(%rbp),%edx
  movslq %edx,%rcx
  mov    (%r11,%rcx,4),%esi
  lea    (%rax,%rdx,1),%r8d
  mov    %r8d,%ecx
  shr    $0x1f,%ecx
  add    %r8d,%ecx
  sar    %ecx
  mov    %ecx,%ebp
  movslq %ecx,%rcx
  mov    (%r11,%rcx,4),%r8d
  jmp    L12
L50:
  jle    L11
  lea    -0x1(%rbp),%eax
  movslq %eax,%rcx
  mov    (%r11,%rcx,4),%r12d
  lea    (%rdx,%rax,1),%r8d
  mov    %r8d,%ecx
  shr    $0x1f,%ecx
  add    %r8d,%ecx
  sar    %ecx
  mov    %ecx,%ebp
  movslq %ecx,%rcx
  mov    (%r11,%rcx,4),%r8d
  jmp    L12
L158:
  mov    %r12d,%r8d
  mov    %eax,%edx
  jmp    L12
L11:
  mov    %ebp,%eax
  mov    %ebp,%edx
  jmp    L12
L161:
  movslq %edx,%rcx
  lea    (%r11,%rcx,4),%rcx
  cmp    %eax,%edx
  jge    L134
L30:
  cmp    %edi,(%rcx)
  jge    L134
  add    $0x1,%edx
  add    $0x4,%rcx
  cmp    %edx,%eax
  jne    L30
L134:
  mov    (%rcx),%esi
  mov    %edx,%ecx
  cmp    %esi,%edi
  je     L126
  jl     L138
  not    %eax
  not    %ecx
  cmp    %edx,%ebx
  cmovle %eax,%ecx
L126:
  mov    %ecx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L138:
  neg    %edx
  mov    %edx,%ecx
  jmp    L126
L20:
  mov    $0xffffffff,%ecx
  jmp    L126
```

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));
}
```