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

```asm
<find_all_occurances>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x70,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  movq   $0x1,-0x40(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x4,-0x58(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %rax,%r8
  mov    $0x0,%r9d
  mov    %rax,%rcx
  mov    $0x0,%ebx
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L87:
  cmp    %rdx,%rsp
  je     L105
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L87
L105:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L82
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L82:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x58(%rbp),%rax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x50(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  jne    L3
  mov    $0x15,%edi
  call   <exit@plt>
L3:
  movl   $0x1,-0x64(%rbp)
L149:
  mov    -0x30(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x78(%rbp),%rsi
  mov    -0x80(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rdi
  call   <regexec@plt>
  test   %rax,%rax
  jne    L133
  movq   $0x0,-0x48(%rbp)
  jmp    L9
L72:
  mov    -0x30(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    (%rax,%rdx,8),%eax
  cmp    $0xffffffff,%eax
  jne    L128
  movl   $0x0,-0x64(%rbp)
  jmp    L121
L128:
  mov    -0x30(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    0x4(%rax,%rdx,8),%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    (%rax,%rdx,8),%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  cltq
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L55
  mov    $0x15,%edi
  call   <exit@plt>
L55:
  mov    -0x30(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    (%rax,%rdx,8),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x60(%rbp)
  mov    -0x60(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jne    L39
  shlq   -0x58(%rbp)
  mov    -0x58(%rbp),%rax
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x50(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  jne    L39
  mov    $0x15,%edi
  call   <exit@plt>
L39:
  mov    -0x60(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trim_whitespaces@plt>
  mov    %rax,(%rbx)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addq   $0x1,-0x48(%rbp)
L9:
  mov    -0x48(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jb     L72
L121:
  mov    -0x30(%rbp),%rax
  mov    0x4(%rax),%eax
  cltq
  add    %rax,-0x78(%rbp)
  cmpl   $0x0,-0x64(%rbp)
  jne    L149
  jmp    L126
L133:
  nop
L126:
  mov    -0x60(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x50(%rbp),%rax
  mov    %r12,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L143
  call   <__stack_chk_fail@plt>
L143:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
char **find_all_occurances(char *page, regex_t *compiledReg) {
  size_t nsub = 1, returnPointer = 0, dynamicArray = 4;
  regmatch_t matchLocations[nsub];
  char **toReturn = (char **)malloc(sizeof(char *) * dynamicArray);
  if (toReturn == NULL) {
    exit(21);
  }
  bool keepRunning = true;
  do {
    if (regexec(compiledReg, page, nsub, matchLocations, 0) != 0) {
      break;
    }
    for (size_t i = 0; i < nsub; i++) {
      if (matchLocations[i].rm_so == -1) {
        keepRunning = false;
        break;
      }
      size_t lengthOfKey = matchLocations[i].rm_eo - matchLocations[i].rm_so;
      char *newKey = (char *)malloc(sizeof(char) * (lengthOfKey + 1));
      if (newKey == NULL) {
        exit(21);
      }
      memcpy(newKey, page + (matchLocations[i].rm_so), lengthOfKey);
      newKey[lengthOfKey] = '\0';
      if (++returnPointer == dynamicArray) {
        dynamicArray *= 2;
        toReturn = (char **)realloc(toReturn, sizeof(char *) * dynamicArray);
        if (toReturn == NULL) {
          exit(21);
        }
      }
      toReturn[returnPointer - 1] = trim_whitespaces(newKey);
      free(newKey);
    }
    page += matchLocations[0].rm_eo;
  } while (keepRunning);
  toReturn[returnPointer] = NULL;
  return toReturn;
}
```