// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/mixture.c
// Function: read_mixture_from_file
Mixtureptr read_mixture_from_file(char* modeldefinition)
{
	/*!Last Changed 26.01.2005*/
	int i, j;
	FILE* infile;
	Mixtureptr mix;
	mix = safemalloc(sizeof(Mixture), "read_mixture_from_file", 4);
	infile = fopen(modeldefinition, "r");
	if (!infile)
		 return NULL;
	fscanf(infile, "%d", &(mix->classcount));
	mix->classpriors = safemalloc(mix->classcount * sizeof(double), "read_mixture_from_file", 7);
	for (i = 0; i < mix->classcount; i++)
		 fscanf(infile, "%lf", &(mix->classpriors[i]));
	mix->numberofmodels = safemalloc(mix->classcount * sizeof(int), "read_mixture_from_file", 10);
 mix->mixtureprob = safemalloc(mix->classcount * sizeof(double*), "read_mixture_from_file", 11);
 mix->mixturemeans = safemalloc(mix->classcount * sizeof(double*), "read_mixture_from_file", 12);
 mix->mixturedeviations = safemalloc(mix->classcount * sizeof(double*), "read_mixture_from_file", 13);
 for (i = 0; i < mix->classcount; i++)
	 {
		 fscanf(infile, "%d", &(mix->numberofmodels[i]));
   mix->mixtureprob[i] = safemalloc(mix->numberofmodels[i] * sizeof(double), "read_mixture_from_file", 17);
   mix->mixturemeans[i] = safemalloc(mix->numberofmodels[i] * sizeof(double), "read_mixture_from_file", 18);
   mix->mixturedeviations[i] = safemalloc(mix->numberofmodels[i] * sizeof(double), "read_mixture_from_file", 19);
			for (j = 0; j < mix->numberofmodels[i]; j++)
				 fscanf(infile, "%lf", &(mix->mixtureprob[i][j]));
	 }
	for (i = 0; i < mix->classcount; i++)
		 for (j = 0; j < mix->numberofmodels[i]; j++)
				 fscanf(infile, "%lf%lf", &(mix->mixturemeans[i][j]), &(mix->mixturedeviations[i][j]));
	fclose(infile);
	return mix;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x66bd3(%rip), %rsi     # 0xaa35c
movl $0x30, %edi
movl $0x4, %edx
callq 0x3a0e1
movq %rax, %rbx
leaq 0x681b9(%rip), %rsi     # 0xab95b
movq %r14, %rdi
callq 0x40f0
testq %rax, %rax
je 0x439ce
movq %rax, %r14
leaq 0x6d438(%rip), %rsi     # 0xb0bf5
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4070
movslq (%rbx), %rdi
shlq $0x3, %rdi
leaq 0x66b84(%rip), %rsi     # 0xaa35c
movl $0x7, %edx
callq 0x3a0e1
movq %rax, 0x10(%rbx)
movslq (%rbx), %rdi
testq %rdi, %rdi
jle 0x4381e
leaq 0x6648b(%rip), %r15     # 0xa9c80
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
addq %r12, %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x4070
incq %r13
movslq (%rbx), %rdi
addq $0x8, %r12
cmpq %rdi, %r13
jl 0x437fb
shlq $0x2, %rdi
leaq 0x66b33(%rip), %r15     # 0xaa35c
movq %r15, %rsi
movl $0xa, %edx
callq 0x3a0e1
movq %rax, 0x8(%rbx)
movslq (%rbx), %rdi
shlq $0x3, %rdi
movq %r15, %rsi
movl $0xb, %edx
callq 0x3a0e1
movq %rax, 0x18(%rbx)
movslq (%rbx), %rdi
shlq $0x3, %rdi
movq %r15, %rsi
movl $0xc, %edx
callq 0x3a0e1
movq %rax, 0x20(%rbx)
movslq (%rbx), %rdi
shlq $0x3, %rdi
movq %r15, %rsi
movl $0xd, %edx
callq 0x3a0e1
movq %rax, 0x28(%rbx)
cmpl $0x0, (%rbx)
jle 0x439c4
movq 0x8(%rbx), %rcx
leaq 0x663ea(%rip), %r13     # 0xa9c80
xorl %ebp, %ebp
leaq (%rcx,%rbp,4), %rdx
movq %r14, %rdi
leaq 0x6d34f(%rip), %rsi     # 0xb0bf5
xorl %eax, %eax
callq 0x4070
movq 0x8(%rbx), %rax
movslq (%rax,%rbp,4), %rdi
shlq $0x3, %rdi
leaq 0x66a9c(%rip), %r15     # 0xaa35c
movq %r15, %rsi
movl $0x11, %edx
callq 0x3a0e1
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x8(%rbx), %rax
movslq (%rax,%rbp,4), %rdi
shlq $0x3, %rdi
movq %r15, %rsi
movl $0x12, %edx
callq 0x3a0e1
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x8(%rbx), %rax
movslq (%rax,%rbp,4), %rdi
shlq $0x3, %rdi
movq %r15, %rsi
movl $0x13, %edx
callq 0x3a0e1
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x8(%rbx), %rcx
cmpl $0x0, (%rcx,%rbp,4)
jle 0x43953
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %rdx
addq %r15, %rdx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4070
incq %r12
movq 0x8(%rbx), %rcx
movslq (%rcx,%rbp,4), %rax
addq $0x8, %r15
cmpq %rax, %r12
jl 0x43927
incq %rbp
movslq (%rbx), %rax
cmpq %rax, %rbp
jl 0x43898
testl %eax, %eax
jle 0x439c4
movq 0x8(%rbx), %rcx
leaq 0x664ca(%rip), %r15     # 0xa9e3b
xorl %r12d, %r12d
cmpl $0x0, (%rcx,%r12,4)
jle 0x439b9
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq (%rax,%r12,8), %rdx
addq %r13, %rdx
movq (%rcx,%r12,8), %rcx
addq %r13, %rcx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x4070
incq %rbp
movq 0x8(%rbx), %rcx
movslq (%rcx,%r12,4), %rax
addq $0x8, %r13
cmpq %rax, %rbp
jl 0x43980
movl (%rbx), %eax
incq %r12
movslq %eax, %rdx
cmpq %rdx, %r12
jl 0x43974
movq %r14, %rdi
callq 0x42a0
jmp 0x439d0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq