user: Converte this assembly snippet into its equivalent C code:

```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    L461
L171:
  mov    0x10(%r13),%ebx
  test   %ebx,%ebx
  jne    L135
  mov    0x4(%r13),%edx
  xor    %eax,%eax
  test   %edx,%edx
  setg   %al
  add    %ebp,%eax
  add    %edx,%eax
  cmp    0x0(%r13),%eax
  jl     L98
L135:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  movsd  0x8(%rsp),%xmm1
  ucomisd %xmm1,%xmm1
  setnp  %bl
  test   %rax,%rax
  je     L523
  test   %bl,%bl
  jne    L57
L523:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L26
  test   %bl,%bl
  jne    L308
L26:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L100
  test   %bl,%bl
  jne    L505
L100:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L505:
  mov    0x18(%r13),%esi
  test   %esi,%esi
  je     L100
  mov    0x14(%r13),%ecx
  test   %ecx,%ecx
  jne    L100
  mov    0xc(%r13),%edx
  test   %edx,%edx
  jne    L205
L374:
  mov    $0x20,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L100
  nopl   0x0(%rax,%rax,1)
L308:
  mov    0x14(%r13),%r8d
  test   %r8d,%r8d
  je     L26
  mov    0xc(%r13),%edi
  test   %edi,%edi
  je     L491
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  je     L26
L491:
  mov    $0x2b,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L57:
  mov    0xc(%r13),%r9d
  test   %r9d,%r9d
  jne    L78
L530:
  mov    $0x2d,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L523
  nop
L98:
  movsd  0x8(%rsp),%xmm2
  ucomisd %xmm2,%xmm2
  jp     L62
L481:
  mov    0x14(%r13),%eax
  test   %eax,%eax
  je     L359
L97:
  mov    0x8(%r13),%r11d
  test   %r11d,%r11d
  jne    L514
L525:
  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     L400
  jmp    L135
  cs nopw 0x0(%rax,%rax,1)
L230:
  mov    $0x20,%edi
  call   <ft_putchar@plt>
L3:
  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    L135
L400:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L230
  mov    0xc(%r13),%r10d
  test   %r10d,%r10d
  je     L230
  mov    $0x30,%edi
  call   <ft_putchar@plt>
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L461:
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L44
L521:
  xor    %r12d,%r12d
L72:
  mov    0xc(%r13),%edx
  test   %edx,%edx
  je     L171
  mov    0x14(%r13),%eax
  test   %eax,%eax
  jne    L24
  mov    0x18(%r13),%eax
  test   %eax,%eax
  je     L171
L167:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  jne    L171
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L171
  mov    $0x20,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L171
  nopw   0x0(%rax,%rax,1)
L514:
  test   %edx,%edx
  jne    L525
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  mov    0x4(%r13),%edx
  cmp    $0x1,%rax
  adc    $0x0,%ebx
  jmp    L525
  nopl   0x0(%rax,%rax,1)
L78:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L530
  jmp    L523
  nopl   0x0(%rax)
L359:
  mov    0x8(%r13),%r11d
  cmpl   $0x1,0x18(%r13)
  sbb    %ebx,%ebx
  test   %r11d,%r11d
  je     L525
  jmp    L514
  xchg   %ax,%ax
L62:
  movapd %xmm2,%xmm0
  call   <is_neg@plt>
  mov    0x4(%r13),%edx
  test   %rax,%rax
  je     L481
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L24:
  movsd  0x8(%rsp),%xmm0
  call   <is_neg@plt>
  test   %rax,%rax
  je     L506
L390:
  mov    0xc(%r13),%eax
  test   %eax,%eax
  je     L171
  mov    0x18(%r13),%eax
  test   %eax,%eax
  je     L171
  mov    0x14(%r13),%eax
  test   %eax,%eax
  jne    L171
  jmp    L167
  nopl   0x0(%rax)
L44:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L521
  mov    $0x2d,%edi
  call   <ft_putchar@plt>
  mov    %eax,%r12d
  jmp    L72
  cs nopw 0x0(%rax,%rax,1)
L506:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L390
  mov    $0x2b,%edi
  call   <ft_putchar@plt>
  add    %eax,%r12d
  jmp    L390
  nop
L205:
  movsd  0x8(%rsp),%xmm0
  call   <is_in@plt>
  test   %rax,%rax
  jne    L374
  jmp    L100
```

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);
}
```