// File: /workspace/github_c_makefile_star2_O2/ffoissey[P]push_swap_42/libft/srcs/ft_printf/ft_set_flags.c
// Function: ft_set_all_flags
char			*ft_set_all_flags(char *s, t_flag *flag)
{
	char	*tmp;

	tmp = s;
	flag->percent = 0;
	while (!ft_ok_conv(*s) && *s != '%' && *s)
	{
		if (*s == '#' || *s == '0' || *s == '-' || *s == '+' || *s == ' ')
			ft_set_attribute_flags(&s, flag);
		else if (*s == 'l' || *s == 'L' || *s == 'h')
			ft_set_length_flags(&s, flag);
		else if (*s == 'j' || *s == 'z')
			ft_prio(flag, *s);
		else if (*s == '*')
			ft_set_wildcard(flag);
		else if (*s == '.')
			ft_set_precision(&s, flag);
		else if (*s >= '0' && *s <= '9')
			ft_set_min_field_size(&s, flag);
		else if (!ft_check_flag(flag) && flag->space && *s != '%')
			return (ft_bad_flag(s, flag));
		else
			break ;
		s++;
	}
	return (ft_set_flag_extend(s, flag, tmp));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r14
movq %rdi, (%r14)
andl $0x0, 0x40(%rsi)
movabsq $0x110000001, %r12      # imm = 0x110000001
movabsq $0x400040000000, %r13   # imm = 0x400040000000
leaq 0x3855(%rip), %rbp      # 0x617c
movq %rdi, %rax
movsbl (%rax), %edi
callq 0x2de4
testl %eax, %eax
jne 0x29df
movq 0x8(%rsp), %rax
movb (%rax), %al
movzbl %al, %ecx
leal -0x20(%rcx), %edx
cmpl $0x10, %edx
ja 0x2963
movslq (%rbp,%rdx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c03
jmp 0x29bd
leal -0x4c(%rcx), %edx
cmpl $0x2e, %edx
ja 0x29a8
btq %rdx, %r12
jae 0x297e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c36
jmp 0x29bd
btq %rdx, %r13
jae 0x29a8
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2b04
jmp 0x29bd
movq %rbx, %rdi
callq 0x2b50
jmp 0x29bd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ba4
jmp 0x29bd
testl %ecx, %ecx
je 0x29df
addb $-0x30, %al
cmpb $0x9, %al
ja 0x29cf
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b64
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
jmp 0x292a
movq %rbx, %rdi
callq 0x2ce6
testl %eax, %eax
je 0x2adf
movq 0x8(%rsp), %r14
movq %r15, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2b04
movzbl (%r14), %eax
testl %eax, %eax
je 0x2a47
cmpl $0x5a, %eax
je 0x2a17
cmpl $0x52, %eax
je 0x2a17
cmpl $0x25, %eax
jne 0x2a60
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d35
jmp 0x2a51
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x50b0
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movl $0x1, 0x34(%rbx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3396
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x1c38
xorl %eax, %eax
cmpb $0x0, (%r14)
cmovneq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x1(%r14), %ecx
testl %ecx, %ecx
je 0x2a81
cmpl $0x25, %ecx
je 0x2a81
pushq $0x25
popq %rsi
movq %r14, %rdi
callq 0x503c
testq %rax, %rax
jne 0x2a47
movb (%r14), %al
movsbl %al, %edi
callq 0x2de4
testl %eax, %eax
jne 0x2a47
movzbl (%r14), %eax
testl %eax, %eax
je 0x2a47
cmpl $0x25, %eax
je 0x2a47
movq %rbx, %rdi
callq 0x1c38
pushq $0x25
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x50f0
movq %rax, (%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x503c
testq %rax, %rax
jne 0x2a47
cmpb $0x0, (%r14)
je 0x2a47
decq %r14
movq %r14, %rax
leaq 0x1(%rax), %r14
cmpb $0x0, 0x2(%rax)
movq %r14, %rax
jne 0x2acd
jmp 0x2a47
cmpl $0x0, 0x30(%rbx)
je 0x29df
movq 0x8(%rsp), %rdi
cmpb $0x25, (%rdi)
je 0x29df
movq %rbx, %rsi
callq 0x2c97
jmp 0x2a51