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

```asm
<searchwindex>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  call   <ftell@plt>
  mov    D146(%rip),%r12
  test   %rax,%rax
  je     L537
L143:
  mov    D35(%rip),%rsi
  mov    D133(%rip),%r15
  cmp    %rsi,%r12
  jl     L257
L150:
  add    %r12,%rsi
  mov    (%r15),%edx
  sar    %rsi
  mov    %rsi,%r12
  jne    L516
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <fseek@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L276
  mov    D162(%rip),%r13
L133:
  mov    0x8(%rsp),%r14
  jmp    L443
  cs nopw 0x0(%rax,%rax,1)
L304:
  cmp    $0x9,%eax
  je     L599
  movzbl (%r14),%ecx
  cmp    %eax,%ecx
  jne    L514
  add    $0x1,%r14
L443:
  mov    %rbp,%rdi
  call   <getc@plt>
  test   $0xffffffdf,%eax
  jne    L304
L599:
  xor    %eax,%eax
L514:
  cmp    %eax,0x0(%r13)
  je     L61
  movzbl (%r14),%edx
  cmp    %eax,%edx
  jle    L61
  lea    0x1(%rbx),%rsi
  mov    D146(%rip),%r12
  mov    %rsi,D115(%rip)
L321:
  cmp    %rsi,%r12
  jge    L150
L257:
  mov    (%r15),%edx
  mov    %rbp,%rdi
  call   <fseek@plt>
  test   %rax,%rax
  jne    L276
  mov    D115(%rip),%rdx
  mov    D162(%rip),%r13
L302:
  test   %rdx,%rdx
  jne    L285
L524:
  mov    0x8(%rsp),%rbx
  jmp    L460
  nopl   (%rax)
L344:
  mov    D115(%rip),%rdx
  movzbl (%rbx),%ecx
  add    $0x1,%rdx
  mov    %rdx,D115(%rip)
  test   $0xffffffdf,%eax
  je     L16
  cmp    $0x9,%eax
  je     L16
  cmp    %eax,%ecx
  jne    L638
  add    $0x1,%rbx
L460:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  jne    L344
L63:
  xor    %eax,%eax
L577:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L61:
  sub    $0x1,%r12
  mov    D115(%rip),%rsi
  mov    %r12,D115(%rip)
  jmp    L321
  nopw   0x0(%rax,%rax,1)
L516:
  lea    -0x1(%rsi),%rsi
  mov    %rbp,%rdi
  call   <fseek@plt>
  test   %rax,%rax
  jne    L276
  mov    D162(%rip),%r13
  mov    %r12,%rbx
  jmp    L392
  nopl   (%rax)
L190:
  cmp    $0xa,%eax
  je     L94
  add    $0x1,%rbx
L392:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  jne    L190
L94:
  mov    %rbp,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L133
L276:
  mov    $0xffffffff,%eax
L164:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  cmp    $0xa,%eax
  je     L193
  addq   $0x1,D115(%rip)
L285:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  jne    L19
L193:
  mov    %rbp,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L524
  jmp    L276
  xchg   %ax,%ax
L16:
  xor    %eax,%eax
L638:
  cmp    %eax,%ecx
  jg     L302
  jne    L63
L587:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    $0x20,%eax
  je     L587
  cmp    $0x9,%eax
  je     L587
  cmp    $0x28,%eax
  je     L63
  cmp    $0xa,%eax
  je     L63
  lea    D115(%rip),%rbx
  mov    %rbx,%r14
  lea    0xff(%rbx),%r12
  jmp    L106
L138:
  cmp    %r12,%r14
  jae    L374
  mov    %al,(%r14)
  add    $0x1,%r14
L374:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    $0x20,%eax
  je     L334
  cmp    $0x9,%eax
  je     L334
  cmp    $0x28,%eax
  je     L166
  cmp    $0xa,%eax
  je     L166
L106:
  cmp    %eax,0x0(%r13)
  jne    L138
L334:
  cmp    %rbx,%r14
  je     L63
  movb   $0x0,(%r14)
  cmp    $0x9,%eax
  je     L268
  cmp    $0x20,%eax
  jne    L263
L268:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    $0x20,%eax
  je     L268
  cmp    $0x9,%eax
  je     L268
L263:
  cmp    $0x28,%eax
  jne    L63
  lea    D86(%rip),%r12
  mov    %r12,%r15
  lea    0x1f(%r12),%r14
  jmp    L92
L513:
  cmp    $0xa,%eax
  je     L115
  cmp    %eax,0x0(%r13)
  je     L115
  lea    -0x41(%rax),%ecx
  lea    0x20(%rax),%edx
  cmp    $0x1a,%ecx
  cmovb  %edx,%eax
  cmp    %r14,%r15
  jb     L491
L92:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    $0x29,%eax
  jne    L513
  movb   $0x0,(%r15)
  cmp    %r12,%r15
  je     L63
  cmpl   $0x29,0x0(%r13)
  jne    L264
  jmp    L63
  xchg   %ax,%ax
L230:
  cmp    $0xa,%eax
  je     L120
L264:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  jne    L230
  cmp    $0xa,%eax
  jne    L63
L120:
  mov    0x10(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x18(%rsp),%rax
  mov    %r12,(%rax)
  mov    $0x1,%eax
  jmp    L164
  cs nopw 0x0(%rax,%rax,1)
L537:
  mov    D94(%rip),%rax
  xor    %esi,%esi
  mov    %rbp,%rdi
  movq   $0x0,D115(%rip)
  mov    (%rax),%edx
  call   <fseek@plt>
  mov    %rbp,%rdi
  call   <ftell@plt>
  mov    %rax,D95(%rip)
  mov    %rax,%r12
  jmp    L143
L166:
  cmp    %rbx,%r14
  je     L63
  movb   $0x0,(%r14)
  jmp    L263
L491:
  add    $0x1,%r15
  mov    %al,-0x1(%r15)
  jmp    L92
L115:
  movb   $0x0,(%r15)
  xor    %eax,%eax
  jmp    L577
```

assistant: ```c
int searchwindex(FILE *wf, char *title, char **ppage, char **psection) {
  static char page[256], section[32];
  static long low, high;
  long mid0, mid1;
  int c;
  unsigned char *pt;
  char *pc;
  if (ftell(wf) == 0) {
    low = 0;
    fseek(wf, (off_t)0, SEEK_END);
    high = ftell(wf);
  }
  while (low <= high) {
    pt = (unsigned char *)title;
    mid0 = mid1 = (low + high) >> 1;
    if (mid0 == 0) {
      if (fseek(wf, (off_t)0, SEEK_SET) != 0)
        return -1;
    } else {
      if (fseek(wf, (off_t)mid0 - 1, SEEK_SET) != 0)
        return -1;
      while ((c = getc(wf)) != EOF && c != '\n')
        mid1++;
      if (ferror(wf))
        return -1;
    }
    for (;;) {
      if ((c = getc(wf)) == ' ' || c == '\t')
        c = 0;
      if (c == 0 || c != *pt)
        break;
      pt++;
    }
    if (c == EOF || *pt <= c) {
      high = mid0 - 1;
    } else {
      low = mid1 + 1;
    }
  }
  if (fseek(wf, (off_t)low, SEEK_SET) != 0)
    return -1;
  do {
    if (low != 0) {
      while ((c = getc(wf)) != EOF && c != '\n')
        low++;
      if (ferror(wf))
        return -1;
    }
    pt = (unsigned char *)title;
    for (;;) {
      if ((c = getc(wf)) == EOF)
        return 0;
      low++;
      if (c == ' ' || c == '\t')
        c = 0;
      if (c == 0 || c != *pt)
        break;
      pt++;
    }
  } while (c < *pt);
  if (*pt != c)
    return 0;
  while ((c = fgetc(wf)) == ' ' || c == '\t') {
  }
  pc = page;
  while (c != ' ' && c != '\t' && c != '(' && c != '\n' && c != EOF) {
    if (pc < ((page) + (sizeof(page) / sizeof((page)[0]))) - 1)
      *pc++ = c;
    c = getc(wf);
  }
  if (pc == page)
    return 0;
  *pc = 0;
  while (c == ' ' || c == '\t')
    c = fgetc(wf);
  if (c != '(')
    return 0;
  pc = section;
  while ((c = fgetc(wf)) != ')' && c != '\n' && c != EOF) {
    if ('A' <= c && c <= 'Z')
      c = c - 'A' + 'a';
    if (pc < ((section) + (sizeof(section) / sizeof((section)[0]))) - 1)
      *pc++ = c;
  }
  *pc = 0;
  if (c != ')' || pc == section)
    return 0;
  while (c != EOF && c != '\n')
    c = getc(wf);
  if (c != '\n')
    return 0;
  *ppage = page;
  *psection = section;
  return 1;
}
```