user: Please show me the C implementation that matches the assembly code listed below:

```asm
<extendsurface>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x178,%rsp
  movaps D32(%rip),%xmm0
  movaps D48(%rip),%xmm1
  mov    %edi,0x5c(%rsp)
  movaps D38(%rip),%xmm2
  mov    %esi,0x20(%rsp)
  movss  D32(%rip),%xmm3
  mov    %edx,0xe4(%rsp)
  mov    0x1b0(%rsp),%r11
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  mov    D32(%rip),%rax
  movaps %xmm0,0xf0(%rsp)
  movaps D22(%rip),%xmm0
  movaps %xmm1,0x100(%rsp)
  mov    %rax,0x150(%rsp)
  movaps %xmm0,0x110(%rsp)
  movaps %xmm2,0x120(%rsp)
  movaps %xmm1,0x130(%rsp)
  movaps %xmm0,0x140(%rsp)
  movss  %xmm3,0x158(%rsp)
  test   %edx,%edx
  jle    L120
  mov    %edi,%ebx
  test   %edi,%edi
  jle    L120
  mov    %esi,%eax
  test   %esi,%esi
  jle    L120
  imul   %ebx,%esi
  neg    %edi
  movl   $0x0,(%rsp)
  mov    %rcx,%rbp
  mov    %edi,0x98(%rsp)
  mov    %ebx,%edi
  movslq %eax,%rbx
  mov    %r8,%r12
  mov    %edi,0xc0(%rsp)
  mov    %rbx,%r13
  pxor   %xmm5,%xmm5
  mov    %r11,%r14
  mov    %esi,0xe0(%rsp)
  mov    %eax,%esi
  sub    $0x1,%eax
  movss  D24(%rip),%xmm2
  neg    %esi
  mov    %eax,0x48(%rsp)
  lea    0xfc(%rsp),%rax
  mov    %esi,0x9c(%rsp)
  lea    0x0(,%rbx,4),%rsi
  mov    %r9,%rbx
  mov    %rsi,0xe8(%rsp)
  lea    -0x1(%rdi),%esi
  mov    %esi,0x24(%rsp)
  lea    -0x1(%rdx),%esi
  mov    %esi,0xc(%rsp)
  mov    %rax,0xa0(%rsp)
  nopl   0x0(%rax,%rax,1)
L49:
  mov    0x5c(%rsp),%esi
  mov    0x20(%rsp),%r9d
  xor    %r11d,%r11d
  mov    %r13,%r8
  mov    0x9c(%rsp),%ecx
  mov    0x98(%rsp),%edi
  mov    %r11d,%r13d
  mov    0xe0(%rsp),%edx
  mov    0xc0(%rsp),%r15d
  mov    %edi,%eax
  add    %esi,%edi
  mov    %ecx,%esi
  mov    %ecx,0x8(%rsp)
  sub    %edx,%esi
  add    %edx,%ecx
  lea    0x1(%rdi),%edx
  mov    %edi,0x98(%rsp)
  sub    %eax,%edx
  mov    %esi,0x10(%rsp)
  imul   %r9d,%edx
  mov    %ecx,0x9c(%rsp)
  mov    %ecx,0x4(%rsp)
  mov    %edx,0x60(%rsp)
  lea    0x1(%r15),%edx
  sub    %eax,%edx
  imul   %r9d,%edx
  mov    %edx,0x6c(%rsp)
  lea    0x2(%rdi),%edx
  sub    %eax,%edx
  imul   %r9d,%edx
  mov    %edx,0x68(%rsp)
  lea    0x2(%r15),%edx
  mov    %rbx,%r15
  mov    %r12,%rbx
  sub    %eax,%edx
  lea    (%rsi,%r9,1),%eax
  mov    %r14,%r12
  imul   %r9d,%edx
  mov    %eax,0x14(%rsp)
  mov    %edx,0x64(%rsp)
  nopw   0x0(%rax,%rax,1)
L7:
  mov    0x10(%rsp),%r14d
  mov    0x60(%rsp),%eax
  mov    0x14(%rsp),%edi
  add    %r14d,%eax
  mov    %r14d,0x58(%rsp)
  mov    %eax,0x18(%rsp)
  mov    0x6c(%rsp),%eax
  mov    %edi,%r10d
  mov    %edi,0x10(%rsp)
  lea    (%rax,%r14,1),%r11d
  mov    0x20(%rsp),%eax
  mov    %r11d,0x4c(%rsp)
  add    %eax,%edi
  mov    0x68(%rsp),%eax
  mov    %edi,0x14(%rsp)
  add    %r14d,%eax
  mov    %eax,0x34(%rsp)
  mov    0x64(%rsp),%eax
  add    %r14d,%eax
  mov    %eax,0x30(%rsp)
  mov    (%rsp),%eax
  test   %eax,%eax
  sete   %cl
  test   %r13d,%r13d
  sete   %dl
  or     %edx,%ecx
  movslq 0x8(%rsp),%rdx
  mov    %ecx,%r9d
  movslq %r14d,%rcx
  mov    %rdx,0x88(%rsp)
  sub    %rcx,%rdx
  lea    0x0(%rbp,%rcx,4),%rsi
  lea    0x0(,%rdx,4),%rax
  movslq 0x4(%rsp),%rdx
  mov    %rcx,0x90(%rsp)
  mov    %rax,0x80(%rsp)
  lea    -0x1(%r14),%eax
  mov    %eax,0x50(%rsp)
  mov    0x8(%rsp),%eax
  mov    %rdx,0x78(%rsp)
  sub    %rcx,%rdx
  sub    $0x1,%eax
  lea    0x0(,%rdx,4),%rcx
  xor    %edx,%edx
  mov    %eax,0x38(%rsp)
  mov    0x4(%rsp),%eax
  mov    %rcx,0x70(%rsp)
  mov    $0x1,%ecx
  sub    $0x1,%eax
  mov    %eax,0x3c(%rsp)
  lea    -0x1(%r10),%eax
  mov    %eax,0x54(%rsp)
  lea    -0x1(%r11),%eax
  mov    %eax,0x40(%rsp)
  lea    -0x1(%rdi),%eax
  mov    %eax,0x44(%rsp)
  mov    0x18(%rsp),%eax
  jmp    L51
  nopl   0x0(%rax)
L152:
  test   %r9b,%r9b
  jne    L3
  mov    (%rsp),%r14d
  cmp    %r14d,0xc(%rsp)
  je     L3
  cmp    %r13d,0x24(%rsp)
  je     L3
  cmp    %edx,0x48(%rsp)
  je     L3
  movslq %eax,%r10
  lea    (%r15,%r10,4),%r14
  cmpb   $0x0,(%rbx,%r10,1)
  mov    %r14,0x18(%rsp)
  lea    (%r12,%r10,1),%r14
  mov    %r14,0x28(%rsp)
  je     L67
  movss  0x0(%rbp,%r10,4),%xmm0
  mov    0x18(%rsp),%rdi
  add    $0x1,%eax
  movss  %xmm0,(%rdi)
  mov    0x28(%rsp),%rdi
  movb   $0x1,(%rdi)
L21:
  add    $0x1,%rdx
  add    $0x1,%ecx
  add    $0x4,%rsi
  cmp    %rdx,%r8
  je     L60
  nopl   0x0(%rax,%rax,1)
L51:
  mov    %edx,%edi
  test   %edx,%edx
  jne    L152
L3:
  movslq %eax,%rdi
  add    $0x1,%rdx
  add    $0x1,%eax
  add    $0x1,%ecx
  movss  0x0(%rbp,%rdi,4),%xmm0
  add    $0x4,%rsi
  movss  %xmm0,(%r15,%rdi,4)
  movb   $0x0,(%r12,%rdi,1)
  cmp    %rdx,%r8
  jne    L51
L60:
  mov    0x20(%rsp),%esi
  add    $0x1,%r13d
  add    %esi,0x8(%rsp)
  add    %esi,0x4(%rsp)
  cmp    %r13d,0x5c(%rsp)
  jne    L7
  addl   $0x1,(%rsp)
  mov    0x5c(%rsp),%ecx
  mov    %r12,%r14
  mov    %r8,%r13
  mov    %rbx,%r12
  add    %ecx,0xc0(%rsp)
  mov    (%rsp),%eax
  mov    %r15,%rbx
  cmp    %eax,0xe4(%rsp)
  jne    L49
L120:
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  add    $0x178,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L67:
  mov    0x50(%rsp),%r14d
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  pxor   %xmm4,%xmm4
  lea    (%rdx,%r14,1),%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  cvtsi2ss %r11d,%xmm1
  mov    0x38(%rsp),%r11d
  add    %edx,%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm3,%xmm1
  cvtsi2ss %r11d,%xmm0
  mov    0x3c(%rsp),%r11d
  add    %edx,%r11d
  addss  %xmm5,%xmm1
  movslq %r11d,%r11
  mulss  %xmm2,%xmm0
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%rcx,%r14,1),%r11d
  mov    0x58(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm3,%xmm1
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  mov    0x38(%rsp),%r11d
  add    %ecx,%r11d
  movslq %r11d,%r11
  mulss  %xmm2,%xmm0
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  mov    0x3c(%rsp),%r11d
  add    %ecx,%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  lea    (%r14,%rcx,1),%r11d
  mov    0x8(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%r14,%rcx,1),%r11d
  mov    0x4(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm3,%xmm1
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  lea    (%r14,%rcx,1),%r11d
  mov    0x54(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%rdx,%r14,1),%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm3,%xmm1
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  lea    -0x1(%rax),%r11d
  add    $0x1,%eax
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  mov    0x40(%rsp),%r11d
  add    %edx,%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%r14,%rcx,1),%r11d
  mov    0x10(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm1
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  mov    0x40(%rsp),%r11d
  add    %ecx,%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%rcx,%r14,1),%r11d
  mov    0x4c(%rsp),%r14d
  addss  %xmm5,%xmm0
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  movslq %eax,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  lea    (%rcx,%r14,1),%r11d
  mov    0x44(%rsp),%r14d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  lea    (%rdx,%r14,1),%r11d
  movslq %r11d,%r11
  movsbl (%rbx,%r11,1),%r11d
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %r11d,%xmm1
  mov    0x34(%rsp),%r11d
  lea    -0x1(%r11),%r14d
  lea    (%rdx,%r14,1),%r11d
  add    %ecx,%r14d
  mulss  %xmm3,%xmm1
  movslq %r11d,%r11
  movslq %r14d,%r14
  movsbl (%rbx,%r11,1),%r11d
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %r11d,%xmm0
  mov    0x30(%rsp),%r11d
  sub    $0x1,%r11d
  add    %r11d,%edi
  add    %ecx,%r11d
  mulss  %xmm2,%xmm0
  movslq %edi,%rdi
  movslq %r11d,%r11
  movsbl (%rbx,%rdi,1),%edi
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %edi,%xmm1
  mov    0x44(%rsp),%edi
  add    %ecx,%edi
  movslq %edi,%rdi
  mulss  %xmm3,%xmm1
  movsbl (%rbx,%rdi,1),%edi
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %edi,%xmm0
  movsbl (%rbx,%r14,1),%edi
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %edi,%xmm1
  movsbl (%rbx,%r11,1),%edi
  mov    0x34(%rsp),%r11d
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %edi,%xmm0
  mov    0x14(%rsp),%edi
  add    %ecx,%edi
  movslq %edi,%rdi
  mulss  %xmm2,%xmm0
  movsbl (%rbx,%rdi,1),%edi
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %edi,%xmm1
  lea    (%rcx,%r11,1),%edi
  mov    0x30(%rsp),%r11d
  movslq %edi,%rdi
  movsbl (%rbx,%rdi,1),%edi
  mulss  %xmm3,%xmm1
  addss  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %edi,%xmm0
  lea    (%rcx,%r11,1),%edi
  movslq %edi,%rdi
  movsbl (%rbx,%rdi,1),%edi
  cvtsi2ss %edi,%xmm4
  mulss  %xmm2,%xmm0
  mulss  %xmm3,%xmm4
  addss  %xmm1,%xmm0
  addss  %xmm0,%xmm4
  ucomiss %xmm5,%xmm4
  jp     L160
  jne    L160
  movss  0x0(%rbp,%r10,4),%xmm0
  mov    0x18(%rsp),%rdi
  movss  %xmm0,(%rdi)
  mov    0x28(%rsp),%rdi
  movb   $0x0,(%rdi)
  jmp    L21
L160:
  mov    0x80(%rsp),%r14
  mov    0x90(%rsp),%r10
  mov    %rsi,0xa8(%rsp)
  lea    0xf0(%rsp),%rdi
  mov    %r13d,0xc4(%rsp)
  mov    0xe8(%rsp),%r13
  movaps %xmm5,%xmm0
  lea    (%r14,%rsi,1),%r11
  add    %rbx,%r10
  mov    0x88(%rsp),%r14
  mov    %r9b,0xd3(%rsp)
  add    %rdx,%r10
  mov    %rsi,0xc8(%rsp)
  mov    %r10,0xb8(%rsp)
  lea    (%r14,%rbx,1),%r10
  mov    0xb8(%rsp),%r9
  lea    (%r10,%rdx,1),%r14
  mov    0x70(%rsp),%r10
  mov    %rdx,0xd8(%rsp)
  mov    %r14,0xb0(%rsp)
  mov    0x78(%rsp),%r14
  add    %rsi,%r10
  mov    %ecx,0xd4(%rsp)
  add    %rbx,%r14
  add    %rdx,%r14
  mov    %rsi,%rdx
  mov    0xb0(%rsp),%rsi
  mov    %r14,%rcx
L99:
  movsbl -0x1(%r9),%r14d
  movss  (%rdi),%xmm1
  pxor   %xmm6,%xmm6
  add    $0x4,%rdi
  mulss  -0x4(%rdx),%xmm1
  cvtsi2ss %r14d,%xmm6
  movsbl -0x1(%rsi),%r14d
  mulss  %xmm6,%xmm1
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl -0x1(%rcx),%r14d
  addss  %xmm1,%xmm0
  movss  0x20(%rdi),%xmm1
  mulss  -0x4(%r11),%xmm1
  mulss  %xmm6,%xmm1
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl (%r9),%r14d
  addss  %xmm0,%xmm1
  movss  0x44(%rdi),%xmm0
  mulss  -0x4(%r10),%xmm0
  mulss  %xmm6,%xmm0
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl (%rsi),%r14d
  addss  %xmm1,%xmm0
  movss  0x8(%rdi),%xmm1
  mulss  (%rdx),%xmm1
  mulss  %xmm6,%xmm1
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl (%rcx),%r14d
  addss  %xmm0,%xmm1
  movss  0x2c(%rdi),%xmm0
  mulss  (%r11),%xmm0
  mulss  %xmm6,%xmm0
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl 0x1(%r9),%r14d
  add    %r8,%r9
  addss  %xmm1,%xmm0
  movss  0x50(%rdi),%xmm1
  mulss  (%r10),%xmm1
  mulss  %xmm6,%xmm1
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl 0x1(%rsi),%r14d
  add    %r8,%rsi
  addss  %xmm0,%xmm1
  movss  0x14(%rdi),%xmm0
  mulss  0x4(%rdx),%xmm0
  add    %r13,%rdx
  mulss  %xmm6,%xmm0
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  movsbl 0x1(%rcx),%r14d
  add    %r8,%rcx
  addss  %xmm1,%xmm0
  movss  0x38(%rdi),%xmm1
  mulss  0x4(%r11),%xmm1
  add    %r13,%r11
  mulss  %xmm6,%xmm1
  pxor   %xmm6,%xmm6
  cvtsi2ss %r14d,%xmm6
  addss  %xmm0,%xmm1
  movss  0x5c(%rdi),%xmm0
  mulss  0x4(%r10),%xmm0
  add    %r13,%r10
  mulss  %xmm6,%xmm0
  addss  %xmm1,%xmm0
  cmp    %rdi,0xa0(%rsp)
  jne    L99
  divss  %xmm4,%xmm0
  mov    0x18(%rsp),%rdi
  mov    0xc4(%rsp),%r13d
  movzbl 0xd3(%rsp),%r9d
  mov    0xc8(%rsp),%rsi
  mov    0xd4(%rsp),%ecx
  mov    0xd8(%rsp),%rdx
  movss  %xmm0,(%rdi)
  mov    0x28(%rsp),%rdi
  movb   $0x1,(%rdi)
  jmp    L21
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D32
data_type: byte[16]
name: extract_symbolic_data
arguments: label: D48
data_type: f32[4]
name: extract_symbolic_data
arguments: label: D38
data_type: f32[4]
name: extract_symbolic_data
arguments: label: D22
data_type: byte[16]
name: extract_symbolic_data
arguments: label: D24
data_type: byte[4]

tool: {"D32": [0x3a,0xcd,0x13,0x3f,0xf3,0x04,0x35,0x3f,0x3a,0xcd,0x13,0x3f,0xf3,0x04,0x35,0x3f]}

tool: {"D48": [1.0,0.7071067690849304,0.5773502588272095,0.7071067690849304]}

tool: {"D38": [1.0,0.0,1.0,0.7071067690849304]}

tool: {"D22": [0x3a,0xcd,0x13,0x3f,0xf3,0x04,0x35,0x3f,0x00,0x00,0x80,0x3f,0xf3,0x04,0x35,0x3f]}

tool: {"D24": [0xf3,0x04,0x35,0x3f]}

assistant: ```c
void extendsurface(int nx, int ny, int nz, float *E, char *c, float *Ex, char *cx) {
  int ix, iy, iz, i, j, k;
  float R[27], s, t;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      for (k = 0; k < 3; k++) {
        R[i + 3 * (j + 3 * k)] = (i != 1 ? (j != 1 ? (k != 1 ? 1.0 / sqrt(3.0) : 1.0 / sqrt(2.0)) : (k != 1 ? 1.0 / sqrt(2.0) : 1)) : (j != 1 ? (k != 1 ? 1.0 / sqrt(2.0) : 1) : (k != 1 ? 1 : 0)));
      }
  for (iz = 0; iz < nz; iz++) {
    for (ix = 0; ix < nx; ix++) {
      for (iy = 0; iy < ny; iy++) {
        if (iz == 0 || ix == 0 || iy == 0 || iz == nz - 1 || ix == nx - 1 || iy == ny - 1) {
          Ex[iy + ny * (ix + iz * nx)] = E[iy + ny * (ix + iz * nx)];
          cx[iy + ny * (ix + iz * nx)] = 0;
        } else {
          if (!c[iy + ny * (ix + iz * nx)]) {
            s = 0;
            for (i = -1; i < 2; i++) {
              for (j = -1; j < 2; j++) {
                for (k = -1; k < 2; k++) {
                  s += R[(i + 1) + 3 * ((j + 1) + 3 * (k + 1))] * c[iy + j + ny * (ix + i + nx * (iz + k))];
                }
              }
            }
            if (s) {
              t = 0;
              for (i = -1; i <= 1; i++) {
                for (j = -1; j <= 1; j++) {
                  for (k = -1; k <= 1; k++) {
                    t += (R[(i + 1) + 3 * ((j + 1) + 3 * (k + 1))] * E[iy + j + ny * (ix + i + nx * (iz + k))] * c[iy + j + ny * (ix + i + nx * (iz + k))]);
                  }
                }
              }
              Ex[iy + ny * (ix + iz * nx)] = t / s;
              cx[iy + ny * (ix + iz * nx)] = 1;
            } else {
              Ex[iy + ny * (ix + iz * nx)] = E[iy + ny * (ix + iz * nx)];
              cx[iy + ny * (ix + iz * nx)] = 0;
            }
          } else {
            Ex[iy + ny * (ix + iz * nx)] = E[iy + ny * (ix + iz * nx)];
            cx[iy + ny * (ix + iz * nx)] = 1;
          }
        }
      }
    }
  }
}
```