// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/ldup.c
// Function: process
static khash_t(64) *process(kdq_t(elem_t) *q, BGZF *fp, khash_t(s) *marked, khash_t(64) *aux, int bc_type)
{
	int i, absent;
	if (kh_n_buckets(aux) < kdq_size(q) * 4 && kh_n_buckets(aux) <= AUX_REALLOC_SIZE) {
		kh_clear(64, aux);
	} else {
		kh_destroy(64, aux);
		aux = kh_init(64);
	}
	for (i = 0; i < kdq_size(q); ++i) {
		elem_t *e = &kdq_at(q, i);
		bam1_t *b = e->b;
		char *qname = bam_get_qname(b);
		if (b->core.flag&0x800) continue;
		if ((b->core.flag&1) && (b->core.flag&(BAM_FREAD1|BAM_FREAD2))) { // PE
			e->is_left = 0, e->is_pe = 1;
			if (b->core.tid < b->core.mtid) e->is_left = 1;
			else if (b->core.tid == b->core.mtid) {
				if (b->core.pos < b->core.mpos) e->is_left = 1;
				else if (b->core.pos == b->core.mpos && (b->core.flag&BAM_FREAD1)) e->is_left = 1;
			}
		} else e->is_left = 1, e->is_pe = 0; // SE
		if (e->is_left) {
			uint64_t key;
			khint_t k;
			int has_BC, rlen;
			if (bc_type == AD_USE_BC) {
				const uint8_t *BC = 0;
				BC = bam_aux_get(b, "BC");
				has_BC = BC? 1 : 0;
				key = has_BC? X31_hash_string(bam_aux2Z(BC)) : 0;
			} else if (bc_type == AD_USE_NAME) {
				const char *p, *qname = bam_get_qname(b);
				int len;
				len = strlen(qname);
				for (p = qname + len - 1; p >= qname && !ispunct(*p); --p);
				has_BC = p > qname? 1 : 0;
				key = has_BC? X31_hash_string(p + 1) : 0;
			} else key = 0, has_BC = 0;
			if (!e->is_pe) rlen = bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b));
			else rlen = b->core.isize > 0? b->core.isize : -b->core.isize;
			key ^= __ac_Wang_hash(rlen);
			k = kh_put(64, aux, key, &absent);
			if (has_BC) ++lt_n_frags_BC;
			else ++lt_n_frags_noBC;
			if (!absent) {
				if (has_BC) ++lt_n_dups_BC;
				else ++lt_n_dups_noBC;
				b->core.flag |= BAM_FDUP;
				if (e->is_pe) kh_put(s, marked, strdup(qname), &absent);
			}
		}
	}
	for (i = 0; i < kdq_size(q); ++i) {
		elem_t *e = &kdq_at(q, i);
		bam1_t *b = e->b;
		char *qname = bam_get_qname(b);
		if (e->is_pe && !e->is_left) {
			khint_t k;
			k = kh_get(s, marked, qname);
			if (k != kh_end(marked)) {
				b->core.flag |= BAM_FDUP;
				free((char*)kh_key(marked, k));
				kh_del(s, marked, k);
			}
		}
	}
	while (kdq_size(q)) {
		elem_t *e;
		e = kdq_shift(elem_t, q);
		bam_write1(fp, e->b);
		bam_destroy1(e->b);
	}
	return aux;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
