// File: /workspace/github_c_makefile_star2_O0/MikeyLHolm[P]Hive-lem-in/source/calculate_moves.c
// Function: calculate_more
int			calculate_more(t_info *info, int i, int rooms, int set)
{
	int		moves;
	int		d;

	if (set == 1)
	{
		while (++i < info->path_n_1)
			rooms += info->rooms[info->valid_indexes[i][0]]->length;
		rooms -= info->last_found_used == 1 ? 0 :
		info->rooms[info->valid_indexes[i - 1][0]]->length;
		d = info->last_found_used == 1 ? info->path_n_1 : info->path_n_1 - 1;
		d = d == 0 ? 1 : d;
		moves = ((rooms + info->ants) / d) + ((rooms + info->ants) % d ? 1 : 0);
	}
	else
	{
		while (++i < info->path_n_2)
			rooms += info->rooms[info->valid_indexes_2[i][0]]->length_2;
		rooms -= info->last_found_used_2 == 1 ? 0 :
		info->rooms[info->valid_indexes_2[i - 1][0]]->length_2;
		d = info->last_found_used_2 == 1 ? info->path_n_2 : info->path_n_2 - 1;
		d = d == 0 ? 1 : d;
		moves = ((rooms + info->ants) / d) + ((rooms + info->ants) % d ? 1 : 0);
	}
	return (moves);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x33da
jmp 0x32bd
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rcx
cmpl 0x1060(%rcx), %eax
jge 0x3302
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 0x44(%rax), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x32bd
movq -0x8(%rbp), %rax
cmpl $0x1, 0x1888(%rax)
jne 0x3316
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0x3346
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x1898(%rcx), %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x44(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %ecx
movl -0x10(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x1888(%rax)
jne 0x336d
movq -0x8(%rbp), %rax
movl 0x1060(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x337d
movq -0x8(%rbp), %rax
movl 0x1060(%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x3393
movl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3399
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x28(%rcx), %eax
cltd
idivl -0x1c(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x28(%rcx), %eax
cltd
idivl -0x1c(%rbp)
movl -0x2c(%rbp), %eax
movl %edx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x34f4
jmp 0x33dc
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rcx
cmpl 0x1064(%rcx), %eax
jge 0x3421
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18a0(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x48(%rax), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x33dc
movq -0x8(%rbp), %rax
cmpl $0x1, 0x188c(%rax)
jne 0x3435
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0x3465
movq -0x8(%rbp), %rax
movq 0x18a8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18a0(%rcx), %rcx
movl -0xc(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl 0x48(%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %ecx
movl -0x10(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x188c(%rax)
jne 0x348c
movq -0x8(%rbp), %rax
movl 0x1064(%rax), %eax
movl %eax, -0x34(%rbp)
jmp 0x349c
movq -0x8(%rbp), %rax
movl 0x1064(%rax), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x34b2
movl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x34b8
movl -0x1c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x28(%rcx), %eax
cltd
idivl -0x1c(%rbp)
movl %eax, -0x3c(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x28(%rcx), %eax
cltd
idivl -0x1c(%rbp)
movl -0x3c(%rbp), %eax
movl %edx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
popq %rbp
retq
nopl (%rax)