// File: /workspace/github_c_makefile_star2_O0/AugustinLopez[P]Fancy_Ft_Malloc/minilibft/printf/pf_number.c
// Function: pf_itoa_base
void				pf_itoa_base(uintmax_t n, int b, t_printf *pf)
{
	char		s[70];
	uintmax_t	tmp;

	tmp = n;
	while ((tmp /= b))
		++pf->printed;
	if (pf->flag & F_QUOTE)
		pf->printed += pf->printed > 3 ? (pf->printed - 1) / 3 : 0;
	(!n && (pf->flag & F_DOT) && !(pf->precision)) ? pf->printed = 0 : 0;
	tmp = (b == 8 && !(pf->printed)) ? 1 : 0;
	(tmp && pf->flag & F_SHARP) ? pf->length-- : 0;
	pf->precision < pf->printed ? pf->precision = pf->printed : 0;
	pf->padding = pf->length - pf->precision;
	!(pf->flag & F_ZERO) ? pf_padding(pf, 0) : 0;
	if ((n || tmp || (char)pf->flag == 'P' || (char)pf->flag == 'p')
	&& (pf->flag & F_SHARP))
	{
		pf_buffer_write(pf, "0", 1);
		if (b == 2)
			pf_buffer_write(pf, (char)pf->flag == 'B' ? "B" : "b", 1);
		else if (b == 16)
			pf_buffer_write(pf, "x", 1);
	}
	finish_printf(n, b, s, pf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movslq -0xc(%rbp), %rcx
movq -0x68(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0x72e1
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0x72bb
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
andl $0x8000000, %eax        # imm = 0x8000000
cmpl $0x0, %eax
je 0x732a
movq -0x18(%rbp), %rax
cmpl $0x3, 0x18(%rax)
jle 0x7316
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
subl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0x6c(%rbp)
jmp 0x731d
xorl %eax, %eax
movl %eax, -0x6c(%rbp)
jmp 0x731d
movl -0x6c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x18(%rax), %ecx
movl %ecx, 0x18(%rax)
cmpq $0x0, -0x8(%rbp)
jne 0x735c
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
andl $0x200000, %eax         # imm = 0x200000
cmpl $0x0, %eax
je 0x735c
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x735c
movq -0x18(%rbp), %rax
movl $0x0, 0x18(%rax)
jmp 0x735e
jmp 0x735e
xorl %eax, %eax
cmpl $0x8, -0xc(%rbp)
movb %al, -0x6d(%rbp)
jne 0x7379
movq -0x18(%rbp), %rax
cmpl $0x0, 0x18(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x73b9
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
andl $0x4000000, %eax        # imm = 0x4000000
cmpl $0x0, %eax
je 0x73b9
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x73bb
jmp 0x73bb
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x73db
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x73dd
jmp 0x73dd
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
jne 0x7413
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x3430
jmp 0x7415
jmp 0x7415
cmpq $0x0, -0x8(%rbp)
jne 0x744b
cmpq $0x0, -0x68(%rbp)
jne 0x744b
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
movsbl %al, %eax
cmpl $0x50, %eax
je 0x744b
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
movsbl %al, %eax
cmpl $0x70, %eax
jne 0x74cb
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
andl $0x4000000, %eax        # imm = 0x4000000
cmpl $0x0, %eax
je 0x74cb
movq -0x18(%rbp), %rdi
leaq 0x4ef8(%rip), %rsi      # 0xc362
movl $0x1, %edx
callq 0x3500
cmpl $0x2, -0xc(%rbp)
jne 0x74ac
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %eax
movsbl %al, %ecx
leaq 0x4ea0(%rip), %rsi      # 0xc332
leaq 0x4eb0(%rip), %rax      # 0xc349
cmpl $0x42, %ecx
cmoveq %rax, %rsi
movl $0x1, %edx
callq 0x3500
jmp 0x74c9
cmpl $0x10, -0xc(%rbp)
jne 0x74c7
movq -0x18(%rbp), %rdi
leaq 0x4e77(%rip), %rsi      # 0xc334
movl $0x1, %edx
callq 0x3500
jmp 0x74c9
jmp 0x74cb
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x74f0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)