// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/contrib/ssw/ssw.c
// Function: ssw_align
s_align* ssw_align (const s_profile* prof,
					const int8_t* ref,
				  	int32_t refLen,
				  	const uint8_t weight_gapO,
				  	const uint8_t weight_gapE,
					const uint8_t flag,	/*  (from high to low) bit 5: return the best alignment beginning position; 6: if (ref_end1 - ref_begin1 <= filterd) && (read_end1 - read_begin1 <= filterd), return cigar; 7: if max score >= filters, return cigar; 8: always return cigar; if 6 & 7 are both setted, only return cigar when both filter fulfilled */
					const uint16_t filters,
					const int32_t filterd,
					const int32_t maskLen) {

	alignment_end* bests = 0, *bests_reverse = 0;
	__m128i* vP = 0;
	int32_t word = 0, band_width = 0, readLen = prof->readLen;
	int8_t* read_reverse = 0;
	cigar* path;
	s_align* r = (s_align*)calloc(1, sizeof(s_align));
	r->ref_begin1 = -1;
	r->read_begin1 = -1;
	r->cigar = 0;
	r->cigarLen = 0;
	if (maskLen < 15) {
		fprintf(stderr, "When maskLen < 15, the function ssw_align doesn't return 2nd best alignment information.\n");
	}

	// Find the alignment scores and ending positions
	if (prof->profile_byte) {
		bests = sw_sse2_byte(ref, 0, refLen, readLen, weight_gapO, weight_gapE, prof->profile_byte, -1, prof->bias, maskLen);
		if (prof->profile_word && bests[0].score == 255) {
            r->saturated = 1;
			free(bests);
			bests = sw_sse2_word(ref, 0, refLen, readLen, weight_gapO, weight_gapE, prof->profile_word, -1, maskLen);
			word = 1;
		} else if (bests[0].score == 255) {
			fprintf(stderr, "Please set 2 to the score_size parameter of the function ssw_init, otherwise the alignment results will be incorrect.\n");
			free(r);
			return NULL;
		}
	}else if (prof->profile_word) {
		bests = sw_sse2_word(ref, 0, refLen, readLen, weight_gapO, weight_gapE, prof->profile_word, -1, maskLen);
		word = 1;
	}else {
		fprintf(stderr, "Please call the function ssw_init before ssw_align.\n");
		free(r);
		return NULL;
	}
	r->score1 = bests[0].score;
	r->ref_end1 = bests[0].ref;
	r->read_end1 = bests[0].read;
	if (maskLen >= 15) {
		r->score2 = bests[1].score;
		r->ref_end2 = bests[1].ref;
	} else {
		r->score2 = 0;
		r->ref_end2 = -1;
	}
	free(bests);
	if (flag == 0 || (flag == 2 && r->score1 < filters)) goto end;

	// Find the beginning position of the best alignment.
	read_reverse = seq_reverse(prof->read, r->read_end1);
	if (word == 0) {
		vP = qP_byte(read_reverse, prof->mat, r->read_end1 + 1, prof->n, prof->bias);
		bests_reverse = sw_sse2_byte(ref, 1, r->ref_end1 + 1, r->read_end1 + 1, weight_gapO, weight_gapE, vP, r->score1, prof->bias, maskLen);
	} else {
		vP = qP_word(read_reverse, prof->mat, r->read_end1 + 1, prof->n);
		bests_reverse = sw_sse2_word(ref, 1, r->ref_end1 + 1, r->read_end1 + 1, weight_gapO, weight_gapE, vP, r->score1, maskLen);
	}
	free(vP);
	free(read_reverse);
	r->ref_begin1 = bests_reverse[0].ref;
	r->read_begin1 = r->read_end1 - bests_reverse[0].read;
	free(bests_reverse);
	if ((7&flag) == 0 || ((2&flag) != 0 && r->score1 < filters) || ((4&flag) != 0 && (r->ref_end1 - r->ref_begin1 > filterd || r->read_end1 - r->read_begin1 > filterd))) goto end;

	// Generate cigar.
	refLen = r->ref_end1 - r->ref_begin1 + 1;
	readLen = r->read_end1 - r->read_begin1 + 1;
	band_width = abs(refLen - readLen) + 1;
	path = banded_sw(ref + r->ref_begin1, prof->read + r->read_begin1, refLen, readLen, r->score1, weight_gapO, weight_gapE, band_width, prof->mat, prof->n);
	if (path == 0) {
		free(r);
		r = NULL;
	}
	else {
		r->cigar = path->seq;
		r->cigarLen = path->length;
		free(path);
	}

end:
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r9d, %r12d
movl %r8d, %ebp
movl %ecx, 0x10(%rsp)
movl %edx, %r13d
movq %rsi, 0x48(%rsp)
movq %rdi, %r14
movl 0x140(%rsp), %r15d
movl 0x20(%rdi), %ebx
movl $0x1, %edi
movl $0x28, %esi
callq 0x29b0e0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x4(%rax)
movl %ecx, 0xc(%rax)
movq $0x0, 0x18(%rax)
movq %rax, 0x18(%rsp)
movl $0x0, 0x20(%rax)
cmpl $0xe, %r15d
jg 0x2f9e9a
callq 0x29be0f
movq (%r14), %rax
testq %rax, %rax
movl %ebp, 0xc(%rsp)
jne 0x2f9ec8
movq 0x8(%r14), %rbp
testq %rbp, %rbp
jne 0x2f9f2e
callq 0x29be63
movq 0x18(%rsp), %r14
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x29b170
jmp 0x2f9fcb
movzbl 0x28(%r14), %r10d
movzbl 0x10(%rsp), %r8d
movzbl %bpl, %r9d
movq 0x48(%rsp), %rdi
xorl %esi, %esi
movl %r13d, %edx
movl %ebx, %ecx
pushq %r15
pushq %r10
pushq $0xff
pushq %rax
callq 0x29b580
addq $0x20, %rsp
movq 0x8(%r14), %rbp
testq %rbp, %rbp
je 0x2f9f06
cmpw $0xff, (%rax)
je 0x2f9f1a
movb $0x1, %cl
movl %ecx, 0x50(%rsp)
cmpw $0xff, (%rax)
jne 0x2f9f63
callq 0x29be2b
jmp 0x2f9eb4
movq 0x18(%rsp), %rcx
movl $0x1, 0x24(%rcx)
movq %rax, %rdi
callq 0x29b170
subq $0x8, %rsp
movzbl 0x18(%rsp), %r8d
movzbl 0x14(%rsp), %r9d
movl $0x0, 0x58(%rsp)
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movl %r13d, %edx
movl %ebx, %ecx
pushq %r15
pushq $0xffff                 # imm = 0xFFFF
pushq %rbp
callq 0x29ba2f
addq $0x20, %rsp
movzwl (%rax), %ecx
movq 0x18(%rsp), %rbx
movq %rcx, 0x58(%rsp)
movw %cx, (%rbx)
movl 0x4(%rax), %ecx
movq %rcx, (%rsp)
movl %ecx, 0x8(%rbx)
movslq 0x8(%rax), %rbp
movl %ebp, 0x10(%rbx)
cmpl $0xf, %r15d
jl 0x2f9f97
movzwl 0xc(%rax), %ecx
movw %cx, 0x2(%rbx)
movl 0x10(%rax), %ecx
jmp 0x2f9fa2
movw $0x0, 0x2(%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x14(%rbx)
movq %rax, %rdi
callq 0x29b170
testb %r12b, %r12b
je 0x2f9fcb
movzwl 0x130(%rsp), %eax
movzbl %r12b, %r13d
cmpl $0x2, %r13d
jne 0x2f9fe0
cmpw %ax, 0x58(%rsp)
jae 0x2f9fe0
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rbx
leaq 0x1(%rbp), %rdi
movl $0x1, %esi
movq %rdi, 0x28(%rsp)
callq 0x29b0e0
movq %rax, %r12
testl %ebp, %ebp
js 0x2fa020
xorl %ecx, %ecx
movq %rbp, %rax
movb (%rbx,%rax), %dl
movb %dl, (%r12,%rcx)
movb (%rbx,%rcx), %dl
movb %dl, (%r12,%rax)
leaq 0x1(%rcx), %rdx
decq %rax
cmpq %rax, %rcx
movq %rdx, %rcx
jl 0x2fa003
movq 0x18(%r14), %rsi
movl 0x24(%r14), %ecx
cmpb $0x0, 0x50(%rsp)
je 0x2fa081
movzbl 0x28(%r14), %r8d
movq %r12, %rdi
movq 0x28(%rsp), %rbx
movl %ebx, %edx
callq 0x29b420
movq %rax, %r11
movq (%rsp), %rax
leal 0x1(%rax), %edx
movzbl 0x28(%r14), %eax
movzbl 0x58(%rsp), %r10d
movzbl 0x10(%rsp), %r8d
movzbl 0xc(%rsp), %r9d
movq 0x48(%rsp), %rdi
movl $0x1, %esi
movl %ebx, %ecx
pushq %r15
movq %r11, %r15
pushq %rax
pushq %r10
pushq %r11
callq 0x29b580
jmp 0x2fa0c6
movq %r12, %rdi
movq 0x28(%rsp), %rbx
movl %ebx, %edx
callq 0x29b4d3
movq %rax, %r10
movq (%rsp), %rax
leal 0x1(%rax), %edx
subq $0x8, %rsp
movzbl 0x18(%rsp), %r8d
movzbl 0x14(%rsp), %r9d
movq 0x50(%rsp), %rdi
movl $0x1, %esi
movl %ebx, %ecx
pushq %r15
movq %r10, %r15
pushq 0x68(%rsp)
pushq %r10
callq 0x29ba2f
addq $0x20, %rsp
movq %rax, %rbx
movq %r15, %rdi
callq 0x29b170
movq %r12, %rdi
callq 0x29b170
movslq 0x4(%rbx), %r15
movq 0x18(%rsp), %rax
movl %r15d, 0x4(%rax)
movl 0x8(%rbx), %r12d
subl %r12d, %ebp
movl %ebp, 0xc(%rax)
movq %rbx, %rdi
callq 0x29b170
testb $0x7, %r13b
je 0x2fa660
testb $0x2, %r13b
movq 0x18(%rsp), %rbx
je 0x2fa124
movzwl 0x130(%rsp), %eax
cmpw %ax, 0x58(%rsp)
jb 0x2f9fcb
testb $0x4, %r13b
je 0x2fa149
movl 0x138(%rsp), %eax
movq (%rsp), %rcx
subl %r15d, %ecx
cmpl %eax, %ecx
jg 0x2f9fcb
cmpl %eax, %r12d
jg 0x2f9fcb
movq (%rsp), %rax
subl %r15d, %eax
leal 0x1(%r12), %ecx
movq %rcx, 0xb8(%rsp)
movq %rax, (%rsp)
movq %r12, 0x60(%rsp)
subl %r12d, %eax
movl %eax, %ebx
negl %ebx
cmovsl %eax, %ebx
incl %ebx
movslq %ebp, %rax
addq 0x10(%r14), %rax
movq %rax, 0x50(%rsp)
movzbl 0x10(%rsp), %eax
movl %eax, 0x28(%rsp)
movzbl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%r14), %rax
movq %rax, 0xf0(%rsp)
movslq 0x24(%r14), %rax
movq %rax, 0xe8(%rsp)
movl $0x40, %edi
callq 0x29b190
movq %rax, 0x40(%rsp)
movl $0x10, %edi
callq 0x29b190
movq %rax, 0xa0(%rsp)
movl $0x20, %edi
callq 0x29b190
movq %rax, %r12
movl $0x20, %edi
callq 0x29b190
movq %rax, %r13
movl $0x20, %edi
callq 0x29b190
movq %rax, 0x20(%rsp)
movl $0x400, %eax            # imm = 0x400
movq %rax, 0xb0(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x29b190
movq %rax, %rdx
movq 0xb8(%rsp), %rax
leal (%rax,%rax,2), %eax
movl %eax, 0x88(%rsp)
addq %r15, 0x48(%rsp)
movl $0x8, %r14d
xorl %ebp, %ebp
movq %rdx, 0x30(%rsp)
movl %ebx, %eax
movq %rax, 0x68(%rsp)
leal 0x3(,%rax,2), %eax
movl %eax, 0x10(%rsp)
cmpl %r14d, %eax
movq 0x20(%rsp), %rax
jl 0x2fa2b6
movq %rax, 0x20(%rsp)
movl %r14d, %eax
sarl %eax
orl %r14d, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
sarl $0x10, %r14d
orl %ecx, %r14d
movslq %r14d, %r15
incl %r14d
leaq 0x4(,%r15,4), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x29b1e0
movq %rax, %r12
movq %r13, %rdi
movq %rbx, %rsi
callq 0x29b1e0
movq %rax, %r13
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x29b1e0
cmpl %r15d, 0x10(%rsp)
jg 0x2fa24c
movq %rax, 0x20(%rsp)
movl %r14d, 0x8c(%rsp)
movq 0x68(%rsp), %rax
leal 0x1(,%rax,2), %edx
movl 0x88(%rsp), %eax
movq %rdx, 0xa8(%rsp)
imull %edx, %eax
movslq %eax, %rbx
movq 0xb0(%rsp), %r15
cmpq %rbx, %r15
movq 0x30(%rsp), %rdi
jg 0x2fa345
movq %r15, %rax
sarq %rax
orq %r15, %rax
movq %rax, %rcx
sarq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
sarq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
sarq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %r14
sarq $0x10, %r14
orq %rcx, %r14
cmpq $-0x2, %r14
jle 0x2fa66a
leaq 0x1(%r14), %r15
movq %r15, %rsi
callq 0x29b1e0
movq %rax, %rdi
cmpq %rbx, %r14
jl 0x2fa2f6
movq %r15, 0xb0(%rsp)
movq %rdi, 0x30(%rsp)
movq 0x68(%rsp), %r14
leal (%r14,%r14), %ebx
leaq 0x4(%r12), %rdi
movl %ebx, %eax
leaq 0x4(,%rax,4), %rdx
movq %rdi, 0xc0(%rsp)
xorl %esi, %esi
callq 0x29b0d0
cmpl $0x0, 0x60(%rsp)
movq %r12, 0x80(%rsp)
movq %r13, 0x78(%rsp)
js 0x2fa656
movq %rbx, 0xc8(%rsp)
leal 0x2(%rbx), %eax
movl %eax, 0x94(%rsp)
movq 0xa8(%rsp), %rax
leal (%rax,%rax,2), %eax
movq %rax, 0x70(%rsp)
movl %r14d, %ecx
notl %ecx
movl %r14d, %edx
negl %edx
movq 0x20(%rsp), %rax
leaq 0x4(%rax), %rbx
leaq 0x4(%r13), %r15
movq 0x30(%rsp), %rax
incq %rax
movq %rax, 0xd0(%rsp)
leal (%r14,%r14,2), %eax
leal 0x3(,%rax,2), %eax
movl %eax, 0x90(%rsp)
movl $0x0, 0x3c(%rsp)
xorl %r14d, %r14d
testl %edx, %edx
movl $0x0, %r10d
movl %edx, 0x98(%rsp)
cmovgl %edx, %r10d
testl %ecx, %ecx
movl $0x0, %esi
movl %ecx, 0x9c(%rsp)
cmovgl %ecx, %esi
movl %r14d, %edx
movl %r14d, %ecx
movq 0x68(%rsp), %rax
subl %eax, %ecx
testl %ecx, %ecx
movl $0x0, %edi
cmovlel %edi, %ecx
movq %rdx, 0xd8(%rsp)
leal (%rax,%rdx), %r9d
movq (%rsp), %rax
cmpl %r9d, %eax
cmovll %eax, %r9d
leal 0x1(%r9), %edx
movl 0x94(%rsp), %eax
cmpl %eax, %edx
cmovgel %eax, %edx
movslq %edx, %rdx
movl %edi, (%r13,%rdx,4)
movl %edi, (%r12,%rdx,4)
movq 0x20(%rsp), %rax
movl %edi, (%rax)
movl %edi, (%r13)
movl %edi, (%r12)
cmpl %r9d, %ecx
jg 0x2fa620
movq 0x48(%rsp), %rax
addq %r10, %rax
movq %rax, 0x10(%rsp)
leaq (,%r10,4), %rcx
shlq $0x2, %rsi
subq %rsi, %rcx
movq 0xc0(%rsp), %rax
leaq (%rax,%rcx), %rdi
addq %r15, %rcx
movq %rcx, 0xe0(%rsp)
movl 0x3c(%rsp), %r8d
addq 0xd0(%rsp), %r8
movslq %r9d, %r9
xorl %esi, %esi
xorl %r13d, %r13d
movl $0x0, %edx
testq %r14, %r14
je 0x2fa4d2
movl (%rdi,%rsi,4), %edx
movq %r10, %rcx
movl $0x0, %r11d
testq %r14, %r14
je 0x2fa4ec
movq 0xe0(%rsp), %rax
movl (%rax,%rsi,4), %r11d
movl 0x28(%rsp), %eax
subl %eax, %edx
movl 0xc(%rsp), %r10d
subl %r10d, %r11d
cmpl %r11d, %edx
setg %r12b
cmovgl %edx, %r11d
movl %r11d, (%r15,%rsi,4)
orb $0x2, %r12b
movb %r12b, -0x1(%r8)
movl -0x4(%rbx,%rsi,4), %edx
subl %eax, %edx
subl %r10d, %r13d
cmpl %r13d, %edx
setg %r11b
cmovgl %edx, %r13d
orb $0x4, %r11b
movb %r11b, (%r8)
movl %r13d, %r10d
testl %r13d, %r13d
jg 0x2fa537
xorl %r10d, %r10d
movl (%r15,%rsi,4), %edx
cmpl %r10d, %edx
movl %r10d, %r11d
cmovgl %edx, %r11d
movq 0x10(%rsp), %rax
movsbq (%rax,%rsi), %r12
imulq 0xe8(%rsp), %r12
movq 0x50(%rsp), %rax
movsbq (%rax,%r14), %rax
addq %r12, %rax
movq 0xf0(%rsp), %r12
movsbl (%r12,%rax), %eax
addl -0x4(%rdi,%rsi,4), %eax
cmpl %eax, %r11d
movl %eax, %r12d
cmovgl %r11d, %r12d
cmpl %ebp, %r12d
cmovgl %r12d, %ebp
movl %r12d, (%rbx,%rsi,4)
movb $0x1, %r12b
cmpl %eax, %r11d
jle 0x2fa5a4
cmpl %r10d, %edx
jg 0x2fa59d
movq %r8, %rdx
jmp 0x2fa5a1
leaq -0x1(%r8), %rdx
movb (%rdx), %r12b
movb %r12b, 0x1(%r8)
movq %rcx, %r10
leaq (%rcx,%rsi), %rax
incq %rax
incq %rsi
decq %rax
addq $0x3, %r8
cmpq %r9, %rax
jl 0x2fa4c5
movq 0x80(%rsp), %r12
movq 0x78(%rsp), %r13
testl %esi, %esi
jle 0x2fa5ec
movl %esi, %edx
shlq $0x2, %rdx
movq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq 0x29b100
incq %r14
movl 0x98(%rsp), %edx
incl %edx
movl 0x9c(%rsp), %ecx
incl %ecx
movl 0x3c(%rsp), %eax
addl 0x90(%rsp), %eax
movl %eax, 0x3c(%rsp)
cmpq 0xb8(%rsp), %r14
jne 0x2fa3f7
jmp 0x2fa624
xorl %esi, %esi
jmp 0x2fa5d2
movq 0x70(%rsp), %r8
imull 0xd8(%rsp), %r8d
movq 0x30(%rsp), %rdx
addq %rdx, %r8
movq 0xc8(%rsp), %rbx
cmpl 0x58(%rsp), %ebp
movl 0x8c(%rsp), %r14d
jl 0x2fa22b
jmp 0x2fa697
movq 0x30(%rsp), %rdx
movq %rdx, %r8
jmp 0x2fa642
movq 0x18(%rsp), %rbx
jmp 0x2f9fcb
callq 0x29be47
xorl %r14d, %r14d
movq 0x18(%rsp), %rbx
testq %r14, %r14
je 0x2fa68f
movq (%r14), %rax
movq %rax, 0x18(%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x20(%rbx)
jmp 0x2f9ebb
movq %rbx, %r14
jmp 0x2f9eb9
movq 0x60(%rsp), %rsi
testl %esi, %esi
jle 0x2faa0e
movq 0xa8(%rsp), %rax
leal (%rax,%rax,2), %eax
negq %rax
movq %rax, 0x28(%rsp)
movb $0x4d, %r15b
movl $0x10, %r14d
movl $0x2, %ebp
xorl %r10d, %r10d
leaq 0x38dc21(%rip), %r11    # 0x6882f0
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x40(%rsp), %rdi
movl %esi, %eax
subl 0x68(%rsp), %eax
testl %eax, %eax
cmovlel %r10d, %eax
movq (%rsp), %rcx
subl %eax, %ecx
leal (%rcx,%rcx,2), %eax
addl %ebp, %eax
cltq
movzbl (%r8,%rax), %ecx
decl %ecx
cmpl $0x4, %ecx
ja 0x2fa845
movslq (%r11,%rcx,4), %rax
addq %r11, %rax
jmpq *%rax
decl %esi
movq (%rsp), %rax
decl %eax
movq %rax, (%rsp)
addq 0x28(%rsp), %r8
movl $0x2, %ebp
movb $0x4d, %al
jmp 0x2fa762
decl %esi
addq 0x28(%rsp), %r8
xorl %ebp, %ebp
jmp 0x2fa73c
decl %esi
addq 0x28(%rsp), %r8
movl $0x2, %ebp
movb $0x49, %al
jmp 0x2fa762
movq (%rsp), %rax
decl %eax
movq %rax, (%rsp)
movl $0x1, %ebp
jmp 0x2fa760
movq (%rsp), %rax
decl %eax
movq %rax, (%rsp)
movl $0x2, %ebp
movb $0x44, %al
cmpb %r15b, %al
jne 0x2fa76f
incl %r13d
jmp 0x2fa813
movl %ebp, 0x50(%rsp)
movq %r8, 0x70(%rsp)
movq %rsi, 0x60(%rsp)
leal 0x1(%rbx), %ebp
cmpl %r14d, %ebp
movb %al, 0x10(%rsp)
jl 0x2fa7cb
movl %r14d, %eax
sarl %eax
orl %r14d, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
sarl $0x10, %r14d
orl %ecx, %r14d
movslq %r14d, %r12
incl %r14d
leaq 0x4(,%r12,4), %rsi
callq 0x29b1e0
movq %rax, %rdi
cmpl %r12d, %ebx
jge 0x2fa789
shll $0x4, %r13d
movzbl %r15b, %eax
leaq 0x38db36(%rip), %rcx    # 0x688310
movzbl (%rax,%rcx), %eax
orl %r13d, %eax
movslq %ebx, %rcx
movl %eax, (%rdi,%rcx,4)
movl $0x1, %r13d
movb 0x10(%rsp), %al
movl %eax, %r15d
movl %ebp, %ebx
movq 0x30(%rsp), %rdx
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %r8
xorl %r10d, %r10d
leaq 0x38dae1(%rip), %r11    # 0x6882f0
movl 0x50(%rsp), %ebp
testl %esi, %esi
jg 0x2fa6d9
movq %rdi, 0x40(%rsp)
shll $0x4, %r13d
movl %r13d, %ebp
movl %eax, %r13d
cmpb $0x4d, %al
jne 0x2fa8ac
leal 0x1(%rbx), %r15d
cmpl %r14d, %r15d
jge 0x2fa8bf
movq 0x40(%rsp), %rdi
jmp 0x2fa906
movq 0x5c078c(%rip), %rcx    # 0x8bafd8
movq %rdi, %rbx
movq (%rcx), %rdi
movq %rdx, %r14
movsbl -0x1(%rax,%r8), %edx
leaq 0x38dc65(%rip), %rsi    # 0x6884c7
xorl %eax, %eax
callq 0x29b1c0
movq %r14, %rdi
callq 0x29b170
movq 0x20(%rsp), %rdi
callq 0x29b170
movq 0x78(%rsp), %rdi
callq 0x29b170
movq 0x80(%rsp), %rdi
callq 0x29b170
movq %rbx, %rdi
callq 0x29b170
movq 0xa0(%rsp), %rdi
callq 0x29b170
jmp 0x2fa66f
leal 0x2(%rbx), %r15d
cmpl %r14d, %r15d
jge 0x2fa91c
movq 0x40(%rsp), %rdi
jmp 0x2fa963
movq 0x40(%rsp), %rdi
movl %r14d, %eax
sarl %eax
orl %r14d, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
sarl $0x10, %r14d
orl %ecx, %r14d
movslq %r14d, %r12
incl %r14d
leaq 0x4(,%r12,4), %rsi
callq 0x29b1e0
movq %rax, %rdi
cmpl %r12d, %ebx
jge 0x2fa8c4
addl $0x10, %ebp
movzbl %r13b, %eax
leaq 0x38d9fc(%rip), %rcx    # 0x688310
movzbl (%rax,%rcx), %eax
orl %ebp, %eax
jmp 0x2fa981
movq 0x40(%rsp), %rdi
movl %r14d, %eax
sarl %eax
orl %r14d, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
sarl $0x10, %r14d
orl %ecx, %r14d
movslq %r14d, %r12
incl %r14d
leaq 0x4(,%r12,4), %rsi
callq 0x29b1e0
movq %rax, %rdi
cmpl %r12d, %r15d
jg 0x2fa921
movzbl %r13b, %eax
leaq 0x38d9a2(%rip), %rcx    # 0x688310
movzbl (%rax,%rcx), %eax
orl %eax, %ebp
movslq %ebx, %rax
movl %ebp, (%rdi,%rax,4)
incl %ebx
movl $0x10, %eax
movslq %ebx, %rcx
movl %eax, (%rdi,%rcx,4)
movslq %r15d, %rbx
movq %rdi, %r14
leaq (,%rbx,4), %rdi
callq 0x29b190
movq %r14, %rdi
testl %ebx, %ebx
jle 0x2fa9c4
movl %r15d, %ecx
decq %rcx
xorl %edx, %edx
movl (%rdi,%rcx,4), %esi
movl %esi, (%rax,%rdx,4)
movl (%rdi,%rdx,4), %esi
movl %esi, (%rax,%rcx,4)
incq %rdx
leaq -0x1(%rcx), %rsi
cmpq %rcx, %rdx
movq %rsi, %rcx
jl 0x2fa9a9
movq 0xa0(%rsp), %r14
movq %rax, (%r14)
movl %r15d, 0x8(%r14)
movq %rdi, %rbx
movq 0x30(%rsp), %rdi
callq 0x29b170
movq 0x20(%rsp), %rdi
callq 0x29b170
movq 0x78(%rsp), %rdi
callq 0x29b170
movq 0x80(%rsp), %rdi
callq 0x29b170
movq %rbx, %rdi
callq 0x29b170
jmp 0x2fa672
movl $0x10, %r14d
xorl %ebx, %ebx
movb $0x4d, %al
xorl %ebp, %ebp
jmp 0x2fa827