// File: jstaursky[P]hutch/src/Sleigh/slghpatexpress.cc
// Function: LessEqualEquation::genPattern(std::vector<TokenPattern, std::allocator<TokenPattern>> const&) const
void LessEqualEquation::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 lhsval;
    intb val = rhs->getSubValue(cur);
    for(lhsval=lhsmin;lhsval<=lhsmax;++lhsval) {
      if (lhsval > val) continue;
      if (count==0)
	resultpattern = buildPattern(lhs,lhsval,semval,cur);
      else
	resultpattern = resultpattern.doOr(buildPattern(lhs,lhsval,semval,cur));
      count += 1;
    }
  } while(advance_combo(cur,min,max));
  if (count == 0)
    throw SleighError("Less than or equal constraint is impossible to match");
}

// Assembly:
subq $0x188, %rsp            # imm = 0x188
movq %rdi, 0x180(%rsp)
movq %rsi, 0x178(%rsp)
movq 0x180(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rax), %rdi
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x170(%rsp)
movq 0x38(%rax), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
movq %rax, 0x168(%rsp)
leaq 0x150(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xe17a0
leaq 0x138(%rsp), %rdi
callq 0xe0900
leaq 0x120(%rsp), %rdi
callq 0xe0900
leaq 0x108(%rsp), %rdi
callq 0xe0900
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rsi
movl $0x0, 0x104(%rsp)
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
jmp 0x12d753
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
leaq 0x138(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq *%rax
jmp 0x12d777
leaq 0x108(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0xce030
jmp 0x12d78e
jmp 0x12d790
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rdi
leaq 0x108(%rsp), %rsi
callq 0xd69f0
movq %rax, 0x28(%rsp)
jmp 0x12d7ad
movq 0x28(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x170(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rax
cmpq 0x168(%rsp), %rax
jg 0x12d991
movq 0xe8(%rsp), %rax
cmpq 0xe0(%rsp), %rax
jle 0x12d810
jmp 0x12d978
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x12dacf
cmpl $0x0, 0x104(%rsp)
jne 0x12d89e
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0xe8(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
leaq 0x150(%rsp), %rcx
leaq 0x108(%rsp), %r8
callq 0x12cb20
jmp 0x12d84e
movq 0x30(%rsp), %rdi
addq $0x10, %rdi
leaq 0xb8(%rsp), %rsi
callq 0xdd160
jmp 0x12d866
leaq 0xb8(%rsp), %rdi
callq 0xd2580
jmp 0x12d967
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xd2580
jmp 0x12dacf
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x20(%rsp)
movq 0x38(%rax), %rsi
movq 0xe8(%rsp), %rdx
leaq 0x68(%rsp), %rdi
leaq 0x150(%rsp), %rcx
leaq 0x108(%rsp), %r8
callq 0x12cb20
jmp 0x12d8d7
movq 0x20(%rsp), %rsi
leaq 0x90(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0xda5f0
jmp 0x12d8f0
movq 0x30(%rsp), %rdi
addq $0x10, %rdi
leaq 0x90(%rsp), %rsi
callq 0xdd160
jmp 0x12d908
leaq 0x90(%rsp), %rdi
callq 0xd2580
leaq 0x68(%rsp), %rdi
callq 0xd2580
jmp 0x12d967
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x12d958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0xd2580
leaq 0x68(%rsp), %rdi
callq 0xd2580
jmp 0x12dacf
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
movq 0xe8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe8(%rsp)
jmp 0x12d7ca
jmp 0x12d993
leaq 0x108(%rsp), %rdi
leaq 0x138(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x12ccd0
movb %al, 0x1f(%rsp)
jmp 0x12d9b6
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x12d790
jmp 0x12d9c4
cmpl $0x0, 0x104(%rsp)
jne 0x12da93
movb $0x1, 0x46(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0x8(%rsp)
leaq 0x47(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe0c80
movq 0x10(%rsp), %rdx
leaq 0x5b094(%rip), %rsi     # 0x188a95
leaq 0x48(%rsp), %rdi
callq 0xe00a0
jmp 0x12da0d
movq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xd06e0
jmp 0x12da1e
movq 0x8(%rsp), %rdi
movb $0x0, 0x46(%rsp)
movq 0x9a439(%rip), %rsi     # 0x1c7e68
movq 0x99fea(%rip), %rdx     # 0x1c7a20
callq 0xe01f0
jmp 0x12db10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x12da74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xd4550
leaq 0x47(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x46(%rsp)
jne 0x12da87
jmp 0x12da91
movq 0x8(%rsp), %rdi
callq 0xd5400
jmp 0x12dacf
leaq 0x108(%rsp), %rdi
callq 0xe1230
leaq 0x120(%rsp), %rdi
callq 0xe1230
leaq 0x138(%rsp), %rdi
callq 0xe1230
leaq 0x150(%rsp), %rdi
callq 0xd3b20
addq $0x188, %rsp            # imm = 0x188
retq
leaq 0x108(%rsp), %rdi
callq 0xe1230
leaq 0x120(%rsp), %rdi
callq 0xe1230
leaq 0x138(%rsp), %rdi
callq 0xe1230
leaq 0x150(%rsp), %rdi
callq 0xd3b20
movq 0xf8(%rsp), %rdi
callq 0xe0be0