// File: /workspace/github_cpp_makefile_star2_O2/eryxcc[P]lois/src/env.cpp
// Function: lois::outenv(lois::rbool, bool, std::shared_ptr<lois::Context>, std::shared_ptr<lois::Context>)
rbool outenv(rbool phi, bool universal, contextptr anccontext, contextptr nowcontext) {
  auto qquery = std::make_shared<FormulaQ> (universal, phi);
  contextptr e = nowcontext;
  while(e != anccontext) {
    if(!e) throw env_exception();
    if(universal)
      qquery->right = (!e->phi) || qquery->right;
    else
      qquery->right = (e->phi) && qquery->right;
    for(auto w: e->var)
      if(qquery->right->uses(w)) qquery->var.push_back(w);
    e = e->parent;
    }
  
  qquery->setfv();
  
  // std::cout << "Simplifying qquery: " << rbool(qquery) << std::endl;
  auto q = qquery->simplify(qquery);
  // std::cout << "Qquery simplified." << std::endl;
  return q;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r8, %rbx
movq %rcx, 0x40(%rsp)
movq %rsi, %rax
movq %rdi, 0x38(%rsp)
leaq 0x7(%rsp), %rsi
movb %dl, (%rsi)
leaq 0x8(%rsp), %rdi
movq %rax, %rdx
callq 0x1eacb
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0xf7c2
leaq 0xb0(%rsp), %rbx
leaq 0x48(%rsp), %r12
leaq 0x28(%rsp), %r15
leaq 0xa8(%rsp), %r13
movq 0x18(%rsp), %rsi
movq 0x40(%rsp), %rax
cmpq (%rax), %rsi
je 0x1e6e6
testq %rsi, %rsi
je 0x1e741
addq $0x10, %rsi
cmpb $0x1, 0x7(%rsp)
jne 0x1e5fc
leaq 0x98(%rsp), %r14
movq %r14, %rdi
callq 0xf04a
movq %r12, %rdi
movq %r14, %rsi
callq 0x1ef2d
movq 0x8(%rsp), %rsi
addq $0x18, %rsi
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0xf04a
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x202f9
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movq %r15, %rsi
callq 0xf3dc
leaq 0x30(%rsp), %rdi
callq 0xefce
leaq 0x90(%rsp), %rdi
callq 0xefce
leaq 0x50(%rsp), %rdi
callq 0xefce
leaq 0xa0(%rsp), %rdi
jmp 0x1e65a
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0xf04a
movq 0x8(%rsp), %rsi
addq $0x18, %rsi
leaq 0x68(%rsp), %r12
movq %r12, %rdi
callq 0xf04a
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20113
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movq %r15, %rsi
callq 0xf3dc
leaq 0x30(%rsp), %rdi
callq 0xefce
leaq 0x70(%rsp), %rdi
callq 0xefce
leaq 0x80(%rsp), %rdi
callq 0xefce
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rbp
movq 0x28(%rax), %r12
cmpq %r12, %rbp
je 0x1e6cd
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1160e
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r14
movq %r13, %rdi
movq %r15, %rsi
callq 0x1160e
movq (%r14), %rax
movq %r14, %rdi
movq %r13, %rsi
callq *0x28(%rax)
movl %eax, %r14d
movq %rbx, %rdi
callq 0xefce
testb %r14b, %r14b
je 0x1e6bd
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
movq %r15, %rsi
callq 0x11466
leaq 0x30(%rsp), %rdi
callq 0xefce
addq $0x10, %rbp
jmp 0x1e66c
movq 0x18(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x112d4
leaq 0x48(%rsp), %r12
jmp 0x1e557
leaq 0x8(%rsp), %rsi
movq (%rsi), %rbx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x1eb2a
movq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1f888
leaq 0x60(%rsp), %rdi
callq 0xefce
leaq 0x20(%rsp), %rdi
callq 0xefce
leaq 0x10(%rsp), %rdi
callq 0xefce
movq %r15, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x7140
leaq 0x28dd0(%rip), %rcx     # 0x47520
movq %rcx, (%rax)
leaq 0x28d9e(%rip), %rsi     # 0x474f8
movq 0x2a87f(%rip), %rdx     # 0x48fe0
movq %rax, %rdi
callq 0x73f0
movq %rax, %r14
leaq 0x60(%rsp), %rdi
jmp 0x1e7cd
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0xefce
leaq 0x80(%rsp), %rdi
jmp 0x1e7cd
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0xefce
leaq 0x50(%rsp), %rdi
callq 0xefce
jmp 0x1e7a9
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
jmp 0x1e7cd
movq %rax, %r14
jmp 0x1e7d2
movq %rax, %r14
jmp 0x1e7c8
movq %rax, %r14
movq %rbx, %rdi
callq 0xefce
leaq 0x30(%rsp), %rdi
callq 0xefce
leaq 0x20(%rsp), %rdi
callq 0xefce
leaq 0x10(%rsp), %rdi
callq 0xefce
movq %r14, %rdi
callq 0x7410