// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_rmdup.c
// Function: bam_rmdup_core
void bam_rmdup_core(samfile_t *in, samfile_t *out)
{
	bam1_t *b;
	int last_tid = -1, last_pos = -1;
	tmp_stack_t stack;
	khint_t k;
	khash_t(lib) *aux;
	khash_t(name) *del_set;
	
	aux = kh_init(lib);
	del_set = kh_init(name);
	b = bam_init1();
	memset(&stack, 0, sizeof(tmp_stack_t));

	kh_resize(name, del_set, 4 * BUFFER_SIZE);
	while (samread(in, b) >= 0) {
		bam1_core_t *c = &b->core;
		if (c->tid != last_tid || last_pos != c->pos) {
			dump_best(&stack, out); // write the result
			clear_best(aux, BUFFER_SIZE);
			if (c->tid != last_tid) {
				clear_best(aux, 0);
				if (kh_size(del_set)) { // check
					fprintf(stderr, "[bam_rmdup_core] %llu unmatched pairs\n", (long long)kh_size(del_set));
					clear_del_set(del_set);
				}
				if ((int)c->tid == -1) { // append unmapped reads
					samwrite(out, b);
					while (samread(in, b) >= 0) samwrite(out, b);
					break;
				}
				last_tid = c->tid;
				fprintf(stderr, "[bam_rmdup_core] processing reference %s...\n", in->header->target_name[c->tid]);
			}
		}
		if (!(c->flag&BAM_FPAIRED) || (c->flag&(BAM_FUNMAP|BAM_FMUNMAP)) || (c->mtid >= 0 && c->tid != c->mtid)) {
			samwrite(out, b);
		} else if (c->isize > 0) { // paired, head
			uint64_t key = (uint64_t)c->pos<<32 | c->isize;
			const char *lib;
			lib_aux_t *q;
			int ret;
			lib = bam_get_library(in->header, b);
			q = lib? get_aux(aux, lib) : get_aux(aux, "\t");
			++q->n_checked;
			k = kh_put(pos, q->best_hash, key, &ret);
			if (ret == 0) { // found in best_hash
				bam1_t *p = kh_val(q->best_hash, k);
				++q->n_removed;
				if (sum_qual(p) < sum_qual(b)) { // the current alignment is better; this can be accelerated in principle
					kh_put(name, del_set, strdup(bam1_qname(p)), &ret); // p will be removed
					bam_copy1(p, b); // replaced as b
				} else kh_put(name, del_set, strdup(bam1_qname(b)), &ret); // b will be removed
				if (ret == 0)
					fprintf(stderr, "[bam_rmdup_core] inconsistent BAM file for pair '%s'. Continue anyway.\n", bam1_qname(b));
			} else { // not found in best_hash
				kh_val(q->best_hash, k) = bam_dup1(b);
				stack_insert(&stack, kh_val(q->best_hash, k));
			}
		} else { // paired, tail
			k = kh_get(name, del_set, bam1_qname(b));
			if (k != kh_end(del_set)) {
				free((char*)kh_key(del_set, k));
				kh_del(name, del_set, k);
			} else samwrite(out, b);
		}
		last_pos = c->pos;
	}

	for (k = kh_begin(aux); k != kh_end(aux); ++k) {
		if (kh_exist(aux, k)) {
			lib_aux_t *q = &kh_val(aux, k);			
			dump_best(&stack, out);
			fprintf(stderr, "[bam_rmdup_core] %lld / %lld = %.4lf in library '%s'\n", (long long)q->n_removed,
					(long long)q->n_checked, (double)q->n_removed/q->n_checked, kh_key(aux, k));
			kh_destroy(pos, q->best_hash);
			free((char*)kh_key(aux, k));
		}
	}
	kh_destroy(lib, aux);

	clear_del_set(del_set);
	kh_destroy(name, del_set);
	free(stack.a);
	bam_destroy1(b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r12
movq %rdi, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x3610
movq %rax, %r15
movl $0x1, %edi
movl $0x28, %esi
callq 0x3610
movq %rax, %rbx
movl $0x1, %edi
movl $0x38, %esi
callq 0x3610
movq %rax, %rbp
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
movl $0x100000, %esi         # imm = 0x100000
callq 0xbe9e
movq %r14, %rdi
movq %rbp, %rsi
callq 0x283b1
testl %eax, %eax
movq %rbp, 0x30(%rsp)
movq %r15, 0x18(%rsp)
js 0xbcb1
leaq 0x10(%r14), %rax
movq %rax, 0x68(%rsp)
leaq 0x30(%rbp), %rax
movq %rax, 0x58(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq $0x0, 0x60(%rsp)
movl $0x0, 0x4(%rsp)
movq %r14, 0x10(%rsp)
cmpl %eax, (%rbp)
movl %eax, 0x38(%rsp)
jne 0xb38c
cmpl 0x4(%rbp), %ebx
je 0xb42a
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0xb3cb
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %rsi
movq %r12, %rdi
callq 0x283e6
movq (%r13,%r14,8), %rax
testq %rax, %rax
je 0xb3c3
movq 0x30(%rax), %rdi
callq 0x3350
movq (%r13,%r14,8), %rdi
callq 0x3350
incq %r14
cmpq %r14, %rbx
jne 0xb399
movq %r15, %rdi
movl $0x40000, %esi          # imm = 0x40000
callq 0xc096
movl $0x0, 0x4(%rsp)
movl 0x38(%rsp), %eax
cmpl %eax, (%rbp)
jne 0xb3f0
movq 0x10(%rsp), %r14
jmp 0xb42a
movq %r15, %rdi
xorl %esi, %esi
callq 0xc096
movq 0x20(%rsp), %rax
movl 0x4(%rax), %edx
testq %rdx, %rdx
movq 0x10(%rsp), %r14
jne 0xbc50
movl (%rbp), %esi
cmpl $-0x1, %esi
je 0xbc77
movq 0x68(%rsp), %rdi
movl %esi, 0x38(%rsp)
callq 0x3dc6
movq 0x8(%rbp), %rax
movabsq $0xd00000000, %rcx      # imm = 0xD00000000
andq %rcx, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0xb741
movl 0x14(%rbp), %eax
testl %eax, %eax
js 0xb45e
cmpl %eax, (%rbp)
jne 0xb741
movslq 0x1c(%rbp), %rax
testq %rax, %rax
jle 0xb76b
movq %rax, 0x48(%rsp)
movl 0x4(%rbp), %ebx
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x2619d
testq %rax, %rax
leaq 0x36cac(%rip), %rcx     # 0x42139
cmoveq %rcx, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0xc1a3
incq (%rax)
movq 0x10(%rax), %rbp
movl (%rbp), %r8d
movl 0x8(%rbp), %ecx
cmpl 0xc(%rbp), %ecx
movq %rax, 0x40(%rsp)
movq %rbx, 0x50(%rsp)
jb 0xb6f7
movl 0x4(%rbp), %eax
leal (%rax,%rax), %ecx
cmpl %r8d, %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0x1, %ecx
addl %r8d, %ecx
movl $0x21, %edx
leaq 0x35c51(%rip), %rdi     # 0x41130
leal -0x2(%rdx), %esi
decl %edx
cmpl %ecx, (%rdi,%rsi,4)
ja 0xb4df
movl %edx, %ecx
movl (%rdi,%rcx,4), %ebx
cvtsi2sd %rbx, %xmm0
mulsd 0x33b15(%rip), %xmm0    # 0x3f010
addsd 0x33b15(%rip), %xmm0    # 0x3f018
cvttsd2si %xmm0, %rcx
cmpl %ecx, %eax
jae 0xb6f7
movq %rcx, 0x70(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %rdi
movq %rdi, 0x8(%rsp)
callq 0x3240
movq %rax, %r14
movq %rax, %rdi
movl $0xaa, %esi
movq 0x8(%rsp), %rdx
callq 0x3080
movl (%rbp), %edx
cmpl %ebx, %edx
jae 0xb577
movq 0x18(%rbp), %rdi
leaq (,%rbx,8), %rsi
movq %rsi, 0x8(%rsp)
callq 0x3720
movq %rax, 0x18(%rbp)
movq 0x20(%rbp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3720
movq %rax, 0x20(%rbp)
movl (%rbp), %edx
testl %edx, %edx
je 0xb6d1
leal -0x1(%rbx), %eax
movl %eax, 0x8(%rsp)
xorl %r8d, %r8d
movq 0x10(%rbp), %r10
movl %r8d, %eax
shrl $0x4, %eax
movl (%r10,%rax,4), %esi
leal (%r8,%r8), %ecx
andl $0x1e, %ecx
movl %esi, %edi
shrl %cl, %edi
testb $0x3, %dil
jne 0xb695
movl %r8d, %edx
movq 0x18(%rbp), %rdi
movq 0x20(%rbp), %r9
movq (%rdi,%rdx,8), %r11
movq (%r9,%rdx,8), %r9
btsl %ecx, %esi
movl %esi, (%r10,%rax,4)
movq %r11, %rcx
shrq $0x21, %rcx
movl %r11d, %eax
shll $0xb, %eax
xorl %eax, %ecx
xorl %r11d, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %ebx
movl %edx, %esi
movl %ecx, %eax
xorl %edx, %edx
divl 0x8(%rsp)
movl %esi, %eax
movl %esi, %ecx
addl %esi, %ecx
andl $0x1e, %ecx
movl $0x2, %edi
shll %cl, %edi
shrl $0x4, %eax
movl (%r14,%rax,4), %r15d
testl %r15d, %edi
jne 0xb62d
incl %edx
addl %edx, %esi
xorl %eax, %eax
cmpl %ebx, %esi
jb 0xb610
movl %ebx, %eax
subl %eax, %esi
movl %esi, %eax
shrl $0x4, %eax
movl (%r14,%rax,4), %r15d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl $0x2, %edi
shll %cl, %edi
testl %r15d, %edi
je 0xb606
notl %edi
andl %r15d, %edi
movl %edi, (%r14,%rax,4)
movl (%rbp), %edx
cmpl %edx, %esi
jae 0xb67e
movl (%r10,%rax,4), %r10d
shrl %cl, %r10d
movq 0x18(%rbp), %rdi
testb $0x3, %r10b
jne 0xb682
movl %esi, %edx
movq (%rdi,%rdx,8), %rsi
movq %r11, (%rdi,%rdx,8)
movq 0x20(%rbp), %rdi
movq (%rdi,%rdx,8), %r15
movq %r9, (%rdi,%rdx,8)
movl $0x1, %edx
shll %cl, %edx
movq 0x10(%rbp), %r10
orl %edx, (%r10,%rax,4)
movq %rsi, %r11
movq %r15, %r9
jmp 0xb5c6
movq 0x18(%rbp), %rdi
movl %esi, %eax
movq %r11, (%rdi,%rax,8)
movq 0x20(%rbp), %rcx
movq %r9, (%rcx,%rax,8)
movq 0x18(%rsp), %r15
incl %r8d
cmpl %edx, %r8d
jne 0xb589
cmpl %ebx, %edx
jbe 0xb6d1
movq 0x18(%rbp), %rdi
leaq (,%rbx,8), %rsi
movq %rsi, 0x8(%rsp)
callq 0x3720
movq %rax, 0x18(%rbp)
movq 0x20(%rbp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3720
movq %rax, 0x20(%rbp)
movq 0x10(%rbp), %rdi
callq 0x3350
movq %r14, 0x10(%rbp)
movl %ebx, (%rbp)
movl 0x4(%rbp), %eax
movl %eax, 0x8(%rbp)
movq 0x70(%rsp), %rax
movl %eax, 0xc(%rbp)
movl %ebx, %r8d
movq 0x10(%rsp), %r14
movq 0x50(%rsp), %r10
shlq $0x20, %r10
movq %r10, %rdi
movq 0x48(%rsp), %rcx
orq %rcx, %rdi
shrq $0x21, %r10
movl %ecx, %eax
shll $0xb, %eax
xorl %eax, %r10d
xorl %ecx, %r10d
movl %r10d, %eax
xorl %edx, %edx
divl %r8d
movl %edx, %esi
movq 0x10(%rbp), %r9
movl %edx, %eax
shrl $0x4, %eax
movl (%r9,%rax,4), %eax
leal (%rsi,%rsi), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0xb7b6
movl %esi, %eax
jmp 0xb846
movq %r12, %rdi
movq %rbp, %rsi
callq 0x283e6
movl 0x4(%rbp), %ebx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x283b1
testl %eax, %eax
movl 0x38(%rsp), %eax
jns 0xb37a
jmp 0xbcbc
movq 0x20(%rsp), %rax
movl (%rax), %ebp
testl %ebp, %ebp
je 0xbb01
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movsbl (%rsi), %ecx
testl %ecx, %ecx
je 0xbb09
movb 0x1(%rsi), %al
testb %al, %al
je 0xbb0b
leaq 0x2(%rsi), %rdx
movl %ecx, %edi
shll $0x5, %edi
subl %ecx, %edi
movsbl %al, %ecx
addl %edi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0xb79c
jmp 0xbb0b
leal -0x1(%r8), %ecx
movl %r10d, %eax
xorl %edx, %edx
divl %ecx
incl %edx
movl %esi, %r10d
movl %r8d, %eax
movl %r10d, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r11d
leal (%r10,%r10), %ecx
andl $0x1e, %ecx
movl %r11d, %ebx
shrl %cl, %ebx
testb $0x2, %bl
jne 0xb82a
testb $0x1, %bl
jne 0xb7fb
movq 0x18(%rbp), %rbx
movl %r10d, %r14d
cmpq %rdi, (%rbx,%r14,8)
movq 0x10(%rsp), %r14
je 0xb82a
btl %ecx, %r11d
cmovbl %r10d, %eax
addl %edx, %r10d
cmpl %r8d, %r10d
movl %r8d, %ecx
movl $0x0, %r11d
cmovbl %r11d, %ecx
subl %ecx, %r10d
cmpl %esi, %r10d
jne 0xb7c9
movb $0x1, %cl
movl %r8d, %edx
cmpl %r8d, %eax
je 0xb839
jmp 0xb846
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %eax, %edx
movl %r10d, %esi
cmpl %r8d, %edx
cmovel %esi, %edx
testb %cl, %cl
cmovnel %esi, %edx
movl %edx, %eax
movl %eax, %edx
shrl $0x4, %edx
movl (%r9,%rdx,4), %esi
leal (%rax,%rax), %ecx
andl $0x1e, %ecx
movl %esi, %r8d
shrl %cl, %r8d
testb $0x2, %r8b
jne 0xb9d0
testb $0x1, %r8b
jne 0xba03
movl $0x0, 0x2c(%rsp)
movq 0x40(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbx
incq 0x8(%rdx)
movq 0x30(%rbx), %rdi
movslq 0x10(%rbx), %rax
xorl %ecx, %ecx
movl $0x0, %edx
testq %rax, %rax
jle 0xb8d7
movq 0x8(%rbx), %rdx
movq %rdx, %rsi
shrq $0x30, %rsi
leaq (%rdi,%rsi,4), %rsi
shrl $0x18, %edx
addq %rsi, %rdx
leal 0x1(%rax), %esi
sarl %esi
movslq %esi, %rsi
addq %rdx, %rsi
xorl %r8d, %r8d
xorl %edx, %edx
movzbl (%rsi,%r8), %r9d
addl %r9d, %edx
incq %r8
cmpq %r8, %rax
jne 0xb8c7
movq 0x30(%rsp), %rbp
movq 0x30(%rbp), %rax
movslq 0x10(%rbp), %rsi
testq %rsi, %rsi
jle 0xb920
movq 0x8(%rbp), %rcx
movq %rcx, %r8
shrq $0x30, %r8
leaq (%rax,%r8,4), %r8
shrl $0x18, %ecx
addq %r8, %rcx
leal 0x1(%rsi), %r8d
sarl %r8d
movslq %r8d, %r8
addq %rcx, %r8
xorl %r9d, %r9d
xorl %ecx, %ecx
movzbl (%r8,%r9), %r10d
addl %r10d, %ecx
incq %r9
cmpq %r9, %rsi
jne 0xb910
cmpl %ecx, %edx
jge 0xbc1c
callq 0x3570
movq 0x20(%rsp), %rdi
movq %rax, %rsi
leaq 0x2c(%rsp), %rdx
callq 0xc749
movq 0x30(%rbx), %r14
movq %rbp, %r15
movl 0x28(%rbx), %ebp
movl 0x24(%r15), %eax
cmpl %eax, %ebp
jge 0xb989
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ebp
sarl $0x10, %ebp
orl %eax, %ebp
incl %ebp
movslq %ebp, %rsi
movq %r14, %rdi
callq 0x3720
movq %rax, %r14
movl 0x24(%r15), %eax
movq 0x30(%r15), %rsi
movslq %eax, %rdx
movq %r14, %rdi
callq 0x37d0
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movupd 0x20(%r15), %xmm2
movupd %xmm2, 0x20(%rbx)
movupd %xmm0, (%rbx)
movupd %xmm1, 0x10(%rbx)
movl %ebp, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movq %r15, %rbp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
jmp 0xbc36
movq 0x18(%rbp), %r8
movl %eax, %r15d
movl $0x3, %eax
shll %cl, %eax
movq %rdi, (%r8,%r15,8)
notl %eax
andl %eax, %esi
movl %esi, (%r9,%rdx,4)
movq 0x4(%rbp), %xmm0
psubd 0x33649(%rip), %xmm0    # 0x3f040
movq %xmm0, 0x4(%rbp)
movl $0x1, %eax
jmp 0xba25
movq 0x18(%rbp), %r8
movl %eax, %r15d
movl $0x3, %eax
shll %cl, %eax
movq %rdi, (%r8,%r15,8)
notl %eax
andl %eax, %esi
movl %esi, (%r9,%rdx,4)
incl 0x4(%rbp)
movl $0x2, %eax
movl %eax, 0x2c(%rsp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x3610
movq %rax, %rbx
movq 0x30(%rsp), %rbp
movupd (%rbp), %xmm0
movupd 0x10(%rbp), %xmm1
movupd 0x20(%rbp), %xmm2
movupd %xmm2, 0x20(%rax)
movupd %xmm0, (%rax)
movupd %xmm1, 0x10(%rax)
movq 0x30(%rbp), %rax
movq %rax, 0x30(%rbx)
movslq 0x24(%rbx), %r14
movl %r14d, 0x28(%rbx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x3610
movq %rax, 0x30(%rbx)
movq 0x30(%rbp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x37d0
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x20(%rax), %rax
movq %rbx, (%rax,%r15,8)
movq 0x10(%rcx), %rax
movq 0x20(%rax), %rax
movq (%rax,%r15,8), %rbx
movq 0x60(%rsp), %rax
cmpl %eax, 0x4(%rsp)
jne 0xbae0
leal (%rax,%rax), %ebp
testl %eax, %eax
movl $0x10000, %eax          # imm = 0x10000
cmovel %eax, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq %r13, %rdi
callq 0x3720
movq %rax, %r13
movl %ebp, %eax
movq %rax, 0x60(%rsp)
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
movl 0x4(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0x4(%rsp)
movq %rbx, (%r13,%rax,8)
jmp 0xb74c
xorl %r15d, %r15d
jmp 0xbbb1
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %ebp
movl %edx, %r9d
leal -0x1(%rbp), %edi
movl %ecx, %eax
xorl %edx, %edx
divl %edi
incl %edx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
movl %r9d, %r15d
movq %rsi, 0x8(%rsp)
movl %r9d, 0x40(%rsp)
movl %edx, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %r14d
leal (%r15,%r15), %ebx
andl $0x1e, %ebx
movl %r14d, %eax
movl %ebx, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xbba4
testb $0x1, %al
jne 0xbb8a
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x35a0
movq 0x48(%rsp), %rdi
movl 0x50(%rsp), %edx
movl 0x40(%rsp), %r9d
movq 0x8(%rsp), %rsi
testl %eax, %eax
je 0xbba4
addl %edx, %r15d
cmpl %ebp, %r15d
movl %ebp, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r15d
cmpl %r9d, %r15d
jne 0xbb3e
jmp 0xbbb6
movl %ebx, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
cmovnel %ebp, %r15d
cmpl %ebp, %r15d
jne 0xbbc8
movq %r12, %rdi
movq 0x30(%rsp), %rbp
movq %rbp, %rsi
callq 0x283e6
jmp 0xbc0d
movq 0x20(%rsp), %rbx
movq 0x18(%rbx), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x3350
movq 0x10(%rbx), %rax
movl %r15d, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
addl %r15d, %r15d
andl $0x1e, %r15d
movl %esi, %edi
movl %r15d, %ecx
shrl %cl, %edi
testb $0x3, %dil
jne 0xbc08
btsl %r15d, %esi
movl %esi, (%rax,%rdx,4)
decl 0x4(%rbx)
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
jmp 0xb74c
movq %rax, %rdi
callq 0x3570
movq 0x20(%rsp), %rdi
movq %rax, %rsi
leaq 0x2c(%rsp), %rdx
callq 0xc749
cmpl $0x0, 0x2c(%rsp)
jne 0xb74c
movq 0x58(%rsp), %rdi
callq 0x3def
jmp 0xb74c
movq 0x44391(%rip), %rax     # 0x4ffe8
movq (%rax), %rdi
leaq 0x3532f(%rip), %rsi     # 0x40f90
xorl %eax, %eax
callq 0x3750
movq 0x20(%rsp), %rdi
callq 0xc125
jmp 0xb410
movq %r12, %rdi
movq %rbp, %rsi
callq 0x283e6
movq %r14, %rdi
movq %rbp, %rsi
callq 0x283b1
movl $0x0, 0x4(%rsp)
testl %eax, %eax
js 0xbcbc
movq %r12, %rdi
movq %rbp, %rsi
callq 0x283e6
movq %r14, %rdi
movq %rbp, %rsi
callq 0x283b1
jmp 0xbc95
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movl (%r15), %ebp
movq 0x10(%r15), %r14
testq %rbp, %rbp
movl 0x4(%rsp), %edx
je 0xbe02
xorl %r15d, %r15d
movq %r14, 0x38(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%r14,%rax,4), %eax
leal (%r15,%r15), %ecx
shrl %cl, %eax
testb $0x3, %al
je 0xbcf9
incq %r15
cmpq %rbp, %r15
jne 0xbcd8
jmp 0xbe02
leaq (%r15,%r15,2), %rcx
shlq $0x3, %rcx
movq 0x18(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x8(%rsp)
testl %edx, %edx
je 0xbd4a
movl %edx, %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %rsi
movq %r12, %rdi
callq 0x283e6
movq (%r13,%r14,8), %rax
testq %rax, %rax
je 0xbd42
movq 0x30(%rax), %rdi
callq 0x3350
movq (%r13,%r14,8), %rdi
callq 0x3350
incq %r14
cmpq %r14, %rbx
jne 0xbd18
movq 0x44297(%rip), %rax     # 0x4ffe8
movq (%rax), %rdi
movq 0x8(%rsp), %rbx
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movq %rdx, %xmm1
movq 0x35203(%rip), %xmm2    # 0x40f70
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x35207(%rip), %xmm3    # 0x40f80
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rcx, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r14
movq (%r14,%r15,8), %r8
leaq 0x35272(%rip), %rsi     # 0x4102c
movb $0x1, %al
callq 0x3750
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0xbded
movq 0x18(%rbx), %rdi
callq 0x3350
movq 0x10(%rbx), %rdi
callq 0x3350
movq 0x20(%rbx), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3350
movq (%r14,%r15,8), %rdi
callq 0x3350
xorl %edx, %edx
movq 0x38(%rsp), %r14
jmp 0xbcec
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rdi
callq 0x3350
movq %r14, %rdi
callq 0x3350
movq 0x20(%rbx), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3350
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xc125
testq %rbx, %rbx
je 0xbe5e
movq 0x18(%rbx), %rdi
callq 0x3350
movq 0x10(%rbx), %rdi
callq 0x3350
movq 0x20(%rbx), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3350
movq %r13, %rdi
callq 0x3350
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0xbe8f
movq 0x30(%rbx), %rdi
callq 0x3350
movq %rbx, %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3350
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq