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

```asm
<simq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %ecx,-0x9c(%rbp)
  mov    %r8d,-0xa0(%rbp)
  mov    %r9,-0xa8(%rbp)
  mov    -0x9c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x60(%rbp)
  cmpl   $0x0,-0xa0(%rbp)
  js     L318
  movl   $0x0,-0x74(%rbp)
  movl   $0x0,-0x7c(%rbp)
  jmp    L345
L271:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x7c(%rbp),%eax
  mov    %eax,(%rdx)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x78(%rbp)
  jmp    L34
L214:
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L198
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D31(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L321
L198:
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L321:
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  comisd -0x38(%rbp),%xmm0
  jbe    L362
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L362:
  addl   $0x1,-0x74(%rbp)
  addl   $0x1,-0x78(%rbp)
L34:
  mov    -0x78(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L214
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jp     L269
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jne    L269
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L319
L269:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  D27(%rip),%xmm0
  divsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x7c(%rbp)
L345:
  mov    -0x7c(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L271
  movl   $0x0,-0x64(%rbp)
  jmp    L230
L289:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x6c(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x7c(%rbp)
  jmp    L251
L86:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L25
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D31(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L37
L25:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L37:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L136
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x7c(%rbp),%eax
  mov    %eax,-0x6c(%rbp)
L136:
  addl   $0x1,-0x7c(%rbp)
L251:
  mov    -0x7c(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L86
  pxor   %xmm0,%xmm0
  ucomisd -0x30(%rbp),%xmm0
  jp     L346
  pxor   %xmm0,%xmm0
  ucomisd -0x30(%rbp),%xmm0
  jne    L346
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x2,%eax
  jmp    L319
L346:
  mov    -0x6c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  je     L304
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x78(%rbp)
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x64(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0xa8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x78(%rbp),%eax
  mov    %eax,(%rdx)
L304:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x58(%rbp),%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x64(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x7c(%rbp)
  jmp    L125
L307:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D31(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  movq   D31(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x9c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x58(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x78(%rbp)
  jmp    L155
L145:
  mov    -0x44(%rbp),%edx
  mov    -0x78(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x70(%rbp)
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x40(%rbp),%edx
  mov    -0x78(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x78(%rbp)
L155:
  mov    -0x78(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L145
  addl   $0x1,-0x7c(%rbp)
L125:
  mov    -0x7c(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L307
  addl   $0x1,-0x64(%rbp)
L230:
  mov    -0x64(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L289
  mov    -0x9c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x9c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x9c(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L90
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L90
  lea    D68(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x3,%eax
  jmp    L319
L318:
  nop
L90:
  mov    -0xa8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x7c(%rbp)
  jmp    L55
L51:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,-0x70(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x78(%rbp)
  jmp    L273
L253:
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x70(%rbp)
  addl   $0x1,-0x78(%rbp)
L273:
  mov    -0x78(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L253
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x7c(%rbp)
L55:
  mov    -0x7c(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L51
  mov    -0x9c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x9c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x9c(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x9c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x9c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x68(%rbp)
  jmp    L239
L76:
  mov    -0x60(%rbp),%eax
  sub    -0x68(%rbp),%eax
  mov    %eax,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x7c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x78(%rbp)
  jmp    L110
L291:
  mov    -0x44(%rbp),%edx
  mov    -0x78(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x78(%rbp)
L110:
  mov    -0x78(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L291
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mov    -0x44(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x68(%rbp)
L239:
  mov    -0x68(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L76
  mov    $0x0,%eax
L319:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D31
type: f32[2]
name: retrieve_data
arguments: tag: D59
type: string
name: retrieve_data
arguments: tag: D27
type: f64
name: retrieve_data
arguments: tag: D2
type: string
name: retrieve_data
arguments: tag: D68
type: string

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

tool: D59: SIMQ ROWNRM=0

tool: D27: 1

tool: D2: SIMQ BIG=0

tool: D68: 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);
}
```