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

{
  if (b->numDisjoint()>0)
    return b->doAnd(this,-sa);

  const CombinePattern *b2 = dynamic_cast<const CombinePattern *>(b);
  if (b2 != (const CombinePattern *)0)
    return b->doAnd(this,-sa);

  const ContextPattern *b3 = dynamic_cast<const ContextPattern *>(b);
  if (b3 != (const ContextPattern *)0) {
    InstructionPattern *newpat = (InstructionPattern *)simplifyClone();
    if (sa < 0)
      newpat->shiftInstruction(-sa);
    return new CombinePattern((ContextPattern *)b3->simplifyClone(),newpat);
  }
  const InstructionPattern *b4 = (const InstructionPattern *)b;

  PatternBlock *respattern;
  if (sa < 0) {
    PatternBlock *a = maskvalue->clone();
    a->shift(-sa);
    respattern = a->intersect(b4->maskvalue);
    delete a;
  }
  else {
    PatternBlock *c = b4->maskvalue->clone();
    c->shift(sa);
    respattern = maskvalue->intersect(c);
    delete c;
  }
  return new InstructionPattern(respattern);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x40(%rax)
testl %eax, %eax
jg 0x629b2
movq 0x4035c(%rip), %rsi     # 0xa2cf8
movq 0x403bd(%rip), %rdx     # 0xa2d60
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x40b60
testq %rax, %rax
je 0x629d0
negl %ebx
movq (%r15), %rax
movq 0x28(%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
movq 0x40321(%rip), %rsi     # 0xa2cf8
movq 0x401fa(%rip), %rdx     # 0xa2bd8
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x40b60
testq %rax, %rax
je 0x62a3f
movq %rax, %r12
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rax, %r14
testl %ebx, %ebx
jns 0x62a0d
negl %ebx
movq (%r14), %rax
movq %r14, %rdi
movl %ebx, %esi
callq *0x18(%rax)
movl $0x18, %edi
callq 0x40810
movq %rax, %r15
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movq 0x403bd(%rip), %rcx     # 0xa2de8
addq $0x10, %rcx
movq %rcx, (%r15)
movq %rax, 0x8(%r15)
movq %r14, 0x10(%r15)
jmp 0x62af5
testl %ebx, %ebx
js 0x62a9c
movq 0x8(%r15), %rdi
callq 0x3f950
movq %rax, %r15
addl %ebx, (%rax)
movq %rax, %rdi
callq 0x40d70
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x40f30
movq %rax, %rbx
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x62a7d
movq 0x30(%r15), %rsi
subq %rdi, %rsi
callq 0x40880
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x62a92
movq 0x18(%r15), %rsi
subq %rdi, %rsi
callq 0x40880
movl $0x38, %esi
movq %r15, %rdi
jmp 0x62ad1
movq 0x8(%r14), %rdi
callq 0x3f950
movq %rax, %r14
subl %ebx, (%rax)
movq %rax, %rdi
callq 0x40d70
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x40f30
movq %rax, %rbx
movq %r14, %rdi
callq 0x3fb40
movl $0x38, %esi
movq %r14, %rdi
callq 0x40880
movl $0x10, %edi
callq 0x40810
movq %rax, %r15
movq 0x40196(%rip), %rax     # 0xa2c80
addq $0x10, %rax
movq %rax, (%r15)
movq %rbx, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10