// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq -0x24(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0xb290
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movl -0x1c(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
subl (%rax), %edx
addl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x31(%rbp)
jne 0xb0fb
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x30(%rbp), %ecx
movb %al, -0x31(%rbp)
jle 0xb0fb
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x20(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0xb104
jmp 0xb114
movl -0x24(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
jmp 0xb0bc
jmp 0xb116
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movl -0x1c(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
subl 0x4(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x32(%rbp)
jne 0xb195
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x32(%rbp)
jle 0xb195
movl -0x30(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x32(%rbp)
jne 0xb195
movl -0x30(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl %ecx, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x32(%rbp)
je 0xb195
movl -0x20(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x32(%rbp)
je 0xb195
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x2c(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0xb19e
jmp 0xb1b1
movl -0x24(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
jmp 0xb116
jmp 0xb1b3
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x20(%rbp)
cmpl $0x0, %eax
je 0xb27d
movl -0x30(%rbp), %eax
cltd
idivl -0x24(%rbp)
addl $0x30, %eax
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %cl
movq -0x18(%rbp), %rdx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rdx
movq (%rdx), %rdx
subl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jne 0xb21f
movl -0x20(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0xb21f
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movb $0x2e, (%rax)
jmp 0xb25e
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rdx
movq (%rdx), %rdx
subl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jge 0xb25c
cmpl $0x6, -0x20(%rbp)
je 0xb248
cmpl $0x3, -0x20(%rbp)
je 0xb248
cmpl $0x0, -0x20(%rbp)
jne 0xb25c
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movb $0x2c, (%rax)
jmp 0xb25e
movl -0x24(%rbp), %ecx
movl -0x30(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
movl -0x24(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
jmp 0xb1b3
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nop