// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, 0x8(%rsp)
movl $0x0, 0x40(%rsi)
movsbl (%rdi), %edi
callq 0x3008
testl %eax, %eax
jne 0x2bae
movabsq $0x110000001, %r12      # imm = 0x110000001
leaq 0x8(%rsp), %r14
movabsq $0x400040000000, %r13   # imm = 0x400040000000
leaq 0x3674(%rip), %rbp      # 0x617c
movq 0x8(%rsp), %rax
movb (%rax), %al
movzbl %al, %ecx
leal -0x20(%rcx), %edx
cmpl $0x10, %edx
ja 0x2b31
movslq (%rbp,%rdx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e0f
jmp 0x2b8f
leal -0x4c(%rcx), %edx
cmpl $0x2e, %edx
ja 0x2b76
btq %rdx, %r12
jae 0x2b4c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e47
jmp 0x2b8f
btq %rdx, %r13
jae 0x2b76
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2cf5
jmp 0x2b8f
movq %rbx, %rdi
callq 0x2d4c
jmp 0x2b8f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2da8
jmp 0x2b8f
testl %ecx, %ecx
je 0x2bae
addb $-0x30, %al
cmpb $0x9, %al
ja 0x2cc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d63
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movsbl 0x1(%rax), %edi
callq 0x3008
testl %eax, %eax
je 0x2b08
movq 0x8(%rsp), %r14
movq %r15, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2cf5
movb (%r14), %al
movzbl %al, %ecx
cmpl $0x51, %ecx
jg 0x2be3
testl %ecx, %ecx
je 0x2c1f
cmpl $0x25, %ecx
jne 0x2c38
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2f54
jmp 0x2c29
cmpl $0x52, %ecx
je 0x2bed
cmpl $0x5a, %ecx
jne 0x2c38
movl $0x1, %esi
movq %r14, %rdi
callq 0x59b4
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movl $0x1, 0x34(%rbx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x360a
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x1d7c
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 0x2c5b
cmpl $0x25, %ecx
je 0x2c5b
movq %r14, %rdi
movl $0x25, %esi
callq 0x5914
testq %rax, %rax
jne 0x2c1f
movb (%r14), %al
movsbl %al, %edi
callq 0x3008
testl %eax, %eax
jne 0x2c1f
movzbl (%r14), %eax
testl %eax, %eax
je 0x2c1f
cmpl $0x25, %eax
je 0x2c1f
movq %rbx, %rdi
callq 0x1d7c
movq %r14, %rdi
movl $0x25, %esi
callq 0x59f4
movq %rax, (%rbx)
movq %r14, %rdi
movl $0x25, %esi
callq 0x5914
testq %rax, %rax
jne 0x2c1f
cmpb $0x0, (%r14)
je 0x2c1f
decq %r14
movq %r14, %rax
leaq 0x1(%rax), %r14
cmpb $0x0, 0x2(%rax)
movq %r14, %rax
jne 0x2cae
jmp 0x2c1f
movq %rbx, %rdi
callq 0x2f05
testl %eax, %eax
jne 0x2bae
cmpl $0x0, 0x30(%rbx)
je 0x2bae
movq 0x8(%rsp), %rdi
cmpb $0x25, (%rdi)
je 0x2bae
movq %rbx, %rsi
callq 0x2eae
jmp 0x2c29