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

```asm
<test_get_set_gid>:
  endbr64
  push   %r13
  mov    $0x1,%edi
  mov    $0x1,%edx
  mov    $0x1,%esi
  push   %r12
  push   %rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <getresgid@plt>
  xor    %edi,%edi
  test   %eax,%eax
  jns    L80
  mov    D21(%rip),%rdx
  mov    D31(%rip),%rax
  xor    %edi,%edi
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  sete   %dil
L80:
  call   <assert@plt>
  lea    0x14(%rsp),%r13
  lea    0x10(%rsp),%r12
  lea    0xc(%rsp),%rbp
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <getresgid@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  mov    0xc(%rsp),%eax
  xor    %edi,%edi
  or     0x10(%rsp),%eax
  or     0x14(%rsp),%eax
  sete   %dil
  call   <assert@plt>
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  movl   $0x1,0xc(%rsp)
  movl   $0x2,0x10(%rsp)
  movl   $0x3,0x14(%rsp)
  call   <setresgid@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  mov    %rbp,%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <getresgid@plt>
  xor    %edi,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L8
L10:
  call   <assert@plt>
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <setresuid@plt>
  mov    $0xffffffff,%edx
  mov    $0x3,%esi
  mov    $0xffffffff,%edi
  movl   $0xffffffff,0xc(%rsp)
  movl   $0x3,0x10(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  call   <setresgid@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  call   <assert@plt>
  mov    %rbp,%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <getresgid@plt>
  xor    %edi,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L31
L77:
  call   <assert@plt>
  mov    $0xffffffff,%edi
  mov    $0xffffffff,%edx
  mov    $0x2,%esi
  movl   $0xffffffff,0xc(%rsp)
  movl   $0x2,0x10(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  call   <setresgid@plt>
  xor    %edi,%edi
  test   %eax,%eax
  jns    L88
  mov    D21(%rip),%rdx
  mov    D39(%rip),%rax
  xor    %edi,%edi
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  sete   %dil
L88:
  call   <assert@plt>
  mov    %rbp,%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <getresgid@plt>
  xor    %edi,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L68
L93:
  call   <assert@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L91
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L31:
  cmpl   $0x3,0x10(%rsp)
  jne    L77
  xor    %edi,%edi
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  jmp    L77
  nopl   0x0(%rax,%rax,1)
L8:
  cmpl   $0x2,0x10(%rsp)
  jne    L10
  xor    %edi,%edi
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  jmp    L10
  nopl   0x0(%rax,%rax,1)
L68:
  cmpl   $0x3,0x10(%rsp)
  jne    L93
  xor    %edi,%edi
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  jmp    L93
L91:
  call   <__stack_chk_fail@plt>
```

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;
}
```