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

{
  CombinePattern *tmp;
  
  if (b->numDisjoint() != 0)
    return b->doAnd(this,-sa);

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

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movl %edx, 0x9c(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x0, %eax
je 0x1384a7
movq 0x40(%rsp), %rsi
movq 0xa0(%rsp), %rdi
xorl %edx, %edx
subl 0x9c(%rsp), %edx
movq (%rdi), %rax
callq *0x28(%rax)
movq %rax, 0xb0(%rsp)
jmp 0x138757
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x1384dd
movq 0x38(%rsp), %rdi
movq 0x8f7e2(%rip), %rsi     # 0x1c7ca8
movq 0x8f853(%rip), %rdx     # 0x1c7d20
xorl %eax, %eax
movl %eax, %ecx
callq 0xd99a0
movq %rax, 0x30(%rsp)
jmp 0x1384e6
xorl %eax, %eax
movq %rax, 0x30(%rsp)
jmp 0x1384e6
movq 0x30(%rsp), %rax
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x1385b4
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rsi
movq (%rdi), %rax
movq 0x28(%rax), %rax
xorl %edx, %edx
callq *%rax
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x80(%rsp)
movq 0x10(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rsi
movl 0x9c(%rsp), %edx
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movq %rax, 0x78(%rsp)
movl $0x18, %edi
callq 0xd8380
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
callq 0xddac0
jmp 0x138580
movq 0x28(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x138747
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
movl $0x18, %esi
callq 0xd8620
jmp 0x138767
movq 0xa0(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x1385ea
movq 0x20(%rsp), %rdi
movq 0x8f6d5(%rip), %rsi     # 0x1c7ca8
movq 0x8f706(%rip), %rdx     # 0x1c7ce0
xorl %eax, %eax
movl %eax, %ecx
callq 0xd99a0
movq %rax, 0x18(%rsp)
jmp 0x1385f3
xorl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x1385f3
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x1386a1
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x60(%rsp), %rsi
movl 0x9c(%rsp), %edx
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movq %rax, 0x58(%rsp)
movl $0x18, %edi
callq 0xd8380
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rsp)
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x10(%rsp)
jmp 0x138657
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %rdx
callq 0xddac0
jmp 0x13866d
movq 0x8(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x138745
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
movl $0x18, %esi
callq 0xd8620
jmp 0x138767
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0xa0(%rsp), %rsi
movq (%rdi), %rax
xorl %edx, %edx
callq *0x28(%rax)
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x50(%rsp)
movq 0x10(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, 0x48(%rsp)
cmpl $0x0, 0x9c(%rsp)
jge 0x1386f4
movq 0x48(%rsp), %rdi
xorl %esi, %esi
subl 0x9c(%rsp), %esi
movq (%rdi), %rax
callq *0x18(%rax)
movl $0x18, %edi
callq 0xd8380
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0xddac0
jmp 0x138719
movq (%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x138745
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
movl $0x18, %esi
callq 0xd8620
jmp 0x138767
jmp 0x138747
movq 0x90(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)