// File: KokiKishimoto[P]cp_decomposition/cp.cpp
// Function: main
int main(int argc, char **argv){
	std::string trainname;
	int dimension;
	int iteration;
	double rate;
	double lambda;
	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]);
	if ((i = ArgPos((char *)"-lambda", argc, argv)) > 0) lambda = std::stof(argv[i + 1]);

	Data data;
	data.readFromRawFile(trainname);

	int randomSeed = 0;
	double threshold = 5.0;
	CP cp(data, dimension, randomSeed, rate, threshold, lambda);

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

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x18e0, %rsp           # imm = 0x18E0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3380
leaq -0x71(%rbp), %rdi
movq %rdi, -0x1860(%rbp)
callq 0x3450
movq -0x1860(%rbp), %rdx
leaq 0xc98d(%rip), %rsi      # 0x1007d
leaq -0x70(%rbp), %rdi
callq 0x3dd0
jmp 0x36fb
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x3600
movl %eax, -0x1864(%rbp)
jmp 0x3713
movl -0x1864(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x31a0
leaq -0x71(%rbp), %rdi
callq 0x32e0
movl -0x1864(%rbp), %eax
cmpl $0x0, %eax
jle 0x379e
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3370
jmp 0x3751
jmp 0x379e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x377c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x31a0
leaq -0x71(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3d84
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x1870(%rbp)
callq 0x3450
movq -0x1870(%rbp), %rdx
leaq 0xc8c5(%rip), %rsi      # 0x10084
leaq -0xa8(%rbp), %rdi
callq 0x3dd0
jmp 0x37cd
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x3600
movl %eax, -0x1874(%rbp)
jmp 0x37e8
movl -0x1874(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31a0
leaq -0xa9(%rbp), %rdi
callq 0x32e0
movl -0x1874(%rbp), %eax
cmpl $0x0, %eax
jle 0x386c
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33e0
movl %eax, -0x34(%rbp)
jmp 0x386c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x385b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31a0
leaq -0xa9(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x1880(%rbp)
callq 0x3450
movq -0x1880(%rbp), %rdx
leaq 0xc802(%rip), %rsi      # 0x1008f
leaq -0xd0(%rbp), %rdi
callq 0x3dd0
jmp 0x389b
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
callq 0x3600
movl %eax, -0x1884(%rbp)
jmp 0x38b6
movl -0x1884(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x31a0
leaq -0xd1(%rbp), %rdi
callq 0x32e0
movl -0x1884(%rbp), %eax
cmpl $0x0, %eax
jle 0x393a
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33e0
movl %eax, -0x38(%rbp)
jmp 0x393a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x31a0
leaq -0xd1(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x1890(%rbp)
callq 0x3450
movq -0x1890(%rbp), %rdx
leaq 0xc73f(%rip), %rsi      # 0x1009a
leaq -0xf8(%rbp), %rdi
callq 0x3dd0
jmp 0x3969
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
callq 0x3600
movl %eax, -0x1894(%rbp)
jmp 0x3984
movl -0x1894(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x31a0
leaq -0xf9(%rbp), %rdi
callq 0x32e0
movl -0x1894(%rbp), %eax
cmpl $0x0, %eax
jle 0x3ab6
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x18a8(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x18a0(%rbp)
callq 0x3450
movq -0x18a8(%rbp), %rsi
movq -0x18a0(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0x3dd0
jmp 0x39f7
xorl %eax, %eax
movl %eax, %esi
leaq -0x120(%rbp), %rdi
callq 0x3e80
movss %xmm0, -0x18ac(%rbp)
jmp 0x3a11
movss -0x18ac(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x31a0
leaq -0x121(%rbp), %rdi
callq 0x32e0
jmp 0x3ab6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3a68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x31a0
leaq -0xf9(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3aa5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x31a0
leaq -0x121(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
leaq -0x149(%rbp), %rdi
movq %rdi, -0x18b8(%rbp)
callq 0x3450
movq -0x18b8(%rbp), %rdx
leaq 0xc5c9(%rip), %rsi      # 0x100a0
leaq -0x148(%rbp), %rdi
callq 0x3dd0
jmp 0x3ae5
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x148(%rbp), %rdi
callq 0x3600
movl %eax, -0x18bc(%rbp)
jmp 0x3b00
movl -0x18bc(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x149(%rbp), %rdi
callq 0x32e0
movl -0x18bc(%rbp), %eax
cmpl $0x0, %eax
jle 0x3c32
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x18d0(%rbp)
leaq -0x171(%rbp), %rdi
movq %rdi, -0x18c8(%rbp)
callq 0x3450
movq -0x18d0(%rbp), %rsi
movq -0x18c8(%rbp), %rdx
leaq -0x170(%rbp), %rdi
callq 0x3dd0
jmp 0x3b73
xorl %eax, %eax
movl %eax, %esi
leaq -0x170(%rbp), %rdi
callq 0x3e80
movss %xmm0, -0x18d4(%rbp)
jmp 0x3b8d
movss -0x18d4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x31a0
leaq -0x171(%rbp), %rdi
callq 0x32e0
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3be4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x149(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3c21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x31a0
leaq -0x171(%rbp), %rdi
callq 0x32e0
jmp 0x3d84
leaq -0x290(%rbp), %rdi
callq 0x3ec0
jmp 0x3c40
leaq -0x2b0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3120
jmp 0x3c52
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x3fb0
jmp 0x3c67
leaq -0x2b0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0x2b4(%rbp)
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, -0x2c0(%rbp)
movl -0x34(%rbp), %edx
movl -0x2b4(%rbp), %ecx
movsd -0x40(%rbp), %xmm0
movsd -0x2c0(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
leaq -0x1850(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x43f0
jmp 0x3cbe
leaq -0x1851(%rbp), %rdi
callq 0x47c0
jmp 0x3ccc
movl $0x5, -0x1858(%rbp)
movl -0x38(%rbp), %edx
movl -0x1858(%rbp), %ecx
leaq -0x1850(%rbp), %rdi
leaq -0x290(%rbp), %rsi
leaq -0x1851(%rbp), %r8
callq 0x47d0
jmp 0x3cfb
movl $0x0, -0x4(%rbp)
leaq -0x1850(%rbp), %rdi
callq 0x4f20
leaq -0x290(%rbp), %rdi
callq 0x4fb0
leaq -0x30(%rbp), %rdi
callq 0x31a0
movl -0x4(%rbp), %eax
addq $0x18e0, %rsp           # imm = 0x18E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x3d78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x31a0
jmp 0x3d78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x1850(%rbp), %rdi
callq 0x4f20
leaq -0x290(%rbp), %rdi
callq 0x4fb0
leaq -0x30(%rbp), %rdi
callq 0x31a0
movq -0x80(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)