// File: 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
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdx, -0x250(%rbp)
movq %rdi, -0x248(%rbp)
movq %rdi, %rax
movq %rax, -0x240(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x238(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x238(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x258(%rbp)
addq $0x28, %rdi
callq 0x1b3b0
movq %rax, %rcx
movq -0x258(%rbp), %rax
cmpq %rcx, %rax
jae 0x415af
movq -0x238(%rbp), %rdi
addq $0x28, %rdi
movq -0x20(%rbp), %rsi
callq 0x44b90
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x1b100
movq -0x238(%rbp), %rdi
addq $0x18, %rdi
callq 0x3ece0
movq %rax, -0x260(%rbp)
jmp 0x412e9
leaq -0x50(%rbp), %rdi
movq %rdi, -0x270(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x1b100
movq -0x260(%rbp), %rdi
movq -0x270(%rbp), %rsi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movb %al, -0x261(%rbp)
jmp 0x4131c
movb -0x261(%rbp), %al
xorb $-0x1, %al
movb %al, -0x271(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10f20
movb -0x271(%rbp), %al
testb $0x1, %al
jne 0x41342
jmp 0x413e9
movq -0x238(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x288(%rbp)
addq $0x28, %rdi
callq 0x1b3b0
movq -0x288(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x44b90
movq -0x238(%rbp), %rdi
movq %rax, -0x280(%rbp)
addq $0x28, %rdi
movq -0x20(%rbp), %rsi
callq 0x44b90
movq -0x280(%rbp), %rsi
movq %rax, %rdi
callq 0x44bb0
movq -0x238(%rbp), %rdi
addq $0x28, %rdi
callq 0x44be0
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x41587
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x415a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10f20
jmp 0x415a1
movq -0x238(%rbp), %rdi
addq $0x18, %rdi
callq 0x3ece0
movq %rax, -0x290(%rbp)
jmp 0x41402
leaq -0x70(%rbp), %rdi
movq %rdi, -0x298(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x1b100
movq -0x238(%rbp), %rcx
movq -0x290(%rbp), %rsi
movq -0x298(%rbp), %rdx
movq (%rsi), %rax
movq 0x30(%rax), %rax
movzbl 0x10(%rcx), %ecx
andl $0x1, %ecx
leaq -0x60(%rbp), %rdi
callq *%rax
jmp 0x41441
leaq -0x70(%rbp), %rdi
callq 0x10f20
leaq -0x60(%rbp), %rdi
callq 0x14bb0
testb $0x1, %al
jne 0x4145c
jmp 0x4157e
movq -0x238(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2a8(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x1b100
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%rbp), %rdx
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rcx
callq 0x1b150
jmp 0x414a2
movq -0x238(%rbp), %rdi
addq $0x18, %rdi
leaq -0x80(%rbp), %rsi
callq 0x11290
leaq -0x80(%rbp), %rdi
callq 0x11060
leaq -0x90(%rbp), %rdi
callq 0x10f20
movq -0x238(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x2b8(%rbp)
addq $0x28, %rdi
callq 0x1b3b0
movq -0x2b8(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x44b90
movq -0x238(%rbp), %rdi
movq %rax, -0x2b0(%rbp)
addq $0x28, %rdi
movq -0x20(%rbp), %rsi
callq 0x44b90
movq -0x2b0(%rbp), %rsi
movq %rax, %rdi
callq 0x44bb0
movq -0x238(%rbp), %rdi
addq $0x28, %rdi
callq 0x44be0
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x4157e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x10f20
jmp 0x415a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x10f20
leaq -0x60(%rbp), %rdi
callq 0x11360
jmp 0x415a1
leaq -0x60(%rbp), %rdi
callq 0x11360
leaq -0x30(%rbp), %rdi
callq 0x10f20
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x41282
leaq -0x30(%rbp), %rdi
callq 0x10f20
jmp 0x42054
movq -0x238(%rbp), %rdi
addq $0x28, %rdi
callq 0x1b3b0
cmpq $0x0, %rax
jne 0x415e1
movq -0x248(%rbp), %rdi
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
callq 0x11030
jmp 0x42044
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x44c10
leaq -0xa0(%rbp), %rdi
callq 0x44ca0
testb $0x1, %al
jne 0x4160a
jmp 0x41630
movq -0x248(%rbp), %rdi
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
callq 0x11030
movl $0x1, -0xa4(%rbp)
jmp 0x42038
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x44cc0
leaq -0xb8(%rbp), %rdi
callq 0x44d50
movb %al, %cl
movb $0x0, -0xc9(%rbp)
movb $0x0, -0xe1(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x2b9(%rbp)
jne 0x41672
jmp 0x416f1
leaq -0xb8(%rbp), %rdi
callq 0x44d70
movq %rax, %rsi
addq $0x18, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x42060
jmp 0x41693
movb $0x1, -0xc9(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x44d90
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x2b9(%rbp)
jne 0x416b7
jmp 0x416f1
leaq -0xb8(%rbp), %rdi
callq 0x44d70
movq %rax, %rsi
addq $0x28, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x42060
jmp 0x416d8
movb $0x1, -0xe1(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x44d90
movb %al, -0x2b9(%rbp)
movb -0x2b9(%rbp), %al
movb %al, -0x2ba(%rbp)
testb $0x1, -0xe1(%rbp)
jne 0x41708
jmp 0x41714
leaq -0xe0(%rbp), %rdi
callq 0x10f20
testb $0x1, -0xc9(%rbp)
jne 0x4171f
jmp 0x4172b
leaq -0xc8(%rbp), %rdi
callq 0x10f20
movb -0x2ba(%rbp), %al
testb $0x1, %al
jne 0x4173a
jmp 0x417c2
movq -0x238(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x41757
leaq 0x640f2(%rip), %rax     # 0xa5840
movq %rax, -0x2c8(%rbp)
jmp 0x41767
leaq 0x640d2(%rip), %rax     # 0xa5830
movq %rax, -0x2c8(%rbp)
jmp 0x41767
movq -0x248(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
callq 0x11030
movl $0x1, -0xa4(%rbp)
jmp 0x42010
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4201e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x417b1
jmp 0x417bd
leaq -0xc8(%rbp), %rdi
callq 0x10f20
jmp 0x4201e
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x44a30
leaq -0xf8(%rbp), %rdi
callq 0x44ac0
testb $0x1, %al
jne 0x417ee
jmp 0x41f93
leaq -0xf8(%rbp), %rdi
callq 0x44ae0
movb 0x10(%rax), %al
andb $0x1, %al
movb %al, -0xf9(%rbp)
leaq -0x118(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x44db0
leaq -0x130(%rbp), %rdi
callq 0x44dd0
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
leaq -0x140(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x11030
movq -0x2d8(%rbp), %rdi
movq -0x2d0(%rbp), %rdx
movzbl -0xf9(%rbp), %esi
andl $0x1, %esi
callq 0x410f0
jmp 0x41861
leaq -0x140(%rbp), %rdi
callq 0x11060
movb $0x0, -0x141(%rbp)
movq $0x0, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x44df0
movq %rax, %rcx
movq -0x2e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x41a61
movq $0x0, -0x158(%rbp)
movq $0x0, -0x160(%rbp)
movq -0x238(%rbp), %rdi
movq -0x160(%rbp), %rax
movq %rax, -0x2e8(%rbp)
addq $0x28, %rdi
callq 0x1b3b0
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x419f3
movq -0x150(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq %rax, %rdi
callq 0x3ece0
movq %rax, -0x2f0(%rbp)
jmp 0x41917
movq -0x238(%rbp), %rdi
addq $0x28, %rdi
movq -0x160(%rbp), %rsi
callq 0x44b90
movq %rax, %rsi
leaq -0x170(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x1b100
movq -0x2f0(%rbp), %rdi
movq -0x300(%rbp), %rsi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movb %al, -0x2f1(%rbp)
jmp 0x41963
leaq -0x170(%rbp), %rdi
callq 0x10f20
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x4197b
jmp 0x419da
movq -0x160(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x419da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x11060
jmp 0x41f79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x41f79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x10f20
jmp 0x41f79
jmp 0x419dc
movq -0x160(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x160(%rbp)
jmp 0x418c2
movq -0x238(%rbp), %rdi
movq -0x158(%rbp), %rax
movq %rax, -0x308(%rbp)
addq $0x28, %rdi
callq 0x1b3b0
movq %rax, %rcx
movq -0x308(%rbp), %rax
cmpq %rcx, %rax
jae 0x41a27
movb $0x1, -0x141(%rbp)
movl -0x158(%rbp), %eax
movl %eax, -0x174(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x174(%rbp), %rsi
callq 0x44e30
jmp 0x41a48
jmp 0x41a4a
movq -0x150(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x150(%rbp)
jmp 0x4187f
testb $0x1, -0x141(%rbp)
je 0x41f49
movl $0x1, -0x178(%rbp)
movslq -0x178(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x44df0
movq %rax, %rcx
movq -0x310(%rbp), %rax
cmpq %rcx, %rax
jae 0x41b9d
cmpl $0x0, -0x178(%rbp)
je 0x41b89
movslq -0x178(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movl (%rax), %eax
movl %eax, -0x314(%rbp)
movl -0x178(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movq %rax, %rcx
movl -0x314(%rbp), %eax
cmpl (%rcx), %eax
jge 0x41b89
movslq -0x178(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movq %rax, -0x328(%rbp)
movl -0x178(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movq -0x328(%rbp), %rdi
movq %rax, %rsi
callq 0x44e80
movslq -0x178(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq %rax, -0x320(%rbp)
movl -0x178(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq -0x320(%rbp), %rdi
movq %rax, %rsi
callq 0x44eb0
movl -0x178(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x41b98
movl -0x178(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x41a78
leaq -0x118(%rbp), %rdi
callq 0x44df0
subq $0x1, %rax
movl %eax, -0x17c(%rbp)
movb $0x0, -0x17d(%rbp)
movslq -0x17c(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x11030
movslq -0x17c(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movl (%rax), %eax
movl %eax, -0x184(%rbp)
jmp 0x41bf9
movl -0x17c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x17c(%rbp)
cmpl $0x0, -0x17c(%rbp)
jl 0x41c2e
movslq -0x17c(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x44e60
movl (%rax), %eax
movl %eax, -0x32c(%rbp)
jmp 0x41c38
xorl %eax, %eax
movl %eax, -0x32c(%rbp)
jmp 0x41c38
movl -0x32c(%rbp), %eax
movl %eax, -0x188(%rbp)
movl -0x184(%rbp), %eax
cmpl -0x188(%rbp), %eax
jle 0x41d6b
leaq -0x1a0(%rbp), %rdi
callq 0x1af40
movl -0x184(%rbp), %eax
cmpl -0x188(%rbp), %eax
jle 0x41cb9
movq -0x238(%rbp), %rdi
movl -0x184(%rbp), %eax
decl %eax
movl %eax, -0x184(%rbp)
addq $0x28, %rdi
movslq -0x184(%rbp), %rsi
callq 0x44b90
movq %rax, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x1b320
jmp 0x41ca6
jmp 0x41c62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x41d5a
movq -0x248(%rbp), %rsi
movq -0x238(%rbp), %rax
movzbl 0x10(%rax), %eax
movl %eax, -0x33c(%rbp)
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x11030
movl -0x33c(%rbp), %esi
movq -0x338(%rbp), %rdx
andl $0x1, %esi
leaq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rcx
callq 0x42090
jmp 0x41d09
movq -0x248(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x11290
leaq -0x1b0(%rbp), %rdi
callq 0x11060
leaq -0x1c0(%rbp), %rdi
callq 0x11060
leaq -0x1a0(%rbp), %rdi
callq 0x1b4c0
jmp 0x41d6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x11060
leaq -0x1a0(%rbp), %rdi
callq 0x1b4c0
jmp 0x41f3b
cmpl $0x0, -0x17c(%rbp)
jge 0x41d97
movb $0x1, -0x17d(%rbp)
movl $0x1, -0xa4(%rbp)
testb $0x1, -0x17d(%rbp)
jne 0x41f39
jmp 0x41f2d
testb $0x1, -0xf9(%rbp)
je 0x41e68
movslq -0x17c(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x11030
movq -0x248(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x11030
movq -0x350(%rbp), %rsi
movq -0x348(%rbp), %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x42150
jmp 0x41e03
movq -0x248(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x11290
leaq -0x1d0(%rbp), %rdi
callq 0x11060
leaq -0x1f0(%rbp), %rdi
callq 0x11060
leaq -0x1e0(%rbp), %rdi
callq 0x11060
jmp 0x41f26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x11060
leaq -0x1e0(%rbp), %rdi
callq 0x11060
jmp 0x41f3b
movslq -0x17c(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x44e10
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x11030
movq -0x248(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x11030
movq -0x360(%rbp), %rsi
movq -0x358(%rbp), %rdx
leaq -0x200(%rbp), %rdi
callq 0x42550
jmp 0x41ec7
movq -0x248(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x11290
leaq -0x200(%rbp), %rdi
callq 0x11060
leaq -0x220(%rbp), %rdi
callq 0x11060
leaq -0x210(%rbp), %rdi
callq 0x11060
jmp 0x41f26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x11060
leaq -0x210(%rbp), %rdi
callq 0x11060
jmp 0x41f3b
jmp 0x41f28
jmp 0x41bf7
movq -0x248(%rbp), %rdi
callq 0x11060
jmp 0x41f53
movq -0x248(%rbp), %rdi
callq 0x11060
jmp 0x41f79
movl $0x0, -0xa4(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x44f00
leaq -0x118(%rbp), %rdi
callq 0x44f60
movl -0xa4(%rbp), %eax
testl %eax, %eax
jne 0x41ff4
jmp 0x41f77
jmp 0x41f93
leaq -0x130(%rbp), %rdi
callq 0x44f00
leaq -0x118(%rbp), %rdi
callq 0x44f60
jmp 0x42002
movq -0x250(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x44fc0
movq -0x248(%rbp), %rdi
movq -0x368(%rbp), %rsi
callq 0x449f0
jmp 0x41fc2
leaq -0x230(%rbp), %rdi
callq 0x14ad0
movl $0x1, -0xa4(%rbp)
jmp 0x41ff4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x14ad0
jmp 0x42002
leaq -0xf8(%rbp), %rdi
callq 0x44b70
jmp 0x42010
leaq -0xf8(%rbp), %rdi
callq 0x44b70
jmp 0x4201e
leaq -0xb8(%rbp), %rdi
callq 0x44ff0
jmp 0x42038
leaq -0xb8(%rbp), %rdi
callq 0x44ff0
leaq -0xa0(%rbp), %rdi
callq 0x44a10
jmp 0x42054
leaq -0xa0(%rbp), %rdi
callq 0x44a10
movq -0x240(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x84d0
nopl (%rax)