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

```asm
<find_next_kv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  lea    D28(%rip),%rdx
  push   %r12
  mov    %r8,%r12
  mov    $0x1,%r8d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  mov    %rcx,(%rsp)
  mov    $0x4,%ecx
  mov    %r9,0x8(%rsp)
  call   <ignore_chs@plt>
  test   %rax,%rax
  je     L1
  mov    %rax,%r14
  mov    0x50(%rsp),%rax
  mov    %ebx,%edx
  mov    $0x3d,%esi
  mov    %r14,%rdi
  movq   $0x0,(%rax)
  mov    %r14,%rax
  mov    %r14,0x0(%r13)
  sub    %rbp,%rax
  sub    %eax,%edx
  call   <memchr@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L1
  movb   $0x0,(%rax)
  lea    D39(%rip),%r15
  mov    %eax,%esi
  mov    %r14,%rdi
  sub    %r14d,%esi
  mov    $0x4,%ecx
  mov    %r15,%rdx
  call   <find_delim@plt>
  test   %rax,%rax
  je     L13
  movb   $0x0,(%rax)
L13:
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    (%rsp),%rcx
  lea    0x1(%r13),%rdi
  mov    %ebx,%esi
  mov    $0x1,%r8d
  mov    %r15,%rdx
  mov    %eax,(%rcx)
  mov    %rdi,%rax
  mov    $0x4,%ecx
  sub    %rbp,%rax
  sub    %eax,%esi
  call   <ignore_chs@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L1
  cmpb   $0x22,(%rax)
  je     L29
  mov    %rax,(%r12)
  mov    %ebx,%esi
  sub    %rbp,%rax
  mov    $0x5,%ecx
  sub    %eax,%esi
  lea    D0(%rip),%rdx
  mov    %r13,%rdi
  call   <find_delim@plt>
  test   %rax,%rax
  je     L21
L57:
  mov    0x8(%rsp),%rcx
  mov    %rax,%rdx
  add    $0x1,%rax
  sub    %r13,%rdx
  mov    %edx,(%rcx)
  mov    0x50(%rsp),%rcx
  mov    %rax,(%rcx)
  sub    %rbp,%rax
  sub    %eax,%ebx
  mov    0x58(%rsp),%rax
  mov    %ebx,(%rax)
  xor    %eax,%eax
L34:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L29:
  add    $0x1,%r13
  mov    %ebx,%esi
  mov    $0x3,%ecx
  mov    %r13,%rax
  mov    %r13,(%r12)
  lea    D17(%rip),%rdx
  mov    %r13,%rdi
  sub    %rbp,%rax
  sub    %eax,%esi
  call   <find_delim@plt>
  test   %rax,%rax
  jne    L57
L21:
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    0x8(%rsp),%rbx
  mov    %eax,(%rbx)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L1:
  mov    $0xffffffff,%eax
  jmp    L34
```

tool_calls: name: read_data
arguments: label: D28
type: string
name: read_data
arguments: label: D39
type: string
name: read_data
arguments: label: D0
type: string
name: read_data
arguments: label: D17
type: string

tool: D28: ;	 


tool: D39: 	 


tool: D0: 	 ;


tool: D17: "


assistant: ```c
int find_next_kv(char *buf, int len, char **key, int *key_len, char **value, int *value_len, char **nbuf, int *nlen) {
  char *p = buf, *p1, *p2, *pe, *pn = 0;
  int find;
  p = ignore_chs(p, len, ";\t \r\n", 4, 1);
  if (!p) {
    return -1;
  }
  *nbuf = 0;
  *key = p;
  pe = memchr(p, '=', len - (p - buf));
  if (!pe) {
    return -1;
  }
  *pe = 0;
  p1 = find_delim(p, pe - p, "\t \r\n", 4);
  if (p1) {
    *p1 = 0;
  }
  *key_len = strlen(p);
  p = pe + 1;
  p = ignore_chs(p, len - (p - buf), "\t \r\n", 4, 1);
  if (!p) {
    return -1;
  }
  find = 0;
  if (*p == '"') {
    p++;
    find = 1;
  }
  *value = p;
  if (find) {
    p2 = find_delim(p, len - (p - buf), "\"\r\n", 3);
  } else {
    p2 = find_delim(p, len - (p - buf), "\t ;\r\n", 5);
  }
  if (p2) {
    *value_len = p2 - p;
    pn = p2 + 1;
  } else {
    *value_len = strlen(p);
  }
  if (pn) {
    *nbuf = pn;
    *nlen = len - (pn - buf);
  }
  return 0;
}
```