// File: /workspace/github_c_makefile_star2_O1/rpeepz[P]ft_ssl/libft/srcs/ft_sprintf/x_to_buf.c
// Function: x_to_buf
int				x_to_buf(char *buf, t_mod modifiers, va_list ap, int i)
{
	int64_t	num;
	char	*str;
	int		len;

	len = -1;
	num = convert_length(modifiers.length, ap);
	if (modifiers.length == 'l' || modifiers.length / 2 == 'l' ||
		modifiers.length == 'z')
		str = num_string_u_base(num, 16);
	else
		str = ft_uitoa_base(num, 16);
	if (i == 8)
		while (str[++len])
			str[len] = ft_tolower(str[len]);
	str[0] == '0' && modifiers.prcsn == 0 ? str[0] = '\0' : 0;
	if (modifiers.fl.minus == 1)
		left_justify(buf, str, modifiers, i);
	else
		right_justify(buf, str, modifiers, i);
	free(str);
	return (ft_strlen(buf));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movl 0xac(%rsp), %eax
cmpl $0x68, %eax
jne 0xac2d
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0xac50
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0xac5c
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0xd0, %ecx
jne 0xac62
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0xac91
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0xac9d
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
movswq (%rcx), %rdi
jmp 0xacb2
leal -0xd8(%rax), %ecx
cmpl $0x2, %ecx
jb 0xac7b
cmpl $0x7a, %eax
je 0xac7b
cmpl $0x6c, %eax
jne 0xaf7e
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0xaca3
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0xacaf
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
movsbq (%rcx), %rdi
jmp 0xacb2
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
movq (%rcx), %rdi
leal -0xd8(%rax), %ecx
cmpl $0x2, %ecx
jb 0xaccb
cmpl $0x7a, %eax
je 0xaccb
cmpl $0x6c, %eax
jne 0xaedd
movl $0x10, %esi
callq 0x7f7e
movq %rax, %r14
leaq 0x90(%rsp), %r15
movl %ebp, 0x2c(%rsp)
cmpl $0x8, %ebp
jne 0xad0b
movb (%r14), %al
testb %al, %al
je 0xad0b
leaq 0x1(%r14), %r13
movsbl %al, %edi
callq 0x6b38
movb %al, -0x1(%r13)
movb (%r13), %al
incq %r13
testb %al, %al
jne 0xacf4
cmpb $0x30, (%r14)
sete %al
movl 0x18(%r15), %ebp
testl %ebp, %ebp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xad26
movb $0x0, (%r14)
cmpl $0x1, 0x8(%r15)
jne 0xae00
movl 0x14(%r15), %r13d
movl 0x4(%r15), %r12d
movq %rbx, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
movq %r14, %rdi
callq 0x7952
movq %rax, %r15
testl %r12d, %r12d
je 0xad8f
movzbl (%r14), %eax
testl %eax, %eax
je 0xad8f
cmpl $0x30, %eax
je 0xad8f
cmpl $0x8, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x2be7(%rip), %rax      # 0xd95b
leaq 0x2bee(%rip), %rsi      # 0xd969
cmoveq %rax, %rsi
callq 0x76fc
addq $0x2, 0x30(%rsp)
addl $0x2, 0x28(%rsp)
cmpl %r15d, %ebp
jle 0xadb8
leaq 0x2021(%rip), %r12      # 0xcdbc
decl %ebp
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x76fc
incq 0x30(%rsp)
incl 0x28(%rsp)
cmpl %r15d, %ebp
jg 0xad9b
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r14, %rsi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xa08a
cmpl %r13d, (%r12)
jge 0xaebe
leaq 0x30(%rsp), %r15
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq 0xa05c
cmpl %r13d, 0x28(%rsp)
jl 0xade4
jmp 0xaebe
movl 0x20(%r15), %eax
movl %eax, 0x50(%rsp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r14, %rdi
callq 0x7952
movq %rax, %r15
cmpl $0x0, 0x34(%rsp)
je 0xae3e
movzbl (%r14), %eax
testl %eax, %eax
je 0xae3e
cmpl $0x30, %eax
jne 0xaeec
movq %rbx, %rdi
callq 0x7952
leaq (%rax,%rbx), %rdi
movl 0x50(%rsp), %eax
movl %eax, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %r15d, %esi
callq 0xafa8
movl 0x48(%rsp), %eax
cmpl %r15d, %eax
jle 0xaea7
decl %eax
movl %eax, 0x48(%rsp)
leaq 0x1f39(%rip), %r12      # 0xcdbc
movq %rbx, %rdi
callq 0x7952
leaq (%rax,%rbx), %rdi
movq %r12, %rsi
callq 0x76fc
movl 0x48(%rsp), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x48(%rsp)
cmpl %r15d, %eax
jg 0xae83
movq %rbx, %rdi
callq 0x7952
leaq (%rax,%rbx), %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x7718
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x7952
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %esi
callq 0xb093
jmp 0xacd5
cmpl $0x0, 0x40(%rsp)
movl 0x2c(%rsp), %ebp
je 0xaf1b
cmpl $-0x1, 0x48(%rsp)
jne 0xaf1b
cmpl $0x8, %ebp
leaq 0x2a53(%rip), %rax      # 0xd95b
leaq 0x2a5a(%rip), %rsi      # 0xd969
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x76fc
movq %rbx, %rdi
callq 0x7952
leaq (%rax,%rbx), %rdi
movl 0x50(%rsp), %eax
movl %eax, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %r15d, %esi
callq 0xafa8
cmpl $0x0, 0x40(%rsp)
je 0xaf5c
cmpl $0x0, 0x48(%rsp)
js 0xae6d
cmpl $0x8, %ebp
leaq 0x29f5(%rip), %rax      # 0xd95b
leaq 0x29fc(%rip), %rsi      # 0xd969
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x76fc
jmp 0xae6d
movl (%rsi), %edx
cmpq $0x28, %rdx
ja 0xaf94
movq %rdx, %rcx
addq 0x10(%rsi), %rcx
addl $0x8, %edx
movl %edx, (%rsi)
jmp 0xafa0
movq 0x8(%rsi), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
movslq (%rcx), %rdi
jmp 0xacb2