// File: It4innovations[P]Handicap/src/GraphLabelings/../Solvers/CombinatorialGenerator.h
// Function: CombinatorialGenerator::computePossibleCombination(std::stack<int, std::deque<int, std::allocator<int>>>&, std::unique_ptr<LabelingSolution<int>, std::default_delete<LabelingSolution<int>>>&)
void computePossibleCombination(std::stack<int> & kSumResults,
		                                std::unique_ptr<LabelingSolution<int>> & matrix) {
			// solve 1-SUM problem
			if (sizeOfSet == 1) {
				bool checkIsWeightIsValid = missingWeight > 1
				                            && missingWeight <= graph->getVerticesCount() + 1
				                            && missingWeight != graph->getMissingLabel()
				                            && matrix->getFreeCellsInColumn(missingWeight) != 0
				                            && missingWeight != currentLabel;
				if (checkIsWeightIsValid) {
					kSumResults.emplace(missingWeight);
				}
				return;
			}

			// solve k-SUM, where k > 1
			if (sizeOfSet > 1 && sizeOfSet <= graph->getRegularConstant()) {
				int index = 0;
				for (int i = 1; i < graph->getVerticesCount() + 2; ++i) {
					if (matrix->getFreeCellsInColumn(i) && i != currentLabel) {
						allowedNumbersArray[index++] = i;
					}
				}

				solver.setK(sizeOfSet);
				solver.setSearchNumber(missingWeight);
				solver.solve(allowedNumbersArray, index, kSumResults);

				return;
			}

			throw "Invalid size of set";
		}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x1, 0x2c(%rax)
jne 0x12a04
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpl $0x1, 0x30(%rcx)
movb %al, 0x17(%rsp)
jle 0x129db
movq 0x18(%rsp), %rdi
movl 0x30(%rdi), %eax
movl %eax, 0x10(%rsp)
callq 0x3f90
movq %rax, %rdi
callq 0x3fa0
movl 0x10(%rsp), %ecx
movl %eax, %edx
addl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0x17(%rsp)
jg 0x129db
movq 0x18(%rsp), %rdi
movl 0x30(%rdi), %eax
movl %eax, 0xc(%rsp)
callq 0x3f90
movq %rax, %rdi
callq 0x3fb0
movl 0xc(%rsp), %ecx
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0x17(%rsp)
je 0x129db
movq 0x30(%rsp), %rdi
callq 0xf630
movq 0x18(%rsp), %rsi
movq %rax, %rdi
addq $0x30, %rsi
callq 0x11f10
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x17(%rsp)
je 0x129db
movq 0x18(%rsp), %rcx
movl 0x30(%rcx), %eax
cmpl 0x28(%rcx), %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
movb %al, 0x2f(%rsp)
testb $0x1, 0x2f(%rsp)
je 0x129ff
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdi
addq $0x30, %rsi
callq 0x32d0
jmp 0x12b47
movq 0x18(%rsp), %rax
cmpl $0x1, 0x2c(%rax)
jle 0x12b20
movq 0x18(%rsp), %rdi
movl 0x2c(%rdi), %eax
movl %eax, 0x8(%rsp)
callq 0x3f90
movq %rax, %rdi
callq 0x6d20
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
jg 0x12b20
movl $0x0, 0x28(%rsp)
movl $0x1, 0x24(%rsp)
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x3f90
movq %rax, %rdi
callq 0x3fa0
movl %eax, %ecx
movl 0x4(%rsp), %eax
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x12ad7
movq 0x30(%rsp), %rdi
callq 0xf630
movq %rax, %rdi
leaq 0x24(%rsp), %rsi
callq 0x11f10
cmpl $0x0, %eax
je 0x12ac5
movq 0x18(%rsp), %rcx
movl 0x24(%rsp), %eax
cmpl 0x28(%rcx), %eax
je 0x12ac5
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, (%rsp)
addq $0x20, %rdi
movl 0x28(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rsp)
movslq %eax, %rsi
callq 0x3290
movl (%rsp), %ecx
movl %ecx, (%rax)
jmp 0x12ac7
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x12a4a
movq 0x18(%rsp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movl 0x2c(%rax), %esi
callq 0x3d00
movq 0x18(%rsp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movl 0x30(%rax), %esi
callq 0x3d20
movq 0x18(%rsp), %rsi
movq %rsi, %rdi
addq $0x10, %rdi
addq $0x20, %rsi
movq 0x38(%rsp), %rcx
leaq 0x28(%rsp), %rdx
callq 0x3910
jmp 0x12b47
movl $0x8, %edi
callq 0x20c0
movq %rax, %rdi
leaq 0x271d(%rip), %rax      # 0x15251
movq %rax, (%rdi)
movq 0xe462(%rip), %rsi      # 0x20fa0
xorl %eax, %eax
movl %eax, %edx
callq 0x2290
addq $0x48, %rsp
retq
nopl (%rax)