// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/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 0x3530
movq %rax, %r15
movl $0x1, %edi
movl $0x28, %esi
callq 0x3530
movq %rax, %rbx
movl $0x1, %edi
movl $0x38, %esi
callq 0x3530
movq %rax, %rbp
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
movl $0x100000, %esi         # imm = 0x100000
callq 0xbd64
movq %r14, %rdi
movq %rbp, %rsi
callq 0x15122
testl %eax, %eax
movq %rbp, 0x30(%rsp)
movq %r15, 0x18(%rsp)
js 0xbb77
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 0xb240
cmpl 0x4(%rbp), %ebx
je 0xb2de
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0xb27f
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %rsi
movq %r12, %rdi
callq 0x15157
movq (%r13,%r14,8), %rax
testq %rax, %rax
je 0xb277
movq 0x30(%rax), %rdi
callq 0x32c0
movq (%r13,%r14,8), %rdi
callq 0x32c0
incq %r14
cmpq %r14, %rbx
jne 0xb24d
movq %r15, %rdi
movl $0x40000, %esi          # imm = 0x40000
callq 0xbf5c
movl $0x0, 0x4(%rsp)
movl 0x38(%rsp), %eax
cmpl %eax, (%rbp)
jne 0xb2a4
movq 0x10(%rsp), %r14
jmp 0xb2de
movq %r15, %rdi
xorl %esi, %esi
callq 0xbf5c
movq 0x20(%rsp), %rax
movl 0x4(%rax), %edx
testq %rdx, %rdx
movq 0x10(%rsp), %r14
jne 0xbb16
movl (%rbp), %esi
cmpl $-0x1, %esi
je 0xbb3d
movq 0x68(%rsp), %rdi
movl %esi, 0x38(%rsp)
callq 0x3a17
movq 0x8(%rbp), %rax
movabsq $0xd00000000, %rcx      # imm = 0xD00000000
andq %rcx, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0xb5f5
movl 0x14(%rbp), %eax
testl %eax, %eax
js 0xb312
cmpl %eax, (%rbp)
jne 0xb5f5
movslq 0x1c(%rbp), %rax
testq %rax, %rax
jle 0xb61f
movq %rax, 0x48(%rsp)
movl 0x4(%rbp), %ebx
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x134e4
testq %rax, %rax
leaq 0x1897c(%rip), %rcx     # 0x23cbd
cmoveq %rcx, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0xc069
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 0xb5ab
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 0x195fd(%rip), %rdi     # 0x24990
leal -0x2(%rdx), %esi
decl %edx
cmpl %ecx, (%rdi,%rsi,4)
ja 0xb393
movl %edx, %ecx
movl (%rdi,%rcx,4), %ebx
cvtsi2sd %rbx, %xmm0
mulsd 0x18221(%rip), %xmm0    # 0x235d0
addsd 0x18141(%rip), %xmm0    # 0x234f8
cvttsd2si %xmm0, %rcx
cmpl %ecx, %eax
jae 0xb5ab
movq %rcx, 0x70(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %rdi
movq %rdi, 0x8(%rsp)
callq 0x31d0
movq %rax, %r14
movq %rax, %rdi
movl $0xaa, %esi
movq 0x8(%rsp), %rdx
callq 0x3060
movl (%rbp), %edx
cmpl %ebx, %edx
jae 0xb42b
movq 0x18(%rbp), %rdi
leaq (,%rbx,8), %rsi
movq %rsi, 0x8(%rsp)
callq 0x3610
movq %rax, 0x18(%rbp)
movq 0x20(%rbp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3610
movq %rax, 0x20(%rbp)
movl (%rbp), %edx
testl %edx, %edx
je 0xb585
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 0xb549
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 0xb4e1
incl %edx
addl %edx, %esi
xorl %eax, %eax
cmpl %ebx, %esi
jb 0xb4c4
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 0xb4ba
notl %edi
andl %r15d, %edi
movl %edi, (%r14,%rax,4)
movl (%rbp), %edx
cmpl %edx, %esi
jae 0xb532
movl (%r10,%rax,4), %r10d
shrl %cl, %r10d
movq 0x18(%rbp), %rdi
testb $0x3, %r10b
jne 0xb536
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 0xb47a
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 0xb43d
cmpl %ebx, %edx
jbe 0xb585
movq 0x18(%rbp), %rdi
leaq (,%rbx,8), %rsi
movq %rsi, 0x8(%rsp)
callq 0x3610
movq %rax, 0x18(%rbp)
movq 0x20(%rbp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3610
movq %rax, 0x20(%rbp)
movq 0x10(%rbp), %rdi
callq 0x32c0
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 0xb66a
movl %esi, %eax
jmp 0xb6fa
movq %r12, %rdi
movq %rbp, %rsi
callq 0x15157
movl 0x4(%rbp), %ebx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x15122
testl %eax, %eax
movl 0x38(%rsp), %eax
jns 0xb22e
jmp 0xbb82
movq 0x20(%rsp), %rax
movl (%rax), %ebp
testl %ebp, %ebp
je 0xb9c7
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movsbl (%rsi), %ecx
testl %ecx, %ecx
je 0xb9cf
movb 0x1(%rsi), %al
testb %al, %al
je 0xb9d1
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 0xb650
jmp 0xb9d1
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 0xb6de
testb $0x1, %bl
jne 0xb6af
movq 0x18(%rbp), %rbx
movl %r10d, %r14d
cmpq %rdi, (%rbx,%r14,8)
movq 0x10(%rsp), %r14
je 0xb6de
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 0xb67d
movb $0x1, %cl
movl %r8d, %edx
cmpl %r8d, %eax
je 0xb6ed
jmp 0xb6fa
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 0xb896
testb $0x1, %r8b
jne 0xb8c9
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 0xb792
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
shrl $0x1f, %esi
addl %eax, %esi
incl %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 0xb782
movq 0x30(%rsp), %rbp
movq 0x30(%rbp), %rax
movslq 0x10(%rbp), %rsi
testq %rsi, %rsi
jle 0xb7e5
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
shrl $0x1f, %r8d
addl %esi, %r8d
incl %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 0xb7d5
cmpl %ecx, %edx
jge 0xbae2
callq 0x34b0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
leaq 0x2c(%rsp), %rdx
callq 0xc60f
movq 0x30(%rbx), %r14
movq %rbp, %rax
movl 0x28(%rbx), %ebp
movl 0x28(%rax), %eax
cmpl %eax, %ebp
jge 0xb849
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 0x3610
movq %rax, %r14
movq 0x30(%rsp), %r15
movq 0x30(%r15), %rsi
movslq 0x24(%r15), %rdx
movq %r14, %rdi
callq 0x3680
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 %r15, %rbp
movq %r14, 0x30(%rbx)
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
jmp 0xbafc
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 0x177f3(%rip), %xmm0    # 0x230b0
movq %xmm0, 0x4(%rbp)
movl $0x1, %eax
jmp 0xb8eb
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 0x3530
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 0x3530
movq %rax, 0x30(%rbx)
movq 0x30(%rbp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x3680
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 0xb9a6
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 0x3610
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 0xb600
xorl %r15d, %r15d
jmp 0xba77
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 0xba6a
testb $0x1, %al
jne 0xba50
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x34e0
movq 0x48(%rsp), %rdi
movl 0x50(%rsp), %edx
movl 0x40(%rsp), %r9d
movq 0x8(%rsp), %rsi
testl %eax, %eax
je 0xba6a
addl %edx, %r15d
cmpl %ebp, %r15d
movl %ebp, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r15d
cmpl %r9d, %r15d
jne 0xba04
jmp 0xba7c
movl %ebx, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
cmovnel %ebp, %r15d
cmpl %ebp, %r15d
jne 0xba8e
movq %r12, %rdi
movq 0x30(%rsp), %rbp
movq %rbp, %rsi
callq 0x15157
jmp 0xbad3
movq 0x20(%rsp), %rbx
movq 0x18(%rbx), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x32c0
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 0xbace
btsl %r15d, %esi
movl %esi, (%rax,%rdx,4)
decl 0x4(%rbx)
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
jmp 0xb600
movq %rax, %rdi
callq 0x34b0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
leaq 0x2c(%rsp), %rdx
callq 0xc60f
cmpl $0x0, 0x2c(%rsp)
jne 0xb600
movq 0x58(%rsp), %rdi
callq 0x3a40
jmp 0xb600
movq 0x224cb(%rip), %rax     # 0x2dfe8
movq (%rax), %rdi
leaq 0x18cca(%rip), %rsi     # 0x247f1
xorl %eax, %eax
callq 0x3630
movq 0x20(%rsp), %rdi
callq 0xbfeb
jmp 0xb2c4
movq %r12, %rdi
movq %rbp, %rsi
callq 0x15157
movq %r14, %rdi
movq %rbp, %rsi
callq 0x15122
movl $0x0, 0x4(%rsp)
testl %eax, %eax
js 0xbb82
movq %r12, %rdi
movq %rbp, %rsi
callq 0x15157
movq %r14, %rdi
movq %rbp, %rsi
callq 0x15122
jmp 0xbb5b
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movl (%r15), %ebp
movq 0x10(%r15), %r14
testq %rbp, %rbp
movl 0x4(%rsp), %edx
je 0xbcc8
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 0xbbbf
incq %r15
cmpq %rbp, %r15
jne 0xbb9e
jmp 0xbcc8
leaq (%r15,%r15,2), %rcx
shlq $0x3, %rcx
movq 0x18(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x8(%rsp)
testl %edx, %edx
je 0xbc10
movl %edx, %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %rsi
movq %r12, %rdi
callq 0x15157
movq (%r13,%r14,8), %rax
testq %rax, %rax
je 0xbc08
movq 0x30(%rax), %rdi
callq 0x32c0
movq (%r13,%r14,8), %rdi
callq 0x32c0
incq %r14
cmpq %r14, %rbx
jne 0xbbde
movq 0x223d1(%rip), %rax     # 0x2dfe8
movq (%rax), %rdi
movq 0x8(%rsp), %rbx
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movq %rdx, %xmm1
movq 0x1781d(%rip), %xmm2    # 0x23450
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x17821(%rip), %xmm3    # 0x23460
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 0x18c0d(%rip), %rsi     # 0x2488d
movb $0x1, %al
callq 0x3630
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0xbcb3
movq 0x18(%rbx), %rdi
callq 0x32c0
movq 0x10(%rbx), %rdi
callq 0x32c0
movq 0x20(%rbx), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x32c0
movq (%r14,%r15,8), %rdi
callq 0x32c0
xorl %edx, %edx
movq 0x38(%rsp), %r14
jmp 0xbbb2
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rdi
callq 0x32c0
movq %r14, %rdi
callq 0x32c0
movq 0x20(%rbx), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x32c0
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xbfeb
testq %rbx, %rbx
je 0xbd24
movq 0x18(%rbx), %rdi
callq 0x32c0
movq 0x10(%rbx), %rdi
callq 0x32c0
movq 0x20(%rbx), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x32c0
movq %r13, %rdi
callq 0x32c0
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0xbd55
movq 0x30(%rbx), %rdi
callq 0x32c0
movq %rbx, %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32c0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq