// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/external/gsaca_cl/gsaca.c
// Function: gsaca_unsigned_cl
int gsaca_unsigned_cl(const unsigned char *S, unsigned int *SA, 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 = (unsigned int *)malloc( n * sizeof(unsigned int) );
	PREV = (unsigned int *)malloc( n * sizeof(unsigned int) );
	GSIZE = gsize_calloc( n );
	if (!ISA || !PREV || !GSIZE)	{
		free(ISA); 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(ISA); 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;
		}
		
		//prepare current group for phase 2
		//SA[gendtmp] = gstarttmp; //counter where to place next entry TODO: removed because not necessary
		
		//set remaining prev pointers of own group to correct value TODO: new, was ignored before
		while (gendtmp >= gstart) {
			s = SA[gendtmp--];
			PREV[s] = PREV[PREV[s]]; //use stored references to get correct pointers
		}
	}

	//// FOR FELIPE ////
	//compute for each suffix S[i..n] the length of its group context
	unsigned int *CLEN = SA; //context length of each suffix
	for (i = 0; i < n; i++) { //set all context lengths to 1
		CLEN[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
			CLEN[p] += CLEN[i]; //add own suffix length to that of p
		}
	}
	

	free(ISA); free(PREV); gsize_free(GSIZE);

	return 0;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x870, %rsp            # imm = 0x870
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x7468
movl $0x0, -0x4(%rbp)
jmp 0x7b79
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7489
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7b79
movl -0x1c(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0xb6a0
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0xb6a0
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %edi
callq 0x7b90
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x74ce
cmpq $0x0, -0x30(%rbp)
je 0x74ce
cmpq $0x0, -0x38(%rbp)
jne 0x74f5
movq -0x28(%rbp), %rdi
callq 0xb810
movq -0x30(%rbp), %rdi
callq 0xb810
movq -0x38(%rbp), %rdi
callq 0x7bb0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7b79
movl $0x0, -0x3c(%rbp)
cmpl $0x100, -0x3c(%rbp)     # imm = 0x100
jae 0x7525
movl -0x3c(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl $0x0, -0x860(%rbp,%rax,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x74fc
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x7562
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
shll %eax
addl $0x1, %eax
cltq
movl -0x860(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x860(%rbp,%rax,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x752c
cmpl $0x1, -0x85c(%rbp)
je 0x75aa
movq 0x7a86(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x52f4(%rip), %rsi      # 0xc870
movb $0x0, %al
callq 0x2160
movq -0x28(%rbp), %rdi
callq 0xb810
movq -0x30(%rbp), %rdi
callq 0xb810
movq -0x38(%rbp), %rdi
callq 0x7bb0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7b79
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x100, -0x3c(%rbp)     # imm = 0x100
jae 0x7627
movl -0x3c(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
cmpl $0x0, -0x860(%rbp,%rax,4)
jbe 0x761a
movl -0x40(%rbp), %ecx
movl -0x3c(%rbp), %eax
shll %eax
movl %eax, %eax
movl %ecx, -0x860(%rbp,%rax,4)
movq -0x38(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl -0x860(%rbp,%rax,4), %edx
callq 0x7bd0
movl -0x3c(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, %eax
movl -0x860(%rbp,%rax,4), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0x761c
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x75b8
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x76af
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
shll %eax
cltq
movl -0x860(%rbp,%rax,4), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
movl -0x860(%rbp,%rdx,4), %ecx
addl $-0x1, %ecx
movl %ecx, -0x860(%rbp,%rdx,4)
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x44(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edx
movq -0x28(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7630
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jbe 0x7ad4
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x48(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x7bf0
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jb 0x7782
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x7767
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x48(%rbp), %eax
ja 0x7756
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jb 0x7754
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movl $0x1, %edx
callq 0x7bd0
jmp 0x7767
jmp 0x7758
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
jmp 0x7716
movl -0x50(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x76f4
movl $0x0, -0x40(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
ja 0x7804
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %edx
movq -0x28(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x7c10
cmpl $0x0, %eax
jne 0x77f7
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
addl -0x40(%rbp), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl -0x40(%rbp), %esi
movl %esi, %edi
addl $0x1, %edi
movl %edi, -0x40(%rbp)
addl %esi, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x77f9
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x778f
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x48(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jb 0x78e4
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x78c1
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x5c(%rbp), %eax
jae 0x7895
movq -0x18(%rbp), %rax
movl -0x48(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x48(%rbp)
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x3c(%rbp)
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl -0x50(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x78bf
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x78df
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x44(%rbp)
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x7823
movl -0x48(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x7907
movq -0x38(%rbp), %rdi
movl -0x48(%rbp), %esi
movl -0x54(%rbp), %edx
subl -0x48(%rbp), %edx
callq 0x7bd0
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7909
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jb 0x7814
jmp 0x7917
movl -0x40(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
cmpl $0x0, %eax
je 0x7a86
movl -0x44(%rbp), %eax
movl %eax, -0x86c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x7c10
movl %eax, %ecx
movl -0x86c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jb 0x79ea
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x7c30
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x4c(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x58(%rbp), %edx
movq -0x28(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x50(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edx
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7956
movl -0x44(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x7a3c
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x7c10
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edx
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x79f0
movl -0x44(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x7a7b
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x7c50
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7a42
movl -0x48(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x7917
jmp 0x7a88
movl -0x60(%rbp), %eax
cmpl -0x44(%rbp), %eax
jb 0x7ac4
movq -0x18(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x60(%rbp)
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x4c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x7a88
jmp 0x7ac6
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x76b8
movq -0x18(%rbp), %rax
movq %rax, -0x868(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x7b0a
movq -0x868(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7ae6
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x3c(%rbp)
cmpl $0x0, %eax
jbe 0x7b57
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x7b55
movq -0x868(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x868(%rbp), %rax
movl -0x50(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0x7b13
movq -0x28(%rbp), %rdi
callq 0xb810
movq -0x30(%rbp), %rdi
callq 0xb810
movq -0x38(%rbp), %rdi
callq 0x7bb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x870, %rsp            # imm = 0x870
popq %rbp
retq
nopw %cs:(%rax,%rax)