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

```asm
<my_lnsrch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%r13d
  mov    %rsi,%rbx
  movsd  %xmm0,0x20(%rsp)
  mov    %rdx,%r14
  mov    %rcx,%rbp
  mov    %r8,%r12
  mov    %r9,%r15
  movsd  %xmm1,0x40(%rsp)
  movsd  %xmm2,0x8(%rsp)
  mov    0x90(%rsp),%rax
  movl   $0x0,(%rax)
  test   %edi,%edi
  jle    L339
  lea    0x8(%rcx),%rax
  lea    -0x1(%rdi),%edx
  lea    0x10(%rcx,%rdx,8),%rdx
  pxor   %xmm1,%xmm1
L21:
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L21
  pxor   %xmm0,%xmm0
  ucomisd %xmm1,%xmm0
  ja     L37
L307:
  sqrtsd %xmm1,%xmm1
  comisd 0x8(%rsp),%xmm1
  ja     L260
L186:
  test   %r13d,%r13d
  jle    L100
L88:
  mov    $0x1,%eax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x10(%rsp)
L98:
  movsd  (%r14,%rax,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jge    L98
  mov    $0x1,%eax
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm3
  movq   D16(%rip),%xmm6
  movapd %xmm2,%xmm4
  movapd %xmm6,%xmm5
  jmp    L257
L339:
  pxor   %xmm1,%xmm1
  jmp    L307
L37:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  comisd 0x8(%rsp),%xmm0
  ja     L264
  jmp    L186
L260:
  test   %r13d,%r13d
  jle    L335
L264:
  movsd  0x8(%rsp),%xmm2
  divsd  %xmm1,%xmm2
  lea    0x8(%rbp),%rax
  lea    -0x1(%r13),%edx
  lea    0x10(%rbp,%rdx,8),%rdx
L289:
  movapd %xmm2,%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L289
  jmp    L88
L13:
  movsd  0x0(%rbp,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
  andpd  %xmm6,%xmm0
L42:
  maxsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  add    $0x1,%rax
  cmp    %eax,%r13d
  jl     L219
L257:
  movsd  (%rbx,%rax,8),%xmm1
  ucomisd %xmm3,%xmm1
  jp     L13
  ucomisd %xmm4,%xmm1
  jne    L13
  movsd  0x0(%rbp,%rax,8),%xmm0
  andpd  %xmm5,%xmm0
  jmp    L42
L335:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x10(%rsp)
  movapd %xmm5,%xmm2
L219:
  movsd  0x40(%rsp),%xmm5
  divsd  %xmm2,%xmm5
  movsd  %xmm5,0x40(%rsp)
  movsd  D39(%rip),%xmm3
  movsd  %xmm3,0x8(%rsp)
  movsd  0x10(%rsp),%xmm4
  xorpd  D70(%rip),%xmm4
  movsd  %xmm4,0x48(%rsp)
  jmp    L215
L100:
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x10(%rsp)
  movapd %xmm4,%xmm2
  jmp    L219
L286:
  lea    0x1(%r13),%edx
  mov    $0x1,%eax
  test   %r13d,%r13d
  jle    L169
L341:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L341
L169:
  mov    0x90(%rsp),%rax
  movl   $0x1,(%rax)
  jmp    L90
L259:
  mov    0x90(%rsp),%rax
  movl   $0x2,(%rax)
L90:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L161:
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm0
  movsd  0x10(%rsp),%xmm6
  mulsd  %xmm6,%xmm0
  movq   %r14,%xmm3
  subsd  0x20(%rsp),%xmm3
  subsd  %xmm0,%xmm3
  movsd  0x30(%rsp),%xmm0
  subsd  0x38(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm8
  movapd %xmm8,%xmm1
  mulsd  %xmm6,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm8,%xmm6
  mulsd  %xmm8,%xmm6
  movapd %xmm7,%xmm5
  subsd  %xmm8,%xmm5
  movapd %xmm7,%xmm4
  mulsd  %xmm7,%xmm4
  movapd %xmm3,%xmm2
  divsd  %xmm4,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm6,%xmm1
  subsd  %xmm1,%xmm2
  divsd  %xmm5,%xmm2
  movapd %xmm8,%xmm1
  xorpd  D70(%rip),%xmm1
  mulsd  %xmm3,%xmm1
  divsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm0
  divsd  %xmm6,%xmm0
  addsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  divsd  %xmm5,%xmm0
  movsd  %xmm0,0x28(%rsp)
  ucomisd D48(%rip),%xmm2
  jp     L67
  jne    L67
  addsd  %xmm0,%xmm0
  movsd  0x48(%rsp),%xmm3
  divsd  %xmm0,%xmm3
  movsd  %xmm3,0x18(%rsp)
L273:
  movsd  0x8(%rsp),%xmm0
  mulsd  D3(%rip),%xmm0
  minsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
L336:
  movsd  0x8(%rsp),%xmm3
  movapd %xmm3,%xmm0
  mulsd  D5(%rip),%xmm0
  movsd  0x20(%rsp),%xmm6
  movsd  %xmm6,0x38(%rsp)
  mov    %r14,0x30(%rsp)
  movsd  %xmm3,0x28(%rsp)
  movsd  0x18(%rsp),%xmm6
  maxsd  %xmm0,%xmm6
  movsd  %xmm6,0x8(%rsp)
L215:
  test   %r13d,%r13d
  jle    L195
  lea    0x1(%r13),%edx
  mov    $0x1,%eax
L347:
  movsd  0x8(%rsp),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L347
L195:
  lea    0x8(%r12),%r14
  lea    0x8(%rbx),%rsi
  mov    %r14,%rdi
  call   <validate_x@plt>
  mov    %r14,%rdi
  call   *0x98(%rsp)
  movsd  %xmm0,(%r15)
  call   <finite@plt>
  test   %rax,%rax
  je     L259
  movsd  0x40(%rsp),%xmm6
  comisd 0x8(%rsp),%xmm6
  ja     L286
  mov    (%r15),%r14
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm0
  mulsd  D4(%rip),%xmm0
  movsd  0x10(%rsp),%xmm5
  mulsd  %xmm5,%xmm0
  movsd  0x20(%rsp),%xmm4
  addsd  %xmm4,%xmm0
  movq   %r14,%xmm3
  comisd %xmm3,%xmm0
  jae    L90
  ucomisd D39(%rip),%xmm7
  jp     L161
  jne    L161
  movq   %r14,%xmm0
  subsd  %xmm4,%xmm0
  subsd  %xmm5,%xmm0
  addsd  %xmm0,%xmm0
  movsd  0x48(%rsp),%xmm4
  divsd  %xmm0,%xmm4
  movsd  %xmm4,0x18(%rsp)
  jmp    L336
L67:
  mulsd  D38(%rip),%xmm2
  movsd  %xmm2,0x30(%rsp)
  movapd %xmm2,%xmm1
  mulsd  0x10(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm5,%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L273
  ucomisd %xmm0,%xmm1
  ja     L358
  sqrtsd %xmm0,%xmm0
L314:
  subsd  0x28(%rsp),%xmm0
  divsd  0x30(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  jmp    L273
L358:
  call   <sqrt@plt>
  jmp    L314
```

