// File: Laakeri[P]maxpre/src/inputreader.cpp
// Function: maxPreprocessor::InputReader::readLine(std::istream&)
int InputReader::readLine(istream& input) {
	input>>ws;
	while (input.peek() == 'c') {
		currentLine++;
		input.ignore(numeric_limits<streamsize>::max(), '\n');
		input>>ws;
	}
	if (input.eof()) return 1;
	int status;
	if (input.peek() == 'C') {
		status = readCardinalityConstraint(input);
		if (status == 1) readError = "Failed to read a cardinality constraint (line "+to_string(currentLine)+")";
	}
	else if (inputFormat == INPUT_FORMAT_WPMS) {
		status = readWeightedClause(input);
		if (status == 1) readError = "Failed to read a clause (line "+to_string(currentLine)+")";
	}
	else if (inputFormat == INPUT_FORMAT_MS) {
		status = readClause(input, 1);
		if (status == 1) readError = "Failed to read a clause (line "+to_string(currentLine)+")";
	}
	else if (inputFormat == INPUT_FORMAT_SAT) {
		status = readClause(input, top);
		if (status == 1) readError = "Failed to read a clause (line "+to_string(currentLine)+")";
	}
	else {
		status = 1;
		readError = "Wrong input format (line "+to_string(currentLine)+")";
	}
	assert(status == 0 || status == 1);
	if (status == 0) return 0;
	else return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x18(%rbp), %rdi
movq 0x55c47(%rip), %rsi     # 0xaefc0
callq 0x4120
movq -0x18(%rbp), %rdi
callq 0x4140
cmpl $0x63, %eax
jne 0x593d2
movq -0x218(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x220(%rbp)
callq 0x5a850
movq -0x220(%rbp), %rdi
movq %rax, %rsi
movl $0xa, %edx
callq 0x4250
movq -0x18(%rbp), %rdi
movq 0x55bf5(%rip), %rsi     # 0xaefc0
callq 0x4120
jmp 0x5937e
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x4650
testb $0x1, %al
jne 0x593e8
jmp 0x593f4
movl $0x1, -0x4(%rbp)
jmp 0x5993d
movq -0x18(%rbp), %rdi
callq 0x4140
cmpl $0x43, %eax
jne 0x594df
movq -0x218(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x58560
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x594da
movq -0x218(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x5a8b0
movq -0x228(%rbp), %rdx
leaq 0x2ddd7(%rip), %rsi     # 0x87222
leaq -0x60(%rbp), %rdi
callq 0x5a860
jmp 0x59456
leaq 0x2e10a(%rip), %rdx     # 0x87567
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xabf0
jmp 0x5946c
movq -0x218(%rbp), %rdi
addq $0x10, %rdi
leaq -0x40(%rbp), %rsi
callq 0x4490
leaq -0x40(%rbp), %rdi
callq 0x4240
leaq -0x60(%rbp), %rdi
callq 0x4240
leaq -0x80(%rbp), %rdi
callq 0x4240
jmp 0x594da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x594cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4240
leaq -0x80(%rbp), %rdi
callq 0x4240
jmp 0x59949
jmp 0x598df
movq -0x218(%rbp), %rax
cmpl $0x1, 0x38(%rax)
jne 0x595e7
movq -0x218(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x582d0
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x595e2
movq -0x218(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x5a8b0
movq -0x230(%rbp), %rdx
leaq 0x2dd19(%rip), %rsi     # 0x87251
leaq -0xd0(%rbp), %rdi
callq 0x5a860
jmp 0x59546
leaq 0x2e01a(%rip), %rdx     # 0x87567
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xabf0
jmp 0x59562
movq -0x218(%rbp), %rdi
addq $0x10, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4490
leaq -0xb0(%rbp), %rdi
callq 0x4240
leaq -0xd0(%rbp), %rdi
callq 0x4240
leaq -0xf0(%rbp), %rdi
callq 0x4240
jmp 0x595e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x595d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4240
leaq -0xf0(%rbp), %rdi
callq 0x4240
jmp 0x59949
jmp 0x598dd
movq -0x218(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x596f4
movq -0x218(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x58450
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x596ef
movq -0x218(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x5a8b0
movq -0x238(%rbp), %rdx
leaq 0x2dc0c(%rip), %rsi     # 0x87251
leaq -0x130(%rbp), %rdi
callq 0x5a860
jmp 0x59653
leaq 0x2df0d(%rip), %rdx     # 0x87567
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xabf0
jmp 0x5966f
movq -0x218(%rbp), %rdi
addq $0x10, %rdi
leaq -0x110(%rbp), %rsi
callq 0x4490
leaq -0x110(%rbp), %rdi
callq 0x4240
leaq -0x130(%rbp), %rdi
callq 0x4240
leaq -0x150(%rbp), %rdi
callq 0x4240
jmp 0x596ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x596de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x4240
leaq -0x150(%rbp), %rdi
callq 0x4240
jmp 0x59949
jmp 0x598db
movq -0x218(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jne 0x59800
movq -0x218(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq 0x30(%rdi), %rdx
callq 0x58450
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x597fb
movq -0x218(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x5a8b0
movq -0x240(%rbp), %rdx
leaq 0x2db00(%rip), %rsi     # 0x87251
leaq -0x190(%rbp), %rdi
callq 0x5a860
jmp 0x5975f
leaq 0x2de01(%rip), %rdx     # 0x87567
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xabf0
jmp 0x5977b
movq -0x218(%rbp), %rdi
addq $0x10, %rdi
leaq -0x170(%rbp), %rsi
callq 0x4490
leaq -0x170(%rbp), %rdi
callq 0x4240
leaq -0x190(%rbp), %rdi
callq 0x4240
leaq -0x1b0(%rbp), %rdi
callq 0x4240
jmp 0x597fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x597ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4240
leaq -0x1b0(%rbp), %rdi
callq 0x4240
jmp 0x59949
jmp 0x598d9
movq -0x218(%rbp), %rax
movl $0x1, -0x1c(%rbp)
movl 0x8(%rax), %esi
leaq -0x210(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x5a8b0
movq -0x248(%rbp), %rdx
leaq 0x2da3e(%rip), %rsi     # 0x87270
leaq -0x1f0(%rbp), %rdi
callq 0x5a860
jmp 0x59840
leaq 0x2dd20(%rip), %rdx     # 0x87567
leaq -0x1d0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xabf0
jmp 0x5985c
movq -0x218(%rbp), %rdi
addq $0x10, %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x4490
leaq -0x1d0(%rbp), %rdi
callq 0x4240
leaq -0x1f0(%rbp), %rdi
callq 0x4240
leaq -0x210(%rbp), %rdi
callq 0x4240
jmp 0x598d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x598cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x4240
leaq -0x210(%rbp), %rdi
callq 0x4240
jmp 0x59949
jmp 0x598db
jmp 0x598dd
jmp 0x598df
movb $0x1, %al
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x249(%rbp)
je 0x598fa
cmpl $0x1, -0x1c(%rbp)
sete %al
movb %al, -0x249(%rbp)
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x59906
jmp 0x59908
jmp 0x59927
leaq 0x2d97b(%rip), %rdi     # 0x8728a
leaq 0x2d98f(%rip), %rsi     # 0x872a5
movl $0xca, %edx
leaq 0x2d993(%rip), %rcx     # 0x872b5
callq 0x4260
cmpl $0x0, -0x1c(%rbp)
jne 0x59936
movl $0x0, -0x4(%rbp)
jmp 0x5993d
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x4610
nopw %cs:(%rax,%rax)