user: Translate the below assembly code into C programming language:

```asm
<cu_convolve_image_psf>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  mov    %edx,%esi
  push   %r12
  push   %rbp
  lea    -0x1(%rsi),%ebp
  lea    0x1(%r9),%esi
  push   %rbx
  lea    -0x1(%r13),%ebx
  sub    $0x9a8,%rsp
  mov    0xa00(%rsp),%rax
  mov    %edi,0x7c(%rsp)
  mov    0xa20(%rsp),%r11
  mov    0xa18(%rsp),%rdi
  mov    %edx,0x180(%rsp)
  mov    %rax,0xa8(%rsp)
  mov    0xa08(%rsp),%rax
  mov    %ecx,0x114(%rsp)
  mov    %rax,0xb0(%rsp)
  mov    0xa10(%rsp),%rax
  mov    %r8d,0x128(%rsp)
  mov    %rax,0xa0(%rsp)
  mov    0xa28(%rsp),%rax
  mov    %r9d,0x84(%rsp)
  mov    %rax,0x20(%rsp)
  mov    0xa30(%rsp),%rax
  mov    %rdi,0x88(%rsp)
  mov    %rax,0x28(%rsp)
  mov    0xa38(%rsp),%rax
  mov    %r11,0x18(%rsp)
  mov    %rax,0x68(%rsp)
  mov    0xa40(%rsp),%rax
  mov    %rax,0x118(%rsp)
  mov    0xa48(%rsp),%rax
  mov    %rax,0x120(%rsp)
  mov    0xa50(%rsp),%rax
  movsd  0x8(%rdi),%xmm6
  mov    %rax,0x170(%rsp)
  mov    0xa58(%rsp),%rax
  mov    %rax,0x178(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x998(%rsp)
  xor    %eax,%eax
  mov    %ebx,%eax
  mov    %esi,0xc0(%rsp)
  cltd
  movsd  %xmm6,0x8(%rsp)
  idiv   %ecx
  mov    %eax,0x12c(%rsp)
  mov    %ebp,%eax
  cltd
  idiv   %r8d
  mov    %eax,0x130(%rsp)
  lea    0x2(%r9),%eax
  imul   %esi,%eax
  mov    %eax,%esi
  mov    %eax,0xe0(%rsp)
  shr    $0x1f,%eax
  add    %esi,%eax
  mov    0x9e0(%rsp),%esi
  sar    %eax
  mov    %eax,0xbc(%rsp)
  mov    0x9e0(%rsp),%eax
  lea    0x2(%rsi),%edx
  add    $0x1,%eax
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x34(%rsp)
  cvttsd2si (%rdi),%eax
  lea    -0x1(%rax),%esi
  cmp    $0x1,%esi
  jle    L663
  cltq
  pxor   %xmm6,%xmm6
  mov    $0x1,%edx
  lea    0x8(,%rax,8),%rax
  movsd  %xmm6,0x38(%rsp)
  lea    (%r11,%rax,1),%rcx
  sub    $0x8,%rax
L35:
  mov    %rcx,%r8
  mov    $0x1,%edi
  movapd %xmm6,%xmm0
L657:
  add    $0x1,%edi
  addsd  (%r8),%xmm0
  add    %rax,%r8
  cmp    %esi,%edi
  jne    L657
  add    $0x1,%edx
  movapd %xmm0,%xmm6
  add    $0x8,%rcx
  cmp    %esi,%edx
  jne    L35
  movq   %xmm0,%r12
L421:
  mov    0x7c(%rsp),%r10d
  test   %r10d,%r10d
  jne    L6
  movsd  0x8(%rsp),%xmm0
  movsd  D134(%rip),%xmm1
  addsd  %xmm0,%xmm0
  mulsd  D170(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %r12,%xmm1
  mulsd  D96(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xd8(%rsp)
L343:
  mov    0x12c(%rsp),%r9d
  test   %r9d,%r9d
  js     L426
  mov    0x114(%rsp),%edx
  mov    0x128(%rsp),%esi
  mov    0x130(%rsp),%r8d
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x184(%rsp)
  mov    %eax,%edi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  mov    %eax,0x134(%rsp)
  test   %r8d,%r8d
  js     L426
  pxor   %xmm6,%xmm6
  pxor   %xmm5,%xmm5
  movslq %edx,%rax
  mov    %edi,0x78(%rsp)
  cvtsi2sd %ebx,%xmm6
  movsd  D114(%rip),%xmm0
  mov    %rax,0x160(%rsp)
  movslq %r13d,%rax
  cvtsi2sd %ebp,%xmm5
  shl    $0x3,%rax
  movq   $0x0,0x108(%rsp)
  imul   %r13d,%esi
  mov    %rax,0xe8(%rsp)
  lea    0x190(%rsp),%rax
  movl   $0x8,0x110(%rsp)
  movsd  %xmm6,0x138(%rsp)
  mulsd  %xmm0,%xmm6
  mulsd  %xmm5,%xmm0
  mov    %esi,0x168(%rsp)
  movl   $0x0,0xf8(%rsp)
  mov    %rax,0x188(%rsp)
  movsd  %xmm5,0x148(%rsp)
  movsd  %xmm6,0x140(%rsp)
  movsd  %xmm0,0x150(%rsp)
L218:
  mov    0x78(%rsp),%eax
  mov    0x184(%rsp),%esi
  pxor   %xmm0,%xmm0
  mov    %r13d,%ebx
  movl   $0x8,0x104(%rsp)
  cvtsi2sd %eax,%xmm0
  add    %esi,%eax
  lea    (%rsi,%rsi,1),%edx
  movl   $0x0,0x100(%rsp)
  cmp    %r13d,%eax
  mov    %r13d,0x158(%rsp)
  subsd  0x140(%rsp),%xmm0
  divsd  0x138(%rsp),%xmm0
  cmovle %eax,%ebx
  sub    %edx,%eax
  movsd  %xmm0,0x58(%rsp)
  mov    %eax,0x16c(%rsp)
  mov    %ebx,0x15c(%rsp)
  movl   $0x0,0xe4(%rsp)
  movl   $0x0,0xfc(%rsp)
L372:
  mov    0xe4(%rsp),%eax
  add    0x134(%rsp),%eax
  pxor   %xmm0,%xmm0
  movq   $0x0,0xf0(%rsp)
  mov    %eax,0x80(%rsp)
  cvtsi2sd %eax,%xmm0
  subsd  0x150(%rsp),%xmm0
  divsd  0x148(%rsp),%xmm0
  movsd  %xmm0,0x60(%rsp)
L54:
  mov    0xf0(%rsp),%rax
  mov    0x188(%rsp),%rbx
  movl   $0x0,0x50(%rsp)
  mov    %eax,0xb8(%rsp)
  lea    (%rbx,%rax,8),%rax
  mov    %rax,0x90(%rsp)
L379:
  mov    0x90(%rsp),%rax
  sub    $0x8,%rsp
  movq   $0x0,(%rax)
  xor    %eax,%eax
  push   0x30(%rsp)
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0xa8(%rsp),%r9
  mov    0xa0(%rsp),%r8d
  mov    0x98(%rsp),%ecx
  mov    0x70(%rsp),%edx
  mov    0xd8(%rsp),%esi
  mov    0x9c(%rsp),%edi
  call   <integrated_profile@plt>
  pxor   %xmm5,%xmm5
  movdqa D99(%rip),%xmm8
  cvtsi2sd %eax,%xmm5
  movsd  %xmm5,0x60(%rsp)
  mov    0xa08(%rsp),%edi
  add    $0x20,%rsp
  test   %edi,%edi
  jle    L753
  cmpl   $0x1,0xe0(%rsp)
  jle    L67
  movsd  0x38(%rsp),%xmm6
  mov    0xbc(%rsp),%eax
  pcmpeqd %xmm11,%xmm11
  movdqa %xmm8,%xmm7
  mov    0x68(%rsp),%r13
  mov    0x84(%rsp),%r15d
  cmp    0x9e8(%rsp),%eax
  mov    %eax,%r14d
  movsd  %xmm6,0x8(%rsp)
  movdqa D49(%rip),%xmm10
  cmovg  0x9e8(%rsp),%r14d
  xor    %ebp,%ebp
  xchg   %ax,%ax
L187:
  mov    0x9f0(%rsp),%esi
  test   %esi,%esi
  jle    L492
  pxor   %xmm1,%xmm1
  xor    %ebx,%ebx
  test   %r15d,%r15d
  jg     L469
L18:
  movsd  0x40(%rsp),%xmm6
  mulsd  0x0(%r13),%xmm6
  movsd  0x58(%rsp),%xmm0
  movsd  %xmm6,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  %xmm0,0x48(%rsp)
  movsd  0x60(%rsp),%xmm0
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm6
  pcmpeqd %xmm11,%xmm11
  movdqa D99(%rip),%xmm8
  mulsd  0x48(%rsp),%xmm6
  movapd %xmm0,%xmm1
  movdqa D49(%rip),%xmm10
  movdqa %xmm8,%xmm7
  movapd %xmm6,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
L492:
  add    $0x1,%ebp
  add    $0x8,%r13
  cmp    %r14d,%ebp
  jl     L187
  cmp    %ebp,0x9e8(%rsp)
  jle    L277
L602:
  movslq %ebp,%r14
  sub    0xbc(%rsp),%ebp
  mov    %ebp,%r15d
  xchg   %ax,%ax
L741:
  mov    %r15d,%eax
  mov    %r14d,%esi
  cltd
  idivl  0x34(%rsp)
  lea    0x1(%rax),%r12d
  cmp    %r12d,0x9f0(%rsp)
  jle    L273
  mov    0xa8(%rsp),%rbx
  movslq %r12d,%rax
  mov    %rax,0x70(%rsp)
  mov    (%rbx,%rax,4),%ebx
  mov    %ebx,0x10(%rsp)
  mov    0xb0(%rsp),%rbx
  mov    (%rbx,%rax,4),%eax
  mov    %eax,0x48(%rsp)
  test   %r12d,%r12d
  je     L259
  mov    0x9e0(%rsp),%ecx
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  test   %ecx,%ecx
  jg     L56
  test   %r12d,%r12d
  jle    L190
L439:
  mov    0x10(%rsp),%r12d
  mov    0x48(%rsp),%edx
  sub    $0x8,%rsp
  xor    %eax,%eax
  add    0xc0(%rsp),%r12d
  add    0x58(%rsp),%edx
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    %r12d,%esi
  push   0x30(%rsp)
  mov    0xa8(%rsp),%r9
  mov    0xa0(%rsp),%r8d
  mov    0x98(%rsp),%ecx
  mov    0x9c(%rsp),%edi
  mov    %edx,0x30(%rsp)
  call   <integrated_profile@plt>
  mov    0xc0(%rsp),%rsi
  add    $0x20,%rsp
  mov    0x70(%rsp),%rdx
  mov    (%rsi,%rdx,4),%edx
  test   %edx,%edx
  mov    0x10(%rsp),%edx
  jne    L718
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L139:
  mov    0x68(%rsp),%rax
  subsd  0x40(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  mulsd  (%rax,%r14,8),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  0x58(%rsp),%xmm0
  call   <pow@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  movsd  %xmm0,0x48(%rsp)
  movsd  0x60(%rsp),%xmm0
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm5
  mulsd  0x48(%rsp),%xmm5
  movdqa D99(%rip),%xmm8
  movapd %xmm0,%xmm1
  movapd %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
L273:
  add    $0x1,%r14
  add    $0x1,%r15d
  cmp    %r14d,0x9e8(%rsp)
  jg     L741
L277:
  mov    0x90(%rsp),%rax
  addl   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%ebx
  movsd  0x8(%rsp),%xmm0
  divsd  0xd8(%rsp),%xmm0
  sub    $0xffffffffffffff80,%rax
  movsd  %xmm0,-0x80(%rax)
  mov    %rax,0x90(%rsp)
  cmp    $0x10,%ebx
  jne    L379
  addq   $0x1,0xf0(%rsp)
  mov    0xf0(%rsp),%rax
  cmp    $0x10,%rax
  jne    L54
  mov    0x180(%rsp),%edi
  mov    0x80(%rsp),%eax
  add    0x134(%rsp),%eax
  mov    0x15c(%rsp),%esi
  cmp    %edi,%eax
  mov    0x16c(%rsp),%ebx
  cmovg  %edi,%eax
  mov    %eax,0x60(%rsp)
  cmp    %ebx,%esi
  jle    L12
  mov    0xe4(%rsp),%ebx
  cmp    %eax,%ebx
  jge    L12
  mov    0x108(%rsp),%rdx
  movslq 0x100(%rsp),%rax
  mov    0x110(%rsp),%r15d
  mov    0x178(%rsp),%rbp
  add    %rdx,%rax
  mov    %rdx,0x90(%rsp)
  mov    $0xffffff88,%edx
  shl    $0x3,%rax
  mov    %r15d,0x8(%rsp)
  mov    %rax,0x98(%rsp)
  mov    $0x8,%eax
  sub    %esi,%eax
  mov    0x158(%rsp),%esi
  mov    %eax,0xd4(%rsp)
  mov    %ebx,%eax
  neg    %eax
  shl    $0x4,%eax
  sub    %eax,%edx
  lea    0x80(%rax),%ebx
  mov    %edx,0xf0(%rsp)
  mov    %ebx,0xc8(%rsp)
  mov    0x170(%rsp),%rbx
L249:
  mov    0x8(%rsp),%edx
  mov    $0x8,%eax
  sub    %edx,%eax
  cmp    $0x7,%eax
  mov    %eax,0xc4(%rsp)
  mov    $0x0,%eax
  cmovle %edx,%eax
  add    %esi,%edx
  mov    %eax,0x48(%rsp)
  mov    $0x10,%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,0x50(%rsp)
  mov    0xe4(%rsp),%eax
  cmp    $0x7,%eax
  jle    L129
  mov    %eax,0x10(%rsp)
L512:
  mov    0x10(%rsp),%eax
  mov    0x118(%rsp),%rdx
  mov    %eax,%r9d
  lea    -0x8(%rax),%r15d
  mov    0xc4(%rsp),%eax
  add    0x48(%rsp),%eax
  imul   %esi,%r9d
  mov    %eax,0x70(%rsp)
  mov    %r15d,%r14d
  mov    0x50(%rsp),%eax
  sub    0x8(%rsp),%eax
  imul   %esi,%r14d
  mov    %eax,0x40(%rsp)
  movslq %r9d,%r9
  add    0x90(%rsp),%r9
  shl    $0x3,%r9
  lea    (%rdx,%r9,1),%r10
  add    0x120(%rsp),%r9
L615:
  mov    %edi,%edx
  mov    $0x10,%eax
  mov    0x50(%rsp),%r11d
  movq   $0x0,(%r10)
  sub    %r15d,%edx
  movq   $0x0,(%r9)
  cmp    %eax,%edx
  cmovle %edx,%eax
  cmp    %r11d,0x48(%rsp)
  jge    L167
  test   %edx,%edx
  jle    L167
  mov    0x70(%rsp),%edx
  lea    -0x8(%rdx),%r13d
  mov    0x10(%rsp),%edx
  lea    -0x8(%rdx,%rax,1),%r11d
  nopl   0x0(%rax)
L300:
  mov    0x8(%rsp),%eax
  cmp    %r13d,%esi
  lea    0x0(%r13,%r14,1),%edx
  setg   %r12b
  lea    0x0(%r13,%rax,1),%ecx
  mov    %r15d,%eax
  nopl   0x0(%rax,%rax,1)
L412:
  cmp    %edi,%eax
  jge    L665
  test   %r12b,%r12b
  je     L665
  movslq %ecx,%r8
  movsd  0x190(%rsp,%r8,8),%xmm0
  movslq %edx,%r8
  movsd  (%rbx,%r8,8),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%r10),%xmm1
  movsd  %xmm1,(%r10)
  mulsd  0x0(%rbp,%r8,8),%xmm0
  addsd  (%r9),%xmm0
  movsd  %xmm0,(%r9)
L665:
  add    $0x1,%eax
  add    $0x10,%ecx
  add    %esi,%edx
  cmp    %eax,%r11d
  jne    L412
  add    $0x1,%r13d
  cmp    0x40(%rsp),%r13d
  jne    L300
L167:
  mov    0xe8(%rsp),%rdx
  addl   $0x1,0x10(%rsp)
  add    $0x1,%r15d
  add    %esi,%r14d
  mov    0x10(%rsp),%eax
  add    %rdx,%r10
  add    %rdx,%r9
  cmp    %eax,0x60(%rsp)
  jg     L615
L274:
  subl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  addq   $0x1,0x90(%rsp)
  addq   $0x8,0x98(%rsp)
  cmp    0xd4(%rsp),%eax
  jne    L249
L12:
  mov    0x128(%rsp),%esi
  addl   $0x1,0xfc(%rsp)
  mov    0x168(%rsp),%edx
  add    %esi,0xe4(%rsp)
  add    %edx,0x100(%rsp)
  mov    0xfc(%rsp),%eax
  sub    %esi,0x104(%rsp)
  cmp    %eax,0x130(%rsp)
  jge    L372
  mov    0x114(%rsp),%esi
  addl   $0x1,0xf8(%rsp)
  add    %esi,0x78(%rsp)
  mov    0x158(%rsp),%r13d
  sub    %esi,0x110(%rsp)
  mov    0xf8(%rsp),%eax
  mov    0x160(%rsp),%rsi
  add    %rsi,0x108(%rsp)
  cmp    %eax,0x12c(%rsp)
  jge    L218
L426:
  mov    0x998(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L666
  add    $0x9a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L259:
  mov    0x84(%rsp),%eax
  pxor   %xmm1,%xmm1
  test   %eax,%eax
  jg     L551
L682:
  mov    0x68(%rsp),%rax
  movsd  0x40(%rsp),%xmm5
  movsd  0x58(%rsp),%xmm0
  mulsd  (%rax,%r14,8),%xmm5
  movsd  %xmm5,0x48(%rsp)
  call   <pow@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12d,%xmm1
  movsd  %xmm0,0x10(%rsp)
  movsd  0x60(%rsp),%xmm0
  call   <pow@plt>
  movdqa D99(%rip),%xmm8
  movapd %xmm0,%xmm1
  movsd  0x10(%rsp),%xmm0
  mulsd  0x48(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L273
L469:
  movd   %ebp,%xmm5
  mov    %r15d,%edx
  xor    %eax,%eax
  xor    %r10d,%r10d
  mov    0xc0(%rsp),%r9d
  pshufd $0x0,%xmm5,%xmm13
  pxor   %xmm12,%xmm12
L658:
  mov    %r15d,%edi
  sub    %edx,%edi
  cmp    $0x18,%edx
  jbe    L356
  movd   %eax,%xmm6
  movd   %r10d,%xmm5
  mov    %r9d,%ecx
  xor    %eax,%eax
  pshufd $0x0,%xmm5,%xmm4
  pshufd $0x0,%xmm6,%xmm2
  movd   %edi,%xmm5
  shr    $0x2,%ecx
  pshufd $0x0,%xmm5,%xmm9
  movdqa D46(%rip),%xmm6
  paddd  %xmm10,%xmm4
  pxor   %xmm1,%xmm1
  movdqa %xmm11,%xmm3
  movdqa %xmm10,%xmm5
  xchg   %ax,%ax
L531:
  movdqa %xmm4,%xmm0
  movdqa %xmm5,%xmm14
  paddd  %xmm7,%xmm4
  add    $0x1,%eax
  pcmpeqd %xmm13,%xmm0
  paddd  %xmm7,%xmm5
  pcmpeqd %xmm12,%xmm0
  movdqa %xmm0,%xmm15
  pand   %xmm0,%xmm2
  pand   %xmm0,%xmm3
  pandn  %xmm9,%xmm15
  pand   %xmm0,%xmm1
  por    %xmm15,%xmm2
  movdqa %xmm0,%xmm15
  pandn  %xmm6,%xmm0
  pandn  %xmm14,%xmm15
  por    %xmm0,%xmm1
  paddd  %xmm7,%xmm6
  por    %xmm15,%xmm3
  cmp    %eax,%ecx
  jne    L531
  movdqa %xmm3,%xmm4
  movd   %xmm1,%r11d
  psrldq $0x8,%xmm4
  movdqa %xmm4,%xmm0
  pcmpgtd %xmm3,%xmm0
  pand   %xmm0,%xmm4
  pandn  %xmm3,%xmm0
  movdqa %xmm0,%xmm3
  por    %xmm4,%xmm3
  movdqa %xmm3,%xmm4
  psrldq $0x4,%xmm4
  movdqa %xmm4,%xmm0
  pcmpgtd %xmm3,%xmm0
  pand   %xmm0,%xmm4
  pandn  %xmm3,%xmm0
  por    %xmm4,%xmm0
  movd   %xmm0,%eax
  pshufd $0x55,%xmm1,%xmm0
  cmp    $0xffffffff,%eax
  movd   %xmm0,%esi
  movd   %xmm0,%ecx
  cmovne %eax,%ebx
  movdqa %xmm1,%xmm0
  cmp    %esi,%r11d
  punpckhdq %xmm1,%xmm0
  cmovae %r11d,%ecx
  movd   %xmm0,%r8d
  cmp    %r8d,%ecx
  jb     L146
  pshufd $0x55,%xmm2,%xmm0
  movd   %xmm2,%r12d
  cmp    %esi,%r11d
  movd   %xmm0,%eax
  cmovae %r12d,%eax
L530:
  pshufd $0xff,%xmm1,%xmm1
  pshufd $0xff,%xmm2,%xmm2
  cmp    %r8d,%ecx
  cmovae %ecx,%r8d
  movd   %xmm1,%ecx
  movd   %xmm2,%esi
  cmp    %ecx,%r8d
  mov    %r9d,%ecx
  cmovb  %esi,%eax
  and    $0xfffffffc,%ecx
  lea    (%r10,%rcx,1),%r8d
  cmp    %r9d,%ecx
  je     L510
L312:
  sub    %ecx,%r8d
  nopl   (%rax)
L214:
  lea    (%r8,%rcx,1),%esi
  cmp    %esi,%ebp
  cmove  %ecx,%ebx
  cmove  %edi,%eax
  add    $0x1,%ecx
  cmp    %ecx,%edx
  jge    L214
L510:
  lea    0x1(%r10,%rdx,1),%r10d
  sub    $0x1,%edx
  sub    $0x1,%r9d
  cmp    $0xffffffff,%edx
  jne    L658
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  jmp    L18
  nopl   (%rax)
L146:
  movdqa %xmm2,%xmm0
  punpckhdq %xmm2,%xmm0
  movd   %xmm0,%eax
  jmp    L530
  xchg   %ax,%ax
L356:
  mov    %r10d,%r8d
  xor    %ecx,%ecx
  jmp    L312
L67:
  movsd  0x38(%rsp),%xmm5
  xor    %ebp,%ebp
  movsd  %xmm5,0x8(%rsp)
  jmp    L602
L551:
  mov    0x84(%rsp),%r13d
L339:
  mov    %r12d,0x98(%rsp)
  movd   %esi,%xmm6
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  mov    %r13d,%edx
  lea    0x1(%r13),%r9d
  xor    %ecx,%ecx
  xor    %r10d,%r10d
  pshufd $0x0,%xmm6,%xmm9
  pcmpeqd %xmm10,%xmm10
  nopl   0x0(%rax)
L228:
  test   %edx,%edx
  js     L344
  cmp    $0x18,%edx
  jbe    L631
  movd   %r10d,%xmm6
  movd   %ebx,%xmm5
  mov    %r9d,%edi
  xor    %eax,%eax
  pshufd $0x0,%xmm6,%xmm3
  movd   %ecx,%xmm6
  pshufd $0x0,%xmm5,%xmm4
  shr    $0x2,%edi
  pshufd $0x0,%xmm6,%xmm12
  paddd  D49(%rip),%xmm3
  movdqa D46(%rip),%xmm6
  pxor   %xmm2,%xmm2
  movdqa D49(%rip),%xmm5
  movdqa %xmm10,%xmm7
  nopw   0x0(%rax,%rax,1)
L368:
  movdqa %xmm3,%xmm0
  movdqa %xmm12,%xmm11
  movdqa %xmm5,%xmm1
  add    $0x1,%eax
  pcmpeqd %xmm9,%xmm0
  paddd  %xmm8,%xmm5
  paddd  %xmm8,%xmm3
  movdqa %xmm0,%xmm13
  pand   %xmm0,%xmm11
  pand   %xmm0,%xmm1
  pandn  %xmm4,%xmm13
  movdqa %xmm13,%xmm4
  por    %xmm11,%xmm4
  movdqa %xmm0,%xmm11
  pandn  %xmm7,%xmm11
  movdqa %xmm11,%xmm7
  por    %xmm1,%xmm7
  movdqa %xmm6,%xmm1
  paddd  %xmm8,%xmm6
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  movdqa %xmm0,%xmm2
  por    %xmm1,%xmm2
  cmp    %eax,%edi
  jne    L368
  movdqa %xmm7,%xmm0
  movd   %xmm2,%ebx
  movd   %xmm2,%r11d
  psrldq $0x8,%xmm0
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm7,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm7,%xmm1
  por    %xmm0,%xmm1
  movdqa %xmm1,%xmm3
  psrldq $0x4,%xmm3
  movdqa %xmm3,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm3
  pandn  %xmm1,%xmm0
  por    %xmm3,%xmm0
  movd   %xmm0,%eax
  pshufd $0x55,%xmm2,%xmm0
  movd   %xmm0,%r8d
  cmp    $0xffffffff,%eax
  movdqa %xmm2,%xmm0
  cmovne %eax,%ebp
  cmp    %ebx,%r8d
  punpckhdq %xmm2,%xmm0
  cmovae %r8d,%r11d
  movd   %xmm0,%edi
  cmp    %r11d,%edi
  jbe    L606
  movdqa %xmm4,%xmm0
  punpckhdq %xmm4,%xmm0
  movd   %xmm0,%ebx
L127:
  cmp    %r11d,%edi
  pshufd $0xff,%xmm2,%xmm2
  pshufd $0xff,%xmm4,%xmm4
  cmovb  %r11d,%edi
  movd   %xmm2,%r8d
  movd   %xmm4,%r12d
  cmp    %r8d,%edi
  mov    %r9d,%edi
  cmovb  %r12d,%ebx
  and    $0xfffffffc,%edi
  lea    (%rdi,%r10,1),%r8d
  cmp    %r9d,%edi
  je     L184
L806:
  sub    %edi,%r8d
  nop
L450:
  lea    (%r8,%rdi,1),%eax
  cmp    %eax,%esi
  cmove  %edi,%ebp
  cmove  %ecx,%ebx
  add    $0x1,%edi
  cmp    %edx,%edi
  jle    L450
L184:
  lea    0x1(%r10,%rdx,1),%r10d
L344:
  add    $0x1,%ecx
  sub    $0x1,%edx
  sub    $0x1,%r9d
  cmp    %ecx,%r13d
  jge    L228
  mov    0x98(%rsp),%r12d
  test   %r12d,%r12d
  jg     L439
L190:
  pxor   %xmm1,%xmm1
  mov    %ebp,%r12d
  cvtsi2sd %ebx,%xmm1
  jmp    L682
  nopl   0x0(%rax)
L606:
  pshufd $0x55,%xmm4,%xmm0
  cmp    %ebx,%r8d
  movd   %xmm4,%eax
  movd   %xmm0,%r12d
  cmova  %r12d,%eax
  mov    %eax,%ebx
  jmp    L127
L631:
  mov    %r10d,%r8d
  xor    %edi,%edi
  jmp    L806
L56:
  mov    0x9e0(%rsp),%r13d
  mov    %edx,%esi
  jmp    L339
L718:
  lea    0x2(%r12),%eax
  mov    %r15d,0xd4(%rsp)
  lea    -0x1(%r12),%r13d
  mov    0x7c(%rsp),%r12d
  mov    %eax,0x70(%rsp)
  lea    -0x1(%rdx),%eax
  pxor   %xmm0,%xmm0
  mov    %eax,0x98(%rsp)
  lea    0x2(%rdx),%eax
  mov    %eax,0x48(%rsp)
  mov    %ebp,0xc4(%rsp)
  mov    0x78(%rsp),%ebp
  mov    %ebx,0xd0(%rsp)
  mov    0x80(%rsp),%ebx
  mov    %r14,0xc8(%rsp)
  mov    0x88(%rsp),%r14
L759:
  mov    0x98(%rsp),%r15d
L375:
  movsd  %xmm0,0x10(%rsp)
  sub    $0x8,%rsp
  mov    %r15d,%edx
  mov    %r14,%r9
  push   0x30(%rsp)
  mov    %ebx,%r8d
  mov    %ebp,%ecx
  mov    %r13d,%esi
  push   0x30(%rsp)
  mov    %r12d,%edi
  xor    %eax,%eax
  add    $0x1,%r15d
  push   0x30(%rsp)
  call   <integrated_profile@plt>
  pxor   %xmm1,%xmm1
  movsd  0x30(%rsp),%xmm0
  add    $0x20,%rsp
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  cmp    0x48(%rsp),%r15d
  jne    L375
  add    $0x1,%r13d
  cmp    0x70(%rsp),%r13d
  jne    L759
  mov    0xc4(%rsp),%ebp
  mov    0xd0(%rsp),%ebx
  divsd  D107(%rip),%xmm0
  mov    0xc8(%rsp),%r14
  mov    0xd4(%rsp),%r15d
  jmp    L139
L753:
  movsd  0x38(%rsp),%xmm5
  movsd  %xmm5,0x8(%rsp)
  jmp    L277
L6:
  cmpl   $0x1,0x7c(%rsp)
  jne    L343
  mov    0x88(%rsp),%rax
  movsd  D172(%rip),%xmm3
  movsd  D172(%rip),%xmm2
  movsd  0x10(%rax),%xmm6
  movsd  0x18(%rax),%xmm5
  movsd  0x40(%rax),%xmm0
  movapd %xmm6,%xmm1
  movsd  %xmm6,0x40(%rsp)
  mulsd  %xmm6,%xmm1
  movsd  0x38(%rsp),%xmm6
  movsd  %xmm5,0x48(%rsp)
  mulsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm3
  movapd %xmm5,%xmm1
  mulsd  %xmm5,%xmm1
  divsd  %xmm1,%xmm2
  movapd %xmm3,%xmm1
  subsd  %xmm2,%xmm1
  addsd  %xmm2,%xmm3
  mulsd  %xmm1,%xmm1
  movsd  %xmm3,0x10(%rsp)
  addsd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm6
  movapd %xmm1,%xmm0
  ja     L502
  sqrtsd %xmm0,%xmm0
L58:
  addsd  0x10(%rsp),%xmm0
  ucomisd %xmm0,%xmm6
  ja     L671
  sqrtsd %xmm0,%xmm0
  movapd %xmm6,%xmm5
L640:
  movsd  D172(%rip),%xmm6
  ucomisd %xmm1,%xmm5
  divsd  %xmm0,%xmm6
  movsd  %xmm6,0x50(%rsp)
  ja     L505
  sqrtsd %xmm1,%xmm1
  movapd %xmm5,%xmm6
L786:
  movsd  0x10(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm6
  ja     L307
  movapd %xmm0,%xmm1
  sqrtsd %xmm1,%xmm1
L301:
  movsd  D172(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  D170(%rip),%xmm1
  mulsd  0x50(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  0x40(%rsp),%xmm1
  mulsd  0x48(%rsp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %r12,%xmm1
  mulsd  D96(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xd8(%rsp)
  jmp    L343
L129:
  mov    0x60(%rsp),%eax
  mov    0x118(%rsp),%r10
  mov    0x120(%rsp),%r9
  mov    0x50(%rsp),%r15d
  lea    -0x1(%rax),%edx
  mov    $0x7,%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  add    0xc8(%rsp),%r15d
  mov    %eax,0xb8(%rsp)
  mov    0x98(%rsp),%rax
  add    %rax,%r10
  add    %rax,%r9
  mov    0xf0(%rsp),%eax
  sub    0x8(%rsp),%eax
  mov    %eax,0x80(%rsp)
  mov    0x104(%rsp),%eax
  mov    %eax,0x70(%rsp)
  mov    0xe4(%rsp),%eax
  mov    %eax,0x10(%rsp)
  mov    0x48(%rsp),%eax
  add    0xc4(%rsp),%eax
  mov    %eax,0xd0(%rsp)
L664:
  mov    0x70(%rsp),%ecx
  mov    $0x10,%edx
  mov    0x50(%rsp),%r11d
  movq   $0x0,(%r10)
  movq   $0x0,(%r9)
  lea    (%rdi,%rcx,1),%eax
  cmp    %edx,%eax
  cmovg  %edx,%eax
  cmp    %r11d,0x48(%rsp)
  jge    L716
  mov    %ecx,%edx
  cmp    %ecx,%eax
  jle    L716
  mov    0x10(%rsp),%ecx
  mov    0x80(%rsp),%r11d
  mov    0xd0(%rsp),%r13d
  lea    -0x8(%rcx,%rdx,1),%edx
  lea    -0x8(%r11),%r14d
  mov    %edx,0x40(%rsp)
  sub    %r11d,%r13d
  lea    -0x8(%rcx,%rax,1),%r11d
  xchg   %ax,%ax
L394:
  lea    (%r14,%r13,1),%edx
  mov    0x40(%rsp),%eax
  mov    %r13d,%ecx
  cmp    %edx,%esi
  setg   %r12b
  nopl   0x0(%rax)
L805:
  cmp    %eax,%edi
  jle    L299
  test   %r12b,%r12b
  je     L299
  movslq %ecx,%r8
  movsd  0x190(%rsp,%r8,8),%xmm0
  movslq %edx,%r8
  movsd  (%rbx,%r8,8),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%r10),%xmm1
  movsd  %xmm1,(%r10)
  mulsd  0x0(%rbp,%r8,8),%xmm0
  addsd  (%r9),%xmm0
  movsd  %xmm0,(%r9)
L299:
  add    $0x1,%eax
  add    $0x10,%ecx
  add    %esi,%edx
  cmp    %r11d,%eax
  jne    L805
  add    $0x1,%r13d
  cmp    %r15d,%r13d
  jne    L394
L716:
  mov    0xe8(%rsp),%rdx
  addl   $0x1,0x10(%rsp)
  sub    $0x10,%r15d
  subl   $0x1,0x70(%rsp)
  mov    0x10(%rsp),%eax
  addl   $0x10,0x80(%rsp)
  add    %rdx,%r10
  add    %rdx,%r9
  cmp    0xb8(%rsp),%eax
  jle    L664
  cmp    %eax,0x60(%rsp)
  jg     L512
  jmp    L274
L663:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x38(%rsp)
  movq   %xmm5,%r12
  jmp    L421
L666:
  call   <__stack_chk_fail@plt>
L307:
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L301
L505:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movsd  0x38(%rsp),%xmm6
  movapd %xmm0,%xmm1
  jmp    L786
L671:
  movsd  %xmm1,0x50(%rsp)
  call   <sqrt@plt>
  movsd  0x50(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm5
  jmp    L640
L502:
  movsd  %xmm1,0x50(%rsp)
  call   <sqrt@plt>
  movsd  0x50(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm6
  jmp    L58
```

