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

```asm
<asg_vstep3d>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x30(%rsp)
  mov    %rsi,-0x40(%rsp)
  mov    %rdx,-0x18(%rsp)
  mov    %rcx,-0x10(%rsp)
  mov    %r8,-0x28(%rsp)
  mov    %r9,-0x20(%rsp)
  mov    0x60(%rsp),%rbp
  mov    0x70(%rsp),%r13
  mov    0x80(%rsp),%r12
  mov    0xa0(%rsp),%r15
  mov    0x58(%rsp),%rax
  mov    0x8(%rax),%eax
  cmp    0x8(%rbp),%eax
  jg     L534
  movslq %eax,%r14
  movsd  D1(%rip),%xmm2
  mov    0x98(%rsp),%eax
  mov    %rax,-0x48(%rsp)
  mov    0x58(%rsp),%r9
  jmp    L610
L720:
  add    $0x1,%r14
  cmp    %r14d,0x8(%rbp)
  jl     L185
L610:
  mov    0x4(%r9),%eax
  mov    %eax,-0x38(%rsp)
  cmp    0x4(%rbp),%eax
  jg     L720
  movslq %eax,%r8
  shl    $0x3,%r8
  jmp    L190
L185:
  mov    0x70(%rsp),%r13
  mov    0x80(%rsp),%r12
L534:
  mov    0x68(%rsp),%rax
  mov    0x8(%rax),%eax
  cmp    0x8(%r13),%eax
  jg     L70
  movslq %eax,%r14
  movsd  D1(%rip),%xmm2
  mov    %rbp,0x60(%rsp)
  mov    0x68(%rsp),%rbx
  mov    %r12,0x80(%rsp)
  mov    0x50(%rsp),%r12
  mov    %r15,%rsi
  mov    -0x18(%rsp),%r15
  jmp    L564
L643:
  add    $0x1,%r14
  cmp    %r14d,0x8(%r13)
  jl     L642
L564:
  mov    0x4(%rbx),%eax
  mov    %eax,-0x40(%rsp)
  cmp    0x4(%r13),%eax
  jg     L643
  cltq
  shl    $0x2,%rax
  mov    %rax,-0x38(%rsp)
  jmp    L949
L642:
  mov    0x60(%rsp),%rbp
  mov    0x80(%rsp),%r12
  mov    %rsi,%r15
L70:
  mov    0x78(%rsp),%rax
  mov    0x8(%rax),%eax
  cmp    0x8(%r12),%eax
  jg     L460
  cltq
  mov    %rax,-0x38(%rsp)
  movsd  D1(%rip),%xmm2
  mov    -0x10(%rsp),%r8
  mov    %rbp,0x60(%rsp)
  mov    %r13,0x70(%rsp)
  mov    0x78(%rsp),%r9
  mov    %r15,%rdi
  mov    0x50(%rsp),%r15
  jmp    L88
L932:
  addq   $0x1,-0x38(%rsp)
  mov    -0x38(%rsp),%rax
  cmp    %eax,0x8(%r12)
  jl     L613
L88:
  mov    0x4(%r9),%eax
  mov    %eax,-0x40(%rsp)
  cmp    0x4(%r12),%eax
  jg     L932
  mov    -0x38(%rsp),%rbx
  lea    0x0(,%rbx,4),%rsi
  mov    %rsi,-0x18(%rsp)
  movslq %eax,%rcx
  shl    $0x3,%rcx
  mov    %ebx,%eax
  mov    %ebx,-0x10(%rsp)
  add    %ebx,%ebx
  mov    %ebx,-0x48(%rsp)
  add    0x98(%rsp),%eax
  mov    %eax,-0x4(%rsp)
  jmp    L101
L613:
  mov    0x60(%rsp),%rbp
  mov    0x70(%rsp),%r13
L460:
  mov    0x88(%rsp),%rax
  cmpl   $0x0,(%rax)
  je     L468
  mov    0x58(%rsp),%rax
  mov    0x8(%rax),%r10d
  cmp    0x8(%rbp),%r10d
  jg     L506
  movslq %r10d,%r10
  mov    -0x28(%rsp),%rbx
  mov    %rax,%r8
  mov    0x98(%rsp),%esi
  jmp    L39
L965:
  mov    %r9,%rdi
  add    (%rbx,%r10,8),%rdi
  mov    $0x1,%edx
L313:
  mov    (%rdi),%rcx
  mov    (%r8),%eax
  lea    (%rax,%rdx,1),%r14d
  movslq %r14d,%r14
  movss  -0x4(%rcx,%r14,4),%xmm0
  sub    %edx,%eax
  cltq
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%edx
  cmp    %edx,%esi
  jne    L313
L236:
  add    $0x1,%r11d
  add    $0x8,%r9
  cmp    %r11d,0x4(%rbp)
  jl     L935
L1077:
  cmp    $0x1,%esi
  jg     L965
  jmp    L236
L935:
  add    $0x1,%r10
  cmp    %r10d,0x8(%rbp)
  jl     L468
L39:
  mov    0x4(%r8),%r11d
  cmp    0x4(%rbp),%r11d
  jg     L935
  movslq %r11d,%r9
  shl    $0x3,%r9
  jmp    L1077
L468:
  mov    0x90(%rsp),%rax
  cmpl   $0x0,(%rax)
  je     L506
  mov    0x58(%rsp),%rax
  mov    0x8(%rax),%r10d
  cmp    0x8(%rbp),%r10d
  jg     L506
  movslq %r10d,%r10
  mov    -0x28(%rsp),%rbx
  mov    0x98(%rsp),%edi
  jmp    L363
L685:
  mov    %r9,%r8
  add    (%rbx,%r10,8),%r8
  mov    $0x1,%edx
L470:
  mov    (%r8),%rsi
  mov    0x0(%rbp),%eax
  mov    %eax,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  movss  0x4(%rsi,%rcx,4),%xmm0
  add    %edx,%eax
  cltq
  movss  %xmm0,(%rsi,%rax,4)
  add    $0x1,%edx
  cmp    %edx,%edi
  jne    L470
L281:
  add    $0x1,%r11d
  add    $0x8,%r9
  cmp    %r11d,0x4(%rbp)
  jl     L811
L184:
  cmp    $0x1,%edi
  jg     L685
  jmp    L281
L811:
  add    $0x1,%r10
  cmp    %r10d,0x8(%rbp)
  jl     L506
L363:
  mov    0x58(%rsp),%rax
  mov    0x4(%rax),%r11d
  cmp    0x4(%rbp),%r11d
  jg     L811
  movslq %r11d,%r9
  shl    $0x3,%r9
  jmp    L184
L506:
  mov    0x88(%rsp),%rax
  cmpl   $0x0,0x4(%rax)
  je     L796
  mov    0x68(%rsp),%rax
  mov    0x8(%rax),%r9d
  cmp    0x8(%r13),%r9d
  jg     L795
  movslq %r9d,%r9
  mov    -0x20(%rsp),%rbx
  mov    %rax,%r10
  mov    0x98(%rsp),%r8d
  jmp    L110
L485:
  mov    (%rbx,%r9,8),%rdi
  mov    $0x1,%edx
L321:
  mov    0x4(%r10),%eax
  lea    (%rax,%rdx,1),%ecx
  movslq %ecx,%rcx
  mov    -0x8(%rdi,%rcx,8),%rcx
  movss  (%rcx,%rsi,1),%xmm0
  sub    %edx,%eax
  cltq
  mov    (%rdi,%rax,8),%rax
  movss  %xmm0,(%rax,%rsi,1)
  add    $0x1,%edx
  cmp    %edx,%r8d
  jne    L321
L745:
  add    $0x1,%r11d
  add    $0x4,%rsi
  cmp    %r11d,0x0(%r13)
  jl     L537
L176:
  cmp    $0x1,%r8d
  jg     L485
  jmp    L745
L537:
  add    $0x1,%r9
  cmp    %r9d,0x8(%r13)
  jl     L796
L110:
  mov    (%r10),%r11d
  cmp    0x0(%r13),%r11d
  jg     L537
  movslq %r11d,%rsi
  shl    $0x2,%rsi
  jmp    L176
L796:
  mov    0x90(%rsp),%rax
  cmpl   $0x0,0x4(%rax)
  je     L795
  mov    0x68(%rsp),%rax
  mov    0x8(%rax),%r9d
  cmp    0x8(%r13),%r9d
  jg     L795
  movslq %r9d,%r9
  mov    -0x20(%rsp),%r11
  mov    0x98(%rsp),%r8d
  jmp    L993
L83:
  mov    (%r11,%r9,8),%rdi
  mov    $0x1,%edx
L50:
  mov    0x4(%r13),%eax
  mov    %eax,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  mov    0x8(%rdi,%rcx,8),%rcx
  movss  (%rcx,%rsi,1),%xmm0
  add    %edx,%eax
  cltq
  mov    (%rdi,%rax,8),%rax
  movss  %xmm0,(%rax,%rsi,1)
  add    $0x1,%edx
  cmp    %edx,%r8d
  jne    L50
L403:
  add    $0x1,%r10d
  add    $0x4,%rsi
  cmp    %r10d,0x0(%r13)
  jl     L341
L370:
  cmp    $0x1,%r8d
  jg     L83
  jmp    L403
L341:
  add    $0x1,%r9
  cmp    %r9d,0x8(%r13)
  jl     L795
L993:
  mov    0x68(%rsp),%rax
  mov    (%rax),%r10d
  cmp    0x0(%r13),%r10d
  jg     L341
  movslq %r10d,%rsi
  shl    $0x2,%rsi
  jmp    L370
L795:
  mov    0x88(%rsp),%rax
  cmpl   $0x0,0x8(%rax)
  je     L1058
  mov    0x78(%rsp),%rax
  mov    0x4(%rax),%r9d
  cmp    0x4(%r12),%r9d
  jg     L1038
  movslq %r9d,%rdi
  shl    $0x3,%rdi
  mov    0x38(%rsp),%r8
  mov    %rax,%r11
  mov    0x98(%rsp),%r10d
  jmp    L781
L307:
  mov    0x8(%r11),%eax
  lea    (%rax,%rdx,1),%ecx
  movslq %ecx,%rcx
  mov    -0x8(%r8,%rcx,8),%rcx
  mov    (%rcx,%rdi,1),%rcx
  movss  (%rcx,%rsi,1),%xmm0
  sub    %edx,%eax
  cltq
  mov    (%r8,%rax,8),%rax
  mov    (%rax,%rdi,1),%rax
  movss  %xmm0,(%rax,%rsi,1)
  add    $0x1,%edx
  cmp    %edx,%r10d
  jne    L307
L268:
  add    $0x1,%ebx
  add    $0x4,%rsi
  cmp    %ebx,(%r12)
  jl     L886
L145:
  mov    $0x1,%edx
  cmp    $0x1,%r10d
  jg     L307
  jmp    L268
L886:
  add    $0x1,%r9d
  add    $0x8,%rdi
  cmp    %r9d,0x4(%r12)
  jl     L1058
L781:
  mov    (%r11),%ebx
  cmp    (%r12),%ebx
  jg     L886
  movslq %ebx,%rsi
  shl    $0x2,%rsi
  jmp    L145
L1058:
  mov    0x90(%rsp),%rax
  cmpl   $0x0,0x8(%rax)
  je     L1038
  mov    0x78(%rsp),%rax
  mov    0x4(%rax),%r9d
  cmp    0x4(%r12),%r9d
  jg     L1038
  movslq %r9d,%rdi
  shl    $0x3,%rdi
  mov    0x38(%rsp),%r8
  mov    0x98(%rsp),%r10d
  jmp    L340
L658:
  mov    0x8(%r12),%eax
  mov    %eax,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  mov    0x8(%r8,%rcx,8),%rcx
  mov    (%rcx,%rdi,1),%rcx
  movss  (%rcx,%rsi,1),%xmm0
  add    %edx,%eax
  cltq
  mov    (%r8,%rax,8),%rax
  mov    (%rax,%rdi,1),%rax
  movss  %xmm0,(%rax,%rsi,1)
  add    $0x1,%edx
  cmp    %edx,%r10d
  jne    L658
L80:
  add    $0x1,%r11d
  add    $0x4,%rsi
  cmp    %r11d,(%r12)
  jl     L407
L990:
  mov    $0x1,%edx
  cmp    $0x1,%r10d
  jg     L658
  jmp    L80
L407:
  add    $0x1,%r9d
  add    $0x8,%rdi
  cmp    %r9d,0x4(%r12)
  jl     L1038
L340:
  mov    0x78(%rsp),%rax
  mov    (%rax),%r11d
  cmp    (%r12),%r11d
  jg     L407
  movslq %r11d,%rsi
  shl    $0x2,%rsi
  jmp    L990
L344:
  cmpl   $0x0,0x98(%rsp)
  jle    L558
L142:
  mov    -0x10(%rsp),%ebp
  mov    $0x0,%r13d
  mov    -0x4(%rsp),%r10d
L839:
  mov    (%r9),%eax
  cmp    (%r12),%eax
  jg     L863
  mov    0x10(%r15),%rdx
  mov    %r13,%r14
  add    0x10(%rdi),%r14
  movslq %ebp,%rsi
  mov    %rcx,%rbx
  add    0x8(%r8,%rsi,8),%rbx
  mov    -0x48(%rsp),%esi
  sub    %ebp,%esi
  movslq %esi,%rsi
  mov    %rcx,%r11
  add    (%r8,%rsi,8),%r11
  cltq
  mov    %ebp,%esi
L729:
  mov    (%rbx),%rbp
  movss  0x0(%rbp,%rax,4),%xmm0
  mov    (%r11),%rbp
  subss  0x0(%rbp,%rax,4),%xmm0
  mulss  (%r14),%xmm0
  addss  (%rdx,%rax,4),%xmm0
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,(%r12)
  jge    L729
  mov    %esi,%ebp
L863:
  add    $0x4,%r13
  add    $0x1,%ebp
  cmp    %r10d,%ebp
  jne    L839
L991:
  mov    (%r9),%eax
  cmp    (%r12),%eax
  jg     L558
  mov    0x48(%rsp),%rsi
  mov    -0x18(%rsp),%rbx
  mov    %rbx,%r14
  add    0x10(%rsi),%r14
  mov    0x38(%rsp),%rdx
  mov    -0x38(%rsp),%rsi
  mov    %rcx,%r13
  add    (%rdx,%rsi,8),%r13
  mov    0x40(%rsp),%rdx
  add    0x10(%rdx),%rbx
  mov    %rbx,%rbp
  mov    -0x30(%rsp),%rdx
  mov    %rcx,%rbx
  add    (%rdx,%rsi,8),%rbx
  mov    %rcx,%r11
  add    0x8(%rdx,%rsi,8),%r11
  mov    0x10(%r15),%r10
  cltq
L284:
  mov    0x0(%r13),%rdx
  lea    (%rdx,%rax,4),%rdx
  movss  (%rdx),%xmm0
  mulss  0x0(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    (%rbx),%rsi
  movss  (%rsi,%rax,4),%xmm1
  mov    (%r11),%rsi
  addss  (%rsi,%rax,4),%xmm1
  cvtss2sd %xmm1,%xmm1
  mulsd  %xmm2,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd (%r10,%rax,4),%xmm3
  mulsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd (%r14),%xmm1
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %eax,(%r12)
  jge    L284
L558:
  addl   $0x1,-0x40(%rsp)
  mov    -0x40(%rsp),%eax
  add    $0x8,%rcx
  cmp    %eax,0x4(%r12)
  jl     L932
L101:
  mov    (%r9),%eax
  cmp    (%r12),%eax
  jg     L344
  mov    0x10(%r15),%rdx
  cltq
L360:
  movl   $0x0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,(%r12)
  jge    L360
  cmpl   $0x0,0x98(%rsp)
  jg     L142
  jmp    L991
L483:
  cmpl   $0x0,0x98(%rsp)
  jle    L402
L543:
  mov    -0x40(%rsp),%eax
  lea    (%rax,%rax,1),%edi
  mov    %edi,-0x48(%rsp)
  mov    %eax,%r10d
  mov    $0x0,%r11d
  mov    %eax,%ebp
  add    0x98(%rsp),%ebp
  mov    %ebp,%edi
L1015:
  mov    (%rbx),%eax
  cmp    0x0(%r13),%eax
  jg     L619
  mov    0x8(%r12),%rdx
  mov    %r11,%rbp
  add    0x8(%rsi),%rbp
  mov    (%r15,%r14,8),%r8
  movslq %r10d,%rcx
  lea    0x8(%r8,%rcx,8),%r9
  mov    -0x48(%rsp),%ecx
  sub    %r10d,%ecx
  movslq %ecx,%rcx
  lea    (%r8,%rcx,8),%r8
  cltq
  mov    %r10d,%ecx
L715:
  mov    (%r9),%r10
  movss  (%r10,%rax,4),%xmm0
  mov    (%r8),%r10
  subss  (%r10,%rax,4),%xmm0
  mulss  0x0(%rbp),%xmm0
  addss  (%rdx,%rax,4),%xmm0
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0x0(%r13)
  jge    L715
  mov    %ecx,%r10d
L619:
  add    $0x4,%r11
  add    $0x1,%r10d
  cmp    %r10d,%edi
  jne    L1015
L868:
  mov    (%rbx),%eax
  cmp    0x0(%r13),%eax
  jg     L402
  mov    0x48(%rsp),%rcx
  mov    -0x38(%rsp),%rdi
  mov    %rdi,%rbp
  add    0x8(%rcx),%rbp
  lea    (%rdi,%rdi,1),%rdx
  mov    -0x20(%rsp),%rcx
  mov    %rdx,%r11
  add    (%rcx,%r14,8),%r11
  mov    0x40(%rsp),%rcx
  add    0x8(%rcx),%rdi
  mov    %rdi,%r10
  mov    -0x30(%rsp),%rdi
  mov    (%rdi,%r14,8),%rcx
  lea    (%rcx,%rdx,1),%r9
  lea    0x8(%rcx,%rdx,1),%r8
  mov    0x8(%r12),%rdi
  cltq
  mov    %r14,%rcx
L434:
  mov    (%r11),%rdx
  lea    (%rdx,%rax,4),%rdx
  movss  (%rdx),%xmm0
  mulss  (%r10),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    (%r9),%r14
  movss  (%r14,%rax,4),%xmm1
  mov    (%r8),%r14
  addss  (%r14,%rax,4),%xmm1
  cvtss2sd %xmm1,%xmm1
  mulsd  %xmm2,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd (%rdi,%rax,4),%xmm3
  mulsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x0(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %eax,0x0(%r13)
  jge    L434
  mov    %rcx,%r14
L402:
  addl   $0x1,-0x40(%rsp)
  mov    -0x40(%rsp),%eax
  addq   $0x4,-0x38(%rsp)
  cmp    %eax,0x4(%r13)
  jl     L643
L949:
  mov    (%rbx),%eax
  cmp    0x0(%r13),%eax
  jg     L483
  mov    0x8(%r12),%rdx
  cltq
L1055:
  movl   $0x0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0x0(%r13)
  jge    L1055
  cmpl   $0x0,0x98(%rsp)
  jg     L543
  jmp    L868
L535:
  cmpl   $0x0,0x98(%rsp)
  jle    L943
L997:
  mov    $0x0,%r10d
  mov    $0x0,%r12d
  mov    0x50(%rsp),%r13
L632:
  mov    (%r9),%eax
  cmp    0x0(%rbp),%eax
  jg     L332
  mov    0x0(%r13),%rsi
  mov    (%r15),%rdx
  lea    (%rdx,%r12,4),%rbx
  mov    -0x40(%rsp),%rdi
  mov    %r8,%r11
  add    (%rdi,%r14,8),%r11
  cltq
  mov    %rax,%rdx
  sub    %r12,%rdx
  shl    $0x2,%rdx
L3:
  mov    (%r11),%rcx
  lea    (%rcx,%rdx,1),%rdi
  movss  0x4(%r10,%rdi,1),%xmm0
  subss  (%rcx,%rdx,1),%xmm0
  mulss  (%rbx),%xmm0
  addss  (%rsi,%rax,4),%xmm0
  movss  %xmm0,(%rsi,%rax,4)
  add    $0x1,%rax
  add    $0x4,%rdx
  cmp    %eax,0x0(%rbp)
  jge    L3
L332:
  add    $0x1,%r12
  add    $0x8,%r10
  cmp    -0x48(%rsp),%r12
  jne    L632
L1053:
  mov    (%r9),%edx
  cmp    0x0(%rbp),%edx
  jg     L943
  mov    0x48(%rsp),%rax
  mov    (%rax),%r13
  mov    -0x28(%rsp),%rax
  mov    %r8,%r12
  add    (%rax,%r14,8),%r12
  mov    0x40(%rsp),%rax
  mov    (%rax),%rbx
  mov    -0x30(%rsp),%rax
  mov    %r8,%r11
  add    (%rax,%r14,8),%r11
  mov    0x50(%rsp),%rax
  mov    (%rax),%r10
  movslq %edx,%rax
  shl    $0x2,%rax
L46:
  pxor   %xmm3,%xmm3
  cvtss2sd 0x0(%r13,%rax,1),%xmm3
  mov    %rax,%rcx
  add    (%r12),%rcx
  movss  (%rcx),%xmm0
  mulss  (%rbx,%rax,1),%xmm0
  cvtss2sd %xmm0,%xmm0
  mov    (%r11),%rsi
  movss  (%rsi,%rax,1),%xmm1
  mov    %rax,%rdi
  add    $0x4,%rax
  addss  (%rsi,%rax,1),%xmm1
  cvtss2sd %xmm1,%xmm1
  mulsd  %xmm2,%xmm1
  pxor   %xmm4,%xmm4
  cvtss2sd (%r10,%rdi,1),%xmm4
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rcx)
  add    $0x1,%edx
  cmp    %edx,0x0(%rbp)
  jge    L46
L943:
  addl   $0x1,-0x38(%rsp)
  mov    -0x38(%rsp),%eax
  add    $0x8,%r8
  cmp    %eax,0x4(%rbp)
  jl     L720
L190:
  mov    (%r9),%eax
  cmp    0x0(%rbp),%eax
  jg     L535
  mov    0x50(%rsp),%rbx
  mov    (%rbx),%rdx
  cltq
L872:
  movl   $0x0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0x0(%rbp)
  jge    L872
  cmpl   $0x0,0x98(%rsp)
  jg     L997
  jmp    L1053
L1038:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D1
type_infered: f64

tool: D1: 0.5

assistant: ```c
void asg_vstep3d(float ***restrict buoy, float ***restrict p0, float ***restrict p1, float ***restrict p2, float ***restrict v0, float ***restrict v1, float ***restrict v2, float **restrict ev, float **restrict evp, float **restrict gradp, int *gsc_v0, int *gec_v0, int *gsc_v1, int *gec_v1, int *gsc_v2, int *gec_v2, int *lbc, int *rbc, int maxoff, float **restrict c) {
  int i0, i1, i2;
  int ioff;
  for (i2 = gsc_v0[2]; i2 <= gec_v0[2]; i2++) {
    for (i1 = gsc_v0[1]; i1 <= gec_v0[1]; i1++) {
      for (i0 = gsc_v0[0]; i0 <= gec_v0[0]; i0++)
        gradp[0][i0] = 0;
      for (ioff = 0; ioff < maxoff; ioff++) {
        for (i0 = gsc_v0[0]; i0 <= gec_v0[0]; i0++)
          gradp[0][i0] += c[0][ioff] * (p0[i2][i1][i0 + ioff + 1] - p0[i2][i1][i0 - ioff]);
      }
      for (i0 = gsc_v0[0]; i0 <= gec_v0[0]; i0++)
        v0[i2][i1][i0] = evp[0][i0] * (v0[i2][i1][i0] * ev[0][i0] - 0.5 * (buoy[i2][i1][i0] + buoy[i2][i1][i0 + 1]) * gradp[0][i0]);
    }
  }
  for (i2 = gsc_v1[2]; i2 <= gec_v1[2]; i2++) {
    for (i1 = gsc_v1[1]; i1 <= gec_v1[1]; i1++) {
      for (i0 = gsc_v1[0]; i0 <= gec_v1[0]; i0++)
        gradp[1][i0] = 0;
      for (ioff = 0; ioff < maxoff; ioff++) {
        for (i0 = gsc_v1[0]; i0 <= gec_v1[0]; i0++)
          gradp[1][i0] += c[1][ioff] * (p1[i2][i1 + ioff + 1][i0] - p1[i2][i1 - ioff][i0]);
      }
      for (i0 = gsc_v1[0]; i0 <= gec_v1[0]; i0++)
        v1[i2][i1][i0] = evp[1][i1] * (v1[i2][i1][i0] * ev[1][i1] - 0.5 * (buoy[i2][i1][i0] + buoy[i2][i1 + 1][i0]) * gradp[1][i0]);
    }
  }
  for (i2 = gsc_v2[2]; i2 <= gec_v2[2]; i2++) {
    for (i1 = gsc_v2[1]; i1 <= gec_v2[1]; i1++) {
      for (i0 = gsc_v2[0]; i0 <= gec_v2[0]; i0++)
        gradp[2][i0] = 0;
      for (ioff = 0; ioff < maxoff; ioff++) {
        for (i0 = gsc_v2[0]; i0 <= gec_v2[0]; i0++)
          gradp[2][i0] += c[2][ioff] * (p2[i2 + ioff + 1][i1][i0] - p2[i2 - ioff][i1][i0]);
      }
      for (i0 = gsc_v2[0]; i0 <= gec_v2[0]; i0++)
        v2[i2][i1][i0] = evp[2][i2] * (v2[i2][i1][i0] * ev[2][i2] - 0.5 * (buoy[i2][i1][i0] + buoy[i2 + 1][i1][i0]) * gradp[2][i0]);
    }
  }
  if (lbc[0]) {
    for (i2 = gsc_v0[2]; i2 <= gec_v0[2]; i2++) {
      for (i1 = gsc_v0[1]; i1 <= gec_v0[1]; i1++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v0[i2][i1][gsc_v0[0] - ioff] = v0[i2][i1][gsc_v0[0] + ioff - 1];
        }
      }
    }
  }
  if (rbc[0]) {
    for (i2 = gsc_v0[2]; i2 <= gec_v0[2]; i2++) {
      for (i1 = gsc_v0[1]; i1 <= gec_v0[1]; i1++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v0[i2][i1][gec_v0[0] + ioff] = v0[i2][i1][gec_v0[0] - ioff + 1];
        }
      }
    }
  }
  if (lbc[1]) {
    for (i2 = gsc_v1[2]; i2 <= gec_v1[2]; i2++) {
      for (i0 = gsc_v1[0]; i0 <= gec_v1[0]; i0++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v1[i2][gsc_v1[1] - ioff][i0] = v1[i2][gsc_v1[1] + ioff - 1][i0];
        }
      }
    }
  }
  if (rbc[1]) {
    for (i2 = gsc_v1[2]; i2 <= gec_v1[2]; i2++) {
      for (i0 = gsc_v1[0]; i0 <= gec_v1[0]; i0++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v1[i2][gec_v1[1] + ioff][i0] = v1[i2][gec_v1[1] - ioff + 1][i0];
        }
      }
    }
  }
  if (lbc[2]) {
    for (i1 = gsc_v2[1]; i1 <= gec_v2[1]; i1++) {
      for (i0 = gsc_v2[0]; i0 <= gec_v2[0]; i0++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v2[gsc_v2[2] - ioff][i1][i0] = v2[gsc_v2[2] + ioff - 1][i1][i0];
        }
      }
    }
  }
  if (rbc[2]) {
    for (i1 = gsc_v2[1]; i1 <= gec_v2[1]; i1++) {
      for (i0 = gsc_v2[0]; i0 <= gec_v2[0]; i0++) {
        for (ioff = 1; ioff < maxoff; ioff++) {
          v2[gec_v2[2] + ioff][i1][i0] = v2[gec_v2[2] - ioff + 1][i1][i0];
        }
      }
    }
  }
}
```