// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movq %rdi, %r14
leaq 0x1bcef(%rip), %rax     # 0x527b0
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x80(%rsp)
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x36af2
movq 0x1b4e4(%rip), %rcx     # 0x51fc8
cmpb $0x0, (%rcx)
je 0x36aee
incl 0x8(%rax)
jmp 0x36af2
lock
incl 0x8(%rax)
leaq 0x1bc67(%rip), %rax     # 0x52760
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x36b24
movq 0x1b4b2(%rip), %rcx     # 0x51fc8
cmpb $0x0, (%rcx)
je 0x36b20
incl 0x8(%rax)
jmp 0x36b24
lock
incl 0x8(%rax)
leaq 0x1bc45(%rip), %r13     # 0x52770
movq (%r13), %rcx
movq 0x8(%r13), %rax
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x36b57
movq 0x1b47f(%rip), %rcx     # 0x51fc8
cmpb $0x0, (%rcx)
je 0x36b53
incl 0x8(%rax)
jmp 0x36b57
lock
incl 0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x70(%rsp), %rcx
leaq 0x60(%rsp), %r8
xorl %edx, %edx
callq 0x28b68
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x371b2
movl %eax, %ebx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x36b9c
callq 0x133fc
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x36bab
callq 0x133fc
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x36bba
callq 0x133fc
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x36bcc
callq 0x133fc
testb %bl, %bl
jne 0x36ffa
leaq 0x1bd11(%rip), %rax     # 0x528ec
movl (%rax), %ecx
movl %ecx, 0x14(%rsp)
movl $0x6, (%rax)
leaq 0x1bcfa(%rip), %rdx     # 0x528e8
movl (%rdx), %eax
movl 0x270(%r14), %ecx
movl %ecx, (%rdx)
movl %eax, 0x270(%r14)
movq 0x260(%r14), %rcx
movq (%r13), %rax
cmpq %rax, %rcx
movq %r14, 0x38(%rsp)
je 0x36fa0
leaq 0x268(%r14), %rbp
leaq 0x8(%r14), %r12
movq 0x1b39d(%rip), %rbx     # 0x51fc8
movq %rbp, 0x90(%rsp)
movq %rcx, 0xa8(%rsp)
movq (%rbp), %rcx
movq %rcx, 0xb0(%rsp)
testq %rcx, %rcx
je 0x36c5e
cmpb $0x0, (%rbx)
je 0x36c56
incl 0x8(%rcx)
jmp 0x36c5e
lock
incl 0x8(%rcx)
movq (%r13), %rax
movq %rax, 0x98(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0xa0(%rsp)
testq %rax, %rax
je 0x36c85
cmpb $0x0, (%rbx)
je 0x36c81
incl 0x8(%rax)
jmp 0x36c85
lock
incl 0x8(%rax)
movq %rsp, %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x34696
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x36caf
callq 0x133fc
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x36cc1
callq 0x133fc
movq (%rsp), %rax
leaq 0x1ba94(%rip), %rcx     # 0x52760
cmpq (%rcx), %rax
je 0x36eb9
movq %rax, 0x260(%r14)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1615e
movl $0x8, %edx
movq %r12, %rdi
leaq 0x99a0(%rip), %rsi      # 0x40698
callq 0x72c0
leaq 0x1b55c(%rip), %rax     # 0x52260
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3ab44
leaq 0x1b55a(%rip), %rcx     # 0x52270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3ab44
movq (%rsp), %rax
movq 0x20(%rax), %r13
movq 0x28(%rax), %r14
cmpq %r14, %r13
je 0x36e34
movq (%r13), %r15
movq 0x8(%r13), %rbp
testq %rbp, %rbp
je 0x36d51
cmpb $0x0, (%rbx)
je 0x36d4d
incl 0x8(%rbp)
jmp 0x36d51
lock
incl 0x8(%rbp)
movl $0xf, %edx
movq %r12, %rdi
leaq 0x9a2c(%rip), %rsi      # 0x4078c
callq 0x72c0
movq %r15, 0x50(%rsp)
movq %rbp, 0x58(%rsp)
testq %rbp, %rbp
je 0x36d82
cmpb $0x0, (%rbx)
je 0x36d7e
incl 0x8(%rbp)
jmp 0x36d82
lock
incl 0x8(%rbp)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x2a2f4
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9a68(%rip), %rsi      # 0x40809
callq 0x72c0
leaq 0x18(%rsp), %rdi
callq 0x346fd
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r15, %rdi
callq 0x72c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x98de(%rip), %rsi      # 0x406b2
callq 0x72c0
leaq 0x1b490(%rip), %rax     # 0x52270
movq (%rax), %rsi
movq %r15, %rdi
callq 0x3ab44
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x36e07
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x36e16
callq 0x133fc
testq %rbp, %rbp
je 0x36e23
movq %rbp, %rdi
callq 0x133fc
addq $0x10, %r13
cmpq %r14, %r13
jne 0x36d36
movq (%rsp), %rax
movq 0x10(%rax), %rax
leaq 0x1b971(%rip), %rcx     # 0x527b0
cmpq (%rcx), %rax
movq 0x38(%rsp), %r14
leaq 0x1b922(%rip), %r13     # 0x52770
movq 0x90(%rsp), %rbp
je 0x36f7d
movl $0x7, %edx
movq %r12, %rdi
leaq 0x9931(%rip), %rsi      # 0x4079c
callq 0x72c0
leaq 0x1b3e9(%rip), %rax     # 0x52260
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3ab44
leaq 0x1b3e7(%rip), %rcx     # 0x52270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3ab44
movq (%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq 0x18(%rcx), %rcx
movq %rcx, 0x48(%rsp)
testq %rcx, %rcx
je 0x36f14
cmpb $0x0, (%rbx)
je 0x36f10
incl 0x8(%rcx)
jmp 0x36f14
movq 0x260(%r14), %rsi
movq (%rsi), %rax
movq %rax, 0x260(%r14)
addq $0x8, %rsi
movq %rbp, %rdi
callq 0x1615e
movl $0x7, %edx
movq %r12, %rdi
leaq 0x97db(%rip), %rsi      # 0x406c0
callq 0x72c0
leaq 0x1b387(%rip), %rax     # 0x52278
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3ab44
leaq 0x1b36d(%rip), %rcx     # 0x52270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3ab44
jmp 0x36f7d
lock
incl 0x8(%rcx)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x297cc
leaq 0x1b348(%rip), %rcx     # 0x52270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3ab44
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x976d(%rip), %rsi      # 0x406b2
callq 0x72c0
leaq 0x1b327(%rip), %rax     # 0x52278
movq (%rax), %rsi
movq %r15, %rdi
callq 0x3ab44
leaq 0x1b30d(%rip), %rcx     # 0x52270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3ab44
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x36f7d
callq 0x133fc
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x36f8c
callq 0x133fc
movq 0x260(%r14), %rcx
movq (%r13), %rax
cmpq %rax, %rcx
jne 0x36c33
leaq 0x8(%r14), %rbx
leaq 0x9709(%rip), %rsi      # 0x406b4
movl $0xb, %edx
movq %rbx, %rdi
callq 0x72c0
leaq 0x1b2b1(%rip), %rax     # 0x52270
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3ab44
leaq 0x1b917(%rip), %rdx     # 0x528e8
movl (%rdx), %eax
movl 0x270(%r14), %ecx
movl %ecx, (%rdx)
movl %eax, 0x270(%r14)
leaq 0x1b902(%rip), %rax     # 0x528ec
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
cmpb $0x0, 0x25c(%r14)
je 0x37013
movl $0x1, %ebp
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x37614
leaq 0x28(%rsp), %r13
xorl %r12d, %r12d
leaq 0x18(%rsp), %rbx
leaq 0x969b(%rip), %r14      # 0x406ca
movq 0x38(%rsp), %rsi
cmpb $0x0, 0x25c(%rsi)
jne 0x36ffa
movq %rbx, %rdi
callq 0x3775a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x70c0
testl %eax, %eax
je 0x370b1
movq %rbx, %rdi
leaq 0x9670(%rip), %rsi      # 0x406ce
callq 0x70c0
testl %eax, %eax
je 0x370c1
movq %rbx, %rdi
leaq 0x9657(%rip), %rsi      # 0x406c8
callq 0x70c0
testl %eax, %eax
je 0x370c8
movl $0x5, %ecx
movq %rbx, %rdi
leaq 0x9b0f(%rip), %rsi      # 0x40b98
xorl %edx, %edx
callq 0x7420
cmpq $-0x1, %rax
je 0x370f8
movq 0x18(%rsp), %rsi
leaq 0x9702(%rip), %rdi      # 0x407a4
xorl %eax, %eax
callq 0x7050
movb $0x1, %r15b
movb $0x1, %r12b
jmp 0x370d3
movzbl %r12b, %eax
andl $0x1, %eax
movl $0x2, %ebp
subl %eax, %ebp
jmp 0x370d0
movl $0x1, %ebp
jmp 0x370d0
movl %r12d, %eax
andb $0x1, %al
movzbl %al, %ebp
xorl %r15d, %r15d
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x370ea
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
testb %r15b, %r15b
jne 0x3702f
jmp 0x36fff
movb $0x1, %r15b
jmp 0x370d3
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x37117
callq 0x133fc
jmp 0x37117
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x37126
callq 0x133fc
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x37135
callq 0x133fc
movq 0x88(%rsp), %rdi
jmp 0x3719f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
jne 0x37195
jmp 0x3719a
movq %rax, %rbx
jmp 0x3719a
movq %rax, %rbx
jmp 0x3718d
jmp 0x3715a
movq %rax, %rbx
jmp 0x3717e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x3717e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3718d
callq 0x133fc
testq %rbp, %rbp
je 0x3719a
movq %rbp, %rdi
callq 0x133fc
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x371a9
callq 0x133fc
movq %rbx, %rdi
callq 0x7430
nop