user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x4,%edi
  jle    L13
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbp
  xor    %esi,%esi
  mov    $0xa,%edx
  lea    D13(%rip),%r15
  call   <strtol@plt>
  mov    0x10(%rbp),%rdi
  mov    $0xa,%edx
  xor    %esi,%esi
  mov    %eax,%r13d
  call   <strtol@plt>
  mov    0x18(%rbp),%rdi
  mov    $0xa,%edx
  xor    %esi,%esi
  mov    %eax,%r12d
  call   <strtol@plt>
  mov    0x20(%rbp),%rsi
  mov    $0xa,%edx
  xor    %edi,%edi
  xor    %ebp,%ebp
  mov    %eax,%ebx
  call   <mpz_init_set_str@plt>
  xor    %esi,%esi
  mov    %ebp,%edi
  call   <mpz_init_set_ui@plt>
  xor    %edi,%edi
  call   <mpz_init@plt>
  mov    %ebp,%edi
  call   <mpz_init@plt>
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L8:
  mov    %r14d,%edx
  mov    %ebp,%esi
  lea    D29(%rip),%rdi
  call   <gmp_printf@plt>
L42:
  xor    %ebp,%ebp
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <mpz_add_ui@plt>
L4:
  xor    %ebp,%ebp
  xor    %esi,%esi
  mov    %ebp,%edi
  call   <mpz_cmp@plt>
  test   %rax,%rax
  jg     L17
  xor    %r14d,%r14d
  xor    %ebp,%ebp
  mov    %ebp,%edx
  mov    %ebp,%esi
  mov    %r14d,%edi
  call   <mpz_mul@plt>
  mov    %r13d,%edx
  mov    %r14d,%esi
  mov    %r14d,%edi
  call   <mpz_mul_ui@plt>
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <mpz_mul_ui@plt>
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r14d,%edi
  call   <mpz_add@plt>
  mov    %r14d,%edi
  mov    %ebx,%edx
  mov    %r14d,%esi
  call   <mpz_add_ui@plt>
  mov    %r14d,%edi
  call   <isprime@plt>
  test   %rax,%rax
  jne    L8
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <gmp_printf@plt>
  jmp    L42
L17:
  mov    %ebp,%edi
  call   <mpz_clear@plt>
  xor    %edi,%edi
  call   <mpz_clear@plt>
  xor    %edi,%edi
  call   <mpz_clear@plt>
  mov    %ebp,%edi
  call   <mpz_clear@plt>
  xor    %eax,%eax
L25:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  lea    D22(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L25
```

tool_calls: name: retrieve_data
arguments: tag: D13
data_type: string
name: retrieve_data
arguments: tag: D29
data_type: string
name: retrieve_data
arguments: tag: D22
data_type: string

tool: D13: %Zd %Zd NG


tool: D29: %Zd %Zd OK


tool: D22: usage : primegen a b c max_n


assistant: ```c
int main(int ac, char *av[]) {
  int a, b, c;
  mpz_t n, n2, max_n, tmp;
  if (ac < 5) {
    printf("usage : primegen a b c max_n\n");
    return (1);
  }
  a = strtol(av[1], NULL, 10);
  b = strtol(av[2], NULL, 10);
  c = strtol(av[3], NULL, 10);
  mpz_init_set_str(max_n, av[4], 10);
  mpz_init_set_ui(n, 0);
  mpz_init(n2);
  mpz_init(tmp);
  while (mpz_cmp(n, max_n) <= 0) {
    mpz_mul(n2, n, n);
    mpz_mul_ui(n2, n2, a);
    mpz_mul_ui(tmp, n, b);
    mpz_add(n2, n2, tmp);
    mpz_add_ui(n2, n2, c);
    if (isprime(n2))
      gmp_printf("%Zd %Zd OK\n", n, n2);
    else
      gmp_printf("%Zd %Zd NG\n", n, n2);
    mpz_add_ui(n, n, 1);
  }
  mpz_clear(n);
  mpz_clear(n2);
  mpz_clear(max_n);
  mpz_clear(tmp);
  return (0);
}
```