// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
leaq 0x1edf2(%rip), %rax     # 0x488f8
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x73e0
xorps %xmm0, %xmm0
movups %xmm0, 0x260(%rbx)
leaq 0x220(%rbx), %r15
movl 0x1fd9c(%rip), %edx     # 0x498c8
leal 0x1(%rdx), %eax
movl %eax, 0x1fd93(%rip)     # 0x498c8
leaq 0x8ac2(%rip), %rsi      # 0x325fe
movq %r15, %rdi
xorl %eax, %eax
callq 0x7070
leaq 0x1fd5b(%rip), %rdi     # 0x498a8
movq %r15, %rsi
callq 0x7440
leaq 0x260(%rbx), %rdi
movb $0x0, 0x25c(%rbx)
leaq 0x1fbf6(%rip), %rsi     # 0x49760
callq 0x112d4
andl $0x0, 0x270(%rbx)
leaq 0x208(%rbx), %r13
movq %r13, %rdi
callq 0x72f0
testl %eax, %eax
jne 0x29d80
leaq 0x210(%rbx), %rbp
movq %rbp, %rdi
callq 0x72f0
testl %eax, %eax
jne 0x29dd4
callq 0x70a0
movl %eax, 0x218(%rbx)
testl %eax, %eax
js 0x29e25
je 0x29e6e
movl (%r13), %edi
callq 0x7450
movl 0x214(%rbx), %edi
callq 0x7450
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x7050
leaq 0x8a46(%rip), %rsi      # 0x3262c
movq %r14, %rdi
callq 0x7230
leaq 0x1fc93(%rip), %rsi     # 0x49888
movq %rax, %rdi
callq 0x7210
leaq 0x8a66(%rip), %rsi      # 0x3266a
movq %rax, %rdi
callq 0x7230
leaq 0x8a25(%rip), %rsi      # 0x32638
movq %r14, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x28009
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x8a11(%rip), %rsi      # 0x3264d
movq %rax, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x48(%rsp), %rdi
callq 0x28009
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x89ee(%rip), %rsi      # 0x32653
movq %rax, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x28(%rsp), %rdi
callq 0x28009
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x89c9(%rip), %rsi      # 0x32657
movq %rax, %rdi
callq 0x7230
leaq 0x28(%rsp), %rdi
callq 0x7478
leaq 0x48(%rsp), %rdi
callq 0x7478
leaq 0x8(%rsp), %rdi
callq 0x7478
leaq 0x89b2(%rip), %rsi      # 0x3266d
movq %r14, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x28009
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x8969(%rip), %rsi      # 0x3264d
movq %rax, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x48(%rsp), %rdi
callq 0x28009
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x8946(%rip), %rsi      # 0x32653
movq %rax, %rdi
callq 0x7230
movq %rax, %r12
leaq 0x28(%rsp), %rdi
callq 0x28009
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x7210
leaq 0x894c(%rip), %rsi      # 0x32682
movq %rax, %rdi
callq 0x7230
leaq 0x28(%rsp), %rdi
callq 0x7478
leaq 0x48(%rsp), %rdi
callq 0x7478
leaq 0x8(%rsp), %rdi
callq 0x7478
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x71a0
movl %eax, 0x21c(%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x7140
movq %rax, %r12
leaq 0x887e(%rip), %rsi      # 0x32610
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xcfe2
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
movq %r12, %rdi
callq 0x28786
xorl %ebp, %ebp
leaq 0x1e7e0(%rip), %rsi     # 0x485a0
leaq -0x160b(%rip), %rdx     # 0x287bc
movq %r12, %rdi
callq 0x73f0
jmp 0x29e6e
pushq $0x28
popq %rdi
callq 0x7140
movq %rax, %r12
leaq 0x8835(%rip), %rsi      # 0x3261b
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xcfe2
movb $0x1, %bpl
leaq 0x88(%rsp), %rsi
movq %r12, %rdi
callq 0x28786
xorl %ebp, %ebp
leaq 0x1e78c(%rip), %rsi     # 0x485a0
leaq -0x165f(%rip), %rdx     # 0x287bc
movq %r12, %rdi
callq 0x73f0
jmp 0x29e6e
pushq $0x28
popq %rdi
callq 0x7140
movq %rax, %r12
leaq 0x87f0(%rip), %rsi      # 0x32627
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xcfe2
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
movq %r12, %rdi
callq 0x28786
xorl %ebp, %ebp
leaq 0x1e741(%rip), %rsi     # 0x485a0
leaq -0x16aa(%rip), %rdx     # 0x287bc
movq %r12, %rdi
callq 0x73f0
movb $0x1, 0x1fa0b(%rip)     # 0x49880
movl 0x20c(%rbx), %edi
callq 0x7450
movl (%rbp), %edi
callq 0x7450
movl 0x214(%rbx), %edi
pushq $0x1
popq %rsi
callq 0x7220
movl 0x208(%rbx), %edi
xorl %esi, %esi
callq 0x7220
movq (%r12), %rdi
callq 0x71e0
xorl %edi, %edi
callq 0x72c0
jmp 0x29f33
movq %rax, %r15
leaq 0x68(%rsp), %rdi
jmp 0x29edb
jmp 0x29ee7
movq %rax, %r15
leaq 0x88(%rsp), %rdi
jmp 0x29edb
jmp 0x29ee7
movq %rax, %r15
leaq 0xa8(%rsp), %rdi
callq 0x7478
testb %bpl, %bpl
jne 0x29eea
jmp 0x29f36
movq %rax, %r15
movq %r12, %rdi
callq 0x7190
jmp 0x29f36
jmp 0x29f15
jmp 0x29f24
jmp 0x29f33
jmp 0x29f15
jmp 0x29f24
jmp 0x29f33
jmp 0x29f06
jmp 0x29f15
jmp 0x29f24
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x7478
jmp 0x29f18
movq %rax, %r15
leaq 0x48(%rsp), %rdi
callq 0x7478
jmp 0x29f27
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x7478
jmp 0x29f36
movq %rax, %r15
addq $0x268, %rbx            # imm = 0x268
movq %rbx, %rdi
callq 0xefce
movq %r14, %rdi
callq 0x7350
movq %r15, %rdi
callq 0x7410
nop