// File: Konano[P]Artificial-Intelligence-Input-Method/training.cpp
// Function: ReadInput(char*)
inline void ReadInput(char *localFileName)
{
	string str, py, tmp;

	len = 1;

	localFileName[14] = 'C';
	ifstream fin(localFileName);

	localFileName[14] = 'P';
	ifstream fpy(localFileName);

	while (!fin.eof())
	{
		fin >> str;
		if (str != "/")
		{
			int L = str.length() / 2;
			fpy >> py;
			for(int i = 1; i < L; i++)
				fpy >> tmp, py += '-' + tmp;
			text[len++] = Word_ID(str, py);
		}
		else
		{
			text[len++] = text[0] = 1;

			#ifdef WORD_1
			for(int j=1; j<len-1; j++) if (text[j])
				Times_1[text[j]]++;
			#endif

			#ifdef WORD_2
			for(int j=1; j<len; j++) if (text[j-1] && text[j])
				Times_2[Long(text[j-1], text[j])]++;
			#endif

			len = 1;
		}
	}
}

// Assembly:
subq $0x518, %rsp            # imm = 0x518
movq %rdi, 0x510(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x3320
leaq 0x4d0(%rsp), %rdi
callq 0x3320
leaq 0x4b0(%rsp), %rdi
callq 0x3320
movl $0x1, 0x59b5750(%rip)   # 0x59b94f0
movq 0x510(%rsp), %rax
movb $0x43, 0xe(%rax)
movq 0x510(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
movl $0x8, %edx
callq 0x3400
jmp 0x3dc8
movq 0x510(%rsp), %rax
movb $0x50, 0xe(%rax)
movq 0x510(%rsp), %rsi
leaq 0x90(%rsp), %rdi
movl $0x8, %edx
callq 0x3400
jmp 0x3df0
jmp 0x3df2
movq 0x2a8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x2a8(%rsp,%rax), %rdi
callq 0x3410
movb %al, 0x17(%rsp)
jmp 0x3e11
movb 0x17(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3e20
jmp 0x4110
leaq 0x2a8(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
callq 0x32e0
jmp 0x3e37
leaq 0x72d4(%rip), %rsi      # 0xb112
leaq 0x4f0(%rsp), %rdi
callq 0x9920
movb %al, 0x16(%rsp)
jmp 0x3e51
movb 0x16(%rsp), %al
testb $0x1, %al
jne 0x3e5e
jmp 0x4035
leaq 0x4f0(%rsp), %rdi
callq 0x3350
shrq %rax
movl %eax, 0x8c(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x4d0(%rsp), %rsi
callq 0x32e0
jmp 0x3e8c
movl $0x1, 0x88(%rsp)
movl 0x88(%rsp), %eax
cmpl 0x8c(%rsp), %eax
jge 0x3f7a
leaq 0x90(%rsp), %rdi
leaq 0x4b0(%rsp), %rsi
callq 0x32e0
jmp 0x3ec2
leaq 0x68(%rsp), %rdi
movl $0x2d, %esi
leaq 0x4b0(%rsp), %rdx
callq 0x9950
jmp 0x3edb
leaq 0x4d0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x32f0
jmp 0x3eef
leaq 0x68(%rsp), %rdi
callq 0x3150
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x3e97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x4173
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x4166
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x4159
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x3150
jmp 0x4159
leaq 0x48(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
callq 0x30e0
jmp 0x3f8e
leaq 0x28(%rsp), %rdi
leaq 0x4d0(%rsp), %rsi
callq 0x30e0
jmp 0x3fa2
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4f10
movl %eax, 0x10(%rsp)
jmp 0x3fb7
movl 0x10(%rsp), %edx
movl 0x59b552f(%rip), %eax   # 0x59b94f0
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x59b5524(%rip)   # 0x59b94f0
movslq %eax, %rcx
leaq 0x59b552a(%rip), %rax   # 0x59b9500
movl %edx, (%rax,%rcx,4)
leaq 0x28(%rsp), %rdi
callq 0x3150
leaq 0x48(%rsp), %rdi
callq 0x3150
jmp 0x410b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x4026
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3150
leaq 0x48(%rsp), %rdi
callq 0x3150
jmp 0x4159
movl $0x1, 0x59b54c1(%rip)   # 0x59b9500
movl 0x59b54ab(%rip), %eax   # 0x59b94f0
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x59b54a0(%rip)   # 0x59b94f0
movslq %eax, %rcx
leaq 0x59b54a6(%rip), %rax   # 0x59b9500
movl $0x1, (%rax,%rcx,4)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x59b547d(%rip), %eax   # 0x59b94f0
jge 0x4101
movl 0x24(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x59b5476(%rip), %rax   # 0x59b9500
cmpl $0x0, (%rax,%rcx,4)
je 0x40ef
movslq 0x24(%rsp), %rcx
leaq 0x59b5464(%rip), %rax   # 0x59b9500
cmpl $0x0, (%rax,%rcx,4)
je 0x40ef
movslq 0x24(%rsp), %rdx
movl %edx, %eax
decl %eax
cltq
leaq 0x59b544c(%rip), %rcx   # 0x59b9500
movslq (%rcx,%rax,4), %rax
imulq $0x16e360, %rax, %rax   # imm = 0x16E360
movslq (%rcx,%rdx,4), %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
leaq 0x502bd6e(%rip), %rdi   # 0x502fe40
leaq 0x18(%rsp), %rsi
callq 0x9a70
movq %rax, 0x8(%rsp)
jmp 0x40e3
movq 0x8(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x40f1
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x4069
movl $0x1, 0x59b53e5(%rip)   # 0x59b94f0
jmp 0x3df2
leaq 0x90(%rsp), %rdi
callq 0x3080
leaq 0x2a8(%rsp), %rdi
callq 0x3080
leaq 0x4b0(%rsp), %rdi
callq 0x3150
leaq 0x4d0(%rsp), %rdi
callq 0x3150
leaq 0x4f0(%rsp), %rdi
callq 0x3150
addq $0x518, %rsp            # imm = 0x518
retq
leaq 0x90(%rsp), %rdi
callq 0x3080
leaq 0x2a8(%rsp), %rdi
callq 0x3080
leaq 0x4b0(%rsp), %rdi
callq 0x3150
leaq 0x4d0(%rsp), %rdi
callq 0x3150
leaq 0x4f0(%rsp), %rdi
callq 0x3150
movq 0x2a0(%rsp), %rdi
callq 0x33d0
nopw (%rax,%rax)