// File: /workspace/github_c_makefile_star2_O0/xtanitfy[P]Murphy/src/layers/conv_layer.c
// Function: ConvLayerBackward
int ConvLayerBackward(NET_PARA_s *pNetPara,LAYER_s *pLayer)
{
	CHECK_EXPR_RET(pLayer == NULL,-1);
	CONV_LAYER_PARA_s *pPara = &pLayer->para->select.convLayer;
	//CONV_LAYER_s *pConvLayer = (CONV_LAYER_s *)pLayer->currLayer;
	
	BLOB_s *pDataCurr = pLayer->pData;
	BLOB_s *pDeltaCurr = pLayer->pDelta;
	CHECK_EXPR_RET(pDataCurr == NULL,-1);
	CHECK_EXPR_RET(pDeltaCurr == NULL,-1);

	CHECK_EXPR_RET(pLayer->nNext <= 0,-1);
	BLOB_s *pDeltaNext = pLayer->pNext[0]->pDelta;
	CHECK_EXPR_RET(pDeltaNext == NULL,-1);
	int sampScale = pLayer->pNext[0]->sampScale;
	int sampScaleSquare = pLayer->pNext[0]->sampScale * pLayer->pNext[0]->sampScale;

	BLOB_DATA_PTR(pDeltaCurr,ptrDeltaCurr);
	BLOB_DATA_PTR(pDeltaNext,ptrDeltaNext);
	BLOB_DATA_PTR(pDataCurr,ptrDataCurr);
	FUNC function = pPara->function;

	int padx = pDeltaCurr->padx;
	int pady = pDeltaCurr->pady;

	for (int i_batch = 0;i_batch < pDataCurr->numSize;i_batch++) {
		for (int i_out = 0;i_out < pDataCurr->channelSize;i_out++) {
			for (int h = 0;h < pDataCurr->heightSize;h++) {
				for (int w = 0;w < pDataCurr->widthSize;w++) {
					ptrDeltaCurr[i_batch][i_out][h+pady][w+padx] = \
						function(ptrDataCurr[i_batch][i_out][h][w],FUNC_DERIVA) *\
						ptrDeltaNext[i_batch][i_out][h/sampScale][w/sampScale]/sampScaleSquare;
				}
			}
		}
	}
	
	#if 0
	if (strcmp(pLayer->name,"conv1") == 0) {
		LOG_writeBlobToTxtFile("conv1_delta.txt",pDeltaCurr);
	} else if (strcmp(pLayer->name,"conv0") == 0) {
		LOG_writeBlobToTxtFile("conv0_delta.txt",pDeltaCurr);
	}
	#endif


	CHECK_EXPR_RET(pLayer->pDB == NULL,-1);
	BLOB_DATA_PTR(pLayer->pDB,ptrDB);
	
	/*����Ȩ�غ�ƫ������*/
//	OPTS_s *pOpts = NET_GetOpts();
//	double alpha = pOpts->alpha;
	//CHECK_EXPR_RET(pLayer->b == NULL,-1);
	//BLOB_DATA_PTR(pLayer->b,ptrB);
	double sum = 0;
	
	for (int i_out = 0;i_out < pDataCurr->channelSize;i_out++) {
		sum = 0;
		for (int i_batch = 0;i_batch < pDataCurr->numSize;i_batch++) {
			for (int h = 0;h < pDataCurr->heightSize;h++) {
				for (int w = 0;w < pDataCurr->widthSize;w++) {
					sum += ptrDeltaCurr[i_batch][i_out][h+pady][w+padx];
				}
			}
		}
		ptrDB[0][i_out][0][0] = sum/pDataCurr->numSize;
	}	
	

#if 0
	if (strcmp(pLayer->name,"conv0") == 0) {
		LOG_writeBlobToTxtFile("conv0_db.txt",pLayer->pDB);
		
	} else if(strcmp(pLayer->name,"conv1") == 0) {
		LOG_writeBlobToTxtFile("conv1_db.txt",pLayer->pDB);
	}
#endif

	CHECK_EXPR_RET(pLayer->nPrev <= 0,-1);
	BLOB_s *pDataPrev = pLayer->pPrev[0]->pData;
	CHECK_EXPR_RET(pDataPrev == NULL,-1);

	BLOB_s *pDK = pLayer->pDK;
	CHECK_EXPR_RET(pDK == NULL,-1);
	BLOB_DATA_PTR(pDK,ptrDK);
	BLOB_DATA_PTR(pDataPrev,ptrDataPrev);

	int blockMinX = 0,blockMinY = 0;
	double tmp = 0;
	int ytmp = pDataPrev->heightSize-1;
	int xtmp = pDataPrev->widthSize-1;
	int y1tmp = pDataCurr->heightSize-1+pady;
	int x1tmp = pDataCurr->widthSize-1+padx;

	//CHECK_EXPR_RET(pLayer->k == NULL,-1);
	//BLOB_DATA_PTR(pLayer->k,ptrK);
	
	for (int i_out = 0;i_out < pDataCurr->channelSize;i_out++) {	
		for (int h = 0;h < pDK->heightSize;h++) {
			for (int w = 0;w < pDK->widthSize;w++) {
				for (int i_in = 0;i_in < pDataPrev->channelSize;i_in++) {
					blockMinY = h;
					blockMinX = w;
					tmp = 0;
					for (int i_batch = 0;i_batch < pDataCurr->numSize;i_batch++) {
						for (int offsetY = blockMinY;offsetY < (blockMinY + pDataCurr->heightSize);offsetY++) {
							for (int offsetX = blockMinX;offsetX < (blockMinX + pDataCurr->widthSize);offsetX++) {	
								tmp += ptrDataPrev[i_batch][i_in][ytmp-offsetY][xtmp-offsetX] * \
										ptrDeltaCurr[i_batch][i_out][y1tmp-offsetY+blockMinY][x1tmp-offsetX+blockMinX];
							}
						}
					}
					ptrDK[i_out][i_in][h][w] = tmp / pDataCurr->numSize;
				}
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7957
leaq 0x36e4(%rip), %rdi      # 0xb015
leaq 0x3e4a(%rip), %rsi      # 0xb782
leaq 0x3e5e(%rip), %rdx      # 0xb79d
movl $0x160, %ecx            # imm = 0x160
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x288, %rax            # imm = 0x288
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x79b5
leaq 0x3686(%rip), %rdi      # 0xb015
leaq 0x3dec(%rip), %rsi      # 0xb782
leaq 0x3e00(%rip), %rdx      # 0xb79d
movl $0x166, %ecx            # imm = 0x166
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
cmpq $0x0, -0x30(%rbp)
jne 0x79e9
leaq 0x3652(%rip), %rdi      # 0xb015
leaq 0x3db8(%rip), %rsi      # 0xb782
leaq 0x3dcc(%rip), %rdx      # 0xb79d
movl $0x167, %ecx            # imm = 0x167
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
jg 0x7a23
leaq 0x3618(%rip), %rdi      # 0xb015
leaq 0x3d7e(%rip), %rsi      # 0xb782
leaq 0x3d92(%rip), %rdx      # 0xb79d
movl $0x169, %ecx            # imm = 0x169
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x7a67
leaq 0x35d4(%rip), %rdi      # 0xb015
leaq 0x3d3a(%rip), %rsi      # 0xb782
leaq 0x3d4e(%rip), %rdx      # 0xb79d
movl $0x16b, %ecx            # imm = 0x16B
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movl 0xec(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movl 0xec(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
imull 0xec(%rcx), %eax
movl %eax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x30(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movslq -0x6c(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x7d67
movl $0x0, -0x70(%rbp)
movslq -0x70(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x7d57
movl $0x0, -0x74(%rbp)
movslq -0x74(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x7d47
movl $0x0, -0x78(%rbp)
movslq -0x78(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x7d37
movq -0x100(%rbp), %rsi
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %r8
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movslq -0x6c(%rbp), %rdx
imulq %rdi, %r8
imulq %rsi, %r8
imulq %r8, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x70(%rbp), %rdx
imulq %rsi, %rdi
imulq %rdi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x74(%rbp), %rdx
imulq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movslq -0x78(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movl $0x1, %edi
callq *%rax
movq -0x128(%rbp), %r9
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %r8
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
imulq %rdx, %r9
imulq %r8, %r9
imulq %r9, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x70(%rbp), %rcx
imulq %r8, %rdx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x150(%rbp)
movl -0x74(%rbp), %eax
cltd
idivl -0x3c(%rbp)
movq -0x118(%rbp), %rdx
movl %eax, %ecx
movq -0x150(%rbp), %rax
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x148(%rbp)
movl -0x78(%rbp), %eax
cltd
idivl -0x3c(%rbp)
movq -0x130(%rbp), %rdx
movl %eax, %ecx
movq -0x148(%rbp), %rax
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
cvtsi2sdl -0x40(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x48(%rbp), %rax
movslq -0x6c(%rbp), %rcx
imulq %rsi, %rdi
imulq %rdx, %rdi
imulq %rdi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x70(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x74(%rbp), %ecx
addl -0x68(%rbp), %ecx
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x78(%rbp), %ecx
addl -0x64(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x7bb5
jmp 0x7d39
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x7b9c
jmp 0x7d49
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x7b83
jmp 0x7d59
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x7b6a
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x7d9f
leaq 0x329c(%rip), %rdi      # 0xb015
leaq 0x3a02(%rip), %rsi      # 0xb782
leaq 0x3a16(%rip), %rdx      # 0xb79d
movl $0x18c, %ecx            # imm = 0x18C
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movslq -0x8c(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x7fd1
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
movl $0x0, -0x90(%rbp)
movslq -0x90(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x7f3b
movl $0x0, -0x94(%rbp)
movslq -0x94(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x7f25
movl $0x0, -0x98(%rbp)
movslq -0x98(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x7f0f
movq -0x130(%rbp), %rdx
movq -0x138(%rbp), %rsi
movq -0x140(%rbp), %rdi
movq -0x48(%rbp), %rax
movslq -0x90(%rbp), %rcx
imulq %rsi, %rdi
imulq %rdx, %rdi
imulq %rdi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0x8c(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x94(%rbp), %ecx
addl -0x68(%rbp), %ecx
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x98(%rbp), %ecx
addl -0x64(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x7e65
jmp 0x7f11
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x7e46
jmp 0x7f27
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x7e27
movq -0x158(%rbp), %rcx
movq -0x160(%rbp), %rsi
movq -0x168(%rbp), %rdx
movsd -0x88(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %xmm1
movaps 0x3368(%rip), %xmm2     # 0xb2d0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x336c(%rip), %xmm2     # 0xb2e0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x80(%rbp), %rax
imulq %rsi, %rdx
imulq %rcx, %rdx
imulq $0x0, %rdx, %rdx
shlq $0x3, %rdx
addq %rdx, %rax
movslq -0x8c(%rbp), %rdx
imulq %rcx, %rsi
imulq %rsi, %rdx
shlq $0x3, %rdx
addq %rdx, %rax
imulq $0x0, %rcx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x7dfd
movq -0x18(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
jg 0x800b
leaq 0x3030(%rip), %rdi      # 0xb015
leaq 0x3796(%rip), %rsi      # 0xb782
leaq 0x37aa(%rip), %rdx      # 0xb79d
movl $0x1ac, %ecx            # imm = 0x1AC
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jne 0x8058
leaq 0x2fe3(%rip), %rdi      # 0xb015
leaq 0x3749(%rip), %rsi      # 0xb782
leaq 0x375d(%rip), %rdx      # 0xb79d
movl $0x1ae, %ecx            # imm = 0x1AE
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x809e
leaq 0x2f9d(%rip), %rdi      # 0xb015
leaq 0x3703(%rip), %rsi      # 0xb782
leaq 0x3717(%rip), %rdx      # 0xb79d
movl $0x1b1, %ecx            # imm = 0x1B1
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8519
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x198(%rbp)
movq -0xa8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x190(%rbp)
movq -0xa8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x188(%rbp)
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xa0(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x180(%rbp)
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x178(%rbp)
movq -0xa0(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x170(%rbp)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl $0x0, -0xc0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
subq $0x1, %rax
movl %eax, -0xcc(%rbp)
movq -0xa0(%rbp), %rax
movq 0x28(%rax), %rax
subq $0x1, %rax
movl %eax, -0xd0(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
subq $0x1, %rax
movslq -0x68(%rbp), %rcx
addq %rcx, %rax
movl %eax, -0xd4(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
subq $0x1, %rax
movslq -0x64(%rbp), %rcx
addq %rcx, %rax
movl %eax, -0xd8(%rbp)
movl $0x0, -0xdc(%rbp)
movslq -0xdc(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x8512
movl $0x0, -0xe0(%rbp)
movslq -0xe0(%rbp), %rax
movq -0xa8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x84fc
movl $0x0, -0xe4(%rbp)
movslq -0xe4(%rbp), %rax
movq -0xa8(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x84e6
movl $0x0, -0xe8(%rbp)
movslq -0xe8(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x84d0
movl -0xe0(%rbp), %eax
movl %eax, -0xc0(%rbp)
movl -0xe4(%rbp), %eax
movl %eax, -0xbc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movl $0x0, -0xec(%rbp)
movslq -0xec(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x841b
movl -0xc0(%rbp), %eax
movl %eax, -0xf0(%rbp)
movslq -0xf0(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movq -0x28(%rbp), %rdx
addq 0x20(%rdx), %rcx
cmpq %rcx, %rax
jae 0x8405
movl -0xbc(%rbp), %eax
movl %eax, -0xf4(%rbp)
movslq -0xf4(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movq -0x28(%rbp), %rdx
addq 0x28(%rdx), %rcx
cmpq %rcx, %rax
jae 0x83ef
movq -0x130(%rbp), %rdx
movq -0x138(%rbp), %rsi
movq -0x140(%rbp), %rdi
movq -0x170(%rbp), %r8
movq -0x178(%rbp), %r9
movq -0x180(%rbp), %r10
movq -0xb8(%rbp), %rax
movslq -0xec(%rbp), %rcx
imulq %r9, %r10
imulq %r8, %r10
imulq %r10, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0xe8(%rbp), %rcx
imulq %r8, %r9
imulq %r9, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0xcc(%rbp), %ecx
subl -0xf0(%rbp), %ecx
movslq %ecx, %rcx
imulq %r8, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0xd0(%rbp), %ecx
subl -0xf4(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movslq -0xec(%rbp), %rcx
imulq %rsi, %rdi
imulq %rdx, %rdi
imulq %rdi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0xdc(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0xd4(%rbp), %ecx
subl -0xf0(%rbp), %ecx
addl -0xc0(%rbp), %ecx
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0xd8(%rbp), %ecx
subl -0xf4(%rbp), %ecx
addl -0xbc(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x82a7
jmp 0x83f1
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0x827c
jmp 0x8407
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x825b
movq -0x188(%rbp), %rdx
movq -0x190(%rbp), %rsi
movq -0x198(%rbp), %rdi
movsd -0xc8(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %xmm1
movaps 0x2e88(%rip), %xmm2     # 0xb2d0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2e8c(%rip), %xmm2     # 0xb2e0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0xb0(%rbp), %rax
movslq -0xdc(%rbp), %rcx
imulq %rsi, %rdi
imulq %rdx, %rdi
imulq %rdi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0xe8(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0xe0(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq -0xe4(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x8216
jmp 0x84d2
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x81f4
jmp 0x84e8
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0x81d2
jmp 0x84fe
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x81b3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop