// File: /workspace/github_cpp_makefile_star2_O1/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 0x7bb0(%rip), %rsi      # 0xa0c0
leaq 0x7bac(%rip), %rdx      # 0xa0c3
leaq 0x148(%rsp), %rdi
callq 0x85d2
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2e66
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0x2556
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b5e(%rip), %rsi      # 0xa0c4
leaq 0x7b58(%rip), %rdx      # 0xa0c5
leaq 0x20(%rsp), %rdi
callq 0x85d2
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b55(%rip), %rsi      # 0xa0dc
leaq 0x7b4f(%rip), %rdx      # 0xa0dd
movq %rsp, %rdi
callq 0x85d2
movq 0x180(%rsp), %rax
movq -0x8(%rax), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x38cc
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7b07(%rip), %rsi      # 0xa0c6
leaq 0x7b04(%rip), %rdx      # 0xa0ca
leaq 0x68(%rsp), %rdi
callq 0x85d2
leaq 0x168(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2f32
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7ad6(%rip), %rsi      # 0xa0cb
leaq 0x7ad0(%rip), %rdx      # 0xa0cc
leaq 0x48(%rsp), %rdi
callq 0x85d2
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7ab4(%rip), %rsi      # 0xa0cd
leaq 0x7aae(%rip), %rdx      # 0xa0ce
leaq 0x88(%rsp), %rdi
callq 0x85d2
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x38cc
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7b1a(%rip), %rsi      # 0xa174
leaq 0x7b14(%rip), %rdx      # 0xa175
leaq 0x128(%rsp), %rdi
callq 0x85d2
leaq 0x118(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x7a5b(%rip), %rsi      # 0xa0dc
leaq 0x7a55(%rip), %rdx      # 0xa0dd
leaq 0x108(%rsp), %rdi
callq 0x85d2
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x38cc
movq %rbx, %rdi
callq 0x2ff2
movq %rax, %rbx
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x79ff(%rip), %rsi      # 0xa0cf
leaq 0x79fb(%rip), %rdx      # 0xa0d2
leaq 0xe8(%rsp), %rdi
callq 0x85d2
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x79db(%rip), %rsi      # 0xa0d3
leaq 0x79d9(%rip), %rdx      # 0xa0d8
leaq 0xc8(%rsp), %rdi
callq 0x85d2
movq 0x18(%rbx), %rax
movq -0x8(%rax), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x38cc
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2746
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
leaq 0x78(%rsp), %r12
je 0x2768
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x30(%rsp), %r15
je 0x278a
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
leaq 0x58(%rsp), %rbp
je 0x27ac
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x27c9
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x27e0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x27f7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2812
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2829
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x78ab(%rip), %rdx      # 0xa0e7
leaq 0xa8(%rsp), %rdi
movq %rdx, %rsi
callq 0x85d2
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2e66
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x287b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x784c(%rip), %rsi      # 0xa0d9
leaq 0x7846(%rip), %rdx      # 0xa0da
callq 0x85d2
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x7833(%rip), %rsi      # 0xa0db
leaq 0x782e(%rip), %rdx      # 0xa0dd
callq 0x85d2
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rdi
movq %rsp, %rsi
leaq 0x68(%rsp), %rdx
callq 0x38cc
leaq 0x20(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x3114
movq %rax, %r14
leaq 0x48(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x77f0(%rip), %rsi      # 0xa0de
leaq 0x77ec(%rip), %rdx      # 0xa0e1
callq 0x85d2
leaq 0x88(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x77d6(%rip), %rsi      # 0xa0e2
leaq 0x77d2(%rip), %rdx      # 0xa0e5
callq 0x85d2
movq 0x18(%r14), %rax
movq -0x8(%rax), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x38cc
movq 0x8(%r14), %rbx
movq $0x0, 0x8(%r14)
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x295b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2972
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x2989
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x29a4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x316e
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xb611(%rip), %rdi      # 0xdfd0
callq 0x21e0
leaq 0x771b(%rip), %rsi      # 0xa0e6
movl $0x1, %edx
movq %rax, %rdi
callq 0x21e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x29f3
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 0x33c4
leaq 0x168(%rsp), %rdi
callq 0x33c4
movq %r15, (%rbx)
leaq 0x76c8(%rip), %rsi      # 0xa0e8
leaq 0x76ca(%rip), %rdx      # 0xa0f1
leaq 0x20(%rsp), %rdi
callq 0x85d2
movq 0xb5a8(%rip), %rdi      # 0xdfe0
leaq 0x20(%rsp), %rsi
callq 0x2220
movl $0x5, %ebx
leaq 0x7699(%rip), %r15      # 0xa0e7
leaq 0x168(%rsp), %rbp
leaq 0x7695(%rip), %r14      # 0xa0f2
leaq 0x7682(%rip), %r12      # 0xa0e6
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x85d2
leaq 0xb246(%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 0x3c1e
leaq 0xb22e(%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 0x2af1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
callq 0x2240
movq %rax, %r13
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x33fa
callq 0x2240
subq %r13, %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0xb499(%rip), %rdi      # 0xdfd0
callq 0x2160
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21e0
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21e0
movq %rbp, %rdi
callq 0x36c8
decl %ebx
jne 0x2a64
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b8b
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 0x2e0a
jmp 0x2cdc
jmp 0x2bff
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x2bd0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2bd0
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2cec
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2cec
jmp 0x2ce9
jmp 0x2ce4
movq %rax, %rbx
jmp 0x2d23
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2dfb
movq 0xb8(%rsp), %rsi
jmp 0x2df3
jmp 0x2cb3
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c52
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2c52
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d35
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2d35
jmp 0x2d32
movq %rax, %rbx
jmp 0x2d52
jmp 0x2c87
movq %rax, %rbx
jmp 0x2d6f
movq %rax, %rbx
jmp 0x2d8c
jmp 0x2c99
movq %rax, %rbx
jmp 0x2da8
jmp 0x2ca3
movq %rax, %rbx
jmp 0x2dc4
movq %rax, %rbx
jmp 0x2ddf
movq %rax, %rbx
jmp 0x2dfb
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e5d
movq 0x158(%rsp), %rsi
jmp 0x2e55
movq %rax, %rbx
jmp 0x2e5d
movq %rax, %rbx
jmp 0x2d08
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2d08
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d23
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x20(%rsp), %rdi
callq 0x33c4
jmp 0x2dfb
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2d52
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d6f
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d8c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2da8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2dc4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2ddf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2dfb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x168(%rsp), %rdi
callq 0x33c4
jmp 0x2e5d
movq %rax, %rbx
jmp 0x2e41
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2e41
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2e41
jmp 0x2e31
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x36c8
leaq 0x30(%rsp), %rax
movq 0x20(%rsp), %rdi
cmpq %rax, %rdi
je 0x2e5d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22d0
nop