// File: /workspace/github_c_makefile_star2_O1/ffoissey[P]push_swap_42/srcs_push_swap/ft_algo500.c
// Function: ft_process_sort500
int			ft_process_sort500(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_stack500(s, &ret_a, &ret_b);
		ft_reposition(s, &ret_a, &ret_b, 0);
		ft_divide_a_stack500(s, &ret_a, &ret_b);
		ft_process_sort500(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 0x1b95
movq %rbx, %rdi
callq 0x26d4
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x20e2
testl %eax, %eax
jne 0x1d80
leaq 0x4(%rsp), %r14
movq %rsp, %r15
leaq 0xf13(%rip), %r12       # 0x2ad4
leaq 0x2445(%rip), %r13      # 0x400d
cmpq $0x3, 0x28(%rbx)
ja 0x1bd7
movq %rbx, %rdi
callq 0x2818
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x20e2
movq 0x28(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x1d3f
cmpl $0x0, (%rsp)
jne 0x1d3f
movq 0x8(%rbx), %rax
movq -0x10(%rax,%rsi,8), %rcx
movq -0x8(%rax,%rsi,8), %rbp
cmpq %rcx, %rbp
jge 0x1c37
cmpq $0x2, %rsi
jne 0x1c1d
movq %rcx, %rbp
jmp 0x1c37
leaq -0x2(%rsi), %rdx
movq %rcx, %rbp
movq -0x8(%rax,%rdx,8), %rcx
cmpq %rcx, (%rax,%rdx,8)
jge 0x1c37
movq %rcx, %rbp
decq %rdx
jne 0x1c21
cmpq $0x4, %rsi
jb 0x1d3f
movq 0x8(%rbx), %rdi
movq %rbp, %rdx
movl $0x1, %ecx
callq 0x26a8
testl %eax, %eax
je 0x1d3f
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
movl $0x1, %edx
callq 0x1f60
testl %eax, %eax
jne 0x1d3f
movq 0x20(%rbx), %rax
cmpq $0x2, %rax
jb 0x1c9c
movq (%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdx
cmpq -0x10(%rcx,%rax,8), %rdx
jle 0x1c9c
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x2370(%rip), %rdx      # 0x400a
jmp 0x1d19
movq 0x8(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rax
cmpq %rbp, %rax
jl 0x1cc0
cmpq -0x10(%rcx,%rdx,8), %rax
jge 0x1cc0
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
jmp 0x1d19
cmpq %rbp, %rax
jge 0x1d08
leaq 0xf50(%rip), %rdi       # 0x2c1c
movq %rbx, %rsi
leaq 0x2343(%rip), %rdx      # 0x4019
callq 0x235a
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x1d1e
movq (%rbx), %rdi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x21f8
testl %eax, %eax
je 0x1d1e
leaq 0xf20(%rip), %rdi       # 0x2c1c
movq %rbx, %rsi
leaq 0x230f(%rip), %rdx      # 0x4015
jmp 0x1d19
leaq 0xe77(%rip), %rdi       # 0x2b86
movq %rbx, %rsi
leaq 0x230f(%rip), %rdx      # 0x4028
callq 0x235a
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x20e2
movq 0x28(%rbx), %rsi
cmpq $0x3, %rsi
ja 0x1c41
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x20e2
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1dd3
movq %rbx, %rdi
callq 0x1b78
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x20e2
testl %eax, %eax
je 0x1bc8
cmpq $0x0, 0x28(%rbx)
je 0x1daa
leaq 0xdf8(%rip), %r14       # 0x2b86
leaq 0x2293(%rip), %r15      # 0x4028
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x235a
cmpq $0x0, 0x28(%rbx)
jne 0x1d95
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x20e2
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq