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

```asm
<sfa_special>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,%r12
  mov    %rsi,0x28(%rsp)
  mov    %rdx,0x78(%rsp)
  mov    %rcx,%rbx
  mov    %r8,0x50(%rsp)
  mov    %r9,%rbp
  movsd  %xmm0,0x10(%rsp)
  mov    0xe0(%rsp),%r14
  mov    0xe8(%rsp),%r13
  movsd  %xmm1,0x68(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movslq 0xd0(%rsp),%r15
  mov    0xd0(%rsp),%edi
  shl    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    0x28(%rsp),%rax
  mov    D1(%rip),%rsi
  mov    %rsi,(%rax)
  cmpl   $0x0,0xd8(%rsp)
  jle    L112
  shl    $0x3,%r15
  lea    -0x8(%r15),%rax
  lea    (%rbx,%rax,1),%rsi
  mov    %rsi,0x30(%rsp)
  lea    -0x10(%rbx,%r15,1),%rsi
  mov    %rsi,0x38(%rsp)
  lea    0x0(%rbp,%rax,1),%rsi
  mov    %rsi,0x40(%rsp)
  add    %r13,%rax
  mov    %rax,0x48(%rsp)
  mov    0xd0(%rsp),%eax
  lea    -0x1(%rax),%r15d
  lea    0x8(%rbx,%r15,8),%rax
  mov    %rax,0x58(%rsp)
  movl   $0xffffffff,0x1c(%rsp)
  movl   $0x1,0xc(%rsp)
  movsd  0x10(%rsp),%xmm6
  xorpd  D29(%rip),%xmm6
  movsd  %xmm6,0x60(%rsp)
  jmp    L75
L18:
  comisd %xmm0,%xmm2
  jbe    L0
  movsd  %xmm2,(%rax)
L0:
  add    $0x8,%rax
  cmp    %rcx,%rax
  je     L154
L62:
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L18
  movsd  %xmm1,(%rax)
  jmp    L0
L127:
  mov    0x28(%rsp),%rax
  movsd  (%rax),%xmm3
  movsd  %xmm3,0x70(%rsp)
  mov    0xd0(%rsp),%r9d
  movsd  0x10(%rsp),%xmm0
  mov    %rbp,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %rax,%rdi
  call   <dualityGap@plt>
  mov    0x28(%rsp),%rax
  movsd  (%rax),%xmm0
  movsd  0x68(%rsp),%xmm4
  comisd %xmm0,%xmm4
  jae    L52
  mov    0x1c(%rsp),%esi
  cmp    %esi,0x18(%rsp)
  jne    L140
  movsd  D26(%rip),%xmm5
  comisd %xmm0,%xmm5
  jbe    L140
  ucomisd 0x70(%rsp),%xmm0
  setnp  %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  cmovne %eax,%edi
  call   <fabs@plt>
  test   %rax,%rax
  je     L140
  jmp    L52
L112:
  movl   $0x1,0xc(%rsp)
  movl   $0xffffffff,0x18(%rsp)
L52:
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x78(%rsp),%rax
  mov    0x18(%rsp),%esi
  mov    %esi,(%rax)
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  mov    0xc(%rsp),%eax
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L153:
  lea    0x80(%rsp),%rdi
  mov    0xd0(%rsp),%ecx
  mov    %r14,%rdx
  mov    %rbx,%rsi
  call   <Thomas@plt>
L154:
  mov    0xc(%rsp),%eax
  cltd
  idivl  0xf0(%rsp)
  test   %edx,%edx
  je     L127
L140:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,0xd8(%rsp)
  jl     L52
  mov    0x18(%rsp),%eax
  mov    %eax,0x1c(%rsp)
L75:
  movsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm0
  subsd  0x8(%rbx),%xmm0
  subsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x0(%r13)
  cmpl   $0x2,0xd0(%rsp)
  jle    L158
  mov    0xd0(%rsp),%eax
  lea    -0x3(%rax),%edx
  add    $0x2,%rdx
  mov    $0x1,%eax
L98:
  movsd  (%rbx,%rax,8),%xmm1
  movapd %xmm1,%xmm0
  subsd  -0x8(%rbx,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  subsd  0x8(%rbx,%rax,8),%xmm0
  subsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L98
L158:
  mov    0x30(%rsp),%rax
  movsd  (%rax),%xmm1
  mov    0x38(%rsp),%rax
  movapd %xmm1,%xmm0
  subsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    0x40(%rsp),%rax
  subsd  (%rax),%xmm0
  mov    0x48(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0xd0(%rsp),%r9d
  movsd  0x10(%rsp),%xmm0
  mov    0x20(%rsp),%r8
  mov    %r13,%rcx
  mov    %rbx,%rdx
  mov    0x50(%rsp),%rsi
  mov    %r12,%rdi
  call   <supportSet@plt>
  mov    %eax,0x18(%rsp)
  cmpl   $0x0,0xd0(%rsp)
  jle    L153
  mov    $0x0,%eax
L44:
  movsd  0x0(%rbp,%rax,8),%xmm0
  subsd  0x8(%r12,%rax,8),%xmm0
  addsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%r15
  jne    L44
  lea    0x80(%rsp),%rdi
  mov    0xd0(%rsp),%ecx
  mov    %r14,%rdx
  mov    %rbx,%rsi
  call   <Thomas@plt>
  mov    %rbx,%rax
  mov    0x58(%rsp),%rcx
  movsd  0x10(%rsp),%xmm1
  movsd  0x60(%rsp),%xmm2
  jmp    L62
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D1
type: byte[8]
name: retrieve_data
arguments: data_tag: D29
type: byte[16]
name: retrieve_data
arguments: data_tag: D26
type: f64

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

tool: {"D29": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D26: 1

assistant: ```c
int sfa_special(double *x, double *gap, int *activeS, double *z, double *v, double *Av, double lambda, int nn, int maxStep, double *s, double *g, double tol, int tau) {
  int i, iterStep;
  double temp;
  int *S = (int *)malloc(sizeof(int) * nn);
  double gapp = -1;
  int numS = -1, numSp = -1;
  *gap = -1;
  for (iterStep = 1; iterStep <= maxStep; iterStep++) {
    g[0] = z[0] + z[0] - z[1] - Av[0];
    for (i = 1; i < nn - 1; i++) {
      g[i] = -z[i - 1] + z[i] + z[i] - z[i + 1] - Av[i];
    }
    g[nn - 1] = -z[nn - 2] + z[nn - 1] + z[nn - 1] - Av[nn - 1];
    numSp = numS;
    numS = supportSet(x, v, z, g, S, lambda, nn);
    for (i = 0; i < nn; i++)
      s[i] = Av[i] - x[i + 1] + x[i];
    Thomas(&temp, z, s, nn);
    for (i = 0; i < nn; i++) {
      if (z[i] > lambda)
        z[i] = lambda;
      else if (z[i] < -lambda)
        z[i] = -lambda;
    }
    if (iterStep % tau == 0) {
      gapp = *gap;
      dualityGap(gap, z, g, s, Av, lambda, nn);
      if (*gap <= tol) {
        break;
      }
      if ((*gap < 1) && (numS == numSp) && fabs(gapp == *gap)) {
        break;
      }
    }
  }
  free(S);
  *activeS = numS;
  return (iterStep);
}
```