// File: 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
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq 0x4348f(%rip), %rsi     # 0xa5830
leaq -0x30(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x11030
leaq 0x43428(%rip), %rsi     # 0xa57e0
leaq -0x40(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x173b0
leaq 0x43421(%rip), %rsi     # 0xa57f0
leaq -0x50(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x173b0
movq -0x198(%rbp), %rsi
movq -0x190(%rbp), %rcx
movq -0x188(%rbp), %r8
leaq -0x20(%rbp), %rdi
xorl %edx, %edx
callq 0x3e180
jmp 0x62401
movq -0x1a0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x62c30
movb %al, -0x1a1(%rbp)
jmp 0x62419
leaq -0x20(%rbp), %rdi
callq 0x11060
leaq -0x50(%rbp), %rdi
callq 0x14b20
leaq -0x40(%rbp), %rdi
callq 0x14b20
leaq -0x30(%rbp), %rdi
callq 0x11060
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0x62449
jmp 0x62498
movl $0x1, -0x4(%rbp)
jmp 0x62c14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x62478
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x11060
leaq -0x50(%rbp), %rdi
callq 0x14b20
leaq -0x40(%rbp), %rdi
callq 0x14b20
leaq -0x30(%rbp), %rdi
callq 0x11060
jmp 0x62c20
movq -0x1a0(%rbp), %rsi
leaq 0x434be(%rip), %rax     # 0xa5964
movl (%rax), %eax
movl %eax, -0x60(%rbp)
leaq 0x434b2(%rip), %rax     # 0xa5964
movl $0x6, (%rax)
addq $0x270, %rsi            # imm = 0x270
leaq 0x4349a(%rip), %rdi     # 0xa5960
callq 0x44e80
movq -0x1a0(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
leaq 0x43310(%rip), %rsi     # 0xa57f0
callq 0x1af60
testb $0x1, %al
jne 0x624ee
jmp 0x62a23
movq -0x1a0(%rbp), %rsi
addq $0x260, %rsi            # imm = 0x260
leaq -0x80(%rbp), %rdi
callq 0x173b0
leaq -0x90(%rbp), %rdi
leaq 0x432dd(%rip), %rsi     # 0xa57f0
callq 0x173b0
leaq -0x70(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x5aa40
leaq -0x90(%rbp), %rdi
callq 0x14b20
leaq -0x80(%rbp), %rdi
callq 0x14b20
leaq -0x70(%rbp), %rdi
leaq 0x43294(%rip), %rsi     # 0xa57e0
callq 0x3ec00
testb $0x1, %al
jne 0x6255a
jmp 0x6260c
movq -0x1a0(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
movq %rdi, -0x1b8(%rbp)
callq 0x1b020
movq -0x1b8(%rbp), %rdi
movq %rax, %rsi
callq 0x1ade0
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x1117e(%rip), %rsi     # 0x73713
callq 0x82b0
movq %rax, -0x1b0(%rbp)
jmp 0x625a3
movq -0x1b0(%rbp), %rdi
leaq 0x42d47(%rip), %rax     # 0xa52f8
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x1c0(%rbp)
jmp 0x625d0
movq -0x1c0(%rbp), %rdi
leaq 0x42d12(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rsi
callq 0x6afb0
jmp 0x625f6
jmp 0x62a07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x62a15
movq -0x1a0(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
leaq -0x70(%rbp), %rsi
callq 0x1ade0
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x110b6(%rip), %rsi     # 0x736eb
callq 0x82b0
movq %rax, -0x1c8(%rbp)
jmp 0x62643
movq -0x1c8(%rbp), %rdi
leaq 0x42c8f(%rip), %rax     # 0xa52e0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x1d0(%rbp)
jmp 0x62670
movq -0x1d0(%rbp), %rdi
leaq 0x42c72(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
callq 0x6afb0
jmp 0x62696
leaq -0x70(%rbp), %rdi
callq 0x1b020
addq $0x20, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x1b040
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x1b070
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1b0a0
testb $0x1, %al
jne 0x626ec
jmp 0x6286b
leaq -0xc0(%rbp), %rdi
callq 0x1b0e0
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
callq 0x1b100
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x110c6(%rip), %rsi     # 0x737df
callq 0x82b0
movq %rax, -0x1d8(%rbp)
jmp 0x62727
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x1b100
movq -0x1d8(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
callq 0x410b0
movq %rax, -0x1e0(%rbp)
jmp 0x6275d
movq -0x1e0(%rbp), %rdi
leaq 0x110f7(%rip), %rsi     # 0x73862
callq 0x82b0
movq %rax, -0x1f0(%rbp)
jmp 0x62779
leaq -0x108(%rbp), %rdi
callq 0x5aae0
jmp 0x62787
movq -0x1f0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x8280
movq %rax, -0x1f8(%rbp)
jmp 0x627a3
movq -0x1f8(%rbp), %rdi
leaq 0x10f54(%rip), %rsi     # 0x73705
callq 0x82b0
movq %rax, -0x200(%rbp)
jmp 0x627bf
movq -0x200(%rbp), %rdi
leaq 0x42b23(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rsi
callq 0x6afb0
jmp 0x627e5
leaq -0x108(%rbp), %rdi
callq 0x8578
leaq -0xe8(%rbp), %rdi
callq 0x10f20
leaq -0xd8(%rbp), %rdi
callq 0x10f20
leaq -0xc0(%rbp), %rdi
callq 0x1b390
jmp 0x626d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x6285a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x6284e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x8578
leaq -0xe8(%rbp), %rdi
callq 0x10f20
leaq -0xd8(%rbp), %rdi
callq 0x10f20
jmp 0x62a15
leaq -0x70(%rbp), %rdi
callq 0x1b020
movq %rax, %rdi
addq $0x10, %rdi
callq 0x29750
testb $0x1, %al
jne 0x62a05
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x10f55(%rip), %rsi     # 0x737ef
callq 0x82b0
movq %rax, -0x208(%rbp)
jmp 0x628a8
movq -0x208(%rbp), %rdi
leaq 0x42a2a(%rip), %rax     # 0xa52e0
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x210(%rbp)
jmp 0x628d5
movq -0x210(%rbp), %rdi
leaq 0x42a0d(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x218(%rbp)
jmp 0x62902
leaq -0x70(%rbp), %rdi
callq 0x1b020
movq %rax, %rsi
addq $0x10, %rsi
leaq -0x130(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x11030
movq -0x218(%rbp), %rdi
movq -0x228(%rbp), %rsi
callq 0x40060
movq %rax, -0x220(%rbp)
jmp 0x62941
movq -0x220(%rbp), %rdi
leaq 0x429a1(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x230(%rbp)
jmp 0x6296e
movq -0x230(%rbp), %rdi
leaq 0x10d89(%rip), %rsi     # 0x73705
callq 0x82b0
movq %rax, -0x238(%rbp)
jmp 0x6298a
movq -0x238(%rbp), %rdi
leaq 0x42960(%rip), %rax     # 0xa52f8
movq (%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rsi
callq 0x6afb0
movq %rax, -0x240(%rbp)
jmp 0x629b7
movq -0x240(%rbp), %rdi
leaq 0x4292b(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rsi
callq 0x6afb0
jmp 0x629dd
leaq -0x130(%rbp), %rdi
callq 0x11060
jmp 0x62a05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x11060
jmp 0x62a15
jmp 0x62a07
leaq -0x70(%rbp), %rdi
callq 0x14b20
jmp 0x624cb
leaq -0x70(%rbp), %rdi
callq 0x14b20
jmp 0x62c20
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
leaq 0x10cd2(%rip), %rsi     # 0x73707
callq 0x82b0
movq %rax, %rdi
leaq 0x428ac(%rip), %rax     # 0xa52f0
movq (%rax), %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rsi
callq 0x6afb0
movq -0x1a0(%rbp), %rsi
addq $0x270, %rsi            # imm = 0x270
leaq 0x42ef1(%rip), %rdi     # 0xa5960
callq 0x44e80
movq -0x1a0(%rbp), %rax
movl -0x60(%rbp), %edx
leaq 0x42edf(%rip), %rcx     # 0xa5964
movl %edx, (%rcx)
testb $0x1, 0x25c(%rax)
je 0x62a9c
movl $0x1, -0x4(%rbp)
jmp 0x62c14
movq -0x1a0(%rbp), %rdi
callq 0x632e0
movb $0x0, -0x151(%rbp)
movq -0x1a0(%rbp), %rax
movb 0x25c(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x62ac7
jmp 0x62c0d
movq -0x1a0(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x634a0
leaq -0x178(%rbp), %rdi
leaq 0x10c35(%rip), %rsi     # 0x7371d
callq 0x50ce0
testb $0x1, %al
jne 0x62af3
jmp 0x62b1b
movb -0x151(%rbp), %dl
movl $0x2, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x17c(%rbp)
jmp 0x62bee
leaq -0x178(%rbp), %rdi
leaq 0x10bf8(%rip), %rsi     # 0x73721
callq 0x50ce0
testb $0x1, %al
jne 0x62b34
jmp 0x62b4a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x17c(%rbp)
jmp 0x62bee
leaq -0x178(%rbp), %rdi
leaq 0x10bc3(%rip), %rsi     # 0x7371b
callq 0x50ce0
testb $0x1, %al
jne 0x62b63
jmp 0x62b85
movb -0x151(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x17c(%rbp)
jmp 0x62bee
leaq -0x178(%rbp), %rdi
leaq 0x10c64(%rip), %rsi     # 0x737f7
xorl %eax, %eax
movl %eax, %edx
callq 0x8550
cmpq $-0x1, %rax
je 0x62be4
movb $0x1, -0x151(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x8130
movq %rax, %rsi
leaq 0x10c3e(%rip), %rdi     # 0x737fd
xorl %eax, %eax
callq 0x8050
jmp 0x62bc8
jmp 0x62be4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x8578
jmp 0x62c20
movl $0x0, -0x17c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x8578
movl -0x17c(%rbp), %eax
testl %eax, %eax
je 0x62c08
jmp 0x62c06
jmp 0x62c14
jmp 0x62aaf
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x84d0
nopl (%rax)