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

{
  Pattern *tmp;

  if (b->numDisjoint() != 0)
    return b->commonSubPattern(this,-sa);

  const CombinePattern *b2 = dynamic_cast<const CombinePattern *>(b);
  if (b2 != (CombinePattern *)0) {
    ContextPattern *c = (ContextPattern *)context->commonSubPattern(b2->context,0);
    InstructionPattern *i = (InstructionPattern *)instr->commonSubPattern(b2->instr,sa);
    tmp = new CombinePattern(c,i);
  }
  else {
    const InstructionPattern *b3 = dynamic_cast<const InstructionPattern *>(b);
    if (b3 != (const InstructionPattern *)0)
      tmp = instr->commonSubPattern(b3,sa);
    else			// Must be a ContextPattern
      tmp = context->commonSubPattern(b,0);
  }
  return tmp;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movl %edx, 0x6c(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x0, %eax
je 0x1387d2
movq 0x28(%rsp), %rsi
movq 0x70(%rsp), %rdi
xorl %edx, %edx
subl 0x6c(%rsp), %edx
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, 0x80(%rsp)
jmp 0x138958
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x138805
movq 0x20(%rsp), %rdi
movq 0x8f4ba(%rip), %rsi     # 0x1c7ca8
movq 0x8f52b(%rip), %rdx     # 0x1c7d20
xorl %eax, %eax
movl %eax, %ecx
callq 0xd99a0
movq %rax, 0x18(%rsp)
jmp 0x13880e
xorl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x13880e
movq 0x18(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x1388c4
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rsi
movq (%rdi), %rax
movq 0x30(%rax), %rax
xorl %edx, %edx
callq *%rax
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x50(%rsp)
movq 0x10(%rax), %rdi
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rsi
movl 0x6c(%rsp), %edx
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movq %rax, 0x48(%rsp)
movl $0x18, %edi
callq 0xd8380
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0xddac0
jmp 0x138893
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x13894b
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
movl $0x18, %esi
callq 0xd8620
jmp 0x138968
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1388f6
movq 0x8(%rsp), %rdi
movq 0x8f3c8(%rip), %rsi     # 0x1c7ca8
movq 0x8f3f9(%rip), %rdx     # 0x1c7ce0
xorl %eax, %eax
movl %eax, %ecx
callq 0xd99a0
movq %rax, (%rsp)
jmp 0x1388fe
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x1388fe
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x13892e
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x30(%rsp), %rsi
movl 0x6c(%rsp), %edx
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, 0x60(%rsp)
jmp 0x138949
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x70(%rsp), %rsi
movq (%rdi), %rax
xorl %edx, %edx
callq *0x30(%rax)
movq %rax, 0x60(%rsp)
jmp 0x13894b
movq 0x60(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
addq $0x88, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)