// File: jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstTpl::transfer(std::vector<HandleTpl*, std::allocator<HandleTpl*>> const&)
void ConstTpl::transfer(const vector<HandleTpl *> &params)

{				// Replace old handles with new handles
  if (type != handle) return;
  HandleTpl *newhandle = params[value.handle_index];

  switch(select) {
  case v_space:
    *this = newhandle->getSpace();
    break;
  case v_offset:
    *this = newhandle->getPtrOffset();
    break;
  case v_offset_plus:
    {
      uintb tmp = value_real;
      *this = newhandle->getPtrOffset();
      if (type == real) {
	value_real += (tmp&0xffff);
      }
      else if ((type == handle)&&(select == v_offset)) {
	select = v_offset_plus;
	value_real = tmp;
      }
      else
	throw LowlevelError("Cannot truncate macro input in this way");
      break;
    }
  case v_size:
    *this = newhandle->getSize();
    break;
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x1, (%rax)
je 0x115552
jmp 0x115773
movq 0x18(%rsp), %rax
movq 0x68(%rsp), %rdi
movslq 0x8(%rax), %rsi
callq 0xdfa00
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rcx
movq %rcx, 0x60(%rsp)
movl 0x18(%rax), %eax
movq %rax, 0x10(%rsp)
subq $0x3, %rax
ja 0x115773
movq 0x10(%rsp), %rax
leaq 0x72ba1(%rip), %rcx     # 0x188134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%rsp), %rdi
callq 0xe19b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
jmp 0x115773
movq 0x60(%rsp), %rdi
callq 0xd4cc0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
jmp 0x115773
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rdi
callq 0xd4cc0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
cmpl $0x0, (%rax)
jne 0x115661
movq 0x18(%rsp), %rax
movq 0x58(%rsp), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0x115743
movq 0x18(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x115690
movq 0x18(%rsp), %rax
cmpl $0x1, 0x18(%rax)
jne 0x115690
movq 0x18(%rsp), %rax
movl $0x3, 0x18(%rax)
movq 0x58(%rsp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x115741
movb $0x1, 0x23(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, (%rsp)
leaq 0x37(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe0c80
movq 0x8(%rsp), %rdx
leaq 0x72b08(%rip), %rsi     # 0x1881c6
leaq 0x38(%rsp), %rdi
callq 0xe00a0
jmp 0x1156ca
movq (%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xd1ae0
jmp 0x1156da
movq (%rsp), %rdi
movb $0x0, 0x23(%rsp)
movq 0xb27a6(%rip), %rsi     # 0x1c7e90
movq 0xb24df(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0x115782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x115723
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xd4550
leaq 0x37(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x23(%rsp)
jne 0x115736
jmp 0x11573f
movq (%rsp), %rdi
callq 0xd5400
jmp 0x115778
jmp 0x115743
jmp 0x115773
movq 0x60(%rsp), %rdi
callq 0xce240
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
addq $0x78, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)