// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/pcodecompile.cc
// Function: PcodeCompile::propagateSize(ConstructTpl*)
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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %r15
cmpq 0x10(%rdi), %r15
je 0x525e1
movq %rdi, %r14
movq %rsp, %r12
movq (%r15), %rdi
callq 0x41f90
testb %al, %al
je 0x525c6
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x40260
movq (%r15), %rdi
callq 0x41f90
testb %al, %al
je 0x525c6
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x525bb
movq (%r15), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x525c6
movq %r12, %rdi
movq %r15, %rdx
callq 0x3f150
addq $0x8, %r15
cmpq 0x10(%r14), %r15
jne 0x5257e
movq 0x8(%rsp), %rbp
subq (%rsp), %rbp
shrq $0x3, %rbp
incl %ebp
jmp 0x525e6
movl $0x1, %ebp
movq %rsp, %r15
leaq 0x20(%rsp), %r12
movq (%rsp), %r14
movq 0x8(%rsp), %rax
movq %rax, %r13
subq %r14, %r13
sarq $0x3, %r13
movslq %ebp, %rcx
cmpq %rcx, %r13
jae 0x52679
movq 0x20(%rsp), %rcx
cmpq %rcx, 0x28(%rsp)
je 0x5261a
movq %rcx, 0x28(%rsp)
cmpq %rax, %r14
je 0x52666
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x40260
movq (%r14), %rdi
callq 0x41f90
testb %al, %al
je 0x5265b
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x52650
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, 0x28(%rsp)
jmp 0x5265b
movq %r12, %rdi
movq %r14, %rdx
callq 0x3f150
addq $0x8, %r14
cmpq 0x8(%rsp), %r14
jne 0x5261f
movq %r15, %rdi
movq %r12, %rsi
callq 0x416a0
movl %r13d, %ebp
jmp 0x525ee
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x52694
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq (%rsp), %r14
testq %r14, %r14
je 0x526a9
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x40880
testl %ebp, %ebp
sete %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x526c1
jmp 0x526c1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x526db
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x526f1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10
nop