// File: /workspace/github_c_makefile_star2_O0/ffoissey[P]push_swap_42/libft/srcs/ft_printf/ft_conversion_u.c
// Function: ft_binary_format
static char						*ft_binary_format(char *s)
{
	char	*new;
	int		i;
	int		j;
	int		count;

	i = -1;
	count = 0;
	while (s[++i])
		if (s[i] == '0' || s[i] == '1')
			count++;
	count = !(count % 8) && count ? count / 8 - 1 : count / 8;
	new = ft_strnew(ft_strlen(s) + count);
	j = ft_strlen(s) - 1;
	i = ft_strlen(s) + count - 1;
	count = 0;
	while (j >= 0 && s[j] != '0' && s[j] != '1')
		new[i--] = s[j--];
	while (j >= 0 && i >= 0)
	{
		if (!(count++ % 8) && count != 1 && (s[j] == '0' || s[j] == '1'))
			new[i--] = ' ';
		new[i--] = s[j--];
	}
	ft_strdel(&s);
	return (new);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movslq %ecx, %rcx
cmpb $0x0, (%rax,%rcx)
je 0x5e2d
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
je 0x5e22
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x5e2b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5dea
movl -0x1c(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5e56
cmpl $0x0, -0x1c(%rbp)
je 0x5e56
movl -0x1c(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
subl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x5e64
movl -0x1c(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9320
movq %rax, %rdi
movslq -0x1c(%rbp), %rax
addq %rax, %rdi
callq 0x9440
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9320
subq $0x1, %rax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9320
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
subq $0x1, %rax
movl %eax, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x21(%rbp)
jl 0x5eea
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x21(%rbp)
je 0x5eea
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x5ef3
jmp 0x5f1f
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x5eb4
jmp 0x5f21
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x22(%rbp)
jl 0x5f36
cmpl $0x0, -0x14(%rbp)
setge %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x5f42
jmp 0x5fc7
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x1c(%rbp)
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5f98
cmpl $0x1, -0x1c(%rbp)
je 0x5f98
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
je 0x5f82
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x5f98
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x14(%rbp)
movslq %ecx, %rcx
movb $0x20, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x5f21
leaq -0x8(%rbp), %rdi
callq 0x25e0
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)