// File: /workspace/github_cpp_makefile_star2_O1/eryxcc[P]lois/src/formula.cpp
// Function: lois::FormulaQ::simplify(std::shared_ptr<lois::FormulaQ>)
rbool FormulaQ::simplify(std::shared_ptr<FormulaQ> def) {
  
  using namespace std;
  // we know the value of something, maybe?
  for(size_t i=0; i<var.size(); i++) {
    vptr v = var[i];
    if(!right->uses(v)) {
      var[i] = var[var.size()-1];
      var.pop_back(); i--;
      }
    else {
      term v1 = right->valueKnown(v, type);
      if(v1.p) {
        right = substitute(right, v, v1);
        var[i] = var[var.size()-1];
        var.pop_back(); i--;
        }
      }
    }
  
  // no variables
  if(!var.size()) return right;    
  // quantified true/false
  auto fix = std::dynamic_pointer_cast<FormulaFixed> (right.p);
  if(fix) return right;
  
  /*
  // quantified binary, one side does not use the vars
  auto bin = std::dynamic_pointer_cast<FormulaBi> (right.p);
  if(bin) {
    bool leftuses = false, rightuses = false;
    for(auto v: var) leftuses |= bin->left->uses(v), rightuses |= bin->right->uses(v);

    if(!leftuses && bin->type == true) return bin->left && makeq(type, bin->right, var);
    if(!rightuses && bin->type == true) return bin->right && makeq(type, bin->left, var);
    if(!leftuses && bin->type == false) return bin->left || makeq(type, bin->right, var);
    if(!rightuses && bin->type == false) return bin->right || makeq(type, bin->left, var);
    } */
  
  // quantified (in)equality
  // as long as we assume that !right->unused(all vars),
  // and that they are variables,
  // we know the value
  auto eq = std::dynamic_pointer_cast<FormulaEq> (right.p);
  if(eq && eq->t1.asVar() && eq->t2.asVar()) return type ? ffalse : ftrue;
  
  // take the independent components out of the quantifier
  auto bin = std::dynamic_pointer_cast<FormulaBi> (right.p);
  if(bin) {
    bool btype = bin->type;
    std::vector<rbool> phi;
    std::vector<int> vused;
    decomposeBin(right, btype, phi);
    bool suc = false;
    for(size_t k=0; k<phi.size(); k++) {
      size_t li = 0;
      for(size_t i=0; i<var.size(); i++)
        if(phi[k]->uses(var[i])) li = i+1;
      if(li < var.size()) suc = true;
      vused.push_back(li);
      }
    
    if(suc) {
      for(int k=1; k<phi.size(); ) {
        if(k && vused[k] < vused[k-1]) 
          std::swap(vused[k], vused[k-1]), std::swap(phi[k], phi[k-1]), k--;
        else
          k++;
        }
      
      int at = phi.size()-1;
      rbool nphi = phi[at];
      int lev = vused[at];
  
/*    std::cout << "SIMPLIFYING: ";
      display(std::cout);
      std::cout << std::endl;
      
      for(int k=0; k<phi.size(); k++)
        std::cout << k << "." << vused[k] << ") " << phi[k] << std::endl; */
      
      while(true) {
        at--;
        int nlev = at >= 0 ? vused[at] : 0;
        if(lev > nlev) {
          varlist v;
          while(lev > nlev) { lev--; v.push_back(var[lev]); }
          nphi = makeq(type, nphi, v);
          }
        if(at < 0) {
/*        std::cout << "SIMPLIFIED: ";
          display(std::cout);
          std::cout << " TO: " << nphi << std::endl; */
          return nphi;
          }
        else if(btype) nphi = phi[at] && nphi;
        else nphi = phi[at] || nphi;
        }
      }
    }
  
  return rbool(def);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, 0x140(%rsp)
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
movq 0x28(%rsi), %rax
movq 0x30(%rsi), %rcx
cmpq %rax, %rcx
je 0x2a4fa
leaq 0x18(%r12), %rcx
movq %rcx, 0x10(%rsp)
xorl %r13d, %r13d
movq %r13, %rbp
shlq $0x4, %rbp
movq (%rax,%rbp), %rbx
movq 0x8(%rax,%rbp), %rax
testq %rax, %rax
movq %rax, %r15
je 0x2a2de
movq 0x28d00(%rip), %rax     # 0x52fc8
cmpb $0x0, (%rax)
je 0x2a2d6
movq %r15, %rax
incl 0x8(%r15)
jmp 0x2a2de
movq %r15, %rax
lock
incl 0x8(%r15)
movq 0x10(%rsp), %rcx
movq (%rcx), %rdi
movq %rbx, 0x120(%rsp)
movq %rax, 0x128(%rsp)
testq %rax, %rax
je 0x2a312
movq 0x28cc6(%rip), %rax     # 0x52fc8
cmpb $0x0, (%rax)
je 0x2a30d
incl 0x8(%r15)
jmp 0x2a312
lock
incl 0x8(%r15)
movq (%rdi), %rax
leaq 0x120(%rsp), %rsi
callq *0x28(%rax)
movl %eax, %r14d
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x2a335
callq 0x13308
testb %r14b, %r14b
je 0x2a369
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq %rbx, 0x110(%rsp)
movq %r15, 0x118(%rsp)
testq %r15, %r15
je 0x2a3b5
movq 0x28c6a(%rip), %rax     # 0x52fc8
cmpb $0x0, (%rax)
je 0x2a3b0
incl 0x8(%r15)
jmp 0x2a3b5
movq 0x28(%r12), %rax
movq 0x30(%r12), %rsi
movq -0x10(%rsi), %rcx
leaq (%rax,%rbp), %rdi
addq $0x8, %rdi
movq %rcx, -0x8(%rdi)
addq $-0x8, %rsi
callq 0x16086
movq 0x30(%r12), %rax
leaq -0x10(%rax), %rcx
movq %rcx, 0x30(%r12)
movq -0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2a3a8
callq 0x13308
movq %r15, %rbx
jmp 0x2a4d0
lock
incl 0x8(%r15)
movzbl 0x10(%r12), %ecx
movq (%rsi), %rax
leaq 0x30(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq *0x30(%rax)
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x2a3e0
callq 0x13308
cmpq $0x0, 0x30(%rsp)
je 0x2a411
movq %rbx, 0x100(%rsp)
movq %r15, %rbx
movq %r15, 0x108(%rsp)
testq %r15, %r15
je 0x2a41d
movq 0x28bc1(%rip), %rax     # 0x52fc8
cmpb $0x0, (%rax)
je 0x2a419
incl 0x8(%rbx)
jmp 0x2a41d
movq %r15, %rbx
jmp 0x2a4be
lock
incl 0x8(%rbx)
leaq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rsi
leaq 0x100(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x1618d
movaps 0x50(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x50(%rsp)
movq 0x20(%r12), %rdi
movups %xmm0, 0x18(%r12)
testq %rdi, %rdi
je 0x2a45b
callq 0x13308
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x2a46a
callq 0x13308
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x2a47c
callq 0x13308
movq 0x28(%r12), %rax
movq 0x30(%r12), %rsi
movq -0x10(%rsi), %rcx
leaq (%rax,%rbp), %rdi
addq $0x8, %rdi
movq %rcx, -0x8(%rdi)
addq $-0x8, %rsi
callq 0x16086
movq 0x30(%r12), %rax
leaq -0x10(%rax), %rcx
movq %rcx, 0x30(%r12)
movq -0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2a4bb
callq 0x13308
decq %r13
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2a4cd
callq 0x13308
incq %r13
testq %rbx, %rbx
je 0x2a4dd
movq %rbx, %rdi
callq 0x13308
movq 0x28(%r12), %rax
movq 0x30(%r12), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpq %rdx, %r13
jb 0x2a2a9
movq 0x18(%r12), %rdi
cmpq %rax, %rcx
je 0x2a526
testq %rdi, %rdi
je 0x2a554
leaq 0x276a8(%rip), %rsi     # 0x51bb8
leaq 0x27799(%rip), %rdx     # 0x51cb0
xorl %ecx, %ecx
callq 0x72b0
testq %rax, %rax
sete %al
jmp 0x2a556
movq 0x8(%rsp), %rcx
movq %rdi, (%rcx)
movq 0x20(%r12), %rax
movq %rax, 0x8(%rcx)
testq %rax, %rax
je 0x2ae59
movq 0x28a81(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a579
incl 0x8(%rax)
jmp 0x2ae59
movb $0x1, %al
testb %al, %al
je 0x2a55e
xorl %ebx, %ebx
jmp 0x2a586
movq 0x20(%r12), %rbx
testq %rbx, %rbx
je 0x2a586
movq 0x28a59(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a582
incl 0x8(%rbx)
jmp 0x2a586
lock
incl 0x8(%rax)
jmp 0x2ae59
lock
incl 0x8(%rbx)
movq 0x18(%r12), %rdi
testb %al, %al
je 0x2a5ae
testq %rdi, %rdi
je 0x2a5dc
leaq 0x2761d(%rip), %rsi     # 0x51bb8
leaq 0x2773e(%rip), %rdx     # 0x51ce0
xorl %ecx, %ecx
callq 0x72b0
movq %rax, %r14
jmp 0x2a5df
movq 0x8(%rsp), %rcx
movq %rdi, (%rcx)
movq 0x20(%r12), %rax
movq %rax, 0x8(%rcx)
testq %rax, %rax
je 0x2ae4c
movq 0x289f9(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a617
incl 0x8(%rax)
jmp 0x2ae4c
xorl %r14d, %r14d
testq %r14, %r14
je 0x2a609
movq 0x20(%r12), %rcx
movq %rcx, 0x20(%rsp)
testq %rcx, %rcx
je 0x2a629
movq 0x289ce(%rip), %rax     # 0x52fc8
cmpb $0x0, (%rax)
je 0x2a620
movq 0x20(%rsp), %rax
incl 0x8(%rax)
jmp 0x2a629
xorl %r14d, %r14d
movq $0x0, 0x20(%rsp)
jmp 0x2a629
lock
incl 0x8(%rax)
jmp 0x2ae4c
movq 0x20(%rsp), %rax
lock
incl 0x8(%rax)
testq %r14, %r14
movq %rbx, 0x28(%rsp)
je 0x2a66c
leaq 0x18(%r14), %rsi
leaq 0x158(%rsp), %r15
movq %r15, %rdi
callq 0x2afc4
cmpq $0x0, (%r15)
je 0x2a66c
leaq 0x28(%r14), %rsi
leaq 0x148(%rsp), %r15
movq %r15, %rdi
callq 0x2afc4
cmpq $0x0, (%r15)
setne %bl
movb $0x1, %al
jmp 0x2a670
xorl %eax, %eax
xorl %ebx, %ebx
testb %al, %al
je 0x2a686
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0x2a686
callq 0x13308
testq %r14, %r14
je 0x2a69d
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x2a69d
callq 0x13308
testb %bl, %bl
je 0x2a704
leaq 0x29118(%rip), %rax     # 0x537c0
cmpb $0x0, 0x10(%r12)
leaq 0x290fb(%rip), %rcx     # 0x537b0
cmovneq %rax, %rcx
movq (%rcx), %rax
leaq 0x29105(%rip), %rcx     # 0x537c8
leaq 0x290ee(%rip), %rdx     # 0x537b8
cmovneq %rcx, %rdx
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq (%rdx), %rax
movq %rax, 0x8(%rcx)
testq %rax, %rax
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %r14
je 0x2ae3f
movq 0x288d1(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a763
incl 0x8(%rax)
jmp 0x2ae3f
movq 0x18(%r12), %rdi
testq %rdi, %rdi
movq 0x28(%rsp), %rbx
je 0x2a72a
leaq 0x2749e(%rip), %rsi     # 0x51bb8
leaq 0x275a7(%rip), %rdx     # 0x51cc8
xorl %ecx, %ecx
callq 0x72b0
jmp 0x2a72c
xorl %eax, %eax
testq %rax, %rax
je 0x2a756
movq 0x20(%r12), %rdx
movq %rdx, 0x48(%rsp)
testq %rdx, %rdx
je 0x2a775
movq 0x28881(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a76c
movq 0x48(%rsp), %rcx
incl 0x8(%rcx)
jmp 0x2a775
xorl %eax, %eax
movq $0x0, 0x48(%rsp)
jmp 0x2a775
lock
incl 0x8(%rax)
jmp 0x2ae3f
movq 0x48(%rsp), %rcx
lock
incl 0x8(%rcx)
testq %rax, %rax
je 0x2adcb
movb 0x10(%rax), %al
movb %al, 0x7(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq 0x18(%r12), %rax
movq %rax, 0xf0(%rsp)
movq 0x20(%r12), %rax
movq %rax, 0xf8(%rsp)
testq %rax, %rax
je 0x2a7d2
movq 0x28804(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a7ce
incl 0x8(%rax)
jmp 0x2a7d2
lock
incl 0x8(%rax)
movzbl 0x7(%rsp), %esi
leaq 0xf0(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2a109
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x2a7fb
callq 0x13308
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x2a948
xorl %r15d, %r15d
movl $0x0, 0x1c(%rsp)
movq 0x28(%r12), %rax
movq 0x30(%r12), %rdx
subq %rax, %rdx
movq %r15, 0x10(%rsp)
je 0x2a8cc
movl $0x8, %ebx
shlq $0x4, %r15
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x30(%rsp), %rcx
movq (%rcx,%r15), %rdi
movq -0x8(%rax,%rbx), %rcx
movq %rcx, 0xe0(%rsp)
movq (%rax,%rbx), %rax
movq %rax, 0xe8(%rsp)
testq %rax, %rax
je 0x2a879
movq 0x2875d(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2a875
incl 0x8(%rax)
jmp 0x2a879
lock
incl 0x8(%rax)
movq (%rdi), %rax
leaq 0xe0(%rsp), %rsi
callq *0x28(%rax)
movl %eax, %ebp
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x2a89b
callq 0x13308
incq %r14
movq %r14, %rcx
testb %bpl, %bpl
jne 0x2a8a9
movq %r13, %rcx
movq 0x28(%r12), %rax
movq 0x30(%r12), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
addq $0x10, %rbx
movq %rcx, %r13
cmpq %rdx, %r14
jb 0x2a83d
jmp 0x2a8d2
sarq $0x4, %rdx
xorl %ecx, %ecx
cmpq %rdx, %rcx
movl 0x1c(%rsp), %eax
movzbl %al, %eax
movl $0x1, %edx
cmovbl %edx, %eax
movl %eax, 0x1c(%rsp)
movl %ecx, 0x70(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x2a90f
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %r15
jmp 0x2a928
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq 0x28(%rsp), %rbx
callq 0x2e352
movq 0x10(%rsp), %r15
incq %r15
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x4, %rax
cmpq %rax, %r15
jb 0x2a816
movl 0x1c(%rsp), %eax
jmp 0x2a94a
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
testb $0x1, %al
je 0x2aa49
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rcx
subq %rbx, %rcx
sarq $0x4, %rcx
cmpq $0x2, %rcx
jb 0x2aa0d
movl $0x1, %ebp
movl $0x1, %eax
testl %ebp, %ebp
je 0x2a9ee
movq 0x50(%rsp), %rcx
movl (%rcx,%rax,4), %edx
movslq %ebp, %r14
movl -0x4(%rcx,%r14,4), %esi
cmpl %esi, %edx
jge 0x2a9ee
decq %r14
movl %esi, (%rcx,%rax,4)
movl %edx, (%rcx,%r14,4)
shlq $0x4, %rax
shlq $0x4, %r14
movq (%rbx,%rax), %r13
movq 0x8(%rbx,%rax), %r15
xorps %xmm1, %xmm1
movups %xmm1, (%rbx,%rax)
movups (%rbx,%r14), %xmm0
movups %xmm1, (%rbx,%r14)
movq 0x8(%rbx,%rax), %rdi
movups %xmm0, (%rbx,%rax)
testq %rdi, %rdi
je 0x2a9d2
callq 0x13308
decl %ebp
addq %r14, %rbx
movq %r13, (%rbx)
movq 0x8(%rbx), %rdi
movq %r15, 0x8(%rbx)
testq %rdi, %rdi
je 0x2a9f0
callq 0x13308
jmp 0x2a9f0
incl %ebp
movslq %ebp, %rax
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rcx
subq %rbx, %rcx
sarq $0x4, %rcx
cmpq %rax, %rcx
ja 0x2a97b
decl %ecx
movslq %ecx, %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq (%rbx,%rcx), %rdx
movq 0x8(%rsp), %rsi
movq %rdx, (%rsi)
movq 0x8(%rbx,%rcx), %rcx
movq %rcx, 0x8(%rsi)
testq %rcx, %rcx
movq 0x28(%rsp), %rbx
je 0x2aa73
movq 0x28589(%rip), %rdx     # 0x52fc8
cmpb $0x0, (%rdx)
je 0x2aa6f
incl 0x8(%rcx)
jmp 0x2aa73
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2aa60
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x7280
leaq 0x30(%rsp), %rdi
callq 0x2d246
jmp 0x2adcb
lock
incl 0x8(%rcx)
movq 0x50(%rsp), %rcx
movl (%rcx,%rax,4), %r13d
movl %eax, %ecx
movl $0x0, 0x6c(%rsp)
leaq 0x70(%rsp), %rbp
movq 0x28536(%rip), %r15     # 0x52fc8
leal -0x1(%rcx), %eax
movl %eax, %r14d
movl $0x0, %eax
movq %rcx, 0x10(%rsp)
testl %ecx, %ecx
jle 0x2aaaf
movq 0x50(%rsp), %rax
movl (%rax,%r14,4), %eax
cmpl %eax, %r13d
jle 0x2abac
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movslq %r13d, %r13
movslq %eax, %rbx
movq %r13, %rsi
shlq $0x4, %rsi
addq $-0x10, %rsi
cmpq %rbx, %r13
jle 0x2aafb
decq %r13
leaq -0x10(%rsi), %r15
addq 0x28(%r12), %rsi
movq %rbp, %rdi
callq 0x162a6
movq %r15, %rsi
jmp 0x2aadd
movb 0x10(%r12), %al
movq 0x8(%rsp), %rdx
movq (%rdx), %rcx
movq %rcx, 0xd0(%rsp)
movq 0x8(%rdx), %rcx
movq %rcx, 0xd8(%rsp)
testq %rcx, %rcx
movq 0x28(%rsp), %rbx
movq 0x2849d(%rip), %r15     # 0x52fc8
je 0x2ab3c
cmpb $0x0, (%r15)
je 0x2ab38
incl 0x8(%rcx)
jmp 0x2ab3c
lock
incl 0x8(%rcx)
movzbl %al, %esi
leaq 0x130(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
movq %rbp, %rcx
callq 0x2b02c
movaps 0x130(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x130(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0x2ab80
callq 0x13308
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x2ab92
callq 0x13308
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x2aba4
callq 0x13308
movq %rbp, %rdi
callq 0x16384
cmpl $0x0, 0x10(%rsp)
jle 0x2abf1
cmpb $0x0, 0x7(%rsp)
je 0x2ac01
movq 0x30(%rsp), %rax
shlq $0x4, %r14
movq (%rax,%r14), %rcx
movq %rcx, 0xc0(%rsp)
movq 0x8(%rax,%r14), %rax
movq %rax, 0xc8(%rsp)
testq %rax, %rax
movq 0x10(%rsp), %r14
je 0x2ac3c
cmpb $0x0, (%r15)
je 0x2ac38
incl 0x8(%rax)
jmp 0x2ac3c
movb $0x1, %al
movl %eax, 0x6c(%rsp)
movq 0x10(%rsp), %r14
jmp 0x2ad74
movq 0x30(%rsp), %rax
shlq $0x4, %r14
movq (%rax,%r14), %rcx
movq %rcx, 0xa0(%rsp)
movq 0x8(%rax,%r14), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
movq 0x10(%rsp), %r14
je 0x2ac6c
cmpb $0x0, (%r15)
je 0x2ac68
incl 0x8(%rax)
jmp 0x2ac6c
lock
incl 0x8(%rax)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0xb0(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0x2ac9c
cmpb $0x0, (%r15)
je 0x2ac98
incl 0x8(%rax)
jmp 0x2ac9c
lock
incl 0x8(%rax)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x90(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x2ad06
cmpb $0x0, (%r15)
je 0x2ad02
incl 0x8(%rax)
jmp 0x2ad06
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0xc0(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x2b0ed
movaps 0x70(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0x2acd7
callq 0x13308
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x2ace6
callq 0x13308
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2acf8
callq 0x13308
movq 0xc8(%rsp), %rdi
jmp 0x2ad6a
lock
incl 0x8(%rax)
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x2b3f6
movaps 0x70(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0x2ad41
callq 0x13308
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad50
callq 0x13308
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad62
callq 0x13308
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad74
callq 0x13308
movq %r14, %rax
decq %rax
testl %r14d, %r14d
movq %rax, %rcx
jg 0x2aa92
testb $0x1, 0x6c(%rsp)
jne 0x2ada0
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2ada0
callq 0x13308
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
movl 0x1c(%rsp), %ebp
je 0x2adbb
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x7280
leaq 0x30(%rsp), %rdi
callq 0x2d246
testb $0x1, %bpl
jne 0x2ae2b
movq 0x140(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdi
testq %rdi, %rdi
je 0x2adf0
movq 0x281e2(%rip), %rcx     # 0x52fc8
cmpb $0x0, (%rcx)
je 0x2adfe
incl 0x8(%rdi)
jmp 0x2ae02
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %rdi, 0x8(%rcx)
jmp 0x2ae21
lock
incl 0x8(%rdi)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rdi, 0x8(%rdx)
testq %rdi, %rdi
je 0x2ae2b
cmpb $0x0, (%rcx)
je 0x2ae1d
incl 0x8(%rdi)
jmp 0x2ae21
lock
incl 0x8(%rdi)
testq %rdi, %rdi
je 0x2ae2b
callq 0x13308
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
movq 0x20(%rsp), %r14
je 0x2ae3f
callq 0x13308
testq %r14, %r14
je 0x2ae4c
movq %r14, %rdi
callq 0x13308
testq %rbx, %rbx
je 0x2ae59
movq %rbx, %rdi
callq 0x13308
movq 0x8(%rsp), %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0xf8(%rsp), %rdi
jmp 0x2af5d
movq %rax, %r14
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2ae95
callq 0x13308
movq 0xc8(%rsp), %rdi
jmp 0x2aebc
movq %rax, %r14
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2aeb4
callq 0x13308
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x2af47
callq 0x13308
jmp 0x2af47
movq %rax, %r14
jmp 0x2af67
movq %rax, %r14
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x2af3d
callq 0x13308
jmp 0x2af3d
movq %rax, %r14
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x2af00
callq 0x13308
movq 0x38(%rsp), %rdi
jmp 0x2af1f
movq %rax, %r14
movq 0x118(%rsp), %rdi
jmp 0x2af1f
movq %rax, %r14
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x2af29
callq 0x13308
movq %r15, %rdi
testq %r15, %r15
jne 0x2afb6
jmp 0x2afbb
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x16384
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
jmp 0x2af5d
movq %rax, %r14
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x2af67
callq 0x13308
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2af7e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x7280
leaq 0x30(%rsp), %rdi
callq 0x2d246
cmpq $0x0, 0x48(%rsp)
je 0x2af9a
movq 0x48(%rsp), %rdi
callq 0x13308
cmpq $0x0, 0x20(%rsp)
je 0x2afac
movq 0x20(%rsp), %rdi
callq 0x13308
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2afbb
callq 0x13308
movq %r14, %rdi
callq 0x7430
nop