// File: zerolfx[P]P-Machine/sto.cpp
// Function: Sto::execute(StackMachine*)
void Sto::execute(StackMachine *stack)
{
	StackAddress p;
	
	if(stack->fSP < 1)
		throw ExecutionError("instruction sto: at least 2 stackelements are required for this operation");
		
	if(typeid(p) != typeid(*(stack->fStore[stack->fSP - 1])))
		throw ExecutionError("instruction sto: type pointed to by SP - 1 is not of type address.");
				
	switch(fType)
	{
		case integer:
		{
			StackInteger p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sto: type pointed to by SP is not of type integer.");
			}
				
			break;
		}	
		case real:
		{
			StackReal p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sto: type pointed to by SP is not of type real.");
			}

			break;
		}
		case boolean:
		{
			StackBoolean p1;
			
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sto: type pointed to by SP is not of type boolean.");
			}

			break;
		}
		case character:
		{
			StackCharacter p1;
			
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sto: type pointed to by SP is not of type character.");
			}


			break;
		}
		case address:
		{
			StackAddress p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sto: type pointed to by SP is not of type address.");
			}
				
			break;
		}
	}
	
	if(stack->fStore[stack->fSP - 1]->heapAddress())
	{
		if(stack->fStore[stack->fSP - 1]->getValue() < stack->fNP)
		{
			throw ExecutionError("instruction sto: invalid heap address.");
		}
		else
		{
			delete stack->fHeap[-stack->fStore[stack->fSP - 1]->getValue() - 1];
			stack->fHeap[-stack->fStore[stack->fSP - 1]->getValue() - 1] = stack->fStore[stack->fSP];
		}
	}
	else
	{
		if(stack->fStore[stack->fSP - 1]->getValue() > stack->fSP - 2) 	
		{
			// -2 because the SP will be decreased by 2 as a result of this operation
			
			throw ExecutionError("instruction sto: invalid stack address.");
		}
		else
		{
			delete stack->fStore[stack->fStore[stack->fSP - 1]->getValue()];
			stack->fStore[stack->fStore[stack->fSP - 1]->getValue()] = stack->fStore[stack->fSP];
		}
	}
	
	stack->fStore.pop_back();
	delete stack->fStore[stack->fSP - 1];
	stack->fStore[stack->fSP - 1] = 0;
	stack->fStore.pop_back();

	stack->fSP -= 2;
	
	// adding cost of this instruction
	stack->fTime.count("sto");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x26800
