// File: /workspace/github_cpp_makefile_star2_O2/KokiKishimoto[P]cp_decomposition/quantizedcp.cpp
// Function: QuantizeCP::QuantizeCP(Data&, int, int, double, double)
QuantizeCP(Data& traindata, int vecDim_, int randomSeed, double learningRate, double threshold) : vecDim(vecDim_){
		op = SignalOperation();

		rnd = std::mt19937(randomSeed);
		double bnd = sqrt(6.0) / sqrt((double)vecDim * 2);
		std::uniform_real_distribution<> dist(-bnd, bnd);

		subjVec.resize(traindata.entity_counter);
		for (int i = 0; i < traindata.entity_counter; i++) {
			subjVec[i].resize(vecDim);
			for (int j = 0; j < vecDim; j++) {
				subjVec[i][j] = dist(rnd);
			}
		}

		objVec.resize(traindata.entity_counter);
		for (int i = 0; i < traindata.entity_counter; i++) {
			objVec[i].resize(vecDim);
			for (int j = 0; j < vecDim; j++) {
				objVec[i][j] = dist(rnd);
			}
		}

		relationVec.resize(traindata.relation_counter);
		for (int i = 0; i < traindata.relation_counter; i++) {
			relationVec[i].resize(vecDim);
			for (int j = 0; j < vecDim; j++) {
				relationVec[i][j] = dist(rnd);
			}
		}

		updater = Updater(learningRate, threshold);

		outVec1.resize(vecDim);
		outVec2.resize(vecDim);
		outVec3.resize(vecDim);

		norms.resize(3);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x13e8, %rsp           # imm = 0x13E8
movsd %xmm1, 0x58(%rsp)
movsd %xmm0, 0x50(%rsp)
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, 0x10(%rsp)
movq %rdi, %rbp
leaq 0x30(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x48(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x60(%rdi), %r15
addq $0x78, %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x60(%rbp)
movupd %xmm0, 0x50(%rbp)
movupd %xmm0, 0x40(%rbp)
movupd %xmm0, 0x30(%rbp)
andq $0x0, 0x70(%rbp)
movq %rdi, 0x48(%rsp)
callq 0x2916
leaq 0x190(%rbp), %rax
movq %rax, 0x40(%rsp)
leaq 0x1a8(%rbp), %rax
movq %rax, 0x38(%rsp)
leaq 0x1c0(%rbp), %rax
movq %rax, 0x30(%rsp)
leaq 0x1d8(%rbp), %rax
movq %rax, 0x28(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1e0(%rbp)
movupd %xmm0, 0x1d0(%rbp)
movupd %xmm0, 0x1c0(%rbp)
movupd %xmm0, 0x1b0(%rbp)
movupd %xmm0, 0x1a0(%rbp)
movupd %xmm0, 0x190(%rbp)
movl %r13d, 0x1f8(%rbp)
leaq 0x200(%rbp), %r13
movq %r13, %rdi
callq 0x42d6
movslq %r12d, %rsi
leaq 0x60(%rsp), %rdi
callq 0x4372
leaq 0x60(%rsp), %rsi
movl $0x1388, %edx           # imm = 0x1388
movq %r13, %rdi
callq 0x21c0
cvtsi2sdl 0x1f8(%rbp), %xmm0
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2d7b
sqrtsd %xmm0, %xmm0
jmp 0x2d80
callq 0x21a0
movsd 0x3288(%rip), %xmm1     # 0x6010
divsd %xmm0, %xmm1
movapd 0x32ac(%rip), %xmm0     # 0x6040
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x60(%rsp)
movsd %xmm1, 0x68(%rsp)
movq 0x10(%rsp), %rax
movslq (%rax), %rsi
movq 0x20(%rsp), %rdi
callq 0x42e0
xorl %ecx, %ecx
leaq 0x60(%rsp), %r12
movq 0x10(%rsp), %rax
movslq (%rax), %rsi
cmpq %rsi, %rcx
jge 0x2e21
movq %rcx, 0x8(%rsp)
imulq $0x18, %rcx, %rbx
movq 0x30(%rbp), %rdi
addq %rbx, %rdi
movslq 0x1f8(%rbp), %rsi
callq 0x4316
xorl %r14d, %r14d
movslq 0x1f8(%rbp), %rax
cmpq %rax, %r14
jge 0x2e17
movq %r12, %rdi
movq %r13, %rsi
callq 0x4348
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x2de9
movq 0x8(%rsp), %rcx
incq %rcx
jmp 0x2dbd
movq 0x18(%rsp), %rdi
callq 0x42e0
xorl %ecx, %ecx
leaq 0x60(%rsp), %r12
movq 0x10(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %rcx
jge 0x2e96
movq %rcx, 0x8(%rsp)
imulq $0x18, %rcx, %rbx
movq 0x48(%rbp), %rdi
addq %rbx, %rdi
movslq 0x1f8(%rbp), %rsi
callq 0x4316
xorl %r14d, %r14d
movslq 0x1f8(%rbp), %rax
cmpq %rax, %r14
jge 0x2e8c
movq %r12, %rdi
movq %r13, %rsi
callq 0x4348
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x2e5e
movq 0x8(%rsp), %rcx
incq %rcx
jmp 0x2e32
movq 0x10(%rsp), %rax
movslq 0x4(%rax), %rsi
movq %r15, %rdi
callq 0x42e0
xorl %ecx, %ecx
leaq 0x60(%rsp), %r12
movq 0x10(%rsp), %rax
movslq 0x4(%rax), %rax
cmpq %rax, %rcx
jge 0x2f0e
movq %rcx, 0x8(%rsp)
imulq $0x18, %rcx, %rbx
movq 0x60(%rbp), %rdi
addq %rbx, %rdi
movslq 0x1f8(%rbp), %rsi
callq 0x4316
xorl %r14d, %r14d
movslq 0x1f8(%rbp), %rax
cmpq %rax, %r14
jge 0x2f04
movq %r12, %rdi
movq %r13, %rsi
callq 0x4348
movq (%r15), %rax
movq (%rax,%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x2edb
movq 0x8(%rsp), %rcx
incq %rcx
jmp 0x2eae
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x8(%rbp)
movsd %xmm0, 0x10(%rbp)
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x18(%rbp)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x20(%rbp)
movslq 0x1f8(%rbp), %rsi
movq 0x40(%rsp), %rdi
callq 0x4316
movslq 0x1f8(%rbp), %rsi
movq 0x38(%rsp), %rdi
callq 0x4316
movslq 0x1f8(%rbp), %rsi
movq 0x30(%rsp), %rdi
callq 0x4316
pushq $0x3
popq %rsi
movq 0x28(%rsp), %rdi
callq 0x4316
addq $0x13e8, %rsp           # imm = 0x13E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f9e
jmp 0x2f9e
movq %rax, %r12
jmp 0x2fd3
jmp 0x2f9e
jmp 0x2f9e
jmp 0x2f9e
jmp 0x2f9e
jmp 0x2f9e
jmp 0x2f9e
movq %rax, %r12
movq 0x28(%rsp), %rdi
callq 0x4a94
movq 0x30(%rsp), %rdi
callq 0x4a94
movq 0x38(%rsp), %rdi
callq 0x4a94
movq 0x40(%rsp), %rdi
callq 0x4a94
movq 0x48(%rsp), %rdi
callq 0x353c
movq %r15, %rdi
callq 0x4350
movq 0x18(%rsp), %rdi
callq 0x4350
movq 0x20(%rsp), %rdi
callq 0x4350
movq %r12, %rdi
callq 0x2350
nop