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

```asm
<parsegroup>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  mov    $0x32,%ecx
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x1f8,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x50(%rsp),%rbp
  mov    %rbp,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x1e8(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x30(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    %r14,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,0x40(%rsp)
  cmp    %r12d,%eax
  jg     L16
  mov    %r12d,%r8d
  mov    %r14,%rcx
  mov    $0x1,%edi
  xor    %edx,%edx
  test   %eax,%eax
  jle    L45
  nopl   0x0(%rax)
L36:
  add    $0x1,%edx
  cmpb   $0x3a,(%rcx)
  jne    L34
  movslq %edi,%rax
  add    $0x1,%edi
  mov    %edx,0x30(%rsp,%rax,4)
L34:
  mov    0x40(%rsp),%r13d
  add    $0x1,%rcx
  cmp    %edx,%r13d
  jg     L36
  cmp    $0x4,%edi
  jne    L45
  mov    0x3c(%rsp),%r15d
  cmp    %r15d,%r13d
  jle    L75
  lea    -0x1(%r13),%edx
  movslq %r15d,%rcx
  lea    0x1(%r15),%eax
  sub    %r15d,%edx
  cltq
  lea    0x2(%rdx,%rcx,1),%rdx
  mov    $0x1,%ecx
  nopl   0x0(%rax)
L123:
  cmpb   $0x2c,-0x1(%r14,%rax,1)
  jne    L60
  movslq %ecx,%rdi
  add    $0x1,%ecx
  mov    %eax,0x50(%rsp,%rdi,4)
L60:
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L123
  lea    0x1(%rcx),%edi
  movslq %edi,%rdi
  lea    0x0(,%rdi,8),%r9
L24:
  movslq %ecx,%rax
  mov    %r13d,0x50(%rsp,%rax,4)
  movslq %r13d,%rax
  add    %r9,%rax
  cmp    %r12,%rax
  jbe    L99
L16:
  mov    D3(%rip),%rax
  mov    (%rax),%eax
L124:
  mov    0x1e8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L66
  add    $0x1f8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L45:
  mov    D10(%rip),%rax
  mov    (%rax),%eax
  jmp    L124
  nopl   0x0(%rax,%rax,1)
L99:
  mov    %r8d,%edx
  mov    %rbx,%rdi
  xor    %esi,%esi
  mov    %r9,0x28(%rsp)
  mov    %ecx,0x24(%rsp)
  call   <memset@plt>
  movslq 0x38(%rsp),%rsi
  mov    %r15d,%r10d
  mov    %rbx,%rdi
  sub    %esi,%r10d
  mov    %esi,0x10(%rsp)
  add    %r14,%rsi
  lea    -0x1(%r10),%edx
  mov    %r10d,0x18(%rsp)
  call   <memcpy@plt>
  movslq 0x18(%rsp),%r10
  mov    %rbx,%rdi
  movb   $0x0,(%rbx,%r10,1)
  call   <atoi@plt>
  mov    0x8(%rsp),%r12
  mov    %r13d,%edx
  mov    %rbx,%rdi
  xor    %esi,%esi
  mov    %eax,0x18(%r12)
  call   <memset@plt>
  mov    0x34(%rsp),%r10d
  mov    %rbx,%rdi
  mov    %r14,%rsi
  mov    %rbx,(%r12)
  lea    -0x1(%r10),%edx
  mov    %r10d,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%rsi
  mov    0x10(%rsp),%r8d
  add    %rsi,%rbx
  sub    %esi,%r8d
  add    %r14,%rsi
  movb   $0x0,(%rbx)
  mov    %r8d,%r13d
  lea    -0x1(%r8),%edx
  mov    %rbx,%rdi
  mov    %rbx,0x8(%r12)
  call   <memcpy@plt>
  movslq %r13d,%r8
  mov    0x28(%rsp),%r9
  mov    0x24(%rsp),%ecx
  lea    (%rbx,%r8,1),%rax
  mov    $0x1,%r13d
  movb   $0x0,(%rax)
  mov    %rax,0x10(%rsp)
  mov    %rax,0x10(%r12)
  lea    (%rax,%r9,1),%r12
  lea    -0x1(%rcx),%eax
  add    $0x2,%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L18:
  movslq %r15d,%rsi
  mov    0x0(%rbp,%r13,4),%r15d
  mov    %r12,%rdi
  mov    %ecx,0x8(%rsp)
  mov    %r15d,%ebx
  sub    %esi,%ebx
  add    %r14,%rsi
  lea    -0x1(%rbx),%edx
  call   <memcpy@plt>
  movslq %ebx,%r8
  mov    0x10(%rsp),%rbx
  mov    %r12,%rax
  add    %r8,%r12
  mov    0x8(%rsp),%ecx
  movb   $0x0,(%r12)
  mov    %rax,-0x8(%rbx,%r13,8)
  add    $0x1,%r13
  cmp    %r13,0x18(%rsp)
  jne    L18
  movq   $0x0,(%rbx,%rcx,8)
  xor    %eax,%eax
  jmp    L124
L75:
  mov    $0x10,%r9d
  mov    $0x1,%ecx
  jmp    L24
L66:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parsegroup(char *str, struct group *result, char *buffer, size_t buflen) {
  int fields[4 + 1] = {0};
  int members[100] = {0};
  int i, field, len;
  char **bufp;
  fields[4] = strlen(str) + 1;
  if (fields[4] > (int)buflen) {
    return ERANGE;
  }
  for (field = 1, i = 0; i < fields[4]; i++) {
    if (str[i] == ':') {
      fields[field++] = i + 1;
    }
  }
  if (field != 4) {
    return ENOENT;
  }
  members[0] = fields[3];
  for (field = 1, i = fields[3]; i < fields[4]; i++) {
    if (str[i] == ',') {
      members[field++] = i + 1;
    }
  }
  members[field] = fields[4];
  if ((fields[4] + ((field + 1) * sizeof(char *))) > buflen) {
    return ERANGE;
  }
  do {
    memset(buffer, 0, buflen);
    memcpy(buffer, &str[fields[2]], ((fields[2 + 1] - fields[2]) - 1));
    buffer[((fields[2 + 1] - fields[2]) - 1) + 1] = '\0';
    result->gr_gid = atoi(buffer);
  } while (0);
  memset(buffer, 0, fields[4]);
  do {
    result->gr_name = buffer;
    memcpy(buffer, &str[fields[0]], ((fields[0 + 1] - fields[0]) - 1));
    buffer[((fields[0 + 1] - fields[0]) - 1) + 1] = '\0';
    buffer += ((fields[0 + 1] - fields[0]) - 1) + 1;
  } while (0);
  do {
    result->gr_passwd = buffer;
    memcpy(buffer, &str[fields[1]], ((fields[1 + 1] - fields[1]) - 1));
    buffer[((fields[1 + 1] - fields[1]) - 1) + 1] = '\0';
    buffer += ((fields[1 + 1] - fields[1]) - 1) + 1;
  } while (0);
  result->gr_mem = bufp = (char **)buffer;
  buffer += (sizeof(char *) * (field + 1));
  for (i = 0; i < field; i++) {
    len = ((members[i + 1] - members[i]) - 1);
    memcpy(buffer, &str[members[i]], len);
    buffer[len + 1] = '\0';
    *(bufp++) = buffer;
    buffer += len + 1;
  }
  *bufp = NULL;
  return 0;
}
```