// File: /workspace/github_cpp_makefile_star2_O2/ClauParser[P]ClauParser/./source/main.cpp
// Function: main
int main(void)
{
	{
		clau_parser::Maker maker("AAA");

		maker.NewItem("x", "1")
			.NewGroup("test")
			.NewItem("a", "0")
			.NewItem("b", "1")
			.EndGroup()
			.NewItem("str", "\"wow\"");

		clau_parser::Maker maker2;
		clau_parser::UserType* result = maker2.NewItem("z", "-1")
			.NewGroup(maker)
			.NewItem("abc", "def")
			.Get();

		std::cout << result->ToString() << "\n";

		delete result;
	}


	/*
	{
		wiz::UserType ut("Name");
		wiz::ItemType<std::string> it("Name", "Data");
		
		ut.AddItemType(it);
	}


	{
		wiz::UserType ut("Name");
		wiz::UserType global("Name");

		global.AddUserTypeItem(ut); // ³»ºÎ¿¡¼­ µ¿ÀûÇÒ´ç
	}




	{
		wiz::UserType global;
		global.AddItem("date", "1947.5.8");
		global.AddItem("save_game", "\"Russia.eu4\"");
		{
			wiz::UserType temp("savegame_versions");
			temp.AddItem("", "\"1.18.1.0\"");
			temp.AddItem("", "\"1.18.2.0\"");
			temp.AddItem("", "\"1.18.3.0\"");
			temp.AddItem("", "\"1.18.4.0\"");
			temp.AddItem("", "\"1.19.1.0\"");
			global.AddUserTypeItem(temp);
		}

		std::cout << global.ToString();
	}
	*/
	
	std::string fileName = "input.eu4"; 
	
	std::cin >> fileName;
	/*
	for (int i = 0; i <= 32; ++i) {
		clau_parser::UserType global;

		auto start = std::chrono::steady_clock::now();

		std::cout << i << "th \n";
		clau_parser::LoadData::LoadDataFromFile(fileName, global, i, i);


		auto last = std::chrono::steady_clock::now();
		auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(last - start);

		std::cout << dur.count() << "ms" << "\n";
	
		//clau_parser::LoadData::SaveWizDB2(global, "output.eu4");
	}
	*/
	for (int i = 0; i < 5; ++i) {
		clau_parser::UserType global;


		auto start = std::chrono::steady_clock::now();

		clau_parser::LoadData::LoadDataFromFile(fileName, global, 0, 0, false); // true - error detected..
		auto last = std::chrono::steady_clock::now();
		auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(last - start);

		std::cout << dur.count() << "ms" << "\n";

		//clau_parser::LoadData::SaveWizDB2(global, "output.eu4");
	}

	for (int i = 0; i < 0; ++i) {
		clau_parser::UserType global;


		auto start = std::chrono::steady_clock::now();

		clau_parser::LoadData::LoadDataFromFile(fileName, global, 0, i);
		auto last = std::chrono::steady_clock::now();
		auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(last - start);

		std::cout << dur.count() << "ms" << "\n";

		//clau_parser::LoadData::SaveWizDB2(global, "output.eu4");
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
leaq 0x6c0c(%rip), %rsi      # 0x9090
leaq 0x158(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2a64
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x2aa0
leaq 0x158(%rsp), %rdi
callq 0x20d0
leaq 0x6bd5(%rip), %rsi      # 0x9094
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2a64
leaq 0x6bd7(%rip), %rsi      # 0x90ac
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x2a64
leaq 0x178(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2b18
movq %rax, %rbx
leaq 0x6b91(%rip), %rsi      # 0x9096
leaq 0x58(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x2a64
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x2b2e
movq %rax, %rbx
leaq 0x6b70(%rip), %rsi      # 0x909b
leaq 0x98(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x2a64
leaq 0x6b59(%rip), %rsi      # 0x909d
leaq 0x78(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x2a64
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x2b18
movq %rax, %rbx
leaq 0x6bd2(%rip), %rsi      # 0x9144
leaq 0x118(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x2a64
leaq 0x6b21(%rip), %rsi      # 0x90ac
leaq 0xf8(%rsp), %rdi
leaq 0x9(%rsp), %rdx
callq 0x2a64
leaq 0x118(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2b18
movq %rax, %rdi
callq 0x2ba2
movq %rax, %rbx
leaq 0x6ad8(%rip), %rsi      # 0x909f
leaq 0xd8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2a64
leaq 0x6ac3(%rip), %rsi      # 0x90a3
leaq 0xb8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2a64
leaq 0xd8(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2b18
leaq 0xb8(%rsp), %rdi
callq 0x20d0
leaq 0xd8(%rsp), %rdi
callq 0x20d0
leaq 0xf8(%rsp), %rdi
callq 0x20d0
leaq 0x118(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x20d0
leaq 0x98(%rsp), %rdi
callq 0x20d0
leaq 0x58(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
callq 0x20d0
leaq 0x30(%rsp), %rdi
callq 0x20d0
leaq 0x6a3d(%rip), %rsi      # 0x90b7
leaq 0x138(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2a64
leaq 0x30(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x2aa0
leaq 0x138(%rsp), %rdi
callq 0x20d0
leaq 0x69f7(%rip), %rsi      # 0x90a9
leaq 0x10(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x2a64
leaq 0x69e0(%rip), %rsi      # 0x90ab
leaq 0x58(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0x2a64
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x2b18
leaq 0x178(%rsp), %rsi
movq %rax, %rdi
callq 0x2c60
movq %rax, %rbx
leaq 0x69a3(%rip), %rsi      # 0x90ae
leaq 0x98(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
callq 0x2a64
leaq 0x698b(%rip), %rsi      # 0x90b2
leaq 0x78(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x2a64
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x2b18
movq 0x8(%rax), %rbx
andq $0x0, 0x8(%rax)
leaq 0x78(%rsp), %rdi
callq 0x20d0
leaq 0x98(%rsp), %rdi
callq 0x20d0
leaq 0x58(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x2cb4
movq 0xb83a(%rip), %rdi      # 0xdfd0
leaq 0x10(%rsp), %rsi
callq 0x2170
leaq 0x690f(%rip), %rsi      # 0x90b6
movq %rax, %rdi
callq 0x21a0
leaq 0x10(%rsp), %rdi
callq 0x20d0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x2efa
leaq 0x178(%rsp), %rdi
callq 0x2efa
leaq 0x68d8(%rip), %rsi      # 0x90b8
leaq 0x30(%rsp), %rdi
leaq 0x178(%rsp), %rdx
callq 0x2a64
movq 0xb7e7(%rip), %rdi      # 0xdfe0
leaq 0x30(%rsp), %rsi
callq 0x2230
pushq $0x5
popq %rbp
leaq 0x10(%rsp), %r14
leaq 0x178(%rsp), %r12
leaq 0x68a8(%rip), %rbx      # 0x90c2
leaq 0x6895(%rip), %r15      # 0x90b6
subl $0x1, %ebp
jb 0x28b1
movq %r14, %rdi
leaq 0x6883(%rip), %rsi      # 0x90b7
leaq 0x58(%rsp), %rdx
callq 0x2a64
movq %r12, %rdi
movq %r14, %rsi
callq 0x2f24
movq %r14, %rdi
callq 0x20d0
callq 0x2260
movq %rax, %r13
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2f5a
callq 0x2260
subq %r13, %rax
cqto
movl $0xf4240, %ecx          # imm = 0xF4240
idivq %rcx
movq 0xb74a(%rip), %rdi      # 0xdfd0
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
movq %r12, %rdi
callq 0x31a2
jmp 0x2821
leaq 0x30(%rsp), %rdi
callq 0x20d0
xorl %eax, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a2d
jmp 0x299a
jmp 0x2909
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x20d0
jmp 0x28ed
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x20d0
jmp 0x29aa
jmp 0x29a7
jmp 0x29a2
movq %rax, %rbx
jmp 0x29be
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
jmp 0x2a17
jmp 0x2982
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x20d0
jmp 0x2938
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x20d0
jmp 0x29cd
jmp 0x29ca
movq %rax, %rbx
jmp 0x29da
jmp 0x2956
movq %rax, %rbx
jmp 0x29e7
movq %rax, %rbx
jmp 0x29f1
jmp 0x2968
movq %rax, %rbx
jmp 0x29fe
jmp 0x2972
movq %rax, %rbx
jmp 0x2a08
movq %rax, %rbx
jmp 0x2a12
movq %rax, %rbx
jmp 0x2a1c
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x2a56
movq %rax, %rbx
jmp 0x2a5b
movq %rax, %rbx
jmp 0x29b4
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
callq 0x20d0
leaq 0x30(%rsp), %rdi
callq 0x2efa
jmp 0x2a1c
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x20d0
leaq 0x118(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x20d0
leaq 0x98(%rsp), %rdi
callq 0x20d0
leaq 0x58(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
callq 0x20d0
leaq 0x30(%rsp), %rdi
callq 0x20d0
leaq 0x178(%rsp), %rdi
callq 0x2efa
jmp 0x2a5b
jmp 0x2a41
movq %rax, %rbx
jmp 0x2a51
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20d0
jmp 0x2a51
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x31a2
leaq 0x30(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2300
nop