user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<newton_min_func>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,%rbp
  mov    %edx,%ebx
  mov    %rcx,%r13
  movsd  %xmm0,0x38(%rsp)
  mov    %r8,%r15
  lea    0x0(,%rdx,8),%r14d
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x48(%rsp)
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x40(%rsp)
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    %ebx,%r14d
  imul   %ebx,%r14d
  shl    $0x3,%r14d
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    0x28(%rsp),%rax
  call   *%rax
  movq   %xmm0,%r14
  mov    %r12,%rcx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    0x28(%rsp),%rdi
  call   <jacobian_fd@plt>
  test   %ebx,%ebx
  jle    L58
  mov    %r13,%rax
  lea    -0x1(%rbx),%edx
  lea    0x8(%r13,%rdx,8),%rdx
  movsd  D0(%rip),%xmm1
L86:
  movapd %xmm1,%xmm0
  divsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L86
  movq   D18(%rip),%xmm4
  movq   %r14,%xmm0
  andpd  %xmm4,%xmm0
  movsd  0x38(%rsp),%xmm7
  andpd  %xmm7,%xmm4
  maxsd  %xmm4,%xmm0
  movapd %xmm0,%xmm4
  mov    %r12,%rdx
  mov    $0x0,%eax
  movq   D18(%rip),%xmm3
  movsd  D0(%rip),%xmm6
  mov    0x48(%rsp),%rcx
  sub    %r12,%rcx
  movapd %xmm3,%xmm5
L116:
  movsd  0x0(%rbp,%rax,8),%xmm2
  andpd  %xmm3,%xmm2
  movsd  0x0(%r13,%rax,8),%xmm0
  andpd  %xmm3,%xmm0
  movapd %xmm6,%xmm1
  divsd  %xmm0,%xmm1
  maxsd  %xmm1,%xmm2
  movsd  (%rdx),%xmm1
  andpd  %xmm5,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%rcx,%rdx,1)
  add    $0x1,%rax
  add    $0x8,%rdx
  cmp    %eax,%ebx
  jg     L116
  mov    %ebx,%esi
  mov    0x48(%rsp),%rdi
  call   <array_max_abs@plt>
  mov    $0x0,%eax
  movsd  D111(%rip),%xmm1
  comisd %xmm0,%xmm1
  jb     L78
L28:
  movsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L28
  mov    $0x1,%r14d
  jmp    L56
