// File: /workspace/github_c_makefile_star2_O1/lh3[P]pre-pe/pre-meta.c
// Function: lt_process
void lt_process(const lt_global_t *g, bseq1_t s[2])
{
	int i, k, mlen, oligo_len;
	mlen = s[0].l_seq > s[1].l_seq? s[0].l_seq : s[1].l_seq;
	oligo_len = strlen(lt_oligo_for);

	// trim heading and trailing N
	for (k = 0; k < 2; ++k) {
		bseq1_t *sk = &s[k];
		for (i = sk->l_seq - 1; i >= 0; --i) // trim trailing "N"
			if (sk->seq[i] != 'N') break;
		sk->l_seq = i + 1;
		sk->seq[sk->l_seq] = sk->qual[sk->l_seq] = 0;
		for (i = 0; i < sk->l_seq; ++i) // trim heading "N"
			if (sk->seq[i] != 'N') break;
		if (i) trim_bseq_5(sk, i);
	}
	
	// trim Illumina PE adapters
	trim_adap(&s[0], lt_adapter1, 0, g->opt.min_adap_len, g->opt.max_adap_pen, 1);
	trim_adap(&s[1], lt_adapter2, 0, g->opt.min_adap_len, g->opt.max_adap_pen, 1);
	
	// trim transposon sequences and store barcodes
	int olig_pos[2];
	char *bc[2];
	
	for (k = 0; k < 2; ++k) {
		olig_pos[k] = 0;
		bc[k] = (char*)alloca(mlen + 1);
		bc[k][0] = 0;
		trim_olig(&s[k], lt_oligo_for, 1, g->opt.min_olig_len, g->opt.max_olig_pen, &olig_pos[k], bc[k], 1);
		trim_olig(&s[k], lt_oligo_rev, 0, g->opt.min_olig_len, g->opt.max_olig_pen, 0, 0, 0);
        trim_adap(&s[k], lt_oligo_rev, 0, g->opt.min_adap_len, g->opt.max_adap_pen, 1);
	}

	
	{ // merge the two ends
		int n_fh, n_rh, n_ch;
		uint64_t fh[2], rh[2], ch[2];
		char *rseq, *rqual, *xseq, *xqual;
		rseq = (char*)alloca(mlen + 1);
		rqual = (char*)alloca(mlen + 1);
		xseq = (char*)alloca(s[0].l_seq + s[1].l_seq + 1);
		xqual = (char*)alloca(s[0].l_seq + s[1].l_seq + 1);
		// reverse the other read
		lt_seq_revcomp(s[1].l_seq, s[1].seq, rseq);
		lt_seq_rev(s[1].l_seq, s[1].qual, rqual);
		// find overlaps
		n_fh = lt_ue_for(s[0].l_seq, s[0].seq, s[0].qual, s[1].l_seq, rseq, rqual, g->opt.max_ovlp_pen, g->opt.min_ovlp_len, 2, fh);
		if (fh[0]>>32 == 0 && s[0].l_seq == s[1].l_seq && (int32_t)fh[0] == s[0].l_seq) n_rh = 0; // complete overlap; don't test ue_rev()
		else n_rh = lt_ue_rev(s[0].l_seq, &s[0].seq[0], &s[0].qual[0], s[1].l_seq, rseq, rqual, g->opt.max_ovlp_pen, g->opt.min_ovlp_len, 2, rh);
		n_ch = lt_ue_contained(s[0].l_seq, &s[0].seq[0], &s[0].qual[0], s[1].l_seq, rseq, rqual, g->opt.max_ovlp_pen, 2, ch);
		if (n_fh + n_rh + n_ch > 1) {
			s[0].type = s[1].type = LT_MERGE_AMBIGUOUS;
		} else if (n_fh + n_rh + n_ch == 0) {
			s[0].type = s[1].type = LT_NO_MERGE;
		} else {
			int x = 0;
			if (n_fh == 1) {
				int l = (uint32_t)fh[0], st = fh[0]>>32;
				if (l < s[1].l_seq) { // partial overlap
					s[0].type = s[1].type = LT_MERGE_PARTIAL;
					for (i = 0; i < st; ++i)
						xseq[x] = s[0].seq[i], xqual[x++] = s[0].qual[i];
					for (i = 0; i < l; ++i) {
						int j = st + i, y;
						y = merge_base(g->opt.max_qual, g->opt.qmask, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
						xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
					}
					for (i = l; i < s[1].l_seq; ++i)
						xseq[x] = rseq[i], xqual[x++] = rqual[i];
				} else { // s[1] is contained in s[0]
					s[0].type = s[1].type = LT_MERGE_COMPLETE;
					for (i = 0; i < l; ++i) {
						int j = st + i, y;
						y = merge_base(g->opt.max_qual, g->opt.qmask, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
						xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
					}
				}
			} else if (n_rh == 1) {
				int l = (uint32_t)rh[0], st = rh[0]>>32;
				s[0].type = s[1].type = LT_MERGE_COMPLETE;
				for (i = 0; i < s[0].l_seq - st - l; ++i)
					xseq[x] = s[0].seq[i], xqual[x++] = s[0].qual[i];
				for (i = s[1].l_seq - l; i < s[1].l_seq; ++i) {
					int j = i - s[1].l_seq + (s[0].l_seq - st), y;
					y = merge_base(g->opt.max_qual, g->opt.qmask, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
					xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
				}
			} else { // s[0] is contained in s[1]
				int j, st = ch[0]>>32;
				s[0].type = s[1].type = LT_MERGE_COMPLETE;
				for (j = 0; j < s[0].l_seq; ++j) {
					int i = j + st, y;
					y = merge_base(g->opt.max_qual, g->opt.qmask, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
					xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
				}
			}
			xseq[x] = xqual[x] = 0;
			if (x < g->opt.min_seq_len) s[0].type = s[1].type = LT_SHORT_SEQ;
			free(s[0].seq); free(s[0].qual);
			s[0].seq = strdup(xseq);
			s[0].qual = strdup(xqual);
			s[0].l_seq = x;
			s[1].l_seq = 0;
		}
	}
	
	// check whether read length is too short
    if (s[0].l_seq < g->opt.min_seq_len) {
        if (s[0].type == LT_MERGE_PARTIAL || s[0].type == LT_MERGE_COMPLETE) { // single-end
            s[0].type = s[1].type = LT_SHORT_SEQ;
        } else if (s[1].l_seq >= g->opt.min_seq_len) { // read 1 is short, but read 2 is not => swap
			char *tmp;
			tmp = s[0].seq, s[0].seq = s[1].seq, s[1].seq = tmp;
			tmp = s[0].qual, s[0].qual = s[1].qual, s[1].qual = tmp;
			tmp = bc[0], bc[0] = bc[1], bc[1] = tmp;
			i = olig_pos[0], olig_pos[0] = olig_pos[1], olig_pos[1] = i;
			i = s[0].l_seq, s[0].l_seq = s[1].l_seq, s[1].l_seq = i;
            s[0].type = s[1].type = LT_SHORT_PE_SWAP;
        } else {
            s[0].type = s[1].type = LT_SHORT_SEQ;
        }
    } else if (s[0].type != LT_MERGE_PARTIAL && s[0].type != LT_MERGE_COMPLETE && s[1].l_seq < g->opt.min_seq_len) { // read 2 is short, but read 1 is not
        s[0].type = s[1].type = LT_SHORT_PE;
    }
    
    // record the barcodes
	for (k = 0; k < 2; ++k) {
		s[k].olig_pos_f = olig_pos[0];
		s[k].olig_pos_r = olig_pos[1];
		s[k].bc_f = strdup(bc[0]);
		s[k].bc_r = strdup(bc[1]);
		if (s[k].olig_pos_f > oligo_len + g->opt.bc_cut && s[k].olig_pos_r > oligo_len + g->opt.bc_cut) {
			int l[2];
			l[0] = s[k].olig_pos_f - (oligo_len + g->opt.bc_cut);
			l[1] = s[k].olig_pos_r - (oligo_len + g->opt.bc_cut);
			s[k].bc_cat = (char*)calloc(l[0] + l[1] + 1, 1);
			strncpy(s[k].bc_cat,        &s[k].bc_f[g->opt.bc_cut], l[0]);
			strncpy(&s[k].bc_cat[l[0]], &s[k].bc_r[g->opt.bc_cut], l[1]);
		} else s[k].bc_cat = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r15
movq %rdi, -0x60(%rbp)
movl (%rsi), %eax
movq %rax, -0x30(%rbp)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl 0x40(%rsi), %eax
movl %eax, -0x38(%rbp)
movq 0x4001(%rip), %rdi      # 0x7170
callq 0x20c0
movq %rax, -0xd8(%rbp)
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movq %r15, -0x80(%rbp)
movq %r13, %rax
shlq $0x6, %rax
leaq (%r15,%rax), %r14
movl (%r15,%rax), %eax
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %r15d, %r15d
testq %rdx, %rdx
jle 0x31bd
leaq -0x1(%rdx), %rcx
movq 0x18(%r14), %rsi
cmpb $0x4e, -0x1(%rsi,%rdx)
movq %rcx, %rdx
je 0x319f
incl %ecx
jmp 0x31bf
xorl %ecx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, (%r14)
movq 0x20(%r14), %rax
movb %r15b, (%rax,%rcx)
movq 0x18(%r14), %rax
movl (%r14), %ecx
andq %r12, %rcx
movb %r15b, (%rax,%rcx)
movl (%r14), %eax
andq %r12, %rax
je 0x3206
movq 0x18(%r14), %rcx
xorl %r15d, %r15d
cmpb $0x4e, (%rcx,%r15)
jne 0x3206
incq %r15
cmpq %r15, %rax
jne 0x31f4
movl %eax, %r15d
testl %r15d, %r15d
je 0x326a
movq 0x18(%r14), %rdi
movl %r15d, %ebx
leaq (%rdi,%rbx), %rsi
subl %r15d, %eax
movslq %eax, %rdx
callq 0x21e0
movq 0x20(%r14), %rdi
addq %rdi, %rbx
movl (%r14), %edx
andq %r12, %rdx
movslq %r15d, %rax
subq %rax, %rdx
movq %rbx, %rsi
callq 0x21e0
movl (%r14), %eax
movl %eax, %ecx
subl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, (%r14)
movq 0x20(%r14), %rax
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x18(%r14), %rax
movl (%r14), %ecx
andq %r12, %rcx
movb %dl, (%rax,%rcx)
leaq 0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
movq -0x80(%rbp), %r15
je 0x3188
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rax
andl %ebx, %eax
movl -0x38(%rbp), %ecx
cmpl %ecx, %eax
cmovbel %ecx, %eax
movq %rax, -0x30(%rbp)
movq 0x3ec4(%rip), %r12      # 0x7160
movq -0x60(%rbp), %rax
movl 0x18(%rax), %ecx
movq %rcx, -0x38(%rbp)
movl 0x1c(%rax), %eax
movq %rax, -0x58(%rbp)
movq %r12, %rdi
callq 0x20c0
movl (%r15), %r14d
andl %r14d, %ebx
movq 0x18(%r15), %rsi
movq %r15, %r13
movq 0x20(%r15), %r15
leaq -0x180(%rbp), %r10
movl %ebx, %edi
movq %r15, %rdx
movl %eax, %ecx
movq %r12, %r8
movq -0x58(%rbp), %r12
xorl %r9d, %r9d
pushq %r10
pushq $0x4
pushq %r12
pushq -0x38(%rbp)
callq 0x2a01
addq $0x20, %rsp
testl %eax, %eax
jle 0x3360
decl %eax
movq -0x180(%rbp,%rax,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
subl %eax, %ebx
cmpl %r12d, %ebx
jle 0x3345
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %r14d      # imm = 0x80000000
orl %ecx, %r14d
movq -0x80(%rbp), %r13
movl %r14d, (%r13)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andq %rcx, %rax
xorl %edx, %edx
movb %dl, (%r15,%rax)
movq 0x18(%r13), %rax
movl (%r13), %esi
andq %rcx, %rsi
movb %dl, (%rax,%rsi)
jmp 0x3360
sarq $0x20, %rcx
addq %rcx, %r15
movslq %ebx, %rdx
movq %r15, %rdi
movl $0x22, %esi
callq 0x2110
movq -0x80(%rbp), %r13
movq 0x3e01(%rip), %r12      # 0x7168
movq -0x60(%rbp), %rax
movl 0x18(%rax), %ecx
movq %rcx, -0x38(%rbp)
movl 0x1c(%rax), %ebx
movq %r12, %rdi
callq 0x20c0
movl 0x40(%r13), %r14d
movl %r14d, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq 0x58(%r13), %rsi
movq 0x60(%r13), %rdx
movl %r15d, %edi
movq %rdx, -0x58(%rbp)
movl %eax, %ecx
movq %r12, %r8
xorl %r9d, %r9d
leaq -0x180(%rbp), %rax
pushq %rax
pushq $0x4
pushq %rbx
pushq -0x38(%rbp)
callq 0x2a01
addq $0x20, %rsp
testl %eax, %eax
jle 0x342d
decl %eax
movq -0x180(%rbp,%rax,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
subl %eax, %r15d
cmpl %ebx, %r15d
jle 0x3411
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %r14d      # imm = 0x80000000
orl %ecx, %r14d
movq -0x80(%rbp), %r13
movl %r14d, 0x40(%r13)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andq %rcx, %rax
xorl %edx, %edx
movq -0x58(%rbp), %rsi
movb %dl, (%rsi,%rax)
movq 0x58(%r13), %rax
movl 0x40(%r13), %esi
andq %rcx, %rsi
movb %dl, (%rax,%rsi)
jmp 0x342d
sarq $0x20, %rcx
movq -0x58(%rbp), %rdi
addq %rcx, %rdi
movslq %r15d, %rdx
movl $0x22, %esi
callq 0x2110
movq -0x80(%rbp), %r13
movq -0x30(%rbp), %rax
incl %eax
addl $0xf, %eax
andl $-0x10, %eax
movq %rax, -0x78(%rbp)
movq %r13, %r15
xorl %ecx, %ecx
leaq (%rcx,%rbp), %r9
addq $-0xa8, %r9
movl $0x0, (%r9)
movq %rsp, %rax
subq -0x78(%rbp), %rax
movq %rax, %rsp
movq %rcx, -0x38(%rbp)
movq %rax, -0xc0(%rbp,%rcx,2)
movb $0x0, (%rax)
movq 0x3cfc(%rip), %rsi      # 0x7170
movq -0x60(%rbp), %rbx
movl 0x20(%rbx), %r8d
movl 0x24(%rbx), %ecx
movq %r15, %rdi
movl $0x1, %edx
pushq $0x1
pushq %rax
callq 0x40f7
addq $0x10, %rsp
movq 0x3cde(%rip), %r13      # 0x7178
movl 0x20(%rbx), %eax
movq %rax, -0x58(%rbp)
movl 0x24(%rbx), %ebx
movq %r13, %rdi
callq 0x20c0
movl (%r15), %r14d
movl %r14d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movl %r12d, %edi
movq %rdx, -0x68(%rbp)
movl %eax, %ecx
movq %r13, %r8
xorl %r9d, %r9d
leaq -0x180(%rbp), %rax
pushq %rax
pushq $0x10
pushq %rbx
pushq -0x58(%rbp)
callq 0x2a01
addq $0x20, %rsp
testl %eax, %eax
jle 0x3551
decl %eax
movq -0x180(%rbp,%rax,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
subl %eax, %r12d
cmpl %ebx, %r12d
jle 0x3539
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %r14d      # imm = 0x80000000
orl %ecx, %r14d
movl %r14d, (%r15)
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andq %rsi, %rax
xorl %edx, %edx
movq -0x68(%rbp), %rcx
movb %dl, (%rcx,%rax)
movq 0x18(%r15), %rax
movl (%r15), %ecx
andq %rsi, %rcx
movb %dl, (%rax,%rcx)
jmp 0x3551
sarq $0x20, %rcx
movq -0x68(%rbp), %rdi
addq %rcx, %rdi
movslq %r12d, %rdx
movl $0x22, %esi
callq 0x2110
movq 0x3c20(%rip), %r13      # 0x7178
movq -0x60(%rbp), %rax
movl 0x18(%rax), %ecx
movq %rcx, -0x58(%rbp)
movl 0x1c(%rax), %ebx
movq %r13, %rdi
callq 0x20c0
movl (%r15), %r14d
movl %r14d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movl %r12d, %edi
movq %rdx, -0x68(%rbp)
movl %eax, %ecx
movq %r13, %r8
xorl %r9d, %r9d
leaq -0x180(%rbp), %rax
pushq %rax
pushq $0x4
pushq %rbx
pushq -0x58(%rbp)
callq 0x2a01
addq $0x20, %rsp
testl %eax, %eax
jle 0x3613
decl %eax
movq -0x180(%rbp,%rax,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
subl %eax, %r12d
cmpl %ebx, %r12d
jle 0x35fb
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %r14d      # imm = 0x80000000
orl %ecx, %r14d
movl %r14d, (%r15)
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andq %rsi, %rax
xorl %edx, %edx
movq -0x68(%rbp), %rcx
movb %dl, (%rcx,%rax)
movq 0x18(%r15), %rax
movl (%r15), %ecx
andq %rsi, %rcx
movb %dl, (%rax,%rcx)
jmp 0x3613
sarq $0x20, %rcx
movq -0x68(%rbp), %rdi
addq %rcx, %rdi
movslq %r12d, %rdx
movl $0x22, %esi
callq 0x2110
movq -0x38(%rbp), %rcx
addq $0x4, %rcx
addq $0x40, %r15
cmpq $0x4, %rcx
je 0x3442
movq %rsp, %rbx
movq -0x30(%rbp), %rax
addl $0x10, %eax
andl $-0x10, %eax
subq %rax, %rbx
movq %rbx, %rsp
movq %rsp, %r13
subq %rax, %r13
movq %r13, %rsp
movq -0x80(%rbp), %r15
movl (%r15), %edi
movl 0x40(%r15), %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdi
andq %rax, %r8
leal (%rdi,%r8), %eax
incl %eax
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
testq %r8, %r8
je 0x36b5
movq 0x58(%r15), %rax
leaq 0x3aed(%rip), %rcx      # 0x7180
movq %r8, %rdx
movsbq (%rax), %rsi
testq %rsi, %rsi
js 0x36a5
movb (%rsi,%rcx), %sil
jmp 0x36a8
movb $0x4e, %sil
movb %sil, -0x1(%rbx,%rdx)
incq %rax
decq %rdx
jne 0x3696
movb $0x0, (%rbx,%r8)
testl %r8d, %r8d
je 0x36d5
movq 0x60(%r15), %rax
movl %r8d, %ecx
movb (%rax), %dl
movb %dl, -0x1(%r13,%rcx)
incq %rax
decq %rcx
jne 0x36c6
movb $0x0, (%r13,%r8)
movq %r8, %rcx
movq 0x18(%r15), %r12
movq 0x20(%r15), %r14
movq -0x60(%rbp), %rax
movl 0x10(%rax), %r10d
movl 0x14(%rax), %r11d
movq %r12, %rsi
movq %r14, %rdx
movq %r8, -0x70(%rbp)
movq %rdi, -0x40(%rbp)
movq %rbx, %r8
movq %r13, %r9
leaq -0x180(%rbp), %rax
pushq %rax
pushq $0x2
movq %r11, -0x30(%rbp)
pushq %r11
movq %r10, -0x98(%rbp)
pushq %r10
callq 0x2a01
movq -0x40(%rbp), %rdi
addq $0x20, %rsp
movq %rax, -0xa0(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x88(%rbp)
shrq $0x20, %rax
movq %rax, -0x38(%rbp)
jne 0x375f
movl %edi, %edx
xorl -0x70(%rbp), %edx
movq -0x88(%rbp), %rcx
xorl %edi, %ecx
xorl %eax, %eax
orl %edx, %ecx
je 0x378f
leaq -0x100(%rbp), %rax
movq %r12, %rsi
movq %r14, %rdx
movq -0x70(%rbp), %rcx
movq %rbx, %r8
movq %r13, %r9
pushq %rax
pushq $0x2
pushq -0x30(%rbp)
pushq -0x98(%rbp)
callq 0x2b22
movq -0x40(%rbp), %rdi
addq $0x20, %rsp
subq $0x8, %rsp
leaq -0xf0(%rbp), %r10
movq %r12, -0x48(%rbp)
movq %r12, %rsi
movq %rax, %r12
movq %r14, -0x30(%rbp)
movq %r14, %rdx
movq -0x70(%rbp), %r14
movl %r14d, %ecx
movq %rbx, -0x50(%rbp)
movq %rbx, %r8
movq %r13, %r9
pushq %r10
pushq $0x2
pushq -0x98(%rbp)
callq 0x2c08
addq $0x20, %rsp
movq -0xa0(%rbp), %rdx
addl %r12d, %eax
addl %edx, %eax
cmpl $0x2, %eax
jl 0x37e7
movl $0x1f, %eax
jmp 0x3856
testl %eax, %eax
je 0x3851
cmpl $0x1, %edx
jne 0x3863
movq %r14, %r12
movq -0x88(%rbp), %r14
cmpl %r14d, %r12d
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
jle 0x38f3
movl $0x16, %eax
movl %eax, 0x44(%r15)
movl %eax, 0x4(%r15)
movq -0x38(%rbp), %rbx
testl %ebx, %ebx
movq %r13, -0x58(%rbp)
jle 0x3b7a
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rbx, %rdx
callq 0x2160
movq -0x78(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rbx, %rdx
callq 0x2160
movq -0x50(%rbp), %rsi
jmp 0x3b82
movl $0x20, %eax
movl %eax, 0x44(%r15)
movl %eax, 0x4(%r15)
jmp 0x3f2f
movq %r12, %rsi
cmpl $0x1, %esi
movq -0x50(%rbp), %rdx
movq -0x30(%rbp), %rsi
jne 0x3a38
movq -0x100(%rbp), %r8
movq %r15, %rcx
movq %r8, %r15
shrq $0x20, %r15
movl $0x15, %eax
movl %eax, 0x44(%rcx)
movl %eax, 0x4(%rcx)
addl %r8d, %r15d
movq -0x40(%rbp), %r12
movl %r12d, %r14d
subl %r15d, %r14d
testl %r14d, %r14d
movq -0x48(%rbp), %rdi
jle 0x3d10
movl %r15d, %ebx
notl %ebx
addl %r12d, %ebx
incq %rbx
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rbx, %rdx
movq %r8, -0x38(%rbp)
callq 0x2160
movq -0x78(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rbx, %rdx
callq 0x2160
movq -0x38(%rbp), %r8
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
subl %r15d, %r12d
movl %r12d, %ecx
jmp 0x3d12
movl $0x15, %eax
movl %eax, 0x44(%r15)
movl %eax, 0x4(%r15)
testl %r14d, %r14d
jle 0x3e58
movq %r13, -0x58(%rbp)
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x70(%rbp)
movq %r14, %rax
sarq $0x20, %rax
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rcx
addq %rax, %rcx
movq %rcx, -0x40(%rbp)
addq %rax, %rdx
xorl %ecx, %ecx
movq %rdx, -0x30(%rbp)
movq %r14, -0x88(%rbp)
movq -0x40(%rbp), %rax
movsbq (%rax,%rcx), %r12
movsbl (%rdx,%rcx), %r14d
movsbq (%rsi,%rcx), %r13
movq -0x58(%rbp), %rax
movq %rcx, -0x38(%rbp)
movsbl (%rax,%rcx), %r15d
cmpb %r13b, %r12b
jne 0x39b4
cmpb %r15b, %r14b
movl %r15d, %eax
cmovgl %r14d, %eax
cmpb %r15b, %r14b
cmovll %r14d, %r15d
movl %r15d, %ecx
addl $-0x21, %ecx
shrl $0x1f, %ecx
addl %r15d, %ecx
addl $-0x21, %ecx
sarl %ecx
leal (%rax,%rcx), %ebx
addl $-0x21, %ebx
callq 0x2030
cmpl -0x70(%rbp), %ebx
jl 0x399a
movl -0x70(%rbp), %ebx
movq (%rax), %rax
shll $0x8, %ebx
addl $0x2100, %ebx           # imm = 0x2100
orl (%rax,%r12,4), %ebx
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
jmp 0x39d0
movq -0x60(%rbp), %rax
movl 0x30(%rax), %eax
leal -0x21(%r14), %ecx
cmpl %eax, %ecx
jl 0x39fa
leal -0x21(%r15), %ecx
movl $0x214e, %ebx           # imm = 0x214E
cmpl %eax, %ecx
jl 0x39fa
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
movb %bl, (%rax,%rcx)
movq -0x78(%rbp), %rax
movb %bh, (%rax,%rcx)
incq %rcx
movq -0x88(%rbp), %r14
cmpq %rcx, %r14
jne 0x3940
jmp 0x3b71
callq 0x2030
movq (%rax), %rax
cmpb %r15b, %r14b
jle 0x3a1e
subl %r15d, %r14d
shll $0x8, %r14d
addl $0x2100, %r14d          # imm = 0x2100
orl (%rax,%r12,4), %r14d
movl %r14d, %ebx
jmp 0x39aa
subl %r14d, %r15d
shll $0x8, %r15d
addl $0x2100, %r15d          # imm = 0x2100
orl (%rax,%r13,4), %r15d
movl %r15d, %ebx
jmp 0x39aa
movq -0xf0(%rbp), %rax
movl $0x15, %ecx
movl %ecx, 0x44(%r15)
movl %ecx, 0x4(%r15)
movq -0x40(%rbp), %r8
testl %r8d, %r8d
movq -0x48(%rbp), %rdi
je 0x3e5c
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, -0x70(%rbp)
sarq $0x20, %rax
addq %rax, %rdx
addq %rax, %r13
movq %r13, -0x58(%rbp)
xorl %ecx, %ecx
movq %rdx, -0x50(%rbp)
movsbq (%rdi,%rcx), %r14
movsbl (%rsi,%rcx), %r13d
movsbq (%rdx,%rcx), %r15
movq -0x58(%rbp), %rax
movq %rcx, -0x38(%rbp)
movsbl (%rax,%rcx), %r12d
cmpb %r15b, %r14b
jne 0x3af3
cmpb %r12b, %r13b
movl %r12d, %eax
cmovgl %r13d, %eax
cmpb %r12b, %r13b
cmovll %r13d, %r12d
movl %r12d, %ecx
addl $-0x21, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
addl $-0x21, %ecx
sarl %ecx
leal (%rax,%rcx), %ebx
addl $-0x21, %ebx
callq 0x2030
cmpl -0x70(%rbp), %ebx
jl 0x3ad1
movl -0x70(%rbp), %ebx
movq (%rax), %rax
shll $0x8, %ebx
addl $0x2100, %ebx           # imm = 0x2100
orl (%rax,%r14,4), %ebx
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %r8
jmp 0x3b10
movq -0x60(%rbp), %rax
movl 0x30(%rax), %eax
leal -0x21(%r13), %ecx
cmpl %eax, %ecx
jl 0x3b33
leal -0x21(%r12), %ecx
movl $0x214e, %ebx           # imm = 0x214E
cmpl %eax, %ecx
jl 0x3b33
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
movb %bl, (%rax,%rcx)
movq -0x78(%rbp), %rax
movb %bh, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r8
jne 0x3a7b
jmp 0x3e52
callq 0x2030
movq (%rax), %rax
cmpb %r12b, %r13b
jle 0x3b57
subl %r12d, %r13d
shll $0x8, %r13d
addl $0x2100, %r13d          # imm = 0x2100
orl (%rax,%r14,4), %r13d
movl %r13d, %ebx
jmp 0x3ae1
subl %r13d, %r12d
shll $0x8, %r12d
addl $0x2100, %r12d          # imm = 0x2100
orl (%rax,%r15,4), %r12d
movl %r12d, %ebx
jmp 0x3ae1
movq -0x80(%rbp), %r15
jmp 0x3ebe
movq $0x0, -0x38(%rbp)
testl %r14d, %r14d
jle 0x3e60
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x8c(%rbp)
movq %r14, %rax
sarq $0x20, %rax
movq -0x38(%rbp), %rdx
movl %edx, %edx
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq %r14, -0x98(%rbp)
movq -0x78(%rbp), %rcx
addq %rdx, %rcx
movq %rcx, -0xa0(%rbp)
movq -0x68(%rbp), %rcx
movq %rdx, -0x38(%rbp)
addq %rdx, %rcx
movq %rcx, -0xd0(%rbp)
movq -0x48(%rbp), %rcx
addq %rax, %rcx
movq %rcx, -0xc8(%rbp)
movq -0x30(%rbp), %rdx
addq %rax, %rdx
xorl %edi, %edi
movq %rdx, -0x30(%rbp)
movq -0xc8(%rbp), %rax
movsbq (%rax,%rdi), %r8
movsbl (%rdx,%rdi), %r14d
movsbq (%rsi,%rdi), %r13
movq -0x58(%rbp), %rax
movsbl (%rax,%rdi), %r12d
cmpb %r13b, %r8b
jne 0x3c72
movq %r8, %r13
movq %rdi, -0x40(%rbp)
cmpb %r12b, %r14b
movl %r12d, %eax
cmovgl %r14d, %eax
cmpb %r12b, %r14b
cmovll %r14d, %r12d
movl %r12d, %ecx
addl $-0x21, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
addl $-0x21, %ecx
sarl %ecx
leal (%rax,%rcx), %ebx
addl $-0x21, %ebx
callq 0x2030
cmpl -0x8c(%rbp), %ebx
jl 0x3c54
movl -0x8c(%rbp), %ebx
movq (%rax), %rax
shll $0x8, %ebx
addl $0x2100, %ebx           # imm = 0x2100
orl (%rax,%r13,4), %ebx
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rdi
jmp 0x3c8f
movq -0x60(%rbp), %rax
movl 0x30(%rax), %eax
leal -0x21(%r14), %ecx
cmpl %eax, %ecx
jl 0x3cb5
leal -0x21(%r12), %ecx
movl $0x214e, %ebx           # imm = 0x214E
cmpl %eax, %ecx
jl 0x3cb5
movq -0xd0(%rbp), %rax
movb %bl, (%rax,%rdi)
movq -0xa0(%rbp), %rax
movb %bh, (%rax,%rdi)
incq %rdi
cmpq %rdi, -0x98(%rbp)
jne 0x3bee
jmp 0x3cfa
movq %r8, %rbx
movq %rdi, -0x40(%rbp)
callq 0x2030
movq (%rax), %rax
cmpb %r12b, %r14b
jle 0x3ce0
subl %r12d, %r14d
shll $0x8, %r14d
addl $0x2100, %r14d          # imm = 0x2100
orl (%rax,%rbx,4), %r14d
movl %r14d, %ebx
jmp 0x3c64
subl %r14d, %r12d
shll $0x8, %r12d
addl $0x2100, %r12d          # imm = 0x2100
orl (%rax,%r13,4), %r12d
movl %r12d, %ebx
jmp 0x3c64
movq -0x38(%rbp), %rcx
addl %edi, %ecx
movq -0x70(%rbp), %r12
movq -0x88(%rbp), %r14
jmp 0x3e64
xorl %ecx, %ecx
testl %r8d, %r8d
jle 0x3e52
movq %r13, -0x58(%rbp)
movq -0x70(%rbp), %rsi
movl %esi, %eax
movq %rax, -0x88(%rbp)
subl %r8d, %esi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x70(%rbp)
movslq %esi, %r12
movl %ecx, %ecx
movq -0x30(%rbp), %rsi
movq %rcx, -0x38(%rbp)
movslq %r14d, %rax
movsbq (%rdi,%rax), %r8
movsbl (%rsi,%rax), %r13d
movsbq (%rdx,%r12), %r9
movq -0x58(%rbp), %rax
movsbl (%rax,%r12), %r15d
cmpb %r9b, %r8b
jne 0x3dc0
movq %r8, -0x40(%rbp)
cmpb %r15b, %r13b
movl %r15d, %eax
cmovgl %r13d, %eax
cmpb %r15b, %r13b
cmovll %r13d, %r15d
movl %r15d, %ecx
addl $-0x21, %ecx
shrl $0x1f, %ecx
addl %r15d, %ecx
addl $-0x21, %ecx
sarl %ecx
leal (%rax,%rcx), %ebx
addl $-0x21, %ebx
callq 0x2030
cmpl -0x70(%rbp), %ebx
jl 0x3d9f
movl -0x70(%rbp), %ebx
movq (%rax), %rax
shll $0x8, %ebx
addl $0x2100, %ebx           # imm = 0x2100
movq -0x40(%rbp), %rcx
orl (%rax,%rcx,4), %ebx
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
jmp 0x3ddc
movq -0x60(%rbp), %rax
movl 0x30(%rax), %eax
leal -0x21(%r13), %ecx
cmpl %eax, %ecx
jl 0x3e06
leal -0x21(%r15), %ecx
movl $0x214e, %ebx           # imm = 0x214E
cmpl %eax, %ecx
jl 0x3e06
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
movb %bl, (%rax,%rcx)
movq -0x78(%rbp), %rax
movb %bh, (%rax,%rcx)
incq %rcx
incq %r12
incl %r14d
cmpq -0x88(%rbp), %r12
jl 0x3d42
jmp 0x3e52
movq %r9, %rbx
movq %r8, -0x40(%rbp)
callq 0x2030
movq (%rax), %rax
cmpb %r15b, %r13b
jle 0x3e38
subl %r15d, %r13d
shll $0x8, %r13d
addl $0x2100, %r13d          # imm = 0x2100
movq -0x40(%rbp), %rcx
orl (%rax,%rcx,4), %r13d
movl %r13d, %ebx
jmp 0x3db2
subl %r13d, %r15d
shll $0x8, %r15d
addl $0x2100, %r15d          # imm = 0x2100
orl (%rax,%rbx,4), %r15d
movl %r15d, %ebx
jmp 0x3db2
movq -0x80(%rbp), %r15
jmp 0x3ec2
xorl %ecx, %ecx
jmp 0x3ebe
xorl %ecx, %ecx
jmp 0x3ec2
movq -0x38(%rbp), %rcx
cmpl %r14d, %r12d
jle 0x3ebe
movl %ecx, %ecx
movq -0x68(%rbp), %rax
leaq (%rax,%rcx), %rdi
movslq %r14d, %rbx
addq %rbx, %rsi
notl %r14d
addl %r12d, %r14d
incq %r14
movq %r14, %rdx
movq %rcx, %r13
callq 0x2160
movq -0x78(%rbp), %rax
movq %r13, -0x38(%rbp)
leaq (%rax,%r13), %rdi
movq -0x58(%rbp), %rsi
addq %rbx, %rsi
movq %r14, %rdx
callq 0x2160
movl %r12d, %eax
subq %rax, %rbx
xorl %eax, %eax
decq %rax
cmpq %rax, %rbx
jne 0x3eb0
movq -0x38(%rbp), %rcx
subl %eax, %ecx
movq -0x48(%rbp), %rdi
movq %rcx, %rbx
movslq %ecx, %rax
xorl %ecx, %ecx
movq -0x78(%rbp), %rdx
movb %cl, (%rdx,%rax)
movq -0x68(%rbp), %rdx
movb %cl, (%rdx,%rax)
movq -0x60(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3eee
movl $0x2, %eax
movl %eax, 0x44(%r15)
movl %eax, 0x4(%r15)
callq 0x2050
movq 0x20(%r15), %rdi
callq 0x2050
movq -0x68(%rbp), %rdi
callq 0x2250
movq %rax, 0x18(%r15)
movq -0x78(%rbp), %rdi
callq 0x2250
movq %rax, 0x20(%r15)
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl $0x80000000, %eax       # imm = 0x80000000
movl (%r15), %ecx
andl %eax, %ecx
orl %ebx, %ecx
movl %ecx, (%r15)
andl %eax, 0x40(%r15)
movl (%r15), %ecx
movl 0x4(%r15), %edx
movl %ecx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x60(%rbp), %rsi
movl 0x8(%rsi), %edi
addl $-0x15, %edx
cmpl %edi, %eax
jge 0x3fbc
movl $0x2, %esi
cmpl $0x2, %edx
jb 0x3fd3
movl 0x40(%r15), %edx
movl %edx, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
cmpl %edi, %r8d
jl 0x3fd3
movups 0x18(%r15), %xmm0
movups 0x58(%r15), %xmm1
movups %xmm1, 0x18(%r15)
movups %xmm0, 0x58(%r15)
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movq %rsi, -0xb8(%rbp)
rolq $0x20, -0xa8(%rbp)
movl $0x80000000, %esi       # imm = 0x80000000
andl %esi, %ecx
orl %ecx, %r8d
movl %r8d, (%r15)
andl %esi, %edx
orl %eax, %edx
movl %edx, 0x40(%r15)
movl $0x4, %esi
jmp 0x3fd3
cmpl $0x2, %edx
jb 0x3fdb
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl 0x40(%r15), %eax
movl $0x3, %esi
cmpl %edi, %eax
jge 0x3fdb
movl %esi, 0x44(%r15)
movl %esi, 0x4(%r15)
movl -0xa8(%rbp), %ecx
movl -0xa4(%rbp), %edx
movq -0xc0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movslq 0x2c(%rax), %rax
movq -0xd8(%rbp), %rsi
movq %rax, -0x78(%rbp)
addl %eax, %esi
movl %ecx, -0x60(%rbp)
movl %ecx, %eax
subl %esi, %eax
setg %cl
movl %edx, -0x38(%rbp)
subl %esi, %edx
setg %r13b
andb %cl, %r13b
leal (%rdx,%rax), %ecx
incl %ecx
movslq %ecx, %rcx
movq %rcx, -0x50(%rbp)
cltq
movq %rax, -0x40(%rbp)
movslq %edx, %rax
movq %rax, -0x48(%rbp)
xorl %r12d, %r12d
movb %r13b, -0x30(%rbp)
movl -0x60(%rbp), %eax
movl %eax, 0x8(%r15,%r12)
movl -0x38(%rbp), %eax
movl %eax, 0xc(%r15,%r12)
movq -0x58(%rbp), %rdi
callq 0x2250
movq %rax, %rbx
movq %rax, 0x28(%r15,%r12)
movq -0x68(%rbp), %rdi
callq 0x2250
movq %rax, 0x30(%r15,%r12)
testb %r13b, %r13b
je 0x40d1
movq %rax, %r14
movl $0x1, %esi
movq -0x50(%rbp), %rdi
callq 0x2120
movq %rax, %r15
movq -0x80(%rbp), %rax
movq %r15, 0x38(%rax,%r12)
movq -0x78(%rbp), %r13
addq %r13, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq -0x40(%rbp), %rbx
movq %rbx, %rdx
callq 0x2070
addq %rbx, %r15
addq %r13, %r14
movb -0x30(%rbp), %r13b
movq %r15, %rdi
movq -0x80(%rbp), %r15
movq %r14, %rsi
movq -0x48(%rbp), %rdx
callq 0x2070
jmp 0x40da
movq $0x0, 0x38(%r15,%r12)
addq $0x40, %r12
cmpq $0x40, %r12
je 0x4048
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq