user: Demonstrate the C code that generates the assembly output below:

```asm
<findIndex>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  add    %ecx,%ebx
  lea    -0x1(%rbx),%eax
  cmp    %eax,%ecx
  jg     L0
  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
L47:
  mov    %esi,%r10d
  mov    %edx,%r9d
L109:
  mov    %eax,%ecx
  sub    %edx,%ecx
  cmp    $0x5,%ecx
  jle    L164
  cmp    %esi,%edi
  jne    L127
  mov    %r10d,%r8d
  mov    %r9d,%eax
  jmp    L109
L127:
  cmp    %r12d,%edi
  je     L58
  cmp    %edi,%r8d
  jge    L117
  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    L47
L117:
  jle    L101
  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    L47
L58:
  mov    %r12d,%r8d
  mov    %eax,%edx
  jmp    L47
L101:
  mov    %ebp,%eax
  mov    %ebp,%edx
  jmp    L47
L164:
  movslq %edx,%rcx
  lea    (%r11,%rcx,4),%rcx
  cmp    %eax,%edx
  jge    L32
L92:
  cmp    %edi,(%rcx)
  jge    L32
  add    $0x1,%edx
  add    $0x4,%rcx
  cmp    %edx,%eax
  jne    L92
L32:
  mov    (%rcx),%esi
  mov    %edx,%ecx
  cmp    %esi,%edi
  je     L34
  jl     L48
  not    %eax
  not    %ecx
  cmp    %edx,%ebx
  cmovle %eax,%ecx
L34:
  mov    %ecx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L48:
  neg    %edx
  mov    %edx,%ecx
  jmp    L34
L0:
  mov    $0xffffffff,%ecx
  jmp    L34
```

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