user: Converte this assembly snippet into its equivalent C code:

```asm
<build_level>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9d,-0x44(%rbp)
  mov    -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  shr    %rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  cltq
  mov    %rax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  shr    %rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_malloc@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  mov    -0x44(%rbp),%r9d
  mov    -0x18(%rbp),%r8
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x28(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   -0x8(%rbp)
  push   $0x1
  push   $0x0
  push   $0x2
  push   $0x0
  push   $0x1
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x44(%rbp),%r9d
  mov    -0x18(%rbp),%r8
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x28(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   -0x10(%rbp)
  push   $0x1
  push   $0x0
  push   $0x2
  push   $0x1
  push   $0x1
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%r8
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x8(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   0x10(%rbp)
  push   $0x2
  push   $0x0
  push   $0x1
  push   $0x0
  mov    -0x44(%rbp),%edi
  push   %rdi
  mov    $0x1,%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x1c(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  cltq
  shl    $0x2,%rax
  add    %rax,0x10(%rbp)
  mov    -0x18(%rbp),%r8
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x8(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   0x10(%rbp)
  push   $0x2
  push   $0x1
  push   $0x1
  push   $0x0
  mov    -0x44(%rbp),%edi
  push   %rdi
  mov    $0x1,%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x1c(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  cltq
  shl    $0x2,%rax
  add    %rax,0x10(%rbp)
  mov    -0x18(%rbp),%r8
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x10(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   0x10(%rbp)
  push   $0x2
  push   $0x0
  push   $0x1
  push   $0x0
  mov    -0x44(%rbp),%edi
  push   %rdi
  mov    $0x1,%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%esi
  mov    0x10(%rbp),%rdi
  mov    $0x0,%eax
  call   <internal_transpose@plt>
  mov    -0x1c(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  cltq
  shl    $0x2,%rax
  add    %rax,0x10(%rbp)
  mov    -0x18(%rbp),%r8
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%esi
  mov    -0x10(%rbp),%rax
  push   $0x0
  lea    D36(%rip),%rdi
  push   %rdi
  push   0x10(%rbp)
  push   $0x2
  push   $0x1
  push   $0x1
  push   $0x0
  mov    -0x44(%rbp),%edi
  push   %rdi
  mov    $0x1,%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <internal_filter@plt>
  add    $0x40,%rsp
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <check_free@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D36
data_type: string

tool: D36: reflect1

assistant: ```c
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;
  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", 0);
  internal_filter(image, level_x_size, level_y_size, hi_filter, filtertemp, filter_size, 1, 1, 2, 0, 1, hi_imagetemp, "reflect1", 0);
  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", 0);
  internal_filter(lo_imagetemp, level_x_size, level_y_size, hi_filter, filtertemp, 1, filter_size, 0, 1, 1, 2, (result_block += (total_size / 4)), "reflect1", 0);
  internal_filter(hi_imagetemp, level_x_size, level_y_size, lo_filter, filtertemp, 1, filter_size, 0, 1, 0, 2, (result_block += (total_size / 4)), "reflect1", 0);
  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, (result_block += (total_size / 4)), "reflect1", 0);
  check_free((char *)filtertemp);
  check_free((char *)hi_imagetemp);
  check_free((char *)lo_imagetemp);
}
```