// File: /workspace/github_c_makefile_star2_O0/xtanitfy[P]Murphy/src/layers/output_layer.c
// Function: OutputLayerInit
int OutputLayerInit(NET_PARA_s *pNetPara,LAYER_s *pLayer)
{
	CHECK_EXPR_RET(pLayer == NULL,-1);

	BLOB_s *pPrevBlob = pLayer->pPrev[0]->pData;
	CHECK_EXPR_RET(pPrevBlob == NULL,-1);

	OUTPUT_LAYER_PARA_s *pPara = &pLayer->para->select.outputLayer;

	NET_autoCreateBlob(pNetPara,pPrevBlob,&pLayer->pData,
						pPara->num,1,1,1,1,&pLayer->k,&pLayer->b);
	
	CHECK_EXPR_RET(pPara->weightInit == NULL,-1);
	pPara->weightInit(pLayer->k);
	
	CHECK_EXPR_RET(pPara->biasInit == NULL,-1);
	pPara->biasInit(pLayer->b);

	pLayer->k->type = BLOB_TYPE_WEIGHT;
	LOG_writeBlobToTxtFile("fw.txt",pLayer->k);	
	
	BLOB_shapeLike(pLayer->pData,&pLayer->pError);
	BLOB_shapeLike(pLayer->pData,&pLayer->pDelta);
	BLOB_shapeLike(pLayer->k,&pLayer->pDK);
	BLOB_shapeLike(pLayer->b,&pLayer->pDB);
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x9024
leaq 0x2017(%rip), %rdi      # 0xb015
leaq 0x280b(%rip), %rsi      # 0xb810
leaq 0x2813(%rip), %rdx      # 0xb81f
movl $0x26, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x91de
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x906b
leaq 0x1fd0(%rip), %rdi      # 0xb015
leaq 0x27c4(%rip), %rsi      # 0xb810
leaq 0x27cc(%rip), %rdx      # 0xb81f
movl $0x29, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x91de
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x288, %rax            # imm = 0x288
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %r10
addq $0x18, %r10
movq -0x18(%rbp), %rax
addq $0x20, %rax
movl $0x1, %r9d
movl %r9d, %r8d
movl $0x1, (%rsp)
movl $0x1, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x5190
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x9102
leaq 0x1f39(%rip), %rdi      # 0xb015
leaq 0x272d(%rip), %rsi      # 0xb810
leaq 0x2735(%rip), %rdx      # 0xb81f
movl $0x30, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x91de
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rdi
callq *%rax
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x914c
leaq 0x1eef(%rip), %rdi      # 0xb015
leaq 0x26e3(%rip), %rsi      # 0xb810
leaq 0x26eb(%rip), %rdx      # 0xb81f
movl $0x33, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x91de
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl $0x1, (%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
leaq 0x26b4(%rip), %rdi      # 0xb82f
callq 0x5460
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0xf8, %rsi
callq 0x28e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
callq 0x28e0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
callq 0x28e0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x38, %rsi
callq 0x28e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)