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

```asm
<pretty>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdi,%rdi
  je     L23
  mov    %rdi,%rbx
  mov    (%rdi),%rsi
  lea    D20(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D108(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <group@plt>
L77:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L23:
  mov    $0x0,%eax
  call   <getlogin@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L120
L115:
  mov    $0x0,%eax
  call   <getuid@plt>
  mov    %eax,%r12d
  mov    %eax,%edi
  call   <getpwuid@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L144
  mov    (%rax),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L133
L62:
  mov    (%rbx),%rsi
  lea    D20(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L47:
  mov    $0x0,%eax
  call   <geteuid@plt>
  mov    %eax,%ebx
  cmp    %eax,%r12d
  jne    L2
L11:
  mov    $0x0,%eax
  call   <getgid@plt>
  mov    %eax,%ebx
  mov    $0x0,%eax
  call   <getegid@plt>
  cmp    %eax,%ebx
  jne    L126
L139:
  lea    D108(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%esi
  mov    $0x0,%edi
  call   <group@plt>
  jmp    L77
L120:
  lea    D10(%rip),%rsi
  mov    $0x1,%edi
  call   <err@plt>
  jmp    L115
L2:
  mov    %eax,%edi
  call   <getpwuid@plt>
  test   %rax,%rax
  je     L86
  mov    (%rax),%rsi
  lea    D75(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L11
L86:
  mov    %ebx,%esi
  lea    D25(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L11
L126:
  mov    %ebx,%edi
  call   <getgrgid@plt>
  test   %rax,%rax
  je     L71
  mov    (%rax),%rsi
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L139
L71:
  mov    %ebx,%esi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L139
L133:
  mov    %rbp,%rsi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L62
L144:
  mov    %rbp,%rsi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12d,%esi
  lea    D80(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L47
```

tool_calls: name: unpack_data
arguments: tag: D20
type_infered: string
name: unpack_data
arguments: tag: D108
type_infered: string
name: unpack_data
arguments: tag: D10
type_infered: string
name: unpack_data
arguments: tag: D75
type_infered: string
name: unpack_data
arguments: tag: D25
type_infered: string
name: unpack_data
arguments: tag: D73
type_infered: string
name: unpack_data
arguments: tag: D0
type_infered: string
name: unpack_data
arguments: tag: D22
type_infered: string
name: unpack_data
arguments: tag: D80
type_infered: string

tool: D20: uid	%s


tool: D108: groups	

tool: D10: getlogin

tool: D75: euid	%s


tool: D25: euid	%u


tool: D73: rgid	%s


tool: D0: rgid	%u


tool: D22: login	%s


tool: D80: uid	%u


assistant: ```c
void pretty(struct passwd *pw) {
  struct group *gr;
  u_int eid, rid;
  char *login;
  if (pw) {
    (void)printf("uid\t%s\n", pw->pw_name);
    (void)printf("groups\t");
    group(pw, 1);
  } else {
    if ((login = getlogin()) == NULL)
      err(1, "getlogin");
    pw = getpwuid(rid = getuid());
    if (pw == NULL || strcmp(login, pw->pw_name))
      (void)printf("login\t%s\n", login);
    if (pw)
      (void)printf("uid\t%s\n", pw->pw_name);
    else
      (void)printf("uid\t%u\n", rid);
    if ((eid = geteuid()) != rid) {
      if ((pw = getpwuid(eid)) != NULL)
        (void)printf("euid\t%s\n", pw->pw_name);
      else
        (void)printf("euid\t%u\n", eid);
    }
    if ((rid = getgid()) != (eid = getegid())) {
      if ((gr = getgrgid(rid)) != NULL)
        (void)printf("rgid\t%s\n", gr->gr_name);
      else
        (void)printf("rgid\t%u\n", rid);
    }
    (void)printf("groups\t");
    group(NULL, 1);
  }
}
```