// File: /workspace/github_cpp_makefile_star2_O3/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 $0x218, %rsp            # imm = 0x218
leaq 0x158(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7bc0(%rip), %rsi      # 0xa0c0
leaq 0x7bbc(%rip), %rdx      # 0xa0c3
leaq 0x148(%rsp), %rdi
callq 0x8698
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2e56
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0x2546
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b6e(%rip), %rsi      # 0xa0c4
leaq 0x7b68(%rip), %rdx      # 0xa0c5
leaq 0x20(%rsp), %rdi
callq 0x8698
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b65(%rip), %rsi      # 0xa0dc
leaq 0x7b5f(%rip), %rdx      # 0xa0dd
movq %rsp, %rdi
callq 0x8698
movq 0x180(%rsp), %rax
movq -0x8(%rax), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x389e
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b17(%rip), %rsi      # 0xa0c6
leaq 0x7b14(%rip), %rdx      # 0xa0ca
leaq 0x68(%rsp), %rdi
callq 0x8698
leaq 0x168(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2f12
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7ae6(%rip), %rsi      # 0xa0cb
leaq 0x7ae0(%rip), %rdx      # 0xa0cc
leaq 0x48(%rsp), %rdi
callq 0x8698
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7ac4(%rip), %rsi      # 0xa0cd
leaq 0x7abe(%rip), %rdx      # 0xa0ce
leaq 0x88(%rsp), %rdi
callq 0x8698
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x389e
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7b2a(%rip), %rsi      # 0xa174
leaq 0x7b24(%rip), %rdx      # 0xa175
leaq 0x128(%rsp), %rdi
callq 0x8698
leaq 0x118(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x7a6b(%rip), %rsi      # 0xa0dc
leaq 0x7a65(%rip), %rdx      # 0xa0dd
leaq 0x108(%rsp), %rdi
callq 0x8698
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x389e
movq %rbx, %rdi
callq 0x2fd2
movq %rax, %rbx
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7a0f(%rip), %rsi      # 0xa0cf
leaq 0x7a0b(%rip), %rdx      # 0xa0d2
leaq 0xe8(%rsp), %rdi
callq 0x8698
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x79eb(%rip), %rsi      # 0xa0d3
leaq 0x79e9(%rip), %rdx      # 0xa0d8
leaq 0xc8(%rsp), %rdi
callq 0x8698
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x389e
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2736
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
leaq 0x78(%rsp), %r12
je 0x2758
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x30(%rsp), %r15
je 0x277a
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
leaq 0x58(%rsp), %rbp
je 0x279c
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x27b9
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x27d0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x27e7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2802
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2819
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x78bb(%rip), %rdx      # 0xa0e7
leaq 0xa8(%rsp), %rdi
movq %rdx, %rsi
callq 0x8698
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2e56
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x286b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x785c(%rip), %rsi      # 0xa0d9
leaq 0x7856(%rip), %rdx      # 0xa0da
callq 0x8698
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x7843(%rip), %rsi      # 0xa0db
leaq 0x783e(%rip), %rdx      # 0xa0dd
callq 0x8698
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rdi
movq %rsp, %rsi
leaq 0x68(%rsp), %rdx
callq 0x389e
leaq 0x20(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x30de
movq %rax, %r14
leaq 0x48(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x7800(%rip), %rsi      # 0xa0de
leaq 0x77fc(%rip), %rdx      # 0xa0e1
callq 0x8698
leaq 0x88(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x77e6(%rip), %rsi      # 0xa0e2
leaq 0x77e2(%rip), %rdx      # 0xa0e5
callq 0x8698
movq 0x18(%r14), %rax
movq -0x8(%rax), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x389e
movq 0x8(%r14), %rbx
movq $0x0, 0x8(%r14)
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x294b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2962
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x2979
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2994
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3138
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xb621(%rip), %rdi      # 0xdfd0
callq 0x21d0
leaq 0x772b(%rip), %rsi      # 0xa0e6
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x29e3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x3396
leaq 0x168(%rsp), %rdi
callq 0x3396
movq %r15, (%rbx)
leaq 0x76d8(%rip), %rsi      # 0xa0e8
leaq 0x76da(%rip), %rdx      # 0xa0f1
leaq 0x20(%rsp), %rdi
callq 0x8698
movq 0xb5b8(%rip), %rdi      # 0xdfe0
leaq 0x20(%rsp), %rsi
callq 0x2210
movl $0x5, %ebx
leaq 0x76a9(%rip), %r15      # 0xa0e7
leaq 0x168(%rsp), %rbp
leaq 0x76a5(%rip), %r14      # 0xa0f2
leaq 0x7692(%rip), %r12      # 0xa0e6
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x8698
leaq 0xb256(%rip), %rax      # 0xdcc8
movq %rax, 0x168(%rsp)
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0x3bf8
leaq 0xb23e(%rip), %rax      # 0xdce8
movq %rax, 0x168(%rsp)
movl $0x82, %edx
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
callq 0x2100
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2ae1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
callq 0x2230
movq %rax, %r13
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x33cc
callq 0x2230
subq %r13, %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0xb4a9(%rip), %rdi      # 0xdfd0
callq 0x2160
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21d0
movq %rbp, %rdi
callq 0x369a
decl %ebx
jne 0x2a54
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b7b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
xorl %eax, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2dfa
jmp 0x2ccc
jmp 0x2bef
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x2bc0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2bc0
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2cdc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2cdc
jmp 0x2cd9
jmp 0x2cd4
movq %rax, %rbx
jmp 0x2d13
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2deb
movq 0xb8(%rsp), %rsi
jmp 0x2de3
jmp 0x2ca3
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c42
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2c42
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d25
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2d25
jmp 0x2d22
movq %rax, %rbx
jmp 0x2d42
jmp 0x2c77
movq %rax, %rbx
jmp 0x2d5f
movq %rax, %rbx
jmp 0x2d7c
jmp 0x2c89
movq %rax, %rbx
jmp 0x2d98
jmp 0x2c93
movq %rax, %rbx
jmp 0x2db4
movq %rax, %rbx
jmp 0x2dcf
movq %rax, %rbx
jmp 0x2deb
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e4d
movq 0x158(%rsp), %rsi
jmp 0x2e45
movq %rax, %rbx
jmp 0x2e4d
movq %rax, %rbx
jmp 0x2cf8
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2cf8
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x20(%rsp), %rdi
callq 0x3396
jmp 0x2deb
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2d42
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d5f
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d7c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2d98
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2db4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2dcf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2deb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x168(%rsp), %rdi
callq 0x3396
jmp 0x2e4d
movq %rax, %rbx
jmp 0x2e31
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2e31
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2e31
jmp 0x2e21
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x369a
leaq 0x30(%rsp), %rax
movq 0x20(%rsp), %rdi
cmpq %rax, %rdi
je 0x2e4d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22c0
nop