user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```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     L124
  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    L87
  nopw   0x0(%rax,%rax,1)
L110:
  movsd  D1(%rip),%xmm5
  comisd %xmm3,%xmm5
  jbe    L133
  pxor   %xmm1,%xmm1
  mov    $0x1,%ecx
  comisd %xmm0,%xmm1
  mov    %cx,0x2c(%rsp)
  ja     L126
  movapd %xmm5,%xmm1
L68:
  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     L31
  je     L113
L31:
  subsd  0x8(%rsp),%xmm0
  cmpw   $0x0,0x2c(%rsp)
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rbp,1)
  je     L30
  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  D53(%rip),%xmm0
  movsd  %xmm0,(%r12,%rbp,1)
L30:
  movsd  %xmm2,(%r15,%rbp,1)
  add    $0x8,%rbp
  cmp    %rbp,0x10(%rsp)
  je     L124
L87:
  movsd  (%r15,%rbp,1),%xmm2
  movsd  D32(%rip),%xmm4
  movsd  0x0(%r13,%rbp,1),%xmm0
  movapd %xmm2,%xmm1
  andpd  D6(%rip),%xmm1
  maxsd  %xmm1,%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm1,%xmm3
  andpd  D6(%rip),%xmm3
  test   %r14w,%r14w
  jne    L110
  movsd  D32(%rip),%xmm6
  comisd %xmm3,%xmm6
  jbe    L158
  pxor   %xmm7,%xmm7
  movsd  D84(%rip),%xmm1
  cmpltsd %xmm7,%xmm0
  andpd  %xmm0,%xmm1
  andnpd %xmm6,%xmm0
  orpd   %xmm0,%xmm1
L158:
  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    L30
  nopl   (%rax)
L133:
  xor    %eax,%eax
  mov    %ax,0x2c(%rsp)
  jmp    L68
  nopl   0x0(%rax)
L113:
  mov    $0x3,%edx
  mov    %dx,0x2e(%rsp)
L84:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  xor    %eax,%eax
  mov    %r15,%rdi
  mulsd  D8(%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     L31
  jne    L31
  subw   $0x1,0x2e(%rsp)
  jne    L84
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L124:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L126:
  movsd  D21(%rip),%xmm1
  jmp    L68
```

tool_calls: name: retrieve_data
arguments: label: D1
type_guessed: byte[8]
name: retrieve_data
arguments: label: D53
type_guessed: f64
name: retrieve_data
arguments: label: D32
type_guessed: byte[8]
name: retrieve_data
arguments: label: D6
type_guessed: qword[2]
name: retrieve_data
arguments: label: D84
type_guessed: byte[8]
name: retrieve_data
arguments: label: D8
type_guessed: f64
name: retrieve_data
arguments: label: D21
type_guessed: byte[8]

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

tool: D53: 0.5

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

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

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

tool: D8: 10

tool: {"D21": [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;
  }
}
```