user: 请将以下的汇编代码转换成C语言代码:

```asm
<cu_convolve_image_psf>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x988,%rsp
  mov    %edi,0x20(%rsp)
  mov    %esi,%r15d
  mov    %edx,%esi
  mov    %edx,0x158(%rsp)
  mov    %ecx,0x100(%rsp)
  mov    %r8d,0x104(%rsp)
  mov    %r9d,0xa8(%rsp)
  mov    0x9e0(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0x9e8(%rsp),%rax
  mov    %rax,0x68(%rsp)
  mov    0x9f0(%rsp),%rax
  mov    %rax,0x90(%rsp)
  mov    0x9f8(%rsp),%rdi
  mov    %rdi,0x10(%rsp)
  mov    0xa00(%rsp),%rbx
  mov    %rbx,0x70(%rsp)
  mov    0xa08(%rsp),%rax
  mov    %rax,0x78(%rsp)
  mov    0xa10(%rsp),%rax
  mov    %rax,0x80(%rsp)
  mov    0xa18(%rsp),%rax
  mov    %rax,0xc8(%rsp)
  mov    0xa20(%rsp),%rax
  mov    %rax,0x138(%rsp)
  mov    0xa28(%rsp),%rax
  mov    %rax,0x140(%rsp)
  mov    0xa30(%rsp),%rax
  mov    %rax,0x148(%rsp)
  mov    0xa38(%rsp),%rax
  mov    %rax,0x150(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x978(%rsp)
  xor    %eax,%eax
  lea    -0x1(%r15),%eax
  mov    %eax,0x114(%rsp)
  cltd
  idiv   %ecx
  mov    %eax,0x108(%rsp)
  lea    -0x1(%rsi),%eax
  mov    %eax,0x118(%rsp)
  cltd
  idiv   %r8d
  mov    %eax,0x10c(%rsp)
  lea    0x1(%r9),%eax
  lea    0x2(%r9),%edx
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x28(%rsp)
  mov    0x9c0(%rsp),%eax
  add    $0x1,%eax
  mov    0x9c0(%rsp),%esi
  lea    0x2(%rsi),%edx
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,0xd8(%rsp)
  mov    %eax,0x4c(%rsp)
  cvttsd2si (%rdi),%eax
  mov    0x8(%rdi),%rbp
  cmp    $0x2,%eax
  jle    L460
  movslq %eax,%rdx
  lea    0x8(,%rdx,8),%rdx
  lea    (%rbx,%rdx,1),%rsi
  sub    $0x1,%eax
  sub    $0x8,%rdx
  mov    D56(%rip),%rbx
  mov    $0x1,%ecx
  movq   %rbx,%xmm6
  jmp    L40
L91:
  movapd %xmm0,%xmm6
  add    $0x1,%ecx
  add    $0x8,%rsi
  cmp    %eax,%ecx
  je     L191
L40:
  mov    %rsi,%r8
  mov    $0x1,%edi
  movapd %xmm6,%xmm0
L274:
  addsd  (%r8),%xmm0
  add    $0x1,%edi
  add    %rdx,%r8
  cmp    %eax,%edi
  jne    L274
  jmp    L91
L460:
  mov    D56(%rip),%rbx
  jmp    L355
L191:
  movq   %xmm0,%rbx
L355:
  cmpl   $0x0,0x20(%rsp)
  jne    L347
  movq   %rbp,%xmm0
  addsd  %xmm0,%xmm0
  mulsd  D66(%rip),%xmm0
  movsd  D4(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rbx,%xmm1
  mulsd  D63(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xc0(%rsp)
L38:
  cmpl   $0x0,0x108(%rsp)
  js     L214
  mov    0x104(%rsp),%ebx
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  mov    %eax,0x110(%rsp)
  mov    0x100(%rsp),%edi
  mov    %edi,%eax
  shr    $0x1f,%eax
  add    %edi,%eax
  sar    %eax
  mov    %eax,0x15c(%rsp)
  imul   %r15d,%ebx
  mov    %ebx,0x134(%rsp)
  movslq %r15d,%rax
  shl    $0x3,%rax
  mov    %rax,0xe8(%rsp)
  movl   $0x8,0xfc(%rsp)
  movl   $0x0,0xf8(%rsp)
  movl   $0x0,0xdc(%rsp)
  lea    0x170(%rsp),%rax
  mov    %rax,0x160(%rsp)
  jmp    L341
L347:
  cmpl   $0x1,0x20(%rsp)
  jne    L38
  mov    0x10(%rsp),%rax
  mov    0x10(%rax),%r12
  mov    0x18(%rax),%r13
  movsd  0x40(%rax),%xmm1
  movq   %r12,%xmm2
  mulsd  %xmm2,%xmm2
  movsd  D71(%rip),%xmm0
  movapd %xmm0,%xmm3
  divsd  %xmm2,%xmm3
  movq   %r13,%xmm2
  mulsd  %xmm2,%xmm2
  divsd  %xmm2,%xmm0
  movapd %xmm3,%xmm2
  subsd  %xmm0,%xmm2
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm2,%xmm2
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rsp)
  pxor   %xmm0,%xmm0
  ucomisd %xmm2,%xmm0
  ja     L240
  sqrtsd %xmm2,%xmm2
  movapd %xmm2,%xmm0
L587:
  addsd  0x8(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L323
  sqrtsd %xmm0,%xmm0
L551:
  movsd  D71(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rsp)
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm5
  ucomisd %xmm5,%xmm0
  ja     L502
  sqrtsd %xmm5,%xmm5
  movapd %xmm5,%xmm1
L380:
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L437
  sqrtsd %xmm0,%xmm0
L21:
  movsd  D71(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rbp,%xmm1
  mulsd  D66(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movq   %r12,%xmm1
  movq   %r13,%xmm6
  mulsd  %xmm6,%xmm1
  divsd  %xmm1,%xmm0
  movq   %rbx,%xmm1
  mulsd  D63(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xc0(%rsp)
  jmp    L38
L240:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L587
L323:
  call   <sqrt@plt>
  jmp    L551
L502:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L380
L437:
  call   <sqrt@plt>
  jmp    L21
L184:
  mov    0xa8(%rsp),%r14d
  jmp    L233
L512:
  lea    (%r8,%rax,1),%edx
  cmp    %edx,%ecx
  cmove  %eax,%ebp
  cmove  %esi,%ebx
  add    $0x1,%eax
  cmp    %edi,%eax
  jne    L512
  lea    0x1(%r10,%r8,1),%r8d
L389:
  add    $0x1,%esi
  sub    $0x1,%r9d
  sub    $0x1,%edi
  cmp    %r14d,%esi
  jg     L518
L484:
  mov    %r9d,%r10d
  mov    $0x0,%eax
  test   %r9d,%r9d
  jns    L512
  jmp    L389
L518:
  test   %r11d,%r11d
  jle    L575
  add    0x88(%rsp),%r12d
  mov    (%rsp),%eax
  add    0x38(%rsp),%eax
  mov    %eax,0x48(%rsp)
  sub    $0x8,%rsp
  push   0x88(%rsp)
  push   0x88(%rsp)
  push   0x88(%rsp)
  mov    0x30(%rsp),%r9
  mov    0x38(%rsp),%r8d
  mov    0x44(%rsp),%ecx
  mov    %eax,%edx
  mov    %r12d,%esi
  mov    0x40(%rsp),%edi
  mov    $0x0,%eax
  call   <integrated_profile@plt>
  add    $0x20,%rsp
  mov    0x90(%rsp),%rdi
  mov    0x30(%rsp),%rsi
  cmpl   $0x0,(%rdi,%rsi,1)
  jne    L273
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L370:
  subsd  0x40(%rsp),%xmm0
  mulsd  (%r15),%xmm0
  movsd  %xmm0,(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  0x50(%rsp),%xmm0
  call   <pow@plt>
  movq   %xmm0,%rbx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  movsd  0x58(%rsp),%xmm0
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm6
  mulsd  (%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
L339:
  add    $0x8,%r15
  add    $0x1,%r13d
  cmp    0x2c(%rsp),%r13d
  je     L513
L172:
  mov    0x28(%rsp),%eax
  lea    0x0(%r13,%rax,1),%ecx
  cmp    %ecx,%eax
  jg     L342
  mov    %r13d,%eax
  cltd
  idivl  0x4c(%rsp)
  lea    0x1(%rax),%r11d
  cmp    0x9d0(%rsp),%r11d
  jge    L339
  movslq %r11d,%rdx
  lea    0x0(,%rdx,4),%rbx
  mov    %rbx,0x30(%rsp)
  mov    0x60(%rsp),%rbx
  mov    (%rbx,%rdx,4),%r12d
  mov    0x68(%rsp),%rdi
  mov    (%rdi,%rdx,4),%ebx
  mov    %ebx,(%rsp)
  test   %r11d,%r11d
  je     L403
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  cmpl   $0x0,0x9c0(%rsp)
  jle    L518
  imul   0xd8(%rsp),%eax
  mov    %r13d,%ecx
  sub    %eax,%ecx
  mov    0x9c0(%rsp),%r14d
L233:
  mov    %r14d,%r9d
  lea    0x1(%r14),%edi
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  mov    $0x0,%esi
  mov    $0x0,%r8d
  jmp    L484
L273:
  lea    -0x1(%r12),%r14d
  lea    0x2(%r12),%eax
  mov    %eax,0x30(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
  mov    0x48(%rsp),%eax
  add    $0x2,%eax
  mov    %ebx,0xac(%rsp)
  mov    %ebp,0xb8(%rsp)
  mov    %eax,%ebp
  mov    %r15,0xb0(%rsp)
  mov    %r13d,0xbc(%rsp)
  mov    0x70(%rsp),%r12
  mov    0x78(%rsp),%r13
  mov    0x80(%rsp),%r15
L539:
  mov    0x48(%rsp),%eax
  lea    -0x1(%rax),%ebx
L415:
  sub    $0x8,%rsp
  push   %r15
  push   %r13
  push   %r12
  mov    0x30(%rsp),%r9
  mov    0x38(%rsp),%r8d
  mov    0x44(%rsp),%ecx
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    0x40(%rsp),%edi
  mov    $0x0,%eax
  call   <integrated_profile@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x20(%rsp)
  add    $0x1,%ebx
  add    $0x20,%rsp
  cmp    %ebp,%ebx
  jne    L415
  add    $0x1,%r14d
  cmp    0x30(%rsp),%r14d
  jne    L539
  mov    0xac(%rsp),%ebx
  mov    0xb8(%rsp),%ebp
  mov    0xb0(%rsp),%r15
  mov    0xbc(%rsp),%r13d
  movsd  (%rsp),%xmm0
  divsd  D28(%rip),%xmm0
  jmp    L370
L239:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
L513:
  movsd  0x8(%rsp),%xmm0
  divsd  0xc0(%rsp),%xmm0
  mov    0xa0(%rsp),%rax
  movsd  %xmm0,(%rax)
  addl   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%eax
  subq   $0xffffffffffffff80,0x98(%rsp)
  cmp    $0x10,%eax
  je     L541
L299:
  mov    0x98(%rsp),%rax
  mov    %rax,0xa0(%rsp)
  movq   $0x0,(%rax)
  sub    $0x8,%rsp
  push   0x88(%rsp)
  push   0x88(%rsp)
  push   0x88(%rsp)
  mov    0x30(%rsp),%r9
  mov    0x38(%rsp),%r8d
  mov    0x44(%rsp),%ecx
  mov    0x58(%rsp),%edx
  mov    0xa8(%rsp),%esi
  mov    0x40(%rsp),%edi
  mov    $0x0,%eax
  call   <integrated_profile@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movsd  %xmm3,0x60(%rsp)
  add    $0x20,%rsp
  cmpl   $0x0,0x9c8(%rsp)
  jle    L239
  mov    0xc8(%rsp),%r15
  mov    0x28(%rsp),%eax
  mov    %eax,%r13d
  neg    %r13d
  mov    0x9c8(%rsp),%ebx
  sub    %eax,%ebx
  mov    %ebx,0x2c(%rsp)
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L172
L541:
  addq   $0x1,0xd0(%rsp)
  mov    0xd0(%rsp),%rax
  cmp    $0x10,%rax
  je     L538
L173:
  mov    0xd0(%rsp),%rax
  mov    %eax,0x88(%rsp)
  mov    0x160(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x98(%rsp)
  movl   $0x0,0x38(%rsp)
  jmp    L299
L538:
  mov    0x16c(%rsp),%r15d
  mov    0xe4(%rsp),%edx
  mov    0x110(%rsp),%esi
  add    %esi,%edx
  mov    0x158(%rsp),%r14d
  cmp    %r14d,%edx
  mov    %r14d,%ebx
  cmovle %edx,%ebx
  mov    %ebx,0xac(%rsp)
  mov    0x11c(%rsp),%edi
  mov    0x130(%rsp),%eax
  cmp    %eax,%edi
  jge    L252
  movslq 0xf0(%rsp),%rax
  movslq %edi,%rcx
  add    %rcx,%rax
  shl    $0x3,%rax
  mov    %rax,0x88(%rsp)
  mov    0xfc(%rsp),%eax
  mov    %eax,0x30(%rsp)
  lea    (%rsi,%rsi,1),%eax
  sub    %eax,%edx
  mov    %edx,0xb8(%rsp)
  mov    $0x8,%eax
  sub    %ebx,%eax
  mov    %eax,0xa0(%rsp)
  mov    0x148(%rsp),%r13
  mov    0x150(%rsp),%r12
  jmp    L407
L374:
  movslq %edx,%rsi
  movsd  0x170(%rsp,%rsi,8),%xmm0
  movslq %ecx,%rsi
  movapd %xmm0,%xmm1
  mulsd  0x0(%r13,%rsi,8),%xmm1
  addsd  (%r9),%xmm1
  movsd  %xmm1,(%r9)
  mulsd  (%r12,%rsi,8),%xmm0
  addsd  (%r10),%xmm0
  movsd  %xmm0,(%r10)
L351:
  add    $0x1,%eax
  add    $0x10,%edx
  add    %r15d,%ecx
  cmp    %r8d,%eax
  je     L59
L589:
  cmp    %edi,%r15d
  jle    L351
  cmp    %r14d,%eax
  jl     L374
  jmp    L351
L59:
  add    $0x1,%r11d
  add    $0x1,%edi
  cmp    (%rsp),%r11d
  je     L145
L444:
  mov    0x8(%rsp),%eax
  sub    $0x8,%eax
  mov    0x18(%rsp),%esi
  lea    (%rsi,%r11,1),%ecx
  mov    %r11d,%edx
  cmp    %ebx,%ebp
  jl     L589
  jmp    L59
L145:
  mov    0xe8(%rsp),%rbx
  add    %rbx,0x38(%rsp)
  add    %rbx,0x40(%rsp)
  subl   $0x1,0x2c(%rsp)
  mov    0x2c(%rsp),%eax
  cmp    0xa0(%rsp),%eax
  je     L540
L215:
  mov    $0x8,%esi
  mov    0x2c(%rsp),%r8d
  sub    %r8d,%esi
  mov    0x38(%rsp),%rax
  mov    %rax,%r9
  movq   $0x0,(%rax)
  mov    0x40(%rsp),%rax
  mov    %rax,%r10
  movq   $0x0,(%rax)
  mov    0x30(%rsp),%eax
  add    %r15d,%eax
  mov    $0x10,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  cmp    $0x8,%esi
  mov    $0x0,%ebp
  cmovl  %r8d,%ebp
  lea    (%r14,%r8,1),%ebx
  cmp    %edx,%ebx
  cmovg  %edx,%ebx
  mov    0x58(%rsp),%edi
  cmp    %eax,%edi
  jge    L145
  mov    %ebp,%ecx
  shl    $0x4,%ecx
  lea    (%rdi,%rcx,1),%r11d
  mov    0x98(%rsp),%edi
  sub    $0x8,%edi
  add    %ecx,%eax
  mov    %eax,(%rsp)
  mov    %ebp,%eax
  sub    %r8d,%eax
  imul   %r15d,%eax
  mov    0x48(%rsp),%edx
  sub    %ecx,%edx
  add    %ebp,%esi
  mov    %esi,0x8(%rsp)
  lea    -0x8(%rax,%rdx,1),%eax
  mov    %eax,0x18(%rsp)
  mov    %ebx,%eax
  sub    %r8d,%eax
  mov    %eax,%r8d
  jmp    L444
L540:
  subl   $0x1,0x30(%rsp)
  mov    0x30(%rsp),%eax
  addq   $0x8,0x88(%rsp)
  cmp    0x168(%rsp),%eax
  je     L252
L407:
  mov    $0x8,%eax
  sub    0x30(%rsp),%eax
  mov    %eax,0x48(%rsp)
  mov    0xb8(%rsp),%ebx
  cmp    %ebx,0xac(%rsp)
  jle    L540
  mov    0x48(%rsp),%ebx
  cmp    $0x7,%ebx
  mov    $0x0,%eax
  cmovle 0x30(%rsp),%eax
  mov    %eax,0x58(%rsp)
  mov    0x138(%rsp),%rdi
  mov    0x88(%rsp),%rsi
  add    %rsi,%rdi
  mov    %rdi,0x38(%rsp)
  mov    0x140(%rsp),%rdi
  add    %rsi,%rdi
  mov    %rdi,0x40(%rsp)
  mov    0xf4(%rsp),%edi
  mov    %edi,0x2c(%rsp)
  add    %ebx,%eax
  mov    %eax,0x98(%rsp)
  jmp    L215
L252:
  addl   $0x1,0xe0(%rsp)
  mov    0xe0(%rsp),%eax
  mov    0x104(%rsp),%edi
  add    %edi,0xe4(%rsp)
  mov    0x134(%rsp),%esi
  add    %esi,0xf0(%rsp)
  sub    %edi,0xf4(%rsp)
  cmp    %eax,0x10c(%rsp)
  jl     L375
L391:
  mov    0xe4(%rsp),%eax
  mov    %eax,0x18(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  0x128(%rsp),%xmm0
  divsd  0x120(%rsp),%xmm0
  movsd  %xmm0,0x58(%rsp)
  movq   $0x0,0xd0(%rsp)
  mov    %r15d,0x16c(%rsp)
  jmp    L173
L375:
  addl   $0x1,0xdc(%rsp)
  mov    0xdc(%rsp),%eax
  mov    0x100(%rsp),%edi
  add    %edi,0xf8(%rsp)
  sub    %edi,0xfc(%rsp)
  cmp    %eax,0x108(%rsp)
  jl     L214
L341:
  cmpl   $0x0,0x10c(%rsp)
  js     L375
  mov    0xf8(%rsp),%eax
  mov    %eax,0x11c(%rsp)
  mov    0x15c(%rsp),%ebx
  add    %ebx,%eax
  mov    %eax,0x24(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x114(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movapd %xmm0,%xmm2
  mulsd  D20(%rip),%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x50(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2sdl 0x118(%rsp),%xmm7
  movsd  %xmm7,0x120(%rsp)
  mulsd  D20(%rip),%xmm7
  movsd  %xmm7,0x128(%rsp)
  add    %ebx,%eax
  cmp    %r15d,%eax
  cmovg  %r15d,%eax
  mov    %eax,0x130(%rsp)
  mov    0x110(%rsp),%ebx
  mov    %ebx,0xe4(%rsp)
  movl   $0x8,0xf4(%rsp)
  movl   $0x0,0xf0(%rsp)
  movl   $0x0,0xe0(%rsp)
  mov    $0x8,%ebx
  sub    %eax,%ebx
  mov    %ebx,0x168(%rsp)
  jmp    L391
L342:
  cmpl   $0x0,0x9d0(%rsp)
  jle    L339
  mov    0x60(%rsp),%rax
  mov    (%rax),%r12d
  mov    0x68(%rsp),%rax
  mov    (%rax),%eax
  mov    %eax,(%rsp)
  mov    $0x0,%r11d
  movq   $0x0,0x30(%rsp)
L403:
  cmpl   $0x0,0xa8(%rsp)
  jg     L184
  mov    $0x0,%ebp
  mov    $0x0,%ebx
L575:
  movsd  0x40(%rsp),%xmm7
  mulsd  (%r15),%xmm7
  movsd  %xmm7,(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  0x50(%rsp),%xmm0
  call   <pow@plt>
  movq   %xmm0,%rbx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  movsd  0x58(%rsp),%xmm0
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm0
  mulsd  (%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L339
L214:
  mov    0x978(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L461
  add    $0x988,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L461:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D56
type: f64
name: read_data
arguments: label: D66
type: f64
name: read_data
arguments: label: D4
type: f64
name: read_data
arguments: label: D63
type: f64
name: read_data
arguments: label: D71
type: f64
name: read_data
arguments: label: D28
type: f64
name: read_data
arguments: label: D20
type: f64

tool: D56: 0

tool: D66: 3.14159265

tool: D4: 0.8493218

tool: D63: 0.25

tool: D71: 1

tool: D28: 9

tool: D20: 0.5

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;
}
```