// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/mlp.c
// Function: reallocate_weights
void reallocate_weights(Mlpparameters P, matrixptr weights, int hiddenindex, int count, INITIALIZATION_TYPE inittype, int initvalue)
{
	/*!Last Changed 17.04.2007*/
	int colcount, rowcount;
	if (hiddenindex == 0)
		 colcount = P.dimnum + 1;
	else
		 colcount = P.hidden[hiddenindex - 1] + 1;
	if (hiddenindex != P.layernum - 1)
		 rowcount = P.hidden[hiddenindex + 1];
 else
		 rowcount = P.classnum;
	weights[hiddenindex] = reallocate_matrix(weights[hiddenindex], P.hidden[hiddenindex] + count, colcount);
 weights[hiddenindex + 1] = reallocate_matrix(weights[hiddenindex + 1], rowcount, P.hidden[hiddenindex] + count + 1);
	if (inittype == RANDOM)
	 {
   assign_partial_random_weights(&weights[hiddenindex], P.hidden[hiddenindex], P.hidden[hiddenindex] + count - 1, 0, colcount - 1, P.randrange);
	  assign_partial_random_weights(&weights[hiddenindex + 1], 0, rowcount - 1, P.hidden[hiddenindex] + 1, P.hidden[hiddenindex] + count, P.randrange);
	 }
	else
		 if (inittype == INITIAL_VALUE)
		  {
     initialize_partial_matrix(&weights[hiddenindex], P.hidden[hiddenindex], P.hidden[hiddenindex] + count - 1, 0, colcount - 1, initvalue);
	    initialize_partial_matrix(&weights[hiddenindex + 1], 0, rowcount - 1, P.hidden[hiddenindex] + 1, P.hidden[hiddenindex] + count, initvalue);
			 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x63736
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6374d
movq -0x48(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl 0x48(%rax,%rcx,4), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x48(%rbp), %rcx
movl -0xc(%rbp), %eax
movl 0x54(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x63774
movq -0x48(%rbp), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl 0x48(%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
jmp 0x6377d
movq -0x48(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movslq -0xc(%rbp), %rdx
movl 0x48(%rcx,%rdx,4), %edx
addl -0x10(%rbp), %edx
movl -0x1c(%rbp), %ecx
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x5a8a0
movq -0x48(%rbp), %rcx
movq %rax, %rsi
movq -0x58(%rbp), %rax
movq %rsi, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x30(%rbp), %rdx
movq %rdx, (%rax)
movq -0x28(%rbp), %rdx
movq %rdx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl -0x20(%rbp), %edx
movslq -0xc(%rbp), %rsi
movl 0x48(%rcx,%rsi,4), %ecx
addl -0x10(%rbp), %ecx
addl $0x1, %ecx
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x5a8a0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
cmpl $0x0, -0x14(%rbp)
jne 0x638d4
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rdi
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %esi
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %edx
addl -0x10(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %r8d
subl $0x1, %r8d
movsd 0x28(%rax), %xmm0
xorl %ecx, %ecx
callq 0x5a720
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rdi
movl -0x20(%rbp), %edx
subl $0x1, %edx
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %ecx
addl $0x1, %ecx
movslq -0xc(%rbp), %rsi
movl 0x48(%rax,%rsi,4), %r8d
addl -0x10(%rbp), %r8d
movsd 0x28(%rax), %xmm0
xorl %esi, %esi
callq 0x5a720
jmp 0x6395b
cmpl $0x1, -0x14(%rbp)
jne 0x63959
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rdi
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %esi
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %edx
addl -0x10(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %r8d
subl $0x1, %r8d
cvtsi2sdl -0x18(%rbp), %xmm0
xorl %ecx, %ecx
callq 0x5a5a0
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rdi
movl -0x20(%rbp), %edx
subl $0x1, %edx
movslq -0xc(%rbp), %rcx
movl 0x48(%rax,%rcx,4), %ecx
addl $0x1, %ecx
movslq -0xc(%rbp), %rsi
movl 0x48(%rax,%rsi,4), %r8d
addl -0x10(%rbp), %r8d
cvtsi2sdl -0x18(%rbp), %xmm0
xorl %esi, %esi
callq 0x5a5a0
jmp 0x6395b
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)