// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movq %r8, %rbx
movq %rcx, 0x58(%rsp)
movq %rsi, %r8
movq %rdi, %r14
leaq 0xf(%rsp), %rcx
movb %dl, (%rcx)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %r15
movq %r15, %rdx
callq 0x294ac
movq (%rbx), %rax
movq %rax, (%r15)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%r15)
testq %rcx, %rcx
movq %r14, 0xb0(%rsp)
je 0x28be2
movq 0x293f9(%rip), %rdx     # 0x51fc8
cmpb $0x0, (%rdx)
je 0x28bd9
incl 0x8(%rcx)
jmp 0x28be2
lock
incl 0x8(%rcx)
movq 0x48(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq (%rcx), %rax
je 0x28eda
leaq 0x20(%rsp), %rbp
movq 0x293cc(%rip), %r15     # 0x51fc8
leaq 0x38(%rsp), %r13
testq %rax, %rax
je 0x28f5f
cmpb $0x1, 0xf(%rsp)
jne 0x28c39
movq 0x10(%rax), %rcx
movq %rcx, 0xa0(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x28c65
cmpb $0x0, (%r15)
je 0x28c61
incl 0x8(%rax)
jmp 0x28c65
movq 0x10(%rax), %rcx
movq %rcx, 0x80(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x28cb6
cmpb $0x0, (%r15)
je 0x28cb2
incl 0x8(%rax)
jmp 0x28cb6
lock
incl 0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x297dd
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x90(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x28d46
cmpb $0x0, (%r15)
je 0x28d42
incl 0x8(%rax)
jmp 0x28d46
lock
incl 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x70(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x28ce1
cmpb $0x0, (%r15)
je 0x28cdd
incl 0x8(%rax)
jmp 0x28ce1
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0x80(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x2b213
movq 0x10(%rsp), %rax
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x20(%rax), %rdi
movups %xmm0, 0x18(%rax)
testq %rdi, %rdi
je 0x28d29
callq 0x133fc
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x28d29
callq 0x133fc
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28d38
callq 0x133fc
movq 0x88(%rsp), %rdi
jmp 0x28dbd
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x2b4e8
movq 0x10(%rsp), %rax
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x20(%rax), %rdi
movups %xmm0, 0x18(%rax)
testq %rdi, %rdi
je 0x28d91
callq 0x133fc
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x28d91
callq 0x133fc
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28da3
callq 0x133fc
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x28db5
callq 0x133fc
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x28dc7
callq 0x133fc
movq 0x48(%rsp), %rsi
movq 0x20(%rsi), %r12
movq 0x28(%rsi), %r14
cmpq %r14, %r12
je 0x28eb1
movq (%r12), %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%r12), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x28e13
cmpb $0x0, (%r15)
je 0x28e2c
incl 0x8(%rax)
movq 0x10(%rsp), %rdx
movq 0x18(%rdx), %rdi
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x28e52
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq %rcx, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
jmp 0x28e61
lock
incl 0x8(%rax)
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rdx
movq 0x18(%rdx), %rdi
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x28e61
cmpb $0x0, (%r15)
je 0x28e5d
incl 0x8(%rax)
jmp 0x28e61
lock
incl 0x8(%rax)
movq (%rdi), %rax
movq %r13, %rsi
callq *0x28(%rax)
movl %eax, %ebx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x28e7b
callq 0x133fc
testb %bl, %bl
je 0x28e90
movq 0x10(%rsp), %rdi
addq $0x28, %rdi
movq %rbp, %rsi
callq 0x16382
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x28e9f
callq 0x133fc
addq $0x10, %r12
cmpq %r14, %r12
jne 0x28ddd
movq 0x48(%rsp), %rsi
movq (%rsi), %rax
movq %rax, 0x48(%rsp)
addq $0x8, %rsi
leaq 0x50(%rsp), %rdi
callq 0x1615e
movq 0x48(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x28c01
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
movq %rsi, 0x60(%rsp)
movq %rax, 0x68(%rsp)
testq %rax, %rax
movq 0xb0(%rsp), %rbx
je 0x28f10
movq 0x290c6(%rip), %rcx     # 0x51fc8
cmpb $0x0, (%rcx)
je 0x28f0c
incl 0x8(%rax)
jmp 0x28f10
lock
incl 0x8(%rax)
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x2a464
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x28f2c
callq 0x133fc
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x28f3b
callq 0x133fc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28f4a
callq 0x133fc
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x7150
leaq 0x275b0(%rip), %rcx     # 0x50520
movq %rcx, (%rax)
leaq 0x2757e(%rip), %rsi     # 0x504f8
movq 0x2905f(%rip), %rdx     # 0x51fe0
movq %rax, %rdi
callq 0x7400
movq %rax, %rbx
movq 0x68(%rsp), %rdi
jmp 0x29006
movq %rax, %rbx
jmp 0x28fdb
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28faa
callq 0x133fc
movq 0x88(%rsp), %rdi
jmp 0x29006
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28fc9
callq 0x133fc
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x28fdb
callq 0x133fc
movq 0xa8(%rsp), %rdi
jmp 0x29006
movq %rax, %rbx
jmp 0x29010
movq %rax, %rbx
jmp 0x29001
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x29001
callq 0x133fc
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x29010
callq 0x133fc
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2901f
callq 0x133fc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2902e
callq 0x133fc
movq %rbx, %rdi
callq 0x7430