user: 请从给定的汇编指令推导出C源代码:

```asm
<grid_abs_squared>:
  endbr64
  push   %rbp
  movapd %xmm0,%xmm7
  mov    %esi,%r11d
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %edi,%ebx
  sub    $0xc8,%rsp
  movsd  D36(%rip),%xmm0
  mov    %edi,-0xb0(%rbp)
  mov    %r9,%rdi
  mov    %esi,-0xac(%rbp)
  mov    %r8,%rsi
  mov    0x10(%rbp),%r8
  movapd %xmm0,%xmm5
  mov    %rdx,-0xe8(%rbp)
  mov    %rsp,%rdx
  divsd  %xmm7,%xmm5
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %r11d,%eax
  mov    %rax,-0xe0(%rbp)
  shl    $0x3,%rax
  mov    %rax,-0x70(%rbp)
  mov    %ebx,%eax
  shr    %ebx
  lea    0xf(,%rax,8),%rax
  mov    %ebx,-0xb4(%rbp)
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%r9
  and    $0xfffffffffffff000,%r9
  sub    %r9,%rdx
  divsd  %xmm1,%xmm0
  movsd  %xmm5,-0x48(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  cmp    %rdx,%rsp
  je     L5
L83:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L83
L5:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L456
L267:
  mov    -0xb0(%rbp),%edx
  mov    %rsp,-0xc0(%rbp)
  test   %edx,%edx
  je     L107
  mov    -0xb0(%rbp),%ebx
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L127
  movd   -0xb4(%rbp),%xmm5
  shr    $0x2,%ebx
  mov    %rsp,%r11
  movdqa D39(%rip),%xmm4
  mov    %ebx,%edx
  movdqa D0(%rip),%xmm3
  mov    %r11,%rax
  pshufd $0x0,%xmm5,%xmm6
  shl    $0x5,%rdx
  movapd %xmm7,%xmm5
  unpcklpd %xmm5,%xmm5
  add    %r11,%rdx
L353:
  movdqa %xmm4,%xmm0
  add    $0x20,%rax
  paddd  %xmm3,%xmm4
  psubd  %xmm6,%xmm0
  cvtdq2pd %xmm0,%xmm2
  mulpd  %xmm5,%xmm2
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  mulpd  %xmm5,%xmm0
  movups %xmm2,-0x20(%rax)
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L353
  mov    -0xb0(%rbp),%ebx
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%ebx
  je     L107
L24:
  mov    -0xc0(%rbp),%rbx
  movslq %eax,%rdx
  pxor   %xmm0,%xmm0
  mov    -0xb0(%rbp),%r11d
  lea    (%rbx,%rdx,8),%r9
  mov    -0xb4(%rbp),%ebx
  mov    %eax,%edx
  sub    %ebx,%edx
  cvtsi2sd %edx,%xmm0
  lea    0x1(%rax),%edx
  mulsd  %xmm7,%xmm0
  movsd  %xmm0,(%r9)
  cmp    %edx,%r11d
  jbe    L107
  sub    %ebx,%edx
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm7,%xmm0
  movsd  %xmm0,0x8(%r9)
  cmp    %eax,%r11d
  jbe    L107
  sub    %ebx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm7,%xmm0
  movsd  %xmm0,0x10(%r9)
L107:
  mov    -0xac(%rbp),%eax
  mov    %rsp,%rdx
  shr    %eax
  mov    %eax,-0xb8(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%r9
  and    $0xfffffffffffff000,%r9
  sub    %r9,%rdx
  cmp    %rdx,%rsp
  je     L172
L270:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L270
L172:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L297
L77:
  mov    -0xac(%rbp),%eax
  mov    %rsp,-0xc8(%rbp)
  test   %eax,%eax
  je     L1
  mov    -0xac(%rbp),%ebx
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L170
  movd   -0xb8(%rbp),%xmm5
  shr    $0x2,%ebx
  mov    %rsp,%r11
  movdqa D39(%rip),%xmm4
  mov    %ebx,%edx
  movdqa D0(%rip),%xmm3
  mov    %r11,%rax
  pshufd $0x0,%xmm5,%xmm6
  shl    $0x5,%rdx
  movapd %xmm1,%xmm5
  unpcklpd %xmm5,%xmm5
  add    %r11,%rdx
L2:
  movdqa %xmm4,%xmm0
  add    $0x20,%rax
  paddd  %xmm3,%xmm4
  psubd  %xmm6,%xmm0
  cvtdq2pd %xmm0,%xmm2
  mulpd  %xmm5,%xmm2
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  mulpd  %xmm5,%xmm0
  movups %xmm2,-0x20(%rax)
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L2
  mov    -0xac(%rbp),%ebx
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%ebx
  je     L1
L65:
  mov    -0xc8(%rbp),%rbx
  movslq %eax,%rdx
  pxor   %xmm0,%xmm0
  mov    -0xac(%rbp),%r11d
  lea    (%rbx,%rdx,8),%r9
  mov    -0xb8(%rbp),%ebx
  mov    %eax,%edx
  sub    %ebx,%edx
  cvtsi2sd %edx,%xmm0
  lea    0x1(%rax),%edx
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%r9)
  cmp    %edx,%r11d
  jbe    L1
  sub    %ebx,%edx
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r9)
  cmp    %r11d,%eax
  jae    L1
  sub    %ebx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%r9)
L1:
  mov    0x18(%rbp),%eax
  mov    %rsp,%r9
  lea    0x1(%rax,%rax,1),%eax
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  shr    $0x4,%rdx
  shl    $0x4,%rdx
  mov    %rdx,%r10
  and    $0xfffffffffffff000,%r10
  sub    %r10,%r9
  cmp    %r9,%rsp
  je     L192
L27:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %r9,%rsp
  jne    L27
L192:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L311
L332:
  shr    $0x4,%rax
  mov    %rsp,%rdx
  mov    %rsp,-0x98(%rbp)
  shl    $0x4,%rax
  mov    %rax,%r9
  and    $0xfffffffffffff000,%r9
  sub    %r9,%rdx
  cmp    %rdx,%rsp
  je     L139
L362:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L362
L139:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L399
L368:
  mov    %rsp,%r15
  test   %ecx,%ecx
  je     L25
  mov    0x18(%rbp),%eax
  mov    %rdi,-0x80(%rbp)
  mov    %r8,-0x90(%rbp)
  add    $0x1,%eax
  mov    %rsi,-0xa0(%rbp)
  mov    %eax,-0xcc(%rbp)
  lea    0x8(%rsi),%rax
  mov    %rax,-0x58(%rbp)
  lea    -0x1(%rcx),%eax
  lea    0x8(%rdi,%rax,8),%rax
  mov    %rax,-0xd8(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0xa8(%rbp)
  nopl   (%rax)
L314:
  mov    -0x80(%rbp),%r11
  movsd  -0x48(%rbp),%xmm0
  mov    $0x0,%edi
  mov    -0x90(%rbp),%rbx
  mov    -0xcc(%rbp),%edx
  movsd  (%r11),%xmm1
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  movsd  -0x50(%rbp),%xmm0
  mulsd  (%rbx),%xmm0
  add    -0xb4(%rbp),%eax
  mov    %eax,%esi
  cvttsd2si %xmm0,%ebx
  add    -0xb8(%rbp),%ebx
  sub    0x18(%rbp),%esi
  cmovns %esi,%edi
  add    %edx,%eax
  mov    $0x0,%esi
  mov    %ebx,%ecx
  cmovns %eax,%esi
  mov    -0xb0(%rbp),%eax
  cmp    %eax,%edi
  cmova  %eax,%edi
  cmp    %eax,%esi
  cmova  %eax,%esi
  sub    0x18(%rbp),%ecx
  mov    $0x0,%eax
  cmovns %ecx,%eax
  add    %edx,%ebx
  mov    %edi,-0x74(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %eax,%ecx
  mov    $0x0,%eax
  cmovs  %eax,%ebx
  mov    %ecx,%eax
  mov    -0xac(%rbp),%ecx
  cmp    %ecx,%eax
  cmova  %ecx,%eax
  cmp    %ecx,%ebx
  cmova  %ecx,%ebx
  mov    %eax,-0x60(%rbp)
  cmp    %edi,%esi
  jle    L180
  mov    -0xc0(%rbp),%rcx
  movslq %edi,%rax
  sub    %edi,%esi
  mov    -0x98(%rbp),%r12
  mov    %ebx,-0x88(%rbp)
  lea    (%rcx,%rax,8),%r13
  mov    -0xa8(%rbp),%rax
  mov    %esi,%ecx
  mov    %r12,%r14
  sub    $0x1,%ecx
  mov    %r13,%rbx
  mov    %r11,%r13
  lea    (%rax,%rcx,8),%rax
  mov    %rax,%r12
  jmp    L9
  cs nopw 0x0(%rax,%rax,1)
L123:
  movsd  0x0(%r13),%xmm1
L9:
  movsd  (%rbx),%xmm0
  add    $0x8,%r14
  add    $0x8,%rbx
  subsd  %xmm1,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  call   <sinc@plt>
  mulsd  -0x48(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%r14)
  cmp    %r12,%r14
  jne    L123
  mov    -0x88(%rbp),%ebx
L180:
  cmp    -0x60(%rbp),%ebx
  jle    L355
  movslq -0x60(%rbp),%rax
  mov    %ebx,%ecx
  mov    -0xc8(%rbp),%rdi
  mov    %ebx,-0x78(%rbp)
  mov    -0x90(%rbp),%r13
  mov    %r15,%r14
  sub    %eax,%ecx
  lea    (%rdi,%rax,8),%r12
  mov    %rax,-0x88(%rbp)
  sub    $0x1,%ecx
  mov    %r12,%rbx
  lea    0x8(%r15,%rcx,8),%rax
  mov    %rax,%r12
  nopl   0x0(%rax,%rax,1)
L295:
  movsd  (%rbx),%xmm0
  subsd  0x0(%r13),%xmm0
  add    $0x8,%r14
  add    $0x8,%rbx
  mulsd  -0x50(%rbp),%xmm0
  call   <sinc@plt>
  mulsd  -0x50(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%r14)
  cmp    %r12,%r14
  jne    L295
  mov    -0x78(%rbp),%ebx
  mov    -0x74(%rbp),%edi
  cmp    %edi,-0x68(%rbp)
  jle    L355
  movslq %edi,%rax
  mov    -0x88(%rbp),%rdi
  mov    -0x68(%rbp),%edx
  mov    %ebx,%r10d
  mov    %rax,%rsi
  imul   -0xe0(%rbp),%rax
  mov    -0xe8(%rbp),%rcx
  sub    %esi,%edx
  mov    -0xa8(%rbp),%rsi
  mov    -0x98(%rbp),%r8
  sub    $0x1,%edx
  mov    -0xa0(%rbp),%r14
  add    %rdi,%rax
  lea    (%rsi,%rdx,8),%rsi
  neg    %rdi
  lea    (%rcx,%rax,8),%rax
  mov    -0x60(%rbp),%ecx
  mov    %rdi,%r13
  mov    %rsi,-0x68(%rbp)
  shl    $0x3,%r13
  sub    %ecx,%r10d
  lea    (%r15,%r13,1),%r12
  mov    %r10d,%edx
  lea    0x0(,%rdx,8),%rdi
  mov    %r10d,%edx
  mov    %rdi,-0x60(%rbp)
  shr    %edx
  mov    %r10d,%edi
  and    $0xfffffffe,%edi
  lea    -0x1(%rdx),%esi
  add    %edi,%ecx
  add    $0x1,%rsi
  mov    %edi,-0x74(%rbp)
  movslq %edi,%rdi
  shl    $0x4,%rsi
  movslq %ecx,%rcx
  xchg   %ax,%ax
L190:
  mov    -0x60(%rbp),%r11
  movsd  (%r8),%xmm1
  lea    (%rax,%r13,1),%rdx
  lea    (%rax,%r11,1),%r9
  cmp    %r9,%r14
  setae  %r11b
  cmp    -0x58(%rbp),%rax
  setae  %r9b
  or     %r11b,%r9b
  je     L85
  cmp    $0x1,%r10d
  je     L85
  movsd  (%r14),%xmm2
  movapd %xmm1,%xmm3
  xor    %r9d,%r9d
  unpcklpd %xmm3,%xmm3
  unpcklpd %xmm2,%xmm2
  nopw   0x0(%rax,%rax,1)
L247:
  movupd (%r15,%r9,1),%xmm0
  movupd (%rax,%r9,1),%xmm7
  mulpd  %xmm3,%xmm0
  mulpd  %xmm2,%xmm0
  addpd  %xmm7,%xmm0
  movups %xmm0,(%rax,%r9,1)
  add    $0x10,%r9
  cmp    %r9,%rsi
  jne    L247
  cmp    -0x74(%rbp),%r10d
  je     L200
  mulsd  (%r15,%rdi,8),%xmm1
  movsd  (%r14),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rdx,%rcx,8),%xmm0
  movsd  %xmm0,(%rdx,%rcx,8)
L200:
  add    $0x8,%r8
  add    -0x70(%rbp),%rax
  cmp    -0x68(%rbp),%r8
  jne    L190
L355:
  addq   $0x8,-0x80(%rbp)
  mov    -0x80(%rbp),%rax
  addq   $0x8,-0x90(%rbp)
  addq   $0x8,-0xa0(%rbp)
  addq   $0x8,-0x58(%rbp)
  cmp    -0xd8(%rbp),%rax
  jne    L314
L25:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L166
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L311:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L332
L297:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L77
L456:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L267
  nopl   (%rax)
L85:
  mov    -0x88(%rbp),%r9
  nop
L419:
  movsd  (%r12,%r9,8),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  (%r14),%xmm0
  addsd  (%rdx,%r9,8),%xmm0
  movsd  %xmm0,(%rdx,%r9,8)
  add    $0x1,%r9
  cmp    %r9d,%ebx
  jg     L419
  jmp    L200
L170:
  xor    %eax,%eax
  jmp    L65
L127:
  xor    %eax,%eax
  jmp    L24
L399:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L368
L166:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D36
type_infered: f64
name: retrieve_data
arguments: data_label: D39
type_infered: byte[16]
name: retrieve_data
arguments: data_label: D0
type_infered: byte[16]

tool: D36: 1

tool: {"D39": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D0": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
void grid_abs_squared(unsigned int Nk, unsigned int Nq, double grid[Nk][Nq], double vk, double vq, unsigned int Nuv, double inpoints[Nuv], double u[Nuv], double v[Nuv], unsigned int precision) {
  int i;
  int j;
  int l;
  double vk_inv = 1. / vk;
  double vq_inv = 1. / vq;
  int shift_k = Nk / 2;
  double pos_k[Nk];
  for (i = 0; i < Nk; i++)
    pos_k[i] = (i - shift_k) * vk;
  int shift_q = Nq / 2;
  double pos_q[Nq];
  for (i = 0; i < Nq; i++)
    pos_q[i] = (i - shift_q) * vq;
  int ind_k;
  int ind_q;
  int max_ind_k;
  int max_ind_q;
  int min_ind_k;
  int min_ind_q;
  double tempdouble;
  double temp_k[precision * 2 + 1];
  double temp_q[precision * 2 + 1];
  for (i = 0; i < Nuv; i++) {
    ind_k = (int)(u[i] * vk_inv);
    ind_k += Nk / 2;
    ind_q = (int)(v[i] * vq_inv);
    ind_q += Nq / 2;
    min_ind_k = ind_k - precision;
    max_ind_k = ind_k + precision + 1;
    if (min_ind_k < 0)
      min_ind_k = 0;
    if (max_ind_k < 0)
      max_ind_k = 0;
    if (min_ind_k > Nk)
      min_ind_k = Nk;
    if (max_ind_k > Nk)
      max_ind_k = Nk;
    min_ind_q = ind_q - precision;
    max_ind_q = ind_q + precision + 1;
    if (min_ind_q < 0)
      min_ind_q = 0;
    if (max_ind_q < 0)
      max_ind_q = 0;
    if (min_ind_q > Nq)
      min_ind_q = Nq;
    if (max_ind_q > Nq)
      max_ind_q = Nq;
    for (j = min_ind_k; j < max_ind_k; j++) {
      tempdouble = vk_inv * sinc((pos_k[j] - u[i]) * vk_inv);
      temp_k[j - min_ind_k] = tempdouble * tempdouble;
    }
    for (l = min_ind_q; l < max_ind_q; l++) {
      tempdouble = vq_inv * sinc((pos_q[l] - v[i]) * vq_inv);
      temp_q[l - min_ind_q] = tempdouble * tempdouble;
    }
    for (j = min_ind_k; j < max_ind_k; j++) {
      for (l = min_ind_q; l < max_ind_q; l++) {
        grid[j][l] += temp_k[j - min_ind_k] * temp_q[l - min_ind_q] * inpoints[i];
      }
    }
  }
}
```