// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
movq %rdx, %r8
movq (%rdi), %r10
movslq (%rsi), %rdx
movl %ecx, %r11d
subl (%r10), %r11d
movl (%r10,%rdx,4), %eax
incl %r11d
cmpl %r11d, %edx
sete %r9b
cmpl $0x5f5e100, %eax        # imm = 0x5F5E100
setl %bl
andb %r9b, %bl
cmpb $0x1, %bl
jne 0x7c96
movl $0x9, %ebx
movl $0x5f5e100, %r9d        # imm = 0x5F5E100
subl $0x1, %ebx
jb 0x7ca3
movslq %r9d, %r9
imulq $0x66666667, %r9, %r9   # imm = 0x66666667
movq %r9, %r14
shrq $0x3f, %r14
sarq $0x22, %r9
addl %r14d, %r9d
cmpl %r11d, %edx
jne 0x7ca8
cmpl %eax, %r9d
jg 0x7c6d
jmp 0x7ca8
movl $0x9, %ebx
movl $0x5f5e100, %r9d        # imm = 0x5F5E100
jmp 0x7ca8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ecx, %r11d
subl 0x4(%r10), %r11d
movl $0x6, %r10d
movl %r11d, -0x2c(%rbp)
cmpl %r11d, %edx
jne 0x7d7a
movslq %eax, %r11
imulq $0x66666667, %r11, %r11 # imm = 0x66666667
movq %r11, %r15
shrq $0x3f, %r15
sarq $0x22, %r11
addl %r15d, %r11d
addl %r11d, %r11d
leal (%r11,%r11,4), %r11d
movl %eax, %r15d
subl %r11d, %r15d
jne 0x7d7a
subl %ebx, %r10d
xorl %r15d, %r15d
movl %ebx, %r11d
leal 0x6(%r15), %r12d
leal (%rbx,%r15), %r13d
leal 0x9(%rax), %r14d
cmpl $0x13, %r14d
jb 0x7d7f
cltq
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %r14
shrq $0x3f, %r14
sarq $0x22, %rax
addl %r14d, %eax
testl %r13d, %r13d
je 0x7d89
decl %r11d
movslq %r9d, %r9
imulq $0x66666667, %r9, %r9   # imm = 0x66666667
movq %r9, %r14
shrq $0x3f, %r14
sarq $0x22, %r9
addl %r14d, %r9d
decl %r15d
cmpl -0x2c(%rbp), %edx
jne 0x7d71
cmpl $0x2, %r12d
jb 0x7d71
movslq %eax, %r14
imulq $0x66666667, %r14, %r12 # imm = 0x66666667
movq %r12, %r13
shrq $0x3f, %r13
sarq $0x22, %r12
addl %r13d, %r12d
addl %r12d, %r12d
leal (%r12,%r12,4), %r12d
subl %r12d, %r14d
je 0x7cf6
addl $0x6, %r15d
movl %r15d, %r10d
jmp 0x7d8f
movl %ebx, %r11d
jmp 0x7d8f
xorl %eax, %eax
movl %r12d, %r10d
movl %r13d, %r11d
jmp 0x7d8f
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
testl %r11d, %r11d
je 0x7e0a
incl %r10d
movl $0x92, %ebx
cltd
idivl %r9d
addb $0x30, %al
movq (%r8), %r15
leaq 0x1(%r15), %r14
movq %r14, (%r8)
movb %al, (%r15)
movl (%rsi), %r14d
movq (%rdi), %rax
movl %ecx, %r15d
subl 0x4(%rax), %r15d
movl %edx, %eax
cmpl %r15d, %r14d
jne 0x7dca
movb $0x2e, %dl
cmpl %r11d, %r10d
je 0x7ddd
cmpl %r15d, %r14d
jge 0x7dea
cmpl $0x7, %r11d
ja 0x7dea
movb $0x2c, %dl
btl %r11d, %ebx
jae 0x7dea
movq (%r8), %r15
leaq 0x1(%r15), %r14
movq %r14, (%r8)
movb %dl, (%r15)
decl %r11d
movslq %r9d, %rdx
imulq $0x66666667, %rdx, %r9  # imm = 0x66666667
movq %r9, %rdx
shrq $0x3f, %rdx
sarq $0x22, %r9
addl %edx, %r9d
testl %r11d, %r11d
jne 0x7d9c
incl (%rsi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq