// File: /workspace/github_cpp_makefile_star2_O1/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, 0x48(%rsp)
movq %rsi, %r8
movq %rdi, 0xb0(%rsp)
leaq 0xf(%rsp), %rcx
movb %dl, (%rcx)
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdx
callq 0x29314
movq (%rbx), %rax
movq %rax, (%r15)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x28a84
movq 0x2a552(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x28a80
incl 0x8(%rax)
jmp 0x28a84
lock
incl 0x8(%rax)
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0x28d51
leaq 0x10(%rsp), %rbp
movq 0x2a525(%rip), %r15     # 0x52fc8
leaq 0x60(%rsp), %r13
testq %rax, %rax
je 0x28dd6
cmpb $0x1, 0xf(%rsp)
jne 0x28ae0
movq 0x10(%rax), %rcx
movq %rcx, 0xa0(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x28b0c
cmpb $0x0, (%r15)
je 0x28b08
incl 0x8(%rax)
jmp 0x28b0c
movq 0x10(%rax), %rcx
movq %rcx, 0x80(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x28b5d
cmpb $0x0, (%r15)
je 0x28b59
incl 0x8(%rax)
jmp 0x28b5d
lock
incl 0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x29645
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x90(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x28bed
cmpb $0x0, (%r15)
je 0x28be9
incl 0x8(%rax)
jmp 0x28bed
lock
incl 0x8(%rax)
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x70(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x28b88
cmpb $0x0, (%r15)
je 0x28b84
incl 0x8(%rax)
jmp 0x28b88
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0x80(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x2b0ed
movq 0x28(%rsp), %rax
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x20(%rax), %rdi
movups %xmm0, 0x18(%rax)
testq %rdi, %rdi
je 0x28bc1
callq 0x13308
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28bd0
callq 0x13308
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28bdf
callq 0x13308
movq 0x88(%rsp), %rdi
jmp 0x28c64
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x2b3f6
movq 0x28(%rsp), %rax
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x20(%rax), %rdi
movups %xmm0, 0x18(%rax)
testq %rdi, %rdi
je 0x28c29
callq 0x13308
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28c38
callq 0x13308
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28c4a
callq 0x13308
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x28c5c
callq 0x13308
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x28c6e
callq 0x13308
movq 0x38(%rsp), %rax
movq 0x20(%rax), %r12
movq 0x28(%rax), %r14
cmpq %r14, %r12
je 0x28d23
movq (%r12), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%r12), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x28cab
cmpb $0x0, (%r15)
je 0x28ca7
incl 0x8(%rax)
jmp 0x28cab
lock
incl 0x8(%rax)
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x28cdc
cmpb $0x0, (%r15)
je 0x28cd8
incl 0x8(%rax)
jmp 0x28cdc
lock
incl 0x8(%rax)
movq (%rdi), %rax
movq %r13, %rsi
callq *0x28(%rax)
movl %eax, %ebx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x28cf6
callq 0x13308
testb %bl, %bl
je 0x28d0b
movq 0x28(%rsp), %rdi
addq $0x28, %rdi
movq %rbp, %rsi
callq 0x162a6
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28d1a
callq 0x13308
addq $0x10, %r12
jmp 0x28c7b
movq 0x38(%rsp), %rsi
movq (%rsi), %rax
movq %rax, 0x38(%rsp)
addq $0x8, %rsi
leaq 0x40(%rsp), %rdi
callq 0x16086
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x28aa8
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rax
movq %rsi, 0x50(%rsp)
movq %rax, 0x58(%rsp)
testq %rax, %rax
movq 0xb0(%rsp), %rbx
je 0x28d87
movq 0x2a24f(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x28d83
incl 0x8(%rax)
jmp 0x28d87
lock
incl 0x8(%rax)
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x2a26a
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x28da3
callq 0x13308
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x28db2
callq 0x13308
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28dc1
callq 0x13308
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 0x28711(%rip), %rcx     # 0x514f8
movq %rcx, (%rax)
leaq 0x286df(%rip), %rsi     # 0x514d0
movq 0x2a1e8(%rip), %rdx     # 0x52fe0
movq %rax, %rdi
callq 0x7400
movq %rax, %rbx
movq 0x58(%rsp), %rdi
jmp 0x28e7d
movq %rax, %rbx
jmp 0x28e52
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28e21
callq 0x13308
movq 0x88(%rsp), %rdi
jmp 0x28e7d
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28e40
callq 0x13308
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x28e52
callq 0x13308
movq 0xa8(%rsp), %rdi
jmp 0x28e7d
movq %rax, %rbx
jmp 0x28e87
movq %rax, %rbx
jmp 0x28e78
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x28e78
callq 0x13308
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28e87
callq 0x13308
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x28e96
callq 0x13308
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28ea5
callq 0x13308
movq %rbx, %rdi
callq 0x7430
nop