// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, %r13
leaq 0x30(%rdi), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x38(%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, 0x30(%rsp)
leaq 0x1a8(%r13), %rax
movq %rax, 0x28(%rsp)
leaq 0x1c0(%r13), %rax
movq %rax, 0x20(%rsp)
leaq 0x1d8(%r13), %rax
movq %rax, 0x18(%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), %rbp
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 %rbp, %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, (%rsp)
movslq (%r12), %rsi
movq 0x48(%rsp), %rdi
callq 0x478a
movsd 0x3e75(%rip), %xmm0     # 0x7010
divsd (%rsp), %xmm0
movapd 0x3e98(%rip), %xmm1     # 0x7040
xorpd %xmm0, %xmm1
movapd %xmm1, 0x50(%rsp)
movl (%r12), %eax
addsd %xmm0, %xmm0
movapd %xmm0, (%rsp)
testl %eax, %eax
jle 0x322a
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
addq 0x30(%r13), %rdi
movslq 0x1f8(%r13), %rsi
callq 0x47c6
cmpl $0x0, 0x1f8(%r13)
jle 0x321e
xorl %r15d, %r15d
movq %rbp, %rdi
callq 0x4bb1
mulsd (%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 0x31ee
incq %rbx
movslq (%r12), %rax
cmpq %rax, %rbx
jl 0x31c5
movslq %eax, %rsi
movq 0x40(%rsp), %rdi
callq 0x478a
cmpl $0x0, (%r12)
jle 0x32a5
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
addq 0x48(%r13), %rdi
movslq 0x1f8(%r13), %rsi
callq 0x47c6
cmpl $0x0, 0x1f8(%r13)
jle 0x3299
xorl %r15d, %r15d
movq %rbp, %rdi
callq 0x4bb1
mulsd (%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 0x3269
incq %rbx
movslq (%r12), %rax
cmpq %rax, %rbx
jl 0x3240
movslq 0x4(%r12), %rsi
movq 0x38(%rsp), %rdi
callq 0x478a
cmpl $0x0, 0x4(%r12)
jle 0x3324
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (,%r14,8), %rdi
addq 0x60(%r13), %rdi
movslq 0x1f8(%r13), %rsi
callq 0x47c6
cmpl $0x0, 0x1f8(%r13)
jle 0x3317
xorl %r15d, %r15d
movq %rbp, %rdi
callq 0x4bb1
mulsd (%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 0x32e7
incq %rbx
movslq 0x4(%r12), %rax
cmpq %rax, %rbx
jl 0x32be
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
movsd %xmm0, 0x10(%r13)
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x18(%r13)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x20(%r13)
movslq 0x1f8(%r13), %rsi
movq 0x30(%rsp), %rdi
callq 0x47c6
movslq 0x1f8(%r13), %rsi
movq 0x28(%rsp), %rdi
callq 0x47c6
movslq 0x1f8(%r13), %rsi
movq 0x20(%rsp), %rdi
callq 0x47c6
movl $0x3, %esi
movq 0x18(%rsp), %rdi
callq 0x47c6
addq $0x1408, %rsp           # imm = 0x1408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x3435
jmp 0x33b8
jmp 0x33b8
jmp 0x33b8
jmp 0x33b8
jmp 0x33b8
jmp 0x33b8
movq %rax, %r12
movq 0x18(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33d7
movq 0x1e8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x20(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33f3
movq 0x1d0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x340f
movq 0x1b8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x30(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x342b
movq 0x1a0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x68(%rsp), %rdi
callq 0x3b7c
movq 0x38(%rsp), %rdi
callq 0x47f8
movq 0x40(%rsp), %rdi
callq 0x47f8
movq 0x48(%rsp), %rdi
callq 0x47f8
movq %r12, %rdi
callq 0x23b0
nop