// File: /workspace/github_cpp_makefile_star2_O2/eryxcc[P]lois/src/solvers.cpp
// Function: lois::SolverIncremental::solveEnv()
virtual int solveEnv() {
#ifdef DO_NOT_USE_STACK
    return solve(outenv());
#endif

    if(isNotInSMTLogic(outenv())) return 1;

    OutputLanguage sav = outlan;
    outlan = SMT_INC;
    
    std::swap(indent, ourindent);
    
    while(last != currentcontext) {
      contextptr p = findchildcontext(last, currentcontext);
      if(p == emptycontext) {
        last = last->parent;
        ofs << "(pop 1)" << iunindent << ieol;
        }
      else {
        last = p;
        ofs << "(push 1)" << iindent << ieol;
        for(auto v: p->var)
          ofs << "(declare-const " << v << " " << smtsort() << ")" << ieol;
        if(!p->phi.isTrue())
          ofs << "(assert" << iindent << ieol << p->phi << ieol << ")" << iunindent << ieol;
        }
      }

    ofs << "(check-sat)" << ieol;

    std::swap(indent, ourindent);
    
    outlan = sav;
    if(crashed) return 1;
    pump();
    bool haderror = false;
    while(!crashed) {
      std::string s = readline();
      if(s == "sat") return haderror ? 1 : 2;
      if(s == "unknown") return 1;
      if(s == "unsat") return haderror ? 1 : 0;
      if(s.find("error") != std::string::npos) {
        haderror = true;
        printf("error reported: %s\n", s.c_str());
        }
      }
    return 1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %r12
leaq 0x1f65b(%rip), %rsi     # 0x497b0
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0xf04a
leaq 0x1f5f4(%rip), %rsi     # 0x49760
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0xf7c2
leaq 0x1f5ed(%rip), %r13     # 0x49770
leaq 0x78(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xf7c2
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x1e4fb
leaq 0x38(%rsp), %rsi
movq %r12, 0x10(%rsp)
movq %r12, %rdi
callq 0x2a6c8
movl %eax, %ebx
leaq 0x40(%rsp), %rdi
callq 0xefce
leaq 0x80(%rsp), %rdi
callq 0xefce
leaq 0x90(%rsp), %rdi
callq 0xefce
leaq 0xa0(%rsp), %rdi
callq 0xefce
pushq $0x1
popq %rax
movl %eax, 0x4(%rsp)
testb %bl, %bl
jne 0x2a62a
leaq 0x1f6e9(%rip), %rax     # 0x498ec
movl (%rax), %ecx
movl %ecx, 0x2c(%rsp)
movl $0x6, (%rax)
leaq 0x1f6d2(%rip), %rsi     # 0x498e8
movl (%rsi), %eax
movq 0x10(%rsp), %rdx
movl 0x270(%rdx), %ecx
movl %ecx, (%rsi)
movl %eax, 0x270(%rdx)
leaq 0x260(%rdx), %r14
leaq 0x8(%rdx), %rax
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %r12
leaq 0xa8(%rsp), %r15
movq %r14, 0x30(%rsp)
movq (%r14), %rax
cmpq (%r13), %rax
je 0x2a4e0
leaq 0xd8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf7c2
leaq 0xc8(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0xf7c2
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x27fb3
leaq 0xd0(%rsp), %rdi
callq 0xefce
leaq 0xe0(%rsp), %rdi
callq 0xefce
movq 0x18(%rsp), %rax
leaq 0x1f4ac(%rip), %rcx     # 0x49760
cmpq (%rcx), %rax
je 0x2a48c
movq %r14, %rdi
movq %r12, %rsi
callq 0x112d4
movq 0x8(%rsp), %rdi
leaq 0x83c4(%rip), %rsi      # 0x32698
callq 0x7230
leaq 0x1ef80(%rip), %rcx     # 0x49260
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x1ef7e(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rbp
movq 0x28(%rax), %r12
cmpq %r12, %rbp
leaq 0x68(%rsp), %rdi
je 0x2a3bd
movq %rbp, %rsi
movq %rdi, %r14
callq 0x1160e
movq 0x8(%rsp), %rdi
leaq 0x845d(%rip), %rsi      # 0x3278c
callq 0x7230
movq %rax, %rbx
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x1160e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1f79c
movq %rax, %rdi
leaq 0x84ad(%rip), %rsi      # 0x32809
callq 0x7230
movq %rax, %rbx
movq %r15, %rdi
callq 0x28009
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7210
movq %rax, %rdi
leaq 0x8331(%rip), %rsi      # 0x326b2
callq 0x7230
leaq 0x1eee3(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
movq %r15, %rdi
callq 0x7478
leaq 0x60(%rsp), %rdi
callq 0xefce
leaq 0x70(%rsp), %rdi
callq 0xefce
addq $0x10, %rbp
jmp 0x2a30a
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
leaq 0x1f3e3(%rip), %rcx     # 0x497b0
cmpq (%rcx), %rax
leaq 0x1f399(%rip), %r13     # 0x49770
movq 0x30(%rsp), %r14
je 0x2a4cc
movq 0x8(%rsp), %rdi
leaq 0x83ae(%rip), %rsi      # 0x3279c
callq 0x7230
leaq 0x1ee66(%rip), %rcx     # 0x49260
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x1ee64(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
movq %rax, %rbx
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0xf04a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1ef1c
leaq 0x1ee2e(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
movq %rax, %rdi
leaq 0x825b(%rip), %rsi      # 0x326b2
callq 0x7230
leaq 0x1ee15(%rip), %rcx     # 0x49278
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x1edfb(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x50(%rsp), %rdi
callq 0xefce
jmp 0x2a4cc
movq (%r14), %rsi
movq %r14, %rdi
callq 0x112d4
movq 0x8(%rsp), %rdi
leaq 0x821d(%rip), %rsi      # 0x326c0
callq 0x7230
leaq 0x1edc9(%rip), %rcx     # 0x49278
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x1edaf(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x20(%rsp), %rdi
callq 0xefce
leaq 0x18(%rsp), %r12
jmp 0x2a24d
leaq 0x81cd(%rip), %rsi      # 0x326b4
movq 0x8(%rsp), %rdi
callq 0x7230
leaq 0x1ed78(%rip), %rcx     # 0x49270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2d27c
leaq 0x1f3de(%rip), %rdx     # 0x498e8
movl (%rdx), %eax
movq 0x10(%rsp), %rdi
movl 0x270(%rdi), %ecx
movl %ecx, (%rdx)
movl %eax, 0x270(%rdi)
leaq 0x1f3c6(%rip), %rax     # 0x498ec
movl 0x2c(%rsp), %ecx
movl %ecx, (%rax)
cmpb $0x0, 0x25c(%rdi)
jne 0x2a62a
callq 0x2a9e4
movq 0x10(%rsp), %rsi
xorl %r12d, %r12d
leaq 0xa8(%rsp), %rbx
leaq 0x8175(%rip), %r14      # 0x326ca
pushq $0x2
popq %r13
leaq 0x816e(%rip), %r15      # 0x326ce
cmpb $0x0, 0x25c(%rsi)
jne 0x2a623
movq %rbx, %rdi
callq 0x2aaf2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x250fa
testb %al, %al
je 0x2a598
movzbl %r12b, %eax
andl $0x1, %eax
movl %r13d, %ecx
subl %eax, %ecx
movl %ecx, 0x4(%rsp)
xorl %ebp, %ebp
jmp 0x2a60b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x250fa
testb %al, %al
je 0x2a5b2
xorl %ebp, %ebp
pushq $0x1
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x2a60b
movq %rbx, %rdi
leaq 0x810c(%rip), %rsi      # 0x326c8
callq 0x250fa
testb %al, %al
je 0x2a5d3
movl %r12d, %eax
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
jmp 0x2a594
movq %rbx, %rdi
leaq 0x85bb(%rip), %rsi      # 0x32b98
xorl %edx, %edx
callq 0x7460
cmpq $-0x1, %rax
je 0x2a608
movq 0xa8(%rsp), %rsi
leaq 0x81ab(%rip), %rdi      # 0x327a4
xorl %eax, %eax
callq 0x7040
movb $0x1, %bpl
movb $0x1, %r12b
jmp 0x2a60b
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x7478
testb %bpl, %bpl
movq 0x10(%rsp), %rsi
jne 0x2a560
jmp 0x2a62a
pushq $0x1
popq %rax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xefce
jmp 0x2a652
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xefce
leaq 0x90(%rsp), %rdi
callq 0xefce
leaq 0xa0(%rsp), %rdi
jmp 0x2a6ba
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x2a6b0
movq %rax, %rbx
jmp 0x2a6b5
jmp 0x2a68c
movq %rax, %rbx
jmp 0x2a6ab
movq %rax, %rbx
jmp 0x2a6a1
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x7478
leaq 0x60(%rsp), %rdi
callq 0xefce
leaq 0x70(%rsp), %rdi
callq 0xefce
leaq 0x20(%rsp), %rdi
callq 0xefce
movq %rbx, %rdi
callq 0x7410
nop