// File: /workspace/github_cpp_makefile_star2_O1/eryxcc[P]lois/src/solvers.cpp
// Function: lois::SolverIncremental::SolverIncremental(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
SolverIncremental(std::string c) { 
    // fprintf(stderr, "[create incremental %d]\n", inccounter);
    sprintf(buf, "incremental%d.smt", inccounter++);
    lastsolver = buf;

    crashed = false; last = emptycontext;
    // ofs << "(declare-sort A 0)\n";

    ourindent = 0;
    
    if(pipe(solver_input))
      throw other_exception("pipe input");
    if(pipe(solver_output))
      throw other_exception("pipe output");
    
    child = fork();
    if(child < 0) throw other_exception("fork");
    else if(child == 0) {
      wearechild = true;
      close(solver_input[1]);
      close(solver_output[0]);
      dup2(solver_output[1], 1);
      dup2(solver_input[0], 0);
      int err = system(c.c_str());
//    fprintf(stderr, "[kill %s]\n", buf);
      exit(0);
      }
    
    close(solver_input[0]);
    close(solver_output[1]);

    ofs.open(buf, std::ofstream::out);
    ofs << "(set-logic " << smtLogic << ")\n";
    ofs << "(define-fun min ((a "<<smtsort()<<") (b "<<smtsort()<<")) "<<smtsort()<<" (ite (<= a b) a b))\n";
    ofs << "(define-fun max ((a "<<smtsort()<<") (b "<<smtsort()<<")) "<<smtsort()<<" (ite (>= a b) a b))\n";
//  fprintf(stderr, "[print logic %s]\n", buf);

    filepipe = open(buf, O_RDONLY);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r12
movq %rdi, %r14
leaq 0x1c24c(%rip), %rax     # 0x528f8
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x73f0
xorps %xmm0, %xmm0
movups %xmm0, 0x260(%r14)
leaq 0x220(%r14), %r15
movl 0x1d1ed(%rip), %edx     # 0x538c0
leal 0x1(%rdx), %eax
movl %eax, 0x1d1e4(%rip)     # 0x538c0
leaq 0xaf3f(%rip), %rsi      # 0x41622
movq %r15, %rdi
xorl %eax, %eax
callq 0x7080
movq 0x1d1b4(%rip), %r13     # 0x538a8
leaq 0x1d1a5(%rip), %rbp     # 0x538a0
movq %r15, %rdi
callq 0x7130
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x7380
movb $0x0, 0x25c(%r14)
leaq 0x1d03b(%rip), %rsi     # 0x53760
movq (%rsi), %rax
movq %rax, 0x260(%r14)
leaq 0x268(%r14), %rdi
addq $0x8, %rsi
callq 0x16086
movl $0x0, 0x270(%r14)
leaq 0x208(%r14), %r13
movq %r13, %rdi
callq 0x7310
testl %eax, %eax
jne 0x36a09
leaq 0x210(%r14), %rbp
movq %rbp, %rdi
callq 0x7310
testl %eax, %eax
jne 0x36a6d
callq 0x70a0
movl %eax, 0x218(%r14)
testl %eax, %eax
js 0x36ace
je 0x36b24
movl (%r13), %edi
callq 0x7460
movl 0x214(%r14), %edi
callq 0x7460
movq %rbx, %rdi
movq %r15, %rsi
movl $0x10, %edx
callq 0x7060
leaq 0xae92(%rip), %rsi      # 0x41650
movl $0xb, %edx
movq %rbx, %rdi
callq 0x72c0
movq 0x1d0ae(%rip), %rsi     # 0x53880
movq 0x1d0af(%rip), %rdx     # 0x53888
movq %rbx, %rdi
callq 0x72c0
leaq 0xaea6(%rip), %rsi      # 0x4168e
movl $0x2, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0xae60(%rip), %rsi      # 0x4165c
movl $0x14, %edx
movq %rbx, %rdi
callq 0x72c0
leaq 0x8(%rsp), %rdi
callq 0x34b0b
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x72c0
movq %rax, %r12
leaq 0xae42(%rip), %rsi      # 0x41671
movl $0x5, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x34b0b
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x72c0
movq %rax, %r12
leaq 0xae15(%rip), %rsi      # 0x41677
movl $0x3, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0x28(%rsp), %rdi
callq 0x34b0b
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x72c0
leaq 0xade9(%rip), %rsi      # 0x4167b
movl $0x15, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0x38(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x368ba
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7280
leaq 0x58(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x368d5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7280
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x368f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7280
leaq 0xad9a(%rip), %rsi      # 0x41691
movl $0x14, %edx
movq %rbx, %rdi
callq 0x72c0
leaq 0x8(%rsp), %rdi
callq 0x34b0b
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x72c0
movq %rax, %r12
leaq 0xad47(%rip), %rsi      # 0x41671
movl $0x5, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x34b0b
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x72c0
movq %rax, %r12
leaq 0xad1a(%rip), %rsi      # 0x41677
movl $0x3, %edx
movq %rax, %rdi
callq 0x72c0
leaq 0x28(%rsp), %rdi
callq 0x34b0b
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x72c0
leaq 0xad19(%rip), %rsi      # 0x416a6
movl $0x15, %edx
movq %rax, %rdi
callq 0x72c0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x18(%rsp), %r12
je 0x369b6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x369cd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7280
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x369e4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7280
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x71c0
movl %eax, 0x21c(%r14)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x7150
movq %rax, %r12
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xac0b(%rip), %rsi      # 0x41634
leaq 0xac0e(%rip), %rdx      # 0x4163e
leaq 0xa8(%rsp), %rdi
callq 0x1c6d0
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
movq %r12, %rdi
callq 0x3560a
xorl %ebp, %ebp
leaq 0x1bb47(%rip), %rsi     # 0x525a0
leaq -0x140c(%rip), %rdx     # 0x35654
movq %r12, %rdi
callq 0x7400
jmp 0x36b24
movl $0x28, %edi
callq 0x7150
movq %rax, %r12
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xabb2(%rip), %rsi      # 0x4163f
leaq 0xabb6(%rip), %rdx      # 0x4164a
leaq 0x88(%rsp), %rdi
callq 0x1c6d0
movb $0x1, %bpl
leaq 0x88(%rsp), %rsi
movq %r12, %rdi
callq 0x3560a
xorl %ebp, %ebp
leaq 0x1bae3(%rip), %rsi     # 0x525a0
leaq -0x1470(%rip), %rdx     # 0x35654
movq %r12, %rdi
callq 0x7400
jmp 0x36b24
movl $0x28, %edi
callq 0x7150
movq %rax, %r12
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xab60(%rip), %rsi      # 0x4164b
leaq 0xab5d(%rip), %rdx      # 0x4164f
leaq 0x68(%rsp), %rdi
callq 0x1c6d0
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
movq %r12, %rdi
callq 0x3560a
xorl %ebp, %ebp
leaq 0x1ba8b(%rip), %rsi     # 0x525a0
leaq -0x14c8(%rip), %rdx     # 0x35654
movq %r12, %rdi
callq 0x7400
movb $0x1, 0x1cd4d(%rip)     # 0x53878
movl 0x20c(%r14), %edi
callq 0x7460
movl (%rbp), %edi
callq 0x7460
movl 0x214(%r14), %edi
movl $0x1, %esi
callq 0x7240
movl 0x208(%r14), %edi
xorl %esi, %esi
callq 0x7240
movq (%r12), %rdi
callq 0x7210
xorl %edi, %edi
callq 0x72f0
jmp 0x36c9f
movq %rax, %r15
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x36bcd
movq 0x78(%rsp), %rsi
jmp 0x36bbd
jmp 0x36bc7
movq %rax, %r15
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x36bcd
movq 0x98(%rsp), %rsi
jmp 0x36bbd
jmp 0x36bc7
movq %rax, %r15
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x36bcd
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36bcd
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x36ca2
movq %r12, %rdi
callq 0x71b0
jmp 0x36ca2
jmp 0x36c14
jmp 0x36c30
jmp 0x36c9f
jmp 0x36c5f
jmp 0x36c7f
jmp 0x36c9f
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x36c17
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36c17
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x36c33
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36c33
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
jmp 0x36c8b
movq %rax, %r15
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c62
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36c62
movq %rax, %r15
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c82
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36c82
movq %rax, %r15
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36ca2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7280
jmp 0x36ca2
movq %rax, %r15
movq 0x268(%r14), %rdi
testq %rdi, %rdi
je 0x36cb3
callq 0x13308
movq %rbx, %rdi
callq 0x7350
movq %r15, %rdi
callq 0x7430
nop