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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x7fff,%edi
  call   <sqrt@plt>
  mov    %eax,%ecx
  lea    -0x3040(%rbp),%rdx
  lea    -0x3010(%rbp),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <find_primes@plt>
  jmp    L26
L67:
  lea    -0x1010(%rbp),%rax
  mov    %rax,-0x3020(%rbp)
  movl   $0x1,-0x3038(%rbp)
  jmp    L61
L97:
  mov    -0x3018(%rbp),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x3028(%rbp)
  lea    D11(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x3018(%rbp)
  mov    -0x3018(%rbp),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x3024(%rbp)
  mov    -0x3024(%rbp),%edx
  mov    -0x3028(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <pow@plt>
  mov    -0x3038(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x3038(%rbp)
  movq   $0x0,-0x3020(%rbp)
L61:
  mov    -0x3020(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x3018(%rbp)
  cmpq   $0x0,-0x3018(%rbp)
  jne    L97
  subl   $0x1,-0x3038(%rbp)
  mov    -0x3040(%rbp),%edx
  lea    -0x303c(%rbp),%rdi
  lea    -0x2010(%rbp),%rcx
  lea    -0x3010(%rbp),%rsi
  mov    -0x3038(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <find_prime_factors@plt>
  mov    -0x303c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x2010(%rbp,%rax,4),%eax
  mov    %eax,-0x302c(%rbp)
  movl   $0x1,-0x3030(%rbp)
  mov    -0x302c(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x303c(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x3034(%rbp)
  jmp    L60
L51:
  mov    -0x3034(%rbp),%eax
  cltq
  mov    -0x2010(%rbp,%rax,4),%eax
  cmp    %eax,-0x302c(%rbp)
  jne    L49
  addl   $0x1,-0x3030(%rbp)
  jmp    L94
L49:
  mov    -0x3030(%rbp),%eax
  mov    %eax,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x3034(%rbp),%eax
  cltq
  mov    -0x2010(%rbp,%rax,4),%eax
  mov    %eax,-0x302c(%rbp)
  mov    -0x302c(%rbp),%eax
  mov    %eax,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x3030(%rbp)
L94:
  subl   $0x1,-0x3034(%rbp)
L60:
  cmpl   $0x0,-0x3034(%rbp)
  jns    L51
  mov    -0x3030(%rbp),%eax
  mov    %eax,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
L26:
  lea    -0x1010(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  test   %rax,%rax
  je     L50
  movzbl -0x1010(%rbp),%eax
  cmp    $0x30,%al
  jne    L67
L50:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L86
  call   <__stack_chk_fail@plt>
L86:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D11
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D1
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D48
type_guessed: string

tool: D11:  

tool: D1: %d

tool: D48:  %d

assistant: ```c
int main() {
  int num, base, exp;
  int primes[1 << 10], num_primes;
  int factors[1 << 10], num_factors;
  char line[4096];
  int i, count, prev;
  find_primes(sqrt(32767), primes, &num_primes);
  while (gets(line) != NULL && line[0] != '0') {
    char *tok;
    char *ptr = &line[0];
    num = 1;
    while ((tok = strtok(ptr, " ")) != NULL) {
      base = strtol(tok, NULL, 10);
      tok = strtok(NULL, " ");
      exp = strtol(tok, NULL, 10);
      num *= pow(base, exp);
      ptr = NULL;
    }
    --num;
    find_prime_factors(num, primes, num_primes, factors, &num_factors);
    prev = factors[num_factors - 1];
    count = 1;
    printf("%d", prev);
    for (i = num_factors - 2; i >= 0; i--) {
      if (factors[i] == prev) {
        count++;
      } else {
        printf(" %d", count);
        prev = factors[i];
        printf(" %d", prev);
        count = 1;
      }
    }
    printf(" %d", count);
    printf("\n");
  }
  return 0;
}
```