tool_calls: name: disassemble_data
arguments: data_label: D16
datatype: qword
name: disassemble_data
arguments: data_label: D39
datatype: f64
name: disassemble_data
arguments: data_label: D70
datatype: f32[4]
name: disassemble_data
arguments: data_label: D48
datatype: f32[2]
name: disassemble_data
arguments: data_label: D3
datatype: f64
name: disassemble_data
arguments: data_label: D5
datatype: f64
name: disassemble_data
arguments: data_label: D4
datatype: byte[8]
name: disassemble_data
arguments: data_label: D38
datatype: f64

tool: D16: 9223372036854775807

tool: D39: 1

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

tool: {"D48": [0.0,0.0]}

tool: D3: 0.5

tool: D5: 0.1

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

tool: D38: 3

assistant: ```c
void my_lnsrch(int n, double xold[], double fold, double g[], double p[], double x[], double *f, double TOLX, double stpmax, int *check, double (*func)(double[])) {
  int i;
  double a, alam, alam2, alamin, b, disc, f2, fold2, rhs1, rhs2, slope, sum, temp, test, tmplam;
  int icount = 0;
  int bad_step;
  double bad_step_factor = 2.0;
  const int ltrace = 0;
  *check = 0;
  for (sum = 0.0, i = 1; i <= n; i++)
    sum += p[i] * p[i];
  sum = sqrt(sum);
  if (sum > stpmax)
    for (i = 1; i <= n; i++)
      p[i] *= stpmax / sum;
  for (slope = 0.0, i = 1; i <= n; i++)
    slope += g[i] * p[i];
  test = 0.0;
  for (i = 1; i <= n; i++) {
    temp = (xold[i] == 0.) ? fabs(p[i]) : fabs(p[i] / xold[i]);
    if (temp > test)
      test = temp;
  }
  alamin = TOLX / test;
  alam = 1.0;
  for (;;) {
    for (i = 1; i <= n; i++)
      x[i] = xold[i] + alam * p[i];
    validate_x((x + 1), (xold + 1));
    *f = (*func)(x + 1);
    bad_step = 0;
    if (finite(*f) == 0) {
      bad_step = 1;
    }
    if (bad_step) {
      *check = 2;
      return;
    }
    if (alam < alamin) {
      for (i = 1; i <= n; i++)
        x[i] = xold[i];
      *check = 1;
      return;
    } else if (*f <= fold + 1.0e-4 * alam * slope) {
      return;
    } else {
      if (alam == 1.0) {
        tmplam = -slope / (2.0 * (*f - fold - slope));
      } else {
        rhs1 = *f - fold - alam * slope;
        rhs2 = f2 - fold2 - alam2 * slope;
        a = (rhs1 / (alam * alam) - rhs2 / (alam2 * alam2)) / (alam - alam2);
        b = (-alam2 * rhs1 / (alam * alam) + alam * rhs2 / (alam2 * alam2)) / (alam - alam2);
        if (a == 0.0)
          tmplam = -slope / (2.0 * b);
        else {
          disc = b * b - 3.0 * a * slope;
          if (disc < 0.0) {
            disc = 0.;
          } else
            tmplam = (-b + sqrt(disc)) / (3.0 * a);
        }
        if (tmplam > 0.5 * alam)
          tmplam = 0.5 * alam;
      }
    }
    alam2 = alam;
    f2 = *f;
    fold2 = fold;
    alam = (((tmplam) > (0.1 * alam)) ? (tmplam) : (0.1 * alam));
    icount++;
  }
}
```