// File: jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: ConsistencyChecker::optimizeGather2(Constructor*, std::map<unsigned long, ConsistencyChecker::OptimizeRecord, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, ConsistencyChecker::OptimizeRecord>>>&, int) const
void ConsistencyChecker::optimizeGather2(Constructor *ct,map<uintb,OptimizeRecord> &recs,int4 secnum) const

{ // Make sure any temp used by the export is not optimized away
  ConstructTpl *tpl;
  if (secnum < 0)
    tpl = ct->getTempl();
  else
    tpl = ct->getNamedTempl(secnum);
  if (tpl == (ConstructTpl *)0)
    return;
  HandleTpl *hand = tpl->getResult();
  if (hand == (HandleTpl *)0) return;
  if (hand->getPtrSpace().isUniqueSpace()) {
    if (hand->getPtrOffset().getType() == ConstTpl::real) {
      pair<map<uintb,OptimizeRecord>::iterator,bool> res;
      uintb offset = hand->getPtrOffset().getReal();
      res = recs.insert( pair<uintb,OptimizeRecord>(offset,OptimizeRecord()));
      (*res.first).second.writeop = 0;
      (*res.first).second.readop = 0;
      (*res.first).second.writecount = 2;
      (*res.first).second.readcount = 2;
      (*res.first).second.readsection = -2;
      (*res.first).second.writesection = -2;
    }
  }
  if (hand->getSpace().isUniqueSpace()) {
    if ((hand->getPtrSpace().getType() == ConstTpl::real)&&
	(hand->getPtrOffset().getType() == ConstTpl::real)) {
      pair<map<uintb,OptimizeRecord>::iterator,bool> res;
      uintb offset = hand->getPtrOffset().getReal();
      res = recs.insert( pair<uintb,OptimizeRecord>(offset,OptimizeRecord()));
      (*res.first).second.writeop = 0;
      (*res.first).second.readop = 0;
      (*res.first).second.writecount = 2;
      (*res.first).second.readcount = 2;
      (*res.first).second.readsection = -2;
      (*res.first).second.writesection = -2;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x5f45f
movq -0x10(%rbp), %rdi
callq 0x52880
movq %rax, -0x28(%rbp)
jmp 0x5f46f
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xaa8d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x5f47b
jmp 0x5f734
movq -0x28(%rbp), %rdi
callq 0x52ef0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5f494
jmp 0x5f734
movq -0x30(%rbp), %rdi
callq 0x6abb0
movq %rax, %rdi
callq 0x4a000
testb $0x1, %al
jne 0x5f4ae
jmp 0x5f5c2
movq -0x30(%rbp), %rdi
callq 0x4e1b0
movq %rax, %rdi
callq 0x3fc10
cmpl $0x0, %eax
jne 0x5f5c0
leaq -0x40(%rbp), %rdi
callq 0x6abd0
movq -0x30(%rbp), %rdi
callq 0x4e1b0
movq %rax, %rdi
callq 0x3fc20
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x6aaf0
movq -0x148(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x6ac40
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x6ac00
movb %dl, -0xa8(%rbp)
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x58(%rbp)
movb -0xa8(%rbp), %al
movb %al, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x6ac90
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0x0, 0x8(%rax)
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0x0, 0xc(%rax)
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0x2, 0x14(%rax)
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0x2, 0x18(%rax)
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0xfffffffe, 0x20(%rax) # imm = 0xFFFFFFFE
leaq -0x40(%rbp), %rdi
callq 0x6ab90
movl $0xfffffffe, 0x1c(%rax) # imm = 0xFFFFFFFE
jmp 0x5f5c2
movq -0x30(%rbp), %rdi
callq 0x4e1a0
movq %rax, %rdi
callq 0x4a000
testb $0x1, %al
jne 0x5f5dc
jmp 0x5f734
movq -0x30(%rbp), %rdi
callq 0x6abb0
movq %rax, %rdi
callq 0x3fc10
cmpl $0x0, %eax
jne 0x5f732
movq -0x30(%rbp), %rdi
callq 0x4e1b0
movq %rax, %rdi
callq 0x3fc10
cmpl $0x0, %eax
jne 0x5f732
leaq -0xc0(%rbp), %rdi
callq 0x6abd0
movq -0x30(%rbp), %rdi
callq 0x4e1b0
movq %rax, %rdi
callq 0x3fc20
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x120(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x6aaf0
movq -0x160(%rbp), %rdx
leaq -0x100(%rbp), %rdi
movq %rdi, -0x150(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x6ac40
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x6ac00
movb %dl, -0x128(%rbp)
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0xd8(%rbp)
movb -0x128(%rbp), %al
movb %al, -0xd0(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x6ac90
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0x0, 0x8(%rax)
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0x0, 0xc(%rax)
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0x2, 0x14(%rax)
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0x2, 0x18(%rax)
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0xfffffffe, 0x20(%rax) # imm = 0xFFFFFFFE
leaq -0xc0(%rbp), %rdi
callq 0x6ab90
movl $0xfffffffe, 0x1c(%rax) # imm = 0xFFFFFFFE
jmp 0x5f734
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax)