// File: /workspace/github_cpp_makefile_star2_O1/zerolfx[P]P-Machine/ldd.cpp
// Function: Ldd::execute(StackMachine*)
void Ldd::execute(StackMachine *stack) 
{
	if(stack->fSP < 2)
		throw ExecutionError("instruction ldd: requires 3 stackelements to be present.");
	
	StackAddress p1;
	if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 2])))
		throw ExecutionError("instruction add: SP-2 does not point to element of type address.");
		
	++stack->fSP;
	
	stack->fStore.push_back(new StackInteger(stack->fStore[stack->fSP -3]->getValue() + fQ));
	
	// adding cost of this instruction
	stack->fTime.count("ldd");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpl $0x1, 0xb4(%rsi)
jle 0x198ad
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x1a3d0
movslq 0xb4(%rbx), %r12
movq 0x18(%rbx), %r13
movq -0x10(%r13,%r12,8), %rax
testq %rax, %rax
je 0x19902
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1a1ca(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x197b9
cmpb $0x2a, (%rdi)
je 0x19856
callq 0x6310
testl %eax, %eax
jne 0x19856
leal 0x1(%r12), %eax
movl %eax, 0xb4(%rbx)
movl $0x10, %edi
callq 0x6200
movq %rax, %r15
movq -0x10(%r13,%r12,8), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
addl 0x8(%r14), %eax
movq %r15, %rdi
movl %eax, %esi
callq 0x1aca0
leaq 0x18(%rbx), %rdi
leaq -0x48(%rbp), %rsi
movq %r15, (%rsi)
callq 0xa3ae
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xca96(%rip), %rsi      # 0x2629f
leaq 0xca92(%rip), %rdx      # 0x262a2
leaq -0x48(%rbp), %rdi
callq 0x746c
addq $0x78, %rbx
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x1ce78
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x1983e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
leaq -0x58(%rbp), %rdi
callq 0x1a3f4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xc9eb(%rip), %rsi      # 0x2625e
leaq 0xca24(%rip), %rdx      # 0x2629e
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x191ec(%rip), %rsi     # 0x32a88
leaq 0x1b93(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x19902
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xc95b(%rip), %rsi      # 0x26225
leaq 0xc98c(%rip), %rdx      # 0x2625d
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x19195(%rip), %rsi     # 0x32a88
leaq 0x1b3c(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
callq 0x6250
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x19927
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x19927
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x1999c
movq %r14, %rdi
callq 0x6170
jmp 0x1999c
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x19956
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x19956
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x19993
movq %r14, %rdi
callq 0x6170
jmp 0x19993
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x19993
movq -0x38(%rbp), %rsi
incq %rsi
jmp 0x1998e
jmp 0x1997e
jmp 0x1997e
movq %rax, %rbx
jmp 0x19993
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x6210
leaq -0x58(%rbp), %rdi
callq 0x1a3f4
movq %rbx, %rdi
callq 0x6410