user: 请将以下的汇编代码转换成C语言代码：

```asm
<__getgrent>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L191:
  movw   $0x0,-0x2a(%rbp)
  movw   $0x100,-0x28(%rbp)
  movswl -0x28(%rbp),%edx
  mov    D173(%rip),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,D172(%rip)
L99:
  movzwl -0x28(%rbp),%eax
  movzwl -0x2a(%rbp),%edx
  sub    %edx,%eax
  movswl %ax,%edx
  mov    D172(%rip),%rcx
  movswq -0x2a(%rbp),%rax
  add    %rax,%rcx
  mov    -0x34(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jg     L127
  mov    $0x0,%eax
  jmp    L58
L127:
  mov    D172(%rip),%rax
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L152
  mov    D172(%rip),%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    D172(%rip),%rsi
  movswl -0x2a(%rbp),%edi
  mov    -0x24(%rbp),%ecx
  add    %edi,%ecx
  movslq %ecx,%rcx
  add    %rcx,%rsi
  sub    %rsi,%rax
  mov    %rax,%rcx
  mov    -0x34(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <lseek@plt>
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    D172(%rip),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L191
  mov    D172(%rip),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L191
  mov    D172(%rip),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L191
  mov    D172(%rip),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L93
  jmp    L191
L152:
  movzwl -0x28(%rbp),%eax
  mov    %ax,-0x2a(%rbp)
  movzwl -0x28(%rbp),%eax
  add    $0x100,%ax
  mov    %ax,-0x28(%rbp)
  movswl -0x28(%rbp),%edx
  mov    D172(%rip),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,D50(%rip)
  jmp    L99
L93:
  nop
  mov    D50(%rip),%rax
  mov    %rax,D50(%rip)
  mov    D50(%rip),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L31
  jmp    L191
L31:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,D177(%rip)
  mov    -0x18(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L165
  jmp    L191
L165:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L143
  jmp    L191
L143:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x0,(%rax)
  lea    -0x20(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %rax,D22(%rip)
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L88
  jmp    L191
L88:
  movw   $0x0,-0x26(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    D225(%rip),%rax
  test   %rax,%rax
  je     L64
  mov    D225(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
L64:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,D218(%rip)
  jmp    L205
L105:
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    D218(%rip),%rdx
  movswq -0x26(%rbp),%rax
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movzwl -0x26(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x26(%rbp)
  movswl -0x26(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  movswl %ax,%edx
  mov    D218(%rip),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,D218(%rip)
L205:
  mov    -0x18(%rbp),%rax
  mov    $0x2c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L105
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L80
  mov    D218(%rip),%rdx
  movswq -0x26(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  jmp    L172
L80:
  mov    D218(%rip),%rdx
  movswq -0x26(%rbp),%rax
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,(%rdx)
  mov    D218(%rip),%rdx
  movswq -0x26(%rbp),%rax
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
L172:
  mov    D218(%rip),%rax
  mov    %rax,D218(%rip)
  lea    D50(%rip),%rax
L58:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L228
  call   <__stack_chk_fail@plt>
L228:
  leave
  ret
```

assistant: ```c
struct group *__getgrent(int grp_fd) {
  static char *line_buff = NULL;
  static char **members = NULL;
  short line_index;
  short buff_size;
  static struct group group;
  char *ptr;
  char *field_begin;
  short member_num;
  char *endptr;
  int line_len;
restart:
  line_index = 0;
  buff_size = 256;
  line_buff = realloc(line_buff, buff_size);
  while (1) {
    if ((line_len = read(grp_fd, line_buff + line_index, buff_size - line_index)) <= 0)
      return NULL;
    field_begin = strchr(line_buff, '\n');
    if (field_begin != NULL) {
      lseek(grp_fd, (long)(1 + field_begin - (line_len + line_index + line_buff)), SEEK_CUR);
      *field_begin = '\0';
      if (*line_buff == '#' || *line_buff == ' ' || *line_buff == '\n' || *line_buff == '\t')
        goto restart;
      break;
    } else {
      line_index = buff_size;
      buff_size += 256;
      line_buff = realloc(line_buff, buff_size);
    }
  }
  group.gr_name = line_buff;
  ptr = strchr(line_buff, ':');
  if (ptr == NULL)
    goto restart;
  *ptr++ = '\0';
  group.gr_passwd = ptr;
  ptr = strchr(ptr, ':');
  if (ptr == NULL)
    goto restart;
  *ptr++ = '\0';
  field_begin = ptr;
  ptr = strchr(ptr, ':');
  if (ptr == NULL)
    goto restart;
  *ptr++ = '\0';
  group.gr_gid = (gid_t)strtoul(field_begin, &endptr, 10);
  if (*endptr != '\0')
    goto restart;
  member_num = 0;
  field_begin = ptr;
  if (members != NULL)
    free(members);
  members = (char **)malloc(1 * sizeof(char *));
  while ((ptr = strchr(ptr, ',')) != NULL) {
    *ptr = '\0';
    ptr++;
    members[member_num] = field_begin;
    field_begin = ptr;
    member_num++;
    members = (char **)realloc((void *)members, (member_num + 1) * sizeof(char *));
  }
  if (*field_begin == '\0')
    members[member_num] = NULL;
  else {
    members[member_num] = field_begin;
    members[member_num + 1] = NULL;
  }
  group.gr_mem = members;
  return &group;
}
```