// File: /workspace/github_c_makefile_star2_O2/ffoissey[P]push_swap_42/srcs_push_swap/ft_algo.c
// Function: ft_process_sort
int			ft_process_sort(t_stack *s)
{
	int		ret_a;
	int		ret_b;

	if (s->size_a < 4)
		ft_three_a(s);
	while (!ft_reposition(s, &ret_a, &ret_b, 1))
	{
		ft_divide_b_stack(s, &ret_a, &ret_b);
		ft_reposition(s, &ret_a, &ret_b, 0);
		ft_divide_a_stack(s, &ret_a, &ret_b);
		ft_process_sort(s);
	}
	while (s->size_b)
		ft_cmd(ft_exec_push, s, "pa");
	ft_reposition(s, &ret_a, &ret_b, 1);
	return (TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x3, 0x20(%rdi)
ja 0x1765
movq %rbx, %rdi
callq 0x2473
leaq 0x4(%rsp), %r14
movq %rsp, %r15
leaq 0x1212(%rip), %r12      # 0x2986
leaq 0x289e(%rip), %r13      # 0x4019
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x1
popq %rcx
callq 0x1efc
testl %eax, %eax
jne 0x1a03
cmpq $0x3, 0x28(%rbx)
ja 0x17a3
movq %rbx, %rdi
callq 0x25b7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x1efc
movq 0x28(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x18aa
cmpl $0x0, (%rsp)
jne 0x18aa
movq 0x8(%rbx), %rdi
callq 0x2028
movslq %eax, %rbp
movq 0x28(%rbx), %rsi
cmpq $0x3, %rsi
jbe 0x1894
movq 0x8(%rbx), %rdi
movq %rbp, %rdx
pushq $0x1
popq %rcx
callq 0x2448
testl %eax, %eax
je 0x1894
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
pushq $0x1
popq %rdx
callq 0x1dac
testl %eax, %eax
jne 0x1894
movq 0x8(%rbx), %rax
movq 0x28(%rbx), %rcx
cmpq %rbp, -0x8(%rax,%rcx,8)
jge 0x185a
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2158
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x1870
movq (%rbx), %rdi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x1fe8
testl %eax, %eax
je 0x1870
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x27bd(%rip), %rdx      # 0x4015
jmp 0x186b
leaq 0x1090(%rip), %rdi      # 0x28f1
movq %rbx, %rsi
leaq 0x27bd(%rip), %rdx      # 0x4028
callq 0x2158
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x1
popq %rcx
callq 0x1efc
jmp 0x17d7
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2158
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x1fe8
testl %eax, %eax
je 0x1886
xorl %ecx, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1efc
cmpq $0x3, 0x20(%rbx)
ja 0x18c9
movq %rbx, %rdi
callq 0x2473
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x1efc
movq 0x20(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x19f6
cmpl $0x0, 0x4(%rsp)
jne 0x19f6
movq (%rbx), %rdi
callq 0x2096
movslq %eax, %rbp
movq 0x20(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x19ee
movq (%rbx), %rdi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x2448
testl %eax, %eax
je 0x19ee
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
xorl %edx, %edx
callq 0x1dac
testl %eax, %eax
jne 0x19ee
movq (%rbx), %rcx
movq 0x20(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rax
cmpq %rbp, %rax
jge 0x1977
cmpq -0x10(%rcx,%rdx,8), %rax
jle 0x1977
leaq 0xefb(%rip), %rdi       # 0x2850
movq %rbx, %rsi
leaq 0x26ab(%rip), %rdx      # 0x400a
callq 0x2158
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x1
popq %rcx
callq 0x1efc
jmp 0x18fd
cmpq %rbp, %rax
jge 0x19b3
leaq 0xf6e(%rip), %rdi       # 0x28f1
movq %rbx, %rsi
leaq 0x269e(%rip), %rdx      # 0x402b
callq 0x2158
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x1fe8
testl %eax, %eax
jne 0x1964
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
jmp 0x198d
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x2655(%rip), %rdx      # 0x4015
callq 0x2158
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x1964
movq 0x8(%rbx), %rdi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x2008
testl %eax, %eax
je 0x1964
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
jmp 0x195f
pushq $0x1
popq %rcx
jmp 0x18ac
movq %rbx, %rdi
callq 0x1748
jmp 0x177b
leaq 0xee7(%rip), %r14       # 0x28f1
leaq 0x2617(%rip), %r15      # 0x4028
cmpq $0x0, 0x28(%rbx)
je 0x1a28
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2158
jmp 0x1a11
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x1efc
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop