user: What would the C source look like for the assembly code provided here?

```asm
<gen_generator>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpz_init@plt>
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <mpz_init_set@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <mpz_init@plt>
  mov    -0x18(%rbp),%ecx
  mov    -0x4(%rbp),%eax
  mov    $0x2,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_sub_ui@plt>
  mov    -0x8(%rbp),%ecx
  mov    -0x8(%rbp),%eax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_sub_ui@plt>
  mov    -0x8(%rbp),%ecx
  mov    -0x8(%rbp),%eax
  mov    $0x2,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_cdiv_q_ui@plt>
  jmp    L46
L37:
  mov    -0x4(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_urandomm@plt>
  mov    -0x14(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    $0x2,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_add_ui@plt>
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  mov    %edx,%ecx
  mov    $0x1,%edx
  mov    %eax,%edi
  call   <mpz_powm_ui@plt>
  mov    -0xc(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <mpz_cmp_ui@plt>
  test   %rax,%rax
  jne    L22
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L22:
  movl   $0x1,-0x10(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  mov    %edx,%ecx
  mov    $0x2,%edx
  mov    %eax,%edi
  call   <mpz_powm_ui@plt>
  mov    -0xc(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <mpz_cmp_ui@plt>
  test   %rax,%rax
  jne    L55
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L55:
  movl   $0x1,-0x10(%rbp)
  mov    -0x18(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <mpz_powm@plt>
  mov    -0xc(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <mpz_cmp_ui@plt>
  test   %rax,%rax
  jne    L0
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L0:
  movl   $0x1,-0x10(%rbp)
L46:
  cmpl   $0x0,-0x10(%rbp)
  je     L37
  mov    -0x8(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <mpz_clears@plt>
  nop
  leave
  ret
```

assistant: ```c
void gen_generator(mpz_t g, mpz_t p, gmp_randstate_t r_state) {
  int done = 0;
  mpz_t temp;
  mpz_init(temp);
  mpz_t q;
  mpz_init_set(q, p);
  mpz_t max;
  mpz_init(max);
  mpz_sub_ui(max, p, 2);
  mpz_sub_ui(q, q, 1);
  mpz_cdiv_q_ui(q, q, 2);
  while (!done) {
    mpz_urandomm(g, r_state, max);
    mpz_add_ui(g, g, 2);
    mpz_powm_ui(temp, g, 1, p);
    if (mpz_cmp_ui(temp, 1) == 0) {
      done = 0;
      continue;
    } else {
      done = 1;
    }
    mpz_powm_ui(temp, g, 2, p);
    if (mpz_cmp_ui(temp, 1) == 0) {
      done = 0;
      continue;
    } else {
      done = 1;
    }
    mpz_powm(temp, g, q, p);
    if (mpz_cmp_ui(temp, 1) == 0) {
      done = 0;
      continue;
    } else {
      done = 1;
    }
  }
  mpz_clears(temp, q, NULL);
}
```