// File: Laakeri[P]maxpre/src/./BVE.cpp
// Function: maxPreprocessor::Preprocessor::tryBVE2(int)
int Preprocessor::tryBVE2(int var) {
	int sizeLimit = pi.litClauses[posLit(var)].size() + pi.litClauses[negLit(var)].size();

  sizeLimit += min(BVElocalGrow, BVEglobalGrow);
	
	vector<int> isPosDef, isNegDef;
	vector<int> defClauses;
	if (BVEgate) {
		defClauses = tryBVEGE(var);
	}
	bool defFound = false;
	if (defClauses.size() > 0) {
		defFound = true;
		rLog.gatesExtracted++;
		isPosDef.resize(pi.litClauses[posLit(var)].size());
		isNegDef.resize(pi.litClauses[negLit(var)].size());
		sort(defClauses.begin(), defClauses.end());
		for (int i = 0; i < (int)pi.litClauses[posLit(var)].size(); i++) {
			if (binary_search(defClauses.begin(), defClauses.end(), pi.litClauses[posLit(var)][i])) {
				isPosDef[i] = 1;
			}
		}
		for (int i = 0; i < (int)pi.litClauses[negLit(var)].size(); i++) {
			if (binary_search(defClauses.begin(), defClauses.end(), pi.litClauses[negLit(var)][i])) {
				isNegDef[i] = 1;
			}
		}
	}
	
	//the condition sizelimit >= 6 doesnt really help
	if (sizeLimit >= 6) { // magic constant
		vector<uint64_t> h1=getBVEHash(pi.litClauses[posLit(var)], var, 0);
		vector<uint64_t> h2=getBVEHash(pi.litClauses[negLit(var)], var, 1);
		int hcnt = 0;
		for (int i = 0; i < (int)pi.litClauses[posLit(var)].size(); i++) {
			for (int ii = 0; ii < (int)pi.litClauses[negLit(var)].size(); ii++) {
				if (defFound && (isPosDef[i] == isNegDef[ii])) continue;
				if ((h1[i] & h2[ii]) == 0) {
					hcnt++;
					if (hcnt > sizeLimit) return 0;
				}
			}
		}
	}
	
	vector<vector<int> > newClauses;
	for (int i = 0; i < (int)pi.litClauses[posLit(var)].size(); i++) {
		for (int ii = 0; ii < (int)pi.litClauses[negLit(var)].size(); ii++) {
			if (defFound && (isPosDef[i] == isNegDef[ii])) continue;
			const vector<int>& c1 = pi.clauses[pi.litClauses[posLit(var)][i]].lit;
			const vector<int>& c2 = pi.clauses[pi.litClauses[negLit(var)][ii]].lit;
			unsigned j2 = 0;
			bool f = false;
			for (unsigned j = 0; j < c1.size(); j++) {
				while (j2 < c2.size() && c2[j2] <= c1[j]) {
					if (litNegation(c2[j2]) == c1[j] && litVariable(c1[j]) != var) {
						f = true;
						break;
					}
					j2++;
				}
				if (f) break;
				if (j2 < c2.size() && litNegation(c2[j2]) == c1[j] && litVariable(c1[j]) != var) {
					f = true;
					break;
				}
			}
			
			if (f) continue;
			if ((int)newClauses.size() >= sizeLimit) return 0;
			newClauses.push_back(vector<int>());
			j2 = 0;
			for (unsigned j = 0; j < c1.size(); j++) {
				while (j2 < c2.size() && c2[j2] <= c1[j]) {
					if (litVariable(c2[j2]) != var) {
						newClauses.back().push_back(c2[j2]);
					}
					j2++;
				}
				if (!(newClauses.back().size() > 0 && newClauses.back().back() == c1[j]) && litVariable(c1[j]) != var) {
					newClauses.back().push_back(c1[j]);
				}
			}
			while (j2 < c2.size()) {
				if (litVariable(c2[j2]) != var) {
					newClauses.back().push_back(c2[j2]);
				}
				j2++;
			}
		}
	}
	
	vector<vector<int> > nClauses;
	vector<int> toRemove;
	for (int c : pi.litClauses[posLit(var)]) {
		toRemove.push_back(c);
	}
	for (int c : pi.litClauses[negLit(var)]) {
		toRemove.push_back(c);
		nClauses.push_back(pi.clauses[c].lit);
	}
	for (int c : toRemove) {
		pi.removeClause(c);
	}
	for (auto& nc : newClauses) {
		pi.addClause(nc);
	}
	trace.BVE(var, nClauses);
	
	rLog.removeVariable(1);
	rLog.removeClause((int)toRemove.size() - (int)newClauses.size());

  BVEglobalGrow += (int)toRemove.size() - (int)newClauses.size();
	
	assert(pi.litClauses[posLit(var)].size() == 0 && pi.litClauses[negLit(var)].size() == 0);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x220(%rbp)
addq $0x18, %rax
movq %rax, -0x238(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movq -0x238(%rbp), %rdi
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movq -0x220(%rbp), %rax
movq %rcx, -0x228(%rbp)
addq $0x18, %rax
movq %rax, -0x230(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movq -0x230(%rbp), %rdi
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq -0x220(%rbp), %rsi
movq %rax, %rcx
movq -0x228(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x18(%rbp)
movq %rsi, %rdi
addq $0x3a4, %rdi            # imm = 0x3A4
addq $0x3a8, %rsi            # imm = 0x3A8
callq 0x3e0c0
movl (%rax), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa7e0
leaq -0x48(%rbp), %rdi
callq 0xa7e0
leaq -0x60(%rbp), %rdi
callq 0xa7e0
movq -0x220(%rbp), %rax
testb $0x1, 0x3a0(%rax)
je 0x19463
movq -0x220(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x78(%rbp), %rdi
callq 0x18c70
jmp 0x19437
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3e100
leaq -0x78(%rbp), %rdi
callq 0xab00
jmp 0x19463
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1a72d
movb $0x0, -0x85(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xf940
cmpq $0x0, %rax
jbe 0x197cb
movq -0x220(%rbp), %rax
movb $0x1, -0x85(%rbp)
movl 0x2c8(%rax), %ecx
incl %ecx
movl %ecx, 0x2c8(%rax)
addq $0x18, %rax
movq %rax, -0x248(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x23c(%rbp)
jmp 0x194b4
movq -0x248(%rbp), %rdi
movl -0x23c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0xa990
jmp 0x194df
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x258(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x24c(%rbp)
jmp 0x19501
movq -0x258(%rbp), %rdi
movl -0x24c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0xa990
jmp 0x1952c
leaq -0x60(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0xa800
movq -0x260(%rbp), %rdi
movq %rax, -0x90(%rbp)
callq 0xa830
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x3e130
jmp 0x1956b
movl $0x0, -0x9c(%rbp)
movq -0x220(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, -0x274(%rbp)
addq $0x18, %rax
movq %rax, -0x270(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x264(%rbp)
jmp 0x195a3
movq -0x270(%rbp), %rdi
movl -0x264(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x274(%rbp), %eax
cmpl %ecx, %eax
jge 0x1969a
leaq -0x60(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0xa800
movq -0x288(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0xa830
movq %rax, %rcx
movq -0x220(%rbp), %rax
movq %rcx, -0xb0(%rbp)
addq $0x18, %rax
movq %rax, -0x280(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x278(%rbp)
jmp 0x19620
movq -0x280(%rbp), %rdi
movl -0x278(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
movslq -0x9c(%rbp), %rsi
callq 0xa7c0
movq %rax, %rdx
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x3e170
movb %al, -0x289(%rbp)
jmp 0x19662
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x1966e
jmp 0x19684
movslq -0x9c(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xa7c0
movl $0x1, (%rax)
jmp 0x19686
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x19575
movl $0x0, -0xb4(%rbp)
movq -0x220(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, -0x29c(%rbp)
addq $0x18, %rax
movq %rax, -0x298(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x290(%rbp)
jmp 0x196d2
movq -0x298(%rbp), %rdi
movl -0x290(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x29c(%rbp), %eax
cmpl %ecx, %eax
jge 0x197c9
leaq -0x60(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0xa800
movq -0x2b0(%rbp), %rdi
movq %rax, -0xc0(%rbp)
callq 0xa830
movq %rax, %rcx
movq -0x220(%rbp), %rax
movq %rcx, -0xc8(%rbp)
addq $0x18, %rax
movq %rax, -0x2a8(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x2a0(%rbp)
jmp 0x1974f
movq -0x2a8(%rbp), %rdi
movl -0x2a0(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
movslq -0xb4(%rbp), %rsi
callq 0xa7c0
movq %rax, %rdx
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x3e170
movb %al, -0x2b1(%rbp)
jmp 0x19791
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x1979d
jmp 0x197b3
movslq -0xb4(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xa7c0
movl $0x1, (%rax)
jmp 0x197b5
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x196a4
jmp 0x197cb
cmpl $0x6, -0x18(%rbp)
jl 0x19ab2
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2c0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x2b8(%rbp)
jmp 0x197f7
movq -0x2c0(%rbp), %rdi
movl -0x2b8(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq -0x220(%rbp), %rsi
movq %rax, %rdx
movl -0x14(%rbp), %ecx
leaq -0xe0(%rbp), %rdi
xorl %r8d, %r8d
callq 0x159a0
jmp 0x1982a
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2d0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x2c4(%rbp)
jmp 0x1984c
movq -0x2d0(%rbp), %rdi
movl -0x2c4(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq -0x220(%rbp), %rsi
movq %rax, %rdx
movl -0x14(%rbp), %ecx
leaq -0xf8(%rbp), %rdi
movl $0x1, %r8d
callq 0x159a0
jmp 0x19882
movl $0x0, -0xfc(%rbp)
movl $0x0, -0x100(%rbp)
movq -0x220(%rbp), %rax
movl -0x100(%rbp), %ecx
movl %ecx, -0x2e4(%rbp)
addq $0x18, %rax
movq %rax, -0x2e0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x2d4(%rbp)
jmp 0x198c4
movq -0x2e0(%rbp), %rdi
movl -0x2d4(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x2e4(%rbp), %eax
cmpl %ecx, %eax
jge 0x19a6d
movl $0x0, -0x104(%rbp)
movq -0x220(%rbp), %rax
movl -0x104(%rbp), %ecx
movl %ecx, -0x2f4(%rbp)
addq $0x18, %rax
movq %rax, -0x2f0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x2e8(%rbp)
jmp 0x1992a
movq -0x2f0(%rbp), %rdi
movl -0x2e8(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x2f4(%rbp), %eax
cmpl %ecx, %eax
jge 0x19a57
testb $0x1, -0x85(%rbp)
je 0x199cf
movslq -0x100(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xa7c0
movl (%rax), %eax
movl %eax, -0x2f8(%rbp)
movslq -0x104(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xa7c0
movq %rax, %rcx
movl -0x2f8(%rbp), %eax
cmpl (%rcx), %eax
jne 0x199cf
jmp 0x19a43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x19aa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xb910
jmp 0x19aa1
movslq -0x100(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x3d140
movq (%rax), %rax
movq %rax, -0x300(%rbp)
movslq -0x104(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x3d140
movq %rax, %rcx
movq -0x300(%rbp), %rax
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0x19a41
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x19a3f
movl $0x0, -0x4(%rbp)
movl $0x1, -0x108(%rbp)
jmp 0x19a77
jmp 0x19a41
jmp 0x19a43
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x198fc
jmp 0x19a59
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x19896
movl $0x0, -0x108(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xb910
leaq -0xe0(%rbp), %rdi
callq 0xb910
movl -0x108(%rbp), %eax
testl %eax, %eax
jne 0x1a706
jmp 0x19a9f
jmp 0x19ab2
leaq -0xe0(%rbp), %rdi
callq 0xb910
jmp 0x1a72d
leaq -0x120(%rbp), %rdi
callq 0xb2e0
movl $0x0, -0x124(%rbp)
movq -0x220(%rbp), %rax
movl -0x124(%rbp), %ecx
movl %ecx, -0x314(%rbp)
addq $0x18, %rax
movq %rax, -0x310(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x304(%rbp)
jmp 0x19af6
movq -0x310(%rbp), %rdi
movl -0x304(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x314(%rbp), %eax
cmpl %ecx, %eax
jge 0x1a258
movl $0x0, -0x128(%rbp)
movq -0x220(%rbp), %rax
movl -0x128(%rbp), %ecx
movl %ecx, -0x324(%rbp)
addq $0x18, %rax
movq %rax, -0x320(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x318(%rbp)
jmp 0x19b5c
movq -0x320(%rbp), %rdi
movl -0x318(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movl -0x324(%rbp), %eax
cmpl %ecx, %eax
jge 0x1a242
testb $0x1, -0x85(%rbp)
je 0x19be1
movslq -0x124(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xa7c0
movl (%rax), %eax
movl %eax, -0x328(%rbp)
movslq -0x128(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xa7c0
movq %rax, %rcx
movl -0x328(%rbp), %eax
cmpl (%rcx), %eax
jne 0x19be1
jmp 0x1a22e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1a6f8
movq -0x220(%rbp), %rax
movq %rax, %rcx
movq %rcx, -0x340(%rbp)
addq $0x18, %rax
movq %rax, -0x338(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x32c(%rbp)
jmp 0x19c0d
movq -0x338(%rbp), %rdi
movl -0x32c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
movslq -0x124(%rbp), %rsi
callq 0xa7c0
movq -0x340(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq %rax, %rcx
movq -0x220(%rbp), %rax
movq %rcx, -0x130(%rbp)
movq %rax, %rcx
movq %rcx, -0x358(%rbp)
addq $0x18, %rax
movq %rax, -0x350(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x344(%rbp)
jmp 0x19c76
movq -0x350(%rbp), %rdi
movl -0x344(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
movslq -0x128(%rbp), %rsi
callq 0xa7c0
movq -0x358(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq %rax, -0x138(%rbp)
movl $0x0, -0x13c(%rbp)
movb $0x0, -0x13d(%rbp)
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
movq %rax, -0x360(%rbp)
movq -0x130(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movq -0x360(%rbp), %rax
cmpq %rcx, %rax
jae 0x19ed2
jmp 0x19cf9
movl -0x13c(%rbp), %eax
movq %rax, -0x370(%rbp)
movq -0x138(%rbp), %rdi
callq 0xf940
movq -0x370(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x361(%rbp)
jae 0x19d6d
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %eax
movl %eax, -0x374(%rbp)
movq -0x130(%rbp), %rdi
movl -0x144(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq %rax, %rcx
movl -0x374(%rbp), %eax
cmpl (%rcx), %eax
setle %al
movb %al, -0x361(%rbp)
movb -0x361(%rbp), %al
testb $0x1, %al
jne 0x19d7c
jmp 0x19e0b
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c5a0
movl %eax, -0x378(%rbp)
jmp 0x19d9f
movq -0x130(%rbp), %rdi
movl -0x144(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq %rax, %rcx
movl -0x378(%rbp), %eax
cmpl (%rcx), %eax
jne 0x19df7
movq -0x130(%rbp), %rdi
movl -0x144(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c880
movl %eax, -0x37c(%rbp)
jmp 0x19de3
movl -0x37c(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x19df7
movb $0x1, -0x13d(%rbp)
jmp 0x19e0b
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x19cf9
testb $0x1, -0x13d(%rbp)
je 0x19e19
jmp 0x19ed2
movl -0x13c(%rbp), %eax
movq %rax, -0x388(%rbp)
movq -0x138(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movq -0x388(%rbp), %rax
cmpq %rcx, %rax
jae 0x19ebc
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c5a0
movl %eax, -0x38c(%rbp)
jmp 0x19e64
movq -0x130(%rbp), %rdi
movl -0x144(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq %rax, %rcx
movl -0x38c(%rbp), %eax
cmpl (%rcx), %eax
jne 0x19ebc
movq -0x130(%rbp), %rdi
movl -0x144(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c880
movl %eax, -0x390(%rbp)
jmp 0x19ea8
movl -0x390(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x19ebc
movb $0x1, -0x13d(%rbp)
jmp 0x19ed2
jmp 0x19ebe
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x19ccb
testb $0x1, -0x13d(%rbp)
je 0x19ee0
jmp 0x1a22e
leaq -0x120(%rbp), %rdi
callq 0xfd70
cmpl -0x18(%rbp), %eax
jl 0x19f07
movl $0x0, -0x4(%rbp)
movl $0x1, -0x108(%rbp)
jmp 0x1a6ea
xorps %xmm0, %xmm0
movaps %xmm0, -0x160(%rbp)
movq $0x0, -0x150(%rbp)
leaq -0x160(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0xa7e0
movq -0x398(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x3e200
jmp 0x19f44
leaq -0x160(%rbp), %rdi
callq 0xab00
movl $0x0, -0x13c(%rbp)
movl $0x0, -0x164(%rbp)
movl -0x164(%rbp), %eax
movq %rax, -0x3a0(%rbp)
movq -0x130(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movq -0x3a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a186
jmp 0x19f92
movl -0x13c(%rbp), %eax
movq %rax, -0x3b0(%rbp)
movq -0x138(%rbp), %rdi
callq 0xf940
movq -0x3b0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x3a1(%rbp)
jae 0x1a006
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %eax
movl %eax, -0x3b4(%rbp)
movq -0x130(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq %rax, %rcx
movl -0x3b4(%rbp), %eax
cmpl (%rcx), %eax
setle %al
movb %al, -0x3a1(%rbp)
movb -0x3a1(%rbp), %al
testb $0x1, %al
jne 0x1a015
jmp 0x1a0b1
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c880
movl %eax, -0x3b8(%rbp)
jmp 0x1a038
movl -0x3b8(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x1a09d
leaq -0x120(%rbp), %rdi
callq 0x3e230
movq %rax, -0x3c0(%rbp)
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq -0x3c0(%rbp), %rdi
movq %rax, %rsi
callq 0xa8c0
jmp 0x1a07b
jmp 0x1a09d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x160(%rbp), %rdi
callq 0xab00
jmp 0x1a6f8
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x19f92
leaq -0x120(%rbp), %rdi
callq 0x3e230
movq %rax, %rdi
callq 0xf940
cmpq $0x0, %rax
jbe 0x1a108
leaq -0x120(%rbp), %rdi
callq 0x3e230
movq %rax, %rdi
callq 0x3e270
movl (%rax), %eax
movl %eax, -0x3c4(%rbp)
movq -0x130(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq %rax, %rcx
movl -0x3c4(%rbp), %eax
cmpl (%rcx), %eax
je 0x1a170
movq -0x130(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c880
movl %eax, -0x3c8(%rbp)
jmp 0x1a12b
movl -0x3c8(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x1a170
leaq -0x120(%rbp), %rdi
callq 0x3e230
movq %rax, -0x3d0(%rbp)
movq -0x130(%rbp), %rdi
movl -0x164(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq -0x3d0(%rbp), %rdi
movq %rax, %rsi
callq 0xa8c0
jmp 0x1a16e
jmp 0x1a170
jmp 0x1a172
movl -0x164(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x164(%rbp)
jmp 0x19f64
jmp 0x1a188
movl -0x13c(%rbp), %eax
movq %rax, -0x3d8(%rbp)
movq -0x138(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movq -0x3d8(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a22c
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movl (%rax), %edi
callq 0x3c880
movl %eax, -0x3dc(%rbp)
jmp 0x1a1d3
movl -0x3dc(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x1a218
leaq -0x120(%rbp), %rdi
callq 0x3e230
movq %rax, -0x3e8(%rbp)
movq -0x138(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, %esi
callq 0x3c5b0
movq -0x3e8(%rbp), %rdi
movq %rax, %rsi
callq 0xa8c0
jmp 0x1a216
jmp 0x1a218
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x1a188
jmp 0x1a22e
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x19b2e
jmp 0x1a244
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x19ac8
leaq -0x180(%rbp), %rdi
callq 0xb2e0
leaq -0x198(%rbp), %rdi
callq 0xa7e0
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x3f8(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x3ec(%rbp)
jmp 0x1a292
movq -0x3f8(%rbp), %rdi
movl -0x3ec(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rdi
callq 0xa800
movq %rax, -0x1a8(%rbp)
movq -0x1a0(%rbp), %rdi
callq 0xa830
movq %rax, -0x1b0(%rbp)
leaq -0x1a8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1a2ed
jmp 0x1a352
leaq -0x1a8(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x1b4(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x1b4(%rbp), %rsi
callq 0xa8c0
jmp 0x1a316
jmp 0x1a318
leaq -0x1a8(%rbp), %rdi
callq 0xa930
jmp 0x1a2d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xab00
leaq -0x180(%rbp), %rdi
callq 0xb3b0
jmp 0x1a6f8
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x408(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x3fc(%rbp)
jmp 0x1a374
movq -0x408(%rbp), %rdi
movl -0x3fc(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rdi
callq 0xa800
movq %rax, -0x1c8(%rbp)
movq -0x1c0(%rbp), %rdi
callq 0xa830
movq %rax, -0x1d0(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1a3cf
jmp 0x1a42c
leaq -0x1c8(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x1d4(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x1d4(%rbp), %rsi
callq 0xa8c0
jmp 0x1a3f8
movq -0x220(%rbp), %rdi
movslq -0x1d4(%rbp), %rsi
callq 0x3c600
movq %rax, %rsi
leaq -0x180(%rbp), %rdi
callq 0x3e2b0
jmp 0x1a41c
jmp 0x1a41e
leaq -0x1c8(%rbp), %rdi
callq 0xa930
jmp 0x1a3b6
leaq -0x198(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rdi
callq 0xa800
movq %rax, -0x1e8(%rbp)
movq -0x1e0(%rbp), %rdi
callq 0xa830
movq %rax, -0x1f0(%rbp)
leaq -0x1e8(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1a479
jmp 0x1a4b1
leaq -0x1e8(%rbp), %rdi
callq 0xa8a0
movq -0x220(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x1f4(%rbp)
movl -0x1f4(%rbp), %esi
callq 0x5f7f0
jmp 0x1a4a1
jmp 0x1a4a3
leaq -0x1e8(%rbp), %rdi
callq 0xa930
jmp 0x1a460
leaq -0x120(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rdi
callq 0x3e320
movq %rax, -0x208(%rbp)
movq -0x200(%rbp), %rdi
callq 0x3e350
movq %rax, -0x210(%rbp)
leaq -0x208(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x3e380
testb $0x1, %al
jne 0x1a4fe
jmp 0x1a540
leaq -0x208(%rbp), %rdi
callq 0x3e3c0
movq -0x220(%rbp), %rdi
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rsi
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
callq 0x5f880
jmp 0x1a530
jmp 0x1a532
leaq -0x208(%rbp), %rdi
callq 0x3e3e0
jmp 0x1a4e5
movq -0x220(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movl -0x14(%rbp), %esi
leaq -0x180(%rbp), %rdx
callq 0x5c250
jmp 0x1a55f
movq -0x220(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61490
jmp 0x1a579
movq -0x220(%rbp), %rax
addq $0x218, %rax            # imm = 0x218
movq %rax, -0x410(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xf940
movl %eax, -0x414(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xfd70
movl -0x414(%rbp), %esi
movq -0x410(%rbp), %rdi
subl %eax, %esi
callq 0x61410
jmp 0x1a5c1
leaq -0x198(%rbp), %rdi
callq 0xf940
movl %eax, -0x424(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xfd70
movl -0x424(%rbp), %edx
movq %rax, %rcx
movq -0x220(%rbp), %rax
subl %ecx, %edx
movl 0x3a8(%rax), %ecx
addl %edx, %ecx
movl %ecx, 0x3a8(%rax)
addq $0x18, %rax
movq %rax, -0x420(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x418(%rbp)
jmp 0x1a61a
movq -0x420(%rbp), %rdi
movl -0x418(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x425(%rbp)
jne 0x1a694
movq -0x220(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x438(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x42c(%rbp)
jmp 0x1a66a
movq -0x438(%rbp), %rdi
movl -0x42c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
callq 0xf940
cmpq $0x0, %rax
sete %al
movb %al, -0x425(%rbp)
movb -0x425(%rbp), %al
testb $0x1, %al
jne 0x1a6a0
jmp 0x1a6a2
jmp 0x1a6c1
leaq 0x6bf00(%rip), %rdi     # 0x865a9
leaq 0x6bd7f(%rip), %rsi     # 0x8642f
movl $0x1cf, %edx            # imm = 0x1CF
leaq 0x6bf3e(%rip), %rcx     # 0x865fa
callq 0x4260
movl $0x1, -0x4(%rbp)
movl $0x1, -0x108(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xab00
leaq -0x180(%rbp), %rdi
callq 0xb3b0
leaq -0x120(%rbp), %rdi
callq 0xb3b0
jmp 0x1a706
leaq -0x120(%rbp), %rdi
callq 0xb3b0
jmp 0x1a72d
leaq -0x60(%rbp), %rdi
callq 0xab00
leaq -0x48(%rbp), %rdi
callq 0xab00
leaq -0x30(%rbp), %rdi
callq 0xab00
movl -0x4(%rbp), %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0xab00
leaq -0x48(%rbp), %rdi
callq 0xab00
leaq -0x30(%rbp), %rdi
callq 0xab00
movq -0x80(%rbp), %rdi
callq 0x4610
nopw %cs:(%rax,%rax)