// File: SNUCSE-CTA[P]GI/src/graph.cpp
// Function: Graph::readGraph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Graph::readGraph(string aFileName) //recommend to use after checkFormat() passed
{
	#ifdef DEBUG
	cout << __PRETTY_FUNCTION__ << endl;
	#endif

	clear(); // avoid double allocation

	ifstream infile(aFileName);

	streampos edgePos = infile.tellg();
	char tag;
	int32_t vid, vlabel, left, right, elabel, gid;
	string line;
	numNode = -1;
	numEdge = 0;

	//first read: read vertices and count degree for each vertex
	while( infile >> tag ) {
		if( tag == 't' ) {
			infile >> gid >> numNode;

			//allocate memory for vertices
			od = new int32_t[numNode];
			d = new int32_t[numNode];
			l = new int32_t[numNode];
			one = new char[numNode];
		}
		else if( tag == 'v' ) {
			infile >> vid >> vlabel;

			d[vid] = 0;
			l[vid] = vlabel;
			one[vid] = 0;

			edgePos = infile.tellg(); //record the last line that tag 'v' appears.
		}
		else if( tag == 'e' ) {
			infile >> left >> right >> elabel;

			if (left == right) {
				cerr << "Error: loops are not allowed." << endl;
				errfile = true;
				infile.close();
				return;
			}

			++(d[left]);
			++(d[right]);
			++numEdge;
		}
	}

	//allocate memory for edges
	e = new int32_t*[numNode];
	for(vid = 0; vid < numNode; ++vid) {
		e[vid] = new int32_t[ d[vid] ];
		d[vid] = 0; //we will use it as index in the second read.
	}

	//second read: read edges
	infile.clear();
	infile.seekg(edgePos);

	while( infile >> tag ) {
		if( tag == 'e' ) { //always true after checkFormat()
			infile >> left >> right >> elabel;
			e[left][ d[left] ] = right;
			e[right][ d[right] ] = left;
			++(d[left]);
			++(d[right]);
		}
	}

	//store original degree (since prepCoreOne changes d)
	for(vid = 0; vid < numNode; ++vid)
		od[vid] = d[vid];

	// Make sure there are no parallel edges.
	int32_t* s = cont.global_memory.getLLArray(numNode);
	int32_t s_top = -1;

	int32_t* adj = cont.global_memory.getLLArray(numNode);
	memset(adj, 0, sizeof(int32_t) * numNode);

	// For each node u in the graph,
	for (int32_t u = 0; u < numNode && !errfile; ++u) {
		// and for each neighbor v of u,
		for (int32_t i = 0; i < d[u] && !errfile; ++i) {
			int32_t v = e[u][i];

			// mark v as adjacent.
			// If v was already marked as adjacent, then there exists a parallel edge.
			if (!adj[v]) {
				adj[v] = 1;

				++s_top;
				s[s_top] = v;
			} else {
				errfile = true;
			}
		}

		// Clean marks for the next iteration.
		while (!(s_top < 0)) {
			int32_t v = s[s_top];
			--s_top;

			adj[v] = 0;
		}
	}

	cont.global_memory.returnLLArray(adj, numNode);
	cont.global_memory.returnLLArray(s, numNode);

	if (errfile) {
		cerr << "Error: no parallel edges are allowed." << endl;
		infile.close();
		return;
	}

	// Make sure the graph is connected
	int32_t* q = cont.global_memory.getLLArray(numNode);
	int32_t q_front = 0;
	int32_t q_rear = -1;

	int32_t* pushed = cont.global_memory.getLLArray(numNode);
	memset(pushed, 0, sizeof(int32_t) * numNode);

	// Perform a BFS on the graph, starting from vertex 0.
	// Enqueue vertex 0.
	++q_rear;
	q[q_rear] = 0;
	pushed[0] = true;
	while (!(q_front > q_rear)) {
		// Pop a vertex from the queue, and call it u.
		int32_t u = q[q_front];
		++q_front;

		// For each neighbor v of u (the current vertex),
		for (int i = 0; i < d[u]; ++i) {
			int32_t v = e[u][i];

			// if v is not visited, mark v as visited and enqueue v.
			if (!pushed[v]) {
				++q_rear;
				q[q_rear] = v;
				pushed[v] = true;
			}
		}
	}

	// If any vertex is not visited, then the graph is not connected.
	for (int32_t u = 0; u < numNode && !errfile; ++u) {
		if (!pushed[u]) {
			errfile = true;
		}
	}

	cont.global_memory.returnLLArray(q, numNode);
	cont.global_memory.returnLLArray(pushed, numNode);

	if (errfile) {
		cerr << "Error: the graph is not connected." << endl;
		infile.close();
		return;
	}

	//calculate the start position of edge list for each vertex
	adjPos = new int32_t[numNode];
	adjPos[0] = 0;
	for(vid = 1; vid < numNode; ++vid)
		adjPos[vid] = adjPos[vid - 1] + d[vid - 1];

	infile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rsi, -0x310(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x6540
movq -0x310(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x308(%rbp)
movl $0x8, %edx
callq 0x3300
movq -0x308(%rbp), %rdi
callq 0x3360
movq %rdx, -0x300(%rbp)
movq %rax, -0x2f8(%rbp)
jmp 0x5835
movq -0x300(%rbp), %rax
movq -0x2f8(%rbp), %rcx
movq %rcx, -0x228(%rbp)
movq %rax, -0x220(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x32a0
movq -0x318(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movl $0x0, 0x10(%rax)
leaq -0x218(%rbp), %rdi
leaq -0x235(%rbp), %rsi
callq 0x3290
movq %rax, -0x320(%rbp)
jmp 0x588e
movq -0x320(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3250
movb %al, -0x321(%rbp)
jmp 0x58ac
movb -0x321(%rbp), %al
testb $0x1, %al
jne 0x58bb
jmp 0x5bf3
movsbl -0x235(%rbp), %eax
cmpl $0x74, %eax
jne 0x5a18
leaq -0x218(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x3130
movq %rax, -0x330(%rbp)
jmp 0x58e7
movq -0x330(%rbp), %rdi
movq -0x318(%rbp), %rsi
addq $0xc, %rsi
callq 0x3130
jmp 0x5900
movq -0x318(%rbp), %rax
movslq 0xc(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x338(%rbp)
jmp 0x592f
movq -0x318(%rbp), %rax
movq -0x338(%rbp), %rcx
movq %rcx, 0x18(%rax)
movslq 0xc(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x340(%rbp)
jmp 0x5969
movq -0x318(%rbp), %rax
movq -0x340(%rbp), %rcx
movq %rcx, 0x20(%rax)
movslq 0xc(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x348(%rbp)
jmp 0x59a3
movq -0x318(%rbp), %rax
movq -0x348(%rbp), %rcx
movq %rcx, 0x28(%rax)
movslq 0xc(%rax), %rdi
callq 0x3040
movq %rax, -0x350(%rbp)
jmp 0x59c7
movq -0x318(%rbp), %rax
movq -0x350(%rbp), %rcx
movq %rcx, 0x30(%rax)
jmp 0x5bee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x64eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x3140
jmp 0x64eb
movsbl -0x235(%rbp), %eax
cmpl $0x76, %eax
jne 0x5aee
leaq -0x218(%rbp), %rdi
leaq -0x23c(%rbp), %rsi
callq 0x3130
movq %rax, -0x358(%rbp)
jmp 0x5a44
movq -0x358(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3130
jmp 0x5a59
movq -0x318(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x23c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
movl -0x240(%rbp), %esi
movq 0x28(%rax), %rcx
movslq -0x23c(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rax
movslq -0x23c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
leaq -0x218(%rbp), %rdi
callq 0x3360
movq %rdx, -0x368(%rbp)
movq %rax, -0x360(%rbp)
jmp 0x5ab1
movq -0x368(%rbp), %rax
movq -0x360(%rbp), %rcx
movq %rcx, -0x280(%rbp)
movq %rax, -0x278(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x278(%rbp), %rax
movq %rax, -0x220(%rbp)
jmp 0x5bec
movsbl -0x235(%rbp), %eax
cmpl $0x65, %eax
jne 0x5bea
leaq -0x218(%rbp), %rdi
leaq -0x244(%rbp), %rsi
callq 0x3130
movq %rax, -0x370(%rbp)
jmp 0x5b1a
movq -0x370(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x3130
movq %rax, -0x378(%rbp)
jmp 0x5b36
movq -0x378(%rbp), %rdi
leaq -0x24c(%rbp), %rsi
callq 0x3130
jmp 0x5b4b
movl -0x244(%rbp), %eax
cmpl -0x248(%rbp), %eax
jne 0x5bb2
movq 0x1a490(%rip), %rdi     # 0x1fff0
leaq 0x12774(%rip), %rsi     # 0x182db
callq 0x31b0
movq %rax, -0x380(%rbp)
jmp 0x5b75
movq -0x380(%rbp), %rdi
movq 0x1a435(%rip), %rsi     # 0x1ffb8
callq 0x31e0
jmp 0x5b8a
movq -0x318(%rbp), %rax
movb $0x1, 0x9(%rax)
leaq -0x218(%rbp), %rdi
callq 0x3080
jmp 0x5ba3
movl $0x1, -0x284(%rbp)
jmp 0x64ca
movq -0x318(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x244(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
addl $0x1, %esi
movl %esi, (%rcx,%rdx,4)
movq 0x20(%rax), %rcx
movslq -0x248(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
addl $0x1, %esi
movl %esi, (%rcx,%rdx,4)
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x5bec
jmp 0x5bee
jmp 0x5872
movq -0x318(%rbp), %rax
movslq 0xc(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x388(%rbp)
jmp 0x5c22
movq -0x318(%rbp), %rax
movq -0x388(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x0, -0x23c(%rbp)
movq -0x318(%rbp), %rcx
movl -0x23c(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x5ccd
movq -0x318(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x23c(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x390(%rbp)
jmp 0x5c8a
movq -0x318(%rbp), %rax
movq -0x390(%rbp), %rsi
movq 0x38(%rax), %rcx
movslq -0x23c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rax), %rax
movslq -0x23c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x5c3e
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
xorl %esi, %esi
callq 0x3340
jmp 0x5ce9
movups -0x228(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdx
leaq -0x218(%rbp), %rdi
callq 0x3260
jmp 0x5d13
jmp 0x5d15
leaq -0x218(%rbp), %rdi
leaq -0x235(%rbp), %rsi
callq 0x3290
movq %rax, -0x398(%rbp)
jmp 0x5d31
movq -0x398(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3250
movb %al, -0x399(%rbp)
jmp 0x5d4f
movb -0x399(%rbp), %al
testb $0x1, %al
jne 0x5d5e
jmp 0x5e3d
movsbl -0x235(%rbp), %eax
cmpl $0x65, %eax
jne 0x5e38
leaq -0x218(%rbp), %rdi
leaq -0x244(%rbp), %rsi
callq 0x3130
movq %rax, -0x3a8(%rbp)
jmp 0x5d8a
movq -0x3a8(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x3130
movq %rax, -0x3b0(%rbp)
jmp 0x5da6
movq -0x3b0(%rbp), %rdi
leaq -0x24c(%rbp), %rsi
callq 0x3130
jmp 0x5dbb
movq -0x318(%rbp), %rax
movl -0x248(%rbp), %esi
movq 0x38(%rax), %rcx
movslq -0x244(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x20(%rax), %rdx
movslq -0x244(%rbp), %rdi
movslq (%rdx,%rdi,4), %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x244(%rbp), %esi
movq 0x38(%rax), %rcx
movslq -0x248(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x20(%rax), %rdx
movslq -0x248(%rbp), %rdi
movslq (%rdx,%rdi,4), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x20(%rax), %rcx
movslq -0x244(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
addl $0x1, %esi
movl %esi, (%rcx,%rdx,4)
movq 0x20(%rax), %rax
movslq -0x248(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x5d15
movl $0x0, -0x23c(%rbp)
movq -0x318(%rbp), %rcx
movl -0x23c(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x5e8d
movq -0x318(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x23c(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movq 0x18(%rax), %rax
movslq -0x23c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x5e47
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movl 0xc(%rax), %esi
callq 0x77d0
movq %rax, -0x3b8(%rbp)
jmp 0x5eac
movq -0x318(%rbp), %rax
movq -0x3b8(%rbp), %rcx
movq %rcx, -0x2a8(%rbp)
movl $0xffffffff, -0x2ac(%rbp) # imm = 0xFFFFFFFF
movq (%rax), %rdi
addq $0x18, %rdi
movl 0xc(%rax), %esi
callq 0x77d0
movq %rax, -0x3c0(%rbp)
jmp 0x5ee3
movq -0x318(%rbp), %rax
movq -0x3c0(%rbp), %rcx
movq %rcx, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rdi
movslq 0xc(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x3110
movl $0x0, -0x2bc(%rbp)
movq -0x318(%rbp), %rdx
movl -0x2bc(%rbp), %ecx
xorl %eax, %eax
cmpl 0xc(%rdx), %ecx
movb %al, -0x3c1(%rbp)
jge 0x5f44
movq -0x318(%rbp), %rax
movb 0x9(%rax), %al
xorb $-0x1, %al
movb %al, -0x3c1(%rbp)
movb -0x3c1(%rbp), %al
testb $0x1, %al
jne 0x5f53
jmp 0x60a2
movl $0x0, -0x2c0(%rbp)
movq -0x318(%rbp), %rax
movl -0x2c0(%rbp), %ecx
movq 0x20(%rax), %rdx
movslq -0x2bc(%rbp), %rsi
xorl %eax, %eax
cmpl (%rdx,%rsi,4), %ecx
movb %al, -0x3c2(%rbp)
jge 0x5f94
movq -0x318(%rbp), %rax
movb 0x9(%rax), %al
xorb $-0x1, %al
movb %al, -0x3c2(%rbp)
movb -0x3c2(%rbp), %al
testb $0x1, %al
jne 0x5fa3
jmp 0x603b
movq -0x318(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2bc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c4(%rbp)
movq -0x2b8(%rbp), %rax
movslq -0x2c4(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x601a
movq -0x2b8(%rbp), %rax
movslq -0x2c4(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0x2ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2ac(%rbp)
movl -0x2c4(%rbp), %edx
movq -0x2a8(%rbp), %rax
movslq -0x2ac(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x6025
movq -0x318(%rbp), %rax
movb $0x1, 0x9(%rax)
jmp 0x6027
movl -0x2c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c0(%rbp)
jmp 0x5f5d
jmp 0x603d
cmpl $0x0, -0x2ac(%rbp)
setl %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x604f
jmp 0x608c
movq -0x2a8(%rbp), %rax
movslq -0x2ac(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c8(%rbp)
movl -0x2ac(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2ac(%rbp)
movq -0x2b8(%rbp), %rax
movslq -0x2c8(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x603d
jmp 0x608e
movl -0x2bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2bc(%rbp)
jmp 0x5f18
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movq -0x2b8(%rbp), %rsi
movl 0xc(%rax), %edx
callq 0x7a30
jmp 0x60c1
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movq -0x2a8(%rbp), %rsi
movl 0xc(%rax), %edx
callq 0x7a30
jmp 0x60e0
movq -0x318(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x613b
movq 0x19efc(%rip), %rdi     # 0x1fff0
leaq 0x121fe(%rip), %rsi     # 0x182f9
callq 0x31b0
movq %rax, -0x3d0(%rbp)
jmp 0x6109
movq -0x3d0(%rbp), %rdi
movq 0x19ea1(%rip), %rsi     # 0x1ffb8
callq 0x31e0
jmp 0x611e
leaq -0x218(%rbp), %rdi
callq 0x3080
jmp 0x612c
movl $0x1, -0x284(%rbp)
jmp 0x64ca
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movl 0xc(%rax), %esi
callq 0x77d0
movq %rax, -0x3d8(%rbp)
jmp 0x615a
movq -0x318(%rbp), %rax
movq -0x3d8(%rbp), %rcx
movq %rcx, -0x2d0(%rbp)
movl $0x0, -0x2d4(%rbp)
movl $0xffffffff, -0x2d8(%rbp) # imm = 0xFFFFFFFF
movq (%rax), %rdi
addq $0x18, %rdi
movl 0xc(%rax), %esi
callq 0x77d0
movq %rax, -0x3e0(%rbp)
jmp 0x619b
movq -0x318(%rbp), %rax
movq -0x3e0(%rbp), %rcx
movq %rcx, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rdi
movslq 0xc(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x3110
movl -0x2d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2d8(%rbp)
movq -0x2d0(%rbp), %rax
movslq -0x2d8(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x2e0(%rbp), %rax
movl $0x1, (%rax)
movl -0x2d4(%rbp), %eax
cmpl -0x2d8(%rbp), %eax
setg %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6211
jmp 0x62f2
movq -0x2d0(%rbp), %rax
movslq -0x2d4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2e4(%rbp)
movl -0x2d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2d4(%rbp)
movl $0x0, -0x2e8(%rbp)
movq -0x318(%rbp), %rcx
movl -0x2e8(%rbp), %eax
movq 0x20(%rcx), %rcx
movslq -0x2e4(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x62ed
movq -0x318(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2e4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2e8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2ec(%rbp)
movq -0x2e0(%rbp), %rax
movslq -0x2ec(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x62d7
movl -0x2d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2d8(%rbp)
movl -0x2ec(%rbp), %edx
movq -0x2d0(%rbp), %rax
movslq -0x2d8(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x2e0(%rbp), %rax
movslq -0x2ec(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x62d9
movl -0x2e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2e8(%rbp)
jmp 0x6241
jmp 0x61f7
movl $0x0, -0x2f0(%rbp)
movq -0x318(%rbp), %rdx
movl -0x2f0(%rbp), %ecx
xorl %eax, %eax
cmpl 0xc(%rdx), %ecx
movb %al, -0x3e1(%rbp)
jge 0x6328
movq -0x318(%rbp), %rax
movb 0x9(%rax), %al
xorb $-0x1, %al
movb %al, -0x3e1(%rbp)
movb -0x3e1(%rbp), %al
testb $0x1, %al
jne 0x6334
jmp 0x6366
movq -0x2e0(%rbp), %rax
movslq -0x2f0(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x6353
movq -0x318(%rbp), %rax
movb $0x1, 0x9(%rax)
jmp 0x6355
movl -0x2f0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2f0(%rbp)
jmp 0x62fc
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movq -0x2d0(%rbp), %rsi
movl 0xc(%rax), %edx
callq 0x7a30
jmp 0x6385
movq -0x318(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movq -0x2e0(%rbp), %rsi
movl 0xc(%rax), %edx
callq 0x7a30
jmp 0x63a4
movq -0x318(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x63ff
movq 0x19c38(%rip), %rdi     # 0x1fff0
leaq 0x11f60(%rip), %rsi     # 0x1831f
callq 0x31b0
movq %rax, -0x3f0(%rbp)
jmp 0x63cd
movq -0x3f0(%rbp), %rdi
movq 0x19bdd(%rip), %rsi     # 0x1ffb8
callq 0x31e0
jmp 0x63e2
leaq -0x218(%rbp), %rdi
callq 0x3080
jmp 0x63f0
movl $0x1, -0x284(%rbp)
jmp 0x64ca
movq -0x318(%rbp), %rax
movslq 0xc(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3040
movq %rax, -0x3f8(%rbp)
jmp 0x642e
movq -0x318(%rbp), %rax
movq -0x3f8(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq 0x40(%rax), %rax
movl $0x0, (%rax)
movl $0x1, -0x23c(%rbp)
movq -0x318(%rbp), %rcx
movl -0x23c(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x64b2
movq -0x318(%rbp), %rax
movq 0x40(%rax), %rcx
movl -0x23c(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %edx
movq 0x20(%rax), %rcx
movl -0x23c(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
addl (%rcx,%rsi,4), %edx
movq 0x40(%rax), %rax
movslq -0x23c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x6454
leaq -0x218(%rbp), %rdi
callq 0x3080
jmp 0x64c0
movl $0x0, -0x284(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x3140
leaq -0x218(%rbp), %rdi
callq 0x3090
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
leaq -0x218(%rbp), %rdi
callq 0x3090
movq -0x230(%rbp), %rdi
callq 0x3370
nopw %cs:(%rax,%rax)