// File: /workspace/github_c_makefile_star2_O2/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 $0xb8, %rsp
movq %rdi, %r14
movl (%rsi), %ebx
leaq 0x40(%rsi), %rax
movq %rax, -0x38(%rbp)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rsi, -0x58(%rbp)
andl 0x40(%rsi), %eax
movl %eax, -0x30(%rbp)
movq 0x426a(%rip), %rdi      # 0x7160
callq 0x20c0
movq %rax, -0x68(%rbp)
xorl %r13d, %r13d
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
cmpq $0x2, %r12
je 0x2fa0
movq %r12, %rax
shlq $0x6, %rax
movq -0x58(%rbp), %rcx
leaq (%rcx,%rax), %rdi
movl (%rcx,%rax), %eax
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
testq %rdx, %rdx
jle 0x2f50
leaq -0x1(%rdx), %rcx
movq 0x18(%rdi), %rsi
cmpb $0x4e, -0x1(%rsi,%rdx)
movq %rcx, %rdx
je 0x2f2f
incl %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
jmp 0x2f52
xorl %ecx, %ecx
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, (%rdi)
movq 0x20(%rdi), %rax
movl %ecx, %ecx
movb %r13b, (%rax,%rcx)
movq 0x18(%rdi), %rax
movl (%rdi), %ecx
andq %r15, %rcx
movb %r13b, (%rax,%rcx)
movl (%rdi), %esi
andq %r15, %rsi
xorl %eax, %eax
cmpq %rax, %rsi
je 0x2f8f
movq 0x18(%rdi), %rcx
cmpb $0x4e, (%rcx,%rax)
jne 0x2f8d
incq %rax
jmp 0x2f79
movl %eax, %esi
testl %esi, %esi
je 0x2f98
callq 0x370d
incq %r12
jmp 0x2f0b
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl -0x30(%rbp), %eax
cmpl %eax, %ebx
cmovbel %eax, %ebx
movq 0x419b(%rip), %rsi      # 0x7150
movl 0x18(%r14), %ecx
movl 0x1c(%r14), %edx
movq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x3779
movq 0x4188(%rip), %rsi      # 0x7158
movl 0x18(%r14), %ecx
movl 0x1c(%r14), %edx
movq -0x38(%rbp), %rdi
callq 0x3779
incl %ebx
xorl %r13d, %r13d
pushq $0x1
popq %r15
cmpq $0x8, %r13
je 0x3082
leaq -0x90(,%r13), %r9
addq %rbp, %r9
andl $0x0, (%r9)
movq %rsp, %rax
leal 0xf(%rbx), %ecx
andl $-0x10, %ecx
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0xb0(%rbp,%r13,2)
movb $0x0, (%rax)
movq 0x413c(%rip), %rsi      # 0x7160
movl 0x20(%r14), %r8d
movl 0x24(%r14), %ecx
movq %r12, %rdi
movl %r15d, %edx
pushq $0x1
pushq %rax
callq 0x3850
popq %rax
popq %rcx
movq 0x4125(%rip), %rsi      # 0x7168
movl 0x20(%r14), %r8d
movl 0x24(%r14), %ecx
movq %r12, %rdi
xorl %edx, %edx
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
callq 0x3850
popq %rax
popq %rcx
movq 0x4103(%rip), %rsi      # 0x7168
movl 0x18(%r14), %ecx
movl 0x1c(%r14), %edx
movq %r12, %rdi
callq 0x3779
addq $0x4, %r13
addq $0x40, %r12
jmp 0x2fea
movq %rsp, %rax
addl $0xf, %ebx
andl $-0x10, %ebx
subq %rbx, %rax
movq %rax, %rsp
movq %rax, %rdx
movq %rax, -0x30(%rbp)
movq %rsp, %r12
subq %rbx, %r12
movq %r12, %rsp
movq -0x58(%rbp), %rbx
movl (%rbx), %r13d
movl 0x40(%rbx), %eax
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq %r13, -0xa0(%rbp)
andq %r15, %r13
movq %rax, -0x78(%rbp)
andq %rax, %r15
leal (%r15,%r13), %eax
incl %eax
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x98(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rcx, %rsp
movq 0x58(%rbx), %rsi
movl %r15d, %edi
callq 0x2748
movq 0x60(%rbx), %rsi
movl %r15d, %edi
movq %r12, %rdx
callq 0x2718
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rbx
movl 0x10(%r14), %eax
movl 0x14(%r14), %r10d
leaq -0xe0(%rbp), %r11
movl %r13d, %edi
movq %rsi, -0x40(%rbp)
movq %rbx, %rdx
movl %r15d, %ecx
movq -0x30(%rbp), %r8
movq %r12, %r9
pushq %r11
pushq $0x2
movq %r10, -0x50(%rbp)
pushq %r10
movq %rax, -0x48(%rbp)
pushq %rax
callq 0x292f
movq %r15, %rcx
addq $0x20, %rsp
movq %rax, -0x80(%rbp)
leaq -0xe0(%rbp), %rax
movq (%rax), %r15
movq %r15, -0x88(%rbp)
shrq $0x20, %r15
movq %rcx, -0x70(%rbp)
jne 0x3182
movl %r13d, %esi
xorl %ecx, %esi
movq -0x88(%rbp), %rdx
xorl %r13d, %edx
xorl %eax, %eax
orl %esi, %edx
je 0x31b0
leaq -0xd0(%rbp), %rax
movl %r13d, %edi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
movq -0x30(%rbp), %r8
movq %r12, %r9
pushq %rax
pushq $0x2
pushq -0x50(%rbp)
pushq -0x48(%rbp)
callq 0x2a0b
movq -0x70(%rbp), %rcx
addq $0x20, %rsp
subq $0x8, %rsp
leaq -0xc0(%rbp), %r10
movl %r13d, %edi
movq -0x40(%rbp), %rsi
movq %rbx, -0x60(%rbp)
movq %rbx, %rdx
movq -0x30(%rbp), %r8
movq %r12, -0x50(%rbp)
movq %rax, %rbx
movq %r12, %r9
pushq %r10
pushq $0x2
pushq -0x48(%rbp)
callq 0x2acb
addq $0x20, %rsp
movq -0x80(%rbp), %rdi
addl %ebx, %eax
addl %edi, %eax
pushq $0x2
popq %rdx
cmpl $0x2, %eax
jl 0x3215
pushq $0x1f
popq %rax
movq -0x58(%rbp), %rbx
movl %eax, 0x44(%rbx)
movl %eax, 0x4(%rbx)
movq -0x68(%rbp), %r15
movq -0x60(%rbp), %r8
movq -0x78(%rbp), %rsi
jmp 0x356e
movq %rbx, %r9
testl %eax, %eax
movq -0x58(%rbp), %rbx
movq -0x60(%rbp), %r8
movq -0x78(%rbp), %rsi
je 0x327a
cmpl $0x1, %edi
jne 0x328c
movq -0x88(%rbp), %rdi
cmpl %edi, -0x70(%rbp)
movq -0x98(%rbp), %r12
jle 0x32eb
pushq $0x16
popq %rax
movl %eax, 0x44(%rbx)
movl %eax, 0x4(%rbx)
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rsi
cmpq %rax, %r15
je 0x3355
movb (%rdx,%rax), %cl
movb %cl, (%r12,%rax)
movb (%r8,%rax), %cl
movb %cl, (%rsi,%rax)
incq %rax
jmp 0x325e
pushq $0x20
popq %rax
movl %eax, 0x44(%rbx)
movl %eax, 0x4(%rbx)
movq -0x68(%rbp), %r15
jmp 0x356e
cmpl $0x1, %r9d
movq -0x98(%rbp), %r12
jne 0x33d6
movq -0xd0(%rbp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
pushq $0x15
popq %rdx
movl %edx, 0x44(%rbx)
movl %edx, 0x4(%rbx)
addl %eax, %ecx
subl %ecx, %r13d
xorl %ecx, %ecx
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
movq -0x38(%rbp), %rsi
cmpq %rcx, %rbx
je 0x343d
movq -0x40(%rbp), %rdx
movb (%rdx,%rcx), %dl
movb %dl, (%r12,%rcx)
movb (%r8,%rcx), %dl
movb %dl, (%rsi,%rcx)
incq %rcx
jmp 0x32cb
pushq $0x15
popq %rax
movl %eax, 0x44(%rbx)
movl %eax, 0x4(%rbx)
movq %rdi, %rax
sarq $0x20, %rax
movl %edi, %ecx
movq %rcx, -0x48(%rbp)
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax), %r15
addq %rax, %r8
movq %r8, %r13
xorl %ebx, %ebx
cmpq %rbx, -0x48(%rbp)
je 0x34a0
movl 0xc(%r14), %edi
movl 0x30(%r14), %esi
movsbl (%r15,%rbx), %edx
movsbl (%r13,%rbx), %ecx
movq -0x30(%rbp), %rax
movsbl (%rax,%rbx), %r8d
movq -0x50(%rbp), %rax
movsbl (%rax,%rbx), %r9d
callq 0x39d6
movb %al, (%r12,%rbx)
movq -0x38(%rbp), %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
jmp 0x3311
movq %rdi, %rax
sarq $0x20, %rax
xorl %ebx, %ebx
testl %edi, %edi
movl $0x0, %ecx
cmovgl %edi, %ecx
movq %rcx, -0x48(%rbp)
leaq (%rdx,%rax), %rcx
movq %rcx, -0x78(%rbp)
addq %rax, %r8
movq %r8, -0x60(%rbp)
movq -0x38(%rbp), %rax
leaq (%rax,%r15), %r13
leaq (%r12,%r15), %rax
movq %rax, -0x80(%rbp)
cmpq %rbx, -0x48(%rbp)
je 0x34a9
movl 0xc(%r14), %edi
movl 0x30(%r14), %esi
movq -0x78(%rbp), %rax
movsbl (%rax,%rbx), %edx
movq -0x60(%rbp), %rax
movsbl (%rax,%rbx), %ecx
movq -0x30(%rbp), %rax
movsbl (%rax,%rbx), %r8d
movq -0x50(%rbp), %rax
movsbl (%rax,%rbx), %r9d
callq 0x39d6
movq -0x80(%rbp), %rcx
movb %al, (%rcx,%rbx)
movq %r13, %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
jmp 0x338b
movslq -0xbc(%rbp), %rax
pushq $0x15
popq %rcx
movl %ecx, 0x44(%rbx)
movl %ecx, 0x4(%rbx)
addq %rax, -0x30(%rbp)
addq %rax, -0x50(%rbp)
xorl %ebx, %ebx
movq -0x68(%rbp), %r15
cmpq %rbx, %r13
je 0x34e2
movl 0xc(%r14), %edi
movl 0x30(%r14), %esi
movq -0x40(%rbp), %rax
movsbl (%rax,%rbx), %edx
movsbl (%r8,%rbx), %ecx
movq -0x30(%rbp), %rax
movsbl (%rax,%rbx), %r8d
movq -0x50(%rbp), %rax
movsbl (%rax,%rbx), %r9d
callq 0x39d6
movq -0x60(%rbp), %r8
movb %al, (%r12,%rbx)
movq -0x38(%rbp), %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
jmp 0x33f4
movq -0x70(%rbp), %rcx
movl %ecx, %edx
movq %rdx, -0x48(%rbp)
subl %eax, %ecx
movslq %ecx, %r15
cmpq -0x48(%rbp), %r15
jge 0x34e8
movl 0xc(%r14), %edi
movl 0x30(%r14), %esi
movslq %r13d, %r13
movq -0x40(%rbp), %rax
movsbl (%rax,%r13), %edx
movsbl (%r8,%r13), %ecx
movq -0x30(%rbp), %rax
movsbl (%rax,%r15), %r8d
movq -0x50(%rbp), %rax
movsbl (%rax,%r15), %r9d
callq 0x39d6
movq -0x60(%rbp), %r8
movb %al, (%r12,%rbx)
movq -0x38(%rbp), %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
incq %r15
incl %r13d
jmp 0x344c
movq -0x88(%rbp), %r13
jmp 0x34eb
movslq -0x88(%rbp), %rax
addq %rbx, %r15
movq -0x58(%rbp), %rbx
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x70(%rbp), %r8
movq -0x38(%rbp), %rdx
cmpq %r8, %rax
jge 0x34f1
movb (%rsi,%rax), %cl
movb %cl, (%r12,%r15)
movb (%rdi,%rax), %cl
movb %cl, (%rdx,%r15)
incq %r15
incq %rax
jmp 0x34c7
movq -0x58(%rbp), %rbx
jmp 0x34f8
movl %ebx, %r13d
movq -0x58(%rbp), %rbx
jmp 0x34f4
movl %r15d, %r13d
movq -0x68(%rbp), %r15
movslq %r13d, %rax
xorl %ecx, %ecx
movq -0x38(%rbp), %rdx
movb %cl, (%rdx,%rax)
movb %cl, (%r12,%rax)
cmpl 0x8(%r14), %eax
jge 0x3517
pushq $0x2
popq %rax
movl %eax, 0x44(%rbx)
movl %eax, 0x4(%rbx)
movq -0x40(%rbp), %rdi
callq 0x2050
movq 0x20(%rbx), %rdi
callq 0x2050
movq %r12, %rdi
callq 0x2240
movq %rax, -0x40(%rbp)
movq %rax, 0x18(%rbx)
movq -0x38(%rbp), %rdi
callq 0x2240
movq %rax, %r8
movq %rax, 0x20(%rbx)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x80000000, %esi       # imm = 0x80000000
movl (%rbx), %eax
andl %esi, %eax
orl %r13d, %eax
movq %rax, -0xa0(%rbp)
movl %eax, (%rbx)
andl 0x40(%rbx), %esi
movl %esi, 0x40(%rbx)
pushq $0x2
popq %rdx
movl 0x8(%r14), %ecx
movl 0x4(%rbx), %eax
addl $-0x17, %eax
cmpl %ecx, %r13d
jge 0x35e5
cmpl $-0x3, %eax
ja 0x35f7
movl %esi, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jb 0x35f7
movups 0x58(%rbx), %xmm0
movq -0x40(%rbp), %rcx
movq %rcx, 0x58(%rbx)
movups %xmm0, 0x18(%rbx)
movq %r8, 0x60(%rbx)
pshufd $0x4e, -0xb0(%rbp), %xmm0 # xmm0 = mem[2,3,0,1]
movdqa %xmm0, -0xb0(%rbp)
movq -0x90(%rbp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, -0x90(%rbp)
movl $0x80000000, %ecx       # imm = 0x80000000
movq -0xa0(%rbp), %rdx
andl %ecx, %edx
orl %edx, %eax
movl %eax, (%rbx)
andl %ecx, %esi
orl %r13d, %esi
movl %esi, 0x40(%rbx)
pushq $0x4
jmp 0x35f6
cmpl $-0x3, %eax
ja 0x35fd
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpl %ecx, %esi
jge 0x35fd
pushq $0x3
popq %rdx
movl %edx, 0x44(%rbx)
movl %edx, 0x4(%rbx)
movl -0x90(%rbp), %eax
movl -0x8c(%rbp), %edx
movq -0xb0(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movq -0xa8(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movslq 0x2c(%r14), %rcx
movq %rcx, -0x60(%rbp)
addl %ecx, %r15d
movl %eax, -0x38(%rbp)
subl %r15d, %eax
setg %cl
movl %edx, -0x30(%rbp)
subl %r15d, %edx
setg %r13b
andb %cl, %r13b
leal (%rdx,%rax), %ecx
incl %ecx
movslq %ecx, %rcx
movq %rcx, -0x78(%rbp)
cltq
movq %rax, -0x80(%rbp)
movslq %edx, %rax
movq %rax, -0x70(%rbp)
xorl %r12d, %r12d
movb %r13b, -0x48(%rbp)
cmpq $0x80, %r12
je 0x36fe
movl -0x38(%rbp), %eax
movl %eax, 0x8(%rbx,%r12)
movl -0x30(%rbp), %eax
movl %eax, 0xc(%rbx,%r12)
movq -0x40(%rbp), %rdi
callq 0x2240
movq %rax, %r15
movq %rax, 0x28(%rbx,%r12)
movq -0x50(%rbp), %rdi
callq 0x2240
movq %rax, 0x30(%rbx,%r12)
testb %r13b, %r13b
je 0x36e7
movq %rax, %r14
movq -0x78(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2120
movq %rax, %rbx
movq -0x60(%rbp), %r13
addq %r13, %r15
movq %rax, %rdi
movq %r15, %rsi
movq -0x80(%rbp), %r15
movq %r15, %rdx
callq 0x2070
movq %rbx, %rdi
addq %r15, %rdi
addq %r13, %r14
movb -0x48(%rbp), %r13b
movq %r14, %rsi
movq -0x70(%rbp), %rdx
callq 0x2070
jmp 0x36e9
xorl %ebx, %ebx
movq -0x58(%rbp), %rax
movq %rbx, 0x38(%rax,%r12)
movq %rax, %rbx
addq $0x40, %r12
jmp 0x3660
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq