user: Please show me the C implementation that matches the assembly code listed below:

```asm
<find_tag_var_start>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdi,%rdi
  je     L18
  mov    %rdi,%r10
  mov    %rsi,%r11
  test   %rsi,%rsi
  je     L18
  movzbl (%rdi),%eax
  test   %eax,%eax
  je     L144
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  jmp    L193
L259:
  movslq %ebp,%rax
  movzbl (%r10,%rax,1),%eax
  test   %eax,%eax
  je     L100
L193:
  cmp    $0x20,%eax
  ja     L163
  add    $0x1,%ebp
  jmp    L259
L163:
  movzbl (%r11),%esi
  movzbl %sil,%eax
  movslq %ebp,%r12
  add    %r10,%r12
  movzbl (%r12),%edx
  test   %eax,%eax
  je     L251
  mov    $0x1,%ecx
L198:
  lea    -0x1(%rcx),%edi
  test   %edx,%edx
  je     L56
  lea    -0x41(%rax),%r9d
  lea    0x20(%rax),%r8d
  cmp    $0x1a,%r9d
  cmovb  %r8d,%eax
  lea    -0x41(%rdx),%r9d
  lea    0x20(%rdx),%r8d
  cmp    $0x1a,%r9d
  cmovb  %r8d,%edx
  cmp    %edx,%eax
  jne    L239
  mov    %ecx,%edi
  movzbl (%r11,%rcx,1),%esi
  movzbl %sil,%eax
  movzbl (%r12,%rcx,1),%edx
  add    $0x1,%rcx
  test   %eax,%eax
  jne    L198
L239:
  test   %sil,%sil
  jne    L22
  lea    0x0(%rbp,%rdi,1),%eax
  cltq
  movzbl (%r10,%rax,1),%eax
  test   %eax,%eax
  je     L78
  movslq %edi,%rdx
L276:
  mov    %edx,%edi
  cmp    $0x3d,%eax
  je     L99
  cmp    $0x20,%eax
  ja     L22
  cmp    $0xa,%eax
  je     L22
  movzbl 0x1(%r12,%rdx,1),%eax
  add    $0x1,%rdx
  test   %eax,%eax
  jne    L276
  mov    $0xffffffff,%ebp
  jmp    L99
L251:
  mov    %ebx,%edi
  jmp    L239
L22:
  lea    0x1(%rdi,%rbp,1),%eax
  cltq
  movzbl (%r10,%rax,1),%edx
  test   %edx,%edx
  je     L89
L176:
  mov    %eax,%ebp
  cmp    $0xa,%edx
  je     L259
  movzbl 0x1(%r10,%rax,1),%edx
  add    $0x1,%rax
  test   %edx,%edx
  jne    L176
  mov    $0xffffffff,%ebp
  jmp    L99
L18:
  mov    $0xffffffff,%ebp
  jmp    L99
L144:
  mov    $0xffffffff,%ebp
  jmp    L99
L100:
  mov    $0xffffffff,%ebp
  jmp    L99
L56:
  mov    $0xffffffff,%ebp
L99:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L78:
  mov    $0xffffffff,%ebp
  jmp    L99
L89:
  mov    $0xffffffff,%ebp
  jmp    L99
```

assistant: ```c
int find_tag_var_start(const char *tagbuffer, const char *varname) {
  int i, j;
  if (!tagbuffer || !varname)
    return -1;
  for (i = 0;;) {
    for (;; i++) {
      unsigned u = ((unsigned)(tagbuffer[i])) & 0xFF;
      if (!u)
        return -1;
      if (u <= 0x20)
        continue;
      break;
    }
    for (j = 0;; j++) {
      unsigned ucmp = ((unsigned)(varname[j])) & 0xFF;
      unsigned u = ((unsigned)(tagbuffer[i + j])) & 0xFF;
      if (!ucmp)
        break;
      if (!u)
        return -1;
      if (ucmp >= 'A' && ucmp <= 'Z') {
        ucmp -= 'A';
        ucmp += 'a';
      }
      if (u >= 'A' && u <= 'Z') {
        u -= 'A';
        u += 'a';
      }
      if (u != ucmp)
        break;
    }
    if (!varname[j]) {
      for (;; j++) {
        unsigned u = ((unsigned)(tagbuffer[i + j])) & 0xFF;
        if (!u)
          return -1;
        if (u == '=')
          return i;
        if (u == 0x0A)
          break;
        if (u <= 0x20)
          continue;
        break;
      }
    }
    i += j + 1;
    for (;; i++) {
      unsigned u = ((unsigned)(tagbuffer[i])) & 0xFF;
      if (!u)
        return -1;
      if (u == 0x0A)
        break;
    }
  }
  return -1;
}
```