// File: /workspace/github_cpp_makefile_star2_O2/jstaursky[P]hutch/src/Sleigh/pcodecompile.cc
// Function: PcodeCompile::force_size(VarnodeTpl*, ConstTpl const&, std::vector<OpTpl*, std::allocator<OpTpl*>> const&)
void PcodeCompile::force_size(VarnodeTpl *vt,const ConstTpl &size,const vector<OpTpl *> &ops)

{
  if ((vt->getSize().getType()!=ConstTpl::real)||(vt->getSize().getReal() != 0))
    return;			// Size already exists

  vt->setSize(size);
  if (!vt->isLocalTemp()) return;
				// If the variable is a local temporary
				// The size may need to be propagated to the various
				// uses of the variable
  OpTpl *op;
  VarnodeTpl *vn;

  for(int4 i=0;i<ops.size();++i) {
    op = ops[i];
    vn = op->getOut();
    if ((vn!=(VarnodeTpl *)0)&&(vn->isLocalTemp())) {
      if (vn->getOffset() == vt->getOffset()) {
	if ((size.getType() == ConstTpl::real)&&(vn->getSize().getType() == ConstTpl::real)&&
	    (vn->getSize().getReal() != 0) && (vn->getSize().getReal() != size.getReal()))
	  throw SleighError("Localtemp size mismatch");
	vn->setSize(size);
      }
    }
    for(int4 j=0;j<op->numInput();++j) {
      vn = op->getIn(j);
      if (vn->isLocalTemp()&&(vn->getOffset()==vt->getOffset())) {
	if ((size.getType() == ConstTpl::real)&&(vn->getSize().getType() == ConstTpl::real)&&
	    (vn->getSize().getReal() != 0) && (vn->getSize().getReal() != size.getReal()))
	  throw SleighError("Localtemp size mismatch");
	vn->setSize(size);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x10(%rsp)
cmpl $0x0, 0x40(%rdi)
jne 0x5ec80
movq %rdi, %r15
cmpq $0x0, 0x50(%rdi)
jne 0x5ec80
movq %rsi, %r14
leaq 0x40(%r15), %rax
movups (%rsi), %xmm0
movups 0xc(%rsi), %xmm1
movups %xmm1, 0xc(%rax)
movups %xmm0, (%rax)
movq %r15, %rdi
callq 0x4ec10
testb %al, %al
je 0x5ec80
addq $0x20, %r15
xorl %r13d, %r13d
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x5ec80
movq (%rax,%r13,8), %rbp
movq (%rbp), %r12
testq %r12, %r12
je 0x5ec06
movq %r12, %rdi
callq 0x4ec10
testb %al, %al
je 0x5ec06
leaq 0x20(%r12), %rdi
movq %r15, %rsi
callq 0x4f1e0
testb %al, %al
je 0x5ec06
cmpl $0x0, (%r14)
jne 0x5ebf1
cmpl $0x0, 0x40(%r12)
jne 0x5ebf1
movq 0x50(%r12), %rax
testq %rax, %rax
je 0x5ebf1
cmpq 0x10(%r14), %rax
jne 0x5ecda
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0x4c(%r12)
movups %xmm0, 0x40(%r12)
xorl %ebx, %ebx
movq 0x10(%rbp), %rax
movq 0x18(%rbp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rbx
jge 0x5ec78
movq (%rax,%rbx,8), %r12
movq %r12, %rdi
callq 0x4ec10
testb %al, %al
je 0x5ec73
leaq 0x20(%r12), %rdi
movq %r15, %rsi
callq 0x4f1e0
testb %al, %al
je 0x5ec73
cmpl $0x0, (%r14)
jne 0x5ec5e
cmpl $0x0, 0x40(%r12)
jne 0x5ec5e
movq 0x50(%r12), %rax
testq %rax, %rax
je 0x5ec5e
cmpq 0x10(%r14), %rax
jne 0x5ec8f
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0x4c(%r12)
movups %xmm0, 0x40(%r12)
incq %rbx
jmp 0x5ec08
incq %r13
jmp 0x5eb89
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %rbx
leaq 0x28248(%rip), %rsi     # 0x86ee9
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x501bf(%rip), %rsi     # 0xaee88
movq 0x4ff68(%rip), %rdx     # 0xaec38
movq %rbx, %rdi
callq 0x51630
jmp 0x5ed23
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %rbx
leaq 0x281fd(%rip), %rsi     # 0x86ee9
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x50174(%rip), %rsi     # 0xaee88
movq 0x4ff1d(%rip), %rdx     # 0xaec38
movq %rbx, %rdi
callq 0x51630
jmp 0x5ed27
jmp 0x5ed3b
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x4e020
testb %bpl, %bpl
jne 0x5ed3e
jmp 0x5ed46
movq %rax, %r14
movq %rbx, %rdi
callq 0x4ea60
movq %r14, %rdi
callq 0x518c0