// File: /workspace/github_c_makefile_star2_O3/AugustinLopez[P]Fancy_Ft_Malloc/minilibft/printf/ftoa/f_putnbr.c
// Function: ft_putnbr_pos_addentum2
void		ft_putnbr_pos_addentum2(int **stack, int *i, char **tmp, int dbl_t)
{
	int				len;
	int				buf;
	char			c;
	int				dot;
	int				n;

	initialize_addentum2(&buf, &len, &dot);
	n = (*stack)[*i];
	while (*i == dbl_t - (*stack)[0] + 1 && buf > n && len--)
		buf /= 10;
	while (*i == dbl_t - (*stack)[1]
			&& dot > 0 && n % 10 == 0 && (n /= 10) && len-- && dot--)
		buf /= 10;
	while (len--)
	{
		c = n / buf + '0';
		((*tmp)++)[0] = c;
		if (*i == dbl_t - (*stack)[1] && len == dot)
			((*tmp)++)[0] = '.';
		else if (*i < dbl_t - (*stack)[1] && (len == 6 || len == 3 || len == 0))
			((*tmp)++)[0] = ',';
		n %= buf;
		buf /= 10;
	}
	(*i)++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r8
movq (%rdi), %r10
movslq (%rsi), %rdx
movl %ecx, %r9d
subl (%r10), %r9d
movl (%r10,%rdx,4), %eax
incl %r9d
cmpl %r9d, %edx
sete %r9b
cmpl $0x5f5e100, %eax        # imm = 0x5F5E100
setl %r11b
andb %r9b, %r11b
cmpb $0x1, %r11b
jne 0x7c16
movl $0x9, %r11d
movl $0x5f5e100, %r9d        # imm = 0x5F5E100
subl $0x1, %r11d
jb 0x7c24
movslq %r9d, %r9
imulq $0x66666667, %r9, %r9   # imm = 0x66666667
movq %r9, %rbx
shrq $0x3f, %rbx
sarq $0x22, %r9
addl %ebx, %r9d
cmpl %eax, %r9d
jg 0x7bf1
jmp 0x7c2a
movl $0x9, %r11d
movl $0x5f5e100, %r9d        # imm = 0x5F5E100
jmp 0x7c2a
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl %ecx, %ebx
subl 0x4(%r10), %ebx
movl $0x6, %r14d
cmpl %ebx, %edx
jne 0x7cf0
movslq %eax, %r10
imulq $0x66666667, %r10, %r10 # imm = 0x66666667
movq %r10, %rbx
shrq $0x3f, %rbx
sarq $0x22, %r10
addl %ebx, %r10d
addl %r10d, %r10d
leal (%r10,%r10,4), %r10d
movl %eax, %ebx
subl %r10d, %ebx
jne 0x7cf0
movl $0x6, %r10d
subl %r11d, %r10d
xorl %r15d, %r15d
leal 0x6(%r15), %r14d
leal (%r11,%r15), %ebx
leal 0x9(%rax), %r12d
cmpl $0x13, %r12d
jb 0x7cf5
cltq
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %r12
shrq $0x3f, %r12
sarq $0x22, %rax
addl %r12d, %eax
testl %ebx, %ebx
je 0x7d00
movslq %r9d, %r9
imulq $0x66666667, %r9, %r9   # imm = 0x66666667
movq %r9, %rbx
shrq $0x3f, %rbx
sarq $0x22, %r9
addl %ebx, %r9d
decl %r15d
cmpl $0x2, %r14d
jb 0x7ce6
movslq %eax, %rbx
imulq $0x66666667, %rbx, %r14 # imm = 0x66666667
movq %r14, %r12
shrq $0x3f, %r12
sarq $0x22, %r14
addl %r12d, %r14d
addl %r14d, %r14d
leal (%r14,%r14,4), %r14d
subl %r14d, %ebx
je 0x7c74
addl %r15d, %r11d
addl $0x6, %r15d
movl %r15d, %r14d
movl %r11d, %ebx
jmp 0x7cf7
xorl %eax, %eax
movl %r14d, %r10d
testl %ebx, %ebx
jne 0x7d05
jmp 0x7d7b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
incl %r10d
movl $0x92, %r11d
cltd
idivl %r9d
addb $0x30, %al
movq (%r8), %r14
leaq 0x1(%r14), %r15
movq %r15, (%r8)
movb %al, (%r14)
movl (%rsi), %r14d
movq (%rdi), %rax
movl %ecx, %r15d
subl 0x4(%rax), %r15d
movl %edx, %eax
cmpl %r15d, %r14d
jne 0x7d3c
movb $0x2e, %dl
cmpl %ebx, %r10d
je 0x7d4e
cmpl %r15d, %r14d
jge 0x7d5b
cmpl $0x7, %ebx
ja 0x7d5b
movb $0x2c, %dl
btl %ebx, %r11d
jae 0x7d5b
movq (%r8), %r14
leaq 0x1(%r14), %r15
movq %r15, (%r8)
movb %dl, (%r14)
decl %ebx
movslq %r9d, %rdx
imulq $0x66666667, %rdx, %r9  # imm = 0x66666667
movq %r9, %rdx
shrq $0x3f, %rdx
sarq $0x22, %r9
addl %edx, %r9d
testl %ebx, %ebx
jne 0x7d0e
movl (%rsi), %edx
incl %edx
movl %edx, (%rsi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq