// File: jstaursky[P]hutch/src/Sleigh/slghpatexpress.cc
// Function: EqualEquation::genPattern(std::vector<TokenPattern, std::allocator<TokenPattern>> const&) const
void EqualEquation::genPattern(const vector<TokenPattern> &ops) const

{
  intb lhsmin = lhs->minValue();
  intb lhsmax = lhs->maxValue();
  vector<const PatternValue *> semval;
  vector<intb> min;
  vector<intb> max;
  vector<intb> cur;
  int4 count=0;

  rhs->listValues(semval);
  rhs->getMinMax(min,max);
  cur = min;

  do {
    intb val = rhs->getSubValue(cur);
    if ((val>=lhsmin)&&(val<=lhsmax)) {
      if (count==0)
	resultpattern = buildPattern(lhs,val,semval,cur);
      else
	resultpattern = resultpattern.doOr(buildPattern(lhs,val,semval,cur));
      count += 1;
    }
  } while(advance_combo(cur,min,max));
  if (count == 0)
    throw SleighError("Equal constraint is impossible to match");
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x170(%rsp)
movq %rsi, 0x168(%rsp)
movq 0x170(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rax), %rdi
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x160(%rsp)
movq 0x38(%rax), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
movq %rax, 0x158(%rsp)
leaq 0x140(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xe17a0
leaq 0x128(%rsp), %rdi
callq 0xe0900
leaq 0x110(%rsp), %rdi
callq 0xe0900
leaq 0xf8(%rsp), %rdi
callq 0xe0900
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rsi
movl $0x0, 0xf4(%rsp)
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
jmp 0x12c783
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
leaq 0x128(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq *%rax
jmp 0x12c7a7
leaq 0xf8(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0xce030
jmp 0x12c7be
jmp 0x12c7c0
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rdi
leaq 0xf8(%rsp), %rsi
callq 0xd69f0
movq %rax, 0x20(%rsp)
jmp 0x12c7dd
movq 0x20(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
cmpq 0x160(%rsp), %rax
jl 0x12c997
movq 0xd8(%rsp), %rax
cmpq 0x158(%rsp), %rax
jg 0x12c997
cmpl $0x0, 0xf4(%rsp)
jne 0x12c8bd
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0xd8(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x140(%rsp), %rcx
leaq 0xf8(%rsp), %r8
callq 0x12cb20
jmp 0x12c854
movq 0x28(%rsp), %rdi
addq $0x10, %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdd160
jmp 0x12c86c
leaq 0xb0(%rsp), %rdi
callq 0xd2580
jmp 0x12c986
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0x12cad1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xd2580
jmp 0x12cad1
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x18(%rsp)
movq 0x38(%rax), %rsi
movq 0xd8(%rsp), %rdx
leaq 0x60(%rsp), %rdi
leaq 0x140(%rsp), %rcx
leaq 0xf8(%rsp), %r8
callq 0x12cb20
jmp 0x12c8f6
movq 0x18(%rsp), %rsi
leaq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xda5f0
jmp 0x12c90f
movq 0x28(%rsp), %rdi
addq $0x10, %rdi
leaq 0x88(%rsp), %rsi
callq 0xdd160
jmp 0x12c927
leaq 0x88(%rsp), %rdi
callq 0xd2580
leaq 0x60(%rsp), %rdi
callq 0xd2580
jmp 0x12c986
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0x12c977
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xd2580
leaq 0x60(%rsp), %rdi
callq 0xd2580
jmp 0x12cad1
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x12c999
leaq 0xf8(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x12ccd0
movb %al, 0x17(%rsp)
jmp 0x12c9bc
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x12c7c0
jmp 0x12c9ca
cmpl $0x0, 0xf4(%rsp)
jne 0x12ca95
movb $0x1, 0x3e(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, (%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe0c80
movq 0x8(%rsp), %rdx
leaq 0x5c010(%rip), %rsi     # 0x188a16
leaq 0x40(%rsp), %rdi
callq 0xe00a0
jmp 0x12ca12
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xd06e0
jmp 0x12ca22
movq (%rsp), %rdi
movb $0x0, 0x3e(%rsp)
movq 0x9b436(%rip), %rsi     # 0x1c7e68
movq 0x9afe7(%rip), %rdx     # 0x1c7a20
callq 0xe01f0
jmp 0x12cb12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0x12ca77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xd4550
leaq 0x3f(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x3e(%rsp)
jne 0x12ca8a
jmp 0x12ca93
movq (%rsp), %rdi
callq 0xd5400
jmp 0x12cad1
leaq 0xf8(%rsp), %rdi
callq 0xe1230
leaq 0x110(%rsp), %rdi
callq 0xe1230
leaq 0x128(%rsp), %rdi
callq 0xe1230
leaq 0x140(%rsp), %rdi
callq 0xd3b20
addq $0x178, %rsp            # imm = 0x178
retq
leaq 0xf8(%rsp), %rdi
callq 0xe1230
leaq 0x110(%rsp), %rdi
callq 0xe1230
leaq 0x128(%rsp), %rdi
callq 0xe1230
leaq 0x140(%rsp), %rdi
callq 0xd3b20
movq 0xe8(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)