user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<calc_thermal_matrix_LU>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%rbx
  mov    %rdi,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D6(%rip),%rdi
  call   <printf@plt>
  lea    0x2c(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <set_up_tfield@plt>
  mov    0x34(%rsp),%edx
  mov    %edx,%esi
  imul   0x30(%rsp),%esi
  mov    %esi,0x10(%rsp)
  lea    (%rsi,%rsi,1),%ebp
  mov    %esi,%r14d
  imul   0x2c(%rsp),%r14d
  mov    %r14d,0x14(%rsp)
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <find_contained_nodes@plt>
  movslq %r14d,%rbx
  shl    $0x3,%rbx
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  test   %r14d,%r14d
  jle    L56
  lea    0x1(%rbp),%r15d
  mov    %r14d,%edx
  lea    0x0(,%rdx,8),%r13
  lea    0x0(%r13,%rax,1),%rdx
L43:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L43
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  movslq %r15d,%r14
  shl    $0x3,%r14
  mov    %rax,%r12
  add    %rax,%r13
  mov    %ebp,%ebp
  lea    0x8(,%rbp,8),%rbx
  mov    %rax,%rbp
L3:
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %rbp,%rcx
  mov    %rax,0x0(%rbp)
  test   %r15d,%r15d
  jle    L42
  mov    $0x0,%eax
L63:
  mov    (%rcx),%rdx
  movq   $0x0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rbx
  jne    L63
L42:
  add    $0x8,%rbp
  cmp    %r13,%rbp
  jne    L3
  mov    0x14(%rsp),%r14d
  mov    %r14d,%edx
  mov    (%rsp),%r15
  mov    %r15,%rsi
  mov    0x18(%rsp),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <set_up_flux@plt>
  mov    0x34(%rsp),%r9d
  mov    0x10(%rsp),%r8d
  mov    %r14d,%ecx
  mov    0x8(%rsp),%rbp
  mov    %rbp,%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <set_up_coef_matrix@plt>
  mov    0x10(%rsp),%r8d
  mov    %r14d,%ecx
  mov    %r15,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <LU_Decomp@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <find_comp_temp@plt>
L2:
  mov    (%r12),%rdi
  call   <free@plt>
  add    $0x8,%r12
  cmp    %r13,%r12
  jne    L2
L12:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L56:
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %rax,0x8(%rsp)
  mov    0x14(%rsp),%ebp
  mov    %ebp,%edx
  mov    (%rsp),%r15
  mov    %r15,%rsi
  mov    0x18(%rsp),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <set_up_flux@plt>
  mov    0x34(%rsp),%r9d
  mov    0x10(%rsp),%r13d
  mov    %r13d,%r8d
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <set_up_coef_matrix@plt>
  mov    %r13d,%r8d
  mov    %ebp,%ecx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <LU_Decomp@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <find_comp_temp@plt>
  jmp    L12
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D6
datatype: string

tool: D6: LU   

assistant: ```c
void calc_thermal_matrix_LU(design) struct Design *design;
{
  double *flux, **R;
  void set_up_tfield(), set_up_flux(), set_up_coef_matrix();
  void LU_Decomp(), find_comp_temp(), find_contained_nodes();
  int i, j, node_dim[3], tot_nodes, hbw, width;
  printf("LU   ");
  set_up_tfield(design, node_dim);
  hbw = node_dim[1] * node_dim[2];
  width = 2 * hbw + 1;
  tot_nodes = node_dim[0] * hbw;
  find_contained_nodes(design, hbw, node_dim[2]);
  flux = (double *)malloc(sizeof(double) * tot_nodes);
  for (i = 0; i < tot_nodes; i++)
    flux[i] = 0.0;
  R = (double **)malloc(sizeof(double *) * tot_nodes);
  for (i = 0; i < tot_nodes; i++) {
    R[i] = (double *)malloc(sizeof(double) * width);
    for (j = 0; j < width; ++j)
      R[i][j] = 0.0;
  }
  set_up_flux(design, flux, tot_nodes);
  set_up_coef_matrix(design, flux, R, tot_nodes, hbw, node_dim[2]);
  LU_Decomp(design, R, flux, tot_nodes, hbw);
  find_comp_temp(design);
  for (i = 0; i < tot_nodes; i++)
    free(R[i]);
  free(R);
  free(flux);
}
```