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

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xeb8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3ea8(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  lea    D22(%rip),%rdi
  call   <scanf@plt>
  cmpq   $0x0,0x8(%rsp)
  jle    L53
  mov    $0x0,%ebx
  lea    D26(%rip),%r12
  mov    $0x1,%r13d
  lea    D3(%rip),%rbp
  jmp    L154
L80:
  cmp    %rcx,%rsi
  cmovl  %r8,%rcx
  add    $0x1,%rcx
  cmp    $0x1,%rsi
  jle    L130
L212:
  mov    %rsi,%rax
  cqto
  idiv   %rcx
  test   %rdx,%rdx
  jne    L80
L189:
  mov    %rcx,0x20(%rsp,%rdi,8)
  mov    %rsi,%rax
  cqto
  idiv   %rcx
  mov    %rax,%rsi
  add    $0x1,%rdi
  cqto
  idiv   %rcx
  test   %rdx,%rdx
  je     L189
  mov    %r13d,%r9d
  jmp    L80
L130:
  test   %r9b,%r9b
  je     L104
  mov    %rsi,0x10(%rsp)
L104:
  cmpq   $0x1,0x18(%rsp)
  jle    L41
L155:
  mov    0x18(%rsp),%rsi
  mov    $0x0,%r10d
  mov    $0x0,%r8d
  mov    $0x2,%ecx
  mov    $0x1,%r9d
  jmp    L136
L192:
  cmp    %rcx,%rsi
  cmovl  %r9,%rcx
  add    $0x1,%rcx
  cmp    $0x1,%rsi
  jle    L69
L136:
  mov    %rsi,%rax
  cqto
  idiv   %rcx
  test   %rdx,%rdx
  jne    L192
L227:
  mov    %rcx,0x1f60(%rsp,%r8,8)
  mov    %rsi,%rax
  cqto
  idiv   %rcx
  mov    %rax,%rsi
  add    $0x1,%r8
  cqto
  idiv   %rcx
  test   %rdx,%rdx
  je     L227
  mov    %r13d,%r10d
  jmp    L192
L69:
  test   %r10b,%r10b
  je     L41
  mov    %rsi,0x18(%rsp)
L41:
  test   %rdi,%rdi
  jle    L6
  mov    $0x0,%eax
  mov    $0x1,%esi
  lea    0x1f60(%rsp),%rcx
  jmp    L95
L114:
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L119
L95:
  mov    0x20(%rsp,%rax,8),%rdx
  cmp    (%rcx,%rax,8),%rdx
  jne    L114
  imul   %rdx,%rsi
  jmp    L114
L6:
  mov    $0x1,%esi
L119:
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%rbx
  cmp    %rbx,0x8(%rsp)
  jle    L53
L154:
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x10(%rsp),%rsi
  mov    $0x0,%r9d
  mov    $0x0,%edi
  mov    $0x2,%ecx
  mov    $0x1,%r8d
  cmp    $0x1,%rsi
  jg     L212
  mov    $0x0,%edi
  mov    $0x1,%esi
  cmpq   $0x1,0x18(%rsp)
  jg     L155
  jmp    L119
L53:
  mov    0x3ea8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  mov    $0x0,%eax
  add    $0x3eb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L81:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D22
type_infered: string
name: unpack_data
arguments: data_tag: D26
type_infered: string
name: unpack_data
arguments: data_tag: D3
type_infered: string

tool: D22: %lld

tool: D26: %lld%lld

tool: D3: 
%lld

assistant: ```c
int main() {
  long long int n, i, j = 2, k = 2, l = 0, m = 0, a[1000], b[1000], p = 1, c, d, o;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld%lld", &c, &d);
    while (c > 1) {
      while (c % j == 0) {
        if (c % j == 0) {
          a[l] = j;
          c = c / j;
          l++;
        }
      }
      if (c < j)
        j = 1;
      j++;
    }
    while (d > 1) {
      while (d % k == 0) {
        if (d % k == 0) {
          b[m] = k;
          d = d / k;
          m++;
        }
      }
      if (d < k)
        k = 1;
      k++;
    }
    for (o = 0; o < l; o++) {
      if (a[o] == b[o])
        p = p * a[o];
    }
    printf("\n%lld", p);
    printf("\n");
    j = 2;
    k = 2;
    l = 0;
    m = 0;
    p = 1;
  }
  return 0;
}
```