// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r12
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl (%rsi), %ecx
andl %eax, %ecx
andl 0x30(%rsi), %eax
cmpl %eax, %ecx
movl %eax, %edx
cmoval %ecx, %edx
movq %rdi, -0x30(%rbp)
addq $0x30, %rsi
movq %rsi, -0x70(%rbp)
addl $0x10, %edx
andl $-0x10, %edx
movq %rsp, %rsi
subq %rdx, %rsi
movq %rsi, -0x58(%rbp)
movq %rsi, %rsp
movq %rsp, %rsi
subq %rdx, %rsi
movq %rsi, -0x50(%rbp)
movq %rsi, %rsp
addl %ecx, %eax
addl $0x10, %eax
andl $-0x10, %eax
movq %rsp, %r10
subq %rax, %r10
movq %r10, %rsp
movq %rsp, %r11
subq %rax, %r11
movq %r11, %rsp
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x2, %rcx
je 0x3905
imulq $0x30, %rcx, %rsi
leaq (%r12,%rsi), %rdx
movl (%r12,%rsi), %esi
movl %esi, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
testq %r8, %r8
jle 0x38dc
leaq -0x1(%r8), %rdi
movq 0x10(%rdx), %r9
cmpb $0x4e, -0x1(%r9,%r8)
movq %rdi, %r8
je 0x38ba
incl %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
jmp 0x38de
xorl %edi, %edi
andl $0x80000000, %esi       # imm = 0x80000000
orl %edi, %esi
movl %esi, (%rdx)
movq 0x18(%rdx), %rsi
movl %edi, %edi
movb %al, (%rsi,%rdi)
movq 0x10(%rdx), %rsi
movl (%rdx), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movb %al, (%rsi,%rdx)
incq %rcx
jmp 0x389e
movq %r11, -0x40(%rbp)
movq %r10, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq 0x198(%rax), %r13
testq %r13, %r13
je 0x39df
movl 0x4(%r13), %eax
addl (%r13), %eax
jle 0x39df
movl 0x8(%r13), %eax
movl 0xc(%r13), %ecx
addl %ecx, %eax
incl %eax
cltq
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
xorl %ebx, %ebx
movq %r12, -0x68(%rbp)
cmpq $0x2, %rbx
je 0x3a63
imulq $0x30, %rbx, %rax
movq 0x10(%r12,%rax), %rsi
movslq 0x8(%r13,%rbx,4), %rdx
movq %r14, %rdi
callq 0x2070
movslq 0x8(%r13,%rbx,4), %rax
movb $0x0, (%r14,%rax)
movl (%r13,%rbx,4), %eax
testl %eax, %eax
movl $0x0, %r12d
movl %eax, -0x38(%rbp)
cmovgl %eax, %r12d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x39c1
movq 0x10(%r13,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
pushq $0x3
popq %rdx
leaq -0xb0(%rbp), %rcx
callq 0x2c3e
testl %eax, %eax
jne 0x39be
incq %r15
jmp 0x3995
movl %r15d, %r12d
cmpl -0x38(%rbp), %r12d
je 0x3c5f
movl %r12d, -0xa0(%rbp,%rbx,4)
incq %rbx
movq -0x68(%rbp), %r12
jmp 0x3954
movq -0x30(%rbp), %rax
movslq 0x20(%rax), %r15
movl 0x24(%rax), %r14d
movl %r14d, %eax
addl %r15d, %eax
jle 0x3aea
movslq %r14d, %rcx
movq %rcx, -0x38(%rbp)
movq %rsp, %r13
movl %eax, %ebx
leaq 0x10(%rbx), %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq 0x10(%r12), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x2070
leaq (%r15,%r13), %rdi
movq 0x40(%r12), %rsi
movq -0x38(%rbp), %rdx
callq 0x2070
movb $0x0, (%rbx,%r13)
movq %r13, %rdi
callq 0x2260
movq %rax, 0x20(%r12)
testl %r15d, %r15d
je 0x3ad9
movq %r12, %rdi
movl %r15d, %esi
callq 0x404a
movq -0x30(%rbp), %rax
movl 0x24(%rax), %r14d
jmp 0x3ad9
movq 0x20(%r13), %rax
movslq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq 0x8(%r13), %rdx
movq %r14, %rdi
callq 0x2070
movslq 0x8(%r13), %rdi
addq %r14, %rdi
movq 0x28(%r13), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq 0xc(%r13), %rdx
callq 0x2070
movslq 0x8(%r13), %rax
movslq 0xc(%r13), %rcx
addq %rax, %rcx
movb $0x0, (%r14,%rcx)
movq %r14, %rdi
callq 0x2260
movq %rax, 0x20(%r12)
movl 0x8(%r13), %esi
testl %esi, %esi
je 0x3ad5
movq %r12, %rdi
callq 0x404a
movq -0x30(%rbp), %rax
movq 0x198(%rax), %r13
movl 0xc(%r13), %r14d
testl %r14d, %r14d
je 0x3aea
movq -0x70(%rbp), %rdi
movl %r14d, %esi
callq 0x404a
movl 0x30(%r12), %r14d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
andq %r13, %r14
movq 0x40(%r12), %rsi
movl %r14d, %edi
movq -0x58(%rbp), %r15
movq %r15, %rdx
callq 0x2e46
movq 0x48(%r12), %rsi
movl %r14d, %edi
movq -0x50(%rbp), %rdx
callq 0x2e16
movl (%r12), %ebx
andq %r13, %rbx
movq 0x10(%r12), %rsi
movq %rsi, -0x38(%rbp)
movq 0x18(%r12), %r13
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r10d
movq %r10, -0x78(%rbp)
movl 0x14(%rax), %eax
movq %rax, -0x48(%rbp)
movl %ebx, %edi
movq %r13, %rdx
movl %r14d, %ecx
movq %r15, %r8
movq -0x50(%rbp), %r9
leaq -0xb0(%rbp), %r11
pushq %r11
pushq $0x2
popq %r11
pushq %r11
pushq %rax
pushq %r10
callq 0x302d
addq $0x20, %rsp
movq %rax, -0x88(%rbp)
leaq -0xd0(%rbp), %rax
movl %ebx, %edi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
movl %r14d, %ecx
movq %r15, %r8
movq -0x50(%rbp), %r15
movq %r15, %r9
pushq %rax
pushq $0x2
popq %rax
pushq %rax
pushq -0x48(%rbp)
pushq -0x78(%rbp)
callq 0x3109
addq $0x20, %rsp
movq %rax, -0x80(%rbp)
subq $0x8, %rsp
leaq -0xc0(%rbp), %rax
movq %rbx, -0x90(%rbp)
movl %ebx, %edi
movq -0x38(%rbp), %rsi
movq %r13, -0x48(%rbp)
movq %r13, %rdx
movq %r14, -0x98(%rbp)
movl %r14d, %ecx
movq -0x58(%rbp), %r8
movq %r15, %r9
pushq %rax
pushq $0x2
popq %rax
pushq %rax
pushq -0x78(%rbp)
callq 0x31c9
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq $0x20, %rsp
addl %esi, %eax
addl %edx, %eax
cmpl $0x1, %eax
jle 0x3c04
pushq $0x1f
jmp 0x3c73
testl %eax, %eax
je 0x3c71
cmpl $0x1, %edx
jne 0x3d77
movq -0xb0(%rbp), %rdi
movq %rdi, %r14
shrq $0x20, %r14
pushq $0x16
popq %rax
movl %eax, 0x34(%r12)
movl %eax, 0x4(%r12)
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
movq -0x60(%rbp), %rdx
movq -0x40(%rbp), %rsi
cmpq %rax, %r14
je 0x3de0
movq -0x38(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%rdx,%rax)
movq -0x48(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%rsi,%rax)
incq %rax
jmp 0x3c3d
pushq $0xb
popq %rax
movq -0x68(%rbp), %rcx
movl %eax, 0x34(%rcx)
movl %eax, 0x4(%rcx)
jmp 0x3d68
pushq $0x20
popq %rax
movl %eax, 0x34(%r12)
leaq 0x4(%r12), %r14
movl %eax, 0x4(%r12)
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0x3c97
callq 0x2260
movq %rax, 0x50(%r12)
movq 0x44c2(%rip), %rsi      # 0x8160
movq -0x30(%rbp), %rbx
movl 0x18(%rbx), %ecx
movl 0x1c(%rbx), %edx
movq %r12, %rdi
callq 0x4132
movq 0x44b1(%rip), %rsi      # 0x8168
movl 0x18(%rbx), %ecx
movl 0x1c(%rbx), %edx
movq -0x70(%rbp), %rdi
callq 0x4132
movl (%r12), %eax
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl 0x8(%rbx), %ecx
cmpl %ecx, %edx
jl 0x3ce8
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq -0x70(%rbp), %rsi
andl (%rsi), %edx
cmpl %ecx, %edx
jge 0x3cf5
pushq $0xd
popq %rcx
movl %ecx, 0x34(%r12)
movl %ecx, 0x4(%r12)
movq -0x30(%rbp), %rcx
movl 0x28(%rcx), %esi
testl %esi, %esi
je 0x3d68
movl (%r14), %ecx
leal -0x1f(%rcx), %edx
cmpl $0x2, %edx
jb 0x3d50
addl $-0x15, %ecx
cmpl $0x1, %ecx
ja 0x3d68
movl %eax, %ecx
subl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, (%r12)
movq 0x18(%r12), %rax
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x10(%r12), %rax
movl (%r12), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movb %dl, (%rax,%rcx)
movq -0x30(%rbp), %rax
movl 0x28(%rax), %esi
movq %r12, %rdi
jmp 0x3d63
movq %r12, %rdi
callq 0x404a
movq -0x30(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x70(%rbp), %rdi
callq 0x404a
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, %esi
movq -0x60(%rbp), %r15
movq -0x90(%rbp), %r13
jne 0x3ea8
movq -0xd0(%rbp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
pushq $0x15
popq %rdx
movl %edx, 0x34(%r12)
movl %edx, 0x4(%r12)
addl %eax, %ecx
subl %ecx, %r13d
xorl %ecx, %ecx
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
movq -0x40(%rbp), %rsi
cmpq %rcx, %rbx
je 0x3f0f
movq -0x38(%rbp), %rdx
movb (%rdx,%rcx), %dl
movb %dl, (%r15,%rcx)
movq -0x48(%rbp), %rdx
movb (%rdx,%rcx), %dl
movb %dl, (%rsi,%rcx)
incq %rcx
jmp 0x3dbd
movq %r12, -0x68(%rbp)
movq %rdi, %r13
sarq $0x20, %r13
xorl %ebx, %ebx
testl %edi, %edi
movl $0x0, %eax
movq %rdi, -0x80(%rbp)
cmovgl %edi, %eax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
addq %r13, %rax
movq %rax, -0x88(%rbp)
addq -0x48(%rbp), %r13
leaq (%rsi,%r14), %r12
leaq (%rdx,%r14), %r15
cmpq %rbx, -0x78(%rbp)
je 0x3e5c
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x88(%rbp), %rax
movsbl (%rax,%rbx), %esi
movsbl (%r13,%rbx), %edx
movq -0x58(%rbp), %rax
movsbl (%rax,%rbx), %ecx
movq -0x50(%rbp), %rax
movsbl (%rax,%rbx), %r8d
callq 0x40b6
movb %al, (%r15,%rbx)
movq %r12, %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
jmp 0x3e19
addq %rbx, %r14
movq -0x80(%rbp), %rcx
movslq %ecx, %rax
movq -0x98(%rbp), %rdx
cmpl %ecx, %edx
jle 0x3f7c
movq -0x68(%rbp), %r12
movq -0x60(%rbp), %r15
movq -0x40(%rbp), %rbx
cmpq %rdx, %rax
jge 0x3fb2
movq -0x58(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%r15,%r14)
movq -0x50(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%rbx,%r14)
incq %r14
incq %rax
jmp 0x3e81
movslq -0xbc(%rbp), %rax
pushq $0x15
popq %rcx
movl %ecx, 0x34(%r12)
movl %ecx, 0x4(%r12)
movl %r13d, %r14d
addq %rax, -0x58(%rbp)
addq %rax, -0x50(%rbp)
xorl %ebx, %ebx
cmpq %rbx, %r14
je 0x3fbe
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x38(%rbp), %rax
movsbl (%rax,%rbx), %esi
movq -0x48(%rbp), %rax
movsbl (%rax,%rbx), %edx
movq -0x58(%rbp), %rax
movsbl (%rax,%rbx), %ecx
movq -0x50(%rbp), %rax
movsbl (%rax,%rbx), %r8d
callq 0x40b6
movb %al, (%r15,%rbx)
movq -0x40(%rbp), %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
jmp 0x3ec9
movq %r13, %rcx
movq -0x98(%rbp), %rdx
movl %edx, %r14d
subl %eax, %edx
movslq %edx, %r13
cmpq %r14, %r13
jge 0x3fb7
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
movq %rcx, %r15
movslq %r15d, %r15
movq -0x38(%rbp), %rax
movsbl (%rax,%r15), %esi
movq -0x48(%rbp), %rax
movsbl (%rax,%r15), %edx
movq -0x58(%rbp), %rax
movsbl (%rax,%r13), %ecx
movq -0x50(%rbp), %rax
movsbl (%rax,%r13), %r8d
callq 0x40b6
movq -0x60(%rbp), %rcx
movb %al, (%rcx,%rbx)
movq -0x40(%rbp), %rcx
movb %ah, (%rcx,%rbx)
incq %rbx
incq %r13
incl %r15d
movq %r15, %rcx
jmp 0x3f21
movq -0x68(%rbp), %r12
movq -0x60(%rbp), %r15
movq -0x40(%rbp), %rbx
movq -0x90(%rbp), %rdx
cmpq %rdx, %rax
jge 0x3fb2
movq -0x38(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%r15,%r14)
movq -0x48(%rbp), %rcx
movb (%rcx,%rax), %cl
movb %cl, (%rbx,%r14)
incq %r14
incq %rax
jmp 0x3f8f
movl %r14d, %r13d
jmp 0x3fc2
movl %ebx, %r13d
movq -0x60(%rbp), %r15
movq -0x40(%rbp), %rbx
movslq %r13d, %rax
xorl %ecx, %ecx
movb %cl, (%rbx,%rax)
movb %cl, (%r15,%rax)
movq -0x30(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3fe4
pushq $0xc
popq %rax
movl %eax, 0x34(%r12)
movl %eax, 0x4(%r12)
movq -0x38(%rbp), %rdi
callq 0x2050
movq 0x18(%r12), %rdi
callq 0x2050
movq %r15, %rdi
callq 0x2260
movq %rax, 0x10(%r12)
movq %rbx, %rdi
callq 0x2260
movq %rax, 0x18(%r12)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x80000000, %ecx       # imm = 0x80000000
movl (%r12), %eax
andl %ecx, %eax
orl %r13d, %eax
movl %eax, (%r12)
andl %ecx, 0x30(%r12)
leaq 0x4(%r12), %r14
movl 0x4(%r12), %ecx
addl $-0x1f, %ecx
cmpl $0x1, %ecx
jbe 0x3c83
jmp 0x3cf5