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

```asm
<f_preformat>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    0xc(%rdi),%r12d
  movsd  %xmm0,0x8(%rsp)
  test   %r12d,%r12d
  jne    L505
L206:
  mov    0x10(%r13),%ebx
  test   %ebx,%ebx
  jne    L171
  mov    0x4(%r13),%edx
  xor    %eax,%eax
  test   %edx,%edx
  setg   %al
  add    %ebp,%eax
  add    %edx,%eax
  cmp    0x0(%r13),%eax
  jl     L324
L171:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  movsd  0x8(%rsp),%xmm1
  ucomisd %xmm1,%xmm1
  setnp  %bl
  test   %rax,%rax
  je     L533
  test   %bl,%bl
  jne    L394
L533:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L392
  test   %bl,%bl
  jne    L471
L392:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L71
  test   %bl,%bl
  jne    L512
L71:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L512:
  mov    0x18(%r13),%esi
  test   %esi,%esi
  je     L71
  mov    0x14(%r13),%ecx
  test   %ecx,%ecx
  jne    L71
  mov    0xc(%r13),%edx
  test   %edx,%edx
  jne    L159
L26:
  mov    $0x20,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L471:
  mov    0x14(%r13),%r8d
  test   %r8d,%r8d
  je     L392
  mov    0xc(%r13),%edi
  test   %edi,%edi
  je     L193
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  je     L392
L193:
  mov    $0x2b,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L392
  nopl   0x0(%rax,%rax,1)
L394:
  mov    0xc(%r13),%r9d
  test   %r9d,%r9d
  jne    L221
L268:
  mov    $0x2d,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L533
  nop
L324:
  movsd  0x8(%rsp),%xmm2
  ucomisd %xmm2,%xmm2
  jp     L143
L17:
  mov    0x14(%r13),%eax
  test   %eax,%eax
  je     L125
L444:
  mov    0x8(%r13),%r11d
  test   %r11d,%r11d
  jne    L469
L440:
  mov    0x0(%r13),%eax
  xor    %ecx,%ecx
  add    $0x1,%ebx
  sub    %ebp,%eax
  test   %edx,%edx
  setg   %cl
  sub    %ecx,%eax
  sub    %edx,%eax
  cmp    %eax,%ebx
  jl     L30
  jmp    L171
  cs nopw 0x0(%rax,%rax,1)
L486:
  mov    $0x20,%edi
  call   <ft_putchar@plt>
L218:
  mov    0x4(%r13),%edx
  add    %eax,%r12d
  mov    0x0(%r13),%eax
  xor    %ecx,%ecx
  add    $0x1,%ebx
  sub    %ebp,%eax
  test   %edx,%edx
  setg   %cl
  sub    %ecx,%eax
  sub    %edx,%eax
  cmp    %ebx,%eax
  jle    L171
L30:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L486
  mov    0xc(%r13),%r10d
  test   %r10d,%r10d
  je     L486
  mov    $0x30,%edi
  call   <ft_putchar@plt>
  jmp    L218
  nopw   0x0(%rax,%rax,1)
L505:
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L172
L536:
  xor    %r12d,%r12d
L450:
  mov    0xc(%r13),%edx
  test   %edx,%edx
  je     L206
  mov    0x14(%r13),%eax
  test   %eax,%eax
  jne    L164
  mov    0x18(%r13),%eax
  test   %eax,%eax
  je     L206
L67:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L206
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L206
  mov    $0x20,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L206
  nopw   0x0(%rax,%rax,1)
L469:
  test   %edx,%edx
  jne    L440
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  mov    0x4(%r13),%edx
  cmp    $0x1,%rax
  adc    $0x0,%ebx
  jmp    L440
  nopl   0x0(%rax,%rax,1)
L221:
  movapd %xmm1,%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L268
  jmp    L533
  nop
L125:
  mov    0x8(%r13),%r11d
  cmpl   $0x1,0x18(%r13)
  sbb    %ebx,%ebx
  test   %r11d,%r11d
  je     L440
  jmp    L469
  cs nopw 0x0(%rax,%rax,1)
L143:
  movapd %xmm2,%xmm0
  call   <is_neg@plt>
  mov    0x4(%r13),%edx
  test   %rax,%rax
  je     L17
  jmp    L444
  nopl   0x0(%rax,%rax,1)
L164:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  je     L271
L275:
  mov    0xc(%r13),%eax
  test   %eax,%eax
  je     L206
  mov    0x18(%r13),%eax
  test   %eax,%eax
  je     L206
  mov    0x14(%r13),%eax
  test   %eax,%eax
  jne    L206
  jmp    L67
  nopl   0x0(%rax)
L172:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L536
  mov    $0x2d,%edi
  call   <ft_putchar@plt>
  mov    %eax,%r12d
  jmp    L450
  cs nopw 0x0(%rax,%rax,1)
L271:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L275
  mov    $0x2b,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L275
  nop
L159:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L26
  jmp    L71
```

assistant: ```c
int f_preformat(double n, int fl[8], int len) {
  int index;
  int ret;
  ret = 0;
  ret += (fl[3] && is_neg(n) && !is_in(n)) ? ft_putchar('-') : 0;
  ret += (fl[3] && fl[5] && !is_neg(n) && !is_in(n)) ? ft_putchar('+') : 0;
  ret += (fl[3] && fl[6] && !fl[5] && !is_neg(n) && !is_in(n)) ? ft_putchar(' ') : 0;
  if (!fl[4] && len + (fl[1] > 0) + fl[1] < fl[0]) {
    index = ((n != n && is_neg(n)) || fl[5] || fl[6]) ? 0 : -1;
    index += (fl[2] && !fl[1] && !is_in(n)) ? 1 : 0;
    while (++index < fl[0] - len - (fl[1] > 0) - fl[1])
      ret += (!is_in(n) && fl[3]) ? ft_putchar('0') : ft_putchar(' ');
  }
  ret += (is_neg(n) && n == n && (!fl[3] || is_in(n))) ? ft_putchar('-') : 0;
  ret += (!is_neg(n) && n == n && fl[5] && (!fl[3] || is_in(n))) ? ft_putchar('+') : 0;
  ret += (!is_neg(n) && n == n && fl[6] && !fl[5] && (!fl[3] || is_in(n))) ? ft_putchar(' ') : 0;
  return (ret);
}
```