// File: /workspace/github_cpp_makefile_star2_O2/killwing[P]PTree/test.cpp
// Function: main
int main() {
    PTree<string> pt;    

    // normal get
    string name("Alice");
    pt.put("person.name", name);
    string nameOut = pt.get("person.name"); // assignment syntax
    assert(name == nameOut);
    string nameEx(pt.get<string>("person.name")); // explicit syntax, need convert explicitly
    assert(name == nameEx);
    assert(pt.isValidPath("person.name"));

    // const get
    const PTree<string>& cpt = pt;
    string nameOutC = cpt.get("person.name");
    assert(name == nameOutC);
    string nameExC;
    nameExC = cpt.get<string>("person.name");
    assert(name == nameExC);
    const string& nameRefC = cpt.get("person.name");
    assert(name == nameRefC);

    // ref get
    string& nameRef = pt.get("person.name");
    nameRef = "Bob";
    nameOut = pt.get<string>("person.name");
    assert(nameRef == nameOut);

    // other types
    int age = 25;
    pt.put("person.age", age);
    int ageOut(pt.get("person.age"));
    assert(age == ageOut);

    float height = 1.65;
    pt.put("person.height", height);
    float heightOut(pt.get("person.height"));
    assert(height == heightOut);

    Car car;
    car.color = "black";
    car.price = 50000;
    pt.put("person.car", car);
    Car carOut(pt.get("person.car"));
    assert(car.color == carOut.color);
    assert(car.price == carOut.price);

    // push as vector
    int income = 100;
    pt.push("person.deposit", income++);
    pt.push("person.deposit", income++);
    pt.push("person.deposit", income++);
    const std::vector<int>& sum = pt.get("person.deposit");
    assert(sum.size() == 3);

    // del
    string error;
    pt.del("person.name");
    try {
        pt.get("person.name");
    } catch (const PTreeError& e) {
        error = e.what();
        cout << "catched PTreeError: " << error << endl;
    }
    assert(!error.empty());
    assert(!pt.isValidPath("person.name"));

    cout << "all test passed" << endl;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
leaq 0x18(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x3c0d(%rip), %rsi      # 0x6004
leaq 0x90(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x2fe0
leaq 0x3bfa(%rip), %rsi      # 0x600a
leaq 0x7e8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x7e8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x301c
leaq 0x7e8(%rsp), %rdi
callq 0x4050
leaq 0x3bbf(%rip), %rsi      # 0x600a
leaq 0x798(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x798(%rsp), %rsi
callq 0x31d4
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x334e
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x21f0
leaq 0x798(%rsp), %rdi
callq 0x4050
leaq 0x90(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x33dc
testb %al, %al
je 0x2ba2
leaq 0x3b52(%rip), %rsi      # 0x600a
leaq 0x748(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x748(%rsp), %rsi
callq 0x3406
leaq 0x138(%rsp), %rdi
movq %rax, %rsi
callq 0x21f0
leaq 0x748(%rsp), %rdi
callq 0x4050
leaq 0x90(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x33dc
testb %al, %al
je 0x2bbe
leaq 0x3af2(%rip), %rsi      # 0x600a
leaq 0x6f8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x6f8(%rsp), %rsi
callq 0x3460
testb %al, %al
je 0x2bda
leaq 0x6f8(%rsp), %rdi
callq 0x4050
leaq 0x3ab7(%rip), %rsi      # 0x600a
leaq 0x6a8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x6a8(%rsp), %rsi
callq 0x3512
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x368c
leaq 0x118(%rsp), %rdi
movq %rax, %rsi
callq 0x21f0
leaq 0x6a8(%rsp), %rdi
callq 0x4050
leaq 0x90(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x33dc
testb %al, %al
je 0x2bf6
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x3a36(%rip), %rsi      # 0x600a
leaq 0x658(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x658(%rsp), %rsi
callq 0x371a
leaq 0xd0(%rsp), %rdi
movq %rax, %rsi
callq 0x20e0
leaq 0x658(%rsp), %rdi
callq 0x4050
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x33dc
testb %al, %al
je 0x2c12
leaq 0x39d6(%rip), %rsi      # 0x600a
leaq 0x608(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x608(%rsp), %rsi
callq 0x3512
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x3774
movq %rax, %rbx
leaq 0x608(%rsp), %rdi
callq 0x4050
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x33dc
testb %al, %al
je 0x2c2e
leaq 0x397b(%rip), %rsi      # 0x600a
leaq 0x5b8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x5b8(%rsp), %rsi
callq 0x31d4
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x334e
movq %rax, %rbx
leaq 0x5b8(%rsp), %rdi
callq 0x4050
leaq 0x39a9(%rip), %rsi      # 0x607b
movq %rbx, %rdi
callq 0x2280
leaq 0x3929(%rip), %rsi      # 0x600a
leaq 0x568(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x568(%rsp), %rsi
callq 0x3406
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x20e0
leaq 0x568(%rsp), %rdi
callq 0x4050
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x33dc
testb %al, %al
je 0x2c4a
movl $0x19, 0xc(%rsp)
leaq 0x394e(%rip), %rsi      # 0x6092
leaq 0x518(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x518(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x3802
leaq 0x518(%rsp), %rdi
callq 0x4050
leaq 0x3916(%rip), %rsi      # 0x6092
leaq 0x4c8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x31d4
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x393a
movl (%rax), %ebx
leaq 0x4c8(%rsp), %rdi
callq 0x4050
cmpl %ebx, 0xc(%rsp)
jne 0x2c66
movl $0x3fd33333, 0x8(%rsp)  # imm = 0x3FD33333
leaq 0x38db(%rip), %rsi      # 0x60ab
leaq 0x478(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x478(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x39c8
leaq 0x478(%rsp), %rdi
callq 0x4050
leaq 0x38a3(%rip), %rsi      # 0x60ab
leaq 0x428(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0x31d4
leaq 0x48(%rsp), %rdi
movq %rax, (%rdi)
callq 0x3b00
movss (%rax), %xmm0
movss %xmm0, 0x44(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x4050
movss 0x8(%rsp), %xmm0
ucomiss 0x44(%rsp), %xmm0
jne 0x2c82
jp 0x2c82
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x3853(%rip), %rsi      # 0x60cd
leaq 0x48(%rsp), %rdi
callq 0x2280
movl $0xc350, 0x68(%rsp)     # imm = 0xC350
leaq 0x3840(%rip), %rsi      # 0x60d3
leaq 0x3d8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x3b8e
leaq 0x3d8(%rsp), %rdi
callq 0x4050
leaq 0x3808(%rip), %rsi      # 0x60d3
leaq 0x388(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x31d4
leaq 0x70(%rsp), %rdi
movq %rax, (%rdi)
callq 0x3cc6
leaq 0xf0(%rsp), %rdi
movq %rax, %rsi
callq 0x3d54
leaq 0x388(%rsp), %rdi
callq 0x4050
leaq 0x48(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x33dc
testb %al, %al
je 0x2c9b
movl 0x68(%rsp), %eax
cmpl 0x110(%rsp), %eax
jne 0x2cb4
leaq 0x37cc(%rip), %rsi      # 0x6112
leaq 0x338(%rsp), %rdi
callq 0x3154
leaq 0x70(%rsp), %rdx
movl $0x64, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x338(%rsp), %rsi
callq 0x3d72
leaq 0x338(%rsp), %rdi
callq 0x4050
leaq 0x378e(%rip), %rsi      # 0x6112
leaq 0x2e8(%rsp), %rdi
callq 0x3154
leaq 0x70(%rsp), %rdx
movl $0x65, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x3d72
leaq 0x2e8(%rsp), %rdi
callq 0x4050
leaq 0x3750(%rip), %rsi      # 0x6112
leaq 0x298(%rsp), %rdi
callq 0x3154
leaq 0x70(%rsp), %rdx
movl $0x66, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x3d72
leaq 0x298(%rsp), %rdi
callq 0x4050
leaq 0x3712(%rip), %rsi      # 0x6112
leaq 0x248(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x31d4
leaq 0x70(%rsp), %rdi
movq %rax, (%rdi)
callq 0x3f02
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
callq 0x4050
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cmpq $0xc, %rax
jne 0x2ccd
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x35a2(%rip), %rsi      # 0x600a
leaq 0x1f8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0x3f90
leaq 0x1f8(%rsp), %rdi
callq 0x4050
leaq 0x356f(%rip), %rsi      # 0x600a
leaq 0x1a8(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x31d4
leaq 0x1a8(%rsp), %rdi
callq 0x4050
cmpq $0x0, 0x78(%rsp)
je 0x2ce6
leaq 0x3530(%rip), %rsi      # 0x600a
leaq 0x158(%rsp), %rdi
callq 0x3154
leaq 0x10(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x3460
testb %al, %al
jne 0x2cff
leaq 0x158(%rsp), %rdi
callq 0x4050
movq 0x84bb(%rip), %rdi      # 0xafd0
leaq 0x3658(%rip), %rsi      # 0x6174
callq 0x2180
movq %rax, %rdi
callq 0x20b0
leaq 0x70(%rsp), %rdi
callq 0x20a0
leaq 0xf0(%rsp), %rdi
callq 0x20a0
leaq 0x48(%rsp), %rdi
callq 0x20a0
leaq 0xd0(%rsp), %rdi
callq 0x20a0
leaq 0x118(%rsp), %rdi
callq 0x20a0
leaq 0x138(%rsp), %rdi
callq 0x20a0
leaq 0xb0(%rsp), %rdi
callq 0x20a0
leaq 0x90(%rsp), %rdi
callq 0x20a0
leaq 0x10(%rsp), %rdi
callq 0x41a2
xorl %eax, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r14
retq
leaq 0x346d(%rip), %rdi      # 0x6016
leaq 0x3476(%rip), %rsi      # 0x6026
leaq 0x3478(%rip), %rcx      # 0x602f
pushq $0x14
jmp 0x2d16
leaq 0x3475(%rip), %rdi      # 0x603a
leaq 0x345a(%rip), %rsi      # 0x6026
leaq 0x345c(%rip), %rcx      # 0x602f
pushq $0x16
jmp 0x2d16
leaq 0x3575(%rip), %rdi      # 0x6156
leaq 0x343e(%rip), %rsi      # 0x6026
leaq 0x3440(%rip), %rcx      # 0x602f
pushq $0x17
jmp 0x2d16
leaq 0x344c(%rip), %rdi      # 0x6049
leaq 0x3422(%rip), %rsi      # 0x6026
leaq 0x3424(%rip), %rcx      # 0x602f
pushq $0x1c
jmp 0x2d16
leaq 0x3441(%rip), %rdi      # 0x605a
leaq 0x3406(%rip), %rsi      # 0x6026
leaq 0x3408(%rip), %rcx      # 0x602f
pushq $0x1f
jmp 0x2d16
leaq 0x3435(%rip), %rdi      # 0x606a
leaq 0x33ea(%rip), %rsi      # 0x6026
leaq 0x33ec(%rip), %rcx      # 0x602f
pushq $0x21
jmp 0x2d16
leaq 0x342e(%rip), %rdi      # 0x607f
leaq 0x33ce(%rip), %rsi      # 0x6026
leaq 0x33d0(%rip), %rcx      # 0x602f
pushq $0x27
jmp 0x2d16
leaq 0x3430(%rip), %rdi      # 0x609d
leaq 0x33b2(%rip), %rsi      # 0x6026
leaq 0x33b4(%rip), %rcx      # 0x602f
pushq $0x2d
jmp 0x2d16
leaq 0x3430(%rip), %rdi      # 0x60b9
leaq 0x3396(%rip), %rsi      # 0x6026
leaq 0x3398(%rip), %rcx      # 0x602f
pushq $0x32
jmp 0x2d16
leaq 0x343c(%rip), %rdi      # 0x60de
leaq 0x337d(%rip), %rsi      # 0x6026
leaq 0x337f(%rip), %rcx      # 0x602f
pushq $0x39
jmp 0x2d16
leaq 0x343d(%rip), %rdi      # 0x60f8
leaq 0x3364(%rip), %rsi      # 0x6026
leaq 0x3366(%rip), %rcx      # 0x602f
pushq $0x3a
jmp 0x2d16
leaq 0x344d(%rip), %rdi      # 0x6121
leaq 0x334b(%rip), %rsi      # 0x6026
leaq 0x334d(%rip), %rcx      # 0x602f
pushq $0x42
jmp 0x2d16
leaq 0x3459(%rip), %rdi      # 0x6146
leaq 0x3332(%rip), %rsi      # 0x6026
leaq 0x3334(%rip), %rcx      # 0x602f
pushq $0x4d
jmp 0x2d16
leaq 0x344f(%rip), %rdi      # 0x6155
leaq 0x3319(%rip), %rsi      # 0x6026
leaq 0x331b(%rip), %rcx      # 0x602f
pushq $0x4e
popq %rdx
callq 0x2100
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x2dc6
movq %rdx, %r14
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x4050
jmp 0x2d47
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x2f6c
movq %rbx, %rdi
callq 0x2070
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x2280
movq 0x825a(%rip), %rdi      # 0xafd0
leaq 0x33b4(%rip), %rsi      # 0x6131
callq 0x2180
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20b0
callq 0x2240
jmp 0x2ac7
jmp 0x2f69
movq %rax, %rbx
callq 0x2240
jmp 0x2f6c
movq %rax, %rdi
callq 0x4044
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
callq 0x4050
jmp 0x2f6c
jmp 0x2f2e
movq %rax, %rbx
leaq 0x298(%rsp), %rdi
jmp 0x2eac
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
jmp 0x2eac
movq %rax, %rbx
leaq 0x338(%rsp), %rdi
jmp 0x2eac
jmp 0x2eb6
movq %rax, %rbx
leaq 0x3d8(%rsp), %rdi
jmp 0x2f3e
jmp 0x2ee5
movq %rax, %rbx
leaq 0x478(%rsp), %rdi
jmp 0x2f12
jmp 0x2ee5
jmp 0x2ee5
movq %rax, %rbx
leaq 0x518(%rsp), %rdi
jmp 0x2f12
jmp 0x2ee5
jmp 0x2ee5
jmp 0x2ee5
jmp 0x2ee5
jmp 0x2e6f
movq %rax, %rbx
leaq 0x6f8(%rsp), %rdi
jmp 0x2f50
movq %rax, %rbx
jmp 0x2fa7
movq %rax, %rbx
jmp 0x2fb4
jmp 0x2e91
movq %rax, %rbx
leaq 0x7e8(%rsp), %rdi
jmp 0x2f62
movq %rax, %rbx
jmp 0x2fc1
movq %rax, %rbx
jmp 0x2fce
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
callq 0x4050
jmp 0x2f76
movq %rax, %rbx
jmp 0x2f83
movq %rax, %rbx
leaq 0x428(%rsp), %rdi
jmp 0x2f12
movq %rax, %rbx
leaq 0x4c8(%rsp), %rdi
jmp 0x2f12
movq %rax, %rbx
leaq 0x568(%rsp), %rdi
jmp 0x2f12
movq %rax, %rbx
jmp 0x2f8d
movq %rax, %rbx
leaq 0x5b8(%rsp), %rdi
jmp 0x2f12
movq %rax, %rbx
leaq 0x608(%rsp), %rdi
jmp 0x2f12
movq %rax, %rbx
leaq 0x658(%rsp), %rdi
callq 0x4050
jmp 0x2f8d
movq %rax, %rbx
leaq 0x748(%rsp), %rdi
callq 0x4050
jmp 0x2fb4
movq %rax, %rbx
jmp 0x2f76
movq %rax, %rbx
leaq 0x388(%rsp), %rdi
callq 0x4050
jmp 0x2f83
movq %rax, %rbx
leaq 0x6a8(%rsp), %rdi
callq 0x4050
jmp 0x2fa7
movq %rax, %rbx
leaq 0x798(%rsp), %rdi
callq 0x4050
jmp 0x2fc1
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x20a0
leaq 0xf0(%rsp), %rdi
callq 0x20a0
leaq 0x48(%rsp), %rdi
callq 0x20a0
leaq 0xd0(%rsp), %rdi
callq 0x20a0
leaq 0x118(%rsp), %rdi
callq 0x20a0
leaq 0x138(%rsp), %rdi
callq 0x20a0
leaq 0xb0(%rsp), %rdi
callq 0x20a0
leaq 0x90(%rsp), %rdi
callq 0x20a0
leaq 0x10(%rsp), %rdi
callq 0x41a2
movq %rbx, %rdi
callq 0x2260