// File: zerolfx[P]P-Machine/movs.cpp
// Function: Movs::execute(StackMachine*)
void Movs::execute(StackMachine *stack)
{	
	StackAddress p;
	
	if((stack->fSP < 0) || (typeid(p) != typeid(*(stack->fStore[stack->fSP]))))
		throw ExecutionError("instruction movs: highest stackposition expected to be of type address.");
		
	int newaddress = stack->fStore[stack->fSP]->getValue();

	delete stack->fStore[stack->fSP];
	stack->fStore[stack->fSP] = 0;
	stack->fStore.pop_back();
	
	if(newaddress < 0)
	{	
		// copying a block from the heapspace to the top of the stack
		// pay attention to the reverse with respect to what the book describes on p50
	
		StackInteger p1;
		StackBoolean p2;
		StackAddress p3;
		StackCharacter p4;
		StackReal p5;
		StackElement p6;
				
		for(int i = 0; i <= fQ - 1; ++i)
		{
			if(typeid(p1) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackInteger(*(dynamic_cast<StackInteger*>(stack->fHeap[i - newaddress]))));
			if(typeid(p2) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackBoolean(*(dynamic_cast<StackBoolean*>(stack->fHeap[i - newaddress]))));
			if(typeid(p3) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackAddress(*(dynamic_cast<StackAddress*>(stack->fHeap[i - newaddress]))));			
			if(typeid(p4) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackCharacter(*(dynamic_cast<StackCharacter*>(stack->fHeap[i - newaddress]))));
			if(typeid(p5) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackReal(*(dynamic_cast<StackReal*>(stack->fHeap[i - newaddress]))));
			if(typeid(p6) == typeid(*stack->fHeap[- i - newaddress - 1]))
				stack->fStore.push_back(new StackElement(*(dynamic_cast<StackElement*>(stack->fHeap[i - newaddress]))));
		}
	}
	else
	{
		// copying a block from the stackspace to the top of the stack
		// pay attention to the reverse with respect to what the book describes on p50

		StackInteger p1;
		StackBoolean p2;
		StackAddress p3;
		StackCharacter p4;
		StackReal p5;
		StackElement p6;
	
		for(int i = 0; i <= fQ - 1; ++i)
		{
			if(typeid(p1) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackInteger(*(dynamic_cast<StackInteger*>(stack->fStore[i + newaddress]))));
			if(typeid(p2) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackBoolean(*(dynamic_cast<StackBoolean*>(stack->fStore[i + newaddress]))));
			if(typeid(p3) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackAddress(*(dynamic_cast<StackAddress*>(stack->fStore[i + newaddress]))));			
			if(typeid(p4) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackCharacter(*(dynamic_cast<StackCharacter*>(stack->fStore[i + newaddress]))));
			if(typeid(p5) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackReal(*(dynamic_cast<StackReal*>(stack->fStore[i + newaddress]))));
			if(typeid(p6) == typeid(*stack->fStore[i + newaddress]))
				stack->fStore.push_back(new StackElement(*(dynamic_cast<StackElement*>(stack->fStore[i + newaddress]))));
		}
	}
	
	stack->fSP = stack->fSP + fQ - 1;
	
	// adding cost of this instruction
	stack->fTime.count("movs");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x26800
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
jl 0x1a408
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x1b0(%rbp)
cmpq $0x0, %rax
jne 0x1a3e5
callq 0x7300
jmp 0x1a3e5
movq -0x1b0(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x3055e(%rip), %rdi     # 0x4a958
callq 0x9370
testb $0x1, %al
jne 0x1a408
jmp 0x1a4d1
movb $0x1, -0x52(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0x1c0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x74f0
movq -0x1b8(%rbp), %rdx
leaq 0x1ebee(%rip), %rsi     # 0x39029
leaq -0x50(%rbp), %rdi
callq 0x8940
jmp 0x1a446
movq -0x1c0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x283d0
jmp 0x1a458
movq -0x1c0(%rbp), %rdi
movb $0x0, -0x52(%rbp)
leaq 0x2f616(%rip), %rsi     # 0x49a80
leaq 0xdf8f(%rip), %rdx      # 0x28400
callq 0x74a0
jmp 0x1b580
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b56e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1a4af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7170
leaq -0x51(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x52(%rbp)
jne 0x1a4c0
jmp 0x1a4cc
movq -0x1c0(%rbp), %rdi
callq 0x71c0
jmp 0x1b56e
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0x1c4(%rbp)
jmp 0x1a4fc
movl -0x1c4(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x1d0(%rbp)
cmpq $0x0, %rax
je 0x1a54a
movq -0x1d0(%rbp), %rdi
callq 0x26ca0
movq -0x1d0(%rbp), %rdi
movl $0x8, %esi
callq 0x7280
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x8e90
cmpl $0x0, -0x58(%rbp)
jge 0x1ad16
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x27340
jmp 0x1a58d
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x27d20
jmp 0x1a59a
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
callq 0x26800
jmp 0x1a5aa
leaq -0x98(%rbp), %rdi
movl $0x61, %esi
callq 0x28170
jmp 0x1a5bd
leaq -0xa8(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x27840
jmp 0x1a5ce
leaq -0xb0(%rbp), %rdi
callq 0x26c80
jmp 0x1a5dc
movl $0x0, -0xb4(%rbp)
movq -0x1a8(%rbp), %rcx
movl -0xb4(%rbp), %eax
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0x1ac94
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x1d8(%rbp)
cmpq $0x0, %rax
jne 0x1a636
callq 0x7300
jmp 0x1a636
movq -0x1d8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x304a5(%rip), %rdi     # 0x4aaf0
callq 0x93a0
testb $0x1, %al
jne 0x1a659
jmp 0x1a784
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x1e8(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x1e0(%rbp)
jmp 0x1a67b
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
cmpq $0x0, %rax
je 0x1a741
movq -0x1f0(%rbp), %rdi
leaq 0x30372(%rip), %rsi     # 0x4aa28
leaq 0x30433(%rip), %rdx     # 0x4aaf0
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x1f8(%rbp)
jmp 0x1a74c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1ad08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1acff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1acf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1ace7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1acdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x26ca0
jmp 0x1acdb
xorl %eax, %eax
movq %rax, -0x1f8(%rbp)
jmp 0x1a74c
movq -0x1e0(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
callq 0xd2d0
movq -0x1e0(%rbp), %rax
movq -0x1e8(%rbp), %rdi
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0xd2a0
jmp 0x1a782
jmp 0x1a784
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x200(%rbp)
cmpq $0x0, %rax
jne 0x1a7b9
callq 0x7300
jmp 0x1a7b9
movq -0x200(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x304c2(%rip), %rdi     # 0x4ac90
callq 0x93a0
testb $0x1, %al
jne 0x1a7dc
jmp 0x1a891
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x210(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x208(%rbp)
jmp 0x1a7fe
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x218(%rbp)
cmpq $0x0, %rax
je 0x1a84e
movq -0x218(%rbp), %rdi
leaq 0x301f3(%rip), %rsi     # 0x4aa28
leaq 0x30454(%rip), %rdx     # 0x4ac90
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x220(%rbp)
jmp 0x1a859
xorl %eax, %eax
movq %rax, -0x220(%rbp)
jmp 0x1a859
movq -0x208(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0xd370
movq -0x208(%rbp), %rax
movq -0x210(%rbp), %rdi
movq %rax, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0xd2a0
jmp 0x1a88f
jmp 0x1a891
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x228(%rbp)
cmpq $0x0, %rax
jne 0x1a8c6
callq 0x7300
jmp 0x1a8c6
movq -0x228(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x3007d(%rip), %rdi     # 0x4a958
callq 0x93a0
testb $0x1, %al
jne 0x1a8e9
jmp 0x1a99e
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x238(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x230(%rbp)
jmp 0x1a90b
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x240(%rbp)
cmpq $0x0, %rax
je 0x1a95b
movq -0x240(%rbp), %rdi
leaq 0x300e6(%rip), %rsi     # 0x4aa28
leaq 0x3000f(%rip), %rdx     # 0x4a958
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x248(%rbp)
jmp 0x1a966
xorl %eax, %eax
movq %rax, -0x248(%rbp)
jmp 0x1a966
movq -0x230(%rbp), %rdi
movq -0x248(%rbp), %rsi
callq 0xd410
movq -0x230(%rbp), %rax
movq -0x238(%rbp), %rdi
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0xd2a0
jmp 0x1a99c
jmp 0x1a99e
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x250(%rbp)
cmpq $0x0, %rax
jne 0x1a9d3
callq 0x7300
jmp 0x1a9d3
movq -0x250(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x30378(%rip), %rdi     # 0x4ad60
callq 0x93a0
testb $0x1, %al
jne 0x1a9f6
jmp 0x1aaab
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x260(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x258(%rbp)
jmp 0x1aa18
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x268(%rbp)
cmpq $0x0, %rax
je 0x1aa68
movq -0x268(%rbp), %rdi
leaq 0x2ffd9(%rip), %rsi     # 0x4aa28
leaq 0x3030a(%rip), %rdx     # 0x4ad60
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x270(%rbp)
jmp 0x1aa73
xorl %eax, %eax
movq %rax, -0x270(%rbp)
jmp 0x1aa73
movq -0x258(%rbp), %rdi
movq -0x270(%rbp), %rsi
callq 0xd3c0
movq -0x258(%rbp), %rax
movq -0x260(%rbp), %rdi
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0xd2a0
jmp 0x1aaa9
jmp 0x1aaab
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x278(%rbp)
cmpq $0x0, %rax
jne 0x1aae0
callq 0x7300
jmp 0x1aae0
movq -0x278(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x300cb(%rip), %rdi     # 0x4abc0
callq 0x93a0
testb $0x1, %al
jne 0x1ab03
jmp 0x1abb8
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x288(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x280(%rbp)
jmp 0x1ab25
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x290(%rbp)
cmpq $0x0, %rax
je 0x1ab75
movq -0x290(%rbp), %rdi
leaq 0x2fecc(%rip), %rsi     # 0x4aa28
leaq 0x3005d(%rip), %rdx     # 0x4abc0
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x298(%rbp)
jmp 0x1ab80
xorl %eax, %eax
movq %rax, -0x298(%rbp)
jmp 0x1ab80
movq -0x280(%rbp), %rdi
movq -0x298(%rbp), %rsi
callq 0xd320
movq -0x280(%rbp), %rax
movq -0x288(%rbp), %rdi
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rsi
callq 0xd2a0
jmp 0x1abb6
jmp 0x1abb8
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
subl -0xb4(%rbp), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2a0(%rbp)
cmpq $0x0, %rax
jne 0x1abed
callq 0x7300
jmp 0x1abed
movq -0x2a0(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2fe26(%rip), %rdi     # 0x4aa28
callq 0x93a0
testb $0x1, %al
jne 0x1ac0d
jmp 0x1ac7e
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2b0(%rbp)
movl $0x8, %edi
callq 0x7270
movq %rax, -0x2a8(%rbp)
jmp 0x1ac2f
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movl -0xb4(%rbp), %eax
movl -0x58(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rsi
callq 0x8e70
movq -0x2a8(%rbp), %rdi
movq (%rax), %rsi
callq 0xd460
movq -0x2a8(%rbp), %rax
movq -0x2b0(%rbp), %rdi
movq %rax, -0xe8(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0xd2a0
jmp 0x1ac7c
jmp 0x1ac7e
jmp 0x1ac80
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x1a5e6
leaq -0xb0(%rbp), %rdi
callq 0x26ca0
leaq -0xa8(%rbp), %rdi
callq 0x27880
leaq -0x98(%rbp), %rdi
callq 0x281b0
leaq -0x88(%rbp), %rdi
callq 0x26840
leaq -0x78(%rbp), %rdi
callq 0x27d70
leaq -0x68(%rbp), %rdi
callq 0x27380
jmp 0x1b49d
leaq -0xa8(%rbp), %rdi
callq 0x27880
leaq -0x98(%rbp), %rdi
callq 0x281b0
leaq -0x88(%rbp), %rdi
callq 0x26840
leaq -0x78(%rbp), %rdi
callq 0x27d70
leaq -0x68(%rbp), %rdi
callq 0x27380
jmp 0x1b56e
leaq -0xf8(%rbp), %rdi
xorl %esi, %esi
callq 0x27340
jmp 0x1ad26
leaq -0x108(%rbp), %rdi
xorl %esi, %esi
callq 0x27d20
jmp 0x1ad36
leaq -0x118(%rbp), %rdi
xorl %esi, %esi
callq 0x26800
jmp 0x1ad46
leaq -0x128(%rbp), %rdi
movl $0x61, %esi
callq 0x28170
jmp 0x1ad59
leaq -0x138(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x27840
jmp 0x1ad6a
leaq -0x140(%rbp), %rdi
callq 0x26c80
jmp 0x1ad78
movl $0x0, -0x144(%rbp)
movq -0x1a8(%rbp), %rcx
movl -0x144(%rbp), %eax
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0x1b412
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2b8(%rbp)
cmpq $0x0, %rax
jne 0x1adcd
callq 0x7300
jmp 0x1adcd
movq -0x2b8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2fd0e(%rip), %rdi     # 0x4aaf0
callq 0x93a0
testb $0x1, %al
jne 0x1adf0
jmp 0x1af1b
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2c8(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x2c0(%rbp)
jmp 0x1ae12
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0x1aed8
movq -0x2d0(%rbp), %rdi
leaq 0x2fbdb(%rip), %rsi     # 0x4aa28
leaq 0x2fc9c(%rip), %rdx     # 0x4aaf0
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x2d8(%rbp)
jmp 0x1aee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b48c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b480
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b474
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b468
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b45c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x26ca0
jmp 0x1b45c
xorl %eax, %eax
movq %rax, -0x2d8(%rbp)
jmp 0x1aee3
movq -0x2c0(%rbp), %rdi
movq -0x2d8(%rbp), %rsi
callq 0xd2d0
movq -0x2c0(%rbp), %rax
movq -0x2c8(%rbp), %rdi
movq %rax, -0x150(%rbp)
leaq -0x150(%rbp), %rsi
callq 0xd2a0
jmp 0x1af19
jmp 0x1af1b
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2e0(%rbp)
cmpq $0x0, %rax
jne 0x1af4b
callq 0x7300
jmp 0x1af4b
movq -0x2e0(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2fd30(%rip), %rdi     # 0x4ac90
callq 0x93a0
testb $0x1, %al
jne 0x1af6e
jmp 0x1b023
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2f0(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x2e8(%rbp)
jmp 0x1af90
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x2f8(%rbp)
cmpq $0x0, %rax
je 0x1afe0
movq -0x2f8(%rbp), %rdi
leaq 0x2fa61(%rip), %rsi     # 0x4aa28
leaq 0x2fcc2(%rip), %rdx     # 0x4ac90
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x300(%rbp)
jmp 0x1afeb
xorl %eax, %eax
movq %rax, -0x300(%rbp)
jmp 0x1afeb
movq -0x2e8(%rbp), %rdi
movq -0x300(%rbp), %rsi
callq 0xd370
movq -0x2e8(%rbp), %rax
movq -0x2f0(%rbp), %rdi
movq %rax, -0x158(%rbp)
leaq -0x158(%rbp), %rsi
callq 0xd2a0
jmp 0x1b021
jmp 0x1b023
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x308(%rbp)
cmpq $0x0, %rax
jne 0x1b053
callq 0x7300
jmp 0x1b053
movq -0x308(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2f8f0(%rip), %rdi     # 0x4a958
callq 0x93a0
testb $0x1, %al
jne 0x1b076
jmp 0x1b12b
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x318(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x310(%rbp)
jmp 0x1b098
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x320(%rbp)
cmpq $0x0, %rax
je 0x1b0e8
movq -0x320(%rbp), %rdi
leaq 0x2f959(%rip), %rsi     # 0x4aa28
leaq 0x2f882(%rip), %rdx     # 0x4a958
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x328(%rbp)
jmp 0x1b0f3
xorl %eax, %eax
movq %rax, -0x328(%rbp)
jmp 0x1b0f3
movq -0x310(%rbp), %rdi
movq -0x328(%rbp), %rsi
callq 0xd410
movq -0x310(%rbp), %rax
movq -0x318(%rbp), %rdi
movq %rax, -0x160(%rbp)
leaq -0x160(%rbp), %rsi
callq 0xd2a0
jmp 0x1b129
jmp 0x1b12b
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x330(%rbp)
cmpq $0x0, %rax
jne 0x1b15b
callq 0x7300
jmp 0x1b15b
movq -0x330(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2fbf0(%rip), %rdi     # 0x4ad60
callq 0x93a0
testb $0x1, %al
jne 0x1b17e
jmp 0x1b233
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x340(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x338(%rbp)
jmp 0x1b1a0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x348(%rbp)
cmpq $0x0, %rax
je 0x1b1f0
movq -0x348(%rbp), %rdi
leaq 0x2f851(%rip), %rsi     # 0x4aa28
leaq 0x2fb82(%rip), %rdx     # 0x4ad60
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x350(%rbp)
jmp 0x1b1fb
xorl %eax, %eax
movq %rax, -0x350(%rbp)
jmp 0x1b1fb
movq -0x338(%rbp), %rdi
movq -0x350(%rbp), %rsi
callq 0xd3c0
movq -0x338(%rbp), %rax
movq -0x340(%rbp), %rdi
movq %rax, -0x168(%rbp)
leaq -0x168(%rbp), %rsi
callq 0xd2a0
jmp 0x1b231
jmp 0x1b233
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x358(%rbp)
cmpq $0x0, %rax
jne 0x1b263
callq 0x7300
jmp 0x1b263
movq -0x358(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2f948(%rip), %rdi     # 0x4abc0
callq 0x93a0
testb $0x1, %al
jne 0x1b286
jmp 0x1b33b
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x368(%rbp)
movl $0x10, %edi
callq 0x7270
movq %rax, -0x360(%rbp)
jmp 0x1b2a8
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x370(%rbp)
cmpq $0x0, %rax
je 0x1b2f8
movq -0x370(%rbp), %rdi
leaq 0x2f749(%rip), %rsi     # 0x4aa28
leaq 0x2f8da(%rip), %rdx     # 0x4abc0
xorl %eax, %eax
movl %eax, %ecx
callq 0x7320
movq %rax, -0x378(%rbp)
jmp 0x1b303
xorl %eax, %eax
movq %rax, -0x378(%rbp)
jmp 0x1b303
movq -0x360(%rbp), %rdi
movq -0x378(%rbp), %rsi
callq 0xd320
movq -0x360(%rbp), %rax
movq -0x368(%rbp), %rdi
movq %rax, -0x170(%rbp)
leaq -0x170(%rbp), %rsi
callq 0xd2a0
jmp 0x1b339
jmp 0x1b33b
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
addl -0x58(%rbp), %eax
movslq %eax, %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x380(%rbp)
cmpq $0x0, %rax
jne 0x1b36b
callq 0x7300
jmp 0x1b36b
movq -0x380(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x2f6a8(%rip), %rdi     # 0x4aa28
callq 0x93a0
testb $0x1, %al
jne 0x1b38b
jmp 0x1b3fc
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x390(%rbp)
movl $0x8, %edi
callq 0x7270
movq %rax, -0x388(%rbp)
jmp 0x1b3ad
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movl -0x144(%rbp), %eax
movl -0x58(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x8e70
movq -0x388(%rbp), %rdi
movq (%rax), %rsi
callq 0xd460
movq -0x388(%rbp), %rax
movq -0x390(%rbp), %rdi
movq %rax, -0x178(%rbp)
leaq -0x178(%rbp), %rsi
callq 0xd2a0
jmp 0x1b3fa
jmp 0x1b3fc
jmp 0x1b3fe
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x1ad82
leaq -0x140(%rbp), %rdi
callq 0x26ca0
leaq -0x138(%rbp), %rdi
callq 0x27880
leaq -0x128(%rbp), %rdi
callq 0x281b0
leaq -0x118(%rbp), %rdi
callq 0x26840
leaq -0x108(%rbp), %rdi
callq 0x27d70
leaq -0xf8(%rbp), %rdi
callq 0x27380
jmp 0x1b49d
leaq -0x138(%rbp), %rdi
callq 0x27880
leaq -0x128(%rbp), %rdi
callq 0x281b0
leaq -0x118(%rbp), %rdi
callq 0x26840
leaq -0x108(%rbp), %rdi
callq 0x27d70
leaq -0xf8(%rbp), %rdi
callq 0x27380
jmp 0x1b56e
movq -0x1a8(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %esi
movl 0x8(%rcx), %ecx
movl %ecx, %edx
movl %esi, %ecx
leal -0x1(%rcx,%rdx), %ecx
movl %ecx, 0xb4(%rax)
movq -0x10(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x3a0(%rbp)
leaq -0x199(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x74f0
movq -0x398(%rbp), %rdx
leaq 0x1db82(%rip), %rsi     # 0x39071
leaq -0x198(%rbp), %rdi
callq 0x8940
jmp 0x1b4fd
movq -0x3a0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x2c4d0
jmp 0x1b512
leaq -0x198(%rbp), %rdi
callq 0x7170
leaq -0x199(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x26840
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1b562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x7170
leaq -0x199(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x26840
movq -0x28(%rbp), %rdi
callq 0x74e0