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

```asm
<read_voxel_file>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  lea    D26(%rip),%rsi
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x28,%rsp
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L66
L22:
  test   %r15d,%r15d
  jle    L94
  lea    -0x1(%r15),%eax
  mov    %r14,0x10(%rsp)
  lea    D28(%rip),%r15
  lea    0x4(%rbx,%rax,4),%rax
  mov    %r12,0x8(%rsp)
  mov    0x60(%rsp),%r12
  mov    %rax,0x18(%rsp)
  mov    %r13,(%rsp)
  lea    D33(%rip),%r13
  nopl   0x0(%rax)
L7:
  mov    0x10(%rsp),%rax
  lea    D8(%rip),%rsi
  mov    %rbp,%rdi
  lea    0x8(%rax),%rcx
  lea    0x10(%rax),%r8
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <fscanf@plt>
  cmp    $0x3,%eax
  je     L119
  mov    %r15,%rdi
  call   <HECMW_vis_print_exit@plt>
L119:
  mov    (%rsp),%rax
  lea    D8(%rip),%rsi
  mov    %rbp,%rdi
  lea    0x8(%rax),%rcx
  lea    0x10(%rax),%r8
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <fscanf@plt>
  cmp    $0x3,%eax
  je     L27
  mov    %r15,%rdi
  call   <HECMW_vis_print_exit@plt>
L27:
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  je     L18
  mov    %r15,%rdi
  call   <HECMW_vis_print_exit@plt>
L18:
  mov    (%rbx),%eax
  test   %eax,%eax
  jle    L95
  xor    %r14d,%r14d
  nopl   0x0(%rax)
L42:
  mov    (%r12),%rax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  lea    (%rax,%r14,4),%rdx
  xor    %eax,%eax
  call   <fscanf@plt>
  cmp    $0x1,%eax
  je     L14
  mov    %r15,%rdi
  add    $0x1,%r14
  call   <HECMW_vis_print_exit@plt>
  cmp    %r14d,(%rbx)
  jg     L42
L95:
  mov    0x8(%rsp),%rax
  addq   $0x18,0x10(%rsp)
  add    $0x4,%rbx
  add    $0x8,%r12
  addq   $0x18,(%rsp)
  movq   $0x0,(%rax)
  add    $0xc,%rax
  movl   $0x0,-0x4(%rax)
  mov    %rax,0x8(%rsp)
  cmp    0x18(%rsp),%rbx
  jne    L7
L94:
  mov    %rbp,%rdi
  call   <fclose@plt>
  add    $0x28,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L14:
  add    $0x1,%r14
  cmp    %r14d,(%rbx)
  jg     L42
  jmp    L95
L66:
  lea    D32(%rip),%rdi
  call   <HECMW_vis_print_exit@plt>
  jmp    L22
```

tool_calls: name: disassemble_data
arguments: data_tag: D26
type: string
name: disassemble_data
arguments: data_tag: D28
type: string
name: disassemble_data
arguments: data_tag: D33
type: string
name: disassemble_data
arguments: data_tag: D8
type: string
name: disassemble_data
arguments: data_tag: D32
type: string

tool: D26: r

tool: D28: ERROR: voxel file format error


tool: D33: %d

tool: D8: %lf %lf %lf

tool: D32: ERROR: HEC-MW-VIS-E0010: Cannot open voxel file

assistant: ```c
int read_voxel_file(char *filename, int n_voxel, double *voxel_dxyz, double *voxel_orig_xyz, int *level, int *voxel_n_neighbor_pe, int **voxel_neighbor_pe) {
  FILE *fp;
  int i, j;
  int ret;
  if ((fp = fopen(filename, "r")) == NULL)
    HECMW_vis_print_exit("ERROR: HEC-MW-VIS-E0010: Cannot open voxel file");
  for (j = 0; j < n_voxel; j++) {
    ret = fscanf(fp, "%lf %lf %lf", &voxel_orig_xyz[j * 3], &voxel_orig_xyz[j * 3 + 1], &voxel_orig_xyz[j * 3 + 2]);
    if (ret != 3)
      HECMW_vis_print_exit("ERROR: voxel file format error\n");
    ret = fscanf(fp, "%lf %lf %lf", &voxel_dxyz[j * 3], &voxel_dxyz[j * 3 + 1], &voxel_dxyz[j * 3 + 2]);
    if (ret != 3)
      HECMW_vis_print_exit("ERROR: voxel file format error\n");
    ret = fscanf(fp, "%d", &voxel_n_neighbor_pe[j]);
    if (ret != 1)
      HECMW_vis_print_exit("ERROR: voxel file format error\n");
    for (i = 0; i < voxel_n_neighbor_pe[j]; i++) {
      ret = fscanf(fp, "%d", &voxel_neighbor_pe[j][i]);
      if (ret != 1)
        HECMW_vis_print_exit("ERROR: voxel file format error\n");
    }
    level[j * 3 + 0] = 0;
    level[j * 3 + 1] = 0;
    level[j * 3 + 2] = 0;
  }
  fclose(fp);
  return 1;
}
```