// File: /workspace/github_c_makefile_star2_O2/paulahemsi[P]push_swap/./source/small_sort.c
// Function: small_sort
void	small_sort(t_stack *stack, t_aux *aux, int total_numbers)
{
	int	first;
	int	second;
	int	last;

	(void)aux;
	if (is_sorted(stack->a) && is_full(stack->a, total_numbers))
		return ;
	if (ft_dlstsize(stack->a) == 2)
	{
		swap(&stack->a, &stack->instr, 'a');
		return ;
	}
	if (ft_dlstsize(stack->a) == 3)
	{
		define_numbers(&first, &second, &last, stack->a);
		sort_three(stack, &first, &second, &last);
		return_to_a(stack);
	}
	else
		send_to_b(stack, aux, total_numbers);
	small_sort(stack, aux, total_numbers);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x1469
testl %eax, %eax
je 0x1cff
movq (%r14), %rdi
movl %ebx, %esi
callq 0x1486
testl %eax, %eax
je 0x1cff
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
callq 0x242c
cmpl $0x2, %eax
jne 0x1d29
leaq 0x10(%r14), %rsi
pushq $0x61
popq %rdx
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12a0
movl %ebx, 0x14(%rsp)
movq (%r14), %rdi
callq 0x242c
cmpl $0x3, %eax
jne 0x1e82
movq (%r14), %rbx
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0x1eea
movq %rbx, %rdi
callq 0x1469
testl %eax, %eax
jne 0x1e1b
movl 0x10(%rsp), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jle 0x1d88
movl 0x8(%rsp), %edx
cmpl %edx, %eax
setl %sil
cmpl %ecx, %edx
setl %dl
orb %sil, %dl
jne 0x1d9e
cmpl %ecx, %eax
jge 0x1dad
movl 0x8(%rsp), %edx
cmpl %ecx, %edx
setge %cl
cmpl %edx, %eax
setge %al
orb %cl, %al
jne 0x1dad
leaq 0x10(%r14), %rsi
pushq $0x61
popq %rdx
movq %r14, %rdi
callq 0x12a0
movq (%r14), %rcx
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1eea
movl (%rbx), %ebx
movl (%r12), %ebp
movl (%r13), %r12d
cmpl %ebp, %ebx
jle 0x1dfa
cmpl %ebp, %r12d
setle %al
cmpl %r12d, %ebx
setle %cl
orb %al, %cl
jne 0x1dfa
leaq 0x10(%r14), %rsi
pushq $0x61
popq %rdx
movq %r14, %rdi
callq 0x1367
cmpl %ebp, %ebx
setl %al
cmpl %r12d, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1e1b
leaq 0x10(%r14), %rsi
pushq $0x61
popq %rdx
movq %r14, %rdi
callq 0x13c7
leaq 0x8(%r14), %r12
leaq 0x10(%r14), %r13
pushq $0x61
popq %rbp
pushq $0x62
popq %rbx
movq (%r12), %rax
testq %rax, %rax
je 0x1ecd
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x1e54
movl 0x4(%rax), %eax
cmpl 0x4(%rcx), %eax
jge 0x1e54
movq %r12, %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x12a0
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl %ebp, %ecx
callq 0x12fd
movq (%r14), %rax
movl 0x4(%rax), %ecx
movq 0x8(%rax), %rax
cmpl 0x4(%rax), %ecx
jle 0x1e29
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x12a0
jmp 0x1e29
leaq 0x10(%r14), %rbx
leaq 0x8(%r14), %r12
pushq $0x62
popq %rbp
pushq $0x61
popq %r13
movq (%r14), %rdi
callq 0x242c
cmpl $0x3, %eax
je 0x1ecd
movq (%r14), %rax
cmpl $0x1, 0x4(%rax)
ja 0x1ebd
decl 0x10(%r15)
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x12fd
jmp 0x1e91
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x1367
jmp 0x1e91
movq %r14, %rdi
movq %r15, %rsi
movl 0x14(%rsp), %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1cc0