// File: /workspace/github_c_makefile_star2_O2/AndreIglesias[P]quick_ls/libft/libstd/depo/.././src//c/stdio/ft_printf/aux/ft_putdbl.c
// Function: ft_putdbl
int	ft_putdbl(long double d, t_flags flags)
{
	int				nb;
	long long int	a;

	nb = write(flags.fd, " ", (d >= 0 && !flags.plus && flags.space));
	nb += write(flags.fd, "+", (d >= 0 && flags.zero) * flags.plus);
	nb += write(flags.fd, "-", (d < 0 && flags.zero));
	if (!flags.minus)
		nb += ft_putwidth((long long)d, flags, (unsigned)d, flags.precision);
	nb += write(flags.fd, "+", (d >= 0 && !flags.zero) * flags.plus);
	nb += write(flags.fd, "-", (d < 0 && !flags.zero));
	nb += ft_putnbr_max(ft_abs((long long int)d), flags.fd);
	a = (long long int)d;
	d = ft_abs(d);
	d -= (long double)ft_abs(a);
	if (flags.precision != 0 || flags.square)
		nb += write(flags.fd, ".", 1);
	nb += ft_putzeroes(1 + ft_fmod(d, 1), flags.precision, flags.fd);
	d = (ft_fmod(d, 1)) * ft_pow(10, flags.precision);
	if ((int)(d * 10) % 10 >= 5)
		d++;
	if (flags.precision != 0 && d)
		nb += ft_putnbr_max((long long int)d, flags.fd);
	if (flags.minus)
		nb += ft_putwidth(a, flags, (unsigned int)a, flags.precision);
	return (nb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
fldt 0xd0(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
leaq 0xe0(%rsp), %r14
movl 0x38(%r14), %ebp
fldz
fld %st(0)
fstpt 0x5c(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
setae %al
movslq 0x8(%r14), %r15
testq %r15, %r15
sete %cl
cmpl $0x0, 0x10(%r14)
setne %dl
andb %cl, %dl
andb %al, %dl
movzbl %dl, %edx
leaq 0x16cd(%rip), %rsi      # 0x5289
movl %ebp, %edi
callq 0x1060
movq %rax, %rbx
movl 0x4(%r14), %ecx
xorl %eax, %eax
movl %ecx, %r13d
testl %ecx, %ecx
movl $0x0, %edx
cmovneq %r15, %rdx
setne %r12b
fldt 0x48(%rsp)
fldt 0x5c(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
cmovbq %rax, %rdx
leaq 0x1790(%rip), %rsi      # 0x5387
movl %ebp, %edi
callq 0x1060
addl %eax, %ebx
fldt 0x48(%rsp)
fldt 0x5c(%rsp)
fucompi %st(1), %st
fstp %st(0)
seta %al
andb %r12b, %al
movzbl %al, %edx
leaq 0x1694(%rip), %rsi      # 0x52b0
movl %ebp, %edi
callq 0x1060
fldt 0x48(%rsp)
fnstcw 0x46(%rsp)
movzwl 0x46(%rsp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, 0x5a(%rsp)
fldcw 0x5a(%rsp)
movq %rax, %r12
fld %st(0)
fistpll 0x90(%rsp)
fldcw 0x46(%rsp)
addl %ebx, %r12d
movq %r14, %rbx
cmpl $0x0, 0xc(%r14)
movq 0x90(%rsp), %r14
je 0x3c69
movl %r13d, %ecx
jmp 0x3cd3
fnstcw 0x44(%rsp)
movzwl 0x44(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x58(%rsp)
fldcw 0x58(%rsp)
fistpll 0x88(%rsp)
fldcw 0x44(%rsp)
movl 0x88(%rsp), %esi
movl 0x18(%rbx), %edx
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x2c(%rbx), %xmm3
movups %xmm3, 0x2c(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x3884
fldt 0x48(%rsp)
addl %r12d, %eax
movl 0x4(%rbx), %ecx
movl 0x38(%rbx), %ebp
movslq 0x8(%rbx), %r15
movl %eax, %r12d
fldz
fucomi %st(1), %st
seta %r13b
testl %ecx, %ecx
movl $0x0, %eax
cmovneq %rax, %r15
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
cmovbq %rax, %r15
leaq 0x1690(%rip), %rsi      # 0x5387
movl %ebp, %edi
movq %r15, %rdx
callq 0x1060
movq %rax, %r15
cmpl $0x0, 0x4(%rbx)
movl 0x38(%rbx), %edi
sete %al
andb %r13b, %al
movzbl %al, %edx
leaq 0x1595(%rip), %rsi      # 0x52b0
callq 0x1060
movq %rax, %r13
addl %r15d, %r13d
addl %r12d, %r13d
movq %r14, %rdi
callq 0x45f8
movl 0x38(%rbx), %esi
movq %rax, %rdi
callq 0x4560
movl %eax, %r15d
addl %r13d, %r15d
movq %r14, %rdi
callq 0x45f8
movq %rax, 0x78(%rsp)
fildll 0x78(%rsp)
fstpt 0x48(%rsp)
movq %r14, %rdi
callq 0x45f8
movq %rax, 0x80(%rsp)
fildll 0x80(%rsp)
fldt 0x48(%rsp)
fsubp %st, %st(1)
movl (%rbx), %eax
orl 0x18(%rbx), %eax
movq %r14, %r12
je 0x3da1
movl 0x38(%rbx), %edi
leaq 0x135e(%rip), %rsi      # 0x50e6
pushq $0x1
popq %rdx
fstpt 0x48(%rsp)
callq 0x1060
fldt 0x48(%rsp)
addl %eax, %r15d
movl 0x18(%rbx), %r14d
jmp 0x3da4
xorl %r14d, %r14d
fstpt (%rsp)
movsd 0x1611(%rip), %xmm0     # 0x53c0
callq 0x3a64
fld %st(0)
fstpt 0x5c(%rsp)
fld1
fld %st(0)
fstpt 0x48(%rsp)
faddp %st, %st(1)
movl 0x38(%rbx), %esi
fstpt (%rsp)
movl %r14d, %edi
callq 0x3ab5
movl %eax, %ebp
addl %r15d, %ebp
movl 0x18(%rbx), %r14d
movl %r14d, %edi
callq 0x3b52
movl %eax, 0x68(%rsp)
fldt 0x5c(%rsp)
fimull 0x68(%rsp)
fld %st(0)
fmuls 0x15d1(%rip)            # 0x53c8
fnstcw 0x42(%rsp)
movzwl 0x42(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x56(%rsp)
fldcw 0x56(%rsp)
fistpl 0x6c(%rsp)
fldcw 0x42(%rsp)
movl 0x6c(%rsp), %eax
pushq $0xa
popq %rcx
cltd
idivl %ecx
cmpl $0x5, %edx
setge %al
fldt 0x48(%rsp)
fadd %st(1), %st
testb %al, %al
fxch %st(1)
fcmovne %st(1), %st
fstp %st(1)
testl %r14d, %r14d
je 0x3e75
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jne 0x3e45
jnp 0x3e75
fnstcw 0x40(%rsp)
movzwl 0x40(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x54(%rsp)
fldcw 0x54(%rsp)
fistpll 0x70(%rsp)
fldcw 0x40(%rsp)
movq 0x70(%rsp), %rdi
movl 0x38(%rbx), %esi
callq 0x4560
addl %eax, %ebp
jmp 0x3e77
fstp %st(0)
cmpl $0x0, 0xc(%rbx)
je 0x3eaf
movl %r12d, %esi
movl 0x18(%rbx), %edx
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x2c(%rbx), %xmm3
movups %xmm3, 0x2c(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x3884
addl %eax, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop