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

```asm
<invmat2>:
  endbr64
  push   %r12
  pxor   %xmm0,%xmm0
  xor    %ecx,%ecx
  mov    %rsi,%r9
  push   %rbp
  mov    $0x2,%r11d
  mov    %ecx,%esi
  lea    0x1(%rcx),%ebp
  push   %rbx
  sub    $0xa0,%rsp
  movupd 0x20(%rdi),%xmm4
  movupd (%rdi),%xmm6
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x60(%rsp)
  mov    %rsp,%r10
  movq   D39(%rip),%xmm1
  movapd %xmm6,%xmm5
  movaps %xmm6,(%rsp)
  mov    %r10,%rdx
  mov    %r10,%r8
  movaps %xmm0,0x80(%rsp)
  movupd 0x10(%rdi),%xmm0
  movlpd 0x10(%rdi),%xmm5
  mov    D39(%rip),%rax
  movq   D21(%rip),%xmm3
  movaps %xmm5,0x10(%rsp)
  movsd  D23(%rip),%xmm5
  shufpd $0x1,%xmm4,%xmm0
  movaps %xmm0,0x20(%rsp)
  movupd 0x10(%rdi),%xmm0
  mov    %rax,0x90(%rsp)
  movapd %xmm3,%xmm6
  lea    0x50(%rsp),%rax
  unpcklpd %xmm4,%xmm0
  movaps %xmm1,0x50(%rsp)
  pxor   %xmm4,%xmm4
  movaps %xmm0,0x30(%rsp)
  movsd  0x28(%rdi),%xmm0
  mov    %r10,%rdi
  movaps %xmm1,0x70(%rsp)
  movsd  %xmm0,0x40(%rsp)
  movsd  (%rdi),%xmm0
  cmp    $0x2,%ecx
  je     L80
L23:
  movsd  0x18(%rdi),%xmm1
  movapd %xmm0,%xmm2
  andpd  %xmm3,%xmm2
  andpd  %xmm3,%xmm1
  ucomisd %xmm2,%xmm1
  cmova  %ebp,%esi
  cmp    $0x1,%ecx
  je     L60
  movsd  0x30(%rdi),%xmm1
  andpd  %xmm3,%xmm1
  ucomisd %xmm2,%xmm1
  cmova  %r11d,%esi
L60:
  cmp    %ecx,%esi
  je     L80
  movslq %esi,%rbx
  lea    (%rsi,%rsi,2),%esi
  movupd (%rdx),%xmm0
  lea    (%rbx,%rbx,2),%rbp
  movslq %esi,%r12
  lea    0x0(,%rbp,8),%rbx
  movsd  (%rsp,%rbx,1),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  0x50(%rsp,%r12,8),%xmm2
  movsd  (%rax),%xmm1
  movsd  %xmm2,(%rax)
  movsd  %xmm1,0x50(%rsp,%r12,8)
  movsd  0x8(%rsp,%rbx,1),%xmm1
  movsd  %xmm1,0x8(%rdx)
  movups %xmm0,(%r10,%rbp,8)
  lea    0x1(%rsi),%ebp
  movsd  0x8(%rax),%xmm0
  add    $0x2,%esi
  movslq %ebp,%rbp
  movslq %esi,%rsi
  movsd  0x50(%rsp,%rbp,8),%xmm1
  movsd  %xmm1,0x8(%rax)
  movsd  0x10(%rsp,%rbx,1),%xmm1
  movsd  %xmm0,0x50(%rsp,%rbp,8)
  movsd  0x10(%rdx),%xmm0
  movsd  %xmm1,0x10(%rdx)
  movsd  0x50(%rsp,%rsi,8),%xmm1
  movsd  %xmm0,0x10(%rsp,%rbx,1)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm1,0x10(%rax)
  movsd  %xmm0,0x50(%rsp,%rsi,8)
  movsd  (%rdi),%xmm0
L80:
  ucomisd %xmm4,%xmm0
  movapd %xmm0,%xmm1
  unpcklpd %xmm1,%xmm1
  jp     L61
  je     L76
L61:
  movapd %xmm0,%xmm2
  andpd  %xmm6,%xmm2
  comisd %xmm2,%xmm5
  ja     L76
  movupd (%rdx),%xmm7
  divpd  %xmm1,%xmm7
  movsd  (%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  movups %xmm7,(%rdx)
  movsd  0x8(%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rax)
  movsd  0x10(%rdx),%xmm2
  divsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rdx)
  movsd  0x10(%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rax)
  test   %rcx,%rcx
  je     L99
  movsd  (%r8),%xmm8
  movupd (%rax),%xmm10
  movapd 0x50(%rsp),%xmm9
  mulsd  %xmm8,%xmm2
  movapd %xmm8,%xmm0
  mulsd  %xmm8,%xmm1
  unpcklpd %xmm0,%xmm0
  mulpd  %xmm0,%xmm10
  mulpd  %xmm7,%xmm0
  movapd (%rsp),%xmm7
  subpd  %xmm10,%xmm9
  subpd  %xmm0,%xmm7
  movsd  0x10(%rsp),%xmm0
  subsd  %xmm2,%xmm0
  movaps %xmm9,0x50(%rsp)
  movaps %xmm7,(%rsp)
  movsd  %xmm0,0x10(%rsp)
  movsd  0x60(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x60(%rsp)
  cmp    $0x1,%ecx
  jne    L99
L28:
  movupd (%rdx),%xmm2
  movsd  (%rax),%xmm7
  add    $0x1,%rcx
  add    $0x20,%rdi
  movsd  0x30(%r8),%xmm0
  add    $0x18,%rdx
  add    $0x8,%r8
  mov    %ecx,%esi
  add    $0x18,%rax
  lea    0x1(%rcx),%ebp
  mulsd  %xmm0,%xmm7
  movapd %xmm0,%xmm1
  unpcklpd %xmm1,%xmm1
  mulpd  %xmm1,%xmm2
  movapd 0x30(%rsp),%xmm1
  subpd  %xmm2,%xmm1
  movsd  0x80(%rsp),%xmm2
  subsd  %xmm7,%xmm2
  movaps %xmm1,0x30(%rsp)
  movsd  0x88(%rsp),%xmm1
  movsd  %xmm2,0x80(%rsp)
  movsd  -0x10(%rax),%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x88(%rsp)
  movsd  -0x8(%rdx),%xmm2
  movsd  0x40(%rsp),%xmm1
  mulsd  %xmm0,%xmm2
  mulsd  -0x8(%rax),%xmm0
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x40(%rsp)
  movsd  0x90(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  (%rdi),%xmm0
  movsd  %xmm1,0x90(%rsp)
  cmp    $0x2,%ecx
  jne    L23
  jmp    L80
  nopl   0x0(%rax)
L99:
  movsd  0x18(%r8),%xmm0
  movupd (%rdx),%xmm2
  movsd  (%rax),%xmm7
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm7
  unpcklpd %xmm1,%xmm1
  mulpd  %xmm1,%xmm2
  movupd 0x18(%rsp),%xmm1
  subpd  %xmm2,%xmm1
  movsd  0x68(%rsp),%xmm2
  subsd  %xmm7,%xmm2
  movups %xmm1,0x18(%rsp)
  movsd  0x70(%rsp),%xmm1
  movsd  %xmm2,0x68(%rsp)
  movsd  0x8(%rax),%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x70(%rsp)
  movsd  0x10(%rdx),%xmm2
  movsd  0x28(%rsp),%xmm1
  mulsd  %xmm0,%xmm2
  mulsd  0x10(%rax),%xmm0
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x28(%rsp)
  movsd  0x78(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x78(%rsp)
  cmp    $0x2,%rcx
  jne    L28
  mov    0x60(%rsp),%rax
  movdqa 0x50(%rsp),%xmm6
  movdqa 0x70(%rsp),%xmm4
  mov    %rax,0x10(%r9)
  mov    0x90(%rsp),%rax
  movups %xmm6,(%r9)
  mov    %rax,0x28(%r9)
  mov    $0x1,%eax
  movups %xmm4,0x18(%r9)
L5:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L123
  add    $0xa0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L76:
  xor    %eax,%eax
  jmp    L5
L123:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D39
data_type: f64
name: disassemble_data
arguments: label: D21
data_type: qword
name: disassemble_data
arguments: label: D23
data_type: byte[8]

tool: D39: 1

tool: D21: 9223372036854775807

tool: {"D23": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

assistant: ```c
int invmat2(double m[6], double m11[6]) {
  double t, tmp[3][3], m1[9];
  int i, j, k, sw;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      m1[i * 3 + j] = i == j ? 1.0 : 0.0;
  for (k = 0, i = 0; i < 3; i++)
    for (j = i; j < 3; j++)
      tmp[i][j] = tmp[j][i] = m[k++];
  for (i = 0; i < 3; i++) {
    sw = i;
    for (j = i + 1; j < 3; j++)
      if (fabs(tmp[j][i]) > fabs(tmp[i][i]))
        sw = j;
    if (sw != i) {
      for (k = 0; k < 3; k++) {
        t = tmp[i][k];
        tmp[i][k] = tmp[sw][k];
        tmp[sw][k] = t;
        t = m1[i * 3 + k];
        m1[i * 3 + k] = m1[sw * 3 + k];
        m1[sw * 3 + k] = t;
      }
    }
    if (((((tmp[i][i]) == 0.0f) ? (fabs(0.0) < 1.e-06) : (((0.0) == 0.0f) ? (fabs(tmp[i][i]) < 1.e-06) : (fabs((tmp[i][i]) - (0.0)) / (fabs(tmp[i][i]) + fabs(0.0)) < 2.e-06)))))
      return (0);
    t = tmp[i][i];
    for (k = 0; k < 3; k++) {
      tmp[i][k] /= t;
      m1[i * 3 + k] /= t;
    }
    for (j = 0; j < 3; j++)
      if (j != i) {
        t = tmp[j][i];
        for (k = 0; k < 3; k++) {
          tmp[j][k] -= tmp[i][k] * t;
          m1[j * 3 + k] -= m1[i * 3 + k] * t;
        }
      }
  }
  for (k = 0, i = 0; i < 3; i++)
    for (j = i; j < 3; j++)
      m11[k++] = m1[i * 3 + j];
  return (1);
}
```