// File: /workspace/github_c_makefile_star2_O0/DReichLab[P]adna/trim.c
// Function: lt_process
void lt_process(const lt_global_t *g, bseq1_t s[2])
{
	int i, k, mlen, bc_id[2];
	char *rseq, *rqual, *xseq, *xqual;

	mlen = s[0].l_seq > s[1].l_seq? s[0].l_seq : s[1].l_seq;
	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);

	// trim 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;
	}
	// test barcode
	if (g->bc && g->bc->n[0] + g->bc->n[1] > 0) {
		char *bc;
		bc = (char*)alloca(g->bc->len[0] + g->bc->len[1] + 1);
		for (k = 0; k < 2; ++k) {
			lt_sc_hit_t hits[3];
			strncpy(bc, s[k].seq, g->bc->len[k]);
			bc[g->bc->len[k]] = 0;
			for (i = 0; i < g->bc->n[k]; ++i)
				if (lt_sc_test(g->bc->bc[k][i], bc, 3, hits))
					break;
			if (i == g->bc->n[k]) break;
			bc_id[k] = i;
		}
		if (k < 2) {
			s[0].type = s[1].type = AD_NO_BARCODE;
			return;
		}
		// write barcode
		strncpy(bc, g->bc->seq[0][bc_id[0]], g->bc->len[0]);
		strncpy(bc + g->bc->len[0], g->bc->seq[1][bc_id[1]], g->bc->len[1]);
		bc[g->bc->len[0] + g->bc->len[1]] = 0;
		s->bc = strdup(bc);
		if (g->bc->len[0]) trim_bseq_5(&s[0], g->bc->len[0]);
		if (g->bc->len[1]) trim_bseq_5(&s[1], g->bc->len[1]);
	} else if (g->opt.bc_len[0] + g->opt.bc_len[1] > 0) {
		char *bc;
		bc = (char*)alloca(g->opt.bc_len[0] + g->opt.bc_len[1] + 1);
		strncpy(bc, s[0].seq, g->opt.bc_len[0]);
		strncpy(bc + g->opt.bc_len[0], s[1].seq, g->opt.bc_len[1]);
		bc[g->opt.bc_len[0] + g->opt.bc_len[1]] = 0;
		s->bc = strdup(bc);
		if (g->opt.bc_len[0]) trim_bseq_5(&s[0], g->opt.bc_len[0]);
		if (g->opt.bc_len[1]) trim_bseq_5(&s[1], g->opt.bc_len[1]);
	}
	// find end overlaps
	{
		int n_fh, n_rh, n_ch;
		uint64_t fh[2], rh[2], ch[2];
		// 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[0], &s[0].qual[0], s[1].l_seq, rseq, rqual, g->opt.max_ovlp_pen, g->opt.min_ovlp_len, 2, fh);
		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 = AD_AMBI_MERGE;
		} else if (n_fh + n_rh + n_ch == 0) {
			s[0].type = s[1].type = AD_NO_MERGE;
		} else {
			int x = 0;
			if (n_fh == 1) {
				int l = (uint32_t)fh[0], st = fh[0]>>32;
				s[0].type = s[1].type = AD_PARTIAL_MERGE;
				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, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
					xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
				}
				if (l < s[1].l_seq) {
					for (i = l; i < s[1].l_seq; ++i)
						xseq[x] = rseq[i], xqual[x++] = rqual[i];
				} else {
					for (i = l; i < s[0].l_seq; ++i)
						xseq[x] = s[0].seq[i], xqual[x++] = s[0].qual[i];
				}
			} else if (n_rh == 1) {
				int l = (uint32_t)rh[0], st = rh[0]>>32;
				s[0].type = s[1].type = AD_COMPLETE_MERGE;
				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, s[0].seq[j], s[0].qual[j], rseq[i], rqual[i]);
					xseq[x] = (uint8_t)y, xqual[x++] = y>>8;
				}
			} else {
				int j, st = ch[0]>>32;
				s[0].type = s[1].type = AD_COMPLETE_MERGE;
				for (j = 0; j < s[0].l_seq; ++j) {
					int i = j + st, y;
					y = merge_base(g->opt.max_qual, 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 = AD_SHORT_SE;
			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;
		}
	}
	if (s->type == AD_NO_MERGE || s->type == AD_AMBI_MERGE) {
		if (s->bc) s[1].bc = strdup(s->bc);
		// 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);
		if (s[0].l_seq < g->opt.min_seq_len || s[1].l_seq < g->opt.min_seq_len)
			s[0].type = s[1].type = AD_SHORT_PE;
	}
	if (g->opt.trim_len) {
		if (s->type == AD_PARTIAL_MERGE || s->type == AD_COMPLETE_MERGE) {
			s->l_seq -= g->opt.trim_len;
			s->seq[s->l_seq] = s->qual[s->l_seq] = 0;
			trim_bseq_5(s, g->opt.trim_len);
		} else if (s->type == AD_NO_MERGE || s->type == AD_AMBI_MERGE) {
			trim_bseq_5(&s[0], g->opt.trim_len);
			trim_bseq_5(&s[1], g->opt.trim_len);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jle 0x44b2
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xe8(%rbp)
jmp 0x44c4
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x30(%rbp)
movslq -0x1c(%rbp), %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl 0x30(%rax), %eax
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movl %edx, %eax
leal 0x10(%rax,%rcx), %eax
andl $-0x10, %eax
movl %eax, %ecx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl 0x30(%rax), %eax
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movl %edx, %eax
leal 0x10(%rax,%rcx), %eax
andl $-0x10, %eax
movl %eax, %ecx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x48(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x4618
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x45ba
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x4e, %eax
je 0x45ad
jmp 0x45ba
jmp 0x45af
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4590
movl -0x14(%rbp), %edx
addl $0x1, %edx
movq -0x50(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4562
movq -0x8(%rbp), %rax
cmpq $0x0, 0x198(%rax)
je 0x488d
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x198(%rcx), %rcx
addl 0x4(%rcx), %eax
cmpl $0x0, %eax
jle 0x488d
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rcx
movl 0x8(%rcx), %eax
movl 0xc(%rcx), %ecx
addl %ecx, %eax
movslq %eax, %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x58(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x4768
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movslq -0x18(%rbp), %rcx
movslq 0x8(%rax,%rcx,4), %rdx
callq 0x2060
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x198(%rcx), %rcx
movslq -0x18(%rbp), %rdx
movslq 0x8(%rcx,%rdx,4), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x198(%rcx), %rcx
movslq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x4736
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movslq -0x18(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x58(%rbp), %rsi
leaq -0x64(%rbp), %rcx
movl $0x3, %edx
callq 0x3010
cmpl $0x0, %eax
je 0x4729
jmp 0x4736
jmp 0x472b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x46dd
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x198(%rcx), %rcx
movslq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x474f
jmp 0x4768
movl -0x14(%rbp), %ecx
movslq -0x18(%rbp), %rax
movl %ecx, -0x24(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4680
cmpl $0x2, -0x18(%rbp)
jge 0x4789
movq -0x10(%rbp), %rax
movl $0xb, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0xb, 0x4(%rax)
jmp 0x52b8
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movslq 0x8(%rax), %rdx
callq 0x2060
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movslq 0x8(%rax), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movq 0x28(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movslq 0xc(%rax), %rdx
callq 0x2060
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x198(%rcx), %rcx
movl 0x8(%rcx), %ecx
movq -0x8(%rbp), %rdx
movq 0x198(%rdx), %rdx
addl 0xc(%rdx), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rdi
callq 0x2260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x485c
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movl 0x8(%rax), %esi
callq 0x52c0
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
cmpl $0x0, 0xc(%rax)
je 0x4888
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rax
movq 0x198(%rax), %rax
movl 0xc(%rax), %esi
callq 0x52c0
jmp 0x496e
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
addl 0x24(%rcx), %eax
cmpl $0x0, %eax
jle 0x496c
movq -0x8(%rbp), %rcx
movl 0x20(%rcx), %eax
movl 0x24(%rcx), %ecx
addl %ecx, %eax
movslq %eax, %rcx
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x20(%rax), %rdx
callq 0x2060
movq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq 0x20(%rax), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x24(%rax), %rdx
callq 0x2060
movq -0x70(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x20(%rcx), %ecx
movq -0x8(%rbp), %rdx
addl 0x24(%rdx), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x70(%rbp), %rdi
callq 0x2260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x494c
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x52c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x496a
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x52c0
jmp 0x496c
jmp 0x496e
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x3360
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x38(%rbp), %rdx
callq 0x3300
movq -0x10(%rbp), %rax
movl (%rax), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r11d
movq -0x8(%rbp), %rax
movl 0x14(%rax), %r10d
leaq -0x90(%rbp), %rax
subq $0x20, %rsp
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl $0x2, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x3630
addq $0x20, %rsp
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r11d
movq -0x8(%rbp), %rax
movl 0x14(%rax), %r10d
leaq -0xa0(%rbp), %rax
subq $0x20, %rsp
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl $0x2, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x3740
addq $0x20, %rsp
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r10d
leaq -0xb0(%rbp), %rax
subq $0x20, %rsp
movl %r10d, (%rsp)
movl $0x2, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3830
addq $0x20, %rsp
movl %eax, -0x7c(%rbp)
movl -0x74(%rbp), %eax
addl -0x78(%rbp), %eax
addl -0x7c(%rbp), %eax
cmpl $0x1, %eax
jle 0x4b10
movq -0x10(%rbp), %rax
movl $0x1f, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x1f, 0x4(%rax)
jmp 0x511f
movl -0x74(%rbp), %eax
addl -0x78(%rbp), %eax
addl -0x7c(%rbp), %eax
cmpl $0x0, %eax
jne 0x4b39
movq -0x10(%rbp), %rax
movl $0x20, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x20, 0x4(%rax)
jmp 0x511d
movl $0x0, -0xb4(%rbp)
cmpl $0x1, -0x74(%rbp)
jne 0x4da2
movq -0x90(%rbp), %rax
movl %eax, -0xb8(%rbp)
movq -0x90(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rax
movl $0x16, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x16, 0x4(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xbc(%rbp), %eax
jge 0x4be5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4b88
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0x4cad
movl -0xbc(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc0(%rbp), %rcx
movb (%rax,%rcx), %sil
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc0(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %r8
movsbl %sil, %esi
movsbl %dl, %edx
movsbl %cl, %ecx
movsbl (%rax,%r8), %r8d
callq 0x5390
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movb %al, %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xc4(%rbp), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4bec
movl -0xb8(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jge 0x4d2d
movl -0xb8(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jge 0x4d2b
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4ccd
jmp 0x4d9d
movl -0xb8(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jge 0x4d9b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4d36
jmp 0x4d9d
jmp 0x5069
cmpl $0x1, -0x78(%rbp)
jne 0x4f59
movq -0xa0(%rbp), %rax
movl %eax, -0xc8(%rbp)
movq -0xa0(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0xcc(%rbp)
movq -0x10(%rbp), %rax
movl $0x15, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x15, 0x4(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0xcc(%rbp), %ecx
subl -0xc8(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4e58
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4de7
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl -0xc8(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jge 0x4f54
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0xcc(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xd0(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xd0(%rbp), %rcx
movb (%rax,%rcx), %sil
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xd0(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %r8
movsbl %sil, %esi
movsbl %dl, %edx
movsbl %cl, %ecx
movsbl (%rax,%r8), %r8d
callq 0x5390
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movb %al, %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xd4(%rbp), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4e6d
jmp 0x5067
movq -0xb0(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0xdc(%rbp)
movq -0x10(%rbp), %rax
movl $0x15, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0x15, 0x4(%rax)
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jge 0x5065
movl -0xd8(%rbp), %eax
addl -0xdc(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xd8(%rbp), %rcx
movb (%rax,%rcx), %sil
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xd8(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movslq -0xe0(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x38(%rbp), %rax
movslq -0xe0(%rbp), %r8
movsbl %sil, %esi
movsbl %dl, %edx
movsbl %cl, %ecx
movsbl (%rax,%r8), %r8d
callq 0x5390
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movb %al, %dl
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xe4(%rbp), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x48(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xb4(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x4f8a
jmp 0x5067
jmp 0x5069
movq -0x48(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x40(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0xb4(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x50ac
movq -0x10(%rbp), %rax
movl $0xc, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0xc, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x40(%rbp), %rdi
callq 0x2260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rdi
callq 0x2260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0xb4(%rbp), %edx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, 0x30(%rax)
jmp 0x511f
movq -0x10(%rbp), %rax
cmpl $0x20, 0x4(%rax)
je 0x5137
movq -0x10(%rbp), %rax
cmpl $0x1f, 0x4(%rax)
jne 0x51ed
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x515a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rdi
movq 0x4ffb(%rip), %rsi      # 0xa160
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x18(%rax), %r8d
xorl %edx, %edx
movl $0x1, %r9d
callq 0x5470
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq 0x4fd8(%rip), %rsi      # 0xa168
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x18(%rax), %r8d
xorl %edx, %edx
movl $0x1, %r9d
callq 0x5470
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0x51d5
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x51eb
movq -0x10(%rbp), %rax
movl $0xd, 0x34(%rax)
movq -0x10(%rbp), %rax
movl $0xd, 0x4(%rax)
jmp 0x51ed
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x52b8
movq -0x10(%rbp), %rax
cmpl $0x16, 0x4(%rax)
je 0x520f
movq -0x10(%rbp), %rax
cmpl $0x15, 0x4(%rax)
jne 0x527c
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x10(%rbp), %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
subl %ecx, %edx
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x52c0
jmp 0x52b6
movq -0x10(%rbp), %rax
cmpl $0x20, 0x4(%rax)
je 0x5290
movq -0x10(%rbp), %rax
cmpl $0x1f, 0x4(%rax)
jne 0x52b4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x52c0
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x52c0
jmp 0x52b6
jmp 0x52b8
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)