user: Translate the below assembly code into C programming language:

```asm
<amoeba>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rbx
  movsd  %xmm0,0x28(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rcx)
  movsd  (%rdi),%xmm0
  addsd  0x10(%rdi),%xmm0
  addsd  0x20(%rdi),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  0x8(%rdi),%xmm0
  addsd  0x18(%rdi),%xmm0
  addsd  0x28(%rdi),%xmm0
  movsd  %xmm0,0x38(%rsp)
  jmp    L47
L63:
  mov    %r12d,%r13d
  mov    %eax,%r12d
L153:
  add    $0x1,%rax
  cmp    $0x3,%rax
  je     L152
L111:
  movsd  (%rbx,%rax,8),%xmm0
  movslq %ebp,%rdx
  movsd  (%rbx,%rdx,8),%xmm1
  ucomisd %xmm0,%xmm1
  cmovae %eax,%ebp
  movslq %r12d,%rdx
  comisd (%rbx,%rdx,8),%xmm0
  ja     L63
  movslq %r13d,%rdx
  comisd (%rbx,%rdx,8),%xmm0
  jbe    L153
  cmp    %eax,%r12d
  cmovne %eax,%r13d
  jmp    L153
L152:
  movslq %r12d,%rax
  lea    (%rbx,%rax,8),%r15
  movsd  (%r15),%xmm1
  movslq %ebp,%rax
  mov    %rax,0x20(%rsp)
  lea    (%rbx,%rax,8),%r14
  movsd  (%r14),%xmm3
  movapd %xmm1,%xmm0
  subsd  %xmm3,%xmm0
  andpd  D6(%rip),%xmm0
  addsd  %xmm0,%xmm0
  andpd  D6(%rip),%xmm1
  movapd %xmm3,%xmm4
  andpd  D6(%rip),%xmm4
  addsd  %xmm4,%xmm1
  addsd  D3(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  0x28(%rsp),%xmm5
  comisd %xmm0,%xmm5
  ja     L134
  mov    0x18(%rsp),%rsi
  mov    (%rsi),%eax
  cmp    $0x1387,%eax
  jg     L16
  add    $0x2,%eax
  mov    %eax,(%rsi)
  lea    0x30(%rsp),%rdx
  movsd  D17(%rip),%xmm0
  mov    %r12d,%r8d
  mov    0x10(%rsp),%rcx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%rdi
  call   <amotry@plt>
  movsd  (%r14),%xmm1
  comisd %xmm0,%xmm1
  jae    L68
  movslq %r13d,%r13
  comisd (%rbx,%r13,8),%xmm0
  jae    L17
  mov    0x18(%rsp),%rax
  subl   $0x1,(%rax)
L47:
  movsd  (%rbx),%xmm2
  comisd 0x8(%rbx),%xmm2
  seta   %r13b
  movzbl %r13b,%r13d
  setbe  %r12b
  movzbl %r12b,%r12d
  mov    $0x0,%eax
  mov    $0x0,%ebp
  jmp    L111
L134:
  movsd  %xmm3,(%rbx)
  movsd  %xmm2,(%r14)
  mov    0x8(%rsp),%rdi
  movsd  (%rdi),%xmm0
  shl    $0x4,%rax
  add    %rdi,%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdi)
  movsd  %xmm0,(%rax)
  movsd  0x8(%rdi),%xmm0
  movsd  0x8(%rax),%xmm1
  movsd  %xmm1,0x8(%rdi)
  movsd  %xmm0,0x8(%rax)
L16:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L73
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L68:
  lea    0x30(%rsp),%rdx
  movsd  D38(%rip),%xmm0
  mov    %r12d,%r8d
  mov    0x10(%rsp),%rcx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%rdi
  call   <amotry@plt>
  jmp    L47
L17:
  mov    (%r15),%r13
  lea    0x30(%rsp),%rdx
  movsd  D76(%rip),%xmm0
  mov    %r12d,%r8d
  mov    0x10(%rsp),%rcx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%rdi
  call   <amotry@plt>
  movq   %r13,%xmm6
  comisd %xmm6,%xmm0
  jb     L47
  mov    0x20(%rsp),%r14
  shl    $0x4,%r14
  mov    0x8(%rsp),%r12
  add    %r12,%r14
  mov    $0x0,%r13d
  mov    0x10(%rsp),%r15
L3:
  cmp    %r13d,%ebp
  je     L39
  movsd  (%r12),%xmm0
  addsd  (%r14),%xmm0
  mulsd  D76(%rip),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  %xmm0,(%r12)
  movsd  0x8(%r12),%xmm0
  addsd  0x8(%r14),%xmm0
  mulsd  D76(%rip),%xmm0
  movsd  %xmm0,0x38(%rsp)
  movsd  %xmm0,0x8(%r12)
  lea    0x30(%rsp),%rdi
  call   *%r15
  movsd  %xmm0,(%rbx,%r13,8)
L39:
  add    $0x1,%r13
  add    $0x10,%r12
  cmp    $0x3,%r13
  jne    L3
  mov    0x18(%rsp),%rax
  addl   $0x2,(%rax)
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm0
  addsd  0x10(%rax),%xmm0
  addsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  0x8(%rax),%xmm0
  addsd  0x18(%rax),%xmm0
  addsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x38(%rsp)
  jmp    L47
L73:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D6
type: qword[2]
name: retrieve_data
arguments: data_label: D3
type: byte[8]
name: retrieve_data
arguments: data_label: D17
type: byte[8]
name: retrieve_data
arguments: data_label: D38
type: f64
name: retrieve_data
arguments: data_label: D76
type: f64

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

tool: {"D3": [0x16,0x56,0xe7,0x9e,0xaf,0x03,0xd2,0x3c]}

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

tool: D38: 2

tool: D76: 0.5

assistant: ```c
void amoeba(double p[3][2], double *y, double ftol, double (*funk)(double[]), int *nfunk) {
  int ii, ihi, ilo, inhi;
  double rtol, ysave, ytry, psum[2], tempzz;
  *nfunk = 0;
  psum[0] = p[0][0] + p[1][0] + p[2][0];
  psum[1] = p[0][1] + p[1][1] + p[2][1];
  for (;;) {
    ilo = 0;
    ihi = y[0] > y[1] ? (inhi = 1, 0) : (inhi = 0, 1);
    for (ii = 0; ii <= 2; ii++) {
      if (y[ii] <= y[ilo])
        ilo = ii;
      if (y[ii] > y[ihi]) {
        inhi = ihi;
        ihi = ii;
      } else if (y[ii] > y[inhi] && ii != ihi)
        inhi = ii;
    }
    rtol = 2.0 * fabs(y[ihi] - y[ilo]) / (fabs(y[ihi]) + fabs(y[ilo]) + 1.0e-15);
    if (rtol < ftol) {
      tempzz = (y[0]);
      (y[0]) = (y[ilo]);
      (y[ilo]) = tempzz;
      tempzz = (p[0][0]);
      (p[0][0]) = (p[ilo][0]);
      (p[ilo][0]) = tempzz;
      tempzz = (p[0][1]);
      (p[0][1]) = (p[ilo][1]);
      (p[ilo][1]) = tempzz;
      break;
    }
    if (*nfunk >= 5000) {
      return;
    }
    *nfunk += 2;
    ytry = amotry(p, y, psum, funk, ihi, -1.0);
    if (ytry <= y[ilo])
      ytry = amotry(p, y, psum, funk, ihi, 2.0);
    else if (ytry >= y[inhi]) {
      ysave = y[ihi];
      ytry = amotry(p, y, psum, funk, ihi, 0.5);
      if (ytry >= ysave) {
        for (ii = 0; ii <= 2; ii++) {
          if (ii != ilo) {
            p[ii][0] = psum[0] = 0.5 * (p[ii][0] + p[ilo][0]);
            p[ii][1] = psum[1] = 0.5 * (p[ii][1] + p[ilo][1]);
            y[ii] = (*funk)(psum);
          }
        }
        *nfunk += 2;
        psum[0] = p[0][0] + p[1][0] + p[2][0];
        psum[1] = p[0][1] + p[1][1] + p[2][1];
      }
    } else
      --(*nfunk);
  }
}
```