// File: shisharka[P]interactive_deduction/naturaldeduction.cpp
// Function: applyDisjE(std::pair<std::vector<std::shared_ptr<BaseFormula>, std::allocator<std::shared_ptr<BaseFormula>>>, std::shared_ptr<BaseFormula>> const&, std::vector<std::pair<std::vector<std::shared_ptr<BaseFormula>, std::allocator<std::shared_ptr<BaseFormula>>>, std::shared_ptr<BaseFormula>>, std::allocator<std::pair<std::vector<std::shared_ptr<BaseFormula>, std::allocator<std::shared_ptr<BaseFormula>>>, std::shared_ptr<BaseFormula>>>>&)
void applyDisjE(const Goal & g, vector<Goal> & subgoals) {
  Formula a, b;
  vector<Formula> ass1, ass2;
  bool applied = false;

  for(vector<Formula>::const_iterator i = g.first.begin(); i != g.first.end(); i++) {
    if((*i)->getType() == T_OR && !applied) {
      a = ((Or *)(*i).get())->getOperand1();
      b = ((Or *)(*i).get())->getOperand2();
      applied = true;
    }
    else {
      ass1.push_back(*i);
      ass2.push_back(*i);
    };
  };

  if(applied) {
    addAssumption(ass1, a);
    addAssumption(ass2, b);
    subgoals.push_back(make_pair(ass1, g.second));
    subgoals.push_back(make_pair(ass2, g.second));
  }
  else
    cerr << "Failed to apply DisjE" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7240
leaq -0x30(%rbp), %rdi
callq 0x7240
leaq -0x48(%rbp), %rdi
callq 0x7430
leaq -0x60(%rbp), %rdi
callq 0x7430
movb $0x0, -0x61(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe7a0
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe7d0
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xeb70
testb $0x1, %al
jne 0x138db
jmp 0x139db
leaq -0x70(%rbp), %rdi
callq 0xebe0
movq %rax, %rdi
callq 0x120d0
movq %rax, %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, -0xe4(%rbp)
jmp 0x138ff
movl -0xe4(%rbp), %eax
cmpl $0x5, %eax
jne 0x13992
testb $0x1, -0x61(%rbp)
jne 0x13992
leaq -0x70(%rbp), %rdi
callq 0xebe0
movq %rax, %rdi
callq 0x120f0
movq %rax, %rdi
callq 0x11a70
movq %rax, -0xf0(%rbp)
jmp 0x13936
movq -0xf0(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x6b30
leaq -0x70(%rbp), %rdi
callq 0xebe0
movq %rax, %rdi
callq 0x120f0
movq %rax, %rdi
callq 0x11a90
movq %rax, -0xf8(%rbp)
jmp 0x13968
movq -0xf8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6b30
movb $0x1, -0x61(%rbp)
jmp 0x139c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x13b2b
leaq -0x70(%rbp), %rdi
callq 0xebe0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x14520
jmp 0x139a9
leaq -0x70(%rbp), %rdi
callq 0xebe0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x14520
jmp 0x139c0
jmp 0x139c2
jmp 0x139c4
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x14a70
movq %rax, -0x90(%rbp)
jmp 0x138b8
testb $0x1, -0x61(%rbp)
je 0x13acb
leaq -0x48(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x12cf0
jmp 0x139f4
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x12cf0
jmp 0x13a03
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x8(%rbp), %rdx
addq $0x18, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x14ae0
jmp 0x13a28
movq -0x100(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x14ab0
jmp 0x13a3d
leaq -0xb8(%rbp), %rdi
callq 0x7450
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x8(%rbp), %rdx
addq $0x18, %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x14ae0
jmp 0x13a6e
movq -0x108(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x14ab0
jmp 0x13a83
leaq -0xe0(%rbp), %rdi
callq 0x7450
jmp 0x13afe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x7450
jmp 0x13b2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x7450
jmp 0x13b2b
movq 0x10516(%rip), %rdi     # 0x23fe8
leaq 0x4643(%rip), %rsi      # 0x1811c
callq 0x41d0
movq %rax, -0x110(%rbp)
jmp 0x13ae7
movq -0x110(%rbp), %rdi
movq 0x1048b(%rip), %rsi     # 0x23f80
callq 0x4200
jmp 0x13afc
jmp 0x13afe
leaq -0x60(%rbp), %rdi
callq 0x7480
leaq -0x48(%rbp), %rdi
callq 0x7480
leaq -0x30(%rbp), %rdi
callq 0x7260
leaq -0x20(%rbp), %rdi
callq 0x7260
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x7480
leaq -0x48(%rbp), %rdi
callq 0x7480
leaq -0x30(%rbp), %rdi
callq 0x7260
leaq -0x20(%rbp), %rdi
callq 0x7260
movq -0x80(%rbp), %rdi
callq 0x4370
nopl (%rax,%rax)