// File: /workspace/github_cpp_makefile_star2_O3/CominLab[P]QCluster/em.cc
// Function: hard_em(int, int, int, double**, double**, double*, double**, double*, int, double**, int*, double*, int, char, int)
int hard_em(int K, int N, int row_length, double** data, 
		double **quality, double *expected_qual, double **quality_1, double *expected_freq,
		int num_nt, double** data_1, int* assignment, double *Z, 
		int num_trials, char dist_type, int verbose)
{
	// Allocate matrices for centroids, distances, assignment and the 
	// vector for the number of members
	double**  centroids = new double*[K];
	centroids[0] = new double[row_length*K];
	for(int k=1; k<K; ++k) {
		centroids[k] = centroids[0] + k*row_length;
	} // K*row_length matrix for centroid locations

	double**  centroids_tilde = new double*[K];
	centroids_tilde[0] = new double[row_length*K];
	for(int k=1; k<K; ++k) {
		centroids_tilde[k] = centroids_tilde[0] + k*row_length;
	} // K*row_length matrix for X_tilde vars for centroids

	int* tmp_assignment = new int[N];
	int *numMembers = new int[K];  // number of members in each cluster
	double** tmp_data = new double*[N];
	double** tmp_data_1 = new double*[N];

	// call clustering routine
	double min_distortion = 0;
	for (int t=0; t<num_trials; t++) {
		if (verbose > 0) {
			cerr<<"Calling EM routine, attempt "<<t+1<<endl;
		}
		double distortion =	em_routine(K, N, row_length, data, quality, 
				expected_qual, quality_1, expected_freq, num_nt, data_1,
				tmp_assignment, numMembers, centroids, centroids_tilde,
				tmp_data, tmp_data_1, dist_type, verbose);
		if (verbose > 0) {
			cerr<<"Resulting distortion: "<<distortion<<endl;
		}
		if (!t || (distortion < min_distortion)) {
			if (verbose > 0) {
				cerr<<"Updating best partitioning and minimal distortion"<<endl;
			}
			min_distortion = distortion;
			memcpy(assignment, tmp_assignment, N*sizeof(*assignment));
		}
	}
	if (verbose > 0) {
		cerr<<"Resulting minimal distortion: "<<min_distortion<<endl;
	}
	//evaluate confidence if using KL with raw counts
	if (dist_type == 'k') {
		eval_confidence(K, N, row_length, data, centroids, Z, quality, expected_qual, expected_freq);
	}
	// delete allocated arrays
	delete[] centroids[0];
	delete[] centroids;
	delete[] centroids_tilde[0];
	delete[] centroids_tilde;
	delete[] numMembers;
	delete[] tmp_data;
	delete[] tmp_data_1;
	delete[] tmp_assignment;

	// return the number of clusters
	return count_num_clusters(N, assignment);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r9, %r12
movq %r8, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
movl %edx, %r13d
movl %edx, 0x18(%rsp)
movl %esi, 0x4(%rsp)
movl %edi, %ebx
movslq %edi, %rbp
leaq (,%rbp,8), %r15
testl %ebp, %ebp
movq $-0x1, %r14
movq %r15, 0xe8(%rsp)
cmovsq %r14, %r15
movq %r15, %rdi
callq 0x2030
movl %r13d, %ecx
imull %ebx, %ecx
leaq (,%rcx,8), %r13
testl %ecx, %ecx
cmovsq %r14, %r13
movq %rax, %r14
movq %r13, %rdi
callq 0x2030
movq %rax, (%r14)
movl %ebx, 0x14(%rsp)
movl %ebx, %ebx
movq %rbp, 0x80(%rsp)
cmpl $0x2, %ebp
movl 0x18(%rsp), %ebp
jl 0x412c
movslq %ebp, %rcx
leaq (%rax,%rcx,8), %rax
shlq $0x3, %rcx
movl $0x1, %edx
movq %rax, (%r14,%rdx,8)
incq %rdx
addq %rcx, %rax
cmpq %rdx, %rbx
jne 0x411d
movq %r14, 0x38(%rsp)
movq %r15, %rdi
callq 0x2030
movq %rax, %r15
movq %r13, %rdi
callq 0x2030
movq %rax, (%r15)
cmpl $0x2, 0x14(%rsp)
movq %rbx, %r14
jl 0x4170
movslq %ebp, %rcx
leaq (%rax,%rcx,8), %rax
shlq $0x3, %rcx
movl $0x1, %edx
movq %rax, (%r15,%rdx,8)
incq %rdx
addq %rcx, %rax
cmpq %rdx, %r14
jne 0x4161
movb 0x168(%rsp), %bpl
movslq 0x4(%rsp), %rax
leaq (,%rax,4), %rdi
testl %eax, %eax
movq $-0x1, %r13
movq %rdi, 0xc8(%rsp)
cmovsq %r13, %rdi
leaq (,%rax,8), %rbx
cmovsq %r13, %rbx
callq 0x2030
movq %r15, 0x70(%rsp)
movq %rax, %r15
movq 0x80(%rsp), %rax
leaq (,%rax,4), %rdi
cmpl $0x0, 0x14(%rsp)
movq %rdi, 0xb0(%rsp)
cmovsq %r13, %rdi
callq 0x2030
movq %rax, 0x48(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0xd8(%rsp)
movq %rbx, 0xf0(%rsp)
movq %rbx, %rdi
callq 0x2030
movl 0x4(%rsp), %ecx
movq %rax, 0xb8(%rsp)
movl %ecx, %eax
cmpl $0x0, 0x160(%rsp)
movq %r14, 0x20(%rsp)
movq %rax, 0x50(%rsp)
jle 0x4b94
leaq (,%rax,4), %rax
testl %ecx, %ecx
movq %rax, 0xd0(%rsp)
movq $-0x1, %r13
cmovnsq %rax, %r13
xorpd %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
movsbl %bpl, %eax
movl %eax, 0x7c(%rsp)
movq %r15, 0x88(%rsp)
movq %r12, 0xa8(%rsp)
movq %r13, 0x40(%rsp)
cmpl $0x0, 0x170(%rsp)
jle 0x42d0
movl $0x1c, %edx
movq 0x7d69(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x48cf(%rip), %rsi      # 0x8b60
callq 0x2240
movq 0x68(%rsp), %rax
leal 0x1(%rax), %esi
movq %rbx, %rdi
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0xf0(%rsp), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x98(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x58(%rsp)
movq $0x0, 0xc0(%rsp)
movl $0x0, 0x7efd(%rip)      # 0xc208
movq %r13, %rdi
callq 0x2030
movq %rax, 0x7ede(%rip)      # 0xc1f8
movabsq $0x430c6bf526340000, %rcx # imm = 0x430C6BF526340000
movq %rcx, 0x7ed5(%rip)      # 0xc200
cmpl $0x0, 0x4(%rsp)
movq 0x48(%rsp), %r14
jle 0x434c
movq %rax, %rdi
movl $0xff, %esi
movq 0xd0(%rsp), %rdx
callq 0x2130
movl 0x7c(%rsp), %eax
cmpl $0x63, %eax
jle 0x436f
cmpl $0x64, %eax
je 0x4399
movl %eax, %edx
cmpl $0x6b, %eax
je 0x43a9
cmpl $0x73, %edx
jne 0x43b9
leaq 0xbda(%rip), %rsi       # 0x4f47
jmp 0x43b0
leaq 0xd6a(%rip), %rsi       # 0x50e0
leaq 0x11f5(%rip), %rdx      # 0x5572
cmpl $0x61, %eax
je 0x43c7
cmpl $0x63, 0x7c(%rsp)
jne 0x43b9
leaq 0xd00(%rip), %rsi       # 0x5090
leaq 0x10ae(%rip), %rdx      # 0x5445
jmp 0x43c7
leaq 0xc68(%rip), %rsi       # 0x5008
leaq 0xf55(%rip), %rdx       # 0x52fc
jmp 0x43c7
leaq 0xafc(%rip), %rsi       # 0x4eac
leaq 0xffb(%rip), %rdx       # 0x53b2
jmp 0x43c7
leaq 0xac0(%rip), %rsi       # 0x4e80
leaq 0xeb1(%rip), %rdx       # 0x5278
movq %rdx, 0xe0(%rsp)
movq %rsi, 0xa0(%rsp)
cmpl $0x0, 0x170(%rsp)
jle 0x4423
movl $0x29, %edx
movq 0x7c03(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x47ee(%rip), %rsi      # 0x8be5
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %r15, %rdi
xorl %esi, %esi
movq 0xc8(%rsp), %rdx
callq 0x2130
movq %r14, %rdi
movl $0xff, %esi
movq 0xb0(%rsp), %rdx
callq 0x2130
cmpl $0x0, 0x14(%rsp)
movq 0x20(%rsp), %rbx
movq 0x70(%rsp), %r13
movq 0xe0(%rsp), %rbp
jle 0x44d9
xorl %r14d, %r14d
callq 0x20a0
cltd
idivl 0x4(%rsp)
movslq %edx, %rax
movq 0x30(%rsp), %rcx
leaq (%rcx,%rax,8), %rdx
movq 0x148(%rsp), %rcx
leaq (%rcx,%rax,8), %r8
movq 0x38(%rsp), %rcx
movq (%rcx,%r14,8), %r9
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %r10
movq 0x130(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
subq $0x8, %rsp
movl $0x1, %edi
movl 0x20(%rsp), %esi
movl 0x148(%rsp), %ecx
pushq 0x140(%rsp)
pushq %rax
pushq %r12
pushq %r10
pushq (%r13,%r14,8)
callq *%rbp
addq $0x30, %rsp
incq %r14
cmpq %r14, %rbx
jne 0x4466
movl 0x4(%rsp), %edx
movq 0x48(%rsp), %r14
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rbp
testl %edx, %edx
jle 0x460b
movq %rcx, %rbp
xorl %r14d, %r14d
xorl %ecx, %ecx
movq %rcx, 0x90(%rsp)
cmpl $0x0, 0x14(%rsp)
jle 0x4595
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movsd 0x4614(%rip), %xmm0     # 0x8b38
movsd %xmm0, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq (%rax,%r15,8), %rdi
movq (%rbp,%r14,8), %rsi
movq 0x70(%rsp), %rax
movq (%rax,%r15,8), %rcx
movq (%r13,%r14,8), %r8
subq $0x8, %rsp
movl 0x20(%rsp), %edx
movq %r12, %r9
pushq 0x140(%rsp)
callq *0xb0(%rsp)
movsd 0x18(%rsp), %xmm1
addq $0x10, %rsp
cmpl $-0x1, %ebx
sete %al
ucomisd %xmm0, %xmm1
seta %cl
orb %al, %cl
movl %r15d, %eax
testb %cl, %cl
jne 0x4581
movl %ebx, %eax
jne 0x4587
movapd %xmm1, %xmm0
incq %r15
movl %eax, %ebx
cmpq %r15, 0x20(%rsp)
jne 0x4524
jmp 0x459a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, 0x90(%rsp)
movb $0x1, %cl
movq 0x88(%rsp), %r15
jne 0x45b5
cmpl %eax, (%r15,%r14,4)
setne %cl
movl %eax, (%r15,%r14,4)
incq %r14
movq 0x50(%rsp), %rbx
cmpq %rbx, %r14
jne 0x4501
movq %rcx, 0x90(%rsp)
movq 0x48(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq 0xb0(%rsp), %rdx
callq 0x2130
xorl %eax, %eax
movq 0x20(%rsp), %rdx
movslq (%r15,%rax,4), %rcx
incl (%r14,%rcx,4)
incq %rax
cmpq %rax, %rbx
jne 0x45f0
movl 0x4(%rsp), %esi
movq 0x40(%rsp), %rbx
jmp 0x4637
movq %rbp, %rbx
movq $0x0, 0x90(%rsp)
movl %edx, %r13d
movq %r14, %rdi
xorl %esi, %esi
movq 0xb0(%rsp), %rdx
callq 0x2130
movl %r13d, %esi
movq 0x20(%rsp), %rdx
cmpl $0x0, 0x14(%rsp)
jle 0x4677
cmpl $0x0, (%r14)
je 0x4684
movl $0x1, %eax
movq %rbx, %rbp
cmpq %rax, %rdx
je 0x4740
leaq 0x1(%rax), %rcx
cmpl $0x0, (%r14,%rax,4)
movq %rcx, %rax
jne 0x464c
decq %rcx
cmpq 0x80(%rsp), %rcx
setl %al
movl %eax, 0x1c(%rsp)
jmp 0x468d
movl $0x0, 0x1c(%rsp)
jmp 0x474f
movb $0x1, %al
movl %eax, 0x1c(%rsp)
movq %rbx, %rbp
cmpl $0x0, 0x170(%rsp)
jle 0x46d9
movl $0x1a, %edx
movq 0x794d(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x4562(%rip), %rsi      # 0x8c0f
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x7b18(%rip), %rdi      # 0xc1f8
testq %rdi, %rdi
je 0x46ea
callq 0x2270
movl $0x0, 0x7b14(%rip)      # 0xc208
movq %rbp, %rdi
callq 0x2030
movq %rax, 0x7af5(%rip)      # 0xc1f8
movabsq $0x430c6bf526340000, %rcx # imm = 0x430C6BF526340000
movq %rcx, 0x7aec(%rip)      # 0xc200
movl 0x4(%rsp), %edx
testl %edx, %edx
jle 0x4934
movl %edx, %r13d
movq %rax, %rdi
movl $0xff, %esi
movq 0xd0(%rsp), %rdx
callq 0x2130
movl %r13d, %edx
jmp 0x4934
cmpq 0x80(%rsp), %rax
setl %al
movl %eax, 0x1c(%rsp)
xorpd %xmm0, %xmm0
testl %esi, %esi
jle 0x47de
xorl %ebx, %ebx
movq 0x88(%rsp), %r12
movq 0xa8(%rsp), %r13
movq 0x28(%rsp), %r14
movl 0x18(%rsp), %ebp
movq 0xa0(%rsp), %r15
movsd %xmm0, 0x8(%rsp)
movslq (%r12,%rbx,4), %rax
movq 0x38(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x30(%rsp), %rcx
movq (%rcx,%rbx,8), %rsi
movq 0x70(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
movq (%r14,%rbx,8), %r8
subq $0x8, %rsp
movl %ebp, %edx
movq %r13, %r9
pushq 0x140(%rsp)
callq *%r15
addq $0x10, %rsp
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %rbx
cmpq %rbx, 0x50(%rsp)
jne 0x477e
movsd %xmm0, 0xc0(%rsp)
cmpb $0x0, 0x90(%rsp)
je 0x494e
movl 0x4(%rsp), %edi
movq 0x88(%rsp), %r15
movq %r15, %rdx
leaq 0xc0(%rsp), %rcx
callq 0x3f5c
testb %al, %al
movq 0xa8(%rsp), %r12
movq 0xd8(%rsp), %r13
jne 0x49dd
cmpl $0x0, 0x14(%rsp)
movq 0x50(%rsp), %rbx
jle 0x4926
xorl %r14d, %r14d
cmpl $0x0, 0x4(%rsp)
jle 0x48b8
xorl %eax, %eax
xorl %edi, %edi
movq 0xb8(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq 0x148(%rsp), %r9
movl 0x140(%rsp), %ecx
movq 0x130(%rsp), %r11
movl (%r15,%rax,4), %r10d
cmpq %r10, %r14
jne 0x48ae
movq (%rsi,%rax,8), %r10
movslq %edi, %rdi
movq %r10, (%r13,%rdi,8)
movq (%r9,%rax,8), %r10
movq %r10, (%r8,%rdi,8)
movq (%rdx,%rax,8), %r10
movq 0x98(%rsp), %rbp
movq %r10, (%rbp,%rdi,8)
movq (%r11,%rax,8), %r10
movq 0x58(%rsp), %rbp
movq %r10, (%rbp,%rdi,8)
incl %edi
incq %rax
cmpq %rax, %rbx
jne 0x4870
jmp 0x48c9
xorl %edi, %edi
movq 0xb8(%rsp), %r8
movl 0x140(%rsp), %ecx
movq 0x38(%rsp), %rax
movq (%rax,%r14,8), %r9
subq $0x8, %rsp
movl 0x20(%rsp), %esi
movq %r13, %rdx
pushq 0x140(%rsp)
pushq 0x68(%rsp)
pushq %r12
pushq 0xb8(%rsp)
movq 0x98(%rsp), %rax
pushq (%rax,%r14,8)
callq *0x110(%rsp)
addq $0x30, %rsp
incq %r14
cmpq 0x20(%rsp), %r14
jne 0x483c
movl 0x4(%rsp), %edx
movq 0x48(%rsp), %r14
movq 0x40(%rsp), %rbp
jmp 0x4934
movq 0x48(%rsp), %r14
movq 0x40(%rsp), %rbp
movl 0x4(%rsp), %edx
cmpb $0x0, 0x1c(%rsp)
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rcx
je 0x44f1
jmp 0x43d7
movsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x170(%rsp)
movq 0x88(%rsp), %r15
movq 0xa8(%rsp), %r12
jle 0x49b0
movl $0x1d, %edx
movq 0x7676(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x42a6(%rip), %rsi      # 0x8c2a
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x7841(%rip), %rdi      # 0xc1f8
testq %rdi, %rdi
je 0x49c1
callq 0x2270
movq 0x98(%rsp), %rdi
callq 0x2270
movq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x4a61
cmpl $0x0, 0x170(%rsp)
jle 0x4a2a
movl $0x1f, %edx
movq 0x75fd(%rip), %r13      # 0xbff0
movq %r13, %rdi
leaq 0x424b(%rip), %rsi      # 0x8c48
callq 0x2240
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x77c7(%rip), %rdi      # 0xc1f8
testq %rdi, %rdi
je 0x4a3b
callq 0x2270
movq 0x98(%rsp), %rdi
callq 0x2270
movq 0x58(%rsp), %rdi
callq 0x2270
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movb 0x168(%rsp), %bpl
movq 0x40(%rsp), %r13
cmpl $0x0, 0x170(%rsp)
jle 0x4b36
movl $0x16, %edx
movq 0x7568(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x40eb(%rip), %rsi      # 0x8b7d
callq 0x2240
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x22d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movsd 0x8(%rsp), %xmm1
cmpl $0x0, 0x68(%rsp)
je 0x4aec
movsd 0x60(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4b79
movl $0x31, %edx
movq 0x74f8(%rip), %rbx      # 0xbff0
movq %rbx, %rdi
leaq 0x4092(%rip), %rsi      # 0x8b94
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movsd 0x8(%rsp), %xmm1
jmp 0x4b4f
cmpl $0x0, 0x68(%rsp)
movsd 0x8(%rsp), %xmm1
je 0x4b4f
movsd 0x60(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4b79
movsd %xmm1, 0x8(%rsp)
movq 0x150(%rsp), %rdi
movq %r15, %rsi
movq 0xc8(%rsp), %rdx
callq 0x2190
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x68(%rsp), %rax
incl %eax
movq %rax, 0x68(%rsp)
cmpl 0x160(%rsp), %eax
jne 0x4271
jmp 0x4b9e
xorpd %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
cmpl $0x0, 0x170(%rsp)
jle 0x4bfb
movq 0x7441(%rip), %rbx      # 0xbff0
leaq 0x4010(%rip), %rsi      # 0x8bc6
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2240
movq %rbx, %rdi
movsd 0x60(%rsp), %xmm0
callq 0x22d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
cmpb $0x6b, %bpl
setne %al
movl 0x4(%rsp), %edx
testl %edx, %edx
setle %cl
orb %al, %cl
movq 0x50(%rsp), %rcx
jne 0x4d79
movq 0x158(%rsp), %rbp
xorl %r13d, %r13d
cmpl $0x0, 0x14(%rsp)
jle 0x4d65
movq %r13, %rax
imulq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq (%rbx,%r13,8), %rsi
movq 0x28(%rsp), %rax
movq (%rax,%r13,8), %r8
subq $0x8, %rsp
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
movq %r12, %r9
pushq 0x140(%rsp)
callq 0x4eac
addq $0x10, %rsp
movsd %xmm0, (%rbp,%r14,8)
incq %r14
cmpq %r14, 0x20(%rsp)
jne 0x4c47
movq %r13, 0x58(%rsp)
movq 0x158(%rsp), %rax
movq 0x8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
cmpl $0x2, 0x14(%rsp)
jl 0x4ccf
movl $0x1, %eax
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %r14
movsd (%rbp,%rax,8), %xmm3
minsd %xmm0, %xmm3
incq %rax
movapd %xmm3, %xmm0
cmpq %rax, %r14
jne 0x4cb7
jmp 0x4cdc
movapd %xmm0, %xmm3
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %r14
xorpd %xmm2, %xmm2
xorl %ebx, %ebx
movsd %xmm3, 0xa0(%rsp)
movsd (%rbp,%rbx,8), %xmm0
subsd %xmm3, %xmm0
ucomisd 0x3e43(%rip), %xmm0     # 0x8b40
xorpd %xmm1, %xmm1
ja 0x4d2f
xorpd 0x3e45(%rip), %xmm0     # 0x8b50
movl %edx, %r13d
movsd %xmm2, 0x8(%rsp)
callq 0x2340
movsd 0xa0(%rsp), %xmm3
movsd 0x8(%rsp), %xmm2
movl %r13d, %edx
movapd %xmm0, %xmm1
movsd %xmm1, (%rbp,%rbx,8)
addsd %xmm1, %xmm2
incq %rbx
cmpq %rbx, %r14
jne 0x4ceb
xorl %eax, %eax
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r13
movsd (%rbp,%rax,8), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, (%rbp,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x4d4d
incq %r13
addq 0xe8(%rsp), %rbp
cmpq %rcx, %r13
jne 0x4c23
movq %rcx, %rbp
movl %edx, %ebx
movq 0x38(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4d90
callq 0x2270
movq 0x38(%rsp), %rdi
callq 0x2270
movq 0x70(%rsp), %r14
movq (%r14), %rdi
testq %rdi, %rdi
movq 0x150(%rsp), %r13
je 0x4db4
callq 0x2270
movq %r14, %rdi
callq 0x2270
movq 0x48(%rsp), %rdi
callq 0x2270
movq 0xd8(%rsp), %rdi
callq 0x2270
movq 0xb8(%rsp), %rdi
callq 0x2270
movq %r15, %rdi
callq 0x2270
testl %ebx, %ebx
jle 0x4e0a
xorl %eax, %eax
xorl %r12d, %r12d
movl (%r13,%rax,4), %ecx
cmpl %r12d, %ecx
cmovgl %ecx, %r12d
incq %rax
cmpq %rax, %rbp
jne 0x4df1
incl %r12d
jmp 0x4e10
movl $0x1, %r12d
leaq (,%r12,4), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2130
cmpl $0x0, 0x4(%rsp)
movq 0x50(%rsp), %rdx
jle 0x4e55
xorl %eax, %eax
movslq (%r13,%rax,4), %rcx
movl $0x1, (%r14,%rcx,4)
incq %rax
cmpq %rax, %rdx
jne 0x4e40
xorl %eax, %eax
addl (%r14,%rax,4), %ebx
incq %rax
cmpq %rax, %r12
jne 0x4e57
movq %r14, %rdi
callq 0x2270
movl %ebx, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop