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

```asm
<read_mosaic_grid_data>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x358,%rsp
  mov    %r9d,0x3c(%rsp)
  lea    0x240(%rsp),%rbx
  mov    %rbx,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x348(%rsp)
  xor    %eax,%eax
  call   <get_file_dir@plt>
  lea    0x140(%rsp),%r9
  mov    %r14,%rdi
  lea    0x3c(%rsp),%rcx
  mov    %r9,%rdx
  lea    D21(%rip),%rsi
  mov    %r9,(%rsp)
  lea    0x40(%rsp),%r14
  call   <get_string_data_level@plt>
  mov    (%rsp),%rcx
  mov    %rbx,%rdx
  mov    %r14,%rdi
  lea    D23(%rip),%rsi
  call   <sprintf@plt>
  lea    D35(%rip),%rsi
  mov    %r14,%rdi
  call   <get_dimlen@plt>
  lea    D47(%rip),%rsi
  mov    %r14,%rdi
  mov    %eax,%ebx
  call   <get_dimlen@plt>
  mov    %eax,%edx
  lea    0x0(%rbp,%rbp,1),%eax
  cmp    %ebx,%eax
  jne    L119
  lea    0x0(%r13,%r13,1),%eax
  cmp    %edx,%eax
  je     L9
L119:
  lea    D9(%rip),%rdi
  mov    %edx,(%rsp)
  call   <error_handler@plt>
  mov    (%rsp),%edx
L9:
  lea    0x1(%rbx),%r9d
  add    $0x1,%edx
  add    $0x1,%r13d
  add    $0x1,%ebp
  imul   %r9d,%edx
  mov    %r9d,0x10(%rsp)
  lea    0x0(,%rdx,8),%edi
  call   <malloc@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %rax,%rdx
  mov    %rax,%rbx
  call   <get_double_data@plt>
  sub    0x398(%rsp),%r13d
  sub    0x390(%rsp),%ebp
  mov    %r13d,(%rsp)
  test   %r13d,%r13d
  jle    L31
  test   %ebp,%ebp
  jle    L31
  mov    0x10(%rsp),%r9d
  movslq %ebp,%rdx
  lea    -0x1(%rbp),%edi
  mov    %r12,%rcx
  lea    0x0(,%rdx,8),%rax
  mov    %edi,0x1c(%rsp)
  shl    $0x4,%rdx
  xor    %r10d,%r10d
  lea    (%r9,%r9,1),%r14d
  mov    %rax,0x8(%rsp)
  xor    %r11d,%r11d
  movslq %r14d,%rax
  mov    %r14d,0x18(%rsp)
  imul   0x398(%rsp),%r9d
  shl    $0x3,%rax
  mov    0x390(%rsp),%r14d
  mov    %rax,0x10(%rsp)
  movslq 0x390(%rsp),%rax
  movslq %r9d,%rsi
  add    %rsi,%rax
  lea    (%rbx,%rax,8),%rsi
  mov    %edi,%eax
  and    $0xfffffffe,%edi
  shr    %eax
  lea    (%rdi,%rdi,1),%r8d
  mov    %edi,0x2c(%rsp)
  lea    0x1(%rdi),%r15d
  sub    $0x1,%eax
  lea    0x2(%r8),%edi
  mov    %r8d,0x28(%rsp)
  lea    -0x8(%rdx),%r8
  add    $0x1,%rax
  mov    %edi,0x38(%rsp)
  shl    $0x5,%rax
  mov    %rax,0x20(%rsp)
  mov    %ebp,%eax
  shl    $0x3,%rax
  mov    %rax,0x30(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L43:
  lea    (%r8,%rsi,1),%rax
  cmp    %rax,%rcx
  mov    0x8(%rsp),%rax
  setae  %dl
  lea    (%rcx,%rax,1),%r13
  cmp    %rsi,%r13
  setbe  %al
  or     %dl,%al
  je     L79
  mov    0x20(%rsp),%rax
  cmpl   $0x3,0x1c(%rsp)
  mov    %rcx,%rdx
  lea    (%rax,%rsi,1),%rdi
  mov    %rsi,%rax
  jbe    L79
  nopl   0x0(%rax,%rax,1)
L61:
  movupd (%rax),%xmm0
  add    $0x20,%rax
  add    $0x10,%rdx
  movhpd -0x10(%rax),%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rdi,%rax
  jne    L61
  mov    0x28(%rsp),%eax
  add    %r9d,%eax
  add    %r14d,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  mov    0x2c(%rsp),%eax
  add    %r10d,%eax
  cltq
  movsd  %xmm0,(%r12,%rax,8)
  cmp    %r15d,%ebp
  jle    L46
  mov    0x38(%rsp),%eax
  add    %r9d,%eax
  add    %r14d,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  lea    (%r10,%r15,1),%eax
  cltq
  movsd  %xmm0,(%r12,%rax,8)
L46:
  add    $0x1,%r11d
  mov    %r13,%rcx
  add    0x10(%rsp),%rsi
  add    %ebp,%r10d
  add    0x18(%rsp),%r9d
  cmp    %r11d,(%rsp)
  jne    L43
L31:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    0x348(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L97
  add    $0x358,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L79:
  mov    0x30(%rsp),%rax
  mov    %rsi,%rdx
  add    %rcx,%rax
  nopl   0x0(%rax,%rax,1)
L28:
  movsd  (%rdx),%xmm0
  add    $0x8,%rcx
  add    $0x10,%rdx
  movsd  %xmm0,-0x8(%rcx)
  cmp    %rax,%rcx
  jne    L28
  jmp    L46
L97:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D21
type_infered: string
name: extract_symbolic_data
arguments: data_label: D23
type_infered: string
name: extract_symbolic_data
arguments: data_label: D35
type_infered: string
name: extract_symbolic_data
arguments: data_label: D47
type_infered: string
name: extract_symbolic_data
arguments: data_label: D9
type_infered: string

tool: D21: gridfiles

tool: D23: %s/%s

tool: D35: nx

tool: D47: ny

tool: D9: supergrid size should be double of the model grid size

assistant: ```c
void read_mosaic_grid_data(const char *mosaic_file, const char *name, int nx, int ny, double *data, int level, int ioff, int joff) {
  char tilefile[255], gridfile[255], dir[255];
  double *tmp;
  int ni, nj, nxp, nyp, i, j;
  get_file_dir(mosaic_file, dir);
  get_string_data_level(mosaic_file, "gridfiles", gridfile, &level);
  sprintf(tilefile, "%s/%s", dir, gridfile);
  ni = get_dimlen(tilefile, "nx");
  nj = get_dimlen(tilefile, "ny");
  if (ni != nx * 2 || nj != ny * 2)
    error_handler("supergrid size should be double of the model grid size");
  tmp = (double *)malloc((ni + 1) * (nj + 1) * sizeof(double));
  get_double_data(tilefile, name, tmp);
  nxp = nx + 1 - ioff;
  nyp = ny + 1 - joff;
  for (j = 0; j < nyp; j++)
    for (i = 0; i < nxp; i++)
      data[j * nxp + i] = tmp[(2 * j + joff) * (ni + 1) + 2 * i + ioff];
  free(tmp);
}
```