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

```asm
<get_BZ_triplets_at_q>:
  endbr64
  push   %r15
  push   %r14
  movslq %r9d,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rdi,%r12
  lea    0x0(,%r9,4),%edi
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  movslq %esi,%rbx
  sub    $0xa8,%rsp
  mov    0xe0(%rsp),%rsi
  mov    %rdx,0x20(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  mov    (%rsi),%eax
  mov    %r9d,(%rsp)
  add    %eax,%eax
  movd   %eax,%xmm0
  mov    0x4(%rsi),%eax
  add    %eax,%eax
  movd   %eax,%xmm2
  mov    0x8(%rsi),%eax
  punpckldq %xmm2,%xmm0
  add    %eax,%eax
  movq   %xmm0,0x60(%rsp)
  mov    %eax,0x68(%rsp)
  call   <malloc@plt>
  mov    (%rsp),%r9d
  mov    %rax,0x40(%rsp)
  test   %r9d,%r9d
  jle    L4
  mov    %rax,%rsi
  xor    %edx,%edx
  xor    %eax,%eax
  nopl   (%rax)
L77:
  cmp    %eax,0x0(%r13,%rax,4)
  jne    L18
  movslq %edx,%rcx
  add    $0x1,%edx
  mov    %eax,(%rsi,%rcx,4)
L18:
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L77
  mov    %edx,0x4c(%rsp)
  test   %edx,%edx
  je     L30
  mov    0x20(%rsp),%rsi
  lea    (%rbx,%rbx,2),%rax
  mov    %r12,0x8(%rsp)
  lea    0x60(%rsp),%r13
  lea    (%rsi,%rax,4),%r14
  mov    0x40(%rsp),%rsi
  lea    -0x1(%rdx),%eax
  lea    0x4(%rsi,%rax,4),%rax
  mov    %rsi,%rbx
  mov    %rax,0x30(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x94(%rsp),%rax
  mov    %rax,(%rsp)
  lea    0x50(%rsp),%rax
  mov    %rax,0x38(%rsp)
  nopl   0x0(%rax)
L23:
  mov    (%r14),%eax
  mov    0x20(%rsp),%rcx
  mov    %rbx,0x18(%rsp)
  mov    $0x2,%r15d
  mov    0x28(%rsp),%r12
  mov    %eax,0x70(%rsp)
  movslq (%rbx),%rdx
  neg    %eax
  lea    (%rdx,%rdx,2),%rdx
  mov    (%rcx,%rdx,4),%edx
  sub    %edx,%eax
  mov    %edx,0x7c(%rsp)
  mov    %eax,0x88(%rsp)
  mov    0x4(%r14),%eax
  mov    %eax,0x74(%rsp)
  movslq (%rbx),%rdx
  neg    %eax
  lea    (%rdx,%rdx,2),%rdx
  mov    0x4(%rcx,%rdx,4),%edx
  sub    %edx,%eax
  mov    %edx,0x80(%rsp)
  mov    %eax,0x8c(%rsp)
  mov    0x8(%r14),%eax
  mov    %eax,0x78(%rsp)
  movslq (%rbx),%rdx
  neg    %eax
  mov    0x10(%rsp),%rbx
  lea    (%rdx,%rdx,2),%rdx
  mov    0x8(%rcx,%rdx,4),%edx
  sub    %edx,%eax
  mov    %edx,0x84(%rsp)
  mov    %eax,0x90(%rsp)
  mov    %r13,%rax
  mov    %rbp,%r13
  mov    %rax,%rbp
L63:
  mov    %rbp,%r8
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <get_third_q_of_triplets_at_q@plt>
  test   %rax,%rax
  je     L62
  sub    $0x1,%r15d
  jae    L63
L62:
  mov    0x8(%rsp),%r15
  mov    %rbp,%rax
  mov    0x10(%rsp),%r12
  mov    %rax,%rbx
  mov    %r15,%rbp
  mov    0x38(%rsp),%r15
L46:
  mov    (%r12),%eax
  mov    %rbx,%rsi
  mov    %r15,%rdi
  add    $0xc,%r12
  add    $0x4,%rbp
  add    %eax,%eax
  movd   %eax,%xmm0
  mov    -0x8(%r12),%eax
  add    %eax,%eax
  movd   %eax,%xmm1
  mov    -0x4(%r12),%eax
  punpckldq %xmm1,%xmm0
  add    %eax,%eax
  movq   %xmm0,0x50(%rsp)
  mov    %eax,0x58(%rsp)
  call   <kpt_get_grid_point_double_mesh@plt>
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,-0x4(%rbp)
  cmp    (%rsp),%r12
  jne    L46
  mov    %r13,%rbp
  mov    %rbx,%r13
  mov    0x18(%rsp),%rbx
  addq   $0xc,0x8(%rsp)
  add    $0x4,%rbx
  cmp    %rbx,0x30(%rsp)
  jne    L23
L30:
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  mov    0x4c(%rsp),%eax
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  movl   $0x0,0x4c(%rsp)
  jmp    L30
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_BZ_triplets_at_q(int triplets[][3], const int grid_point, int bz_grid_address[][3], const int bz_map[], const int map_triplets[], const int num_map_triplets, const int mesh[3]) {
  int i, j, k, num_ir;
  int bz_address[3][3], bz_address_double[3], bzmesh[3];
  int *ir_grid_points;
  for (i = 0; i < 3; i++) {
    bzmesh[i] = mesh[i] * 2;
  }
  num_ir = 0;
  ir_grid_points = (int *)malloc(sizeof(int) * num_map_triplets);
  for (i = 0; i < num_map_triplets; i++) {
    if (map_triplets[i] == i) {
      ir_grid_points[num_ir] = i;
      num_ir++;
    }
  }
#pragma omp parallel for private(j, k, bz_address, bz_address_double)
  for (i = 0; i < num_ir; i++) {
    for (j = 0; j < 3; j++) {
      bz_address[0][j] = bz_grid_address[grid_point][j];
      bz_address[1][j] = bz_grid_address[ir_grid_points[i]][j];
      bz_address[2][j] = -bz_address[0][j] - bz_address[1][j];
    }
    for (j = 2; j > -1; j--) {
      if (get_third_q_of_triplets_at_q(bz_address, j, bz_map, mesh, bzmesh) == 0) {
        break;
      }
    }
    for (j = 0; j < 3; j++) {
      for (k = 0; k < 3; k++) {
        bz_address_double[k] = bz_address[j][k] * 2;
      }
      triplets[i][j] = bz_map[kpt_get_grid_point_double_mesh(bz_address_double, bzmesh)];
    }
  }
  free(ir_grid_points);
  return num_ir;
}
```