// File: /workspace/github_cpp_makefile_star2_O1/reedoolang[P]reedoo/cond.cc
// Function: eval_cond(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool eval_cond(string cond) {

	string term = "";
	bool state = 0;
	int and_or_count = 0;
	bool r = true;

	for (int i = 0; i < cond.size(); i++) {
		
		if (cond[i] == '"') {
			if (state == 0) {
				state = 1;
			} else {
				state = 0;
			}
		}

		if (cond[i] == ' ' and state == 0) {
			terms.push_back(term);
			term = "";
		}
		else {
			term += cond[i];	
		}
	}

	for (int i = 0; i < terms.size(); i++) {
		//cout << terms[i] << " ";
	}
	//cout << endl;

	for (int i = 0; i < terms.size(); i++) {

		if (terms[i] == "or") {
			and_or_count++;
			if (i-3 >= 0 and i+3 < terms.size()) {
				if (terms[i] == "or") {
					if (terms[i-3] == terms[i-1]) {
						terms.clear();
						return true;
					} else {
						r = false;
					}

					if (terms[i+1] == terms[i+3]) {
						r = true;
					} else {
						r = false;
					}
				}
				
			}
		}

		if (terms[i] == "and") {
			and_or_count++;
			if (i-3 >= 0 and i+3 < terms.size()) {

				if (terms[i-3] != terms[i-1]) {
					terms.clear();
					return false;
				} else {
					r = true;
				}

				if (terms[i+1] != terms[i+3]) {
					r= false;
				} else {
					r = true;
				}
			}
		}
	}

	if (and_or_count == 0) {
		for (int i = 0; i < terms.size(); i++) {
			if (terms[i] == terms[i+2]) {
				terms.clear();
				return true;
			} else {
				terms.clear();
				return false;
			}
		}
	}

	terms.clear();
	
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xf98(%rip), %rdx       # 0xe179
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x3260
cmpq $0x0, 0x8(%rbx)
je 0xd260
xorl %r13d, %r13d
leaq 0x43a9(%rip), %r14      # 0x115a8
leaq 0x8(%rsp), %r15
leaq 0xf6e(%rip), %r12       # 0xe179
xorl %ebp, %ebp
movl %ebp, %ecx
movq (%rbx), %rax
movb (%rax,%r13), %al
cmpb $0x22, %al
sete %bpl
xorb %cl, %bpl
cmpb $0x20, %al
jne 0xd24c
movl %ebp, %ecx
andb $0x1, %cl
jne 0xd24c
movq %r14, %rdi
movq %r15, %rsi
callq 0x685c
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x22d0
jmp 0xd257
movsbl %al, %esi
movq %r15, %rdi
callq 0x2190
incq %r13
cmpq %r13, 0x8(%rbx)
ja 0xd20d
movq 0x4341(%rip), %rdi      # 0x115a8
cmpq %rdi, 0x4342(%rip)      # 0x115b0
setne %r14b
je 0xd439
xorl %r12d, %r12d
movb $0x1, %al
movl %eax, (%rsp)
movl $0x3, %ebp
leaq 0xe8a(%rip), %r15       # 0xe116
xorl %r13d, %r13d
leaq -0x3(%rbp), %rbx
addq %r12, %rdi
movq %r15, %rsi
callq 0x20b0
testl %eax, %eax
jne 0xd355
incl %r13d
cmpq $0x3, %rbx
jb 0xd355
movq 0x42f6(%rip), %rax      # 0x115b0
movq 0x42e7(%rip), %rdi      # 0x115a8
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xd355
addq %r12, %rdi
movq %r15, %rsi
callq 0x20b0
testl %eax, %eax
jne 0xd355
movq 0x42c1(%rip), %r15      # 0x115a8
movq -0x58(%r15,%r12), %rdx
cmpq -0x18(%r15,%r12), %rdx
jne 0xd319
movb $0x1, %al
movl %eax, 0x4(%rsp)
testq %rdx, %rdx
je 0xd44f
movq -0x60(%r15,%r12), %rdi
movq -0x20(%r15,%r12), %rsi
callq 0x21f0
testl %eax, %eax
je 0xd44f
movq 0x28(%r15,%r12), %rdx
cmpq 0x68(%r15,%r12), %rdx
jne 0xd340
testq %rdx, %rdx
je 0xd349
movq 0x20(%r15,%r12), %rdi
movq 0x60(%r15,%r12), %rsi
callq 0x21f0
testl %eax, %eax
sete %al
jmp 0xd34b
movl $0x0, (%rsp)
jmp 0xd34e
movb $0x1, %al
movl %eax, (%rsp)
leaq 0xdc1(%rip), %r15       # 0xe116
movq 0x424c(%rip), %rdi      # 0x115a8
addq %r12, %rdi
leaq 0xdac(%rip), %rsi       # 0xe112
callq 0x20b0
testl %eax, %eax
jne 0xd402
incl %r13d
cmpq $0x3, %rbx
jb 0xd402
movq 0x4229(%rip), %rax      # 0x115b0
movq 0x421a(%rip), %r15      # 0x115a8
subq %r15, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xd3fb
movq -0x58(%r15,%r12), %rdx
cmpq -0x18(%r15,%r12), %rdx
jne 0xd447
testq %rdx, %rdx
je 0xd3c6
movq -0x60(%r15,%r12), %rdi
movq -0x20(%r15,%r12), %rsi
callq 0x21f0
testl %eax, %eax
jne 0xd447
movq 0x28(%r15,%r12), %rdx
cmpq 0x68(%r15,%r12), %rdx
jne 0xd3ed
testq %rdx, %rdx
je 0xd3f6
movq 0x20(%r15,%r12), %rdi
movq 0x60(%r15,%r12), %rsi
callq 0x21f0
testl %eax, %eax
sete %al
jmp 0xd3f8
movl $0x0, (%rsp)
jmp 0xd3fb
movb $0x1, %al
movl %eax, (%rsp)
leaq 0xd14(%rip), %r15       # 0xe116
movq 0x41a7(%rip), %rax      # 0x115b0
movq 0x4198(%rip), %rdi      # 0x115a8
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %r12
leaq 0x1(%rbp), %rcx
addq $-0x2, %rbp
movl %edx, 0x4(%rsp)
cmpq %rbp, %rax
seta %r14b
movq %rcx, %rbp
ja 0xd28f
jmp 0xd45e
xorl %r13d, %r13d
movb $0x1, %al
movl %eax, (%rsp)
movl %eax, 0x4(%rsp)
jmp 0xd45e
movl $0x0, 0x4(%rsp)
leaq 0x4152(%rip), %rdi      # 0x115a8
movq %r15, %rsi
callq 0xcefc
testb $0x1, %r14b
je 0xd46a
movl 0x4(%rsp), %ecx
jmp 0xd4da
testl %r13d, %r13d
movl 0x4(%rsp), %ecx
je 0xd48d
movq 0x412e(%rip), %rsi      # 0x115a8
leaq 0x4127(%rip), %rdi      # 0x115a8
callq 0xcefc
movl (%rsp), %eax
movl %eax, %ecx
jmp 0xd4da
movq 0x411c(%rip), %r14      # 0x115b0
movq 0x410d(%rip), %rbx      # 0x115a8
cmpq %rbx, %r14
je 0xd4d5
movq 0x8(%rbx), %rdx
cmpq 0x48(%rbx), %rdx
jne 0xd4c2
movb $0x1, %bpl
testq %rdx, %rdx
je 0xd4c4
movq (%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x21f0
testl %eax, %eax
je 0xd4c4
xorl %ebp, %ebp
leaq 0x40dd(%rip), %rdi      # 0x115a8
movq %rbx, %rsi
callq 0xcefc
movl %ebp, %ecx
cmpq %rbx, %r14
je 0xd473
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xd4fa
movq 0x18(%rsp), %rsi
incq %rsi
movl %ecx, %ebx
callq 0x21e0
movl %ebx, %ecx
andb $0x1, %cl
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xd52d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2320