user: 这段汇编代码用C语言表示是什么样的?

```asm
<test_get_set_gid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <getresgid@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L43
  mov    D6(%rip),%rax
  mov    (%rax),%rdx
  mov    D36(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L43
  mov    $0x1,%eax
  jmp    L193
L43:
  mov    $0x0,%eax
L193:
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getresgid@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jne    L77
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  jne    L77
  mov    -0x10(%rbp),%eax
  test   %eax,%eax
  jne    L77
  mov    $0x1,%eax
  jmp    L148
L77:
  mov    $0x0,%eax
L148:
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x1,-0x18(%rbp)
  movl   $0x2,-0x14(%rbp)
  movl   $0x3,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x18(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <setresgid@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getresgid@plt>
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jne    L145
  mov    -0x14(%rbp),%eax
  cmp    $0x2,%eax
  jne    L145
  mov    -0x10(%rbp),%eax
  cmp    $0x3,%eax
  jne    L145
  mov    $0x1,%eax
  jmp    L47
L145:
  mov    $0x0,%eax
L47:
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <setresuid@plt>
  movl   $0xffffffff,-0x18(%rbp)
  movl   $0x3,-0x14(%rbp)
  movl   $0xffffffff,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x18(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <setresgid@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getresgid@plt>
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jne    L162
  mov    -0x14(%rbp),%eax
  cmp    $0x3,%eax
  jne    L162
  mov    -0x10(%rbp),%eax
  cmp    $0x3,%eax
  jne    L162
  mov    $0x1,%eax
  jmp    L171
L162:
  mov    $0x0,%eax
L171:
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0xffffffff,-0x18(%rbp)
  movl   $0x2,-0x14(%rbp)
  movl   $0xffffffff,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x18(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <setresgid@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L72
  mov    D6(%rip),%rax
  mov    (%rax),%rdx
  mov    D30(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L72
  mov    $0x1,%eax
  jmp    L132
L72:
  mov    $0x0,%eax
L132:
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getresgid@plt>
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jne    L190
  mov    -0x14(%rbp),%eax
  cmp    $0x3,%eax
  jne    L190
  mov    -0x10(%rbp),%eax
  cmp    $0x3,%eax
  jne    L190
  mov    $0x1,%eax
  jmp    L187
L190:
  mov    $0x0,%eax
L187:
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
int test_get_set_gid(void) {
  gid_t rgid, egid, sgid;
  int error;
  error = getresgid((void *)1, (void *)1, (void *)1);
  assert(error < 0 && errno == EFAULT);
  error = getresgid(&rgid, &egid, &sgid);
  assert(error == 0);
  assert(rgid == 0 && egid == 0 && sgid == 0);
  rgid = 1, egid = 2, sgid = 3;
  error = setresgid(rgid, egid, sgid);
  assert(error == 0);
  getresgid(&rgid, &egid, &sgid);
  assert(rgid == 1 && egid == 2 && sgid == 3);
  setresuid(1, 1, 1);
  rgid = -1, egid = 3, sgid = -1;
  error = setresgid(rgid, egid, sgid);
  assert(error == 0);
  getresgid(&rgid, &egid, &sgid);
  assert(rgid == 1 && egid == 3 && sgid == 3);
  rgid = -1, egid = 2, sgid = -1;
  error = setresgid(rgid, egid, sgid);
  assert(error < 0 && errno == EPERM);
  getresgid(&rgid, &egid, &sgid);
  assert(rgid == 1 && egid == 3 && sgid == 3);
  return 0;
}
```