user: What is the c source code of the assembly code below?

```asm
<apprgrdn>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm0,0x8(%rsp)
  test   %di,%di
  je     L89
  movzwl %di,%ebp
  mov    %rsi,%r12
  mov    %rdx,%r15
  mov    %rcx,%rbx
  lea    0x0(,%rbp,8),%rax
  mov    %r8,%r13
  mov    %r9d,%r14d
  xor    %ebp,%ebp
  mov    %rax,0x10(%rsp)
  jmp    L116
  nopw   0x0(%rax,%rax,1)
L54:
  movsd  D16(%rip),%xmm5
  comisd %xmm3,%xmm5
  jbe    L81
  pxor   %xmm1,%xmm1
  mov    $0x1,%ecx
  comisd %xmm0,%xmm1
  mov    %cx,0x2c(%rsp)
  ja     L39
  movapd %xmm5,%xmm1
L119:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  xor    %eax,%eax
  mov    %r15,%rdi
  addsd  %xmm1,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,(%r15,%rbp,1)
  call   *%rbx
  movsd  0x8(%rsp),%xmm6
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
  ucomisd %xmm0,%xmm6
  jp     L12
  je     L95
L12:
  subsd  0x8(%rsp),%xmm0
  cmpw   $0x0,0x2c(%rsp)
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rbp,1)
  je     L21
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  mov    %r15,%rdi
  xor    %eax,%eax
  subsd  %xmm1,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,(%r15,%rbp,1)
  call   *%rbx
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
  movapd %xmm0,%xmm3
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  addsd  (%r12,%rbp,1),%xmm0
  mulsd  D31(%rip),%xmm0
  movsd  %xmm0,(%r12,%rbp,1)
L21:
  movsd  %xmm2,(%r15,%rbp,1)
  add    $0x8,%rbp
  cmp    %rbp,0x10(%rsp)
  je     L89
L116:
  movsd  (%r15,%rbp,1),%xmm2
  movsd  D62(%rip),%xmm4
  movsd  0x0(%r13,%rbp,1),%xmm0
  movapd %xmm2,%xmm1
  andpd  D12(%rip),%xmm1
  maxsd  %xmm1,%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm1,%xmm3
  andpd  D12(%rip),%xmm3
  test   %r14w,%r14w
  jne    L54
  movsd  D62(%rip),%xmm6
  comisd %xmm3,%xmm6
  jbe    L84
  pxor   %xmm7,%xmm7
  movsd  D47(%rip),%xmm1
  cmpltsd %xmm7,%xmm0
  andpd  %xmm0,%xmm1
  andnpd %xmm6,%xmm0
  orpd   %xmm0,%xmm1
L84:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  mov    %r15,%rdi
  xor    %eax,%eax
  addsd  %xmm1,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,(%r15,%rbp,1)
  call   *%rbx
  subsd  0x8(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rbp,1)
  jmp    L21
  nopl   (%rax)
L81:
  xor    %eax,%eax
  mov    %ax,0x2c(%rsp)
  jmp    L119
  nopl   0x0(%rax)
L95:
  mov    $0x3,%edx
  mov    %dx,0x2e(%rsp)
L104:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  xor    %eax,%eax
  mov    %r15,%rdi
  mulsd  D21(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,(%r15,%rbp,1)
  call   *%rbx
  movsd  0x8(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
  ucomisd %xmm0,%xmm7
  jp     L12
  jne    L12
  subw   $0x1,0x2e(%rsp)
  jne    L104
  jmp    L12
  nopw   0x0(%rax,%rax,1)
L89:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L39:
  movsd  D33(%rip),%xmm1
  jmp    L119
```

tool_calls: name: parse_data
arguments: data_tag: D16
type_infered: byte[8]
name: parse_data
arguments: data_tag: D31
type_infered: f64
name: parse_data
arguments: data_tag: D62
type_infered: byte[8]
name: parse_data
arguments: data_tag: D12
type_infered: qword[2]
name: parse_data
arguments: data_tag: D47
type_infered: byte[8]
name: parse_data
arguments: data_tag: D21
type_infered: f64
name: parse_data
arguments: data_tag: D33
type_infered: byte[8]

tool: {"D16": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xeb,0x3d]}

tool: D31: 0.5

tool: {"D62": [0x9b,0x2b,0xa1,0x86,0x9b,0x84,0xf6,0x3c]}

tool: {"D12": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D47": [0x9b,0x2b,0xa1,0x86,0x9b,0x84,0xf6,0xbc]}

tool: D21: 10

tool: {"D33": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xeb,0xbd]}

assistant: ```c
void apprgrdn(unsigned short n, double g[], double x[], double f, double fun(), double deltax[], unsigned short obj) {
  double const lowbndobj = 2.0e-10, lowbndcnt = 5.0e-15, ten = 10.0, half = 0.5;
  double d, y, fi;
  unsigned short i, j, center = 0;
  for (i = 0; i < n; i++) {
    y = x[i];
    d = ((lowbndcnt) > (fabs(y)) ? (lowbndcnt) : (fabs(y)));
    d *= deltax[i];
    if (obj) {
      if (fabs(d) < lowbndobj) {
        if (deltax[i] < 0.0)
          d = -lowbndobj;
        else
          d = lowbndobj;
        center = 1;
      } else
        center = 0;
    } else if (fabs(d) < lowbndcnt) {
      if (deltax[i] < 0.0)
        d = -lowbndcnt;
      else
        d = lowbndcnt;
    }
    x[i] = y + d;
    fi = fun(x);
    if (obj) {
      if (fi == f) {
        for (j = 1; j <= 3; j++) {
          d *= ten;
          x[i] = y + d;
          fi = fun(x);
          if (fi != f)
            break;
        }
      }
    }
    g[i] = (fi - f) / d;
    if (obj) {
      if (center) {
        x[i] = y - d;
        fi = fun(x);
        g[i] = half * (g[i] + (f - fi) / d);
      }
    }
    x[i] = y;
  }
}
```