// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1408, %rsp           # imm = 0x1408
movsd %xmm1, 0x78(%rsp)
movsd %xmm0, 0x70(%rsp)
movl %ecx, %r14d
movl %edx, %ebx
movq %rsi, %rbp
movq %rdi, %r13
leaq 0x30(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x48(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x8(%rsp)
addq $0x78, %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x60(%r13)
movupd %xmm0, 0x50(%r13)
movupd %xmm0, 0x40(%r13)
movupd %xmm0, 0x30(%r13)
movq $0x0, 0x70(%r13)
movq %rdi, 0x68(%rsp)
callq 0x2b70
leaq 0x190(%r13), %rax
movq %rax, 0x48(%rsp)
leaq 0x1a8(%r13), %rax
movq %rax, 0x40(%rsp)
leaq 0x1c0(%r13), %rax
movq %rax, 0x38(%rsp)
leaq 0x1d8(%r13), %rax
movq %rax, 0x30(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1e0(%r13)
movupd %xmm0, 0x1d0(%r13)
movupd %xmm0, 0x1c0(%r13)
movupd %xmm0, 0x1b0(%r13)
movupd %xmm0, 0x1a0(%r13)
movupd %xmm0, 0x190(%r13)
movl %ebx, 0x1f8(%r13)
leaq 0x200(%r13), %r12
movq $0x1571, 0x200(%r13) # imm = 0x1571
movl $0x1571, %ecx           # imm = 0x1571
movl $0x41, %eax
movq %rcx, %rdx
shrq $0x1e, %rdx
xorl %ecx, %edx
imull $0x6c078965, %edx, %ecx # imm = 0x6C078965
addl %eax, %ecx
addl $-0x40, %ecx
movq %rcx, (%r13,%rax,8)
incq %rax
cmpq $0x2b0, %rax            # imm = 0x2B0
jne 0x30dc
movq $0x270, 0x1580(%r13) # imm = 0x270
movl %r14d, %eax
movq %rax, 0x80(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x80(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x311b
leaq 0x80(%rsp), %rsi
movq $0x270, 0x1380(%rsi) # imm = 0x270
movl $0x1388, %edx           # imm = 0x1388
movq %r12, %rdi
callq 0x21e0
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x317b
sqrtsd %xmm0, %xmm0
jmp 0x3180
callq 0x21c0
movsd %xmm0, 0x20(%rsp)
movslq (%rbp), %rsi
movq 0x18(%rsp), %rdi
callq 0x47b2
movsd 0x3e74(%rip), %xmm0     # 0x7010
divsd 0x20(%rsp), %xmm0
movapd 0x3e96(%rip), %xmm1     # 0x7040
xorpd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movslq (%rbp), %rsi
addsd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
testq %rsi, %rsi
jle 0x3237
movl 0x1f8(%r13), %eax
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
movq 0x18(%rsp), %rcx
addq (%rcx), %rdi
movslq %eax, %rsi
callq 0x47ee
movl 0x1f8(%r13), %eax
testl %eax, %eax
jle 0x322b
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x4bdd
mulsd 0x20(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movq 0x30(%r13), %rax
movq (%rax,%r14,8), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0x1f8(%r13), %rax
cmpq %rax, %r15
jl 0x31fa
incq %rbx
movslq (%rbp), %rsi
cmpq %rsi, %rbx
jl 0x31d0
movq 0x10(%rsp), %rdi
callq 0x47b2
cmpl $0x0, (%rbp)
jle 0x32b7
movl 0x1f8(%r13), %eax
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
movq 0x10(%rsp), %rcx
addq (%rcx), %rdi
movslq %eax, %rsi
callq 0x47ee
movl 0x1f8(%r13), %eax
testl %eax, %eax
jle 0x32ab
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x4bdd
mulsd 0x20(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movq 0x48(%r13), %rax
movq (%rax,%r14,8), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0x1f8(%r13), %rax
cmpq %rax, %r15
jl 0x327a
incq %rbx
movslq (%rbp), %rcx
cmpq %rcx, %rbx
jl 0x3250
movslq 0x4(%rbp), %rsi
movq 0x8(%rsp), %rdi
callq 0x47b2
cmpl $0x0, 0x4(%rbp)
movl 0x1f8(%r13), %eax
jle 0x333b
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
movq 0x8(%rsp), %rcx
addq (%rcx), %rdi
movslq %eax, %rsi
callq 0x47ee
movl 0x1f8(%r13), %eax
testl %eax, %eax
jle 0x332f
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x4bdd
mulsd 0x20(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movq 0x60(%r13), %rax
movq (%rax,%r14,8), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0x1f8(%r13), %rax
cmpq %rax, %r15
jl 0x32fe
incq %rbx
movslq 0x4(%rbp), %rcx
cmpq %rcx, %rbx
jl 0x32d4
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
movsd %xmm0, 0x10(%r13)
movabsq $0x3e45798ee2308c3a, %rcx # imm = 0x3E45798EE2308C3A
movq %rcx, 0x18(%r13)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x20(%r13)
movslq %eax, %rsi
movq 0x48(%rsp), %rdi
callq 0x47ee
movslq 0x1f8(%r13), %rsi
movq 0x40(%rsp), %rdi
callq 0x47ee
movslq 0x1f8(%r13), %rsi
movq 0x38(%rsp), %rdi
callq 0x47ee
movl $0x3, %esi
movq 0x30(%rsp), %rdi
callq 0x47ee
addq $0x1408, %rsp           # imm = 0x1408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x3448
jmp 0x33cb
jmp 0x33cb
jmp 0x33cb
jmp 0x33cb
jmp 0x33cb
jmp 0x33cb
movq %rax, %r12
movq 0x30(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33ea
movq 0x1e8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x38(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3406
movq 0x1d0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x40(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3422
movq 0x1b8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x48(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x343e
movq 0x1a0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x68(%rsp), %rdi
callq 0x3ba0
movq 0x8(%rsp), %rdi
callq 0x4820
movq 0x10(%rsp), %rdi
callq 0x4820
movq 0x18(%rsp), %rdi
callq 0x4820
movq %r12, %rdi
callq 0x23b0