// File: jstaursky[P]hutch/src/Sleigh/slghpattern.cc
// Function: OrPattern::doOr(Pattern const*, int) const
Pattern *OrPattern::doOr(const Pattern *b,int4 sa) const

{
  const OrPattern *b2 = dynamic_cast<const OrPattern *>(b);
  vector<DisjointPattern *> newlist;
  vector<DisjointPattern *>::const_iterator iter;

  for(iter=orlist.begin();iter!=orlist.end();++iter)
    newlist.push_back((DisjointPattern *)(*iter)->simplifyClone());
  if (sa < 0)
    for(iter=orlist.begin();iter!=orlist.end();++iter)
      (*iter)->shiftInstruction(-sa);

  if (b2 == (const OrPattern *)0)
    newlist.push_back((DisjointPattern *)b->simplifyClone());
  else {
    for(iter=b2->orlist.begin();iter!=b2->orlist.end();++iter)
      newlist.push_back((DisjointPattern *)(*iter)->simplifyClone());
  }
  if (sa > 0)
    for(int4 i=0;i<newlist.size();++i)
      newlist[i]->shiftInstruction(sa);

  OrPattern *tmpor = new OrPattern(newlist);
  return tmpor;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movl %edx, 0xe4(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x1397f1
movq 0x48(%rsp), %rdi
movq 0x8e4ce(%rip), %rsi     # 0x1c7ca8
movq 0x8e567(%rip), %rdx     # 0x1c7d48
xorl %eax, %eax
movl %eax, %ecx
callq 0xd99a0
movq %rax, 0x38(%rsp)
jmp 0x1397fa
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0x1397fa
movq 0x38(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xd3170
leaq 0xb8(%rsp), %rdi
callq 0xe0480
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
callq 0xe0c70
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
callq 0xd1e10
movq %rax, 0xa8(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xe2bc0
testb $0x1, %al
jne 0x139878
jmp 0x1398e9
leaq 0xb8(%rsp), %rdi
callq 0xd1260
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x30(%rsp)
jmp 0x139898
movq 0x30(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xe0080
jmp 0x1398bc
jmp 0x1398be
leaq 0xb8(%rsp), %rdi
callq 0xe2a00
jmp 0x139847
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x139b51
cmpl $0x0, 0xe4(%rsp)
jge 0x139985
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
callq 0xe0c70
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
callq 0xd1e10
movq %rax, 0x80(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xe2bc0
testb $0x1, %al
jne 0x13994e
jmp 0x139983
leaq 0xb8(%rsp), %rdi
callq 0xd1260
movq (%rax), %rdi
movl 0xe4(%rsp), %esi
negl %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x139972
jmp 0x139974
leaq 0xb8(%rsp), %rdi
callq 0xe2a00
jmp 0x13991d
jmp 0x139985
cmpq $0x0, 0xd8(%rsp)
jne 0x1399cb
movq 0xe8(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x28(%rsp)
jmp 0x1399a8
movq 0x28(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xe0080
jmp 0x1399c6
jmp 0x139a6d
movq 0xd8(%rsp), %rdi
addq $0x8, %rdi
callq 0xe0c70
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xd8(%rsp), %rdi
addq $0x8, %rdi
callq 0xd1e10
movq %rax, 0x68(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe2bc0
testb $0x1, %al
jne 0x139a1c
jmp 0x139a6b
leaq 0xb8(%rsp), %rdi
callq 0xd1260
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x20(%rsp)
jmp 0x139a3c
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xe0080
jmp 0x139a5a
jmp 0x139a5c
leaq 0xb8(%rsp), %rdi
callq 0xe2a00
jmp 0x1399ee
jmp 0x139a6d
cmpl $0x0, 0xe4(%rsp)
jle 0x139adb
movl $0x0, 0x5c(%rsp)
movslq 0x5c(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xdf0f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x139ad9
movslq 0x5c(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xdcc50
movq (%rax), %rdi
movl 0xe4(%rsp), %esi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x139aca
jmp 0x139acc
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x139a7f
jmp 0x139adb
movl $0x20, %edi
callq 0xd8380
movq %rax, 0x10(%rsp)
jmp 0x139aec
movq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe0f50
jmp 0x139b00
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xddf80
movq 0x8(%rsp), %rax
addq $0xf8, %rsp
retq
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
movl $0x20, %esi
callq 0xd8620
leaq 0xc0(%rsp), %rdi
callq 0xddf80
movq 0x98(%rsp), %rdi
callq 0xe0be0
nopl (%rax,%rax)