// File: Laakeri[P]maxpre/src/inputreader.cpp
// Function: maxPreprocessor::InputReader::readCardinalityConstraint(std::istream&)
int InputReader::readCardinalityConstraint(istream& inputF) {
	string inputLine;
	getline(inputF, inputLine);
	stringstream input(inputLine);
	string coding;
	input>>coding;
	if (input.fail()) return 1;
	int codingN;
	if (coding == "CARD") {
		codingN = CardinalityConstraint::CODING_DEFAULT;
	}
	else {
		return 1;
	}
	
	vector<int> inputLiterals;
	vector<int> outputLiterals;
	vector<int> addLiterals;
	string in;
	string compr;
	int p = 0;
	int k = 0;
	bool foundK = false;
	bool iff = 0;
	while (!input.eof() && input>>in) {
		if (input.fail()) return 1;
		if (in == "=" || in == ">=" || in == "<=" || in == ">" || in == "<" || in == "==" || in == "!=" || in == "<:" || in == ">:" || in == "::") {
			if (p != 0) return 1;
			compr = in;
			p = 1;
		}
		else if (in == "OUT") {
			if (p > 1) return 1;
			p = 2;
		}
		else if (in == "ADD") {
			if (p == 0 || p > 2) return 1;
			p = 3;
		}
		else if (in == "IFF") {
			iff = true;
		}
		else {
			stringstream ss;
			ss<<in;
			int t;
			ss>>t;
			if (!ss.eof()) return 1;
			if (ss.fail()) return 1;
			if (p == 0) {
				if (t == 0) return 1;
				inputLiterals.push_back(t);
			}
			else if (p == 1) {
				if (foundK && t == 0) break;
				if (foundK) return 1;
				foundK = true;
				k = t;
			}
			else if (p == 2) {
				if (t == 0) break;
				outputLiterals.push_back(t);
			}
			else if (p == 3) {
				if (t == 0) break;
				addLiterals.push_back(t);
			}
		}
		input>>ws;
	}
	if (!foundK) return 1;
	if (input.fail()) return 1;
	if (inputLiterals.size() == 0) return 1;
	if (compr == ">") {
		compr = ">=";
		k++;
	}
	if (compr == "<") {
		compr = "<=";
		k--;
	}
	if (compr == "==") compr = "=";
	
	int type = -1;
	
	if (compr == ">=") {
		compr = "<=";
		k = (int)inputLiterals.size() - k;
		for (int& lit : inputLiterals) {
			lit = -lit;
		}
	}
	
	if (compr == "<=") type = CardinalityConstraint::CONSTRAINT_LESS_EQ;
	else if (compr == "=") type = CardinalityConstraint::CONSTRAINT_EQUAL;
	else if (compr == "!=") type = CardinalityConstraint::CONSTRAINT_NEQUAL;
	else if (compr == "<:") type = CardinalityConstraint::CONSTRAINT_ALL_LESS;
	else if (compr == ">:") type = CardinalityConstraint::CONSTRAINT_ALL_GREATER;
	else if (compr == "::") type = CardinalityConstraint::CONSTRAINT_ALL_BOTH;
	else return 1;
	
	if (type == CardinalityConstraint::CONSTRAINT_ALL_LESS || type == CardinalityConstraint::CONSTRAINT_ALL_GREATER || type == CardinalityConstraint::CONSTRAINT_ALL_BOTH) {
		if (k != (int)outputLiterals.size()) return 1;
		if (k > (int)inputLiterals.size()) return 1;
		if (k <= 0) return 1;
	}
	else {
		if (outputLiterals.size() > 1) return 1;
	}
	
	if (outputLiterals.size() == 0) {
		iff = false;
	}
	if (type == CardinalityConstraint::CONSTRAINT_ALL_BOTH) {
		iff = true;
	}
	cardinalityConstraints.push_back(CardinalityConstraint(type, codingN, inputLiterals, outputLiterals, k, addLiterals, iff));
	if (input.fail()) return 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x4b0(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x4500
movq -0x4a8(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x40a0
jmp 0x585a0
movl $0x10, %edi
movl $0x8, %esi
callq 0x5a800
movl %eax, -0x4b4(%rbp)
jmp 0x585b7
movl -0x4b4(%rbp), %edx
leaq -0x1d0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4580
jmp 0x585cf
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x4500
movq -0x4c0(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x44c0
jmp 0x585f7
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x4c1(%rbp)
jmp 0x58617
movb -0x4c1(%rbp), %al
testb $0x1, %al
jne 0x58623
jmp 0x5865b
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x592f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5933b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x59323
leaq 0x2eb96(%rip), %rsi     # 0x871f8
leaq -0x1f0(%rbp), %rdi
callq 0xa640
movb %al, -0x4c2(%rbp)
jmp 0x58676
movb -0x4c2(%rbp), %al
testb $0x1, %al
jne 0x58682
jmp 0x5868e
movl $0x1, -0x1f8(%rbp)
jmp 0x586a4
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x592f6
leaq -0x210(%rbp), %rdi
callq 0xa7e0
leaq -0x228(%rbp), %rdi
callq 0xa7e0
leaq -0x240(%rbp), %rdi
callq 0xa7e0
leaq -0x260(%rbp), %rdi
callq 0x4500
leaq -0x280(%rbp), %rdi
callq 0x4500
movl $0x0, -0x284(%rbp)
movl $0x0, -0x288(%rbp)
movb $0x0, -0x289(%rbp)
movb $0x0, -0x28a(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x4650
movb %al, -0x4c3(%rbp)
jmp 0x58722
movb -0x4c3(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4c4(%rbp)
jne 0x5877f
jmp 0x58737
leaq -0x1d0(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x44c0
movq %rax, -0x4d0(%rbp)
jmp 0x58753
movq -0x4d0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x44b0
movb %al, -0x4d1(%rbp)
jmp 0x58771
movb -0x4d1(%rbp), %al
movb %al, -0x4c4(%rbp)
jmp 0x5877f
movb -0x4c4(%rbp), %al
testb $0x1, %al
jne 0x5878e
jmp 0x58ceb
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x4d2(%rbp)
jmp 0x587ae
movb -0x4d2(%rbp), %al
testb $0x1, %al
jne 0x587ba
jmp 0x587e1
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x592b8
leaq 0x2ea23(%rip), %rsi     # 0x8720b
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d3(%rbp)
jmp 0x587fc
movb -0x4d3(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x5880c
leaq 0x2e9ea(%rip), %rsi     # 0x871fd
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d4(%rbp)
jmp 0x58827
movb -0x4d4(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x58837
leaq 0x2e9c2(%rip), %rsi     # 0x87200
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d5(%rbp)
jmp 0x58852
movb -0x4d5(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x58862
leaq 0x2e99a(%rip), %rsi     # 0x87203
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d6(%rbp)
jmp 0x5887d
movb -0x4d6(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x5888d
leaq 0x2e971(%rip), %rsi     # 0x87205
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d7(%rbp)
jmp 0x588a8
movb -0x4d7(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x588b8
leaq 0x2e948(%rip), %rsi     # 0x87207
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d8(%rbp)
jmp 0x588d3
movb -0x4d8(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x588e3
leaq 0x2e920(%rip), %rsi     # 0x8720a
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4d9(%rbp)
jmp 0x588fe
movb -0x4d9(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x5890a
leaq 0x2e8fc(%rip), %rsi     # 0x8720d
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4da(%rbp)
jmp 0x58925
movb -0x4da(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x58931
leaq 0x2e8d8(%rip), %rsi     # 0x87210
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4db(%rbp)
jmp 0x5894c
movb -0x4db(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x58958
leaq 0x2e8b4(%rip), %rsi     # 0x87213
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4dc(%rbp)
jmp 0x58973
movb -0x4dc(%rbp), %al
testb $0x1, %al
jne 0x5897f
jmp 0x589c2
cmpl $0x0, -0x284(%rbp)
je 0x5899e
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
leaq -0x280(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x4060
jmp 0x589b3
movl $0x1, -0x284(%rbp)
jmp 0x58cd1
leaq 0x2e84d(%rip), %rsi     # 0x87216
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4dd(%rbp)
jmp 0x589dd
movb -0x4dd(%rbp), %al
testb $0x1, %al
jne 0x589e9
jmp 0x58a17
cmpl $0x1, -0x284(%rbp)
jle 0x58a08
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movl $0x2, -0x284(%rbp)
jmp 0x58ccf
leaq 0x2e7fc(%rip), %rsi     # 0x8721a
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4de(%rbp)
jmp 0x58a32
movb -0x4de(%rbp), %al
testb $0x1, %al
jne 0x58a3e
jmp 0x58a75
cmpl $0x0, -0x284(%rbp)
je 0x58a50
cmpl $0x2, -0x284(%rbp)
jle 0x58a66
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movl $0x3, -0x284(%rbp)
jmp 0x58ccd
leaq 0x2e7a2(%rip), %rsi     # 0x8721e
leaq -0x260(%rbp), %rdi
callq 0xa640
movb %al, -0x4df(%rbp)
jmp 0x58a90
movb -0x4df(%rbp), %al
testb $0x1, %al
jne 0x58a9c
jmp 0x58aa8
movb $0x1, -0x28a(%rbp)
jmp 0x58ccb
leaq -0x418(%rbp), %rdi
callq 0x42b0
jmp 0x58ab6
leaq -0x408(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x4370
jmp 0x58acb
leaq -0x418(%rbp), %rdi
leaq -0x41c(%rbp), %rsi
callq 0x4230
jmp 0x58ae0
movq -0x418(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x418(%rbp,%rax), %rdi
callq 0x4650
movb %al, -0x4e0(%rbp)
jmp 0x58b00
movb -0x4e0(%rbp), %al
testb $0x1, %al
jne 0x58b3f
jmp 0x58b0c
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x58c9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x42e0
jmp 0x592b8
movq -0x418(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x418(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x4e1(%rbp)
jmp 0x58b5f
movb -0x4e1(%rbp), %al
testb $0x1, %al
jne 0x58b6b
jmp 0x58b81
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x58c9b
cmpl $0x0, -0x284(%rbp)
jne 0x58bc3
cmpl $0x0, -0x41c(%rbp)
jne 0x58ba9
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x58c9b
leaq -0x210(%rbp), %rdi
leaq -0x41c(%rbp), %rsi
callq 0xa8c0
jmp 0x58bbe
jmp 0x58c91
cmpl $0x1, -0x284(%rbp)
jne 0x58c21
testb $0x1, -0x289(%rbp)
je 0x58bed
cmpl $0x0, -0x41c(%rbp)
jne 0x58bed
movl $0x3, -0x1f4(%rbp)
jmp 0x58c9b
testb $0x1, -0x289(%rbp)
je 0x58c0c
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x58c9b
movb $0x1, -0x289(%rbp)
movl -0x41c(%rbp), %eax
movl %eax, -0x288(%rbp)
jmp 0x58c8f
cmpl $0x2, -0x284(%rbp)
jne 0x58c56
cmpl $0x0, -0x41c(%rbp)
jne 0x58c3f
movl $0x3, -0x1f4(%rbp)
jmp 0x58c9b
leaq -0x228(%rbp), %rdi
leaq -0x41c(%rbp), %rsi
callq 0xa8c0
jmp 0x58c54
jmp 0x58c8d
cmpl $0x3, -0x284(%rbp)
jne 0x58c8b
cmpl $0x0, -0x41c(%rbp)
jne 0x58c74
movl $0x3, -0x1f4(%rbp)
jmp 0x58c9b
leaq -0x240(%rbp), %rdi
leaq -0x41c(%rbp), %rsi
callq 0xa8c0
jmp 0x58c89
jmp 0x58c8b
jmp 0x58c8d
jmp 0x58c8f
jmp 0x58c91
movl $0x0, -0x1f4(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x42e0
movl -0x1f4(%rbp), %eax
movl %eax, -0x4e8(%rbp)
testl %eax, %eax
je 0x58cc9
jmp 0x58cb9
movl -0x4e8(%rbp), %eax
subl $0x3, %eax
je 0x58ceb
jmp 0x5927a
jmp 0x58ccb
jmp 0x58ccd
jmp 0x58ccf
jmp 0x58cd1
movq 0x562e8(%rip), %rsi     # 0xaefc0
leaq -0x1d0(%rbp), %rdi
callq 0x4120
jmp 0x58ce6
jmp 0x58702
testb $0x1, -0x289(%rbp)
jne 0x58d0a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x4e9(%rbp)
jmp 0x58d2a
movb -0x4e9(%rbp), %al
testb $0x1, %al
jne 0x58d36
jmp 0x58d4c
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
leaq -0x210(%rbp), %rdi
callq 0xf940
cmpq $0x0, %rax
jne 0x58d74
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
leaq 0x2e488(%rip), %rsi     # 0x87203
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4ea(%rbp)
jmp 0x58d8f
movb -0x4ea(%rbp), %al
testb $0x1, %al
jne 0x58d9b
jmp 0x58dbf
leaq 0x2e45b(%rip), %rsi     # 0x871fd
leaq -0x280(%rbp), %rdi
callq 0x44f0
jmp 0x58db0
movl -0x288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x288(%rbp)
leaq 0x2e43f(%rip), %rsi     # 0x87205
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4eb(%rbp)
jmp 0x58dda
movb -0x4eb(%rbp), %al
testb $0x1, %al
jne 0x58de6
jmp 0x58e0a
leaq 0x2e413(%rip), %rsi     # 0x87200
leaq -0x280(%rbp), %rdi
callq 0x44f0
jmp 0x58dfb
movl -0x288(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x288(%rbp)
leaq 0x2e3f6(%rip), %rsi     # 0x87207
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4ec(%rbp)
jmp 0x58e25
movb -0x4ec(%rbp), %al
testb $0x1, %al
jne 0x58e31
jmp 0x58e48
leaq 0x2e3d3(%rip), %rsi     # 0x8720b
leaq -0x280(%rbp), %rdi
callq 0x44f0
jmp 0x58e46
jmp 0x58e48
movl $0xffffffff, -0x420(%rbp) # imm = 0xFFFFFFFF
leaq 0x2e3a4(%rip), %rsi     # 0x871fd
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4ed(%rbp)
jmp 0x58e6d
movb -0x4ed(%rbp), %al
testb $0x1, %al
jne 0x58e7c
jmp 0x58f2d
leaq 0x2e37d(%rip), %rsi     # 0x87200
leaq -0x280(%rbp), %rdi
callq 0x44f0
jmp 0x58e91
leaq -0x210(%rbp), %rdi
callq 0xf940
subl -0x288(%rbp), %eax
movl %eax, -0x288(%rbp)
leaq -0x210(%rbp), %rax
movq %rax, -0x428(%rbp)
movq -0x428(%rbp), %rdi
callq 0xa800
movq %rax, -0x430(%rbp)
movq -0x428(%rbp), %rdi
callq 0xa830
movq %rax, -0x438(%rbp)
leaq -0x430(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x58ef6
jmp 0x58f2b
leaq -0x430(%rbp), %rdi
callq 0xa8a0
movq %rax, -0x440(%rbp)
movq -0x440(%rbp), %rax
xorl %ecx, %ecx
subl (%rax), %ecx
movq -0x440(%rbp), %rax
movl %ecx, (%rax)
leaq -0x430(%rbp), %rdi
callq 0xa930
jmp 0x58edd
jmp 0x58f2d
leaq 0x2e2cc(%rip), %rsi     # 0x87200
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4ee(%rbp)
jmp 0x58f48
movb -0x4ee(%rbp), %al
testb $0x1, %al
jne 0x58f54
jmp 0x58f63
movl $0x3, -0x420(%rbp)
jmp 0x5908b
leaq 0x2e2a1(%rip), %rsi     # 0x8720b
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4ef(%rbp)
jmp 0x58f7e
movb -0x4ef(%rbp), %al
testb $0x1, %al
jne 0x58f8a
jmp 0x58f99
movl $0x1, -0x420(%rbp)
jmp 0x59089
leaq 0x2e26a(%rip), %rsi     # 0x8720a
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4f0(%rbp)
jmp 0x58fb4
movb -0x4f0(%rbp), %al
testb $0x1, %al
jne 0x58fc0
jmp 0x58fcf
movl $0x2, -0x420(%rbp)
jmp 0x59087
leaq 0x2e237(%rip), %rsi     # 0x8720d
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4f1(%rbp)
jmp 0x58fea
movb -0x4f1(%rbp), %al
testb $0x1, %al
jne 0x58ff6
jmp 0x59005
movl $0x4, -0x420(%rbp)
jmp 0x59085
leaq 0x2e204(%rip), %rsi     # 0x87210
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4f2(%rbp)
jmp 0x59020
movb -0x4f2(%rbp), %al
testb $0x1, %al
jne 0x5902c
jmp 0x59038
movl $0x5, -0x420(%rbp)
jmp 0x59083
leaq 0x2e1d4(%rip), %rsi     # 0x87213
leaq -0x280(%rbp), %rdi
callq 0xa640
movb %al, -0x4f3(%rbp)
jmp 0x59053
movb -0x4f3(%rbp), %al
testb $0x1, %al
jne 0x5905f
jmp 0x5906b
movl $0x6, -0x420(%rbp)
jmp 0x59081
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
jmp 0x59083
jmp 0x59085
jmp 0x59087
jmp 0x59089
jmp 0x5908b
cmpl $0x4, -0x420(%rbp)
je 0x590aa
cmpl $0x5, -0x420(%rbp)
je 0x590aa
cmpl $0x6, -0x420(%rbp)
jne 0x59141
movl -0x288(%rbp), %eax
movl %eax, -0x4f8(%rbp)
leaq -0x228(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movl -0x4f8(%rbp), %eax
cmpl %ecx, %eax
je 0x590e5
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movl -0x288(%rbp), %eax
movl %eax, -0x4fc(%rbp)
leaq -0x210(%rbp), %rdi
callq 0xf940
movq %rax, %rcx
movl -0x4fc(%rbp), %eax
cmpl %ecx, %eax
jle 0x59120
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
cmpl $0x0, -0x288(%rbp)
jg 0x5913f
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
jmp 0x5916b
leaq -0x228(%rbp), %rdi
callq 0xf940
cmpq $0x1, %rax
jbe 0x59169
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
jmp 0x5916b
leaq -0x228(%rbp), %rdi
callq 0xf940
cmpq $0x0, %rax
jne 0x59184
movb $0x0, -0x28a(%rbp)
cmpl $0x6, -0x420(%rbp)
jne 0x59194
movb $0x1, -0x28a(%rbp)
movq -0x4b0(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x508(%rbp)
movl -0x420(%rbp), %esi
movl -0x1f8(%rbp), %edx
movl -0x288(%rbp), %r9d
movzbl -0x28a(%rbp), %ecx
andl $0x1, %ecx
movq %rsp, %rax
movl %ecx, 0x8(%rax)
leaq -0x240(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x4a0(%rbp), %rdi
leaq -0x210(%rbp), %rcx
leaq -0x228(%rbp), %r8
callq 0x7b4e0
jmp 0x591ef
movq -0x508(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x5a820
jmp 0x59204
leaq -0x4a0(%rbp), %rdi
callq 0xd840
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1d0(%rbp,%rax), %rdi
callq 0x4030
movb %al, -0x509(%rbp)
jmp 0x59230
movb -0x509(%rbp), %al
testb $0x1, %al
jne 0x5923c
jmp 0x59269
movl $0x1, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0x5927a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0xd840
jmp 0x592b8
movl $0x0, -0x4(%rbp)
movl $0x1, -0x1f4(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x4240
leaq -0x260(%rbp), %rdi
callq 0x4240
leaq -0x240(%rbp), %rdi
callq 0xab00
leaq -0x228(%rbp), %rdi
callq 0xab00
leaq -0x210(%rbp), %rdi
callq 0xab00
jmp 0x592f6
leaq -0x280(%rbp), %rdi
callq 0x4240
leaq -0x260(%rbp), %rdi
callq 0x4240
leaq -0x240(%rbp), %rdi
callq 0xab00
leaq -0x228(%rbp), %rdi
callq 0xab00
leaq -0x210(%rbp), %rdi
callq 0xab00
jmp 0x59323
leaq -0x1f0(%rbp), %rdi
callq 0x4240
leaq -0x1d0(%rbp), %rdi
callq 0x42e0
leaq -0x38(%rbp), %rdi
callq 0x4240
movl -0x4(%rbp), %eax
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
leaq -0x1f0(%rbp), %rdi
callq 0x4240
leaq -0x1d0(%rbp), %rdi
callq 0x42e0
leaq -0x38(%rbp), %rdi
callq 0x4240
movq -0x40(%rbp), %rdi
callq 0x4610
nopl (%rax)