movl (%rcx), %eax
cmpq $0x400, %rax            # imm = 0x400
ja 0x2dea
movq 0x8(%r13), %rcx
shlq $0x2, %rcx
cmpq %rax, %rcx
jbe 0x2dea
movq 0x10(%r14), %rdi
testq %rdi, %rdi
movq %r14, 0x10(%rsp)
je 0x2e21
movl %eax, %ecx
shrl $0x2, %ecx
andl $0x1fc, %ecx            # imm = 0x1FC
cmpl $0x10, %eax
movl $0x4, %edx
cmovael %ecx, %edx
movl $0xaa, %esi
callq 0x21b0
movq $0x0, 0x4(%r14)
jmp 0x2e21
movq 0x18(%r14), %rdi
callq 0x2050
movq 0x10(%r14), %rdi
callq 0x2050
movq 0x20(%r14), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2050
movl $0x1, %edi
movl $0x28, %esi
callq 0x21f0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x8(%r13)
je 0x3abc
movl %ebp, 0x2c(%rsp)
movq %rbx, 0x58(%rsp)
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
xorl %r8d, %r8d
movq %r13, 0x50(%rsp)
movq 0x18(%r13), %rbx
movq (%r13), %rax
andq %rbp, %rax
addq %r8, %rax
andq 0x10(%r13), %rax
shlq $0x4, %rax
movq (%rbx,%rax), %rdi
movl 0xc(%rdi), %ecx
btl $0xb, %ecx
jb 0x36c2
addq %rax, %rbx
movq 0x28(%rdi), %rax
movq %rax, 0x38(%rsp)
testb $0x1, %cl
sete %al
testb $-0x40, %cl
sete %cl
orb %al, %cl
je 0x2e92
movw $0x100, 0x8(%rbx)       # imm = 0x100
jmp 0x2ea7
movw $0x1, 0x8(%rbx)
movl 0x14(%rdi), %eax
cmpl %eax, (%rdi)
jge 0x2fb5
movb $0x1, 0x9(%rbx)
movl 0x2c(%rsp), %eax
cmpl $0x2, %eax
movq %r8, 0x40(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x38(%rsp), %rbp
je 0x2f28
cmpl $0x1, %eax
jne 0x2fa8
leaq 0xb2a1(%rip), %rsi      # 0xe170
callq 0xc86a
testq %rax, %rax
movq 0x10(%rsp), %r15
je 0x2fec
movq %rax, %rdi
callq 0xcbb8
movsbq (%rax), %r14
movb $0x1, %r11b
testq %r14, %r14
je 0x2fef
movb 0x1(%rax), %cl
testb %cl, %cl
je 0x2ff2
addq $0x2, %rax
movq %r14, %rdx
shlq $0x5, %rdx
subq %r14, %rdx
movsbq %cl, %r14
addq %rdx, %r14
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x2f09
jmp 0x2ff2
movq %rbx, %r12
movq %rbp, %rdi
callq 0x2150
movslq %eax, %rcx
leaq (%rcx,%rbp), %rax
incq %rax
addq %rbp, %rcx
addq $0x2, %rcx
movq %rax, %r15
movq %rcx, %rbx
leaq -0x2(%rax), %r14
cmpq %rbp, %r14
jb 0x2f6e
callq 0x2410
movq (%rax), %rdx
movsbq -0x2(%r15), %rsi
leaq -0x1(%r15), %rax
leaq -0x1(%rbx), %rcx
testb $0x4, (%rdx,%rsi,2)
je 0x2f44
cmpq %rbp, %r14
jbe 0x2fdc
movsbq -0x1(%r15), %r14
movb $0x1, %r11b
testq %r14, %r14
je 0x2fdf
movb (%r15), %al
testb %al, %al
je 0x2fe2
movq 0x10(%rsp), %r15
movq %r14, %rcx
shlq $0x5, %rcx
subq %r14, %rcx
movsbq %al, %r14
addq %rcx, %r14
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x2f8c
jmp 0x2fe7
xorl %r11d, %r11d
xorl %r14d, %r14d
movq 0x10(%rsp), %r15
jmp 0x2ff2
jne 0x36c2
movl 0x18(%rdi), %eax
cmpl %eax, 0x4(%rdi)
jl 0x2ea3
jne 0x36c2
testb $0x40, 0xc(%rdi)
jne 0x2ea3
jmp 0x36c2
xorl %r11d, %r11d
xorl %r14d, %r14d
movq 0x10(%rsp), %r15
movq %r12, %rbx
jmp 0x2ff2
xorl %r11d, %r11d
xorl %r14d, %r14d
cmpb $0x0, 0x8(%rbx)
je 0x3009
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %eax
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
jmp 0x302d
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rsi, %rdi
shrq $0x30, %rdi
shrl $0x18, %esi
addq 0x28(%rax), %rsi
movq %r11, %r12
callq 0x9077
movq %r12, %r11
movl %eax, %ebp
movl (%r15), %r12d
movl 0x8(%r15), %eax
cmpl 0xc(%r15), %eax
jb 0x3273
movl 0x4(%r15), %eax
leal (%rax,%rax), %ecx
cmpl %r12d, %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0x1, %ecx
addl %r12d, %ecx
decl %ecx
movl %ecx, %edx
shrl %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x2, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x4, %edx
orl %ecx, %edx
movl %edx, %esi
shrl $0x8, %esi
orl %edx, %esi
movl %esi, %ecx
shrl $0x10, %ecx
orl %esi, %ecx
incl %ecx
cmpl $0x5, %ecx
movl $0x4, %edx
cmovael %ecx, %edx
cvtsi2sd %rdx, %xmm0
mulsd 0xaf75(%rip), %xmm0     # 0xe008
addsd 0xaf75(%rip), %xmm0     # 0xe010
cvttsd2si %xmm0, %rsi
cmpl %esi, %eax
jae 0x3273
movq %rsi, 0x60(%rsp)
movq %r11, 0x18(%rsp)
movq %rbx, 0x30(%rsp)
movl %edx, %r13d
shrl $0x2, %r13d
andl $-0x4, %r13d
cmpl $0x10, %ecx
movl $0x4, %eax
cmovbl %eax, %r13d
movq %r13, %rdi
movq %rdx, 0x48(%rsp)
callq 0x22a0
movq %rax, %rbx
movq %rax, %rdi
movl $0xaa, %esi
movq %r13, %rdx
movq 0x50(%rsp), %r13
callq 0x21b0
movq 0x48(%rsp), %rcx
cmpl %ecx, %r12d
jae 0x3121
movq 0x18(%r15), %rdi
movl %ecx, %esi
shlq $0x3, %rsi
callq 0x22e0
movq 0x48(%rsp), %rcx
movq %rax, 0x18(%r15)
movl (%r15), %r12d
testl %r12d, %r12d
je 0x3241
movq 0x10(%r15), %rax
leal -0x1(%rcx), %edx
xorl %esi, %esi
movl %esi, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r9d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl %r9d, %r8d
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x3219
leaq (%rax,%rdi,4), %r10
movq 0x18(%r15), %rdi
movl %esi, %r8d
movq (%rdi,%r8,8), %r8
btsl %ecx, %r9d
movl %r9d, (%r10)
movq %r8, %r11
shrq $0x21, %r11
movl %r8d, %ecx
shll $0xb, %ecx
xorl %ecx, %r11d
xorl %r8d, %r11d
movl %edx, %r9d
andl %r11d, %r9d
movl %r9d, %r10d
shrl $0x4, %r10d
movl (%rbx,%r10,4), %r15d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r12d
shll %cl, %r12d
testl %r15d, %r12d
jne 0x31d2
movl %r11d, %ecx
shrl $0x3, %ecx
shll $0x3, %r11d
xorl %ecx, %r11d
orl $0x1, %r11d
andl %edx, %r11d
addl %r11d, %r9d
andl %edx, %r9d
movl %r9d, %r10d
shrl $0x4, %r10d
movl (%rbx,%r10,4), %r15d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r12d
shll %cl, %r12d
testl %r15d, %r12d
je 0x31ac
notl %r12d
andl %r15d, %r12d
movl %r12d, (%rbx,%r10,4)
movq 0x10(%rsp), %r11
movl (%r11), %r12d
movl %r9d, %r11d
cmpl %r12d, %r9d
jae 0x3210
movl (%rax,%r10,4), %r9d
movl %r9d, %r15d
shrl %cl, %r15d
testb $0x3, %r15b
jne 0x3210
leaq (%rax,%r10,4), %r10
movq (%rdi,%r11,8), %r15
movq %r8, (%rdi,%r11,8)
movq %r15, %r8
jmp 0x3158
movq %r8, (%rdi,%r11,8)
movq 0x10(%rsp), %r15
incl %esi
cmpl %r12d, %esi
jne 0x312a
movq 0x48(%rsp), %rax
cmpl %eax, %r12d
jbe 0x3241
movq 0x18(%r15), %rdi
movl %eax, %esi
shlq $0x3, %rsi
callq 0x22e0
movq %rax, 0x18(%r15)
movq 0x10(%r15), %rdi
callq 0x2050
movq 0x48(%rsp), %r12
movq %rbx, 0x10(%r15)
movl %r12d, (%r15)
movl 0x4(%r15), %eax
movl %eax, 0x8(%r15)
movq 0x60(%rsp), %rax
movl %eax, 0xc(%r15)
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %r11
jmp 0x3273
movl %ebp, %eax
shll $0xf, %eax
notl %eax
addl %ebp, %eax
movl %eax, %ecx
shrl $0xa, %ecx
xorl %eax, %ecx
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0x6, %ecx
xorl %eax, %ecx
movl %ecx, %edx
shll $0xb, %edx
notl %edx
addl %ecx, %edx
movl %edx, %eax
shrl $0x10, %eax
xorl %edx, %eax
xorq %r14, %rax
leal -0x1(%r12), %r8d
shrq $0x21, %r14
xorl %eax, %r14d
movl %eax, %r9d
shll $0xb, %r9d
xorl %r14d, %r9d
movl %r8d, %edi
andl %r9d, %edi
movq 0x10(%r15), %rdx
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %esi
leal (%rdi,%rdi), %ecx
shrl %cl, %esi
testb $0x2, %sil
je 0x32e4
movl %edi, %esi
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
jmp 0x3395
movq %r12, %r10
movq %r11, 0x18(%rsp)
movq %rbx, 0x30(%rsp)
movl %r9d, %ecx
shrl $0x3, %ecx
shll $0x3, %r9d
xorl %ecx, %r9d
orl $0x1, %r9d
andl %r8d, %r9d
movl %r10d, %esi
movl %edi, %r10d
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
movl %r10d, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r11d
leal (%r10,%r10), %ecx
andl $0x1e, %ecx
movl %r11d, %ebx
shrl %cl, %ebx
testb $0x2, %bl
jne 0x336b
testb $0x1, %bl
jne 0x3342
movq 0x18(%r15), %rbx
movl %r10d, %r14d
cmpq %rax, (%rbx,%r14,8)
je 0x336b
btl %ecx, %r11d
cmovbl %r10d, %esi
addl %r9d, %r10d
andl %r8d, %r10d
cmpl %edi, %r10d
jne 0x3315
movb $0x1, %cl
movl %r12d, %r8d
cmpl %r12d, %esi
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %r11
je 0x3385
jmp 0x3395
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %r10d, %edi
movl %esi, %r8d
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %r11
cmpl %r12d, %r8d
cmovel %edi, %r8d
testb %cl, %cl
cmovnel %edi, %r8d
movl %r8d, %esi
movl %esi, %edi
shrl $0x4, %edi
movl (%rdx,%rdi,4), %r8d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl %r8d, %r9d
shrl %cl, %r9d
testb $0x2, %r9b
jne 0x3654
testb $0x1, %r9b
jne 0x3687
testb %r11b, %r11b
leaq 0xef90(%rip), %rax      # 0x12358
leaq 0xef81(%rip), %rcx      # 0x12350
cmovneq %rcx, %rax
leaq 0xef8e(%rip), %rcx      # 0x12368
leaq 0xef7f(%rip), %rdx      # 0x12360
cmovneq %rdx, %rcx
incq (%rax)
incq (%rcx)
movabsq $0x40000000000, %rax    # imm = 0x40000000000
movq 0x20(%rsp), %rcx
orq %rax, 0x8(%rcx)
cmpb $0x0, 0x8(%rbx)
movq 0x40(%rsp), %r8
je 0x36c2
movq 0x38(%rsp), %rdi
callq 0x23d0
movq %rax, %rsi
movq 0x8(%rsp), %r15
movl (%r15), %r14d
movl 0x8(%r15), %eax
cmpl 0xc(%r15), %eax
jb 0x36d7
movl 0x4(%r15), %eax
leal (%rax,%rax), %ecx
cmpl %r14d, %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0x1, %ecx
addl %r14d, %ecx
decl %ecx
movl %ecx, %edx
shrl %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x2, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x4, %edx
orl %ecx, %edx
movl %edx, %edi
shrl $0x8, %edi
orl %edx, %edi
movl %edi, %ecx
shrl $0x10, %ecx
orl %edi, %ecx
incl %ecx
cmpl $0x5, %ecx
movl $0x4, %ebx
cmovael %ecx, %ebx
cvtsi2sd %rbx, %xmm0
mulsd 0xab83(%rip), %xmm0     # 0xe008
addsd 0xab83(%rip), %xmm0     # 0xe010
cvttsd2si %xmm0, %r12
cmpl %r12d, %eax
jae 0x36d7
movq %rsi, 0x38(%rsp)
movl %ebx, %ebp
shrl $0x2, %ebp
andl $-0x4, %ebp
cmpl $0x10, %ecx
movl $0x4, %eax
cmovbl %eax, %ebp
movq %rbp, %rdi
callq 0x22a0
movq %rax, %r13
movq %rax, %rdi
movl $0xaa, %esi
movq %rbp, %rdx
callq 0x21b0
cmpl %ebx, %r14d
jae 0x34f2
movq 0x18(%r15), %rdi
movl %ebx, %esi
shlq $0x3, %rsi
callq 0x22e0
movq %rax, 0x18(%r15)
movl (%r15), %r14d
testl %r14d, %r14d
je 0x3621
movq %r12, 0x20(%rsp)
movq %rbx, %r12
leal -0x1(%rbx), %eax
xorl %edx, %edx
movq 0x10(%r15), %rsi
movl %edx, %r8d
shrl $0x4, %r8d
movl (%rsi,%r8,4), %r9d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %r9d, %edi
shrl %cl, %edi
testb $0x3, %dil
jne 0x35f6
movq 0x18(%r15), %rdi
movl %edx, %r10d
movq (%rdi,%r10,8), %rdi
btsl %ecx, %r9d
movl %r9d, (%rsi,%r8,4)
movsbl (%rdi), %r8d
testl %r8d, %r8d
je 0x3567
movb 0x1(%rdi), %cl
testb %cl, %cl
je 0x356a
leaq 0x2(%rdi), %r9
movl %r8d, %r10d
shll $0x5, %r10d
subl %r8d, %r10d
movsbl %cl, %r8d
addl %r10d, %r8d
movb (%r9), %cl
incq %r9
testb %cl, %cl
jne 0x354a
jmp 0x356a
xorl %r8d, %r8d
movl %r8d, %ecx
shrl $0x3, %ecx
leal (,%r8,8), %r10d
xorl %ecx, %r10d
orl $0x1, %r10d
andl %eax, %r10d
movl %r8d, %r11d
andl %eax, %r11d
movl %r11d, %r9d
leal (%r11,%r11), %ecx
andl $0x1e, %ecx
movl $0x2, %ebx
shll %cl, %ebx
shrl $0x4, %r9d
movl (%r13,%r9,4), %ebp
leal (%r11,%r10), %r8d
testl %ebp, %ebx
je 0x3582
notl %ebx
andl %ebx, %ebp
movl %ebp, (%r13,%r9,4)
movl (%r15), %r14d
movl %r11d, %r8d
cmpl %r14d, %r11d
jae 0x35ee
movl (%rsi,%r9,4), %r10d
shrl %cl, %r10d
movq 0x18(%r15), %rsi
testb $0x3, %r10b
jne 0x35f2
movq (%rsi,%r8,8), %r10
movq %rdi, (%rsi,%r8,8)
movl $0x1, %edi
shll %cl, %edi
movq 0x10(%r15), %rsi
orl %edi, (%rsi,%r9,4)
movq %r10, %rdi
jmp 0x3536
movq 0x18(%r15), %rsi
movq %rdi, (%rsi,%r8,8)
incl %edx
cmpl %r14d, %edx
jne 0x34ff
movq %r12, %rbx
cmpl %ebx, %r14d
movq 0x20(%rsp), %r12
jbe 0x3621
movq 0x18(%r15), %rdi
movl %ebx, %esi
shlq $0x3, %rsi
callq 0x22e0
movq %rax, 0x18(%r15)
movq 0x10(%r15), %rdi
callq 0x2050
movq %r13, 0x10(%r15)
movl %ebx, (%r15)
movl 0x4(%r15), %eax
movl %eax, 0x8(%r15)
movl %r12d, 0xc(%r15)
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
jmp 0x36da
movq 0x18(%r15), %r9
movl $0x3, %r10d
shll %cl, %r10d
movl %esi, %ecx
movq %rax, (%r9,%rcx,8)
notl %r10d
andl %r10d, %r8d
movl %r8d, (%rdx,%rdi,4)
movq 0x4(%r15), %xmm0
psubd 0xa9a1(%rip), %xmm0     # 0xe020
movq %xmm0, 0x4(%r15)
jmp 0x36a8
movq 0x18(%r15), %r9
movl $0x3, %r10d
shll %cl, %r10d
movl %esi, %ecx
movq %rax, (%r9,%rcx,8)
notl %r10d
andl %r10d, %r8d
movl %r8d, (%rdx,%rdi,4)
incl 0x4(%r15)
testb %r11b, %r11b
movq 0x40(%rsp), %r8
je 0x36bb
incq 0xec97(%rip)            # 0x12350
jmp 0x36c2
incq 0xec96(%rip)            # 0x12358
incq %r8
movq 0x8(%r13), %rax
cmpq %r8, %rax
ja 0x2e47
jmp 0x3894
movl %r14d, %edi
movsbl (%rsi), %r14d
testl %r14d, %r14d
je 0x370c
movb 0x1(%rsi), %al
testb %al, %al
je 0x370f
movq %rsi, %rcx
addq $0x2, %rcx
movl %r14d, %edx
shll $0x5, %edx
subl %r14d, %edx
movsbl %al, %r14d
addl %edx, %r14d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x36f1
jmp 0x370f
xorl %r14d, %r14d
leal -0x1(%rdi), %edx
movl %r14d, %r9d
andl %edx, %r9d
movq 0x10(%r15), %r13
movl %r9d, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %eax
leal (%r9,%r9), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x3739
movl %r9d, %r12d
jmp 0x3804
movl %r14d, %eax
shrl $0x3, %eax
shll $0x3, %r14d
xorl %eax, %r14d
orl $0x1, %r14d
andl %edx, %r14d
movq %rdi, 0x18(%rsp)
movq %rdi, %r12
movl %r9d, %ebx
movq %rsi, 0x38(%rsp)
movq %r9, 0x20(%rsp)
movl %edx, 0x30(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %r15d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r15d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x37d7
testb $0x1, %al
jne 0x37ab
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2200
movl 0x30(%rsp), %edx
movq 0x20(%rsp), %r9
movq 0x38(%rsp), %rsi
testl %eax, %eax
je 0x37d7
btl %ebp, %r15d
cmovbl %ebx, %r12d
addl %r14d, %ebx
andl %edx, %ebx
cmpl %r9d, %ebx
jne 0x3766
movb $0x1, %al
movq 0x18(%rsp), %rdx
movl %edx, %ecx
cmpl %edx, %r12d
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
je 0x37f3
jmp 0x3804
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x2, %r15b
sete %al
movl %ebx, %r9d
movl %r12d, %ecx
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
cmpl 0x18(%rsp), %ecx
cmovel %r9d, %ecx
testb %al, %al
cmovnel %r9d, %ecx
movl %ecx, %r12d
movl %r12d, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %edx
leal (%r12,%r12), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
movq 0x40(%rsp), %r8
jne 0x3858
testb $0x1, %dl
movq 0x50(%rsp), %r13
je 0x36c2
movq 0x8(%rsp), %rdi
movq 0x18(%rdi), %rdx
movl %r12d, %r9d
movq %rsi, (%rdx,%r9,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%rdi)
jmp 0x36c2
movq 0x8(%rsp), %rdi
movq 0x18(%rdi), %rdx
movl %r12d, %r9d
movq %rsi, (%rdx,%r9,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
movq 0x4(%rdi), %xmm0
psubd 0xa79b(%rip), %xmm0     # 0xe020
movq %xmm0, 0x4(%rdi)
movq 0x50(%rsp), %r13
jmp 0x36c2
testq %rax, %rax
je 0x3abc
xorl %r14d, %r14d
movq (%r13), %rax
andq %rbp, %rax
addq %r14, %rax
andq 0x10(%r13), %rax
movq 0x18(%r13), %rcx
shlq $0x4, %rax
cmpb $0x0, 0x8(%rcx,%rax)
je 0x38c7
leaq (%rcx,%rax), %rdx
cmpb $0x0, 0x9(%rdx)
je 0x38e7
incq %r14
movq 0x50(%rsp), %r13
movq 0x8(%r13), %rax
cmpq %r14, %rax
movabsq $0x3ffffffffffffff, %rbp # imm = 0x3FFFFFFFFFFFFFF
ja 0x38a0
jmp 0x3a5c
movq (%rcx,%rax), %rcx
movq 0x8(%rsp), %rax
movl (%rax), %edi
testl %edi, %edi
movq %rcx, 0x30(%rsp)
je 0x392e
movq 0x28(%rcx), %rsi
movsbl (%rsi), %r12d
testl %r12d, %r12d
je 0x3936
movb 0x1(%rsi), %al
testb %al, %al
je 0x3939
leaq 0x2(%rsi), %rcx
movl %r12d, %edx
shll $0x5, %edx
subl %r12d, %edx
movsbl %al, %r12d
addl %edx, %r12d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x3913
jmp 0x3939
xorl %r13d, %r13d
jmp 0x39e4
xorl %r12d, %r12d
movq %rdi, 0x18(%rsp)
leal -0x1(%rdi), %edx
movl %r12d, %edi
andl %edx, %edi
movl %r12d, %eax
shrl $0x3, %eax
shll $0x3, %r12d
xorl %eax, %r12d
orl $0x1, %r12d
andl %edx, %r12d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r15
movl %edi, %r13d
movq %r14, 0x38(%rsp)
movl %edi, 0x20(%rsp)
movq %rsi, 0x40(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%r15,%rax,4), %ebx
leal (,%r13,2), %ebp
andl $0x1e, %ebp
movl %ebx, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x39d4
testb $0x1, %al
jne 0x39c4
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movl %edx, %r14d
callq 0x2200
movl 0x20(%rsp), %edi
movl %r14d, %edx
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %rsi
testl %eax, %eax
je 0x39d4
addl %r12d, %r13d
andl %edx, %r13d
cmpl %edi, %r13d
jne 0x3974
jmp 0x38c7
movl %ebp, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq 0x18(%rsp), %rdi
cmovnel %edi, %r13d
cmpl %edi, %r13d
je 0x38c7
movabsq $0x40000000000, %rax    # imm = 0x40000000000
movq 0x30(%rsp), %rcx
orq %rax, 0x8(%rcx)
movq 0x8(%rsp), %rbx
movq 0x18(%rbx), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2050
cmpl %r13d, (%rbx)
je 0x38c7
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movl %r13d, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
addl %r13d, %r13d
andl $0x1e, %r13d
movl %esi, %edi
movl %r13d, %ecx
shrl %cl, %edi
testb $0x3, %dil
jne 0x38c7
btsl %r13d, %esi
movl %esi, (%rax,%rdx,4)
movq 0x8(%rsp), %rax
decl 0x4(%rax)
jmp 0x38c7
testq %rax, %rax
movq 0x58(%rsp), %r12
je 0x3abc
movabsq $-0x400000000000000, %rbx # imm = 0xFC00000000000000
movq (%r13), %rcx
movq 0x18(%r13), %r14
movq %rcx, %r15
andq %rbp, %r15
leaq 0x1(%rcx), %rdx
andq %rbp, %rdx
andq %rbx, %rcx
shlq $0x4, %r15
andq 0x10(%r13), %rdx
orq %rcx, %rdx
movq %rdx, (%r13)
decq %rax
movq %rax, 0x8(%r13)
movq (%r14,%r15), %rsi
movq %r12, %rdi
callq 0x93f4
movq (%r14,%r15), %rdi
callq 0x8f92
movq 0x8(%r13), %rax
testq %rax, %rax
jne 0x3a70
movq 0x10(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq