// File: /workspace/github_cpp_makefile_star2_O1/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 0x1c7f3(%rip), %rax     # 0x537b0
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x80(%rsp)
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x36fee
movq 0x1bfe8(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x36fea
incl 0x8(%rax)
jmp 0x36fee
lock
incl 0x8(%rax)
leaq 0x1c76b(%rip), %rax     # 0x53760
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x37020
movq 0x1bfb6(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x3701c
incl 0x8(%rax)
jmp 0x37020
lock
incl 0x8(%rax)
leaq 0x1c749(%rip), %r13     # 0x53770
movq (%r13), %rcx
movq 0x8(%r13), %rax
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x37053
movq 0x1bf83(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x3704f
incl 0x8(%rax)
jmp 0x37053
lock
incl 0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x70(%rsp), %rcx
leaq 0x60(%rsp), %r8
xorl %edx, %edx
callq 0x28a12
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x376a4
movl %eax, %ebx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x37098
callq 0x13308
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x370a7
callq 0x13308
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x370b6
callq 0x13308
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x370c8
callq 0x13308
testb %bl, %bl
jne 0x374ec
leaq 0x1c80d(%rip), %rax     # 0x538e4
movl (%rax), %ecx
movl %ecx, 0x14(%rsp)
movl $0x6, (%rax)
leaq 0x1c7f6(%rip), %rdx     # 0x538e0
movl (%rdx), %eax
movl 0x270(%r14), %ecx
movl %ecx, (%rdx)
movl %eax, 0x270(%r14)
movq 0x260(%r14), %rax
cmpq (%r13), %rax
movq %r14, 0x38(%rsp)
je 0x37492
leaq 0x268(%r14), %rbp
leaq 0x8(%r14), %r12
movq 0x1bea4(%rip), %rbx     # 0x52fc8
movq %rbp, 0x90(%rsp)
movq %rax, 0xa8(%rsp)
movq (%rbp), %rax
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0x37153
cmpb $0x0, (%rbx)
je 0x3714f
incl 0x8(%rax)
jmp 0x37153
lock
incl 0x8(%rax)
movq (%r13), %rcx
movq 0x8(%r13), %rax
movq %rcx, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
testq %rax, %rax
je 0x3717e
cmpb $0x0, (%rbx)
je 0x3717a
incl 0x8(%rax)
jmp 0x3717e
lock
incl 0x8(%rax)
movq %rsp, %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x34aa0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x371a8
callq 0x13308
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x371ba
callq 0x13308
movq (%rsp), %rax
leaq 0x1c59b(%rip), %rcx     # 0x53760
cmpq (%rcx), %rax
je 0x373ae
movq %rax, 0x260(%r14)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x16086
movl $0x8, %edx
movq %r12, %rdi
leaq 0xa4cb(%rip), %rsi      # 0x416bc
callq 0x72c0
leaq 0x1c063(%rip), %rax     # 0x53260
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3b148
leaq 0x1c061(%rip), %rcx     # 0x53270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3b148
movq (%rsp), %rax
movq 0x20(%rax), %r13
movq 0x28(%rax), %r14
cmpq %r14, %r13
je 0x37325
movq (%r13), %r15
movq 0x8(%r13), %rbp
testq %rbp, %rbp
je 0x3724a
cmpb $0x0, (%rbx)
je 0x37246
incl 0x8(%rbp)
jmp 0x3724a
lock
incl 0x8(%rbp)
movl $0xf, %edx
movq %r12, %rdi
leaq 0xa557(%rip), %rsi      # 0x417b0
callq 0x72c0
movq %r15, 0x50(%rsp)
movq %rbp, 0x58(%rsp)
testq %rbp, %rbp
je 0x3727b
cmpb $0x0, (%rbx)
je 0x37277
incl 0x8(%rbp)
jmp 0x3727b
lock
incl 0x8(%rbp)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x2a0f7
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xa593(%rip), %rsi      # 0x4182d
callq 0x72c0
leaq 0x18(%rsp), %rdi
callq 0x34b0b
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r15, %rdi
callq 0x72c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xa409(%rip), %rsi      # 0x416d6
callq 0x72c0
leaq 0x1bf97(%rip), %rax     # 0x53270
movq (%rax), %rsi
movq %r15, %rdi
callq 0x3b148
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x37300
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3730f
callq 0x13308
testq %rbp, %rbp
je 0x3731c
movq %rbp, %rdi
callq 0x13308
addq $0x10, %r13
jmp 0x37226
movq (%rsp), %rax
movq 0x10(%rax), %rax
leaq 0x1c47c(%rip), %rcx     # 0x537b0
cmpq (%rcx), %rax
movq 0x38(%rsp), %r14
leaq 0x1c42d(%rip), %r13     # 0x53770
movq 0x90(%rsp), %rbp
je 0x37472
movl $0x7, %edx
movq %r12, %rdi
leaq 0xa460(%rip), %rsi      # 0x417c0
callq 0x72c0
leaq 0x1bef4(%rip), %rax     # 0x53260
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3b148
leaq 0x1bef2(%rip), %rcx     # 0x53270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3b148
movq (%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq 0x18(%rcx), %rcx
movq %rcx, 0x48(%rsp)
testq %rcx, %rcx
je 0x37409
cmpb $0x0, (%rbx)
je 0x37405
incl 0x8(%rcx)
jmp 0x37409
movq 0x260(%r14), %rsi
movq (%rsi), %rax
movq %rax, 0x260(%r14)
addq $0x8, %rsi
movq %rbp, %rdi
callq 0x16086
movl $0x7, %edx
movq %r12, %rdi
leaq 0xa30a(%rip), %rsi      # 0x416e4
callq 0x72c0
leaq 0x1be92(%rip), %rax     # 0x53278
movq (%rax), %rsi
movq %r12, %rdi
callq 0x3b148
leaq 0x1be78(%rip), %rcx     # 0x53270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3b148
jmp 0x37472
lock
incl 0x8(%rcx)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x29634
leaq 0x1be53(%rip), %rcx     # 0x53270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3b148
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xa29c(%rip), %rsi      # 0x416d6
callq 0x72c0
leaq 0x1be32(%rip), %rax     # 0x53278
movq (%rax), %rsi
movq %r15, %rdi
callq 0x3b148
leaq 0x1be18(%rip), %rcx     # 0x53270
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x3b148
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x37472
callq 0x13308
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x37481
callq 0x13308
movq 0x260(%r14), %rax
cmpq (%r13), %rax
jne 0x3712c
leaq 0x8(%r14), %rbx
leaq 0xa23b(%rip), %rsi      # 0x416d8
movl $0xb, %edx
movq %rbx, %rdi
callq 0x72c0
leaq 0x1bdbf(%rip), %rax     # 0x53270
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3b148
leaq 0x1c41d(%rip), %rdx     # 0x538e0
movl (%rdx), %eax
movl 0x270(%r14), %ecx
movl %ecx, (%rdx)
movl %eax, 0x270(%r14)
leaq 0x1c408(%rip), %rax     # 0x538e4
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
cmpb $0x0, 0x25c(%r14)
je 0x37505
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 0x37b6c
leaq 0x28(%rsp), %r13
xorl %r12d, %r12d
leaq 0x18(%rsp), %rbx
leaq 0xa1cd(%rip), %r14      # 0x416ee
movq 0x38(%rsp), %rsi
cmpb $0x0, 0x25c(%rsi)
jne 0x374ec
movq %rbx, %rdi
callq 0x37c96
movq %rbx, %rdi
movq %r14, %rsi
callq 0x70c0
testl %eax, %eax
je 0x375a3
movq %rbx, %rdi
leaq 0xa1a2(%rip), %rsi      # 0x416f2
callq 0x70c0
testl %eax, %eax
je 0x375b3
movq %rbx, %rdi
leaq 0xa189(%rip), %rsi      # 0x416ec
callq 0x70c0
testl %eax, %eax
je 0x375ba
movl $0x5, %ecx
movq %rbx, %rdi
leaq 0xa641(%rip), %rsi      # 0x41bbc
xorl %edx, %edx
callq 0x7420
cmpq $-0x1, %rax
je 0x375ea
movq 0x18(%rsp), %rsi
leaq 0xa234(%rip), %rdi      # 0x417c8
xorl %eax, %eax
callq 0x7050
movb $0x1, %r15b
movb $0x1, %r12b
jmp 0x375c5
movzbl %r12b, %eax
andl $0x1, %eax
movl $0x2, %ebp
subl %eax, %ebp
jmp 0x375c2
movl $0x1, %ebp
jmp 0x375c2
movl %r12d, %eax
andb $0x1, %al
movzbl %al, %ebp
xorl %r15d, %r15d
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x375dc
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
testb %r15b, %r15b
jne 0x37521
jmp 0x374f1
movb $0x1, %r15b
jmp 0x375c5
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x37609
callq 0x13308
jmp 0x37609
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x37618
callq 0x13308
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x37627
callq 0x13308
movq 0x88(%rsp), %rdi
jmp 0x37691
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
jne 0x37687
jmp 0x3768c
movq %rax, %rbx
jmp 0x3768c
jmp 0x3764c
movq %rax, %rbx
jmp 0x3767f
movq %rax, %rbx
jmp 0x37670
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x37670
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3767f
callq 0x13308
testq %rbp, %rbp
je 0x3768c
movq %rbp, %rdi
callq 0x13308
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3769b
callq 0x13308
movq %rbx, %rdi
callq 0x7430
nop