// File: /workspace/github_c_makefile_star2_O0/MikeyLHolm[P]Hive-lem-in/source/divide_ants_to_paths.c
// Function: divide_to_paths
void		divide_to_paths(t_info *info, int i, int tab, int cmp)
{
	int		antnb;

	antnb = 1;
	while (info->ants_at_start > 0)
	{
		if (info->path_n_1 == 1)
			tab = divide_paths_data(info, antnb++, i, tab);
		else if (info->rooms[info->valid_indexes[i][0]]->cost
		<= info->rooms[info->valid_indexes[i + 1][0]]->cost)
		{
			if (info->rooms[info->valid_indexes[i][0]]->cost
			== info->rooms[info->valid_indexes[i + 1][0]]->cost)
				i = cmp_loop(info, cmp, i);
			tab = divide_paths_data(info, antnb++, i, tab);
		}
		else if (info->rooms[info->valid_indexes[i][0]]->cost
		> info->rooms[info->valid_indexes[i + 1][0]]->cost)
			tab = divide_paths_data(info, antnb++, ++i, tab);
		if (i == info->path_n_1 - 1
		|| info->rooms[info->valid_indexes[i][0]]->cost
		< info->rooms[info->valid_indexes[i + 1][0]]->cost)
			i = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jle 0x3831
movq -0x8(%rbp), %rax
cmpl $0x1, 0x1060(%rax)
jne 0x3659
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
callq 0x3840
movl %eax, -0x10(%rbp)
jmp 0x37ba
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x1898(%rdx), %rdx
movl -0xc(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x3c(%rcx), %eax
jg 0x373c
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x1898(%rdx), %rdx
movl -0xc(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x3c(%rcx), %eax
jne 0x371d
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x3920
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
callq 0x3840
movl %eax, -0x10(%rbp)
jmp 0x37b8
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x1898(%rdx), %rdx
movl -0xc(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x3c(%rcx), %eax
jle 0x37b6
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %edx
addl $0x1, %edx
movl %edx, -0xc(%rbp)
movl -0x10(%rbp), %ecx
callq 0x3840
movl %eax, -0x10(%rbp)
jmp 0x37b8
jmp 0x37ba
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x1060(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x3825
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x1898(%rdx), %rdx
movl -0xc(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x3c(%rcx), %eax
jge 0x382c
movl $0x0, -0xc(%rbp)
jmp 0x361c
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)