// File: /workspace/github_c_makefile_star2_O2/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 0x1a6d
movq %rbx, %rdi
callq 0x2473
leaq 0x4(%rsp), %r14
movq %rsp, %r15
pushq $0x1
popq %rbp
leaq 0xdd1(%rip), %r12       # 0x2850
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x1efc
testl %eax, %eax
jne 0x1d60
cmpq $0x3, 0x28(%rbx)
ja 0x1aa6
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 0x1bf1
cmpl $0x0, (%rsp)
jne 0x1bf1
movq 0x8(%rbx), %rax
movq -0x8(%rax,%rsi,8), %rdi
leaq -0x1(%rsi), %rcx
movq %rcx, %rdx
movq %rdi, %r13
subq $0x1, %rdx
jb 0x1bc2
movq (%rax,%rdx,8), %rdi
cmpq %rdi, (%rax,%rcx,8)
movq %rdx, %rcx
jl 0x1ade
jmp 0x1bc2
movq 0x20(%rbx), %rax
cmpq $0x2, %rax
jb 0x1b28
movq (%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdx
cmpq -0x10(%rcx,%rax,8), %rdx
jle 0x1b28
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x24e7(%rip), %rdx      # 0x400a
jmp 0x1ba9
movq 0x8(%rbx), %rcx
movq 0x28(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rax
cmpq %r13, %rax
jl 0x1b50
cmpq -0x10(%rcx,%rdx,8), %rax
jge 0x1b50
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x24bf(%rip), %rdx      # 0x400d
jmp 0x1ba9
cmpq %r13, %rax
jge 0x1b98
leaq 0xe2a(%rip), %rdi       # 0x2986
movq %rbx, %rsi
leaq 0x24b3(%rip), %rdx      # 0x4019
callq 0x2158
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x1bae
movq (%rbx), %rdi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x1fe8
testl %eax, %eax
je 0x1bae
leaq 0xdfa(%rip), %rdi       # 0x2986
movq %rbx, %rsi
leaq 0x247f(%rip), %rdx      # 0x4015
jmp 0x1ba9
leaq 0xd52(%rip), %rdi       # 0x28f1
movq %rbx, %rsi
leaq 0x247f(%rip), %rdx      # 0x4028
callq 0x2158
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x1efc
movq 0x28(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x1bf1
movq 0x8(%rbx), %rdi
movq %r13, %rdx
movl %ebp, %ecx
callq 0x2448
testl %eax, %eax
je 0x1bf1
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
movl %ebp, %edx
callq 0x1dac
testl %eax, %eax
je 0x1afd
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x1efc
cmpq $0x3, 0x20(%rbx)
ja 0x1c10
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 0x1d53
cmpl $0x0, 0x4(%rsp)
jne 0x1d53
movq (%rbx), %rdi
callq 0x2096
movslq %eax, %r13
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
movq %r13, %rdx
callq 0x2008
testl %eax, %eax
jne 0x1d53
movq 0x20(%rbx), %rsi
cmpq $0x4, %rsi
jb 0x1c01
movq (%rbx), %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x2448
testl %eax, %eax
je 0x1c01
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
xorl %edx, %edx
callq 0x1dac
testl %eax, %eax
jne 0x1c01
movq 0x28(%rbx), %rax
cmpq $0x2, %rax
jb 0x1cb8
movq 0x8(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdx
cmpq -0x10(%rcx,%rax,8), %rdx
jge 0x1cb8
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x235a(%rip), %rdx      # 0x400d
jmp 0x1d39
movq (%rbx), %rcx
movq 0x20(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rax
cmpq %r13, %rax
jge 0x1cdf
cmpq -0x10(%rcx,%rdx,8), %rax
jle 0x1cdf
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x232d(%rip), %rdx      # 0x400a
jmp 0x1d39
cmpq %r13, %rax
jge 0x1cf7
leaq 0xc06(%rip), %rdi       # 0x28f1
movq %rbx, %rsi
leaq 0x2336(%rip), %rdx      # 0x402b
jmp 0x1d39
leaq 0xc88(%rip), %rdi       # 0x2986
movq %rbx, %rsi
leaq 0x230d(%rip), %rdx      # 0x4015
callq 0x2158
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x1d3e
movq 0x8(%rbx), %rdi
movq -0x8(%rdi,%rsi,8), %rdx
callq 0x2008
testl %eax, %eax
je 0x1d3e
leaq 0xc57(%rip), %rdi       # 0x2986
movq %rbx, %rsi
leaq 0x22e0(%rip), %rdx      # 0x4019
callq 0x2158
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x1efc
jmp 0x1c5b
movq %rbx, %rdi
callq 0x1a50
jmp 0x1a7f
leaq 0xb8a(%rip), %r14       # 0x28f1
leaq 0x22ba(%rip), %r15      # 0x4028
cmpq $0x0, 0x28(%rbx)
je 0x1d85
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2158
jmp 0x1d6e
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