// File: KokiKishimoto[P]cp_decomposition/quantizedcp.cpp
// Function: main
int main(int argc, char **argv){
	std::string trainname;
	//std::string testname;
	//std::string validname;
	int dimension;
	int iteration;
	//std::string testidname;
	double rate;
	int i;
	if ((i = ArgPos((char *)"-train", argc, argv)) > 0) trainname = argv[i + 1];
	if ((i = ArgPos((char *)"-dimension", argc, argv)) > 0) dimension = atoi(argv[i + 1]);
	if ((i = ArgPos((char *)"-iteration", argc, argv)) > 0) iteration = atoi(argv[i + 1]);
	if ((i = ArgPos((char *)"-rate", argc, argv)) > 0) rate = std::stof(argv[i + 1]);

	Data data;
	data.readFromRawFile(trainname);

	int randomSeed = 0;
	double threshold = 5.0;
	QuantizeCP quantizecp(data, dimension, randomSeed, rate, threshold);

	ModelFileWriter mfw;
	int negativeSize = 5;
	quantizecp.train(data, iteration, negativeSize, mfw);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1850, %rsp           # imm = 0x1850
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3380
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1800(%rbp)
callq 0x3450
movq -0x1800(%rbp), %rdx
leaq 0xc99d(%rip), %rsi      # 0x1008d
leaq -0x68(%rbp), %rdi
callq 0x3c20
jmp 0x36fb
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x3600
movl %eax, -0x1804(%rbp)
jmp 0x3713
movl -0x1804(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x31a0
leaq -0x69(%rbp), %rdi
callq 0x32e0
movl -0x1804(%rbp), %eax
cmpl $0x0, %eax
jle 0x3795
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3370
jmp 0x3751
jmp 0x3795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3776
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x31a0
leaq -0x69(%rbp), %rdi
callq 0x32e0
jmp 0x3bd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3bd9
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x1810(%rbp)
callq 0x3450
movq -0x1810(%rbp), %rdx
leaq 0xc8de(%rip), %rsi      # 0x10094
leaq -0xa0(%rbp), %rdi
callq 0x3c20
jmp 0x37c4
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x3600
movl %eax, -0x1814(%rbp)
jmp 0x37df
movl -0x1814(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0xa1(%rbp), %rdi
callq 0x32e0
movl -0x1814(%rbp), %eax
cmpl $0x0, %eax
jle 0x385d
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33e0
movl %eax, -0x34(%rbp)
jmp 0x385d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x384c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0xa1(%rbp), %rdi
callq 0x32e0
jmp 0x3bd9
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x1820(%rbp)
callq 0x3450
movq -0x1820(%rbp), %rdx
leaq 0xc821(%rip), %rsi      # 0x1009f
leaq -0xc8(%rbp), %rdi
callq 0x3c20
jmp 0x388c
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x3600
movl %eax, -0x1824(%rbp)
jmp 0x38a7
movl -0x1824(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xc9(%rbp), %rdi
callq 0x32e0
movl -0x1824(%rbp), %eax
cmpl $0x0, %eax
jle 0x3925
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33e0
movl %eax, -0x38(%rbp)
jmp 0x3925
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3914
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xc9(%rbp), %rdi
callq 0x32e0
jmp 0x3bd9
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x1830(%rbp)
callq 0x3450
movq -0x1830(%rbp), %rdx
leaq 0xc764(%rip), %rsi      # 0x100aa
leaq -0xf0(%rbp), %rdi
callq 0x3c20
jmp 0x3954
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x3600
movl %eax, -0x1834(%rbp)
jmp 0x396f
movl -0x1834(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x31a0
leaq -0xf1(%rbp), %rdi
callq 0x32e0
movl -0x1834(%rbp), %eax
cmpl $0x0, %eax
jle 0x3a95
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x1848(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x1840(%rbp)
callq 0x3450
movq -0x1848(%rbp), %rsi
movq -0x1840(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x3c20
jmp 0x39e2
xorl %eax, %eax
movl %eax, %esi
leaq -0x118(%rbp), %rdi
callq 0x3cd0
movss %xmm0, -0x184c(%rbp)
jmp 0x39fc
movss -0x184c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x31a0
leaq -0x119(%rbp), %rdi
callq 0x32e0
jmp 0x3a95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3a4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x31a0
leaq -0xf1(%rbp), %rdi
callq 0x32e0
jmp 0x3bd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3a84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x31a0
leaq -0x119(%rbp), %rdi
callq 0x32e0
jmp 0x3bd9
leaq -0x238(%rbp), %rdi
callq 0x3d10
jmp 0x3aa3
leaq -0x258(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3120
jmp 0x3ab5
leaq -0x238(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3e00
jmp 0x3aca
leaq -0x258(%rbp), %rdi
callq 0x31a0
movl $0x0, -0x25c(%rbp)
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, -0x268(%rbp)
movl -0x34(%rbp), %edx
movl -0x25c(%rbp), %ecx
movsd -0x40(%rbp), %xmm0
movsd -0x268(%rbp), %xmm1
leaq -0x17f0(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4240
jmp 0x3b1c
leaq -0x17f1(%rbp), %rdi
callq 0x4860
jmp 0x3b2a
movl $0x5, -0x17f8(%rbp)
movl -0x38(%rbp), %edx
movl -0x17f8(%rbp), %ecx
leaq -0x17f0(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x17f1(%rbp), %r8
callq 0x4870
jmp 0x3b59
movl $0x0, -0x4(%rbp)
leaq -0x17f0(%rbp), %rdi
callq 0x4fc0
leaq -0x238(%rbp), %rdi
callq 0x5050
leaq -0x30(%rbp), %rdi
callq 0x31a0
movl -0x4(%rbp), %eax
addq $0x1850, %rsp           # imm = 0x1850
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3bcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x31a0
jmp 0x3bcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x17f0(%rbp), %rdi
callq 0x4fc0
leaq -0x238(%rbp), %rdi
callq 0x5050
leaq -0x30(%rbp), %rdi
callq 0x31a0
movq -0x78(%rbp), %rdi
callq 0x3440
nopl (%rax,%rax)