user: Converte this assembly snippet into its equivalent C code:

```asm
<cipherRSA>:
  endbr64
  push   %r15
  lea    D29(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D42(%rip),%rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    D46(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D11(%rip),%rdi
  call   <fopen@plt>
  mov    %rbp,%rsi
  lea    D97(%rip),%rdi
  mov    %rax,%r13
  call   <fopen@plt>
  lea    D59(%rip),%rsi
  lea    D27(%rip),%rdi
  mov    %rax,%r12
  call   <fopen@plt>
  test   %r13,%r13
  mov    %rax,%rbp
  sete   %al
  test   %r12,%r12
  sete   %dl
  or     %dl,%al
  jne    L67
  test   %rbp,%rbp
  je     L67
  xor    %r11d,%r11d
  mov    $0x800,%esi
  xor    %ebx,%ebx
  mov    %r11d,%edi
  mov    %r11d,0xc(%rsp)
  call   <mpz_init2@plt>
  xor    %r10d,%r10d
  mov    $0x800,%esi
  mov    %r10d,%edi
  mov    %r10d,(%rsp)
  call   <mpz_init2@plt>
  xor    %edi,%edi
  mov    $0x800,%esi
  call   <mpz_init2@plt>
  xor    %edi,%edi
  mov    $0x800,%esi
  call   <mpz_init2@plt>
  mov    0xc(%rsp),%edi
  mov    $0x10,%edx
  mov    %r13,%rsi
  call   <mpz_inp_str@plt>
  mov    (%rsp),%edi
  mov    $0x10,%edx
  mov    %r13,%rsi
  call   <mpz_inp_str@plt>
  lea    D20(%rip),%rdi
  call   <puts@plt>
  lea    0x10(%rsp),%rax
  mov    %r12,%rdi
  mov    %rax,(%rsp)
  call   <fgetc@plt>
  test   %al,%al
  je     L55
  nopl   0x0(%rax,%rax,1)
L49:
  cmp    $0xa,%al
  je     L55
  mov    %ebx,%edx
  mov    %ebx,%ecx
  and    $0x7f,%ecx
  and    $0x7f,%edx
  mov    %al,0x10(%rsp,%rcx,1)
  cmp    $0x7e,%edx
  je     L35
L27:
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <fgetc@plt>
  test   %al,%al
  jne    L49
L55:
  imul   $0xefdfbf7f,%ebx,%eax
  cmp    $0x2040810,%eax
  jbe    L6
  mov    %ebx,%eax
  and    $0x7f,%eax
  movb   $0x0,0x10(%rsp,%rax,1)
L6:
  xor    %r15d,%r15d
  mov    (%rsp),%rsi
  mov    $0x3e,%edx
  xor    %r14d,%r14d
  mov    %r15d,%edi
  call   <mpz_set_str@plt>
  xor    %r11d,%r11d
  xor    %r10d,%r10d
  mov    %r15d,%esi
  mov    %r10d,%edx
  mov    %r11d,%ecx
  mov    %r14d,%edi
  mov    %r11d,0xc(%rsp)
  mov    %r10d,(%rsp)
  call   <mpz_powm@plt>
  mov    %r14d,%edx
  mov    $0x3e,%esi
  mov    %rbp,%rdi
  call   <mpz_out_str@plt>
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  lea    0x1(%rbx),%esi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D46(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edi
  call   <mpz_clear@plt>
  mov    (%rsp),%edi
  call   <mpz_clear@plt>
  mov    %r15d,%edi
  call   <mpz_clear@plt>
  mov    %r14d,%edi
  call   <mpz_clear@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L15:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  mov    (%rsp),%rsi
  xor    %r15d,%r15d
  xor    %r14d,%r14d
  mov    $0x3e,%edx
  mov    %r15d,%edi
  movb   $0x0,0x8f(%rsp)
  call   <mpz_set_str@plt>
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <mpz_powm@plt>
  mov    %rbp,%rdi
  mov    %r14d,%edx
  mov    $0x3e,%esi
  call   <mpz_out_str@plt>
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L27
L67:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L15
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D29
type: string
name: retrieve_data
arguments: data_tag: D42
type: string
name: retrieve_data
arguments: data_tag: D46
type: string
name: retrieve_data
arguments: data_tag: D11
type: string
name: retrieve_data
arguments: data_tag: D97
type: string
name: retrieve_data
arguments: data_tag: D59
type: string
name: retrieve_data
arguments: data_tag: D27
type: string
name: retrieve_data
arguments: data_tag: D20
type: string
name: retrieve_data
arguments: data_tag: D47
type: string
name: retrieve_data
arguments: data_tag: D10
type: string

tool: D29:          File Encryption

tool: D42: r

tool: D46: --------------------------------------

tool: D11: out/public.rsa

tool: D97: source/Clair.txt

tool: D59: w

tool: D27: out/cipherFile.txt

tool: D20: -> (n,e) has been imported from public.rsa


tool: D47: -> End of encryption. %d caracters have been encrypted in cipherFile.txt


tool: D10: Error while opening one of the 3 files required in cipherRSA

assistant: ```c
int cipherRSA() {
  printf("         File Encryption\n");
  printf("--------------------------------------\n");
  FILE *publicFile = fopen("out/public.rsa", "r");
  FILE *clearFile = fopen("source/Clair.txt", "r");
  FILE *cipheredFile = fopen("out/cipherFile.txt", "w");
  if (publicFile == NULL || clearFile == NULL || cipheredFile == NULL) {
    printf("Error while opening one of the 3 files required in cipherRSA\n");
    return -1;
  }
  mpz_t n;
  mpz_t e;
  mpz_t m;
  mpz_t c;
  char buffer[128];
  int i = 0;
  char caract;
  mpz_init2(n, 2048);
  mpz_init2(e, 2048);
  mpz_init2(m, 2048);
  mpz_init2(c, 2048);
  mpz_inp_str(n, publicFile, 16);
  mpz_inp_str(e, publicFile, 16);
  printf("-> (n,e) has been imported from public.rsa\n\n");
  do {
    caract = fgetc(clearFile);
    if (caract != '\0' && caract != '\n') {
      buffer[i % 128] = caract;
      if (i % 128 == 126) {
        buffer[127] = '\0';
        mpz_set_str(m, buffer, 62);
        mpz_powm(c, m, e, n);
        mpz_out_str(cipheredFile, 62, c);
        fputc('\n', cipheredFile);
      }
    } else {
      if (i % 127 != 0) {
        buffer[i % 128] = '\0';
      }
      mpz_set_str(m, buffer, 62);
      mpz_powm(c, m, e, n);
      mpz_out_str(cipheredFile, 62, c);
      fputc('\n', cipheredFile);
    }
    i++;
  } while (caract != '\0' && caract != '\n');
  printf("-> End of encryption. %d caracters have been encrypted in cipherFile.txt\n", i);
  printf("--------------------------------------\n");
  mpz_clear(n);
  mpz_clear(e);
  mpz_clear(m);
  mpz_clear(c);
  fclose(publicFile);
  fclose(clearFile);
  fclose(cipheredFile);
  return 0;
}
```