L58:
  mov    %ebx,%esi
  mov    0x48(%rsp),%rdi
  call   <array_max_abs@plt>
  mov    $0x1,%r14d
  movsd  D111(%rip),%xmm1
  comisd %xmm0,%xmm1
  jae    L56
  mov    0x40(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    0x20(%rsp),%rcx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    0x28(%rsp),%rdi
  call   <hessian_fd@plt>
  jmp    L24
L78:
  mov    0x40(%rsp),%r14
  mov    %r14,0x18(%rsp)
  mov    0x20(%rsp),%rcx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    0x28(%rsp),%rdi
  call   <hessian_fd@plt>
  test   %ebx,%ebx
  jle    L24
  mov    %ebx,%eax
  lea    (%r14,%rax,8),%rdx
  mov    %r14,%rax
  sub    %r14,%rbp
L5:
  movsd  0x0(%rbp,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L5
L24:
  lea    -0x1(%rbx),%eax
  mov    0x40(%rsp),%rsi
  lea    0x8(%rsi,%rax,8),%rbp
  mov    %r13,%r14
  mov    0x28(%rsp),%r13
L62:
  mov    0x10(%rsp),%rcx
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    0x20(%rsp),%rdi
  call   <modelhess@plt>
  mov    D66(%rip),%rax
  movq   %rax,%xmm0
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <scale@plt>
  mov    0x8(%rsp),%rcx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    0x10(%rsp),%rdi
  call   <linsolve_lower@plt>
  mov    D66(%rip),%rax
  movq   %rax,%xmm0
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <scale@plt>
  sub    $0x8,%rsp
  push   %r15
  mov    D47(%rip),%rax
  movq   %rax,%xmm1
  mov    %r14,%r9
  mov    D0(%rip),%rax
  movq   %rax,%xmm0
  mov    %ebx,%r8d
  mov    0x18(%rsp),%rcx
  mov    %r12,%rdx
  mov    0x28(%rsp),%rsi
  mov    %r13,%rdi
  call   <lnsrch@plt>
  mov    %eax,0x38(%rsp)
  mov    %ebx,%esi
  mov    %r15,%rdi
  call   *%r13
  movsd  %xmm0,0x40(%rsp)
  mov    %r12,%rcx
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <jacobian_fd@plt>
  mov    0x38(%rsp),%r9d
  mov    D47(%rip),%rax
  movq   %rax,%xmm3
  mov    D45(%rip),%rax
  movq   %rax,%xmm2
  movsd  0x48(%rsp),%xmm1
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %r15,%rdx
  mov    0x28(%rsp),%rsi
  mov    %ebx,%edi
  movsd  0x40(%rsp),%xmm0
  call   <stopcheck@plt>
  mov    %eax,0x38(%rsp)
  mov    0x30(%rsp),%rcx
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <hessian_fd@plt>
  add    $0x10,%rsp
  test   %ebx,%ebx
  jle    L6
  mov    0x40(%rsp),%rcx
  mov    %rcx,%rax
  mov    %r15,%rdx
  sub    %rcx,%rdx
L11:
  movsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rbp,%rax
  jne    L11
L6:
  cmpl   $0x0,0x28(%rsp)
  je     L62
  mov    0x28(%rsp),%r14d
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
L56:
  mov    %r14d,%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D0
data_type: f64
name: parse_data
arguments: data_label: D18
data_type: qword
name: parse_data
arguments: data_label: D111
data_type: byte[8]
name: parse_data
arguments: data_label: D66
data_type: byte[8]
name: parse_data
arguments: data_label: D47
data_type: byte[8]
name: parse_data
arguments: data_label: D45
data_type: byte[8]

tool: D0: 1

tool: D18: 9223372036854775807

tool: {"D111": [0x3e,0x8c,0x30,0xe2,0x8e,0x79,0x45,0x3e]}

tool: {"D66": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: {"D47": [0xc4,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

tool: {"D45": [0xf4,0x68,0xe3,0x88,0xb5,0xf8,0xe4,0x3e]}

assistant: ```c
int newton_min_func(double (*funcpt)(double *, int), double *xi, int N, double *dx, double fsval, double *xf) {
  int rcode, iter;
  int i, siter, retval;
  double gtol, stol;
  double fx, num, den, stop0, maxstep, fxf;
  double *jac, *hess, *scheck, *xc, *L, *step;
  jac = (double *)malloc(sizeof(double) * N);
  scheck = (double *)malloc(sizeof(double) * N);
  xc = (double *)malloc(sizeof(double) * N);
  step = (double *)malloc(sizeof(double) * N);
  hess = (double *)malloc(sizeof(double) * N * N);
  L = (double *)malloc(sizeof(double) * N * N);
  rcode = 0;
  iter = 0;
  siter = (int)100;
  gtol = pow((double)1e-15, 1.0 / 3.0);
  stol = gtol * gtol;
  fx = funcpt(xi, N);
  jacobian_fd(funcpt, xi, N, jac);
  maxstep = 1.0;
  for (i = 0; i < N; ++i) {
    dx[i] = 1.0 / dx[i];
  }
  if (fabs(fx) > fabs(fsval)) {
    den = fabs(fx);
  } else {
    den = fabs(fsval);
  }
  for (i = 0; i < N; ++i) {
    if (fabs(xi[i]) > 1.0 / fabs(dx[i])) {
      num = fabs(xi[i]);
    } else {
      num = 1.0 / fabs(dx[i]);
    }
    scheck[i] = fabs(jac[i]) * num / den;
  }
  stop0 = array_max_abs(scheck, N);
  if (stop0 <= gtol * 1e-03) {
    rcode = 1;
    for (i = 0; i < N; ++i) {
      xf[i] = xi[i];
    }
    return rcode;
  }
  hessian_fd(funcpt, xi, N, hess);
  for (i = 0; i < N; ++i) {
    xc[i] = xi[i];
  }
  while (rcode == 0 && iter < siter) {
    modelhess(hess, N, dx, L);
    scale(jac, 1, N, -1.0);
    linsolve_lower(L, N, jac, step);
    scale(jac, 1, N, -1.0);
    retval = lnsrch(funcpt, xc, jac, step, N, maxstep, dx, stol, xf);
    fxf = funcpt(xf, N);
    jacobian_fd(funcpt, xf, N, jac);
    rcode = stopcheck(fxf, N, xc, xf, jac, dx, fsval, gtol, stol, retval);
    hessian_fd(funcpt, xf, N, hess);
    for (i = 0; i < N; ++i) {
      xc[i] = xf[i];
    }
  }
  free(jac);
  free(hess);
  free(scheck);
  free(xc);
  free(L);
  free(step);
  return rcode;
}
```