user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x2,%edi
  je     L47
  mov    $0x8,%esi
  mov    $0xa,%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    $0xa,%edi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    $0xa,%edi
  mov    %rax,%rbx
  mov    %rax,0x8(%rsp)
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    $0xa,%edi
  mov    %rax,%r14
  call   <calloc@plt>
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rax,%r8
  mov    $0xa,%edi
  mov    %rax,%r15
  mov    $0xa,%ebx
  call   <cf@plt>
  mov    $0xa,%edx
  mov    $0xa,%esi
  xor    %eax,%eax
  lea    D98(%rip),%rdi
  call   <printf@plt>
  lea    D13(%rip),%rdi
  call   <puts@plt>
L27:
  xor    %r13d,%r13d
  lea    D66(%rip),%rbp
  nopl   0x0(%rax)
L7:
  mov    0x8(%rsp),%rax
  movsd  (%r12,%r13,8),%xmm0
  mov    %rbp,%rdi
  movsd  (%rax,%r13,8),%xmm1
  mov    $0x2,%eax
  add    $0x1,%r13
  call   <printf@plt>
  cmp    %r13d,%ebx
  jg     L7
  mov    $0xa,%edi
  xor    %r13d,%r13d
  call   <putchar@plt>
  lea    D30(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax,%rax,1)
L2:
  movsd  (%r14,%r13,8),%xmm0
  movsd  (%r15,%r13,8),%xmm1
  mov    %rbp,%rdi
  mov    $0x2,%eax
  add    $0x1,%r13
  call   <printf@plt>
  cmp    %r13d,%ebx
  jg     L2
L45:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L69
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %ebx,%edi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %ebx,%edi
  mov    %rax,%rbp
  mov    %rax,0x8(%rsp)
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %ebx,%edi
  mov    %rax,%r14
  call   <calloc@plt>
  mov    %r14,%rcx
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rax,%r8
  mov    %ebx,%edi
  mov    %rax,%r15
  call   <cf@plt>
  lea    D98(%rip),%rdi
  xor    %eax,%eax
  mov    %ebx,%edx
  mov    %ebx,%esi
  call   <printf@plt>
  lea    D13(%rip),%rdi
  call   <puts@plt>
  test   %ebx,%ebx
  jg     L27
  jmp    L26
L69:
  lea    D47(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    $0x8,%esi
  xor    %edi,%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  xor    %edi,%edi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    $0x8,%esi
  xor    %edi,%edi
  mov    %rax,%rbx
  mov    %rax,0x8(%rsp)
  call   <calloc@plt>
  mov    $0x8,%esi
  xor    %edi,%edi
  mov    %rax,%r14
  call   <calloc@plt>
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rax,%r8
  xor    %edi,%edi
  mov    %rax,%r15
  call   <cf@plt>
  lea    D98(%rip),%rdi
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D13(%rip),%rdi
  call   <puts@plt>
L26:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D30(%rip),%rdi
  call   <puts@plt>
  jmp    L45
```

tool_calls: name: retrieve_data
arguments: label: D98
type_guessed: string
name: retrieve_data
arguments: label: D13
type_guessed: string
name: retrieve_data
arguments: label: D66
type_guessed: string
name: retrieve_data
arguments: label: D30
type_guessed: string
name: retrieve_data
arguments: label: D47
type_guessed: string

tool: D98: Type (%i, %i) best rational function approximant to matrix exponential.


tool: D13: poles: 

tool: D66: %.15e + %.15e i


tool: D30: residuals: 

tool: D47: Error in command line argument, should be a single nonzero integer.

assistant: ```c
int main(int argc, char *argv[]) {
  int n = 10;
  if (argc == 2) {
    n = atoi(argv[1]);
    if (n == 0) {
      printf("Error in command line argument, should be a single nonzero integer.\n");
      exit(1);
    }
  }
  double *poles_r = (double *)calloc(n, sizeof(double));
  double *poles_i = (double *)calloc(n, sizeof(double));
  double *res_r = (double *)calloc(n, sizeof(double));
  double *res_i = (double *)calloc(n, sizeof(double));
  cf(n, poles_r, poles_i, res_r, res_i);
  printf("Type (%i, %i) best rational function approximant to matrix exponential.\n", n, n);
  printf("poles: \n");
  for (int i = 0; i < n; ++i) {
    printf("%.15e + %.15e i\n", poles_r[i], poles_i[i]);
  }
  printf("\n");
  printf("residuals: \n");
  for (int i = 0; i < n; ++i) {
    printf("%.15e + %.15e i\n", res_r[i], res_i[i]);
  }
  printf("\n");
  free(poles_r);
  free(poles_i);
  free(res_r);
  free(res_i);
  return 0;
}
```