// File: /workspace/github_c_makefile_star2_O0/MikeyLHolm[P]Hive-lem-in/source/save_path.c
// Function: enough_paths
int		enough_paths(t_info *info, int path_index, int sum, int i)
{
	int		cmp_length;

	if ((info->phase == 1 && info->path_n_1 == info->max_paths)
	|| (info->phase == 2 && info->path_n_2 == info->max_paths))
		return (1);
	else if ((info->phase == 1 && info->path_n_1 == 1)
	|| (info->phase == 2 && info->path_n_2 == 1))
		return (0);
	cmp_length = info->phase == 1 ?
	info->rooms[info->valid_indexes[path_index][0]]->length :
	info->rooms[info->valid_indexes_2[path_index][0]]->length_2;
	while (i < path_index)
	{
		sum += info->phase == 1 ?
		(cmp_length - info->rooms[info->valid_indexes[i][0]]->length) :
		(cmp_length - info->rooms[info->valid_indexes_2[i][0]]->length_2);
		i++;
	}
	if (info->phase == 1)
		info->last_found_used = sum >= info->ants ? 0 : 1;
	else
		info->last_found_used_2 = sum >= info->ants ? 0 : 1;
	return (sum >= info->ants);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x106c(%rax)
jne 0x4634
movq -0x10(%rbp), %rax
movl 0x1060(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x105c(%rcx), %eax
je 0x4657
movq -0x10(%rbp), %rax
cmpl $0x2, 0x106c(%rax)
jne 0x4663
movq -0x10(%rbp), %rax
movl 0x1064(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x105c(%rcx), %eax
jne 0x4663
movl $0x1, -0x4(%rbp)
jmp 0x4802
movq -0x10(%rbp), %rax
cmpl $0x1, 0x106c(%rax)
jne 0x467d
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1060(%rax)
je 0x4697
movq -0x10(%rbp), %rax
cmpl $0x2, 0x106c(%rax)
jne 0x46a3
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1064(%rax)
jne 0x46a3
movl $0x0, -0x4(%rbp)
jmp 0x4802
jmp 0x46a5
movq -0x10(%rbp), %rax
cmpl $0x1, 0x106c(%rax)
jne 0x46df
movq -0x10(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x44(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x470a
movq -0x10(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18a0(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x48(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x479e
movq -0x10(%rbp), %rax
cmpl $0x1, 0x106c(%rax)
jne 0x4759
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq 0x1898(%rdx), %rdx
movslq -0x1c(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
subl 0x44(%rcx), %eax
movl %eax, -0x28(%rbp)
jmp 0x4787
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18a8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq 0x18a0(%rdx), %rdx
movslq -0x1c(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
subl 0x48(%rcx), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4710
movq -0x10(%rbp), %rax
cmpl $0x1, 0x106c(%rax)
jne 0x47cd
movl -0x18(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
movl $0x1, %ecx
xorl %eax, %eax
cmpl %esi, %edx
cmovgel %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1888(%rax)
jmp 0x47ed
movl -0x18(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
movl $0x1, %ecx
xorl %eax, %eax
cmpl %esi, %edx
cmovgel %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x188c(%rax)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
setge %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)