// File: Laakeri[P]maxpre/src/./GSLE.cpp
// Function: maxPreprocessor::Preprocessor::GSLEtryBackTrack(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<unsigned long, std::allocator<unsigned long>>&, unsigned long, unsigned long)
bool Preprocessor::GSLEtryBackTrack(vector<vector<int> >& hs, vector<uint64_t>& weights, uint64_t w, uint64_t itLim) {
	if (hs.size() == 0) return true;
	bool found = false;
	vector<int> sel(weights.size());
	found = false;
	int tries = 10; // magic constant
	for (int l : hs[0]) {
		if (weights[l] > w) continue;
		uint64_t lm = itLim;
		sel[l] = 1;
		GSLEBT(1, w - weights[l], sel, weights, hs, found, lm);
		sel[l] = 0;
		if (found) break;
		tries--;
		if (tries < 0) break;
	}
	return found;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rdi
callq 0xfd70
cmpq $0x0, %rax
jne 0x2a092
movb $0x1, -0x1(%rbp)
jmp 0x2a25b
movb $0x0, -0x31(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3f1b0
movq %rax, -0xa8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0xa710
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xa730
jmp 0x2a0cf
leaq -0x51(%rbp), %rdi
callq 0xa7a0
movb $0x0, -0x31(%rbp)
movl $0xa, -0x68(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xaab0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa800
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa830
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x2a124
jmp 0x2a24a
leaq -0x78(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x84(%rbp), %rsi
callq 0x3d140
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jbe 0x2a16d
jmp 0x2a23c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0xa7a0
jmp 0x2a269
movq -0x30(%rbp), %rax
movq %rax, -0x90(%rbp)
movslq -0x84(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0xa7c0
movl $0x1, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x84(%rbp), %rsi
callq 0x3d140
movq -0xb8(%rbp), %rdx
movq -0x98(%rbp), %rdi
movq -0xb0(%rbp), %rcx
movq (%rax), %rax
subq %rax, %rdx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
movq %rsp, %rax
leaq -0x90(%rbp), %rsi
movq %rsi, 0x8(%rax)
leaq -0x31(%rbp), %rsi
movq %rsi, (%rax)
movl $0x1, %esi
callq 0x29e20
jmp 0x2a1f4
movslq -0x84(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xa7c0
movl $0x0, (%rax)
testb $0x1, -0x31(%rbp)
je 0x2a229
jmp 0x2a24a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xab00
jmp 0x2a269
movl -0x68(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x68(%rbp)
jge 0x2a23a
jmp 0x2a24a
jmp 0x2a23c
leaq -0x78(%rbp), %rdi
callq 0xa930
jmp 0x2a10e
movb -0x31(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xab00
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4610
nopw %cs:(%rax,%rax)