// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/model.c
// Function: generate_candidate_mlp_models
int* generate_candidate_mlp_models(Datasetptr d, int maxhidden, int bestmodel, int*modelcount, MODEL_SEARCH_DIRECTION_TYPE searchdirection)
{
	/*!Last Changed 29.10.2005*/
	/*!Last Changed 17.07.2005*/
	int numberofclasses, addmaxhidden = 0, *list;
	list = safemalloc(MAX_MODEL_SEARCH * sizeof(int), "generate_candidate_mlp_models", 2);
	*modelcount = 0;
	if (d->classno == 0)
		 numberofclasses = 1;
	else
		 numberofclasses = d->classno;
	search_and_add_into_list(list, modelcount, bestmodel);
	if (bestmodel == 0)
		{
			if (numberofclasses < maxhidden)
				{
					search_and_add_into_list(list, modelcount, numberofclasses);
					if (2 * numberofclasses < maxhidden)
						 search_and_add_into_list(list, modelcount, 2 * numberofclasses);
					else
							addmaxhidden = 1;
				}
			else
					addmaxhidden = 1;
			if ((numberofclasses + d->multifeaturecount) / 4 <= maxhidden)
				{
					search_and_add_into_list(list, modelcount, (numberofclasses + d->multifeaturecount) / 4);
					if ((numberofclasses + d->multifeaturecount) / 2 <= maxhidden)
							search_and_add_into_list(list, modelcount, (numberofclasses + d->multifeaturecount) / 2);
					else
							addmaxhidden = 1;
				}
			else
					addmaxhidden = 1;
		}
	else
		{
			if (bestmodel + 1 < maxhidden)
				{
					search_and_add_into_list(list, modelcount, bestmodel + 1);
					if (bestmodel * 1.5 < maxhidden)
							search_and_add_into_list(list, modelcount, (int) (bestmodel * 1.5));
					else
							addmaxhidden = 1;
				}
			else
					addmaxhidden = 1;
   if (bestmodel - 1 > 0)
					search_and_add_into_list(list, modelcount, bestmodel - 1);
			if (0.5 * bestmodel > 1)
					search_and_add_into_list(list, modelcount, (int) (0.5 * bestmodel));
		}
	if (addmaxhidden)
			search_and_add_into_list(list, modelcount, maxhidden);
	if (searchdirection == BACKWARD)
		 search_and_add_into_list(list, modelcount, 0);
	return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x1c, %edi
leaq 0x7e622(%rip), %rsi     # 0xe6fdf
movl $0x2, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x689e8
movl $0x1, -0x20(%rbp)
jmp 0x689f2
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x10(%rbp), %edx
callq 0x50840
cmpl $0x0, -0x10(%rbp)
jne 0x68ae5
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x68a4b
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x50840
movl -0x20(%rbp), %eax
shll %eax
cmpl -0xc(%rbp), %eax
jge 0x68a42
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
shll %edx
callq 0x50840
jmp 0x68a49
movl $0x1, -0x24(%rbp)
jmp 0x68a52
movl $0x1, -0x24(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c0(%rcx), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl -0xc(%rbp), %eax
jg 0x68ad9
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c0(%rcx), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %edx
callq 0x50840
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c0(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl -0xc(%rbp), %eax
jg 0x68ad0
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c0(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
callq 0x50840
jmp 0x68ad7
movl $0x1, -0x24(%rbp)
jmp 0x68ae0
movl $0x1, -0x24(%rbp)
jmp 0x68bb4
movl -0x10(%rbp), %eax
addl $0x1, %eax
cmpl -0xc(%rbp), %eax
jge 0x68b4c
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x10(%rbp), %edx
addl $0x1, %edx
callq 0x50840
cvtsi2sdl -0x10(%rbp), %xmm1
movsd 0x79f68(%rip), %xmm0    # 0xe2a78
mulsd %xmm0, %xmm1
cvtsi2sdl -0xc(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x68b43
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
cvtsi2sdl -0x10(%rbp), %xmm0
movsd 0x79f44(%rip), %xmm1    # 0xe2a78
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
callq 0x50840
jmp 0x68b4a
movl $0x1, -0x24(%rbp)
jmp 0x68b53
movl $0x1, -0x24(%rbp)
movl -0x10(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jle 0x68b71
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0x50840
cvtsi2sdl -0x10(%rbp), %xmm1
movsd 0x79e3a(%rip), %xmm0    # 0xe29b8
mulsd %xmm1, %xmm0
movsd 0x7948e(%rip), %xmm1    # 0xe2018
ucomisd %xmm1, %xmm0
jbe 0x68bb2
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
cvtsi2sdl -0x10(%rbp), %xmm1
movsd 0x79e13(%rip), %xmm0    # 0xe29b8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
callq 0x50840
jmp 0x68bb4
cmpl $0x0, -0x24(%rbp)
je 0x68bca
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xc(%rbp), %edx
callq 0x50840
cmpl $0x1, -0x1c(%rbp)
jne 0x68bdf
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x50840
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)