tool_calls: name: read_data
arguments: data_tag: D134
data_type: f64
name: read_data
arguments: data_tag: D170
data_type: f64
name: read_data
arguments: data_tag: D96
data_type: f64
name: read_data
arguments: data_tag: D114
data_type: f64
name: read_data
arguments: data_tag: D99
data_type: byte[16]
name: read_data
arguments: data_tag: D49
data_type: f32[4]
name: read_data
arguments: data_tag: D46
data_type: byte[16]
name: read_data
arguments: data_tag: D107
data_type: f64
name: read_data
arguments: data_tag: D172
data_type: f64

tool: D134: 0.8493218

tool: D170: 3.14159265

tool: D96: 0.25

tool: D114: 0.5

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

tool: {"D49": [0.0,1.401298464324817e-45,2.802596928649634e-45,4.203895392974451e-45]}

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

tool: D107: 9

tool: D172: 1

assistant: ```c
void cu_convolve_image_psf(int profile_type, int nx, int ny, int dx, int dy, int dp, int ds, int n_coeff, int nkernel, int kernel_radius, int *kxindex, int *kyindex, int *ext_basis, double *psf_parameters, double *psf_0, double *psf_xd, double *psf_yd, double *coeff, double *cim1, double *cim2, double *tex0, double *tex1) {
  int id, txa, tyb, txag, tybg, imax, jmax, idxmin, idxmax, idymin, idymax;
  int np, ns, i, j, ii, ip, jp, ic, ki, a, b;
  int d1, sidx, l, m, l1, m1, ig, jg;
  int psf_size, ix, jx;
  double x, y, p0, p1, p1g, cpsf_pixel;
  int xpos, ypos;
  double psf_height, psf_sigma_x, psf_sigma_y, psf_sigma_xy, psf_xpos, psf_ypos;
  double gain, psf_rad, psf_rad2, px, py;
  double sx2, sy2, sxy2, sx2msy2, sx2psy2;
  double psf_norm, dd;
  double pi = 3.14159265, fwtosig = 0.8493218;
  double psf_sum;
  double cpsf[256];
  int idx, idy, blockIdx, blockIdy, blockDimx = 16, blockDimy = 16, gridDimx, gridDimy;
  gridDimx = (nx - 1) / dx + 1;
  gridDimy = (ny - 1) / dy + 1;
  np = (dp + 1) * (dp + 2) / 2;
  ns = (ds + 1) * (ds + 2) / 2;
  psf_size = (int)psf_parameters[0];
  psf_height = psf_parameters[1];
  psf_sigma_x = psf_parameters[2];
  psf_sigma_y = psf_parameters[3];
  psf_ypos = psf_parameters[4];
  psf_xpos = psf_parameters[5];
  psf_rad = psf_parameters[6];
  gain = psf_parameters[7];
  if (psf_rad > 6.0) {
    psf_rad = 6.0;
  }
  psf_rad2 = psf_rad * psf_rad;
  psf_sum = 0.0;
  for (i = 1; i < psf_size - 1; i++) {
    for (j = 1; j < psf_size - 1; j++) {
      psf_sum += psf_0[i + j * psf_size];
    }
  }
  if (profile_type == 0) {
    psf_norm = 0.25 * psf_sum + psf_height * 2 * pi * fwtosig * fwtosig;
  } else if (profile_type == 1) {
    psf_sigma_xy = psf_parameters[8];
    sx2 = psf_sigma_x * psf_sigma_x;
    sy2 = psf_sigma_y * psf_sigma_y;
    sxy2 = psf_sigma_xy * psf_sigma_xy;
    sx2msy2 = 1.0 / sx2 - 1.0 / sy2;
    sx2psy2 = 1.0 / sx2 + 1.0 / sy2;
    px = 1.0 / sqrt(sx2psy2 + sqrt(sx2msy2 * sx2msy2 + sxy2));
    py = 1.0 / sqrt(sx2psy2 - sqrt(sx2msy2 * sx2msy2 + sxy2));
    psf_norm = 0.25 * psf_sum + psf_height * pi * (px * py) / (psf_sigma_x * psf_sigma_y);
  }
  for (blockIdx = 0; blockIdx < gridDimx; blockIdx += 1) {
    for (blockIdy = 0; blockIdy < gridDimy; blockIdy += 1) {
      xpos = blockIdx * dx + dx / 2;
      ypos = blockIdy * dy + dy / 2;
      x = (xpos - 0.5 * (nx - 1)) / (nx - 1);
      y = (ypos - 0.5 * (ny - 1)) / (ny - 1);
      for (idx = 0; idx < blockDimx; idx++) {
        for (idy = 0; idy < blockDimy; idy++) {
          id = idx + idy * blockDimx;
          cpsf[id] = 0.0;
          p0 = integrated_profile(profile_type, idx, idy, xpos, ypos, psf_parameters, psf_0, psf_xd, psf_yd);
          cpsf_pixel = 0.0;
          for (ic = 0; ic < n_coeff; ic++) {
            ki = ic < np ? 0 : (ic - np) / ns + 1;
            if (ki < nkernel) {
              a = kxindex[ki];
              b = kyindex[ki];
              if (ki == 0) {
                d1 = dp;
                sidx = ic;
              } else {
                d1 = ds;
                sidx = ic - np - (ki - 1) * ns;
              }
              l1 = m1 = 0;
              if (d1 > 0) {
                i = 0;
                for (l = 0; l <= d1; l++) {
                  for (m = 0; m <= d1 - l; m++) {
                    if (i == sidx) {
                      l1 = l;
                      m1 = m;
                    }
                    i++;
                  }
                }
              }
              if (ki > 0) {
                txa = idx + a;
                tyb = idy + b;
                p1 = integrated_profile(profile_type, txa, tyb, xpos, ypos, psf_parameters, psf_0, psf_xd, psf_yd);
                if (ext_basis[ki]) {
                  p1 = 0.0;
                  for (ig = -1; ig < 2; ig++) {
                    for (jg = -1; jg < 2; jg++) {
                      txag = txa + ig;
                      tybg = tyb + jg;
                      p1g = integrated_profile(profile_type, txag, tybg, xpos, ypos, psf_parameters, psf_0, psf_xd, psf_yd);
                      p1 += p1g;
                    }
                  }
                  p1 /= 9.0;
                }
                cpsf_pixel += coeff[ic] * (p1 - p0) * pow(x, l1) * pow(y, m1);
              } else {
                cpsf_pixel += coeff[ic] * p0 * pow(x, l1) * pow(y, m1);
              }
            }
          }
          cpsf[id] = cpsf_pixel / psf_norm;
        }
      }
      imax = (xpos + dx / 2) < nx ? xpos + dx / 2 : nx;
      jmax = (ypos + dy / 2) < ny ? ypos + dy / 2 : ny;
      for (i = xpos - dx / 2; i < imax; i++) {
        for (j = ypos - dy / 2; j < jmax; j++) {
          cim1[i + j * nx] = 0.0;
          cim2[i + j * nx] = 0.0;
          idxmin = ((i - 8) >= 0) ? 0 : 8 - i;
          idxmax = (blockDimx < (nx + 8 - i)) ? blockDimx : nx + 8 - i;
          idymin = ((j - 8) >= 0) ? 0 : 8 - j;
          idymax = (blockDimy < (ny + 8 - j)) ? blockDimx : ny + 8 - j;
          for (idx = idxmin; idx < idxmax; idx++) {
            for (idy = idymin; idy < idymax; idy++) {
              id = idx + idy * blockDimx;
              ix = i + idx - 8;
              jx = j + idy - 8;
              if ((ix < nx) && (jx < ny)) {
                cim1[i + j * nx] += cpsf[id] * tex0[ix + nx * jx];
                cim2[i + j * nx] += cpsf[id] * tex1[ix + nx * jx];
              }
            }
          }
        }
      }
    }
  }
  return;
}
```