// File: CMU-SAFARI[P]Register-Interval/main.cpp
// Function: split_abstract_basic_blocks(std::vector<basicBlock*, std::allocator<basicBlock*>>)
vector<basicBlock*> split_abstract_basic_blocks(vector<basicBlock*> ABBs){
	basicBlock *temp, *temp2;
	vector<basicBlock*> controling_basicBlocks;
	string q = "Controling_basicBlock";
	int p = 0;
        
        vector<basicBlock*> basic_blocks;

	//**********************Splitting Codes and Constructing new BBs***********************
	string str, str2;
	int found1 = 0;
	int found2 = 0;
	int foundtemp = 0;
	int foundExit = 0;
	for(int i = 0; i < ABBs.size(); i++){
		str = ABBs[i]->get_code();
		char tt = 'A';
		found1 = 0;
		found2 = str.find("<exit", found1);
		
		while(found2 != string::npos){
			str2.clear();
			for(int j = found1; j < found2; j++){
				str2 = str2 + str[j];
			}

			foundExit = str2.find("EXIT", 0);
			foundtemp = str2.find(";", 0);

			if(foundExit == string::npos){
				if(str2.find(";", foundtemp + 1) == string::npos && str2.find("@P0", 0) != string::npos){
					temp2 = new basicBlock();
					temp2->set_code(str2);
					temp2->set_name(q + std::to_string(p));
					p++;
					temp2->set_controling();
					controling_basicBlocks.push_back(temp2);

					temp->set_control_basicBlock(temp2);
				}
				else{
					temp = new basicBlock(ABBs[i]->getID());
					temp->set_code(str2);
					if(found1 == 0)
						temp->set_name(ABBs[i]->get_name());
					else{
						temp->set_name(ABBs[i]->get_name()+tt);
						tt++;
					}
					basic_blocks.push_back(temp);
				}
			}

			found1 = found2+1;
			found2 = str.find("<exit", found1);
		}

		str2.clear();
		for(int j = found1; j < str.size(); j++){
			str2 = str2 + str[j];
		}

		foundExit = str2.find("EXIT", 0);
		foundtemp = str2.find(";", 0);
		if(foundExit == string::npos){
			if(str2.find(";", foundtemp + 1) == string::npos && str2.find("@P0", 0) != string::npos){
				temp2 = new basicBlock();
				temp2->set_code(str2);
				temp2->set_name(q + std::to_string(p));
				p++;
				temp2->set_controling();
				controling_basicBlocks.push_back(temp2);

				temp->set_control_basicBlock(temp2);
			}
			else{
				temp = new basicBlock(ABBs[i]->getID());
				temp->set_code(str2);
				if(found1 == 0)
					temp->set_name(ABBs[i]->get_name());
				else{
					temp->set_name(ABBs[i]->get_name()+tt);
					tt++;
				}
				basic_blocks.push_back(temp);
			}
		}
	}
	//***********************************************************************************

	//*********************Setting Predecessors and Successors***************************
	vector<basicBlock*> P, S;
	bool isNextBB;
	int firstID;
	int lastID;
	string name;
	for(int i = 0; i < ABBs.size(); i++){
		P = ABBs[i]->get_predecessors();
		S = ABBs[i]->get_successors();

		int count = 0;
		for(int k = 0; k < basic_blocks.size(); k++){
			if(basic_blocks[k]->get_ABB() == ABBs[i]->getID()){
				if(count == 0)
					firstID = k;
				count++;
			}
		}
		lastID = firstID + count - 1;


		for(int j = 0; j < S.size(); j++){
			if(S[j]->getID() == ABBs[i]->getID()+1){
				basic_blocks[lastID]->add_successor(basic_blocks[lastID+1]);
				basic_blocks[lastID+1]->add_predecessor(basic_blocks[lastID]);
			}
		}

		for(int j = firstID; j < lastID; j++){
			basic_blocks[j]->add_successor(basic_blocks[j+1]);
			basic_blocks[j+1]->add_predecessor(basic_blocks[j]);
		}

		for(int j = firstID; j <= lastID; j++){
			if(basic_blocks[j]->get_controling_basicBlock() != nullptr){
				str = (basic_blocks[j]->get_controling_basicBlock())->get_code();
				for(int k = 0; k < basic_blocks.size(); k++){
					name = basic_blocks[k]->get_name();
					if(str.find(name, 0) != string::npos && name.size() != 0){
						basic_blocks[j]->add_successor(basic_blocks[k]);
						basic_blocks[k]->add_predecessor(basic_blocks[j]);
					}
				}
			}
		}
	}
        
        return basic_blocks;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rsi, -0x418(%rbp)
movq %rdi, -0x410(%rbp)
movq %rdi, %rax
movq %rax, -0x408(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xbdb0
leaq -0x59(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x3450
movq -0x400(%rbp), %rdx
leaq 0xdbd1(%rip), %rsi      # 0x18023
leaq -0x58(%rbp), %rdi
callq 0x3340
jmp 0xa45d
leaq -0x59(%rbp), %rdi
callq 0x32a0
movq -0x410(%rbp), %rdi
movl $0x0, -0x70(%rbp)
movb $0x0, -0x71(%rbp)
callq 0xbdb0
leaq -0x98(%rbp), %rdi
callq 0x3360
leaq -0xb8(%rbp), %rdi
callq 0x3360
movl $0x0, -0xbc(%rbp)
movl $0x0, -0xc0(%rbp)
movl $0x0, -0xc4(%rbp)
movl $0x0, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
movq -0x418(%rbp), %rdi
movslq -0xcc(%rbp), %rax
movq %rax, -0x420(%rbp)
callq 0xbe80
movq %rax, %rcx
movq -0x420(%rbp), %rax
cmpq %rcx, %rax
jae 0xaf70
movq -0x418(%rbp), %rdi
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x4360
jmp 0xa518
leaq -0x98(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x32c0
leaq -0xf0(%rbp), %rdi
callq 0x31a0
movb $0x41, -0xf1(%rbp)
movl $0x0, -0xbc(%rbp)
movslq -0xbc(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq 0xdadc(%rip), %rsi      # 0x18039
callq 0x3490
movl %eax, -0xc0(%rbp)
movslq -0xc0(%rbp), %rax
cmpq $-0x1, %rax
je 0xaa8c
leaq -0xb8(%rbp), %rdi
callq 0x3300
movl -0xbc(%rbp), %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jge 0xa639
movslq -0xf8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x34a0
movq %rax, -0x428(%rbp)
jmp 0xa5bf
movq -0x428(%rbp), %rax
movsbl (%rax), %edx
leaq -0x118(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xccd0
jmp 0xa5de
leaq -0xb8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x32c0
leaq -0x118(%rbp), %rdi
callq 0x31a0
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0xa591
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x32a0
jmp 0xb5f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xb59c
leaq -0xb8(%rbp), %rdi
leaq 0xd9f8(%rip), %rsi      # 0x1803f
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
movl %eax, -0xc8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq 0xdaad(%rip), %rsi      # 0x18111
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
movl %eax, -0xc4(%rbp)
movslq -0xc8(%rbp), %rax
cmpq $-0x1, %rax
jne 0xaa58
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
leaq -0xb8(%rbp), %rdi
leaq 0xda73(%rip), %rsi      # 0x18111
callq 0x3490
cmpq $-0x1, %rax
jne 0xa840
leaq -0xb8(%rbp), %rdi
leaq 0xd989(%rip), %rsi      # 0x18044
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
cmpq $-0x1, %rax
je 0xa840
movl $0xf8, %edi
callq 0x3250
movq %rax, -0x430(%rbp)
jmp 0xa6e1
movq -0x430(%rbp), %rdi
callq 0x3d10
jmp 0xa6ef
movq -0x430(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x438(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3110
jmp 0xa71a
movq -0x438(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x4020
jmp 0xa72f
leaq -0x138(%rbp), %rdi
callq 0x31a0
movq -0x20(%rbp), %rax
movq %rax, -0x440(%rbp)
movl -0x70(%rbp), %esi
leaq -0x178(%rbp), %rdi
callq 0xcbb0
jmp 0xa757
leaq -0x158(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0xc8e0
jmp 0xa770
movq -0x440(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3ff0
jmp 0xa785
leaq -0x158(%rbp), %rdi
callq 0x31a0
leaq -0x178(%rbp), %rdi
callq 0x31a0
movl -0x70(%rbp), %eax
incl %eax
movl %eax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x45e0
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xbec0
jmp 0xa7bd
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4620
jmp 0xaa56
movq -0x430(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x3230
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xa82f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x31a0
leaq -0x178(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movl $0xf8, %edi
callq 0x3250
movq %rax, -0x448(%rbp)
jmp 0xa853
movq -0x418(%rbp), %rdi
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4350
movq -0x448(%rbp), %rdi
movl %eax, %esi
callq 0x3f40
jmp 0xa87e
movq -0x448(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x450(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3110
jmp 0xa8a9
movq -0x450(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4020
jmp 0xa8be
leaq -0x198(%rbp), %rdi
callq 0x31a0
cmpl $0x0, -0xbc(%rbp)
jne 0xa983
movq -0x418(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x458(%rbp)
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x4320
jmp 0xa906
movq -0x458(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x3ff0
jmp 0xa91b
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
jmp 0xaa42
movq -0x448(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x3230
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq -0x418(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x460(%rbp)
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x4320
jmp 0xa9b2
movsbl -0xf1(%rbp), %edx
leaq -0x1d8(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0xcf50
jmp 0xa9ce
movq -0x460(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x3ff0
jmp 0xa9e3
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
movb -0xf1(%rbp), %al
addb $0x1, %al
movb %al, -0xf1(%rbp)
jmp 0xaa42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xaa31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq -0x410(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xbec0
jmp 0xaa54
jmp 0xaa56
jmp 0xaa58
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
movslq -0xbc(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq 0xd5bd(%rip), %rsi      # 0x18039
callq 0x3490
movl %eax, -0xc0(%rbp)
jmp 0xa568
leaq -0xb8(%rbp), %rdi
callq 0x3300
movl -0xbc(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movslq -0x1fc(%rbp), %rax
movq %rax, -0x468(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x31c0
movq %rax, %rcx
movq -0x468(%rbp), %rax
cmpq %rcx, %rax
jae 0xab3b
movslq -0x1fc(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x34a0
movq %rax, -0x470(%rbp)
jmp 0xaae9
movq -0x470(%rbp), %rax
movsbl (%rax), %edx
leaq -0x220(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xccd0
jmp 0xab08
leaq -0xb8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x32c0
leaq -0x220(%rbp), %rdi
callq 0x31a0
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
jmp 0xaaa4
leaq -0xb8(%rbp), %rdi
leaq 0xd4f6(%rip), %rsi      # 0x1803f
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
movl %eax, -0xc8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq 0xd5ab(%rip), %rsi      # 0x18111
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
movl %eax, -0xc4(%rbp)
movslq -0xc8(%rbp), %rax
cmpq $-0x1, %rax
jne 0xaf5a
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
leaq -0xb8(%rbp), %rdi
leaq 0xd571(%rip), %rsi      # 0x18111
callq 0x3490
cmpq $-0x1, %rax
jne 0xad42
leaq -0xb8(%rbp), %rdi
leaq 0xd487(%rip), %rsi      # 0x18044
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
cmpq $-0x1, %rax
je 0xad42
movl $0xf8, %edi
callq 0x3250
movq %rax, -0x478(%rbp)
jmp 0xabe3
movq -0x478(%rbp), %rdi
callq 0x3d10
jmp 0xabf1
movq -0x478(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x480(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3110
jmp 0xac1c
movq -0x480(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x4020
jmp 0xac31
leaq -0x240(%rbp), %rdi
callq 0x31a0
movq -0x20(%rbp), %rax
movq %rax, -0x488(%rbp)
movl -0x70(%rbp), %esi
leaq -0x280(%rbp), %rdi
callq 0xcbb0
jmp 0xac59
leaq -0x260(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x280(%rbp), %rdx
callq 0xc8e0
jmp 0xac72
movq -0x488(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x3ff0
jmp 0xac87
leaq -0x260(%rbp), %rdi
callq 0x31a0
leaq -0x280(%rbp), %rdi
callq 0x31a0
movl -0x70(%rbp), %eax
incl %eax
movl %eax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x45e0
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xbec0
jmp 0xacbf
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4620
jmp 0xaf58
movq -0x478(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x3230
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xad31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x31a0
leaq -0x280(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movl $0xf8, %edi
callq 0x3250
movq %rax, -0x490(%rbp)
jmp 0xad55
movq -0x418(%rbp), %rdi
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4350
movq -0x490(%rbp), %rdi
movl %eax, %esi
callq 0x3f40
jmp 0xad80
movq -0x490(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x498(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3110
jmp 0xadab
movq -0x498(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x4020
jmp 0xadc0
leaq -0x2a0(%rbp), %rdi
callq 0x31a0
cmpl $0x0, -0xbc(%rbp)
jne 0xae85
movq -0x418(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x4a0(%rbp)
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x4320
jmp 0xae08
movq -0x4a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x3ff0
jmp 0xae1d
leaq -0x2c0(%rbp), %rdi
callq 0x31a0
jmp 0xaf44
movq -0x490(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
callq 0x3230
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq -0x418(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x4a8(%rbp)
movslq -0xcc(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x300(%rbp), %rdi
callq 0x4320
jmp 0xaeb4
movsbl -0xf1(%rbp), %edx
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0xcf50
jmp 0xaed0
movq -0x4a8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x3ff0
jmp 0xaee5
leaq -0x2e0(%rbp), %rdi
callq 0x31a0
leaq -0x300(%rbp), %rdi
callq 0x31a0
movb -0xf1(%rbp), %al
addb $0x1, %al
movb %al, -0xf1(%rbp)
jmp 0xaf44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xaf33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x31a0
leaq -0x300(%rbp), %rdi
callq 0x31a0
jmp 0xb59c
movq -0x410(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xbec0
jmp 0xaf56
jmp 0xaf58
jmp 0xaf5a
jmp 0xaf5c
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0xa4c7
leaq -0x318(%rbp), %rdi
callq 0xbdb0
leaq -0x330(%rbp), %rdi
callq 0xbdb0
leaq -0x360(%rbp), %rdi
callq 0x3360
movl $0x0, -0x364(%rbp)
movq -0x418(%rbp), %rdi
movslq -0x364(%rbp), %rax
movq %rax, -0x4b0(%rbp)
callq 0xbe80
movq %rax, %rcx
movq -0x4b0(%rbp), %rax
cmpq %rcx, %rax
jae 0xb554
movq -0x418(%rbp), %rdi
movslq -0x364(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x380(%rbp), %rdi
callq 0x44a0
jmp 0xafef
leaq -0x318(%rbp), %rdi
leaq -0x380(%rbp), %rsi
movq %rsi, -0x4b8(%rbp)
callq 0xcf20
movq -0x4b8(%rbp), %rdi
callq 0xbdd0
movq -0x418(%rbp), %rdi
movslq -0x364(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x398(%rbp), %rdi
callq 0x44d0
jmp 0xb039
leaq -0x330(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0xcf20
leaq -0x398(%rbp), %rdi
callq 0xbdd0
movl $0x0, -0x39c(%rbp)
movl $0x0, -0x3a0(%rbp)
movq -0x410(%rbp), %rdi
movslq -0x3a0(%rbp), %rax
movq %rax, -0x4c0(%rbp)
callq 0xbe80
movq %rax, %rcx
movq -0x4c0(%rbp), %rax
cmpq %rcx, %rax
jae 0xb152
movq -0x410(%rbp), %rdi
movslq -0x3a0(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x45c0
movq -0x418(%rbp), %rdi
movl %eax, -0x4c4(%rbp)
movslq -0x364(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4350
movl %eax, %ecx
movl -0x4c4(%rbp), %eax
cmpl %ecx, %eax
jne 0xb13c
cmpl $0x0, -0x39c(%rbp)
jne 0xb12d
movl -0x3a0(%rbp), %eax
movl %eax, -0x338(%rbp)
jmp 0xb12d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x31a0
leaq -0x330(%rbp), %rdi
callq 0xbdd0
leaq -0x318(%rbp), %rdi
callq 0xbdd0
jmp 0xb59c
movl -0x39c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x39c(%rbp)
jmp 0xb13e
movl -0x3a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3a0(%rbp)
jmp 0xb06c
movl -0x338(%rbp), %eax
addl -0x39c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x33c(%rbp)
movl $0x0, -0x3a4(%rbp)
movslq -0x3a4(%rbp), %rax
movq %rax, -0x4d0(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xbe80
movq %rax, %rcx
movq -0x4d0(%rbp), %rax
cmpq %rcx, %rax
jae 0xb28f
movslq -0x3a4(%rbp), %rsi
leaq -0x330(%rbp), %rdi
callq 0xbea0
movq (%rax), %rdi
callq 0x4350
movq -0x418(%rbp), %rdi
movl %eax, -0x4d4(%rbp)
movslq -0x364(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4350
movl %eax, %ecx
movl -0x4d4(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb279
movq -0x410(%rbp), %rdi
movslq -0x33c(%rbp), %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x4e0(%rbp)
movl -0x33c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0xbea0
movq -0x4e0(%rbp), %rdi
movq (%rax), %rsi
callq 0x41a0
jmp 0xb232
movq -0x410(%rbp), %rdi
movl -0x33c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x4e8(%rbp)
movslq -0x33c(%rbp), %rsi
callq 0xbea0
movq -0x4e8(%rbp), %rdi
movq (%rax), %rsi
callq 0x4110
jmp 0xb277
jmp 0xb279
jmp 0xb27b
movl -0x3a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3a4(%rbp)
jmp 0xb171
movl -0x338(%rbp), %eax
movl %eax, -0x3a8(%rbp)
movl -0x3a8(%rbp), %eax
cmpl -0x33c(%rbp), %eax
jge 0xb34d
movq -0x410(%rbp), %rdi
movslq -0x3a8(%rbp), %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x4f0(%rbp)
movl -0x3a8(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0xbea0
movq -0x4f0(%rbp), %rdi
movq (%rax), %rsi
callq 0x41a0
jmp 0xb2f2
movq -0x410(%rbp), %rdi
movl -0x3a8(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x4f8(%rbp)
movslq -0x3a8(%rbp), %rsi
callq 0xbea0
movq -0x4f8(%rbp), %rdi
movq (%rax), %rsi
callq 0x4110
jmp 0xb337
jmp 0xb339
movl -0x3a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3a8(%rbp)
jmp 0xb29b
movl -0x338(%rbp), %eax
movl %eax, -0x3ac(%rbp)
movl -0x3ac(%rbp), %eax
cmpl -0x33c(%rbp), %eax
jg 0xb53e
movq -0x410(%rbp), %rdi
movslq -0x3ac(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4640
cmpq $0x0, %rax
je 0xb528
movq -0x410(%rbp), %rdi
movslq -0x3ac(%rbp), %rsi
callq 0xbea0
movq (%rax), %rdi
callq 0x4640
movq %rax, %rsi
leaq -0x3d0(%rbp), %rdi
callq 0x4360
jmp 0xb3bc
leaq -0x98(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x32c0
leaq -0x3d0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0x3d4(%rbp)
movq -0x410(%rbp), %rdi
movslq -0x3d4(%rbp), %rax
movq %rax, -0x500(%rbp)
callq 0xbe80
movq %rax, %rcx
movq -0x500(%rbp), %rax
cmpq %rcx, %rax
jae 0xb526
movq -0x410(%rbp), %rdi
movslq -0x3d4(%rbp), %rsi
callq 0xbea0
movq (%rax), %rsi
leaq -0x3f8(%rbp), %rdi
callq 0x4320
jmp 0xb436
leaq -0x360(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x32c0
leaq -0x3f8(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
leaq -0x360(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x34b0
cmpq $-0x1, %rax
je 0xb510
leaq -0x360(%rbp), %rdi
callq 0x31c0
cmpq $0x0, %rax
je 0xb510
movq -0x410(%rbp), %rdi
movslq -0x3ac(%rbp), %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x508(%rbp)
movslq -0x3d4(%rbp), %rsi
callq 0xbea0
movq -0x508(%rbp), %rdi
movq (%rax), %rsi
callq 0x41a0
jmp 0xb4cd
movq -0x410(%rbp), %rdi
movslq -0x3d4(%rbp), %rsi
callq 0xbea0
movq -0x410(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x510(%rbp)
movslq -0x3ac(%rbp), %rsi
callq 0xbea0
movq -0x510(%rbp), %rdi
movq (%rax), %rsi
callq 0x4110
jmp 0xb50e
jmp 0xb510
jmp 0xb512
movl -0x3d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d4(%rbp)
jmp 0xb3e5
jmp 0xb528
jmp 0xb52a
movl -0x3ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ac(%rbp)
jmp 0xb359
jmp 0xb540
movl -0x364(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x364(%rbp)
jmp 0xaf9e
movb $0x1, -0x71(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x31a0
leaq -0x330(%rbp), %rdi
callq 0xbdd0
leaq -0x318(%rbp), %rdi
callq 0xbdd0
leaq -0xb8(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x71(%rbp)
jne 0xb5d7
jmp 0xb5cb
leaq -0xb8(%rbp), %rdi
callq 0x31a0
leaq -0x98(%rbp), %rdi
callq 0x31a0
movq -0x410(%rbp), %rdi
callq 0xbdd0
leaq -0x58(%rbp), %rdi
callq 0x31a0
jmp 0xb5f9
movq -0x410(%rbp), %rdi
callq 0xbdd0
leaq -0x58(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0xbdd0
movq -0x408(%rbp), %rax
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0xbdd0
movq -0x68(%rbp), %rdi
callq 0x3440
nopl (%rax,%rax)