// File: /workspace/github_c_makefile_star2_O1/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 0x2ffc
testl %eax, %eax
jne 0x2b9a
movabsq $0x110000001, %r12      # imm = 0x110000001
leaq 0x8(%rsp), %r14
movabsq $0x400040000000, %r13   # imm = 0x400040000000
leaq 0x3688(%rip), %rbp      # 0x617c
movq 0x8(%rsp), %rax
movb (%rax), %al
movzbl %al, %ecx
leal -0x20(%rcx), %edx
cmpl $0x10, %edx
ja 0x2b1d
movslq (%rbp,%rdx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e09
jmp 0x2b7b
leal -0x4c(%rcx), %edx
cmpl $0x2e, %edx
ja 0x2b62
btq %rdx, %r12
jae 0x2b38
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e41
jmp 0x2b7b
btq %rdx, %r13
jae 0x2b62
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2cdd
jmp 0x2b7b
movq %rbx, %rdi
callq 0x2d34
jmp 0x2b7b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d99
jmp 0x2b7b
testl %ecx, %ecx
je 0x2b9a
addb $-0x30, %al
cmpb $0x9, %al
ja 0x2ca8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d4b
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movsbl 0x1(%rax), %edi
callq 0x2ffc
testl %eax, %eax
je 0x2af4
movq 0x8(%rsp), %r14
movq %r15, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2cdd
movzbl (%r14), %eax
cmpl $0x51, %eax
jg 0x2bcd
testl %eax, %eax
je 0x2c09
cmpl $0x25, %eax
jne 0x2c22
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2f4c
jmp 0x2c13
cmpl $0x52, %eax
je 0x2bd7
cmpl $0x5a, %eax
jne 0x2c22
movl $0x1, %esi
movq %r14, %rdi
callq 0x5464
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movl $0x1, 0x34(%rbx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x35ea
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x1d5c
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), %eax
testl %eax, %eax
je 0x2c42
cmpl $0x25, %eax
je 0x2c42
movq %r14, %rdi
movl $0x25, %esi
callq 0x53bc
testq %rax, %rax
jne 0x2c09
movsbl (%r14), %edi
callq 0x2ffc
testl %eax, %eax
jne 0x2c09
movzbl (%r14), %eax
testl %eax, %eax
je 0x2c09
cmpl $0x25, %eax
je 0x2c09
movq %rbx, %rdi
callq 0x1d5c
movq %r14, %rdi
movl $0x25, %esi
callq 0x54a8
movq %rax, (%rbx)
movq %r14, %rdi
movl $0x25, %esi
callq 0x53bc
testq %rax, %rax
jne 0x2c09
cmpb $0x0, (%r14)
je 0x2c09
decq %r14
movq %r14, %rax
leaq 0x1(%rax), %r14
cmpb $0x0, 0x2(%rax)
movq %r14, %rax
jne 0x2c96
jmp 0x2c09
movq %rbx, %rdi
callq 0x2efd
testl %eax, %eax
jne 0x2b9a
cmpl $0x0, 0x30(%rbx)
je 0x2b9a
movq 0x8(%rsp), %rdi
cmpb $0x25, (%rdi)
je 0x2b9a
movq %rbx, %rsi
callq 0x2ea6
jmp 0x2c13