user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<parsepasswd>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x28(%rsp)
  movq   $0x0,0x20(%rsp)
  movaps %xmm0,0x10(%rsp)
  call   <strlen@plt>
  lea    0x1(%rax),%ebx
  mov    %ebx,0x2c(%rsp)
  cmp    %r14d,%ebx
  jg     L38
  mov    %r14d,%r15d
  mov    %r12,%rdx
  mov    $0x1,%ecx
  xor    %eax,%eax
  test   %ebx,%ebx
  jle    L57
  xchg   %ax,%ax
L107:
  add    $0x1,%eax
  cmpb   $0x3a,(%rdx)
  je     L14
  add    $0x1,%rdx
  cmp    %eax,%ebx
  jg     L107
  cmp    $0x7,%ecx
  je     L37
L57:
  mov    D4(%rip),%rax
  mov    (%rax),%eax
L85:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L14:
  mov    %eax,0x10(%rsp,%rcx,4)
  mov    0x2c(%rsp),%ebx
  lea    0x1(%rcx),%esi
  add    $0x1,%rdx
  cmp    %eax,%ebx
  jle    L69
  movslq %esi,%rcx
  jmp    L107
  nopl   0x0(%rax)
L37:
  mov    %r15d,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  call   <memset@plt>
  mov    0x1c(%rsp),%ecx
  movslq 0x18(%rsp),%rsi
  mov    %rbp,%rdi
  mov    %ecx,%r8d
  mov    %rsi,%r14
  mov    %ecx,0xc(%rsp)
  sub    %esi,%r8d
  add    %r12,%rsi
  lea    -0x1(%r8),%edx
  mov    %r8d,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%r8
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%r8,1)
  call   <atoi@plt>
  mov    %r15d,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  mov    %rax,0x30(%r13)
  call   <memset@plt>
  mov    0x20(%rsp),%r15d
  movslq 0xc(%rsp),%rcx
  mov    %rbp,%rdi
  mov    %r15d,%r8d
  lea    (%r12,%rcx,1),%rsi
  sub    %ecx,%r8d
  lea    -0x1(%r8),%edx
  mov    %r8d,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%r8
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%r8,1)
  call   <atoi@plt>
  mov    %ebx,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  mov    %rax,0x28(%r13)
  call   <memset@plt>
  mov    0x14(%rsp),%ecx
  mov    %rbp,0x0(%r13)
  mov    %rbp,%rdi
  mov    %r12,%rsi
  lea    -0x1(%rcx),%edx
  mov    %ecx,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%rsi
  add    %rsi,%rbp
  sub    %esi,%r14d
  add    %r12,%rsi
  movb   $0x0,0x0(%rbp)
  lea    -0x1(%r14),%edx
  mov    %rbp,%rdi
  movslq %r14d,%r14
  mov    %rbp,0x8(%r13)
  add    %r14,%rbp
  call   <memcpy@plt>
  mov    0x24(%rsp),%r14d
  movslq %r15d,%rsi
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp)
  add    %r12,%rsi
  mov    %rbp,0x10(%r13)
  mov    %r14d,%ecx
  sub    %r15d,%ecx
  lea    -0x1(%rcx),%edx
  mov    %ecx,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%rcx
  movslq 0x28(%rsp),%r15
  movslq %r14d,%rsi
  add    %r12,%rsi
  add    %rcx,%rbp
  mov    %r15d,%ecx
  sub    %r15d,%ebx
  movb   $0x0,0x0(%rbp)
  sub    %r14d,%ecx
  mov    %rbp,%rdi
  mov    %rbp,0x18(%r13)
  lea    -0x1(%rcx),%edx
  mov    %ecx,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%rcx
  lea    -0x1(%rbx),%edx
  lea    (%r12,%r15,1),%rsi
  movslq %ebx,%rbx
  add    %rcx,%rbp
  movb   $0x0,0x0(%rbp)
  mov    %rbp,%rdi
  mov    %rbp,0x20(%r13)
  call   <memcpy@plt>
  movb   $0x0,0x0(%rbp,%rbx,1)
  xor    %eax,%eax
  jmp    L85
  cs nopw 0x0(%rax,%rax,1)
L38:
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  jmp    L85
  xchg   %ax,%ax
L69:
  mov    %esi,%ecx
  cmp    $0x7,%ecx
  jne    L57
  jmp    L37
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parsepasswd(char *str, struct passwd *result, char *buffer, size_t buflen) {
  int fields[7 + 1] = {0};
  fields[7] = strlen(str) + 1;
  if (fields[7] > (int)buflen) {
    return ERANGE;
  }
  int i, field;
  for (field = 1, i = 0; i < fields[7]; i++) {
    if (str[i] == ':') {
      fields[field++] = i + 1;
    }
  }
  if (field != 7) {
    return ENOENT;
  }
  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->pw_uid = atoi(buffer);
  } while (0);
  do {
    memset(buffer, 0, buflen);
    memcpy(buffer, &str[fields[3]], ((fields[3 + 1] - fields[3]) - 1));
    buffer[((fields[3 + 1] - fields[3]) - 1) + 1] = '\0';
    result->pw_gid = atoi(buffer);
  } while (0);
  memset(buffer, 0, fields[7]);
  do {
    result->pw_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->pw_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);
  do {
    result->pw_gecos = buffer;
    memcpy(buffer, &str[fields[4]], ((fields[4 + 1] - fields[4]) - 1));
    buffer[((fields[4 + 1] - fields[4]) - 1) + 1] = '\0';
    buffer += ((fields[4 + 1] - fields[4]) - 1) + 1;
  } while (0);
  do {
    result->pw_dir = buffer;
    memcpy(buffer, &str[fields[5]], ((fields[5 + 1] - fields[5]) - 1));
    buffer[((fields[5 + 1] - fields[5]) - 1) + 1] = '\0';
    buffer += ((fields[5 + 1] - fields[5]) - 1) + 1;
  } while (0);
  do {
    result->pw_shell = buffer;
    memcpy(buffer, &str[fields[6]], ((fields[6 + 1] - fields[6]) - 1));
    buffer[((fields[6 + 1] - fields[6]) - 1) + 1] = '\0';
    buffer += ((fields[6 + 1] - fields[6]) - 1) + 1;
  } while (0);
  return 0;
}
```