user: 请将以下的汇编代码转换成C语言代码:

```asm
<lnsrch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %rdx,-0xb8(%rbp)
  mov    %rcx,-0xc0(%rbp)
  mov    %r8d,-0xc4(%rbp)
  movsd  %xmm0,-0xd0(%rbp)
  mov    %r9,-0xd8(%rbp)
  movsd  %xmm1,-0xe0(%rbp)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x68(%rbp)
  mov    $0x20,%edi
  call   <malloc@plt>
  mov    %rax,-0x60(%rbp)
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,-0x58(%rbp)
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,-0x50(%rbp)
  mov    -0xc4(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  movl   $0x64,-0x98(%rbp)
  movsd  D190(%rip),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  D52(%rip),%xmm0
  movsd  %xmm0,-0x90(%rbp)
  mov    -0xc4(%rbp),%ecx
  mov    -0x68(%rbp),%rdx
  mov    -0xc0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    $0x1,%r9d
  mov    %ecx,%r8d
  mov    $0x1,%ecx
  mov    %rax,%rdi
  call   <mmult@plt>
  movl   $0x0,-0x94(%rbp)
  jmp    L57
L205:
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D0(%rip),%xmm1
  andpd  %xmm1,%xmm0
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movq   D0(%rip),%xmm2
  andpd  %xmm1,%xmm2
  movsd  D52(%rip),%xmm1
  divsd  %xmm2,%xmm1
  comisd %xmm1,%xmm0
  jbe    L81
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D0(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  jmp    L33
L81:
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D0(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  D52(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
L33:
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xc0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x94(%rbp)
L57:
  mov    -0x94(%rbp),%eax
  cmp    -0xc4(%rbp),%eax
  jl     L205
  mov    -0xc4(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <array_max_abs@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  movsd  -0xe0(%rbp),%xmm0
  divsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L85
L15:
  mov    -0x90(%rbp),%rcx
  mov    -0xc4(%rbp),%edx
  mov    -0xc0(%rbp),%rax
  movq   %rcx,%xmm0
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <scale@plt>
  mov    -0xc4(%rbp),%edx
  mov    -0xc0(%rbp),%rsi
  mov    -0xb0(%rbp),%rax
  mov    %edx,%r8d
  mov    $0x1,%ecx
  mov    0x10(%rbp),%rdx
  mov    %rax,%rdi
  call   <madd@plt>
  mov    -0xc4(%rbp),%eax
  mov    -0xa8(%rbp),%rdx
  mov    %eax,%esi
  mov    0x10(%rbp),%rdi
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0xc4(%rbp),%edx
  mov    -0xb0(%rbp),%rax
  mov    -0xa8(%rbp),%rcx
  mov    %edx,%esi
  mov    %rax,%rdi
  call   *%rcx
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x90(%rbp),%xmm1
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  -0x20(%rbp),%xmm0
  comisd -0x28(%rbp),%xmm0
  jb     L41
  movl   $0x0,-0x98(%rbp)
  jmp    L85
L41:
  movsd  -0x30(%rbp),%xmm0
  comisd -0x90(%rbp),%xmm0
  jbe    L105
  movl   $0x1,-0x98(%rbp)
  movl   $0x0,-0x94(%rbp)
  jmp    L47
L185:
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rax,%rdx
  mov    -0x94(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    0x10(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x94(%rbp)
L47:
  mov    -0x94(%rbp),%eax
  cmp    -0xc4(%rbp),%eax
  jl     L185
  jmp    L85
L105:
  movsd  D52(%rip),%xmm0
  ucomisd -0x90(%rbp),%xmm0
  jp     L194
  movsd  D52(%rip),%xmm0
  ucomisd -0x90(%rbp),%xmm0
  jne    L194
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm0
  movq   D35(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  subsd  -0x20(%rbp),%xmm1
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  jmp    L155
L194:
  movsd  -0x90(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x88(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x90(%rbp),%xmm0
  subsd  -0x88(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  D52(%rip),%xmm0
  divsd  -0x18(%rbp),%xmm0
  mov    -0x60(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%rax
  add    $0x8,%rax
  movsd  D165(%rip),%xmm0
  divsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x88(%rbp),%xmm0
  movq   D35(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x60(%rbp),%rax
  add    $0x10,%rax
  divsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%rax
  add    $0x18,%rax
  movsd  -0x90(%rbp),%xmm0
  divsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x28(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm1
  mulsd  -0x90(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movsd  %xmm0,(%rax)
  movsd  -0x78(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm1
  mulsd  -0x88(%rbp),%xmm1
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rdx
  mov    -0x58(%rbp),%rsi
  mov    -0x60(%rbp),%rax
  mov    $0x1,%r9d
  mov    $0x2,%r8d
  mov    $0x2,%ecx
  mov    %rax,%rdi
  call   <mmult@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  movq   %rdx,%xmm0
  mov    $0x2,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <scale@plt>
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L126
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L126
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm0
  movq   D35(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  jmp    L108
L126:
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm2
  movsd  D34(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    -0x50(%rbp),%rdx
  add    $0x8,%rdx
  movsd  (%rdx),%xmm1
  movq   %rax,%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm2
  movsd  D34(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
L108:
  movsd  -0x90(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x80(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L155
  movsd  -0x90(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
L155:
  movsd  -0x90(%rbp),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x90(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  comisd -0x80(%rbp),%xmm0
  jb     L79
  movsd  -0x90(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  jmp    L85
L79:
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x90(%rbp)
L85:
  cmpl   $0x1,-0x98(%rbp)
  jg     L15
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x98(%rbp),%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D190
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D52
type_infered: f64
name: disassemble_data
arguments: data_label: D0
type_infered: qword
name: disassemble_data
arguments: data_label: D35
type_infered: f32[2]
name: disassemble_data
arguments: data_label: D165
type_infered: f32[2]
name: disassemble_data
arguments: data_label: D34
type_infered: f64
name: disassemble_data
arguments: data_label: D9
type_infered: f64
name: disassemble_data
arguments: data_label: D16
type_infered: f64

tool: {"D190": [0x2d,0x43,0x1c,0xeb,0xe2,0x36,0x1a,0x3f]}

tool: D52: 1

tool: D0: 9223372036854775807

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

tool: {"D165": [0.0,-1.875]}

tool: D34: 3

tool: D9: 0.5

tool: D16: 0.1

assistant: ```c
int lnsrch(double (*funcpt)(double *, int), double *xi, double *jac, double *p, int N, double maxstep, double *dx, double stol, double *x) {
  int retval, i, j;
  double alpha, lambda, lambdamin, funcf, funci, lambdaprev, lambdatemp, funcprev;
  double lambda2, lambdaprev2, ll, den, rell;
  double *slopei, *temp1, *temp2, *ab, *rcheck;
  slopei = (double *)malloc(sizeof(double) * 1);
  temp1 = (double *)malloc(sizeof(double) * 4);
  temp2 = (double *)malloc(sizeof(double) * 2);
  ab = (double *)malloc(sizeof(double) * 2);
  rcheck = (double *)malloc(sizeof(double) * N);
  retval = 100;
  alpha = 1e-04;
  lambda = 1.0;
  mmult(jac, p, slopei, 1, N, 1);
  for (i = 0; i < N; ++i) {
    if (fabs(xi[i]) > 1.0 / fabs(dx[i])) {
      den = fabs(xi[i]);
    } else {
      den = 1.0 / fabs(dx[i]);
    }
    rcheck[i] = p[i] / den;
  }
  rell = array_max_abs(rcheck, N);
  lambdamin = stol / rell;
  while (retval > 1) {
    scale(p, 1, N, lambda);
    madd(xi, p, x, 1, N);
    funcf = funcpt(x, N);
    funci = funcpt(xi, N);
    if (funcf <= funci + alpha * lambda * slopei[0]) {
      retval = 0;
    } else if (lambda < lambdamin) {
      retval = 1;
      for (i = 0; i < N; ++i) {
        x[i] = xi[i];
      }
    } else {
      if (lambda == 1.0) {
        lambdatemp = -slopei[0] / (funcf - funci - slopei[0]);
      } else {
        lambda2 = lambda * lambda;
        lambdaprev2 = lambdaprev * lambdaprev;
        ll = lambda - lambdaprev;
        temp1[0] = 1.0 / lambda2;
        temp1[1] = -1.0 / lambdaprev2;
        temp1[2] = -lambdaprev / lambda2;
        temp1[3] = lambda / lambdaprev2;
        temp2[0] = funcf - funci - lambda * slopei[0];
        temp2[1] = funcprev - funci - lambdaprev * slopei[0];
        mmult(temp1, temp2, ab, 2, 2, 1);
        scale(ab, 1, 2, ll);
        if (ab[0] == 0.0) {
          lambdatemp = -slopei[0] / (2.0 * ab[1]);
        } else {
          lambdatemp = (-ab[1] + sqrt(ab[1] * ab[1] - 3.0 * ab[0] * slopei[0])) / (3.0 * ab[0]);
        }
        if (lambdatemp > 0.5 * lambda) {
          lambdatemp = 0.5 * lambda;
        }
      }
      lambdaprev = lambda;
      funcprev = funcf;
      if (lambdatemp <= 0.1 * lambda) {
        lambda = 0.1 * lambda;
      } else {
        lambda = lambdatemp;
      }
    }
  }
  free(slopei);
  free(temp1);
  free(temp2);
  free(ab);
  free(rcheck);
  return retval;
}
```