user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<parse_gquad>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%ecx
  cmp    $0x2b,%cl
  je     L20
  test   %cl,%cl
  je     L20
  mov    $0x1,%eax
  nopl   0x0(%rax)
L215:
  movzbl (%r14,%rax,1),%ecx
  mov    %eax,%r13d
  add    $0x1,%rax
  test   %cl,%cl
  je     L115
  cmp    $0x2b,%cl
  jne    L215
L18:
  lea    0x1(%r13),%ebx
  xor    %r12d,%r12d
  movslq %ebx,%rax
  add    %r14,%rax
  cmpb   $0x2b,(%rax)
  jne    L30
L156:
  test   %r12,%r12
  je     L170
  mov    (%r15),%r8d
  mov    %ebx,%esi
  add    %r13d,%r8d
  jmp    L122
  cs nopw 0x0(%rax,%rax,1)
L173:
  add    $0x1,%rax
  add    $0x1,%ebx
  cmpb   $0x2b,(%rax)
  jne    L110
  mov    %ebx,%esi
L122:
  lea    -0x1(%rbx),%edi
  cmp    %ebx,%r8d
  jne    L173
L143:
  cmp    $0x3,%r12
  je     L165
L116:
  mov    %r8d,%r13d
  mov    %edi,%esi
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L170:
  add    $0x1,%rax
  mov    %ebx,%esi
  add    $0x1,%ebx
  cmpb   $0x2b,(%rax)
  je     L170
L110:
  mov    %ebx,%eax
  sub    %r13d,%eax
  test   %r12,%r12
  jne    L149
L76:
  mov    %eax,(%r15)
  mov    %ebx,%r13d
L142:
  movslq %r13d,%rax
  lea    0x1(%r14,%rax,1),%rax
  cs nopw 0x0(%rax,%rax,1)
L186:
  mov    %rax,%r8
  add    $0x1,%rax
  mov    %r13d,%edi
  add    $0x1,%r13d
  cmpb   $0x2e,-0x1(%rax)
  je     L186
  sub    %esi,%edi
  mov    %edi,0x0(%rbp,%r12,4)
  cmpb   $0x2b,(%r8)
  je     L184
  lea    D19(%rip),%rdi
  call   <nrerror@plt>
L184:
  lea    0x1(%r13),%ebx
  add    $0x1,%r12
  movslq %ebx,%rax
  add    %r14,%rax
  cmpb   $0x2b,(%rax)
  je     L156
L30:
  mov    %r13d,%esi
  mov    $0x1,%eax
  test   %r12,%r12
  je     L76
  nopl   0x0(%rax)
L149:
  cmp    %eax,(%r15)
  je     L54
  lea    D7(%rip),%rdi
  mov    %esi,0xc(%rsp)
  call   <nrerror@plt>
  mov    0xc(%rsp),%edi
  mov    %ebx,%r8d
  cmp    $0x3,%r12
  jne    L116
L165:
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  xor    %r13d,%r13d
  nopl   0x0(%rax,%rax,1)
L115:
  cmp    $0x2b,%cl
  je     L18
  xor    %r8d,%r8d
  jmp    L165
L54:
  mov    %ebx,%r8d
  mov    %esi,%edi
  jmp    L143
```

tool_calls: name: read_data
arguments: label: D19
data_type: string
name: read_data
arguments: label: D7
data_type: string

tool: D19: illegal character in gquad linker region

tool: D7: unequal stack lengths in gquad

assistant: ```c
int parse_gquad(const char *struc, int *L, int l[3]) {
  int i, il, start, end, len;
  for (i = 0; struc[i] && struc[i] != '+'; i++)
    ;
  if (struc[i] == '+') {
    for (il = 0; il <= 3; il++) {
      start = i;
      while (struc[++i] == '+') {
        if ((il) && (i - start == *L))
          break;
      }
      end = i;
      len = end - start;
      if (il == 0)
        *L = len;
      else if (len != *L)
        nrerror("unequal stack lengths in gquad");
      if (il == 3)
        break;
      while (struc[++i] == '.')
        ;
      l[il] = i - end;
      if (struc[i] != '+')
        nrerror("illegal character in gquad linker region");
    }
  } else
    return 0;
  return end;
}
```