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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  cmpl   $0x1,-0x14(%rbp)
  jg     L23
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L23:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <getpwnam@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L42
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L42:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,%rsi
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x20(%rax),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x28(%rax),%eax
  mov    %eax,%esi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    0x2c(%rax),%eax
  mov    %eax,%esi
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D90(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L1
L38:
  mov    -0x10(%rbp),%rax
  mov    0x2c(%rax),%edi
  mov    -0x10(%rbp),%rax
  mov    0x28(%rax),%esi
  mov    -0x10(%rbp),%rax
  mov    0x20(%rax),%rcx
  mov    -0x10(%rbp),%rax
  mov    0x18(%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %rax,%rsi
  lea    D84(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L1:
  mov    $0x0,%eax
  call   <getpwent@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L38
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L46
L59:
  mov    -0x8(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L46:
  mov    $0x0,%eax
  call   <getspent@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L59
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D19
type: string
name: read_data
arguments: data_tag: D26
type: string
name: read_data
arguments: data_tag: D106
type: string
name: read_data
arguments: data_tag: D52
type: string
name: read_data
arguments: data_tag: D7
type: string
name: read_data
arguments: data_tag: D101
type: string
name: read_data
arguments: data_tag: D8
type: string
name: read_data
arguments: data_tag: D116
type: string
name: read_data
arguments: data_tag: D75
type: string
name: read_data
arguments: data_tag: D90
type: string
name: read_data
arguments: data_tag: D84
type: string
name: read_data
arguments: data_tag: D86
type: string
name: read_data
arguments: data_tag: D31
type: string

tool: D19: Usage: %s username


tool: D26: get user information error

tool: D106: pw_name: %s


tool: D52: pw_passwd: %s


tool: D7: pw_gecos: %s


tool: D101: pw_dir: %s


tool: D8: pw_shell: %s


tool: D116: pw_uid: %d


tool: D75: pw_gid: %d


tool: D90: ===================================

tool: D84: %20s : %32s : %32s : %6d : %6d


tool: D86: shadow===================================

tool: D31: [%s] : [%s]


assistant: ```c
int main(int argc, char *argv[]) {
  struct passwd *pwd;
  struct spwd *spw;
  if (argc < 2) {
    printf("Usage: %s username\n", argv[0]);
    exit(1);
  }
  pwd = getpwnam(argv[1]);
  if (pwd == NULL) {
    perror("get user information error");
    exit(1);
  }
  printf("pw_name: %s\n", pwd->pw_name);
  printf("pw_passwd: %s\n", pwd->pw_passwd);
  printf("pw_gecos: %s\n", pwd->pw_gecos);
  printf("pw_dir: %s\n", pwd->pw_dir);
  printf("pw_shell: %s\n", pwd->pw_shell);
  printf("pw_uid: %d\n", pwd->pw_uid);
  printf("pw_gid: %d\n", pwd->pw_gid);
  printf("===================================\n");
  while ((pwd = getpwent()) != NULL) {
    printf("%20s : %32s : %32s : %6d : %6d\n", pwd->pw_name, pwd->pw_dir, pwd->pw_shell, pwd->pw_uid, pwd->pw_gid);
  }
  printf("shadow===================================\n");
  while ((spw = getspent()) != NULL) {
    printf("[%s] : [%s]\n", spw->sp_namp, spw->sp_pwdp);
  }
  return 0;
}
```