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

```asm
<simq>:
  endbr64
  push   %r15
  lea    -0x1(%rcx),%eax
  mov    %rdi,%r10
  mov    %rdx,%r11
  push   %r14
  mov    %ecx,%edi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x18(%rsp)
  mov    %eax,0x14(%rsp)
  test   %r8d,%r8d
  js     L170
  test   %ecx,%ecx
  jle    L125
  mov    0x14(%rsp),%ebx
  movq   D39(%rip),%xmm3
  mov    %ecx,%ebp
  xor    %esi,%esi
  movsd  D41(%rip),%xmm4
  xor    %ecx,%ecx
  lea    0x8(%r10),%r8
  pxor   %xmm2,%xmm2
  nopl   0x0(%rax)
L238:
  movslq %esi,%rdx
  mov    %ecx,(%r9,%rcx,4)
  movapd %xmm2,%xmm1
  lea    (%r10,%rdx,8),%rax
  add    %rbx,%rdx
  lea    (%r8,%rdx,8),%rdx
  cs nopw 0x0(%rax,%rax,1)
L39:
  movsd  (%rax),%xmm0
  comisd %xmm0,%xmm2
  jbe    L6
  xorpd  %xmm3,%xmm0
L6:
  maxsd  %xmm1,%xmm0
  add    $0x8,%rax
  movapd %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L39
  add    %edi,%esi
  ucomisd %xmm2,%xmm0
  jp     L127
  je     L9
L127:
  movapd %xmm4,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r11,%rcx,8)
  add    $0x1,%rcx
  cmp    %rcx,%rbp
  jne    L238
L125:
  mov    0x14(%rsp),%eax
  pxor   %xmm2,%xmm2
  test   %eax,%eax
  jle    L3
  movq   D39(%rip),%xmm6
  lea    -0x2(%rdi),%eax
  xor    %ebx,%ebx
  xor    %r15d,%r15d
  mov    %eax,0x10(%rsp)
  mov    $0x1,%r13d
  pxor   %xmm4,%xmm4
  lea    0x10(%r10),%r14
  movapd %xmm6,%xmm3
  cmp    %ebx,%edi
  je     L227
  nopw   0x0(%rax,%rax,1)
L29:
  mov    %r15,%rdx
  movapd %xmm4,%xmm2
  movapd %xmm4,%xmm1
  xor    %esi,%esi
  nopl   (%rax)
L309:
  movslq (%r9,%rdx,4),%r8
  mov    %edi,%eax
  movslq %edx,%rcx
  imul   %r8d,%eax
  add    %ebx,%eax
  cltq
  movsd  (%r10,%rax,8),%xmm0
  comisd %xmm0,%xmm4
  jbe    L59
  xorpd  %xmm6,%xmm0
L59:
  mulsd  (%r11,%r8,8),%xmm0
  comisd %xmm1,%xmm0
  maxsd  %xmm1,%xmm0
  cmovbe %rsi,%rcx
  add    $0x1,%rdx
  movapd %xmm0,%xmm1
  movslq %ecx,%rsi
  cmp    %edx,%edi
  jg     L309
  ucomisd %xmm4,%xmm0
  jp     L73
  je     L227
L73:
  cmp    %ebx,%ecx
  je     L288
  lea    (%r9,%rcx,4),%rax
  mov    (%r9,%r15,4),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%r9,%r15,4)
  mov    %edx,(%rax)
L288:
  mov    (%r9,%r15,4),%r12d
  imul   %edi,%r12d
  lea    (%r12,%rbx,1),%eax
  cltq
  movsd  (%r10,%rax,8),%xmm5
  lea    0x1(%rbx),%eax
  mov    %eax,0xc(%rsp)
  cmp    %eax,%edi
  jle    L264
  mov    0x10(%rsp),%ebp
  mov    %r13,%r8
  movslq %r12d,%r12
  add    %r15,%rbp
  nopw   0x0(%rax,%rax,1)
L189:
  mov    (%r9,%r8,4),%esi
  imul   %edi,%esi
  lea    (%rsi,%rbx,1),%eax
  movslq %esi,%rsi
  cltq
  lea    0x0(%rbp,%rsi,1),%rdx
  lea    (%r10,%rax,8),%rax
  lea    (%r14,%rdx,8),%rcx
  mov    %r12,%rdx
  movsd  (%rax),%xmm1
  sub    %rsi,%rdx
  xorpd  %xmm3,%xmm1
  divsd  %xmm5,%xmm1
  movapd %xmm1,%xmm0
  xorpd  %xmm3,%xmm0
  movsd  %xmm0,(%rax)
  lea    0x0(%r13,%rsi,1),%rax
  lea    (%r10,%rax,8),%rax
  nopl   0x0(%rax,%rax,1)
L109:
  movsd  (%rax,%rdx,8),%xmm0
  add    $0x8,%rax
  mulsd  %xmm1,%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L109
  add    $0x1,%r8
  cmp    %r8d,%edi
  jg     L189
L264:
  subl   $0x1,0x10(%rsp)
  mov    0xc(%rsp),%ebx
  add    $0x1,%r15
  add    $0x1,%r13
  cmp    %ebx,0x14(%rsp)
  je     L3
  mov    0xc(%rsp),%ebx
  cmp    %ebx,%edi
  jne    L29
L227:
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x28,%rsp
  mov    $0x2,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
L99:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L170:
  movslq %ecx,%rbp
  mov    -0x4(%r9,%rbp,4),%eax
  imul   %ecx,%eax
  lea    -0x1(%rcx,%rax,1),%eax
  cltq
  lea    (%r10,%rax,8),%r12
L186:
  movslq (%r9),%rax
  mov    0x18(%rsp),%r13
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%r11)
  cmp    $0x1,%edi
  jle    L273
  lea    -0x2(%rdi),%ebx
  lea    0x4(%r9),%r8
  pxor   %xmm2,%xmm2
  xor    %edx,%edx
  shl    $0x3,%rbx
  nopl   0x0(%rax,%rax,1)
L147:
  movslq (%r8),%rsi
  mov    %edi,%eax
  movapd %xmm2,%xmm1
  imul   %esi,%eax
  cltq
  lea    (%r10,%rax,8),%rcx
  xor    %eax,%eax
  jmp    L136
  cs nopw 0x0(%rax,%rax,1)
L84:
  movsd  0x8(%r11,%rax,1),%xmm0
  add    $0x8,%rax
L136:
  mulsd  (%rcx,%rax,1),%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L84
  movsd  0x0(%r13,%rsi,8),%xmm0
  add    $0x4,%r8
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r11,%rdx,1)
  cmp    %rdx,%rbx
  je     L19
  movsd  (%r11),%xmm0
  add    $0x8,%rdx
  jmp    L147
L19:
  lea    -0x8(%r11,%rbp,8),%rax
  movsd  (%rax),%xmm0
  divsd  (%r12),%xmm0
  movsd  %xmm0,(%rax)
  movslq 0x14(%rsp),%rax
  mov    %rax,%rsi
  sub    $0x1,%rax
  lea    (%r9,%rax,4),%r9
  lea    (%r11,%rax,8),%r8
  cs nopw 0x0(%rax,%rax,1)
L157:
  mov    (%r9),%ecx
  movslq %esi,%rax
  sub    $0x1,%esi
  imul   %edi,%ecx
  cmp    %eax,%edi
  jle    L257
  movslq %ecx,%rdx
  movapd %xmm2,%xmm1
  lea    (%r10,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L211:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  (%r11,%rax,8),%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %eax,%edi
  jg     L211
L232:
  movsd  (%r8),%xmm0
  lea    (%rcx,%rsi,1),%eax
  sub    $0x4,%r9
  sub    $0x8,%r8
  cltq
  subsd  %xmm1,%xmm0
  divsd  (%r10,%rax,8),%xmm0
  movsd  %xmm0,0x8(%r8)
  test   %esi,%esi
  jne    L157
  xor    %eax,%eax
L248:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L257:
  movapd %xmm2,%xmm1
  jmp    L232
L3:
  movslq %edi,%rbp
  mov    -0x4(%r9,%rbp,4),%eax
  imul   %edi,%eax
  lea    -0x1(%rdi,%rax,1),%eax
  cltq
  lea    (%r10,%rax,8),%r12
  ucomisd (%r12),%xmm2
  jp     L186
  jne    L186
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x3,%eax
  jmp    L99
L273:
  lea    -0x8(%r11,%rbp,8),%rax
  movsd  (%rax),%xmm0
  divsd  (%r12),%xmm0
  movsd  %xmm0,(%rax)
  xor    %eax,%eax
  jmp    L248
```

