user: Demonstrate the C code that generates the assembly output below:

```asm
<parsepasswd>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%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>
  add    $0x1,%eax
  mov    %eax,0x2c(%rsp)
  cmp    %ebx,%eax
  jg     L26
  mov    %ebx,%r14d
  mov    %r12,%rcx
  mov    $0x1,%esi
  xor    %edx,%edx
  test   %eax,%eax
  jle    L52
  nopl   (%rax)
L45:
  add    $0x1,%edx
  cmpb   $0x3a,(%rcx)
  jne    L62
  movslq %esi,%rax
  add    $0x1,%esi
  mov    %edx,0x10(%rsp,%rax,4)
L62:
  mov    0x2c(%rsp),%ebx
  add    $0x1,%rcx
  cmp    %edx,%ebx
  jg     L45
  cmp    $0x7,%esi
  je     L53
L52:
  mov    D7(%rip),%rax
  mov    (%rax),%eax
L3:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L76
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L53:
  mov    %r14d,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  call   <memset@plt>
  mov    0x1c(%rsp),%r8d
  movslq 0x18(%rsp),%rsi
  mov    %rbp,%rdi
  mov    %r8d,%ecx
  mov    %rsi,%r15
  mov    %r8d,0xc(%rsp)
  sub    %esi,%ecx
  add    %r12,%rsi
  lea    -0x1(%rcx),%edx
  mov    %ecx,0x8(%rsp)
  call   <memcpy@plt>
  movslq 0x8(%rsp),%rcx
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp,%rcx,1)
  call   <atoi@plt>
  mov    %r14d,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  mov    %rax,0x30(%r13)
  call   <memset@plt>
  mov    0x20(%rsp),%ecx
  movslq 0xc(%rsp),%rsi
  mov    %rbp,%rdi
  mov    %ecx,%r14d
  mov    %ecx,0x8(%rsp)
  sub    %esi,%r14d
  add    %r12,%rsi
  lea    -0x1(%r14),%edx
  movslq %r14d,%r14
  call   <memcpy@plt>
  movb   $0x0,0x0(%rbp,%r14,1)
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %ebx,%edx
  mov    %rbp,%rdi
  xor    %esi,%esi
  mov    %rax,0x28(%r13)
  call   <memset@plt>
  mov    0x14(%rsp),%r14d
  mov    %rbp,%rdi
  mov    %r12,%rsi
  mov    %rbp,0x0(%r13)
  lea    -0x1(%r14),%edx
  sub    %r14d,%r15d
  call   <memcpy@plt>
  movslq %r14d,%rsi
  lea    -0x1(%r15),%edx
  movslq %r15d,%r15
  add    %rsi,%rbp
  add    %r12,%rsi
  movb   $0x0,0x0(%rbp)
  mov    %rbp,%rdi
  mov    %rbp,0x8(%r13)
  add    %r15,%rbp
  call   <memcpy@plt>
  mov    0x24(%rsp),%r14d
  movslq 0x8(%rsp),%rcx
  mov    %rbp,%rdi
  movb   $0x0,0x0(%rbp)
  mov    %r14d,%r15d
  mov    %rbp,0x10(%r13)
  lea    (%r12,%rcx,1),%rsi
  sub    %ecx,%r15d
  lea    -0x1(%r15),%edx
  movslq %r15d,%r15
  call   <memcpy@plt>
  add    %r15,%rbp
  movslq 0x28(%rsp),%r15
  movslq %r14d,%rsi
  movb   $0x0,0x0(%rbp)
  mov    %rbp,%rdi
  add    %r12,%rsi
  mov    %rbp,0x18(%r13)
  mov    %r15d,%ecx
  sub    %r15d,%ebx
  sub    %r14d,%ecx
  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    L3
  nopl   0x0(%rax)
L26:
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  jmp    L3
L76:
  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;
}
```