// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0xd0, %rsp
fldt 0x100(%rsp)
fld %st(0)
fstpt 0x54(%rsp)
leaq 0x110(%rsp), %r12
fldz
fld %st(0)
fstpt 0x70(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
setae %al
cmpl $0x0, 0x8(%r12)
movl 0x38(%r12), %edi
sete %cl
cmpl $0x0, 0x10(%r12)
setne %dl
andb %cl, %dl
andb %al, %dl
movzbl %dl, %edx
leaq 0x14e4(%rip), %rsi      # 0x5289
callq 0x1060
xorl %ecx, %ecx
cmpl $0x0, 0x4(%r12)
movq %rax, %r14
movslq 0x8(%r12), %rdx
cmoveq %rcx, %rdx
movl 0x38(%r12), %edi
fldt 0x70(%rsp)
fldt 0x54(%rsp)
fucompi %st(1), %st
fstp %st(0)
cmovbq %rcx, %rdx
leaq 0x15ad(%rip), %rsi      # 0x5387
callq 0x1060
addl %eax, %r14d
fldt 0x54(%rsp)
fldt 0x70(%rsp)
fucompi %st(1), %st
fstp %st(0)
seta %al
cmpl $0x0, 0x4(%r12)
movl 0x38(%r12), %edi
setne %cl
andb %al, %cl
movzbl %cl, %edx
leaq 0x14a5(%rip), %rsi      # 0x52b0
callq 0x1060
movq %rax, %rbx
addl %r14d, %ebx
cmpl $0x0, 0xc(%r12)
jne 0x3eb7
fnstcw 0x52(%rsp)
movzwl 0x52(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x66(%rsp)
fldcw 0x66(%rsp)
fldt 0x54(%rsp)
fld %st(0)
fistpll 0xc8(%rsp)
fldcw 0x52(%rsp)
movq 0xc8(%rsp), %rdi
fnstcw 0x50(%rsp)
movzwl 0x50(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x64(%rsp)
fldcw 0x64(%rsp)
fistpll 0xc0(%rsp)
fldcw 0x50(%rsp)
movl 0xc0(%rsp), %esi
movl 0x18(%r12), %edx
movups (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movups 0x2c(%r12), %xmm3
movups %xmm3, 0x2c(%rsp)
movupd %xmm2, 0x20(%rsp)
movupd %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x399f
addl %ebx, %eax
movl %eax, %ebx
fldz
fldt 0x54(%rsp)
fxch %st(1)
fucomi %st(1), %st
seta %bpl
xorl %eax, %eax
cmpl $0x0, 0x4(%r12)
movslq 0x8(%r12), %rdx
cmovneq %rax, %rdx
movl 0x38(%r12), %edi
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
cmovbq %rax, %rdx
leaq 0x149b(%rip), %rsi      # 0x5387
callq 0x1060
movq %rax, %r14
cmpl $0x0, 0x4(%r12)
movl 0x38(%r12), %edi
sete %al
andb %bpl, %al
movzbl %al, %edx
leaq 0x13a1(%rip), %rsi      # 0x52b0
callq 0x1060
fnstcw 0x4e(%rsp)
movzwl 0x4e(%rsp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, 0x62(%rsp)
fldcw 0x62(%rsp)
fldt 0x54(%rsp)
fistpll 0xa8(%rsp)
fldcw 0x4e(%rsp)
movq %rax, %r15
addl %r14d, %r15d
addl %ebx, %r15d
movq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x49d0
movl 0x38(%r12), %esi
movq %rax, %rdi
callq 0x4914
movl %eax, %ebp
addl %r15d, %ebp
movq %rbx, %rdi
callq 0x49d0
movq %rax, 0xb0(%rsp)
fildll 0xb0(%rsp)
fstpt 0x54(%rsp)
movq %rbx, %rdi
callq 0x49d0
movq %rax, 0xb8(%rsp)
fildll 0xb8(%rsp)
fldt 0x54(%rsp)
fsubp %st, %st(1)
movl (%r12), %eax
orl 0x18(%r12), %eax
je 0x3fc9
movl 0x38(%r12), %edi
leaq 0x1131(%rip), %rsi      # 0x50e6
movl $0x1, %edx
fstpt 0x54(%rsp)
callq 0x1060
fldt 0x54(%rsp)
addl %eax, %ebp
fld %st(0)
fchs
fucomi %st(1), %st
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
fstl 0xa0(%rsp)
movsd 0xa0(%rsp), %xmm3
ucomisd 0x13db(%rip), %xmm3     # 0x53c8
movapd %xmm3, %xmm0
jb 0x4011
movsd 0x13d5(%rip), %xmm1     # 0x53d0
movsd 0x13c5(%rip), %xmm2     # 0x53c8
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x4007
fldz
fucompi %st(1), %st
fstpt 0x54(%rsp)
movapd %xmm3, 0x70(%rsp)
jbe 0x4029
xorpd 0x1377(%rip), %xmm0     # 0x53a0
movsd %xmm0, 0x98(%rsp)
fld1
faddl 0x98(%rsp)
movl 0x18(%r12), %edi
movl 0x38(%r12), %esi
fstpt (%rsp)
callq 0x3c45
movl %eax, %r14d
movapd 0x70(%rsp), %xmm2
ucomisd 0x136a(%rip), %xmm2     # 0x53c8
jae 0x4066
fldt 0x54(%rsp)
jmp 0x4084
movsd 0x1362(%rip), %xmm0     # 0x53d0
movsd 0x1352(%rip), %xmm1     # 0x53c8
fldt 0x54(%rsp)
addsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0x407a
fldz
fucompi %st(1), %st
fstp %st(0)
jbe 0x4094
xorpd 0x130c(%rip), %xmm2     # 0x53a0
movsd %xmm2, 0x90(%rsp)
fldl 0x90(%rsp)
movl 0x18(%r12), %eax
fld1
testl %eax, %eax
jle 0x40cd
fstp %st(0)
leal 0x1(%rax), %edx
movl $0x1, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
decl %edx
cmpl $0x1, %edx
jg 0x40b9
movl %ecx, 0x6c(%rsp)
fildl 0x6c(%rsp)
fmulp %st, %st(1)
fld %st(0)
fmuls 0x1301(%rip)            # 0x53d8
fnstcw 0x4c(%rsp)
movzwl 0x4c(%rsp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, 0x60(%rsp)
fldcw 0x60(%rsp)
fistpl 0x68(%rsp)
fldcw 0x4c(%rsp)
addl %ebp, %r14d
movslq 0x68(%rsp), %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x22, %rdx
addl %esi, %edx
addl %edx, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
cmpl $0x5, %ecx
setge %cl
fld1
fadd %st(1), %st
testb %cl, %cl
fxch %st(1)
fcmovne %st(1), %st
fstp %st(1)
testl %eax, %eax
je 0x4175
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jne 0x413c
jnp 0x4175
fnstcw 0x4a(%rsp)
movzwl 0x4a(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x5e(%rsp)
fldcw 0x5e(%rsp)
fistpll 0x88(%rsp)
fldcw 0x4a(%rsp)
movq 0x88(%rsp), %rdi
movl 0x38(%r12), %esi
callq 0x4914
addl %eax, %r14d
jmp 0x4177
fstp %st(0)
cmpl $0x0, 0xc(%r12)
je 0x41c3
movl %ebx, %esi
movl 0x18(%r12), %edx
movupd (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movupd 0x2c(%r12), %xmm3
movupd %xmm3, 0x2c(%rsp)
movupd %xmm2, 0x20(%rsp)
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x399f
addl %eax, %r14d
movl %r14d, %eax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop