user: 请从给定的汇编指令推导出C源代码:

```asm
<babl_matrix_invert>:
  endbr64
  push   %rbx
  mov    %rdi,%r8
  mov    %rsi,%rbx
  mov    $0x48,%edx
  mov    %r8,%rsi
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <memcpy@plt>
  movsd  0x20(%rsp),%xmm7
  movsd  0x38(%rsp),%xmm8
  movsd  0x40(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm10
  movapd %xmm8,%xmm1
  movapd %xmm7,%xmm12
  movapd %xmm8,%xmm9
  movsd  0x18(%rsp),%xmm6
  mulsd  %xmm10,%xmm1
  movsd  0x30(%rsp),%xmm3
  movapd %xmm4,%xmm13
  movapd %xmm10,%xmm11
  mulsd  %xmm4,%xmm12
  movsd  (%rsp),%xmm0
  movsd  0x8(%rsp),%xmm5
  mulsd  %xmm6,%xmm13
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm6,%xmm9
  movapd %xmm0,%xmm14
  mulsd  %xmm3,%xmm11
  subsd  %xmm1,%xmm12
  movapd %xmm7,%xmm1
  mulsd  %xmm3,%xmm1
  mulsd  %xmm12,%xmm14
  subsd  %xmm1,%xmm9
  movapd %xmm13,%xmm1
  subsd  %xmm11,%xmm1
  subsd  %xmm13,%xmm11
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm14
  movapd %xmm2,%xmm1
  mulsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm14
  movsd  D4(%rip),%xmm1
  divsd  %xmm14,%xmm1
  movapd %xmm4,%xmm14
  mulsd  %xmm5,%xmm14
  mulsd  %xmm0,%xmm4
  mulsd  %xmm1,%xmm12
  mulsd  %xmm1,%xmm11
  mulsd  %xmm1,%xmm9
  movsd  %xmm12,(%rbx)
  movapd %xmm8,%xmm12
  mulsd  %xmm2,%xmm12
  movsd  %xmm11,0x18(%rbx)
  movapd %xmm3,%xmm11
  mulsd  %xmm2,%xmm11
  movsd  %xmm9,0x30(%rbx)
  mulsd  %xmm5,%xmm3
  mulsd  %xmm0,%xmm8
  subsd  %xmm14,%xmm12
  movapd %xmm7,%xmm14
  mulsd  %xmm2,%xmm14
  subsd  %xmm11,%xmm4
  mulsd  %xmm6,%xmm2
  mulsd  %xmm1,%xmm12
  subsd  %xmm8,%xmm3
  mulsd  %xmm1,%xmm4
  mulsd  %xmm1,%xmm3
  movsd  %xmm12,0x8(%rbx)
  movapd %xmm10,%xmm12
  mulsd  %xmm5,%xmm12
  movsd  %xmm4,0x20(%rbx)
  mulsd  %xmm0,%xmm10
  mulsd  %xmm6,%xmm5
  movsd  %xmm3,0x38(%rbx)
  mulsd  %xmm7,%xmm0
  subsd  %xmm14,%xmm12
  subsd  %xmm10,%xmm2
  subsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm12
  mulsd  %xmm1,%xmm2
  mulsd  %xmm1,%xmm0
  movsd  %xmm12,0x10(%rbx)
  movsd  %xmm2,0x28(%rbx)
  movsd  %xmm0,0x40(%rbx)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x50,%rsp
  pop    %rbx
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D4
datatype: f64

tool: D4: 1

assistant: ```c
void babl_matrix_invert(const double *in, double *out) {
  double mat[9];
  double det, invdet;
  memcpy(mat, in, sizeof(mat));
  det = mat[0 * 3 + 0] * (mat[1 * 3 + 1] * mat[2 * 3 + 2] - mat[2 * 3 + 1] * mat[1 * 3 + 2]) - mat[0 * 3 + 1] * (mat[1 * 3 + 0] * mat[2 * 3 + 2] - mat[1 * 3 + 2] * mat[2 * 3 + 0]) + mat[0 * 3 + 2] * (mat[1 * 3 + 0] * mat[2 * 3 + 1] - mat[1 * 3 + 1] * mat[2 * 3 + 0]);
  invdet = 1.0 / det;
  out[0 * 3 + 0] = (mat[1 * 3 + 1] * mat[2 * 3 + 2] - mat[2 * 3 + 1] * mat[1 * 3 + 2]) * invdet;
  out[0 * 3 + 1] = (mat[0 * 3 + 2] * mat[2 * 3 + 1] - mat[0 * 3 + 1] * mat[2 * 3 + 2]) * invdet;
  out[0 * 3 + 2] = (mat[0 * 3 + 1] * mat[1 * 3 + 2] - mat[0 * 3 + 2] * mat[1 * 3 + 1]) * invdet;
  out[1 * 3 + 0] = (mat[1 * 3 + 2] * mat[2 * 3 + 0] - mat[1 * 3 + 0] * mat[2 * 3 + 2]) * invdet;
  out[1 * 3 + 1] = (mat[0 * 3 + 0] * mat[2 * 3 + 2] - mat[0 * 3 + 2] * mat[2 * 3 + 0]) * invdet;
  out[1 * 3 + 2] = (mat[1 * 3 + 0] * mat[0 * 3 + 2] - mat[0 * 3 + 0] * mat[1 * 3 + 2]) * invdet;
  out[2 * 3 + 0] = (mat[1 * 3 + 0] * mat[2 * 3 + 1] - mat[2 * 3 + 0] * mat[1 * 3 + 1]) * invdet;
  out[2 * 3 + 1] = (mat[2 * 3 + 0] * mat[0 * 3 + 1] - mat[0 * 3 + 0] * mat[2 * 3 + 1]) * invdet;
  out[2 * 3 + 2] = (mat[0 * 3 + 0] * mat[1 * 3 + 1] - mat[1 * 3 + 0] * mat[0 * 3 + 1]) * invdet;
}
```