user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dlacon2_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x10(%rsp)
  mov    %rdx,%rbx
  mov    %r8,0x8(%rsp)
  mov    %r9,%r13
  mov    0x70(%rsp),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x24(%rsp)
  cmpl   $0x0,(%r9)
  je     L200
  mov    %rcx,%r12
  mov    (%r15),%r14d
  cmp    $0x4,%r14d
  je     L140
  jg     L194
  cmp    $0x2,%r14d
  je     L404
  cmp    $0x3,%r14d
  jne    L195
  lea    0x24(%rsp),%r14
  mov    %r14,%r8
  mov    0x10(%rsp),%rcx
  mov    %r14,%rdx
  mov    %rbx,%rsi
  call   <dcopy_@plt>
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm6
  movsd  %xmm6,0x18(%rsp)
  mov    %r14,%rdx
  mov    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <dasum_@plt>
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    $0x0,%r14d
  cmpl   $0x0,0x0(%rbp)
  jg     L388
  jmp    L220
L200:
  mov    (%rdi),%edx
  test   %edx,%edx
  jle    L31
  movsd  D131(%rip),%xmm2
L311:
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  movapd %xmm2,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  mov    0x0(%rbp),%edx
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L311
L31:
  movl   $0x1,0x0(%r13)
  movl   $0x1,(%r15)
L77:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L300
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L194:
  cmp    $0x5,%r14d
  je     L335
L195:
  cmpl   $0x1,0x0(%rbp)
  je     L198
  lea    0x24(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <dasum_@plt>
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax)
  cmpl   $0x0,0x0(%rbp)
  jle    L251
  mov    $0x0,%r14d
  jmp    L33
L404:
  lea    0x24(%rsp),%rdx
  mov    %rbx,%rsi
  call   <idamax_@plt>
  sub    $0x1,%eax
  mov    %eax,0x4(%r15)
L323:
  mov    %r14d,0x8(%r15)
  mov    $0x0,%eax
  cmpl   $0x0,0x0(%rbp)
  jle    L185
L292:
  movq   $0x0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,0x0(%rbp)
  jg     L292
L185:
  movslq 0x4(%r15),%rax
  mov    D131(%rip),%rsi
  mov    %rsi,(%rbx,%rax,8)
  movl   $0x1,0x0(%r13)
  movl   $0x3,(%r15)
  jmp    L77
L140:
  mov    0x4(%r15),%r12d
  lea    0x24(%rsp),%rdx
  mov    %rbx,%rsi
  call   <idamax_@plt>
  sub    $0x1,%eax
  mov    %eax,0x4(%r15)
  movslq %r12d,%r12
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  andpd  D122(%rip),%xmm0
  ucomisd (%rbx,%r12,8),%xmm0
  jp     L69
  jne    L69
L228:
  mov    0x0(%rbp),%eax
  mov    $0x0,%edx
  movsd  D131(%rip),%xmm1
  test   %eax,%eax
  jle    L220
  movapd %xmm1,%xmm4
  movq   D68(%rip),%xmm3
L147:
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  sub    $0x1,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx,%rdx,8)
  xorpd  %xmm3,%xmm1
  mov    0x0(%rbp),%eax
  add    $0x1,%rdx
  lea    0x1(%rdx),%ecx
  cmp    %ecx,%eax
  jge    L147
L220:
  movl   $0x1,0x0(%r13)
  movl   $0x5,(%r15)
  jmp    L77
L335:
  lea    0x24(%rsp),%rdx
  mov    %rbx,%rsi
  call   <dasum_@plt>
  mov    0x0(%rbp),%eax
  lea    (%rax,%rax,2),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movq   %xmm0,%r12
  mov    0x8(%rsp),%rax
  comisd (%rax),%xmm0
  jbe    L252
  lea    0x24(%rsp),%rdx
  mov    %rdx,%r8
  mov    0x10(%rsp),%rcx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <dcopy_@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,(%rax)
  jmp    L252
L198:
  movsd  (%rbx),%xmm0
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax)
  andpd  D122(%rip),%xmm0
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax)
L252:
  movl   $0x0,0x0(%r13)
  jmp    L77
L251:
  movl   $0x2,0x0(%r13)
  movl   $0x2,(%r15)
  jmp    L77
L73:
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  neg    %eax
L32:
  cmp    %eax,(%r12,%r14,4)
  jne    L135
  add    $0x1,%r14
  cmp    %r14d,0x0(%rbp)
  jle    L228
L388:
  movsd  (%rbx,%r14,8),%xmm0
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm0
  jb     L73
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  jmp    L32
L135:
  mov    0x8(%rsp),%rax
  movsd  0x18(%rsp),%xmm3
  comisd (%rax),%xmm3
  jae    L228
  mov    $0x0,%r14d
  cmpl   $0x0,0x0(%rbp)
  jg     L393
L268:
  movl   $0x2,0x0(%r13)
  movl   $0x4,(%r15)
  jmp    L77
L69:
  mov    0x8(%r15),%r14d
  cmp    $0x4,%r14d
  jg     L228
  add    $0x1,%r14d
  jmp    L323
