user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  lea    -0x186000(%rsp),%r11
L79:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L79
  sub    $0xa88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movq   $0x0,-0x186a70(%rbp)
  movq   $0x0,-0x186a78(%rbp)
  lea    -0x186aa0(%rbp),%rdx
  lea    -0x186aa8(%rbp),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x186aa8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x186a68(%rbp)
  mov    %rax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  mov    %rax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L63:
  cmp    %rdx,%rsp
  je     L7
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L63
L7:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L78
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L78:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x186a60(%rbp)
  movq   $0x0,-0x186a80(%rbp)
  jmp    L88
L125:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%rcx
  mov    -0x186a60(%rbp),%rax
  mov    -0x186a80(%rbp),%rdx
  mov    %rcx,(%rax,%rdx,8)
  addq   $0x1,-0x186a80(%rbp)
L88:
  mov    -0x186aa8(%rbp),%rax
  cmp    %rax,-0x186a80(%rbp)
  jl     L125
  lea    -0x186a50(%rbp),%rax
  mov    $0x186a1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0xc3540(%rbp),%rax
  mov    $0x186a1,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movq   $0x0,-0x186a80(%rbp)
  jmp    L36
L53:
  lea    -0x186a88(%rbp),%rcx
  lea    -0x186a90(%rbp),%rdx
  lea    -0x186a98(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x186a90(%rbp),%rax
  xor    -0x186a70(%rbp),%rax
  mov    -0x186aa8(%rbp),%rcx
  cqto
  idiv   %rcx
  mov    %rdx,-0x186a58(%rbp)
  mov    -0x186a98(%rbp),%rax
  cmp    $0x1,%rax
  jne    L2
  mov    -0x186a58(%rbp),%rax
  mov    -0x186a50(%rbp,%rax,8),%rax
  add    $0x1,%rax
  shl    $0x3,%rax
  mov    %rax,%rcx
  mov    -0x186a60(%rbp),%rax
  mov    -0x186a58(%rbp),%rdx
  mov    (%rax,%rdx,8),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    -0x186a60(%rbp),%rdx
  mov    -0x186a58(%rbp),%rcx
  mov    %rax,(%rdx,%rcx,8)
  mov    -0x186a60(%rbp),%rax
  mov    -0x186a58(%rbp),%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    -0x186a58(%rbp),%rax
  mov    -0x186a50(%rbp,%rax,8),%rax
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x186a88(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x186a58(%rbp),%rax
  mov    -0x186a50(%rbp,%rax,8),%rax
  lea    0x1(%rax),%rdx
  mov    -0x186a58(%rbp),%rax
  mov    %rdx,-0x186a50(%rbp,%rax,8)
  jmp    L23
L2:
  mov    -0x186a60(%rbp),%rax
  mov    -0x186a58(%rbp),%rdx
  mov    (%rax,%rdx,8),%rsi
  mov    -0x186a88(%rbp),%rax
  mov    -0x186a58(%rbp),%rdx
  mov    -0x186a50(%rbp,%rdx,8),%rcx
  cqto
  idiv   %rcx
  mov    %rdx,%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rax,-0x186a70(%rbp)
  mov    -0x186a78(%rbp),%rax
  mov    -0x186a70(%rbp),%rdx
  mov    %rdx,-0xc3540(%rbp,%rax,8)
  addq   $0x1,-0x186a78(%rbp)
L23:
  addq   $0x1,-0x186a80(%rbp)
L36:
  mov    -0x186aa0(%rbp),%rax
  cmp    %rax,-0x186a80(%rbp)
  jl     L53
  movq   $0x0,-0x186a80(%rbp)
  jmp    L38
L128:
  mov    -0x186a80(%rbp),%rax
  mov    -0xc3540(%rbp,%rax,8),%rax
  mov    %rax,%rsi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addq   $0x1,-0x186a80(%rbp)
L38:
  mov    -0x186a80(%rbp),%rax
  cmp    -0x186a78(%rbp),%rax
  jl     L128
  mov    $0x0,%eax
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D5
type_guessed: string
name: disassemble_data
arguments: tag: D17
type_guessed: string
name: disassemble_data
arguments: tag: D18
type_guessed: string

tool: D5: %lld %lld

tool: D17: %lld %lld %lld

tool: D18: %lld


assistant: ```c
int main() {
  long long n, q, i, l;
  long long idx[100001];
  long long out[100001];
  long long qn, x, y;
  long long lastAns;
  lastAns = 0;
  l = 0;
  scanf("%lld %lld", &n, &q);
  long long *arr[n];
  for (i = 0; i < n; i++)
    arr[i] = (long long *)malloc(sizeof(long long));
  memset(idx, 0, 100001);
  memset(out, 0, 100001);
  for (i = 0; i < q; i++) {
    scanf("%lld %lld %lld", &qn, &x, &y);
    long long seq = (x ^ lastAns) % n;
    if (qn == 1) {
      arr[seq] = realloc(arr[seq], (idx[seq] + 1) * sizeof(long long));
      arr[seq][idx[seq]] = y;
      idx[seq]++;
    } else {
      lastAns = arr[seq][y % idx[seq]];
      out[l] = lastAns;
      l++;
    }
  }
  for (i = 0; i < l; i++) {
    printf("%lld\n", out[i]);
  }
  return 0;
}
```