tool_calls: name: disassemble_data
arguments: data_tag: D39
datatype: f32[2]
name: disassemble_data
arguments: data_tag: D41
datatype: f64
name: disassemble_data
arguments: data_tag: D55
datatype: string
name: disassemble_data
arguments: data_tag: D15
datatype: string
name: disassemble_data
arguments: data_tag: D58
datatype: string

tool: {"D39": [0.0,-0.0]}

tool: D41: 1

tool: D55: SIMQ BIG=0

tool: D15: SIMQ ROWNRM=0

tool: D58: SIMQ A[kpn]=0

assistant: ```c
int simq(A, B, X, n, flag, IPS)
double A[], B[], X[];
int n, flag;
int IPS[];
{
  int i, j, ij, ip, ipj, ipk, ipn;
  int idxpiv, iback;
  int k, kp, kp1, kpk, kpn;
  int nip, nkp, nm1;
  double em, q, rownrm, big, size, pivot, sum;
  nm1 = n - 1;
  if (flag < 0)
    goto solve;
  ij = 0;
  for (i = 0; i < n; i++) {
    IPS[i] = i;
    rownrm = 0.0;
    for (j = 0; j < n; j++) {
      q = ((A[ij]) < 0 ? -(A[ij]) : (A[ij]));
      if (rownrm < q)
        rownrm = q;
      ++ij;
    }
    if (rownrm == 0.0) {
      printf("SIMQ ROWNRM=0");
      return (1);
    }
    X[i] = 1.0 / rownrm;
  }
  for (k = 0; k < nm1; k++) {
    big = 0.0;
    idxpiv = 0;
    for (i = k; i < n; i++) {
      ip = IPS[i];
      ipk = n * ip + k;
      size = ((A[ipk]) < 0 ? -(A[ipk]) : (A[ipk])) * X[ip];
      if (size > big) {
        big = size;
        idxpiv = i;
      }
    }
    if (big == 0.0) {
      printf("SIMQ BIG=0");
      return (2);
    }
    if (idxpiv != k) {
      j = IPS[k];
      IPS[k] = IPS[idxpiv];
      IPS[idxpiv] = j;
    }
    kp = IPS[k];
    kpk = n * kp + k;
    pivot = A[kpk];
    kp1 = k + 1;
    for (i = kp1; i < n; i++) {
      ip = IPS[i];
      ipk = n * ip + k;
      em = -A[ipk] / pivot;
      A[ipk] = -em;
      nip = n * ip;
      nkp = n * kp;
      for (j = kp1; j < n; j++) {
        ipj = nip + j;
        A[ipj] = A[ipj] + em * A[nkp + j];
      }
    }
  }
  kpn = n * IPS[n - 1] + n - 1;
  if (A[kpn] == 0.0) {
    printf("SIMQ A[kpn]=0");
    return (3);
  }
solve:
  ip = IPS[0];
  X[0] = B[ip];
  for (i = 1; i < n; i++) {
    ip = IPS[i];
    ipj = n * ip;
    sum = 0.0;
    for (j = 0; j < i; j++) {
      sum += A[ipj] * X[j];
      ++ipj;
    }
    X[i] = B[ip] - sum;
  }
  ipn = n * IPS[n - 1] + n - 1;
  X[n - 1] = X[n - 1] / A[ipn];
  for (iback = 1; iback < n; iback++) {
    i = nm1 - iback;
    ip = IPS[i];
    nip = n * ip;
    sum = 0.0;
    for (j = i + 1; j < n; j++)
      sum += A[nip + j] * X[j];
    X[i] = (X[i] - sum) / A[nip + i];
  }
  return (0);
}
```