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

```asm
<build_level>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %esi,%r13d
  mov    %edx,%ebx
  mov    %rcx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9d,%r12d
  mov    %esi,%r15d
  imul   %edx,%r15d
  movslq %r9d,%rdi
  shl    $0x2,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  movslq %eax,%rbp
  movslq %r15d,%r14
  shl    $0x2,%r14
  shr    %r14
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  cltq
  mov    %rax,0x10(%rsp)
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  movslq %eax,%rdx
  sub    $0x8,%rsp
  lea    D7(%rip),%r14
  push   %r14
  mov    %rdx,0x18(%rsp)
  push   %rdx
  push   $0x1
  push   $0x0
  push   $0x2
  push   $0x0
  push   $0x1
  mov    %r12d,%r9d
  mov    %rbp,%r8
  mov    0x58(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x68(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x38,%rsp
  push   %r14
  push   0x20(%rsp)
  push   $0x1
  push   $0x0
  push   $0x2
  push   $0x1
  push   $0x1
  mov    %r12d,%r9d
  mov    %rbp,%r8
  mov    0x60(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x68(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  mov    %r13d,%eax
  shr    $0x1f,%eax
  add    %eax,%r13d
  sar    %r13d
  add    $0x38,%rsp
  push   %r14
  push   0x80(%rsp)
  push   $0x2
  push   $0x0
  push   $0x1
  push   $0x0
  push   %r12
  mov    $0x1,%r9d
  mov    %rbp,%r8
  mov    0x58(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x48(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  lea    0x3(%r15),%eax
  add    $0x38,%rsp
  test   %r15d,%r15d
  cmovns %r15d,%eax
  sar    $0x2,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    %rsi,0x30(%rsp)
  mov    %rsi,%r15
  add    0x78(%rsp),%r15
  push   %r14
  push   %r15
  push   $0x2
  push   $0x1
  push   $0x1
  push   $0x0
  push   %r12
  mov    $0x1,%r9d
  mov    %rbp,%r8
  mov    0x60(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x48(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    0x68(%rsp),%r15
  add    $0x38,%rsp
  push   %r14
  push   %r15
  push   $0x2
  push   $0x0
  push   $0x1
  push   $0x0
  push   %r12
  mov    $0x1,%r9d
  mov    %rbp,%r8
  mov    0x58(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x50(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    %ebx,%esi
  shr    $0x1f,%esi
  add    %ebx,%esi
  sar    %esi
  mov    %r13d,%edx
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <internal_transpose@plt>
  sub    $0x8,%rsp
  push   %r14
  add    0x38(%rsp),%r15
  push   %r15
  push   $0x2
  push   $0x1
  push   $0x1
  push   $0x0
  push   %r12
  mov    $0x1,%r9d
  mov    %rbp,%r8
  mov    0x60(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r13d,%esi
  mov    0x50(%rsp),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  mov    0x8(%rsp),%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  mov    $0x1,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D7
type: string

tool: D7: reflect1

assistant: ```c
int build_level(image, level_x_size, level_y_size, lo_filter, hi_filter, filter_size, result_block)
int level_x_size, level_y_size, filter_size;
float *image, *result_block, *lo_filter, *hi_filter;
{
  float *hi_imagetemp, *lo_imagetemp, *filtertemp;
  int total_size = level_x_size * level_y_size, i;
  float *tresult_block = result_block;
  filtertemp = (float *)check_malloc(filter_size * sizeof(float));
  hi_imagetemp = (float *)check_malloc(total_size * sizeof(float) / 2);
  lo_imagetemp = (float *)check_malloc(total_size * sizeof(float) / 2);
  internal_filter(image, level_x_size, level_y_size, lo_filter, filtertemp, filter_size, 1, 0, 2, 0, 1, lo_imagetemp, "reflect1");
  internal_filter(image, level_x_size, level_y_size, hi_filter, filtertemp, filter_size, 1, 1, 2, 0, 1, hi_imagetemp, "reflect1");
  level_x_size /= 2;
  internal_filter(lo_imagetemp, level_x_size, level_y_size, lo_filter, filtertemp, 1, filter_size, 0, 1, 0, 2, result_block, "reflect1");
  internal_filter(lo_imagetemp, level_x_size, level_y_size, hi_filter, filtertemp, 1, filter_size, 0, 1, 1, 2, (tresult_block += (total_size / 4)), "reflect1");
  internal_filter(hi_imagetemp, level_x_size, level_y_size, lo_filter, filtertemp, 1, filter_size, 0, 1, 0, 2, (tresult_block += (total_size / 4)), "reflect1");
  internal_transpose(result_block, level_y_size / 2, level_x_size);
  internal_filter(hi_imagetemp, level_x_size, level_y_size, hi_filter, filtertemp, 1, filter_size, 0, 1, 1, 2, (tresult_block += (total_size / 4)), "reflect1");
  check_free((char *)filtertemp);
  check_free((char *)hi_imagetemp);
  check_free((char *)lo_imagetemp);
  return 1;
}
```