// File: /workspace/github_c_makefile_star2_O3/xtanitfy[P]Murphy/examples/mnist/mnist_read_input.c
// Function: Mnist_GetInitFw
int Mnist_GetInitFw(BLOB_s *pBLOB)
{
#define INIT_FW_BIN_FILE  "data/mnist/ffw_10_192_1.bin"

	SIZE_s size;
	getSizeFromFilename(INIT_FW_BIN_FILE,&size);
	//readMatFromFile
	int allSize = size.w*size.h*size.n;
#if 0
	printf("pBLOB->num :%ld\n",pBLOB->num);
	printf("pBLOB->height:%ld\n",pBLOB->height);
	printf("pBLOB->width:%ld\n",pBLOB->width);
	printf("size.h:%d\n", size.h);
	printf("size.w:%d\n", size.w);
#endif
	CHECK_EXPR_RET(pBLOB->numSize!= size.h,-1);
	CHECK_EXPR_RET(pBLOB->channelSize!= size.w,-1);
	
	double *data = (double *)malloc(sizeof(double)*allSize);
	readMatFromFile(INIT_FW_BIN_FILE,data,allSize);
	
	BLOB_s *pBlobData;
	BLOB_create(&pBlobData,size.h,size.w,1,1,FALSE);
	BLOB_shapeByPtr(pBlobData,data,allSize);
	
	BLOB_DATA_PTR(pBLOB,ptr);
	BLOB_DATA_PTR(pBlobData,ptr1);
	
	for (int i_out = 0;i_out < pBLOB->numSize;i_out++) {	
		for (int i_in = 0;i_in < pBLOB->channelSize;i_in++) {
			for (int i_height = 0;i_height < pBLOB->heightSize;i_height++) {
				for (int i_width = 0;i_width < pBLOB->widthSize;i_width++) {	
					ptr[i_out][i_in][i_height][i_width] = 
							ptr1[i_out][i_in][i_height][i_width];
				}
			}
		}
	}
	
	

	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x5669(%rip), %rdi      # 0x71c0
leaq 0x38(%rsp), %rbx
movq %rbx, %rsi
callq 0x1a49
movslq (%rbx), %rax
movq 0x10(%r14), %r15
cmpq %rax, %r15
jne 0x1cdd
movslq 0x3c(%rsp), %rcx
movq 0x18(%r14), %r13
cmpq %rcx, %r13
jne 0x1cf9
imulq %rcx, %rax
movslq 0x40(%rsp), %r12
imulq %rax, %r12
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x10e0
movq %rax, %rbp
leaq 0x5617(%rip), %rdi      # 0x71c0
movq %rax, %rsi
movl %r12d, %edx
callq 0x1ada
leaq 0x30(%rsp), %rbx
movl $0x1, %ecx
movl $0x1, %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %r9d, %r9d
callq 0x1d64
movq (%rbx), %rdi
movq %rbp, %rsi
movl %r12d, %edx
callq 0x21fa
movq 0x10(%r14), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x1cd9
movq 0x18(%r14), %rcx
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rsi
movq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movq %rdi, 0x8(%rsp)
movq 0x28(%rax), %r9
movq %rsi, %r10
imulq %rdx, %r10
movq %r10, %rdi
imulq %rcx, %rdi
shlq $0x3, %rdi
movq %rdi, 0x20(%rsp)
shlq $0x3, %r10
leaq (,%rsi,8), %r14
movq 0x20(%rax), %r15
imulq %r9, %r15
movq 0x18(%rax), %rax
imulq %r15, %rax
shlq $0x3, %rax
movq %rax, 0x18(%rsp)
shlq $0x3, %r15
shlq $0x3, %r9
xorl %r13d, %r13d
testq %rcx, %rcx
je 0x1cbb
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %rbx
xorl %eax, %eax
testq %rdx, %rdx
je 0x1cad
movq %r8, %rbp
movq %rbx, %rdi
xorl %r12d, %r12d
testq %rsi, %rsi
je 0x1c9f
xorl %r11d, %r11d
movsd (%rbp,%r11,8), %xmm0
movsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r11, %rsi
jne 0x1c8a
incq %r12
addq %r14, %rdi
addq %r9, %rbp
cmpq %rdx, %r12
jne 0x1c82
incq %rax
addq %r10, %rbx
addq %r15, %r8
cmpq %rcx, %rax
jne 0x1c74
incq %r13
movq 0x20(%rsp), %rax
addq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq %rax, 0x8(%rsp)
cmpq 0x28(%rsp), %r13
jne 0x1c63
xorl %eax, %eax
jmp 0x1d1f
leaq 0x5361(%rip), %rdi      # 0x7045
leaq 0x54b4(%rip), %rsi      # 0x719f
leaq 0x54ea(%rip), %rdx      # 0x71dc
movl $0x4e, %ecx
jmp 0x1d13
leaq 0x5345(%rip), %rdi      # 0x7045
leaq 0x5498(%rip), %rsi      # 0x719f
leaq 0x54ce(%rip), %rdx      # 0x71dc
movl $0x4f, %ecx
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq