user: 下面的汇编指令对应的C源代码是什么:

```asm
<test_get_set_gid>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <getresgid@plt>
  mov    $0x0,%edi
  test   %eax,%eax
  js     L3
L110:
  call   <assert@plt>
  lea    0x14(%rsp),%r12
  lea    0x10(%rsp),%rbp
  lea    0xc(%rsp),%rbx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <getresgid@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0xc(%rsp),%eax
  or     0x10(%rsp),%eax
  or     0x14(%rsp),%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movl   $0x1,0xc(%rsp)
  movl   $0x2,0x10(%rsp)
  movl   $0x3,0x14(%rsp)
  mov    $0x3,%edx
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <setresgid@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <getresgid@plt>
  mov    $0x0,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L63
L30:
  call   <assert@plt>
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    $0x1,%edi
  call   <setresuid@plt>
  movl   $0xffffffff,0xc(%rsp)
  movl   $0x3,0x10(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  mov    $0xffffffff,%edx
  mov    $0x3,%esi
  mov    $0xffffffff,%edi
  call   <setresgid@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  call   <getresgid@plt>
  mov    $0x0,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L24
L122:
  call   <assert@plt>
  movl   $0xffffffff,0xc(%rsp)
  movl   $0x2,0x10(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  mov    $0xffffffff,%edx
  mov    $0x2,%esi
  mov    $0xffffffff,%edi
  call   <setresgid@plt>
  mov    $0x0,%edi
  test   %eax,%eax
  js     L127
L34:
  call   <assert@plt>
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  call   <getresgid@plt>
  mov    $0x0,%edi
  cmpl   $0x1,0xc(%rsp)
  je     L118
L77:
  call   <assert@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L3:
  mov    D1(%rip),%rdx
  mov    D36(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  sete   %dil
  movzbl %dil,%edi
  jmp    L110
L63:
  cmpl   $0x2,0x10(%rsp)
  jne    L30
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  movzbl %dil,%edi
  jmp    L30
L24:
  cmpl   $0x3,0x10(%rsp)
  jne    L122
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  movzbl %dil,%edi
  jmp    L122
L127:
  mov    D1(%rip),%rdx
  mov    D26(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  sete   %dil
  movzbl %dil,%edi
  jmp    L34
L118:
  cmpl   $0x3,0x10(%rsp)
  jne    L77
  cmpl   $0x3,0x14(%rsp)
  sete   %dil
  movzbl %dil,%edi
  jmp    L77
L26:
  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;
}
```