L216:
  movsd  D49(%rip),%xmm7
  movsd  %xmm7,(%rbx,%r14,8)
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  neg    %eax
L331:
  mov    %eax,(%r12,%r14,4)
  add    $0x1,%r14
  cmp    %r14d,0x0(%rbp)
  jle    L251
L33:
  movsd  (%rbx,%r14,8),%xmm0
  pxor   %xmm5,%xmm5
  comisd %xmm5,%xmm0
  jb     L216
  movsd  D131(%rip),%xmm7
  movsd  %xmm7,(%rbx,%r14,8)
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  jmp    L331
L167:
  movsd  D49(%rip),%xmm4
  movsd  %xmm4,(%rbx,%r14,8)
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  neg    %eax
L187:
  mov    %eax,(%r12,%r14,4)
  add    $0x1,%r14
  cmp    %r14d,0x0(%rbp)
  jle    L268
L393:
  movsd  (%rbx,%r14,8),%xmm0
  pxor   %xmm3,%xmm3
  comisd %xmm3,%xmm0
  jb     L167
  movsd  D131(%rip),%xmm4
  movsd  %xmm4,(%rbx,%r14,8)
  movsd  D72(%rip),%xmm0
  call   <floor@plt>
  jmp    L187
L300:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D131
datatype: f64
name: unpack_data
arguments: data_tag: D122
datatype: qword[2]
name: unpack_data
arguments: data_tag: D68
datatype: f32[2]
name: unpack_data
arguments: data_tag: D72
datatype: f32[2]
name: unpack_data
arguments: data_tag: D49
datatype: f32[2]

tool: D131: 1

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

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

tool: {"D72": [0.0,1.9375]}

tool: {"D49": [0.0,-1.875]}

assistant: ```c
int dlacon2_(int *n, double *v, double *x, int *isgn, double *est, int *kase, int isave[3]) {
  int c__1 = 1;
  double zero = 0.0;
  double one = 1.0;
  int jlast;
  double altsgn, estold;
  int i;
  double temp;
  extern int idamax_(int *, double *, int *);
  extern double dasum_(int *, double *, int *);
  extern int dcopy_(int *, double *, int *, double *, int *);
  if (*kase == 0) {
    for (i = 0; i < *n; ++i) {
      x[i] = 1. / (double)(*n);
    }
    *kase = 1;
    isave[0] = 1;
    return 0;
  }
  switch (isave[0]) {
  case 1:
    goto L20;
  case 2:
    goto L40;
  case 3:
    goto L70;
  case 4:
    goto L110;
  case 5:
    goto L140;
  }
L20:
  if (*n == 1) {
    v[0] = x[0];
    *est = fabs(v[0]);
    goto L150;
  }
  *est = dasum_(n, x, &c__1);
  for (i = 0; i < *n; ++i) {
    x[i] = (x[i] >= 0 ? fabs(one) : -fabs(one));
    isgn[i] = (x[i] >= 0 ? floor(x[i] + .5) : -floor(.5 - x[i]));
  }
  *kase = 2;
  isave[0] = 2;
  return 0;
L40:
  isave[1] = idamax_(n, &x[0], &c__1);
  --isave[1];
  isave[2] = 2;
L50:
  for (i = 0; i < *n; ++i)
    x[i] = zero;
  x[isave[1]] = one;
  *kase = 1;
  isave[0] = 3;
  return 0;
L70:
  dcopy_(n, x, &c__1, v, &c__1);
  estold = *est;
  *est = dasum_(n, v, &c__1);
  for (i = 0; i < *n; ++i)
    if (((x[i] >= 0 ? fabs(one) : -fabs(one)) >= 0 ? floor((x[i] >= 0 ? fabs(one) : -fabs(one)) + .5) : -floor(.5 - (x[i] >= 0 ? fabs(one) : -fabs(one)))) != isgn[i])
      goto L90;
  goto L120;
L90:
  if (*est <= estold)
    goto L120;
  for (i = 0; i < *n; ++i) {
    x[i] = (x[i] >= 0 ? fabs(one) : -fabs(one));
    isgn[i] = (x[i] >= 0 ? floor(x[i] + .5) : -floor(.5 - x[i]));
  }
  *kase = 2;
  isave[0] = 4;
  return 0;
L110:
  jlast = isave[1];
  isave[1] = idamax_(n, &x[0], &c__1);
  isave[1] = isave[1] - 1;
  if (x[jlast] != fabs(x[isave[1]]) && isave[2] < 5) {
    isave[2] = isave[2] + 1;
    goto L50;
  }
L120:
  altsgn = 1.;
  for (i = 1; i <= *n; ++i) {
    x[i - 1] = altsgn * ((double)(i - 1) / (double)(*n - 1) + 1.);
    altsgn = -altsgn;
  }
  *kase = 1;
  isave[0] = 5;
  return 0;
L140:
  temp = dasum_(n, x, &c__1) / (double)(*n * 3) * 2.;
  if (temp > *est) {
    dcopy_(n, &x[0], &c__1, &v[0], &c__1);
    *est = temp;
  }
L150:
  *kase = 0;
  return 0;
}
```