// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/main.cpp
// Function: main
int main(int argc, char* argv[]){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	if ((argc > 1 && isHelp(argv[1])) || (argc > 2 && isHelp(argv[2])) || (argc > 3 && isHelp(argv[3]))) {
		printHelp(cout);
		return 0;
	}
	if (argc < 3) {
		cout<<"Use -help"<<endl;
		cout<<"Use -help"<<endl;
		return 0;
	}
	auto flags = getFlags(argc, argv);
	if (flags.count("h") || flags.count("help")) {
		printHelp(cout);
	}
	string type(argv[2]);
	assert(type == "solve" || type == "preprocess" || type == "reconstruct");
	string file(argv[1]);
	if (type == "reconstruct") {
		if (!flags.count("mapfile")) {
			cout<<"Give mapfile with -mapfile= flag"<<endl;
			cerr<<"Give mapfile with -mapfile= flag"<<endl;
			return 0;
		}
		string mapFile = flags["mapfile"];
		maxPreprocessor::OutputReader opr;
		ifstream in(file);
		int readStatus = opr.readSolution(in);
		in.close();
		if (readStatus > 0) {
			cout<<"Failed to parse solution"<<endl;
			cerr<<"Failed to parse solution"<<endl;
			return 0;
		}
		if (opr.status == 2) {
			cout<<"s UNSATISFIABLE"<<endl;
		}
		else {
			ifstream mapF(mapFile);
			int vars, ppVars, originalVars;
			mapF>>vars>>ppVars>>originalVars;
			vector<int> varMap(vars);
			for (int i = 0; i < vars; i++) mapF>>varMap[i];
			vector<int> trueLits;
			for (int lit : opr.trueLits) {
				if (abs(lit) > vars) continue;
				if (lit > 0) lit = varMap[abs(lit)-1];
				else lit = -varMap[abs(lit)-1];
				trueLits.push_back(lit);
			}
			maxPreprocessor::Trace trace;
			int traceLines;
			mapF>>traceLines;
			trace.operations.resize(traceLines);
			trace.data.resize(traceLines);
			for (int i = 0; i < traceLines; i++) {
				mapF>>trace.operations[i];
				int sz;
				mapF>>sz;
				trace.data[i].resize(sz);
				for (int j = 0; j < sz; j++) {
					mapF>>trace.data[i][j];
				}
			}
			trace.printSolution(cout, trueLits, opr.ansW, ppVars, originalVars);
		}
		return 0;
	}
	
	if (type == "solve") {
		// just check that -solver flag is used
		if (!(flags.count("solver") && flags["solver"].size() > 0)) {
			cout<<"Please specify the solver"<<endl;
			cerr<<"Please specify the solver"<<endl;
			return 0;
		}
	}
	
	string techniques = parseTechniques(flags);
	double timeLimit = parseTimeLimit(flags);
	bool BVEgate = parseBVEgate(flags);
	bool labelMatching = parseLabelMatching(flags);
	bool maxSat = parseProblemType(flags);
	int skipTechnique = parseSkipTechnique(flags);
  bool BVEsortMaxFirst = parseBVEsortMaxFirst(flags);
  int BVElocalGrow = parseBVElocalGrow(flags);
  int BVEglobalGrow = parseBVEglobalGrow(flags);
	
	ifstream instanceFile(file);
	if (instanceFile.fail()) {
		cout<<"Failed to read the input file"<<endl;
		cerr<<"Failed to read the input file"<<endl;
		return 0;
	}
	maxPreprocessor::InputReader inputReader;
	int readStatus = inputReader.readClauses(instanceFile, maxSat);
	instanceFile.close();
	
	if (readStatus > 0) {
		cout<<"Failed to parse input instance: "<<inputReader.readError<<endl;
		cerr<<"Failed to parse input instance: "<<inputReader.readError<<endl;
		return 0;
	}
	
	int outputFormat = maxPreprocessor::INPUT_FORMAT_WPMS;
	if (flags["outputformat"] == "original") {
		outputFormat = inputReader.inputFormat;
		if (outputFormat == maxPreprocessor::INPUT_FORMAT_MS) {
			// preprocessor works in labeled cnf so it cannot output pure maxsat
			outputFormat = maxPreprocessor::INPUT_FORMAT_WPMS;
		}
		string outf;
		if (outputFormat == maxPreprocessor::INPUT_FORMAT_WPMS) {
			outf = "weighted partial Max-SAT";
		}
		else if (outputFormat == maxPreprocessor::INPUT_FORMAT_SAT) {
			outf = "SAT";
		}
		else {
			return 0;
		}
		cout<<"c Outputformat "<<outf<<endl;
		cerr<<"Outputformat "<<outf<<endl;
	}
	
	int verb = parseVerb(flags);
	
	maxPreprocessor::PreprocessorInterface pif(inputReader.clauses, inputReader.weights, inputReader.top);
	pif.setBVEGateExtraction(BVEgate);
	pif.setLabelMatching(labelMatching);
	pif.setSkipTechnique(skipTechnique);
  pif.setBVEsortMaxFirst(BVEsortMaxFirst);
  pif.setBVElocalGrowLimit(BVElocalGrow);
  pif.setBVEglobalGrowLimit(BVEglobalGrow);

	maxPreprocessor::Timer preprocessTimer;
	preprocessTimer.start();
	
	pif.preprocess(techniques, verb, timeLimit);
	
	preprocessTimer.stop();
	
	cerr<<"Preprocess time: "<<preprocessTimer.getTime().count()<<endl;
	if (verb > 0) pif.printTimeLog(cerr);
	if (type == "preprocess") {
		if (verb > 0) pif.printTechniqueLog(cerr);
		pif.printTechniqueLog(cout);
		pif.printTimeLog(cout);
		pif.printInfoLog(cout);
		pif.printInstance(cout, outputFormat);
		
		if (flags.count("mapfile")) {
			string mapFile = flags["mapfile"];
			cout<<"c Outputting reconstruction map to "<<mapFile<<endl;
			cerr<<"Outputting reconstruction map to "<<mapFile<<endl;
			ofstream out(mapFile);
			pif.printMap(out);
			out.close();
		}
		else {
			cout<<"c No -mapfile= given, will not ouput reconstruction map"<<endl;
			cerr<<"No -mapfile= given, will not ouput reconstruction map"<<endl;
		}
	}
	if (type == "solve") {
		string solver;
		if (flags.count("solver") && flags["solver"].size() > 0) {
			solver = flags["solver"];
			cout<<"c Using solver "<<solver<<endl;
			cerr<<"Using solver "<<solver<<endl;
			cout<<"c Solver flags "<<flags["solverflags"]<<endl;
			cerr<<"Solver flags "<<flags["solverflags"]<<endl;
		}
		else {
			cout<<"Please specify the solver"<<endl;
			cerr<<"Please specify the solver"<<endl;
			return 0;
		}
		
		ofstream out("preprocessed.wcnf");
		pif.printInstance(out, outputFormat);
		out.close();
		
		maxPreprocessor::Timer solveTimer;
		solveTimer.start();
		if (system((solver + " preprocessed.wcnf " + flags["solverflags"] + " > sol0.sol").c_str())) {
			cout<<"Solver error"<<endl;
			cerr<<"Solver error"<<endl;
			return 0;
		}
		solveTimer.stop();
		
		maxPreprocessor::OutputReader opr;
		ifstream in("sol0.sol");
		readStatus = opr.readSolution(in);
		in.close();
		if (readStatus > 0) {
			cout<<"Failed to parse solution"<<endl;
			cerr<<"Failed to parse solution"<<endl;
			return 0;
		}
		
		if (opr.status == 2) {
			cout<<"s UNSATISFIABLE"<<endl;
		}
		else {
			pif.printSolution(opr.trueLits, cout, opr.ansW);
		}
		cerr<<"Preprocess time: "<<preprocessTimer.getTime().count()<<", Solve time: "<<solveTimer.getTime().count()<<endl;
		if (verb > 0) pif.printTimeLog(cerr);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20c8, %rsp           # imm = 0x20C8
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x3100
movq 0x3ed91(%rip), %rax     # 0x43fd8
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
andq $0x0, 0xd8(%rax,%rcx)
cmpl $0x2, %ebp
jl 0x527c
movq 0x8(%rbx), %rdi
callq 0x50ff
testl %eax, %eax
je 0x5277
movq 0x3ed58(%rip), %rdi     # 0x43fc8
callq 0x4b0b
jmp 0x52b0
cmpl $0x2, %ebp
jne 0x52c4
movq 0x3ed45(%rip), %rbx     # 0x43fc8
leaq 0x29d20(%rip), %r14     # 0x2efaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
xorl %eax, %eax
addq $0x20c8, %rsp           # imm = 0x20C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rdi
callq 0x50ff
testl %eax, %eax
jne 0x5269
cmpl $0x4, %ebp
jb 0x52e3
movq 0x18(%rbx), %rdi
callq 0x50ff
testl %eax, %eax
jne 0x5269
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x382c
leaq 0x29caf(%rip), %rsi     # 0x2efa8
leaq 0x830(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x682a
testq %rax, %rax
je 0x5334
leaq 0x830(%rsp), %rdi
callq 0x3130
jmp 0x5384
leaq 0x29c74(%rip), %rsi     # 0x2efaf
leaq 0x628(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x628(%rsp), %rsi
callq 0x682a
movq %rax, %r14
leaq 0x628(%rsp), %rdi
callq 0x3130
leaq 0x830(%rsp), %rdi
callq 0x3130
testq %r14, %r14
je 0x5390
movq 0x3ec3d(%rip), %rdi     # 0x43fc8
callq 0x4b0b
movq 0x10(%rbx), %rsi
leaq 0xa8(%rsp), %rdi
leaq 0x830(%rsp), %rdx
callq 0x6788
leaq 0x29c04(%rip), %rsi     # 0x2efb4
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
jne 0x53f5
leaq 0x29bf2(%rip), %rsi     # 0x2efba
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
jne 0x53f5
leaq 0x29be5(%rip), %rsi     # 0x2efc5
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
je 0x6498
movq 0x8(%rbx), %rsi
leaq 0x150(%rsp), %rdi
leaq 0x830(%rsp), %rdx
callq 0x6788
leaq 0x29bb0(%rip), %rsi     # 0x2efc5
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
je 0x553e
leaq 0x29c01(%rip), %rsi     # 0x2f032
leaq 0x830(%rsp), %rdi
leaq 0x628(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x682a
movq %rax, %rbx
leaq 0x830(%rsp), %rdi
callq 0x3130
testq %rbx, %rbx
je 0x56ce
leaq 0x29bba(%rip), %rsi     # 0x2f032
leaq 0x830(%rsp), %rdi
leaq 0x628(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x67c4
leaq 0x3a0(%rsp), %rdi
movq %rax, %rsi
callq 0x33a0
leaq 0x830(%rsp), %rdi
callq 0x3130
leaq 0x430(%rsp), %r14
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x830(%rsp), %rdi
leaq 0x150(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x3440
leaq 0x428(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x20070
movl %eax, %ebx
leaq 0x830(%rsp), %rdi
callq 0x3070
testl %ebx, %ebx
jle 0x57a8
movq 0x3eaad(%rip), %rdi     # 0x43fc8
leaq 0x29b39(%rip), %rbx     # 0x2f05b
movq %rbx, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3eab7(%rip), %rdi     # 0x43ff0
jmp 0x57c4
leaq 0x29a6f(%rip), %rsi     # 0x2efb4
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
je 0x55e6
leaq 0x2955a(%rip), %rsi     # 0x2eabb
leaq 0x830(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x682a
testq %rax, %rax
je 0x57f6
leaq 0x29523(%rip), %rsi     # 0x2eabb
leaq 0x628(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x628(%rsp), %rsi
callq 0x67c4
movq 0x8(%rax), %rbx
leaq 0x628(%rsp), %rdi
callq 0x3130
leaq 0x830(%rsp), %rdi
callq 0x3130
testq %rbx, %rbx
je 0x5803
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3a3b
leaq 0x18(%rsp), %rdi
callq 0x3b78
movsd %xmm0, 0x108(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x3d07
movl %eax, %r15d
leaq 0x18(%rsp), %rdi
callq 0x3e94
movb %al, 0xf(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x4021
movl %eax, %r14d
leaq 0x18(%rsp), %rdi
callq 0x4276
movl %eax, %ebx
leaq 0x18(%rsp), %rdi
callq 0x443b
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x45c8
movl %eax, %r13d
leaq 0x18(%rsp), %rdi
callq 0x478d
movl %eax, %r12d
leaq 0x628(%rsp), %rdi
leaq 0x150(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x3440
movq 0x628(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x648(%rsp,%rax)
je 0x56f1
movq 0x3e92e(%rip), %rdi     # 0x43fc8
leaq 0x299fd(%rip), %rsi     # 0x2f09e
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3e93b(%rip), %rdi     # 0x43ff0
leaq 0x299e2(%rip), %rsi     # 0x2f09e
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x6455
movq 0x3e8f3(%rip), %rdi     # 0x43fc8
leaq 0x2995e(%rip), %rbx     # 0x2f03a
movq %rbx, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x5821
leaq 0x3c0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
andq $0x0, 0x60(%rax)
movzbl %r14b, %edx
leaq 0x3a0(%rsp), %rdi
leaq 0x628(%rsp), %rsi
callq 0x1f362
movl %eax, %r14d
leaq 0x628(%rsp), %rdi
callq 0x3070
testl %r14d, %r14d
jle 0x5ab1
movq 0x3e872(%rip), %rdi     # 0x43fc8
leaq 0x2995f(%rip), %rsi     # 0x2f0bc
callq 0x32a0
leaq 0x3b0(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x3e86c(%rip), %rdi     # 0x43ff0
leaq 0x29931(%rip), %rsi     # 0x2f0bc
callq 0x32a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3140
jmp 0x6448
cmpl $0x2, 0x428(%rsp)
jne 0x583d
leaq 0x298b7(%rip), %rbx     # 0x2f074
movq 0x3e804(%rip), %rdi     # 0x43fc8
movq %rbx, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
leaq 0x830(%rsp), %rdi
callq 0x3090
movq %r14, %rdi
callq 0x7512
leaq 0x3a0(%rsp), %rdi
jmp 0x646a
leaq 0x830(%rsp), %rdi
callq 0x3130
movq 0x3e7be(%rip), %rdi     # 0x43fc8
leaq 0x29873(%rip), %rbx     # 0x2f084
movq %rbx, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3e7c8(%rip), %rdi     # 0x43ff0
movq %rbx, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x646f
leaq 0x628(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x3440
leaq 0x628(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x31a0
leaq 0x110(%rsp), %rsi
movq %rax, %rdi
callq 0x31a0
leaq 0x130(%rsp), %rsi
movq %rax, %rdi
callq 0x31a0
movslq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x6852
xorl %r15d, %r15d
leaq 0x628(%rsp), %rbx
xorl %r14d, %r14d
movslq 0x70(%rsp), %rax
cmpq %rax, %r14
jge 0x58cf
movq 0x48(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x31a0
incq %r14
addq $0x4, %r15
jmp 0x58ac
xorps %xmm0, %xmm0
leaq 0xe0(%rsp), %rbx
andq $0x0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq 0x430(%rsp), %r12
movq 0x438(%rsp), %r13
leaq 0x190(%rsp), %r15
cmpq %r13, %r12
je 0x5943
movl (%r12), %eax
movl %eax, 0x190(%rsp)
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl 0x70(%rsp), %ecx
jg 0x593d
movq 0x48(%rsp), %rdx
movl %ecx, %ecx
movl -0x4(%rdx,%rcx,4), %ecx
movl %ecx, %edx
negl %edx
testl %eax, %eax
cmovgl %ecx, %edx
movl %edx, 0x190(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x68a4
addq $0x4, %r12
jmp 0x58fa
xorps %xmm0, %xmm0
movaps %xmm0, 0x1b0(%rsp)
movaps %xmm0, 0x1a0(%rsp)
movaps %xmm0, 0x190(%rsp)
andq $0x0, 0x1c0(%rsp)
leaq 0x628(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x31a0
leaq 0x198(%rsp), %rdi
movslq 0x90(%rsp), %rsi
callq 0x68c2
leaq 0x1b0(%rsp), %rdi
movslq 0x90(%rsp), %rsi
callq 0x68f4
xorl %r12d, %r12d
leaq 0x628(%rsp), %rbx
leaq 0xc8(%rsp), %r15
movslq 0x90(%rsp), %rax
cmpq %rax, %r12
jge 0x5a3f
leaq (,%r12,4), %rsi
addq 0x198(%rsp), %rsi
movq %rbx, %rdi
callq 0x31a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31a0
imulq $0x18, %r12, %r13
movq 0x1b0(%rsp), %rdi
addq %r13, %rdi
movslq 0xc8(%rsp), %rsi
callq 0x68c2
xorl %ebp, %ebp
xorl %r14d, %r14d
movslq 0xc8(%rsp), %rax
cmpq %rax, %r14
jge 0x5a37
movq 0x1b0(%rsp), %rax
movq (%rax,%r13), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0x31a0
incq %r14
addq $0x4, %rbp
jmp 0x5a0a
incq %r12
jmp 0x59b9
movq 0x448(%rsp), %rcx
movl 0x110(%rsp), %r8d
movl 0x130(%rsp), %r9d
movq 0x3e56a(%rip), %rsi     # 0x43fc8
leaq 0x190(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x20e10
leaq 0x190(%rsp), %rdi
callq 0x692a
leaq 0xe0(%rsp), %rdi
callq 0x7512
leaq 0x48(%rsp), %rdi
callq 0x7512
leaq 0x628(%rsp), %rdi
callq 0x3090
leaq 0x430(%rsp), %r14
jmp 0x57d4
leaq 0x29625(%rip), %rsi     # 0x2f0dd
leaq 0x830(%rsp), %rdi
leaq 0x190(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x67c4
leaq 0x29604(%rip), %rsi     # 0x2f0ea
movq %rax, %rdi
callq 0x6844
movl %eax, %r14d
leaq 0x830(%rsp), %rdi
callq 0x3130
testb %r14b, %r14b
je 0x5b42
movl 0x3d8(%rsp), %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovnel %eax, %ecx
leaq 0x840(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x1, %ecx
movl %ecx, 0x10(%rsp)
je 0x5b4b
cmpl $0x3, %ecx
jne 0x5ed0
leaq 0x2869e(%rip), %rsi     # 0x2e1de
jmp 0x5b52
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
jmp 0x5bc2
leaq 0x295a1(%rip), %rsi     # 0x2f0f3
leaq 0x830(%rsp), %rdi
callq 0x34d0
movq 0x3e462(%rip), %rdi     # 0x43fc8
leaq 0x2959f(%rip), %rsi     # 0x2f10c
callq 0x32a0
leaq 0x830(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x3e45f(%rip), %rdi     # 0x43ff0
leaq 0x29576(%rip), %rsi     # 0x2f10e
callq 0x32a0
leaq 0x830(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
leaq 0x830(%rsp), %rdi
callq 0x3130
leaq 0x18(%rsp), %rdi
callq 0x4952
movl %eax, %r14d
leaq 0x3e0(%rsp), %rsi
leaq 0x3f8(%rsp), %rdx
movq -0x28(%rdx), %rcx
leaq 0x830(%rsp), %rdi
xorl %r8d, %r8d
callq 0x28afc
movzbl %r15b, %esi
leaq 0x830(%rsp), %rdi
callq 0x296f8
movzbl 0xf(%rsp), %esi
leaq 0x830(%rsp), %rdi
callq 0x29700
leaq 0x830(%rsp), %rdi
movl %ebx, %esi
callq 0x29708
movzbl %bpl, %esi
leaq 0x830(%rsp), %rdi
callq 0x29710
leaq 0x830(%rsp), %rdi
movl %r13d, %esi
callq 0x29718
leaq 0x830(%rsp), %rdi
movl %r12d, %esi
callq 0x29720
leaq 0x90(%rsp), %rdi
callq 0x21ad4
leaq 0x90(%rsp), %rdi
callq 0x21ae0
leaq 0x170(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x33a0
leaq 0x830(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl %r14d, %edx
movsd 0x108(%rsp), %xmm0
callq 0x28c9a
leaq 0x170(%rsp), %rdi
callq 0x3130
leaq 0x90(%rsp), %rdi
callq 0x21af8
movq 0x3e329(%rip), %rdi     # 0x43ff0
leaq 0x2944e(%rip), %rsi     # 0x2f11c
callq 0x32a0
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x21b26
movq %rbx, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x3140
testl %r14d, %r14d
je 0x5d0c
movq 0x3e2f1(%rip), %rsi     # 0x43ff0
leaq 0x830(%rsp), %rdi
callq 0x29afc
leaq 0x292a7(%rip), %rsi     # 0x2efba
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
je 0x5f18
testl %r14d, %r14d
je 0x5d41
movq 0x3e2bc(%rip), %rsi     # 0x43ff0
leaq 0x830(%rsp), %rdi
callq 0x29af0
movq 0x3e280(%rip), %rsi     # 0x43fc8
leaq 0x830(%rsp), %rdi
callq 0x29af0
movq 0x3e26c(%rip), %rsi     # 0x43fc8
leaq 0x830(%rsp), %rdi
callq 0x29afc
movq 0x3e258(%rip), %rsi     # 0x43fc8
leaq 0x830(%rsp), %rdi
callq 0x29b08
movq 0x3e244(%rip), %rsi     # 0x43fc8
leaq 0x830(%rsp), %rdi
movl 0x10(%rsp), %edx
callq 0x29728
leaq 0x29296(%rip), %rsi     # 0x2f032
leaq 0x190(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x682a
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x3130
testq %rbx, %rbx
je 0x5ee2
leaq 0x2924f(%rip), %rsi     # 0x2f032
leaq 0x190(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x67c4
leaq 0x428(%rsp), %rdi
movq %rax, %rsi
callq 0x33a0
leaq 0x190(%rsp), %rdi
callq 0x3130
movq 0x3e19d(%rip), %rdi     # 0x43fc8
leaq 0x292fc(%rip), %rsi     # 0x2f12e
callq 0x32a0
leaq 0x428(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x3e19a(%rip), %rdi     # 0x43ff0
leaq 0x292d3(%rip), %rsi     # 0x2f130
callq 0x32a0
leaq 0x428(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
leaq 0x190(%rsp), %rdi
leaq 0x428(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x34e0
leaq 0x830(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x29b14
leaq 0x190(%rsp), %rdi
callq 0x33b0
leaq 0x190(%rsp), %rdi
callq 0x33e0
leaq 0x428(%rsp), %rdi
callq 0x3130
jmp 0x5f18
leaq 0x830(%rsp), %rdi
callq 0x3130
jmp 0x6448
movq 0x3e0df(%rip), %rdi     # 0x43fc8
leaq 0x29262(%rip), %rsi     # 0x2f152
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3e0ec(%rip), %rdi     # 0x43ff0
leaq 0x29249(%rip), %rsi     # 0x2f154
callq 0x32a0
movq %rax, %rdi
callq 0x3140
leaq 0x29095(%rip), %rsi     # 0x2efb4
leaq 0xa8(%rsp), %rdi
callq 0x6844
testb %al, %al
je 0x643b
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x28b6c(%rip), %rsi     # 0x2eabb
leaq 0x190(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x682a
testq %rax, %rax
je 0x627d
leaq 0x28b38(%rip), %rsi     # 0x2eabb
leaq 0x428(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0x67c4
movq 0x8(%rax), %rbx
leaq 0x428(%rsp), %rdi
callq 0x3130
leaq 0x190(%rsp), %rdi
callq 0x3130
testq %rbx, %rbx
je 0x628a
leaq 0x28ae3(%rip), %rsi     # 0x2eabb
leaq 0x190(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x67c4
leaq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x3160
leaq 0x190(%rsp), %rdi
callq 0x3130
movq 0x3dfa8(%rip), %rdi     # 0x43fc8
leaq 0x29163(%rip), %rsi     # 0x2f18a
callq 0x32a0
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x3dfa8(%rip), %rdi     # 0x43ff0
leaq 0x2913d(%rip), %rsi     # 0x2f18c
callq 0x32a0
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x3df58(%rip), %rdi     # 0x43fc8
leaq 0x29123(%rip), %rsi     # 0x2f19a
callq 0x32a0
movq %rax, %rbx
leaq 0x29124(%rip), %rsi     # 0x2f1aa
leaq 0x190(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x67c4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3140
leaq 0x190(%rsp), %rdi
callq 0x3130
movq 0x3df1c(%rip), %rdi     # 0x43ff0
leaq 0x290c1(%rip), %rsi     # 0x2f19c
callq 0x32a0
movq %rax, %rbx
leaq 0x290c0(%rip), %rsi     # 0x2f1aa
leaq 0x190(%rsp), %rdi
leaq 0x428(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x67c4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3140
leaq 0x190(%rsp), %rdi
callq 0x3130
leaq 0x2841f(%rip), %rsi     # 0x2e557
leaq 0x428(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x32f0
leaq 0x830(%rsp), %rdi
leaq 0x428(%rsp), %rsi
movl 0x10(%rsp), %edx
callq 0x29728
leaq 0x428(%rsp), %rdi
callq 0x33b0
leaq 0xc8(%rsp), %rdi
callq 0x21ad4
leaq 0xc8(%rsp), %rdi
callq 0x21ae0
leaq 0x29027(%rip), %rdx     # 0x2f1b6
leaq 0x110(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x6982
leaq 0x29002(%rip), %rsi     # 0x2f1aa
leaq 0x130(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x6788
leaq 0x18(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x67c4
leaq 0x48(%rsp), %rdi
leaq 0x110(%rsp), %rsi
movq %rax, %rdx
callq 0x6963
leaq 0x2839e(%rip), %rdx     # 0x2e586
leaq 0x190(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x6944
movq 0x190(%rsp), %rdi
callq 0x3270
movl %eax, %ebx
leaq 0x190(%rsp), %rdi
callq 0x3130
leaq 0x48(%rsp), %rdi
callq 0x3130
leaq 0x130(%rsp), %rdi
callq 0x3130
leaq 0x110(%rsp), %rdi
callq 0x3130
testl %ebx, %ebx
je 0x62c5
movq 0x3dd7f(%rip), %rdi     # 0x43fc8
leaq 0x28f7a(%rip), %rsi     # 0x2f1ca
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3dd8c(%rip), %rdi     # 0x43ff0
leaq 0x28f5f(%rip), %rsi     # 0x2f1ca
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x6424
leaq 0x190(%rsp), %rdi
callq 0x3130
movq 0x3dd37(%rip), %rdi     # 0x43fc8
leaq 0x28dec(%rip), %rsi     # 0x2f084
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3dd44(%rip), %rdi     # 0x43ff0
leaq 0x28dd1(%rip), %rsi     # 0x2f084
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x6431
leaq 0xc8(%rsp), %rdi
callq 0x21af8
movl %r14d, %ebp
leaq 0x50(%rsp), %r14
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x2829c(%rip), %rsi     # 0x2e589
leaq 0x190(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x34b0
leaq 0x48(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x20070
movl %eax, %ebx
leaq 0x190(%rsp), %rdi
callq 0x3070
testl %ebx, %ebx
jle 0x635d
movq 0x3dc9f(%rip), %rdi     # 0x43fc8
leaq 0x28d2b(%rip), %rsi     # 0x2f05b
callq 0x32a0
movq %rax, %rdi
callq 0x3140
movq 0x3dcac(%rip), %rdi     # 0x43ff0
leaq 0x28d10(%rip), %rsi     # 0x2f05b
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x640f
cmpl $0x2, 0x48(%rsp)
jne 0x6381
movq 0x3dc5d(%rip), %rdi     # 0x43fc8
leaq 0x28d02(%rip), %rsi     # 0x2f074
callq 0x32a0
movq %rax, %rdi
callq 0x3140
jmp 0x639d
movq 0x68(%rsp), %rcx
movq 0x3dc3b(%rip), %rdx     # 0x43fc8
leaq 0x830(%rsp), %rdi
movq %r14, %rsi
callq 0x2902a
movq 0x3dc4c(%rip), %rdi     # 0x43ff0
leaq 0x28d71(%rip), %rsi     # 0x2f11c
callq 0x32a0
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x21b26
movq %rbx, %rdi
callq 0x3430
leaq 0x28e08(%rip), %rsi     # 0x2f1d7
movq %rax, %rdi
callq 0x32a0
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x21b26
movq %rbx, %rdi
callq 0x3430
movq %rax, %rdi
callq 0x3140
testl %ebp, %ebp
je 0x640f
movq 0x3dbee(%rip), %rsi     # 0x43ff0
leaq 0x830(%rsp), %rdi
callq 0x29afc
leaq 0x190(%rsp), %rdi
callq 0x3090
movq %r14, %rdi
callq 0x7512
leaq 0x428(%rsp), %rdi
callq 0x33e0
leaq 0x70(%rsp), %rdi
callq 0x3130
leaq 0x830(%rsp), %rdi
callq 0x69ba
leaq 0x3a0(%rsp), %rdi
callq 0x69f0
leaq 0x628(%rsp), %rdi
callq 0x3090
leaq 0xe0(%rsp), %rdi
callq 0x3130
leaq 0x150(%rsp), %rdi
callq 0x3130
leaq 0xa8(%rsp), %rdi
callq 0x3130
leaq 0x18(%rsp), %rdi
callq 0x6a28
jmp 0x52b0
leaq 0x28b32(%rip), %rdi     # 0x2efd1
leaq 0x28b6c(%rip), %rsi     # 0x2f012
leaq 0x28b6e(%rip), %rcx     # 0x2f01b
movl $0x17f, %edx            # imm = 0x17F
callq 0x31c0
movq %rax, %rbx
jmp 0x6559
jmp 0x6549
jmp 0x6549
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x3130
jmp 0x64de
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3130
jmp 0x6529
movq %rax, %rbx
jmp 0x6536
jmp 0x65a1
jmp 0x65e5
jmp 0x65e5
jmp 0x65e5
jmp 0x65e5
jmp 0x65d8
movq %rax, %rbx
leaq 0x428(%rsp), %rdi
callq 0x3130
jmp 0x6573
jmp 0x6570
jmp 0x665c
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x3130
leaq 0x110(%rsp), %rdi
callq 0x3130
jmp 0x65a4
jmp 0x65a1
jmp 0x6570
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x3090
movq %r14, %rdi
callq 0x7512
jmp 0x65a4
jmp 0x6570
jmp 0x65e5
jmp 0x6594
jmp 0x665c
jmp 0x6570
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x3130
jmp 0x65e8
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x33e0
jmp 0x65db
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x65ed
movq %rax, %rbx
leaq 0x428(%rsp), %rdi
callq 0x33e0
jmp 0x65e8
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x65ed
jmp 0x6696
jmp 0x6696
jmp 0x65f4
jmp 0x6696
jmp 0x661f
jmp 0x66f3
movq %rax, %rbx
leaq 0x428(%rsp), %rdi
jmp 0x65ed
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3130
jmp 0x665f
movq %rax, %rbx
leaq 0x830(%rsp), %rdi
callq 0x3130
jmp 0x6699
jmp 0x665c
movq %rax, %rbx
leaq 0x628(%rsp), %rdi
callq 0x3130
jmp 0x6689
jmp 0x6686
movq %rax, %rbx
jmp 0x6728
jmp 0x6701
jmp 0x665c
jmp 0x6686
jmp 0x66ee
movq %rax, %rbx
jmp 0x6742
jmp 0x66ee
jmp 0x6652
jmp 0x6652
jmp 0x6652
jmp 0x6652
jmp 0x6652
jmp 0x6652
jmp 0x6652
jmp 0x6652
movq %rax, %rbx
jmp 0x66ba
jmp 0x66ee
movq %rax, %rbx
leaq 0x830(%rsp), %rdi
callq 0x69ba
jmp 0x6699
movq %rax, %rbx
leaq 0x628(%rsp), %rdi
callq 0x3130
jmp 0x66d9
jmp 0x66d6
jmp 0x6686
jmp 0x66ee
movq %rax, %rbx
leaq 0x830(%rsp), %rdi
jmp 0x6757
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x69f0
jmp 0x66ad
jmp 0x66e6
movq %rax, %rbx
leaq 0x628(%rsp), %rdi
callq 0x3090
leaq 0xe0(%rsp), %rdi
jmp 0x6757
movq %rax, %rbx
jmp 0x6711
movq %rax, %rbx
jmp 0x6769
jmp 0x66e6
movq %rax, %rbx
leaq 0x830(%rsp), %rdi
jmp 0x6771
movq %rax, %rbx
jmp 0x6776
movq %rax, %rbx
jmp 0x675c
movq %rax, %rbx
jmp 0x6735
jmp 0x6701
movq %rax, %rbx
jmp 0x671e
jmp 0x6701
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x692a
leaq 0xe0(%rsp), %rdi
callq 0x7512
leaq 0x48(%rsp), %rdi
callq 0x7512
leaq 0x628(%rsp), %rdi
callq 0x3090
leaq 0x830(%rsp), %rdi
callq 0x3090
leaq 0x430(%rsp), %rdi
callq 0x7512
leaq 0x3a0(%rsp), %rdi
callq 0x3130
leaq 0x150(%rsp), %rdi
callq 0x3130
leaq 0xa8(%rsp), %rdi
callq 0x3130
leaq 0x18(%rsp), %rdi
callq 0x6a28
movq %rbx, %rdi
callq 0x3490