// File: biotomas[P]ipasir/app/genipafolio/genipafolio.cpp
// Function: loadFormula(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, char const*)
bool loadFormula(vector<vector<int> >& clauses, const char* filename) {
	FILE* f = fopen(filename, "r");
	if (f == NULL) {
		return false;
	}
	int c = 0;
	bool neg = false;
	vector<int> cls;
	while (c != EOF) {
		c = fgetc(f);
		// comment or problem definition line
		if (c == 'c' || c == 'p') {
			// skip this line
			while(c != '\n') {
				c = fgetc(f);
			}
			continue;
		}
		// whitespace
		if (isspace(c)) {
			continue;
		}
		// negative
		if (c == '-') {
			neg = true;
			continue;
		}
		// number
		if (isdigit(c)) {
			int num = c - '0';
			c = fgetc(f);
			while (isdigit(c)) {
				num = num*10 + (c-'0');
				c = fgetc(f);
			}
			if (neg) {
				num *= -1;
			}
			neg = false;
			if (num != 0) {
				cls.push_back(num);
			} else {
				clauses.push_back(vector<int>(cls));
				cls.clear();
			}
		}
	}
	fclose(f);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1d826(%rip), %rsi     # 0x1fbd4
callq 0x21b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x23c7
movb $0x0, -0x1(%rbp)
jmp 0x255d
movl $0x0, -0x24(%rbp)
movb $0x0, -0x25(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2960
cmpl $-0x1, -0x24(%rbp)
je 0x2538
movq -0x20(%rbp), %rdi
callq 0x2240
movl %eax, -0x6c(%rbp)
jmp 0x23f3
movl -0x6c(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x63, -0x24(%rbp)
je 0x2405
cmpl $0x70, -0x24(%rbp)
jne 0x2436
jmp 0x2407
cmpl $0xa, -0x24(%rbp)
je 0x2434
movq -0x20(%rbp), %rdi
callq 0x2240
movl %eax, -0x70(%rbp)
jmp 0x241b
movl -0x70(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x2407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2552
jmp 0x23db
movl -0x24(%rbp), %edi
callq 0x2040
cmpl $0x0, %eax
je 0x2445
jmp 0x23db
cmpl $0x2d, -0x24(%rbp)
jne 0x2451
movb $0x1, -0x25(%rbp)
jmp 0x23db
movl -0x24(%rbp), %edi
callq 0x2110
cmpl $0x0, %eax
je 0x2533
movl -0x24(%rbp), %eax
addl $-0x30, %eax
movl %eax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2240
movl %eax, -0x74(%rbp)
jmp 0x2479
movl -0x74(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
callq 0x2110
cmpl $0x0, %eax
je 0x24b8
movl -0x50(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,4), %edx
movl -0x24(%rbp), %ecx
movl %ecx, %eax
movl %edx, %ecx
leal -0x30(%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2240
movl %eax, -0x78(%rbp)
jmp 0x24b0
movl -0x78(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x247f
testb $0x1, -0x25(%rbp)
je 0x24c5
imull $-0x1, -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
movb $0x0, -0x25(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x24e0
leaq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2980
jmp 0x24de
jmp 0x2531
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2a20
jmp 0x24f7
movq -0x80(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x29f0
jmp 0x2506
leaq -0x68(%rbp), %rdi
callq 0x2b10
leaq -0x40(%rbp), %rdi
callq 0x2b70
jmp 0x2531
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2b10
jmp 0x2552
jmp 0x2533
jmp 0x23db
movq -0x20(%rbp), %rdi
callq 0x2150
jmp 0x2543
movb $0x1, -0x1(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2b10
jmp 0x255d
leaq -0x40(%rbp), %rdi
callq 0x2b10
jmp 0x256b
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2270
nopw %cs:(%rax,%rax)