// File: /workspace/github_cpp_makefile_star2_O2/snawaz[P]cson/test.cpp
// Function: main
int main()
{
	using namespace test;

	auto x = cson
	(
	 	name = "Rafi", 
		age = 55,
		dict = cson
		(
			name = 1947, 
			age = "The type of age is deduced now which is std::string", 
			fun = [](std::string const & name) { std::cout << "Hello " << name << std::endl; },
			items = {"Shaan", "udit", "Sonu"}
		),
		fun = {1,2,3,4}, 
		work = "Singing"
	);

	x.dict.fun("Sarfaraz Nawaz");

	std::cout << x.name << "," << x.age <<"," << x.work << std::endl;
	x.name="Mukesh";
	x.age++; //well it is int
	std::cout << x.name << "," << x.age <<"," << x.work << std::endl;

	std::cout << x << std::endl;
	std::cout << x[work] << std::endl;

	std::cout << x[dict][age] << std::endl;
	std::cout << x.dict[age] << std::endl;
	std::cout << x[dict].age << std::endl;

	for(auto const & key : x.keys()) {
		std::cout << "key => " << key << std::endl;
    }

    std::cout << "---- iterate using .for_each ----" << std::endl;
    // we can also iterate over keys and values, but for that we have to
    // use .for_each() method passing a generic lambda (requires C++14 or above)
    auto printable_values = cson(
        name = "Rafi",
		age = 55,
		dict = cson
		(
			name = 1947,
			age = "The type of age is deduced now which is std::string"
		),
		work = "Singing"
	);

    printable_values.for_each([](std::string const & key, auto && value) {
        // note: in each iteration the type of 'value' could be different, which is why it's declared to be `auto`
        std::cout << key << " : " << value << std::endl;
    });
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
leaq 0x5deb(%rip), %rsi      # 0x70f2
leaq 0x2d12(%rip), %rdx      # 0x4020
leaq -0x70(%rbp), %rdi
callq 0x202c
leaq 0x5dd5(%rip), %rsi      # 0x70f3
leaq 0x2d00(%rip), %rdx      # 0x4025
leaq -0x90(%rbp), %rdi
callq 0x204e
movq 0x5a78(%rip), %rax      # 0x6db0
leaq -0x270(%rbp), %rdx
movq %rax, 0x10(%rdx)
movups 0x5a56(%rip), %xmm0     # 0x6da0
movaps %xmm0, (%rdx)
leaq 0x5da3(%rip), %rsi      # 0x70f7
leaq -0x1b0(%rbp), %rdi
pushq $0x3
popq %rcx
callq 0x2070
leaq -0xd0(%rbp), %rsi
movl $0x79b, -0x8(%rsi)      # imm = 0x79B
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x139d
movq %rdx, -0xd0(%rbp)
movq -0x80(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
jmp 0x13a3
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq -0x88(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq %rax, -0x90(%rbp)
andq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movups -0x1a8(%rbp), %xmm0
movups %xmm0, -0xa0(%rbp)
andq $0x0, -0x1a0(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x1b0(%rbp)
leaq -0x170(%rbp), %r14
movl $0x79b, -0x8(%r14)      # imm = 0x79B
movq %r14, %rdi
callq 0x1120
leaq -0xa8(%rbp), %rsi
movb -0x8(%rsi), %al
leaq -0x148(%rbp), %rbx
movb %al, -0x8(%rbx)
movq %rbx, %rdi
callq 0x25c0
movaps 0x2be4(%rip), %xmm0     # 0x4010
leaq -0x280(%rbp), %rdx
movups %xmm0, (%rdx)
leaq 0x5cb9(%rip), %rsi      # 0x70f6
leaq -0x190(%rbp), %rdi
pushq $0x4
popq %rcx
callq 0x2112
leaq 0x5ca1(%rip), %rsi      # 0x70f4
leaq 0x2c0f(%rip), %rdx      # 0x4069
leaq -0x48(%rbp), %rdi
callq 0x21b4
leaq -0x248(%rbp), %rcx
movq %rcx, -0x10(%rcx)
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x148f
movq %rdx, -0x258(%rbp)
movq -0x60(%rbp), %rcx
movq %rcx, -0x248(%rbp)
jmp 0x1495
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq -0x68(%rbp), %rcx
leaq -0x218(%rbp), %rdx
movq %rcx, -0x38(%rdx)
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
movl $0x37, -0x20(%rdx)
leaq -0x160(%rbp), %rcx
movl -0x18(%rcx), %eax
movl %eax, -0x18(%rdx)
movq %rdx, -0x10(%rdx)
movq -0x10(%rcx), %rax
cmpq %rcx, %rax
je 0x14e9
movq %rax, -0x228(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0x218(%rbp)
jmp 0x14ef
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq -0x168(%rbp), %rdx
leaq -0x1c0(%rbp), %rax
movq %rdx, -0x60(%rax)
movq %rcx, -0x170(%rbp)
andq $0x0, -0x168(%rbp)
movb $0x0, -0x160(%rbp)
movb -0x150(%rbp), %cl
movb %cl, -0x48(%rax)
movq -0x148(%rbp), %rcx
movq %rcx, -0x40(%rax)
movups -0x140(%rbp), %xmm0
movups %xmm0, -0x38(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq -0x190(%rbp), %rcx
movq %rcx, -0x28(%rax)
movups -0x188(%rbp), %xmm1
movups %xmm1, -0x20(%rax)
movaps %xmm0, -0x190(%rbp)
andq $0x0, -0x180(%rbp)
movq %rax, -0x10(%rax)
leaq -0x38(%rbp), %r12
movq -0x10(%r12), %rcx
cmpq %r12, %rcx
je 0x158c
movq %rcx, -0x1d0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x1c0(%rbp)
jmp 0x1594
movups (%r12), %xmm0
movups %xmm0, (%rax)
leaq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, -0x1c8(%rbp)
movq %r12, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
callq 0x1070
leaq -0x190(%rbp), %rdi
callq 0x223a
leaq -0x178(%rbp), %rdi
callq 0x1f6e
leaq -0xd8(%rbp), %rdi
callq 0x1f6e
leaq -0x1b0(%rbp), %rdi
callq 0x21d6
leaq -0x90(%rbp), %rdi
callq 0x1070
leaq -0x70(%rbp), %rdi
callq 0x1070
leaq 0x2a71(%rip), %rsi      # 0x4071
leaq -0x178(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x1050
movq 0x59be(%rip), %rdi      # 0x6fd8
leaq 0x2a92(%rip), %rsi      # 0x40b3
callq 0x10d0
leaq -0x178(%rbp), %rsi
movq %rax, %rdi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x5988(%rip), %rdi      # 0x6fd8
leaq -0x258(%rbp), %rsi
callq 0x10c0
leaq 0x2a1d(%rip), %rsi      # 0x4080
movq %rax, %rdi
callq 0x10d0
movl -0x238(%rbp), %esi
movq %rax, %rdi
callq 0x1180
leaq 0x2a00(%rip), %rsi      # 0x4080
movq %rax, %rdi
callq 0x10d0
leaq -0x1d0(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
leaq 0x29d9(%rip), %rsi      # 0x4082
leaq -0x258(%rbp), %rdi
callq 0x11a0
leaq -0x258(%rbp), %rsi
incl 0x20(%rsi)
movq 0x5912(%rip), %rdi      # 0x6fd8
callq 0x10c0
leaq 0x29ae(%rip), %rsi      # 0x4080
movq %rax, %rdi
callq 0x10d0
movl -0x238(%rbp), %esi
movq %rax, %rdi
callq 0x1180
leaq 0x2991(%rip), %rsi      # 0x4080
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
movq 0x58c7(%rip), %rdi      # 0x6fd8
leaq 0x29cc(%rip), %rsi      # 0x40e4
callq 0x10d0
movq 0x58b4(%rip), %rdi      # 0x6fd8
leaq 0x29bf(%rip), %rsi      # 0x40ea
callq 0x10d0
movq %rax, %r14
leaq -0x168(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x178(%rbp), %rdi
pushq $0x20
popq %rdx
xorl %esi, %esi
callq 0x1100
leaq -0x178(%rbp), %rsi
movq %r14, %rdi
callq 0x10c0
leaq 0x2984(%rip), %rsi      # 0x40e9
movq %rax, %rdi
callq 0x10d0
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x5858(%rip), %rdi      # 0x6fd8
leaq -0x258(%rbp), %rsi
pushq $0x4
popq %rdx
callq 0x28c2
leaq -0x238(%rbp), %rsi
movq 0x583b(%rip), %rdi      # 0x6fd8
pushq $0x4
popq %rdx
callq 0x2986
leaq -0x178(%rbp), %rdi
movq %r13, (%rdi)
pushq $0x4
popq %rsi
pushq $0x20
popq %rdx
callq 0x1100
movq 0x5817(%rip), %rdi      # 0x6fd8
leaq -0x178(%rbp), %rsi
callq 0x10c0
movq %rax, %r14
leaq -0xd8(%rbp), %rdi
callq 0x1fc8
leaq -0xd8(%rbp), %rsi
movq %r14, %rdi
callq 0x10c0
leaq 0x28fc(%rip), %rsi      # 0x40ee
movq %rax, %rdi
callq 0x10d0
leaq -0xd8(%rbp), %rdi
callq 0x1070
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x57bf(%rip), %rdi      # 0x6fd8
leaq 0x28ca(%rip), %rsi      # 0x40ea
callq 0x10d0
movq %rax, %r14
leaq -0x178(%rbp), %rdi
movq %r13, (%rdi)
pushq $0x4
popq %rsi
pushq $0x20
popq %rdx
callq 0x1100
leaq -0x178(%rbp), %rsi
movq %r14, %rdi
callq 0x10c0
leaq 0x2896(%rip), %rsi      # 0x40e9
movq %rax, %rdi
callq 0x10d0
leaq -0x230(%rbp), %r14
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x5763(%rip), %rdi      # 0x6fd8
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x2c4c
leaq -0x228(%rbp), %r14
movq 0x574a(%rip), %rdi      # 0x6fd8
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x2d10
leaq -0x178(%rbp), %rdi
movq %r13, (%rdi)
pushq $0x8
popq %rsi
pushq $0x20
popq %rdx
callq 0x1100
movq 0x5723(%rip), %rdi      # 0x6fd8
leaq -0x178(%rbp), %rsi
callq 0x10c0
movq %rax, %r15
leaq 0x2835(%rip), %rsi      # 0x4100
leaq -0xd8(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x1050
leaq -0xd8(%rbp), %rsi
movq %r15, %rdi
callq 0x10c0
leaq 0x27fd(%rip), %rsi      # 0x40ee
movq %rax, %rdi
callq 0x10d0
leaq -0xd8(%rbp), %rdi
callq 0x1070
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x56c0(%rip), %rdi      # 0x6fd8
pushq $0x1
popq %rsi
callq 0x1170
leaq 0x2759(%rip), %rsi      # 0x4080
movq %rax, %rdi
callq 0x10d0
movq 0x56a2(%rip), %rdi      # 0x6fd8
leaq 0x27ad(%rip), %rsi      # 0x40ea
callq 0x10d0
leaq -0x200(%rbp), %rsi
movq 0x5688(%rip), %rdi      # 0x6fd8
pushq $0x8
popq %rdx
callq 0x2dd4
leaq -0x178(%rbp), %rdi
movq %r13, (%rdi)
pushq $0x4
popq %rsi
pushq $0x20
popq %rdx
callq 0x1100
movq 0x5664(%rip), %rdi      # 0x6fd8
leaq -0x178(%rbp), %rsi
callq 0x10c0
leaq 0x2765(%rip), %rsi      # 0x40ec
movq %rax, %rdi
callq 0x10d0
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x5636(%rip), %rdi      # 0x6fd8
leaq 0x2741(%rip), %rsi      # 0x40ea
callq 0x10d0
leaq -0x1e8(%rbp), %rsi
movq 0x561c(%rip), %rdi      # 0x6fd8
pushq $0x4
popq %rdx
callq 0x2a4a
movq 0x560d(%rip), %rdi      # 0x6fd8
pushq $0x4
popq %rdx
movq %rbx, %rsi
callq 0x2b0e
leaq -0x178(%rbp), %rdi
movq %r13, (%rdi)
pushq $0x20
popq %rdx
xorl %esi, %esi
callq 0x1100
movq 0x55e7(%rip), %rdi      # 0x6fd8
leaq -0x178(%rbp), %rsi
callq 0x10c0
leaq 0x26e8(%rip), %rsi      # 0x40ec
movq %rax, %rdi
callq 0x10d0
leaq -0x178(%rbp), %rdi
callq 0x1070
movq 0x55b9(%rip), %rdi      # 0x6fd8
leaq 0x26c4(%rip), %rsi      # 0x40ea
callq 0x10d0
movq %rax, %rdi
callq 0x1080
movq 0x559e(%rip), %rdi      # 0x6fd8
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
movq 0x5587(%rip), %rdi      # 0x6fd8
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
movq 0x5570(%rip), %rdi      # 0x6fd8
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
movq 0x5559(%rip), %rdi      # 0x6fd8
movq %r14, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
leaq -0x178(%rbp), %r14
movq %r14, %rdi
callq 0x2bd2
leaq -0x158(%rbp), %r15
movq %r15, %rdi
callq 0x2c0e
leaq -0x138(%rbp), %r15
movq %r15, %rdi
callq 0x1fc8
leaq -0x118(%rbp), %r15
movq %r15, %rdi
callq 0x2f78
leaq -0xf8(%rbp), %r15
movq %r15, %rdi
callq 0x300a
leaq -0xd8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
pushq $0x5
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x302e
movl $0x80, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x178, %rdi           # imm = 0xFE88
callq 0x1070
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x1af9
movq -0xd8(%rbp), %rbx
movq -0xd0(%rbp), %r13
movq 0x54b0(%rip), %r14      # 0x6fd8
leaq 0x255a(%rip), %r15      # 0x4089
cmpq %r13, %rbx
je 0x1b58
movq %r14, %rdi
movq %r15, %rsi
callq 0x10d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1080
addq $0x20, %rbx
jmp 0x1b2f
leaq -0xd8(%rbp), %rdi
callq 0x21d6
movq 0x546d(%rip), %rdi      # 0x6fd8
leaq 0x251f(%rip), %rsi      # 0x4091
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x556c(%rip), %rsi      # 0x70f2
leaq 0x2493(%rip), %rdx      # 0x4020
leaq -0x90(%rbp), %rdi
callq 0x202c
movl $0x37, -0x270(%rbp)
leaq 0x5549(%rip), %rsi      # 0x70f3
leaq 0x2474(%rip), %rdx      # 0x4025
leaq -0x48(%rbp), %rdi
callq 0x204e
leaq -0x58(%rbp), %rax
movl $0x79b, -0x18(%rax)     # imm = 0x79B
movq %rax, -0x10(%rax)
movq -0x48(%rbp), %rcx
cmpq %r12, %rcx
je 0x1be0
movq %rcx, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x1be8
movups (%r12), %xmm0
movups %xmm0, (%rax)
leaq -0x68(%rbp), %r14
movq -0x40(%rbp), %rax
movq %rax, 0x8(%r14)
movq %r12, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x314e
leaq 0x54dc(%rip), %rsi      # 0x70f4
leaq 0x244a(%rip), %rdx      # 0x4069
leaq -0x1b0(%rbp), %rdi
callq 0x21b4
leaq -0x178(%rbp), %rdi
leaq -0x90(%rbp), %rbx
leaq -0x270(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
leaq -0x1b0(%rbp), %r15
movq %rbx, %rsi
movq %r15, %r8
callq 0x3164
movq %r15, %rdi
callq 0x1070
leaq -0xd0(%rbp), %rdi
callq 0x1070
movq %r14, %rdi
callq 0x1070
leaq -0x48(%rbp), %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1070
leaq -0xd8(%rbp), %rdi
callq 0x2bd2
leaq -0xd8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x1fec
leaq -0x70(%rbp), %rdi
callq 0x2c0e
movq 0x5323(%rip), %rdi      # 0x6fd8
leaq -0x70(%rbp), %rsi
callq 0x10c0
leaq 0x2429(%rip), %rsi      # 0x40ee
movq %rax, %rdi
callq 0x10d0
movl -0x158(%rbp), %esi
movq %rax, %rdi
callq 0x1180
movq %rax, %rdi
callq 0x1080
leaq -0x90(%rbp), %rdi
callq 0x31c2
movq 0x52e2(%rip), %rdi      # 0x6fd8
leaq -0x90(%rbp), %rsi
callq 0x10c0
leaq 0x23e5(%rip), %rsi      # 0x40ee
movq %rax, %rdi
callq 0x10d0
leaq -0x150(%rbp), %rsi
movq %rax, %rdi
callq 0x31e5
movq %rax, %rdi
callq 0x1080
leaq -0x48(%rbp), %rdi
callq 0x300a
leaq -0x128(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x1fec
leaq -0x48(%rbp), %rdi
callq 0x1070
leaq -0x90(%rbp), %rdi
callq 0x1070
leaq -0x70(%rbp), %rdi
callq 0x1070
leaq -0xd8(%rbp), %rdi
callq 0x1070
leaq -0x178(%rbp), %rdi
callq 0x2202
leaq -0x258(%rbp), %rdi
callq 0x1f92
xorl %eax, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x1070
jmp 0x1efb
jmp 0x1ef8
jmp 0x1f09
jmp 0x1db4
movq %rax, %rbx
jmp 0x1f15
movq %rax, %rbx
jmp 0x1f21
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x1070
jmp 0x1dd8
movq %rax, %rbx
movq %r14, %rdi
callq 0x1070
leaq -0x48(%rbp), %rdi
callq 0x1070
jmp 0x1dee
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
jmp 0x1ef1
jmp 0x1f45
movq %rax, %rbx
movl $0x80, %r14d
leaq (%r14,%rbp), %rdi
addq $-0x178, %rdi           # imm = 0xFE88
callq 0x1070
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x1e08
jmp 0x1f59
jmp 0x1f45
jmp 0x1f45
jmp 0x1f45
jmp 0x1ee7
jmp 0x1ee7
jmp 0x1f45
jmp 0x1ee7
jmp 0x1ee7
jmp 0x1f45
jmp 0x1f45
jmp 0x1f45
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x223a
jmp 0x1e72
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x1f6e
jmp 0x1e90
movq %rax, %rbx
movq %r14, %rdi
callq 0x1070
jmp 0x1e90
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x1f6e
leaq -0x1b0(%rbp), %rdi
callq 0x21d6
jmp 0x1ead
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x1070
leaq -0x70(%rbp), %rdi
callq 0x1070
jmp 0x1f65
movq %rax, %rbx
jmp 0x1eb9
jmp 0x1ee7
jmp 0x1ee7
jmp 0x1ed4
jmp 0x1ee7
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x1070
jmp 0x1eea
jmp 0x1ee7
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x1070
jmp 0x1f59
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x1070
jmp 0x1f0c
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x1070
leaq -0xd8(%rbp), %rdi
callq 0x1070
leaq -0x178(%rbp), %rdi
callq 0x2202
jmp 0x1f59
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x1070
cmpq %r14, %r15
jne 0x1f32
jmp 0x1f59
movq %rax, %rbx
jmp 0x1f59
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x21d6
leaq -0x258(%rbp), %rdi
callq 0x1f92
movq %rbx, %rdi
callq 0x1190
nop