movq -0x10(%rbp), %rax
cmpl $0x1, 0xb4(%rax)
jge 0x219b2
movb $0x1, -0x55(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x228(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x74f0
movq -0x220(%rbp), %rdx
leaq 0x181f8(%rip), %rsi     # 0x39b25
leaq -0x40(%rbp), %rdi
callq 0x8940
jmp 0x21938
movq -0x228(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x283d0
jmp 0x2194a
movq -0x228(%rbp), %rdi
movb $0x0, -0x55(%rbp)
leaq 0x28124(%rip), %rsi     # 0x49a80
leaq 0x6a9d(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21990
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x7170
leaq -0x41(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x55(%rbp)
jne 0x219a1
jmp 0x219ad
movq -0x228(%rbp), %rdi
callq 0x71c0
jmp 0x22797
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x230(%rbp)
cmpq $0x0, %rax
jne 0x219e6
callq 0x7300
jmp 0x219e6
movq -0x230(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28f5d(%rip), %rdi     # 0x4a958
callq 0x9370
testb $0x1, %al
jne 0x21a09
jmp 0x21ad2
movb $0x1, -0x7a(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x240(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x74f0
movq -0x238(%rbp), %rdx
leaq 0x18133(%rip), %rsi     # 0x39b6f
leaq -0x78(%rbp), %rdi
callq 0x8940
jmp 0x21a47
movq -0x240(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x283d0
jmp 0x21a59
movq -0x240(%rbp), %rdi
movb $0x0, -0x7a(%rbp)
leaq 0x28015(%rip), %rsi     # 0x49a80
leaq 0x698e(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x22797
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21ab0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x7170
leaq -0x79(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x7a(%rbp)
jne 0x21ac1
jmp 0x21acd
movq -0x240(%rbp), %rdi
callq 0x71c0
jmp 0x22797
movq -0x218(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x248(%rbp)
subq $0x4, %rax
ja 0x221e0
movq -0x248(%rbp), %rax
leaq 0x18011(%rip), %rcx     # 0x39b0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
callq 0x27340
jmp 0x21b14
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x250(%rbp)
cmpq $0x0, %rax
jne 0x21b43
callq 0x7300
jmp 0x21b43
movq -0x250(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28f98(%rip), %rdi     # 0x4aaf0
callq 0x9370
testb $0x1, %al
jne 0x21b66
jmp 0x21c41
movb $0x1, -0xb2(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x260(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x74f0
movq -0x258(%rbp), %rdx
leaq 0x18013(%rip), %rsi     # 0x39bb2
leaq -0xb0(%rbp), %rdi
callq 0x8940
jmp 0x21bad
movq -0x260(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x283d0
jmp 0x21bc2
movq -0x260(%rbp), %rdi
movb $0x0, -0xb2(%rbp)
leaq 0x27ea9(%rip), %rsi     # 0x49a80
leaq 0x6822(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21c52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21c1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x7170
leaq -0xb1(%rbp), %rdi
callq 0x72e0
testb $0x1, -0xb2(%rbp)
jne 0x21c33
jmp 0x21c3f
movq -0x260(%rbp), %rdi
callq 0x71c0
jmp 0x21c52
leaq -0x90(%rbp), %rdi
callq 0x27380
jmp 0x221e0
leaq -0x90(%rbp), %rdi
callq 0x27380
jmp 0x22797
leaq -0xc8(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x27840
jmp 0x21c74
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x268(%rbp)
cmpq $0x0, %rax
jne 0x21ca3
callq 0x7300
jmp 0x21ca3
movq -0x268(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28f08(%rip), %rdi     # 0x4abc0
callq 0x9370
testb $0x1, %al
jne 0x21cc6
jmp 0x21da1
movb $0x1, -0xea(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x278(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x74f0
movq -0x270(%rbp), %rdx
leaq 0x17ef2(%rip), %rsi     # 0x39bf1
leaq -0xe8(%rbp), %rdi
callq 0x8940
jmp 0x21d0d
movq -0x278(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x283d0
jmp 0x21d22
movq -0x278(%rbp), %rdi
movb $0x0, -0xea(%rbp)
leaq 0x27d49(%rip), %rsi     # 0x49a80
leaq 0x66c2(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21db2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21d7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x7170
leaq -0xe9(%rbp), %rdi
callq 0x72e0
testb $0x1, -0xea(%rbp)
jne 0x21d93
jmp 0x21d9f
movq -0x278(%rbp), %rdi
callq 0x71c0
jmp 0x21db2
leaq -0xc8(%rbp), %rdi
callq 0x27880
jmp 0x221e0
leaq -0xc8(%rbp), %rdi
callq 0x27880
jmp 0x22797
leaq -0x100(%rbp), %rdi
xorl %esi, %esi
callq 0x27d20
jmp 0x21dd3
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x280(%rbp)
cmpq $0x0, %rax
jne 0x21e02
callq 0x7300
jmp 0x21e02
movq -0x280(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28e79(%rip), %rdi     # 0x4ac90
callq 0x9370
testb $0x1, %al
jne 0x21e25
jmp 0x21f00
movb $0x1, -0x122(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x290(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x74f0
movq -0x288(%rbp), %rdx
leaq 0x17dcf(%rip), %rsi     # 0x39c2d
leaq -0x120(%rbp), %rdi
callq 0x8940
jmp 0x21e6c
movq -0x290(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x283d0
jmp 0x21e81
movq -0x290(%rbp), %rdi
movb $0x0, -0x122(%rbp)
leaq 0x27bea(%rip), %rsi     # 0x49a80
leaq 0x6563(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21f11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x21edb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x7170
leaq -0x121(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x122(%rbp)
jne 0x21ef2
jmp 0x21efe
movq -0x290(%rbp), %rdi
callq 0x71c0
jmp 0x21f11
leaq -0x100(%rbp), %rdi
callq 0x27d70
jmp 0x221e0
leaq -0x100(%rbp), %rdi
callq 0x27d70
jmp 0x22797
leaq -0x138(%rbp), %rdi
movl $0x61, %esi
callq 0x28170
jmp 0x21f35
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x298(%rbp)
cmpq $0x0, %rax
jne 0x21f64
callq 0x7300
jmp 0x21f64
movq -0x298(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28de7(%rip), %rdi     # 0x4ad60
callq 0x9370
testb $0x1, %al
jne 0x21f87
jmp 0x22062
movb $0x1, -0x15a(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x2a8(%rbp)
leaq -0x159(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x74f0
movq -0x2a0(%rbp), %rdx
leaq 0x17cac(%rip), %rsi     # 0x39c6c
leaq -0x158(%rbp), %rdi
callq 0x8940
jmp 0x21fce
movq -0x2a8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x283d0
jmp 0x21fe3
movq -0x2a8(%rbp), %rdi
movb $0x0, -0x15a(%rbp)
leaq 0x27a88(%rip), %rsi     # 0x49a80
leaq 0x6401(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x22073
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x7170
leaq -0x159(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x15a(%rbp)
jne 0x22054
jmp 0x22060
movq -0x2a8(%rbp), %rdi
callq 0x71c0
jmp 0x22073
leaq -0x138(%rbp), %rdi
callq 0x281b0
jmp 0x221e0
leaq -0x138(%rbp), %rdi
callq 0x281b0
jmp 0x22797
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
callq 0x26800
jmp 0x22094
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2b0(%rbp)
cmpq $0x0, %rax
jne 0x220c3
callq 0x7300
jmp 0x220c3
movq -0x2b0(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x28880(%rip), %rdi     # 0x4a958
callq 0x9370
testb $0x1, %al
jne 0x220e6
jmp 0x221c1
movb $0x1, -0x192(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x2c0(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x74f0
movq -0x2b8(%rbp), %rdx
leaq 0x17b8e(%rip), %rsi     # 0x39cad
leaq -0x190(%rbp), %rdi
callq 0x8940
jmp 0x2212d
movq -0x2c0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x283d0
jmp 0x22142
movq -0x2c0(%rbp), %rdi
movb $0x0, -0x192(%rbp)
leaq 0x27929(%rip), %rsi     # 0x49a80
leaq 0x62a2(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x221cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2219c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x7170
leaq -0x191(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x192(%rbp)
jne 0x221b3
jmp 0x221bf
movq -0x2c0(%rbp), %rdi
callq 0x71c0
jmp 0x221cf
leaq -0x170(%rbp), %rdi
callq 0x26840
jmp 0x221e0
leaq -0x170(%rbp), %rdi
callq 0x26840
jmp 0x22797
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
callq *%rax
movb %al, -0x2c1(%rbp)
jmp 0x22212
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x22221
jmp 0x22445
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x2c8(%rbp)
jmp 0x22250
movl -0x2c8(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xb8(%rcx), %eax
jge 0x22336
movb $0x1, -0x1ba(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x2d8(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x74f0
movq -0x2d0(%rbp), %rdx
leaq 0x17a4d(%rip), %rsi     # 0x39cec
leaq -0x1b8(%rbp), %rdi
callq 0x8940
jmp 0x222ad
movq -0x2d8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x283d0
jmp 0x222c2
movq -0x2d8(%rbp), %rdi
movb $0x0, -0x1ba(%rbp)
leaq 0x277a9(%rip), %rsi     # 0x49a80
leaq 0x6122(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2230e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x7170
leaq -0x1b9(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x1ba(%rbp)
jne 0x22325
jmp 0x22331
movq -0x2d8(%rbp), %rdi
callq 0x71c0
jmp 0x22797
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, -0x2e8(%rbp)
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x2dc(%rbp)
jmp 0x22373
movq -0x2e8(%rbp), %rdi
movl -0x2dc(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2f0(%rbp)
cmpq $0x0, %rax
je 0x223bc
movq -0x2f0(%rbp), %rdi
callq 0x26ca0
movq -0x2f0(%rbp), %rdi
movl $0x8, %esi
callq 0x7280
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x308(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, -0x300(%rbp)
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x2f4(%rbp)
jmp 0x2241a
movq -0x300(%rbp), %rdi
movl -0x2f4(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq -0x308(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x2264f
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x30c(%rbp)
jmp 0x22474
movl -0x30c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0xb4(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x2255f
movb $0x1, -0x1e2(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x320(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x74f0
movq -0x318(%rbp), %rdx
leaq 0x1784b(%rip), %rsi     # 0x39d13
leaq -0x1e0(%rbp), %rdi
callq 0x8940
jmp 0x224d6
movq -0x320(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x283d0
jmp 0x224eb
movq -0x320(%rbp), %rdi
movb $0x0, -0x1e2(%rbp)
leaq 0x27580(%rip), %rsi     # 0x49a80
leaq 0x5ef9(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x227a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x22537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x7170
leaq -0x1e1(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x1e2(%rbp)
jne 0x2254e
jmp 0x2255a
movq -0x320(%rbp), %rdi
callq 0x71c0
jmp 0x22797
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movq %rdi, -0x330(%rbp)
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x324(%rbp)
jmp 0x22595
movq -0x330(%rbp), %rdi
movl -0x324(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x338(%rbp)
cmpq $0x0, %rax
je 0x225d7
movq -0x338(%rbp), %rdi
callq 0x26ca0
movq -0x338(%rbp), %rdi
movl $0x8, %esi
callq 0x7280
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x350(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movq %rdi, -0x348(%rbp)
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x33c(%rbp)
jmp 0x2262e
movq -0x348(%rbp), %rdi
movl -0x33c(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq -0x350(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x2264f
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x8e90
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x358(%rbp)
cmpq $0x0, %rax
je 0x226a6
movq -0x358(%rbp), %rdi
callq 0x26ca0
movq -0x358(%rbp), %rdi
movl $0x8, %esi
callq 0x7280
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movl 0xb4(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8e70
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x8e90
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %ecx
addl $-0x2, %ecx
movl %ecx, 0xb4(%rax)
movq -0x10(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x368(%rbp)
leaq -0x209(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x74f0
movq -0x360(%rbp), %rdx
leaq 0x17623(%rip), %rsi     # 0x39d3b
leaq -0x208(%rbp), %rdi
callq 0x8940
jmp 0x22726
movq -0x368(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x2c4d0
jmp 0x2273b
leaq -0x208(%rbp), %rdi
callq 0x7170
leaq -0x209(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x26840
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2278b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x7170
leaq -0x209(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x26840
movq -0x50(%rbp), %rdi
callq 0x74e0
nopl (%rax)