// File: Laakeri[P]maxpre/src/./SE.cpp
// Function: maxPreprocessor::Preprocessor::trySEgen(int, std::vector<int, std::allocator<int>>&)
void Preprocessor::trySEgen(int lit, vector<int>& toRemove) {
	if ((int)pi.litClauses[lit].size() <= 64) { // magic constant
		trySE(pi.litClauses[lit], toRemove);
	}
	else {
		int avg = 0;
		for (int c : pi.litClauses[lit]) {
			avg += pi.clauses[c].lit.size();
		}
		avg /= (int)pi.litClauses[lit].size();
		
		if (avg <= 10) { // magic constant
			trySEHash(pi.litClauses[lit], lit, toRemove);
		}
		else if (avg >= 30) { // magic constant
			trySEAmsLex(pi.litClauses[lit], toRemove);
		}
		else {
			if (avg * (int)pi.litClauses[lit].size() > 10000) { // magic constant
				trySEAmsLex(pi.litClauses[lit], toRemove);
			}
			else {
				trySEHash(pi.litClauses[lit], lit, toRemove);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
cmpl $0x40, %eax
jg 0x1525b
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x14df0
jmp 0x153d7
movq -0x48(%rbp), %rdi
movl $0x0, -0x1c(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa800
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa830
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x152a4
jmp 0x152df
leaq -0x30(%rbp), %rdi
callq 0xa8a0
movq -0x48(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movslq -0x3c(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movslq -0x1c(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x1c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa930
jmp 0x15291
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movl %eax, %ecx
movl -0x1c(%rbp), %eax
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
cmpl $0xa, -0x1c(%rbp)
jg 0x15332
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x13eb0
jmp 0x153d5
cmpl $0x1e, -0x1c(%rbp)
jl 0x1535b
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x14860
jmp 0x153d3
movq -0x48(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x4c(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x4c(%rbp), %eax
imull %ecx, %eax
cmpl $0x2710, %eax           # imm = 0x2710
jle 0x153ad
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x14860
jmp 0x153d1
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaab0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x13eb0
jmp 0x153d3
jmp 0x153d5
jmp 0x153d7
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)