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

```asm
<lnsrch>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  mov    $0x8,%edi
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x58,%rsp
  mov    %rdx,0x18(%rsp)
  mov    0x90(%rsp),%r13
  mov    %r9,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <malloc@plt>
  mov    $0x20,%edi
  mov    %rax,%r15
  call   <malloc@plt>
  mov    $0x10,%edi
  mov    %rax,0x28(%rsp)
  call   <malloc@plt>
  mov    $0x10,%edi
  mov    %rax,0x30(%rsp)
  call   <malloc@plt>
  lea    0x0(,%rbx,8),%edi
  mov    %rax,0x20(%rsp)
  call   <malloc@plt>
  mov    0x18(%rsp),%rdi
  mov    %ebx,%r8d
  mov    %r15,%rdx
  mov    $0x1,%r9d
  mov    $0x1,%ecx
  mov    %r12,%rsi
  mov    %rax,0x10(%rsp)
  call   <mmult@plt>
  test   %ebx,%ebx
  mov    0x8(%rsp),%r10
  jle    L61
  mov    0x10(%rsp),%rcx
  lea    0x8(%r12),%rax
  lea    0x8(%rbp),%rdx
  cmp    %rax,%rcx
  setne  %al
  cmp    %rdx,%rcx
  setne  %dl
  and    %edx,%eax
  cmp    $0x1,%ebx
  setne  %dl
  test   %dl,%al
  je     L49
  lea    0x8(%r10),%rax
  cmp    %rax,%rcx
  je     L49
  mov    %ebx,%edx
  mov    %rbp,%rdi
  mov    %r10,%rsi
  mov    %rcx,%r11
  shr    %edx
  mov    %rcx,%rax
  sub    %rcx,%rdi
  sub    %rcx,%rsi
  shl    $0x4,%rdx
  movapd D37(%rip),%xmm2
  movapd D140(%rip),%xmm4
  add    %rcx,%rdx
  mov    %r12,%rcx
  sub    %r11,%rcx
  nopl   (%rax)
L212:
  movupd (%rsi,%rax,1),%xmm1
  movapd %xmm4,%xmm3
  movupd (%rdi,%rax,1),%xmm0
  andpd  %xmm2,%xmm1
  andpd  %xmm2,%xmm0
  divpd  %xmm1,%xmm3
  movupd (%rcx,%rax,1),%xmm1
  add    $0x10,%rax
  maxpd  %xmm3,%xmm0
  divpd  %xmm0,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L212
  movsd  D140(%rip),%xmm5
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  movsd  %xmm5,0x18(%rsp)
  test   $0x1,%bl
  je     L220
  movq   D41(%rip),%xmm1
  movsd  (%r10,%rax,8),%xmm2
  movsd  0x0(%rbp,%rax,8),%xmm0
  mov    0x10(%rsp),%rcx
  andpd  %xmm1,%xmm2
  divsd  %xmm2,%xmm5
  andpd  %xmm1,%xmm0
  maxsd  %xmm5,%xmm0
  movapd %xmm0,%xmm1
  movsd  (%r12,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
L220:
  mov    0x10(%rsp),%rdi
  mov    %ebx,%esi
  call   <array_max_abs@plt>
  movsd  (%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  divsd  %xmm0,%xmm4
  movsd  %xmm4,0x38(%rsp)
L24:
  movapd %xmm3,%xmm0
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  movsd  %xmm3,0x8(%rsp)
  call   <scale@plt>
  mov    %ebx,%r8d
  mov    $0x1,%ecx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <madd@plt>
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   *%r14
  mov    %ebx,%esi
  mov    %rbp,%rdi
  movsd  %xmm0,(%rsp)
  call   *%r14
  movsd  D73(%rip),%xmm7
  movsd  0x8(%rsp),%xmm3
  movsd  (%r15),%xmm2
  movapd %xmm0,%xmm1
  mulsd  %xmm3,%xmm7
  movapd %xmm7,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  comisd (%rsp),%xmm0
  jb     L43
  xor    %r12d,%r12d
L65:
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  add    $0x58,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L43:
  movsd  0x38(%rsp),%xmm4
  comisd %xmm3,%xmm4
  ja     L91
  ucomisd 0x18(%rsp),%xmm3
  jp     L137
  jne    L137
  movsd  (%rsp),%xmm4
  movapd %xmm2,%xmm0
  xorpd  D81(%rip),%xmm0
  subsd  %xmm1,%xmm4
  subsd  %xmm2,%xmm4
  divsd  %xmm4,%xmm0
L203:
  movapd %xmm0,%xmm1
  movsd  D59(%rip),%xmm2
  movsd  (%rsp),%xmm4
  movsd  %xmm3,0x40(%rsp)
  mulsd  %xmm3,%xmm2
  movsd  %xmm4,0x48(%rsp)
  cmpnlesd %xmm2,%xmm1
  andpd  %xmm1,%xmm0
  andnpd %xmm2,%xmm1
  movapd %xmm1,%xmm3
  orpd   %xmm0,%xmm3
  jmp    L24
L49:
  mov    0x10(%rsp),%rdi
  mov    %ebx,%eax
  mov    %rbp,%rcx
  mov    %r12,%rdx
  movsd  D140(%rip),%xmm4
  movq   D41(%rip),%xmm3
  lea    (%rdi,%rax,8),%rsi
  sub    %rdi,%rcx
  mov    %rdi,%rax
  sub    %rdi,%r10
  movsd  %xmm4,0x18(%rsp)
  sub    %rdi,%rdx
L48:
  movsd  (%r10,%rax,1),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  (%rcx,%rax,1),%xmm0
  andpd  %xmm3,%xmm2
  divsd  %xmm2,%xmm1
  andpd  %xmm3,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  movsd  (%rdx,%rax,1),%xmm0
  add    $0x8,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rsi
  jne    L48
  jmp    L220
  xchg   %ax,%ax
L137:
  movsd  0x40(%rsp),%xmm7
  movapd %xmm3,%xmm2
  movsd  0x18(%rsp),%xmm0
  movapd %xmm3,%xmm5
  mulsd  %xmm3,%xmm2
  mov    0x28(%rsp),%rdi
  mov    0x30(%rsp),%rsi
  mov    $0x1,%r9d
  movapd %xmm7,%xmm4
  subsd  %xmm7,%xmm5
  mov    0x20(%rsp),%rdx
  movsd  D149(%rip),%xmm6
  mulsd  %xmm7,%xmm4
  mov    $0x2,%r8d
  mov    $0x2,%ecx
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm5,0x40(%rsp)
  divsd  %xmm2,%xmm0
  divsd  %xmm4,%xmm6
  unpcklpd %xmm6,%xmm0
  movups %xmm0,(%rdi)
  movapd %xmm7,%xmm0
  xorpd  D81(%rip),%xmm0
  divsd  %xmm2,%xmm0
  movapd %xmm3,%xmm2
  divsd  %xmm4,%xmm2
  unpcklpd %xmm2,%xmm0
  movapd %xmm3,%xmm2
  movups %xmm0,0x10(%rdi)
  movsd  (%rsp),%xmm0
  mulsd  (%r15),%xmm2
  subsd  %xmm1,%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rsi)
  movsd  (%r15),%xmm5
  movsd  0x48(%rsp),%xmm0
  mulsd  %xmm7,%xmm5
  subsd  %xmm1,%xmm0
  subsd  %xmm5,%xmm0
  movsd  %xmm0,0x8(%rsi)
  call   <mmult@plt>
  movsd  0x40(%rsp),%xmm5
  mov    0x20(%rsp),%rdi
  mov    $0x2,%edx
  mov    $0x1,%esi
  movapd %xmm5,%xmm0
  call   <scale@plt>
  mov    0x20(%rsp),%rax
  pxor   %xmm4,%xmm4
  movsd  0x8(%rsp),%xmm3
  movsd  (%rax),%xmm1
  ucomisd %xmm4,%xmm1
  jp     L206
  jne    L206
  movsd  0x8(%rax),%xmm1
  movsd  (%r15),%xmm0
  xorpd  D81(%rip),%xmm0
  addsd  %xmm1,%xmm1
  divsd  %xmm1,%xmm0
L12:
  movsd  D133(%rip),%xmm1
  mulsd  %xmm3,%xmm1
  minsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  jmp    L203
  cs nopw 0x0(%rax,%rax,1)
L91:
  test   %ebx,%ebx
  jle    L69
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L194
  lea    0x8(%rbp),%rax
  cmp    %rax,%r13
  je     L194
  mov    %ebx,%edx
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
  nopw   0x0(%rax,%rax,1)
L200:
  movupd 0x0(%rbp,%rax,1),%xmm4
  movups %xmm4,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L200
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ebx
  je     L69
  movsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
L69:
  mov    $0x1,%r12d
  jmp    L65
L206:
  mulsd  D120(%rip),%xmm1
  mov    0x20(%rsp),%rax
  movsd  (%r15),%xmm4
  movsd  0x8(%rax),%xmm2
  movapd %xmm2,%xmm0
  mulsd  %xmm1,%xmm4
  mulsd  %xmm2,%xmm0
  subsd  %xmm4,%xmm0
  pxor   %xmm4,%xmm4
  ucomisd %xmm0,%xmm4
  ja     L80
  sqrtsd %xmm0,%xmm0
L261:
  subsd  %xmm2,%xmm0
  divsd  %xmm1,%xmm0
  jmp    L12
L61:
  movsd  D140(%rip),%xmm4
  movsd  %xmm4,0x18(%rsp)
  jmp    L220
L194:
  mov    %ebx,%ebx
  xor    %eax,%eax
L144:
  movsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L144
  jmp    L69
L80:
  movsd  %xmm3,0x48(%rsp)
  movsd  %xmm1,0x40(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x48(%rsp),%xmm3
  movsd  0x40(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  jmp    L261
```

tool_calls: name: disassemble_data
arguments: label: D37
type_infered: qword[2]
name: disassemble_data
arguments: label: D140
type_infered: f64[2]
name: disassemble_data
arguments: label: D41
type_infered: qword
name: disassemble_data
arguments: label: D73
type_infered: byte[8]
name: disassemble_data
arguments: label: D81
type_infered: f32[4]
name: disassemble_data
arguments: label: D59
type_infered: f64
name: disassemble_data
arguments: label: D149
type_infered: f32[2]
name: disassemble_data
arguments: label: D133
type_infered: f64
name: disassemble_data
arguments: label: D120
type_infered: f64

tool: {"D37": [0x7fffffffffffffff,0x7fffffffffffffff]}

tool: {"D140": [1.0,1.0]}

tool: D41: 9223372036854775807

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

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

tool: D59: 0.1

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

tool: D133: 0.5

tool: D120: 3

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;
}
```