// File: jstaursky[P]hutch/src/Sleigh/slghpatexpress.cc
// Function: EquationCat::resolveOperandLeft(OperandResolve&) const
bool EquationCat::resolveOperandLeft(OperandResolve &state) const

{
  bool res = left->resolveOperandLeft(state);
  if (!res) return false;
  int4 cur_base = state.base;
  int4 cur_offset = state.offset;
  if ((!left->getTokenPattern().getLeftEllipsis())&&(!left->getTokenPattern().getRightEllipsis())) {
    // Keep the same base
    state.offset += left->getTokenPattern().getMinimumLength(); // But add to its size
  }
  else if (state.cur_rightmost != -1) {
    state.base = state.cur_rightmost;
    state.offset = state.size;
  }
  else if (state.size != -1) {
    state.offset += state.size;
  }
  else {
    state.base = -2;		// We have no anchor
  }
  int4 cur_rightmost = state.cur_rightmost;
  int4 cur_size = state.size;
  res = right->resolveOperandLeft(state);
  if (!res) return false;
  state.base = cur_base;	// Restore base and offset
  state.offset = cur_offset;
  if (state.cur_rightmost == -1) {
    if ((state.size != -1)&&(cur_rightmost != -1)&&(cur_size != -1)) {
      state.cur_rightmost = cur_rightmost;
      state.size += cur_size;
    }
  }
  return true;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rax), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
andb $0x1, %al
movb %al, 0x1f(%rsp)
testb $0x1, 0x1f(%rsp)
jne 0x12ec4d
movb $0x0, 0x37(%rsp)
jmp 0x12edb5
movq (%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x18(%rsp)
movq 0x20(%rsp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0x14(%rsp)
movq 0x38(%rax), %rdi
callq 0xe17d0
movq %rax, %rdi
callq 0xd84c0
testb $0x1, %al
jne 0x12ecbb
movq (%rsp), %rax
movq 0x38(%rax), %rdi
callq 0xe17d0
movq %rax, %rdi
callq 0xddf00
testb $0x1, %al
jne 0x12ecbb
movq (%rsp), %rax
movq 0x38(%rax), %rdi
callq 0xe17d0
movq %rax, %rdi
callq 0xe1780
movl %eax, %ecx
movq 0x20(%rsp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
jmp 0x12ed18
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x10(%rax)
je 0x12ece8
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rax
movl 0x14(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
jmp 0x12ed16
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x14(%rax)
je 0x12ed08
movq 0x20(%rsp), %rax
movl 0x14(%rax), %ecx
movq 0x20(%rsp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
jmp 0x12ed14
movq 0x20(%rsp), %rax
movl $0xfffffffe, 0x8(%rax)  # imm = 0xFFFFFFFE
jmp 0x12ed16
jmp 0x12ed18
movq (%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rsp)
movq 0x20(%rsp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0xc(%rsp)
movq 0x40(%rax), %rdi
movq 0x20(%rsp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
andb $0x1, %al
movb %al, 0x1f(%rsp)
testb $0x1, 0x1f(%rsp)
jne 0x12ed57
movb $0x0, 0x37(%rsp)
jmp 0x12edb5
movl 0x18(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x14(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x10(%rax)
jne 0x12edb0
movq 0x20(%rsp), %rax
cmpl $-0x1, 0x14(%rax)
je 0x12edae
cmpl $-0x1, 0x10(%rsp)
je 0x12edae
cmpl $-0x1, 0xc(%rsp)
je 0x12edae
movl 0x10(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x10(%rax)
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %rax
addl 0x14(%rax), %ecx
movl %ecx, 0x14(%rax)
jmp 0x12edb0
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq