user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<cu_convolve_image_psf>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x978,%rsp
  mov    0x9d0(%rsp),%rax
  mov    0x9f0(%rsp),%rbx
  mov    %edi,0x4c(%rsp)
  mov    %edx,%edi
  mov    0x9e8(%rsp),%r13
  mov    %edx,0x124(%rsp)
  mov    %rax,0x68(%rsp)
  mov    0x9d8(%rsp),%rax
  mov    %ecx,0xf0(%rsp)
  mov    %rax,0x70(%rsp)
  mov    0x9e0(%rsp),%rax
  mov    %r8d,0xf4(%rsp)
  mov    %rax,0xa0(%rsp)
  mov    0x9f8(%rsp),%rax
  mov    %r9d,0x98(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0xa00(%rsp),%rax
  mov    %rbx,0x10(%rsp)
  mov    %rax,0x20(%rsp)
  mov    0xa08(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0xa10(%rsp),%rax
  mov    %rax,0x128(%rsp)
  mov    0xa18(%rsp),%rax
  mov    %rax,0x130(%rsp)
  mov    0xa20(%rsp),%rax
  mov    %rax,0x138(%rsp)
  mov    0xa28(%rsp),%rax
  movsd  0x8(%r13),%xmm7
  mov    %rax,0x140(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x968(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rsi),%eax
  movsd  %xmm7,(%rsp)
  cltd
  mov    %eax,0x104(%rsp)
  idiv   %ecx
  mov    %eax,0xf8(%rsp)
  lea    -0x1(%rdi),%eax
  mov    0x9b0(%rsp),%edi
  cltd
  mov    %eax,0x118(%rsp)
  idiv   %r8d
  lea    0x2(%r9),%edx
  mov    %eax,0xfc(%rsp)
  lea    0x1(%r9),%eax
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  lea    0x2(%rdi),%edx
  sar    %eax
  mov    %eax,0x48(%rsp)
  mov    0x9b0(%rsp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x88(%rsp)
  cvttsd2si 0x0(%r13),%eax
  lea    -0x1(%rax),%esi
  cmp    $0x1,%esi
  jle    L117
  cltq
  pxor   %xmm3,%xmm3
  mov    $0x1,%edx
  lea    0x8(,%rax,8),%rax
  movsd  %xmm3,0x80(%rsp)
  lea    (%rbx,%rax,1),%rcx
  sub    $0x8,%rax
L76:
  mov    %rcx,%r8
  mov    $0x1,%edi
  movapd %xmm3,%xmm0
L155:
  add    $0x1,%edi
  addsd  (%r8),%xmm0
  add    %rax,%r8
  cmp    %esi,%edi
  jne    L155
  add    $0x1,%edx
  movapd %xmm0,%xmm3
  add    $0x8,%rcx
  cmp    %esi,%edx
  jne    L76
  movq   %xmm0,%rbx
L526:
  mov    0x4c(%rsp),%r10d
  test   %r10d,%r10d
  jne    L273
  movsd  (%rsp),%xmm0
  movsd  D39(%rip),%xmm1
  addsd  %xmm0,%xmm0
  mulsd  D91(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rbx,%xmm1
  mulsd  D59(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xc0(%rsp)
L458:
  mov    0xf8(%rsp),%r9d
  test   %r9d,%r9d
  js     L136
  mov    0xf0(%rsp),%ebx
  mov    %r13,0x78(%rsp)
  mov    %r14d,%r15d
  movl   $0x8,0xec(%rsp)
  movl   $0x0,0xdc(%rsp)
  mov    %ebx,%eax
  movl   $0x0,0xd4(%rsp)
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  mov    %eax,0x148(%rsp)
  mov    0xf4(%rsp),%eax
  mov    %eax,%ebx
  imul   %r14d,%ebx
  mov    %ebx,0x120(%rsp)
  mov    %eax,%ebx
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  mov    %eax,0x100(%rsp)
  movslq %r14d,%rax
  shl    $0x3,%rax
  mov    %rax,0xe0(%rsp)
  lea    0x160(%rsp),%rax
  mov    %rax,0x150(%rsp)
L310:
  mov    0xfc(%rsp),%edx
  test   %edx,%edx
  js     L327
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  pxor   %xmm6,%xmm6
  mov    %r15d,%r14d
  cvtsi2sdl 0x104(%rsp),%xmm0
  mov    0x148(%rsp),%eax
  mov    0xdc(%rsp),%r13d
  movl   $0x0,0xe8(%rsp)
  movsd  D87(%rip),%xmm2
  movsd  D87(%rip),%xmm4
  cvtsi2sdl 0x118(%rsp),%xmm6
  movl   $0x0,0xd0(%rsp)
  add    %eax,%r13d
  movslq 0x9b8(%rsp),%rbx
  movl   $0x0,0xd8(%rsp)
  cvtsi2sd %r13d,%xmm1
  add    %r13d,%eax
  mov    %r13d,0x158(%rsp)
  mulsd  %xmm0,%xmm2
  cmp    %r15d,%eax
  mov    %rbx,0x28(%rsp)
  mov    $0x8,%ebx
  mulsd  %xmm6,%xmm4
  cmovg  %r15d,%eax
  movsd  %xmm6,0x108(%rsp)
  sub    %eax,%ebx
  mov    %eax,0x11c(%rsp)
  mov    %ebx,0x14c(%rsp)
  subsd  %xmm2,%xmm1
  movsd  %xmm4,0x110(%rsp)
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x50(%rsp)
L293:
  movq   $0x0,0xc8(%rsp)
  mov    0xd0(%rsp),%r12d
  pxor   %xmm0,%xmm0
  mov    %r14d,0x15c(%rsp)
  add    0x100(%rsp),%r12d
  mov    0x158(%rsp),%r13d
  cvtsi2sd %r12d,%xmm0
  mov    %r12d,%r15d
  subsd  0x110(%rsp),%xmm0
  divsd  0x108(%rsp),%xmm0
  movsd  %xmm0,0x58(%rsp)
L216:
  mov    0xc8(%rsp),%rax
  mov    0x150(%rsp),%rbx
  movl   $0x0,0x38(%rsp)
  mov    %eax,0x8c(%rsp)
  lea    (%rbx,%rax,8),%rax
  mov    %rax,0x90(%rsp)
L243:
  mov    0x90(%rsp),%rax
  sub    $0x8,%rsp
  mov    %r15d,%r8d
  mov    %r13d,%ecx
  movq   $0x0,(%rax)
  xor    %eax,%eax
  push   0x28(%rsp)
  push   0x28(%rsp)
  push   0x28(%rsp)
  mov    0x98(%rsp),%r9
  mov    0x58(%rsp),%edx
  mov    0xac(%rsp),%esi
  mov    0x6c(%rsp),%edi
  call   <integrated_profile@plt>
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movsd  %xmm6,0x60(%rsp)
  mov    0x9d8(%rsp),%r8d
  add    $0x20,%rsp
  test   %r8d,%r8d
  jle    L353
  movsd  0x80(%rsp),%xmm3
  xor    %r12d,%r12d
  movsd  %xmm3,0x8(%rsp)
  jmp    L103
  cs nopw 0x0(%rax,%rax,1)
L254:
  mov    0x9c0(%rsp),%edi
  test   %edi,%edi
  jle    L365
  movq   $0x0,0x30(%rsp)
  mov    0x68(%rsp),%rax
  mov    (%rax),%eax
  mov    %eax,(%rsp)
  mov    0x70(%rsp),%rax
  mov    (%rax),%r14d
L452:
  mov    0x98(%rsp),%eax
  test   %eax,%eax
  jg     L252
  pxor   %xmm1,%xmm1
  xor    %ebx,%ebx
L200:
  mov    0x60(%rsp),%rax
  movsd  0x40(%rsp),%xmm5
  movsd  0x50(%rsp),%xmm0
  mulsd  (%rax,%r12,8),%xmm5
  movsd  %xmm5,(%rsp)
  call   <pow@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  %xmm0,0x30(%rsp)
  movsd  0x58(%rsp),%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm5
  mulsd  0x30(%rsp),%xmm5
  movapd %xmm0,%xmm1
  movapd %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
L365:
  add    $0x1,%r12
  cmp    0x28(%rsp),%r12
  je     L334
L103:
  mov    %r12d,%r9d
  cmp    %r12d,0x48(%rsp)
  jg     L254
  mov    %r12d,%eax
  sub    0x48(%rsp),%eax
  cltd
  idivl  0x88(%rsp)
  add    $0x1,%eax
  cmp    0x9c0(%rsp),%eax
  jge    L365
  movslq %eax,%rcx
  lea    0x0(,%rcx,4),%rbx
  mov    %rbx,0x30(%rsp)
  mov    0x68(%rsp),%rbx
  mov    (%rbx,%rcx,4),%edi
  mov    0x70(%rsp),%rbx
  mov    %edi,(%rsp)
  mov    (%rbx,%rcx,4),%r14d
  test   %eax,%eax
  je     L452
  mov    0x9b0(%rsp),%esi
  xor    %ebx,%ebx
  xor    %ebp,%ebp
  test   %esi,%esi
  jg     L430
  test   %eax,%eax
  jle    L361
L476:
  mov    (%rsp),%r10d
  add    0x38(%rsp),%r14d
  sub    $0x8,%rsp
  mov    %r13d,%ecx
  add    0x94(%rsp),%r10d
  xor    %eax,%eax
  mov    %r15d,%r8d
  mov    %r14d,%edx
  push   0x28(%rsp)
  mov    %r10d,%esi
  push   0x28(%rsp)
  push   0x28(%rsp)
  mov    0x98(%rsp),%r9
  mov    0x6c(%rsp),%edi
  mov    %r10d,0x20(%rsp)
  call   <integrated_profile@plt>
  mov    0x50(%rsp),%rsi
  add    $0x20,%rsp
  mov    0xa0(%rsp),%rdi
  mov    (%rsp),%r10d
  mov    (%rdi,%rsi,1),%ecx
  test   %ecx,%ecx
  jne    L410
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L130:
  mov    0x60(%rsp),%rax
  subsd  0x40(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  mulsd  (%rax,%r12,8),%xmm0
  add    $0x1,%r12
  movsd  %xmm0,(%rsp)
  movsd  0x50(%rsp),%xmm0
  call   <pow@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  %xmm0,0x30(%rsp)
  movsd  0x58(%rsp),%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm4
  mulsd  0x30(%rsp),%xmm4
  movapd %xmm0,%xmm1
  movapd %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  cmp    0x28(%rsp),%r12
  jne    L103
L334:
  mov    0x90(%rsp),%rax
  addl   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%edi
  movsd  0x8(%rsp),%xmm0
  divsd  0xc0(%rsp),%xmm0
  sub    $0xffffffffffffff80,%rax
  movsd  %xmm0,-0x80(%rax)
  mov    %rax,0x90(%rsp)
  cmp    $0x10,%edi
  jne    L243
  addq   $0x1,0xc8(%rsp)
  mov    0xc8(%rsp),%rax
  cmp    $0x10,%rax
  jne    L216
  mov    0x100(%rsp),%eax
  mov    0x124(%rsp),%ebx
  mov    0xdc(%rsp),%edi
  mov    0x15c(%rsp),%r14d
  add    %r15d,%eax
  cmp    %ebx,%eax
  cmovg  %ebx,%eax
  mov    %eax,0x8c(%rsp)
  mov    0x11c(%rsp),%eax
  cmp    %eax,%edi
  jge    L318
  movslq 0xe8(%rsp),%rax
  movslq %edi,%rdx
  mov    %ebx,%ebp
  mov    0x138(%rsp),%r12
  mov    0x140(%rsp),%r13
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,0xa8(%rsp)
  mov    0xec(%rsp),%eax
  mov    %eax,0x58(%rsp)
  lea    0x8(%rbx),%eax
  mov    %eax,0xb4(%rsp)
L416:
  mov    $0x8,%eax
  sub    0x58(%rsp),%eax
  mov    0x8c(%rsp),%ebx
  mov    %eax,0x90(%rsp)
  cmp    %ebx,0xd0(%rsp)
  jge    L183
  mov    0x58(%rsp),%ebx
  xor    %eax,%eax
  cmpl   $0x7,0x90(%rsp)
  mov    0x128(%rsp),%r15
  mov    0x130(%rsp),%r8
  cmovle %ebx,%eax
  add    %r14d,%ebx
  mov    %eax,0x9c(%rsp)
  mov    $0x10,%eax
  cmp    %eax,%ebx
  cmovle %ebx,%eax
  mov    %eax,0xb0(%rsp)
  mov    0xa8(%rsp),%rax
  add    %rax,%r15
  add    %rax,%r8
  mov    0xd0(%rsp),%eax
  mov    %eax,0x40(%rsp)
L455:
  mov    0x40(%rsp),%edi
  mov    0xb4(%rsp),%ebx
  mov    $0x8,%r11d
  xor    %eax,%eax
  mov    0x9c(%rsp),%esi
  mov    0xb0(%rsp),%ecx
  movq   $0x0,(%r15)
  sub    %edi,%r11d
  cmp    $0x8,%edi
  movq   $0x0,(%r8)
  cmovge %eax,%r11d
  sub    %edi,%ebx
  mov    $0x10,%eax
  cmp    %eax,%ebx
  cmovg  %eax,%ebx
  cmp    %ecx,%esi
  jge    L85
  mov    %r11d,%eax
  mov    0x90(%rsp),%edx
  shl    $0x4,%eax
  lea    (%rsi,%rax,1),%r10d
  lea    (%rcx,%rax,1),%esi
  sub    %eax,%edx
  mov    %esi,(%rsp)
  mov    %edi,%esi
  lea    -0x8(%rdi),%edi
  lea    -0x8(%rdx),%ecx
  lea    (%r11,%rdi,1),%eax
  add    %r11d,%esi
  mov    %ecx,0x8(%rsp)
  add    %ebx,%edi
  imul   %r14d,%eax
  mov    %esi,0x30(%rsp)
  lea    -0x8(%rdx,%rax,1),%eax
  mov    %eax,0x38(%rsp)
  nopl   0x0(%rax)
L164:
  cmp    %ebx,%r11d
  jge    L66
  mov    0x8(%rsp),%eax
  mov    0x38(%rsp),%esi
  mov    %r10d,%edx
  add    %r10d,%eax
  lea    (%rsi,%r10,1),%ecx
  cmp    %eax,%r14d
  mov    0x30(%rsp),%eax
  setg   %r9b
  sub    $0x8,%eax
  nopl   (%rax)
L515:
  cmp    %ebp,%eax
  jge    L387
  test   %r9b,%r9b
  je     L387
  movslq %edx,%rsi
  movsd  0x160(%rsp,%rsi,8),%xmm0
  movslq %ecx,%rsi
  movsd  (%r12,%rsi,8),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%r15),%xmm1
  movsd  %xmm1,(%r15)
  mulsd  0x0(%r13,%rsi,8),%xmm0
  addsd  (%r8),%xmm0
  movsd  %xmm0,(%r8)
L387:
  add    $0x1,%eax
  add    $0x10,%edx
  add    %r14d,%ecx
  cmp    %eax,%edi
  jne    L515
L66:
  add    $0x1,%r10d
  cmp    %r10d,(%rsp)
  jne    L164
L85:
  mov    0xe0(%rsp),%rbx
  addl   $0x1,0x40(%rsp)
  mov    0x40(%rsp),%eax
  add    %rbx,%r15
  add    %rbx,%r8
  cmp    %eax,0x8c(%rsp)
  jne    L455
L183:
  subl   $0x1,0x58(%rsp)
  mov    0x58(%rsp),%eax
  addq   $0x8,0xa8(%rsp)
  cmp    0x14c(%rsp),%eax
  jne    L416
L318:
  mov    0xf4(%rsp),%edi
  addl   $0x1,0xd8(%rsp)
  add    %edi,0xd0(%rsp)
  mov    0xd8(%rsp),%eax
  mov    0x120(%rsp),%edi
  add    %edi,0xe8(%rsp)
  cmp    %eax,0xfc(%rsp)
  jge    L293
  mov    %r14d,%r15d
L327:
  mov    0xf0(%rsp),%edi
  addl   $0x1,0xd4(%rsp)
  add    %edi,0xdc(%rsp)
  mov    0xd4(%rsp),%eax
  sub    %edi,0xec(%rsp)
  cmp    %eax,0xf8(%rsp)
  jge    L310
L136:
  mov    0x968(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L337
  add    $0x978,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L252:
  mov    0x98(%rsp),%r11d
  xor    %eax,%eax
L329:
  mov    %r11d,%r10d
  lea    0x1(%r11),%edi
  xor    %ebx,%ebx
  xor    %ebp,%ebp
  xor    %esi,%esi
  xor    %r8d,%r8d
  cs nopw 0x0(%rax,%rax,1)
L530:
  xor    %edx,%edx
  test   %r10d,%r10d
  js     L75
  nopw   0x0(%rax,%rax,1)
L469:
  lea    (%rdx,%r8,1),%ecx
  cmp    %ecx,%r9d
  cmove  %edx,%ebx
  cmove  %esi,%ebp
  add    $0x1,%edx
  cmp    %edi,%edx
  jne    L469
  lea    0x1(%r8,%r10,1),%r8d
L75:
  add    $0x1,%esi
  sub    $0x1,%r10d
  sub    $0x1,%edi
  cmp    %r11d,%esi
  jle    L530
  test   %eax,%eax
  jg     L476
L361:
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  jmp    L200
L430:
  mov    0x9b0(%rsp),%r11d
  mov    %edx,%r9d
  jmp    L329
L410:
  lea    0x2(%r10),%eax
  mov    %ebx,0xa8(%rsp)
  lea    -0x1(%r10),%esi
  mov    0x4c(%rsp),%ebx
  mov    %eax,0x9c(%rsp)
  lea    -0x1(%r14),%eax
  pxor   %xmm0,%xmm0
  mov    %eax,0xb0(%rsp)
  lea    0x2(%r14),%eax
  mov    %eax,0x30(%rsp)
  mov    %ebp,0xb4(%rsp)
  mov    0x78(%rsp),%rbp
  mov    %r12,0xb8(%rsp)
  mov    %r15d,%r12d
  mov    %esi,%r15d
L284:
  mov    %rbp,%rax
  mov    0xb0(%rsp),%r14d
  mov    %ebx,%ebp
  mov    %r13d,%ebx
  mov    %rax,%r13
L362:
  movsd  %xmm0,(%rsp)
  sub    $0x8,%rsp
  mov    %r14d,%edx
  mov    %r13,%r9
  push   0x28(%rsp)
  mov    %r12d,%r8d
  mov    %ebx,%ecx
  mov    %r15d,%esi
  push   0x28(%rsp)
  mov    %ebp,%edi
  xor    %eax,%eax
  add    $0x1,%r14d
  push   0x28(%rsp)
  call   <integrated_profile@plt>
  pxor   %xmm1,%xmm1
  movsd  0x20(%rsp),%xmm0
  add    $0x20,%rsp
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  cmp    0x30(%rsp),%r14d
  jne    L362
  mov    %r13,%rax
  add    $0x1,%r15d
  mov    %ebx,%r13d
  mov    %ebp,%ebx
  mov    %rax,%rbp
  cmp    0x9c(%rsp),%r15d
  jne    L284
  mov    %r12d,%r15d
  mov    0xa8(%rsp),%ebx
  mov    0xb4(%rsp),%ebp
  divsd  D115(%rip),%xmm0
  mov    0xb8(%rsp),%r12
  jmp    L130
L353:
  movsd  0x80(%rsp),%xmm2
  movsd  %xmm2,0x8(%rsp)
  jmp    L334
L273:
  cmpl   $0x1,0x4c(%rsp)
  jne    L458
  movsd  0x10(%r13),%xmm1
  movsd  0x18(%r13),%xmm7
  movsd  D18(%rip),%xmm3
  movsd  0x40(%r13),%xmm0
  movsd  %xmm1,0x28(%rsp)
  mulsd  %xmm1,%xmm1
  movsd  D18(%rip),%xmm2
  movsd  0x80(%rsp),%xmm4
  mulsd  %xmm0,%xmm0
  movsd  %xmm7,0x30(%rsp)
  divsd  %xmm1,%xmm3
  movapd %xmm7,%xmm1
  mulsd  %xmm7,%xmm1
  divsd  %xmm1,%xmm2
  movapd %xmm3,%xmm1
  subsd  %xmm2,%xmm1
  addsd  %xmm2,%xmm3
  mulsd  %xmm1,%xmm1
  movsd  %xmm3,0x8(%rsp)
  addsd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm4
  movapd %xmm1,%xmm0
  ja     L147
  sqrtsd %xmm0,%xmm0
L101:
  movsd  0x80(%rsp),%xmm6
  addsd  0x8(%rsp),%xmm0
  ucomisd %xmm0,%xmm6
  ja     L529
  sqrtsd %xmm0,%xmm0
L96:
  movsd  D18(%rip),%xmm4
  movsd  0x80(%rsp),%xmm7
  divsd  %xmm0,%xmm4
  ucomisd %xmm1,%xmm7
  movsd  %xmm4,0x38(%rsp)
  ja     L205
  sqrtsd %xmm1,%xmm1
L176:
  movsd  0x80(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm4
  ja     L124
  movapd %xmm0,%xmm1
  sqrtsd %xmm1,%xmm1
L170:
  movsd  D18(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  (%rsp),%xmm1
  mulsd  D91(%rip),%xmm1
  mulsd  0x38(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  0x28(%rsp),%xmm1
  mulsd  0x30(%rsp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %rbx,%xmm1
  mulsd  D59(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xc0(%rsp)
  jmp    L458
L117:
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x80(%rsp)
  movq   %xmm2,%rbx
  jmp    L526
L337:
  call   <__stack_chk_fail@plt>
L124:
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L170
L205:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L176
L529:
  movsd  %xmm1,0x38(%rsp)
  call   <sqrt@plt>
  movsd  0x38(%rsp),%xmm1
  jmp    L96
L147:
  movsd  %xmm1,0x38(%rsp)
  call   <sqrt@plt>
  movsd  0x38(%rsp),%xmm1
  jmp    L101
```

tool_calls: name: read_data
arguments: data_tag: D39
datatype: f64
name: read_data
arguments: data_tag: D91
datatype: f64
name: read_data
arguments: data_tag: D59
datatype: f64
name: read_data
arguments: data_tag: D87
datatype: f64
name: read_data
arguments: data_tag: D115
datatype: f64
name: read_data
arguments: data_tag: D18
datatype: f64

tool: D39: 0.8493218

tool: D91: 3.14159265

tool: D59: 0.25

tool: D87: 0.5

tool: D115: 9

tool: D18: 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;
}
```