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    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x60(%rsp),%rsi
  lea    D43(%rip),%rdi
  call   <scanf@plt>
  cmpq   $0x0,0x60(%rsp)
  je     L165
  movq   $0x0,0x38(%rsp)
  movabs $0x89705f3112a28fe5,%r14
  jmp    L121
L114:
  mov    0x8(%rsp),%r13
  sub    0x10(%rsp),%r13
  add    %r15,%r13
  mov    0x28(%rsp),%r12
  mov    $0x0,%ebx
  mov    $0x0,%ebp
L183:
  mov    (%r12),%rsi
  mov    0x0(%r13),%rdi
  call   <getSum@plt>
  lea    (%rax,%rbx,1),%rcx
  mov    %rcx,%rax
  mul    %r14
  shr    $0x1d,%rdx
  imul   $0x3b9aca07,%rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%rbx
  add    $0x1,%rbp
  add    $0x8,%r12
  cmp    %rbp,0x58(%rsp)
  ja     L183
L182:
  mov    %rbx,(%r15)
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  add    $0x8,%r15
  cmp    %rax,0x50(%rsp)
  jbe    L91
L22:
  mov    0x58(%rsp),%rbx
  test   %rbx,%rbx
  jne    L114
  jmp    L182
L91:
  mov    0x48(%rsp),%r15
  test   %r15,%r15
  je     L32
  mov    0x30(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    $0x0,%r15d
  movq   $0x0,0x18(%rsp)
  jmp    L237
L164:
  add    $0x1,%rbp
  add    $0x8,%rbx
  cmp    %rbp,0x50(%rsp)
  jbe    L193
L51:
  mov    (%rbx),%rsi
  mov    0x0(%r13),%rdi
  call   <permissible@plt>
  test   %rax,%rax
  je     L164
  mov    0x0(%r13),%rsi
  mov    (%rbx),%rdi
  call   <getSum@plt>
  mov    0x10(%rsp),%rdx
  sub    0x8(%rsp),%rdx
  imul   (%rdx,%rbx,1),%rax
  lea    (%rax,%r12,1),%rcx
  mov    %rcx,%rax
  mul    %r14
  shr    $0x1d,%rdx
  imul   $0x3b9aca07,%rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%r12
  jmp    L164
L193:
  add    %r15,%r12
  mov    %r12,%rax
  mul    %r14
  shr    $0x1d,%rdx
  imul   $0x3b9aca07,%rdx,%rax
  mov    %r12,%r15
  sub    %rax,%r15
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  addq   $0x8,0x20(%rsp)
  cmp    %rax,0x48(%rsp)
  jbe    L32
L237:
  mov    0x50(%rsp),%r12
  test   %r12,%r12
  je     L193
  mov    0x20(%rsp),%r13
  mov    0x8(%rsp),%rbx
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  jmp    L51
L32:
  mov    %r15,%rsi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    %rax,0x60(%rsp)
  jbe    L165
L121:
  lea    0x58(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  lea    0x48(%rsp),%rsi
  lea    D28(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x48(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rax,0x30(%rsp)
  mov    0x50(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    0x58(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x28(%rsp)
  cmpq   $0x0,0x48(%rsp)
  je     L53
  mov    $0x0,%ebx
L212:
  mov    %rbp,%rsi
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %rbx,0x48(%rsp)
  ja     L212
L53:
  cmpq   $0x0,0x50(%rsp)
  je     L4
  mov    0x8(%rsp),%rbp
  mov    $0x0,%ebx
L99:
  mov    %rbp,%rsi
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %rbx,0x50(%rsp)
  ja     L99
L4:
  cmpq   $0x0,0x58(%rsp)
  je     L31
  mov    0x28(%rsp),%rbp
  mov    $0x0,%ebx
L52:
  mov    %rbp,%rsi
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %rbx,0x58(%rsp)
  ja     L52
L31:
  mov    0x48(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    $0x0,%esi
  mov    0x30(%rsp),%rdi
  call   <mergeSort@plt>
  mov    0x50(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    $0x0,%esi
  mov    0x8(%rsp),%rdi
  call   <mergeSort@plt>
  mov    0x58(%rsp),%rax
  lea    -0x1(%rax),%rdx
  mov    $0x0,%esi
  mov    0x28(%rsp),%rdi
  call   <mergeSort@plt>
  mov    0x50(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  cmpq   $0x0,0x50(%rsp)
  je     L91
  mov    %rax,%r15
  movq   $0x0,0x18(%rsp)
  jmp    L22
L165:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L60
  mov    $0x0,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D43
type: string
name: extract_symbolic_data
arguments: data_tag: D5
type: string
name: extract_symbolic_data
arguments: data_tag: D28
type: string

tool: D43: %llu

tool: D5: %llu


tool: D28: %llu %llu %llu

assistant: ```c
int main() {
  unsigned long long p, q, r, i, j, k, t, m = 0;
  unsigned long long *arr_p, *arr_q, *arr_r, *arr_q1;
  unsigned long long summer = 0, total = 0;
  scanf("%llu", &t);
  while (m++ < t) {
    summer = 0, total = 0;
    scanf("%llu %llu %llu", &p, &q, &r);
    arr_p = (unsigned long long *)malloc(sizeof(unsigned long long) * p);
    arr_q = (unsigned long long *)malloc(sizeof(unsigned long long) * q);
    arr_r = (unsigned long long *)malloc(sizeof(unsigned long long) * r);
    for (i = 0; i < p; i++) {
      scanf("%llu", &arr_p[i]);
    }
    for (i = 0; i < q; i++) {
      scanf("%llu", &arr_q[i]);
    }
    for (i = 0; i < r; i++) {
      scanf("%llu", &arr_r[i]);
    }
    mergeSort(arr_p, 0, p - 1);
    mergeSort(arr_q, 0, q - 1);
    mergeSort(arr_r, 0, r - 1);
    arr_q1 = (long long unsigned *)malloc(sizeof(long long unsigned) * q);
    for (i = 0; i < q; i++) {
      summer = 0;
      for (j = 0; j < r; j++) {
        summer = (summer + getSum(arr_q[i], arr_r[j])) % 1000000007;
      }
      arr_q1[i] = summer;
    }
    for (i = 0; i < p; i++) {
      summer = 0;
      for (j = 0; j < q; j++) {
        if (permissible(arr_p[i], arr_q[j])) {
          summer = (summer + getSum(arr_q[j], arr_p[i]) * arr_q1[j]) % 1000000007;
        }
      }
      total = (total + summer) % 1000000007;
    }
    printf("%llu\n", total);
    free(arr_p);
    free(arr_q);
    free(arr_r);
    free(arr_q1);
  }
  return 0;
}
```