// File: /workspace/github_c_makefile_star2_O1/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 0x6629(%rip), %rdi      # 0x81c0
leaq 0x38(%rsp), %rbx
movq %rbx, %rsi
callq 0x1a89
movslq (%rbx), %r15
cmpq %r15, 0x10(%r14)
jne 0x1d1a
movslq 0x3c(%rsp), %r13
cmpq %r13, 0x18(%r14)
jne 0x1d36
movq %r15, %rax
imulq %r13, %rax
movslq 0x40(%rsp), %r12
imulq %rax, %r12
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x10d0
movq %rax, %rbp
leaq 0x65da(%rip), %rdi      # 0x81c0
movq %rax, %rsi
movl %r12d, %edx
callq 0x1b1a
leaq 0x30(%rsp), %rbx
movl $0x1, %ecx
movl $0x1, %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %r9d, %r9d
callq 0x1da4
movq (%rbx), %rdi
movq %rbp, %rsi
movl %r12d, %edx
callq 0x2250
movq 0x10(%r14), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x1d16
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 0x1cf8
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %rbx
xorl %eax, %eax
testq %rdx, %rdx
je 0x1cea
movq %r8, %rbp
movq %rbx, %rdi
xorl %r12d, %r12d
testq %rsi, %rsi
je 0x1cdc
xorl %r11d, %r11d
movsd (%rbp,%r11,8), %xmm0
movsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r11, %rsi
jne 0x1cc7
incq %r12
addq %r14, %rdi
addq %r9, %rbp
cmpq %rdx, %r12
jne 0x1cbf
incq %rax
addq %r10, %rbx
addq %r15, %r8
cmpq %rcx, %rax
jne 0x1cb1
incq %r13
movq 0x20(%rsp), %rax
addq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq %rax, 0x8(%rsp)
cmpq 0x28(%rsp), %r13
jne 0x1ca0
xorl %eax, %eax
jmp 0x1d5c
leaq 0x6324(%rip), %rdi      # 0x8045
leaq 0x6477(%rip), %rsi      # 0x819f
leaq 0x64ad(%rip), %rdx      # 0x81dc
movl $0x4e, %ecx
jmp 0x1d50
leaq 0x6308(%rip), %rdi      # 0x8045
leaq 0x645b(%rip), %rsi      # 0x819f
leaq 0x6491(%rip), %rdx      # 0x81dc
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