// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/external/gsaca_cl/gsaca.c
// Function: gsaca_unsigned_cl_la
int gsaca_unsigned_cl_la(const unsigned char *S, unsigned int *SA, unsigned int *LA, unsigned int n) {
	unsigned int *ISA, *PREV;
	void *GSIZE;
	unsigned int i,j;
	unsigned int gstart, gend;
	unsigned int s, p, sr;
	unsigned int tmp, gstarttmp, gendtmp;
	unsigned int C[2*C_SIZE]; //counts and cumulative counts

	if (n == 0)		return 0;
	if (S[n-1] != '\0')	return -1;

	//set up needed structures
	ISA = LA;
	PREV = (unsigned int *)malloc( n * sizeof(unsigned int) );
	GSIZE = gsize_calloc( n );
	if (!PREV || !GSIZE)	{
		free(PREV); gsize_free(GSIZE);
		return -2;
	}

	//// PHASE 1: pre-sort suffixes ////
	//build initial group structure
	for (i = 0; i < C_SIZE; ++i)	C_CNT(i) = 0;
	for (i = 0; i < n; ++i) ++C_CNT(S[i]); //count characters

	if (C_CNT(0) != 1) { //more than 1 nullbyte
		fprintf(stderr, "more than 1 nullbyte\n");
		free(PREV); gsize_free(GSIZE);
		return -1;
	}
	j = 0;
	for (i = 0; i < C_SIZE; ++i) { //build cumulative counts and set up GSIZE
		if (C_CNT(i) > 0) {
			C_CUM(i) = j;
			gsize_set(GSIZE, j, C_CNT(i));
			j += C_CNT(i);
		}
	}
	for (i = n-1; i < n; --i) { //set up ISA, GLINK and SA
		gstart = C_CUM(S[i]);
		sr = gstart + --C_CNT(S[i]);
		GLINK[i] = gstart;
		ISA[i] = sr;
		SA[sr] = i;
	}

	//process groups from highest to lowest
	for (gend = n-1; gend > 0; gend = gstarttmp-1) {
		gstart = GLINK[SA[gend]];
		gstarttmp = gstart;	gendtmp = gend;

		//clear GSIZE group size for marking
		gsize_clear(GSIZE, gstart);

		//compute prev - pointers and mark suffixes of own group that
		//have a prev-pointer of own group pointing to them
		for (i = gend; i >= gstart; --i) {
			s = SA[i]; //use prev - pointers from already used groups
			for (p = s-1; p < n; p = PREV[p]) {
				if (ISA[p] <= gend) {
					if (ISA[p] >= gstart) {
						gsize_set(GSIZE, ISA[p], 1); //mark ISA[p]
					}
					break;
				}
			}
			PREV[s] = p;
		}

		//set GENDLINK of all suffixes for phase 2 and move unmarked
		// suffixes to the front of the actual group
		j = 0;
		for (i = gstart; i <= gend; ++i) {
			s = SA[i];
			GENDLINK[s] = gend;
			if (gsize_get(GSIZE, i) == 0) { //i is not marked
				//swap SA[i] and SA[gstart+j] TODO: changed, now a swap is performed
				SA[i] = SA[gstart+j];
				SA[gstart+(j++)] = s;
			}
		}

		//order the suffixes according on how much suffixes of same
		//group are jumped by them
		gend = gstart + j; //exclusive bound by now
		j = 0;
		do {
			i = gend-1; sr = gend;
			while (i >= gstart) {
				s = SA[i];
				p = PREV[s];
				if (p < n) {
					if (ISA[p] < gstarttmp) { //p is in a lex. smaller group
						SA[i--] = SA[--gend];
						SA[gend] = p; //push prev to back
					} else { //p is in same group
						PREV[s] = PREV[p];
						PREV[p] = s; //set a reference from p to s, as s's prev pointer will be correct later TODO changed, could be ignored before
						--i;
					}
				} else { //prev points to nothing
					SA[i] = SA[gstart++]; //remove entry
				}
			}
			//write number of suffixes written to end on stack using GSIZE
			if (gend < sr) {
				gsize_set(GSIZE, gend, sr-gend);
				++j; //also, count number of splitted groups
			}
		} while (gstart < gend);

		//rearrange previous suffixes stored in other groups
		while (j--) {
			gend = gstart + gsize_get(GSIZE, gstart);
			//decrement group count of previous group suffixes, and move them to back
			for (i = gend-1; i >= gstart; --i) {
				p = SA[i];
				sr = GLINK[p];
				sr += gsize_dec_get(GSIZE, sr);
				//move p to back by exchanging it with last suffix s of group
				s = SA[sr];
				tmp = ISA[p];
				SA[tmp] = s;	ISA[s] = tmp;
				SA[sr] = p;	ISA[p] = sr;				
			}
			//set new GLINK for moved suffixes
			for (i = gstart; i < gend; ++i) {
				p = SA[i];
				sr = GLINK[p];
				sr += gsize_get(GSIZE, sr);
				GLINK[p] = sr;
			}
			//set up GSIZE for newly created groups
			for (i = gstart; i < gend; ++i) {
				p = SA[i];
				sr = GLINK[p];
				gsize_inc(GSIZE, sr);
			}
			gstart = gend;
		}
		
		//set remaining prev pointers of own group to correct value TODO: new, was ignored before
		for (i = gendtmp; i >= gstart; --i) {
			s = SA[i];
			PREV[s] = PREV[PREV[s]]; //use stored references to get correct pointers
		}

		//prepare current group for phase 2
		SA[gendtmp] = gstarttmp; //counter where to place next entry TODO: removed because not necessary
	}

	//// PHASE 2: sort suffixes finally ////
	SA[0] = n-1;
	for (i = 0; i < n; i++) {
		s = SA[i]-1;
		while (s < n) {
			sr = GENDLINK[s];
			if (sr == n) //suffix already placed to SA, stop
				break;
			sr = SA[sr]++; //get position where to write s
			SA[sr] = s;
			//mark that suffix is placed in SA already
			GENDLINK[s] = n; 
			/* NOTE: Using annother technique
			   to indicate if a suffix is placed to SA already,
			   ISA could be computed too. A possible way would be to
			   set PREV[s] = s, and check that in the above if. 
			*/
			s = PREV[s]; //process next suffix
		}
	}

	//// PHASE 3: compute Lyndon array ////
	//compute for each suffix S[i..n] the length of its group context
	for (i = 0; i < n; i++) { //set all context lengths to 1
		LA[i] = 1;
	}

	//use prev pointers to compute context lengths
	for (i = n-1; i-- > 0; ) { //run from back to front
		p = PREV[i];
		if (p < n) { //ensure previous suffix exists
			LA[p] += LA[i]; //add own suffix length to that of p
		}
	}
	

	free(PREV); gsize_free(GSIZE);

	return 0;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x880, %rsp            # imm = 0x880
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x7c9c
movl $0x0, -0x4(%rbp)
jmp 0x8415
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7cbd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8415
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0xb6a0
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %edi
callq 0x7b90
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x7cf1
cmpq $0x0, -0x40(%rbp)
jne 0x7d0f
movq -0x38(%rbp), %rdi
callq 0xb810
movq -0x40(%rbp), %rdi
callq 0x7bb0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x8415
movl $0x0, -0x44(%rbp)
cmpl $0x100, -0x44(%rbp)     # imm = 0x100
jae 0x7d3f
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl $0x0, -0x870(%rbp,%rax,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7d16
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x7d7c
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
movzbl (%rax,%rcx), %eax
shll %eax
addl $0x1, %eax
cltq
movl -0x870(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x870(%rbp,%rax,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7d46
cmpl $0x1, -0x86c(%rbp)
je 0x7dbb
movq 0x726c(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x4ada(%rip), %rsi      # 0xc870
movb $0x0, %al
callq 0x2160
movq -0x38(%rbp), %rdi
callq 0xb810
movq -0x40(%rbp), %rdi
callq 0x7bb0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8415
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x100, -0x44(%rbp)     # imm = 0x100
jae 0x7e38
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
cmpl $0x0, -0x870(%rbp,%rax,4)
jbe 0x7e2b
movl -0x48(%rbp), %ecx
movl -0x44(%rbp), %eax
shll %eax
movl %eax, %eax
movl %ecx, -0x870(%rbp,%rax,4)
movq -0x40(%rbp), %rdi
movl -0x48(%rbp), %esi
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl -0x870(%rbp,%rax,4), %edx
callq 0x7bd0
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl -0x870(%rbp,%rax,4), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x7e2d
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7dc9
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x7ec0
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
movzbl (%rax,%rcx), %eax
shll %eax
cltq
movl -0x870(%rbp,%rax,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x44(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
movl -0x870(%rbp,%rdx,4), %ecx
addl $-0x1, %ecx
movl %ecx, -0x870(%rbp,%rdx,4)
addl %ecx, %eax
movl %eax, -0x5c(%rbp)
movl -0x4c(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x5c(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7e41
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jbe 0x82f3
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x50(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x7bf0
movl -0x50(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jb 0x7f93
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x7f78
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x50(%rbp), %eax
ja 0x7f67
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x4c(%rbp), %eax
jb 0x7f65
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movl $0x1, %edx
callq 0x7bd0
jmp 0x7f78
jmp 0x7f69
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
jmp 0x7f27
movl -0x58(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7f05
movl $0x0, -0x48(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x50(%rbp), %eax
ja 0x8015
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x7c10
cmpl $0x0, %eax
jne 0x8008
movq -0x18(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl -0x48(%rbp), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl -0x48(%rbp), %esi
movl %esi, %edi
addl $0x1, %edi
movl %edi, -0x48(%rbp)
addl %esi, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x800a
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7fa0
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x50(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jb 0x80f5
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rax
movl -0x54(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x80d2
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x64(%rbp), %eax
jae 0x80a6
movq -0x18(%rbp), %rax
movl -0x50(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x50(%rbp)
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x44(%rbp)
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl -0x58(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x80d0
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x80f0
movq -0x18(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x8034
movl -0x50(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x8118
movq -0x40(%rbp), %rdi
movl -0x50(%rbp), %esi
movl -0x5c(%rbp), %edx
subl -0x50(%rbp), %edx
callq 0x7bd0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x811a
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jb 0x8025
jmp 0x8128
movl -0x48(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x48(%rbp)
cmpl $0x0, %eax
je 0x8297
movl -0x4c(%rbp), %eax
movl %eax, -0x874(%rbp)
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x7c10
movl %eax, %ecx
movl -0x874(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jb 0x81fb
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x7c30
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movl -0x54(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x60(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x58(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x5c(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8167
movl -0x4c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x824d
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x7c10
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8201
movl -0x4c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x828c
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x7c50
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8253
movl -0x50(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x8128
movl -0x68(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jb 0x82d8
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x54(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x829d
movl -0x64(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x68(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x7ec9
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x838d
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x837d
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x833d
jmp 0x837d
movq -0x18(%rbp), %rcx
movl -0x5c(%rbp), %eax
movl %eax, %edx
movl (%rcx,%rdx,4), %eax
movl %eax, %esi
addl $0x1, %esi
movl %esi, (%rcx,%rdx,4)
movl %eax, -0x5c(%rbp)
movl -0x54(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
movl -0x54(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
jmp 0x831e
jmp 0x837f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8306
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x83b5
movq -0x20(%rbp), %rax
movl -0x44(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8394
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x44(%rbp)
cmpl $0x0, %eax
jbe 0x83fc
movq -0x38(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x83fa
movq -0x20(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movl -0x58(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0x83be
movq -0x38(%rbp), %rdi
callq 0xb810
movq -0x40(%rbp), %rdi
callq 0x7bb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x880, %rsp            # imm = 0x880
popq %rbp
retq
nopw %cs:(%rax,%rax)