// File: fffrankkk[P]XmlCode/src/Main.cpp
// Function: CMain::Src(std::vector<CClassDetail*, std::allocator<CClassDetail*>>&, CClassDetail*)
void CMain::Src(vector<CClassDetail *>& vecDetail, CClassDetail* pCRoot)
{
    ofstream ofsWriter;
    ofsWriter.open("Config.cpp");

    CClassCont CContent;
    string strComment = CContent.GetFileComment("Config.cpp");
    ofsWriter << strComment << endl;

    ofsWriter << "#include \"Config.h\"" << endl;
    ofsWriter << endl;
    ofsWriter << "#include <map>" << endl;
    ofsWriter << endl;
    ofsWriter << "#include <stdlib.h>" << endl;
    ofsWriter << endl;
    ofsWriter << "using std::map;" << endl;
    ofsWriter << endl;
    ofsWriter << "CConfig* CConfig::sm_pCInstance = new CConfig;" << endl;
    ofsWriter << endl;

    pCRoot->SetName("Config");

    for (BT_AUTO(iterDetail, vecDetail.begin()); iterDetail != vecDetail.end(); ++iterDetail) {
        pCRoot->AddChild((*iterDetail)->GetName(), *iterDetail);
    }

    stack<pair<CClassDetail*, string> > staClasses;
    staClasses.push(make_pair(pCRoot, ""));
    vector<pair<CClassDetail*, string> > vecClasses;
    while (!staClasses.empty()) {
        pair<CClassDetail*, string> paiClass = staClasses.top();
        staClasses.pop();

        vecClasses.push_back(paiClass);

        vector<CClassDetail *> vecChildren = paiClass.first->GetChildren();

        string strBase = string("C") + NUtility::First2Up(paiClass.first->GetName());
        if (!paiClass.second.empty()) {
            strBase = paiClass.second + "::" + strBase;
        }

        for (size_t zuCount = 0; zuCount < vecChildren.size(); ++zuCount) {
            staClasses.push(make_pair(vecChildren[zuCount], strBase));
        }
    }

    for (BT_AUTO(iterPair, vecClasses.rbegin()); iterPair != vecClasses.rend(); ++iterPair) {

        vector<string> vecStr = iterPair->first->GenerateConstruct(iterPair->second);
        for (size_t zuCount = 0; zuCount < vecStr.size(); ++zuCount) {
            ofsWriter  << vecStr[zuCount] << endl;
        }

        //if (!iterPair->second.empty()) {
        vector<string> vecParse = iterPair->first->GenerateParse(iterPair->second);
        for (size_t zuCount = 0; zuCount < vecParse.size(); ++zuCount) {
            ofsWriter << vecParse[zuCount] << endl;
        }
        ofsWriter << endl;
        //}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x610, %rsp            # imm = 0x610
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0x56e0
movq -0x530(%rbp), %rdi
leaq 0x259ed(%rip), %rsi     # 0x37125
movl $0x10, %edx
callq 0x5070
jmp 0x11744
leaq -0x260(%rbp), %rdi
callq 0x27a50
jmp 0x11752
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x538(%rbp)
callq 0x5750
movq -0x538(%rbp), %rdx
leaq 0x259b2(%rip), %rsi     # 0x37125
leaq -0x2a0(%rbp), %rdi
callq 0x7a40
jmp 0x11781
leaq -0x280(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
callq 0x283e0
jmp 0x1179d
leaq -0x2a0(%rbp), %rdi
callq 0x5240
leaq -0x2a1(%rbp), %rdi
callq 0x5460
leaq -0x218(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x5340
movq %rax, -0x540(%rbp)
jmp 0x117d1
movq -0x540(%rbp), %rdi
movq 0x397d1(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x117e6
leaq 0x25943(%rip), %rsi     # 0x37130
leaq -0x218(%rbp), %rdi
callq 0x53d0
movq %rax, -0x548(%rbp)
jmp 0x11802
movq -0x548(%rbp), %rdi
movq 0x397a0(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x11817
movq 0x39792(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x1182c
leaq 0x25911(%rip), %rsi     # 0x37144
leaq -0x218(%rbp), %rdi
callq 0x53d0
movq %rax, -0x550(%rbp)
jmp 0x11848
movq -0x550(%rbp), %rdi
movq 0x3975a(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x1185d
movq 0x3974c(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x11872
leaq 0x258da(%rip), %rsi     # 0x37153
leaq -0x218(%rbp), %rdi
callq 0x53d0
movq %rax, -0x558(%rbp)
jmp 0x1188e
movq -0x558(%rbp), %rdi
movq 0x39714(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x118a3
movq 0x39706(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x118b8
leaq 0x258a8(%rip), %rsi     # 0x37167
leaq -0x218(%rbp), %rdi
callq 0x53d0
movq %rax, -0x560(%rbp)
jmp 0x118d4
movq -0x560(%rbp), %rdi
movq 0x396ce(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x118e9
movq 0x396c0(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x118fe
leaq 0x25872(%rip), %rsi     # 0x37177
leaq -0x218(%rbp), %rdi
callq 0x53d0
movq %rax, -0x568(%rbp)
jmp 0x1191a
movq -0x568(%rbp), %rdi
movq 0x39688(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x1192f
movq 0x3967a(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x11944
movq -0x18(%rbp), %rax
movq %rax, -0x578(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x5750
movq -0x570(%rbp), %rdx
leaq 0x25836(%rip), %rsi     # 0x371a6
leaq -0x2c8(%rbp), %rdi
callq 0x7a40
jmp 0x1197e
movq -0x578(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x1acc0
jmp 0x11993
leaq -0x2c8(%rbp), %rdi
callq 0x5240
leaq -0x2c9(%rbp), %rdi
callq 0x5460
movq -0x10(%rbp), %rdi
callq 0xe6c0
movq %rax, -0x2d8(%rbp)
movq -0x10(%rbp), %rdi
callq 0xe550
movq %rax, -0x2e0(%rbp)
leaq -0x2d8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x12430
testb $0x1, %al
jne 0x119e7
jmp 0x11b27
movq -0x18(%rbp), %rax
movq %rax, -0x580(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x12470
movq (%rax), %rsi
leaq -0x300(%rbp), %rdi
callq 0x1acf0
jmp 0x11a0f
leaq -0x2d8(%rbp), %rdi
callq 0x12470
movq -0x580(%rbp), %rdi
movq (%rax), %rdx
leaq -0x300(%rbp), %rsi
callq 0xbf30
jmp 0x11a33
leaq -0x300(%rbp), %rdi
callq 0x5240
leaq -0x2d8(%rbp), %rdi
callq 0x12490
jmp 0x119bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x122ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11a99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x5240
leaq -0x2a1(%rbp), %rdi
callq 0x5460
jmp 0x122a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x12294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11af3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x5240
leaq -0x2c9(%rbp), %rdi
callq 0x5460
jmp 0x12294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x5240
jmp 0x12294
leaq -0x350(%rbp), %rdi
callq 0x124b0
jmp 0x11b35
leaq 0x259ce(%rip), %rsi     # 0x3750a
leaq -0x18(%rbp), %rdi
callq 0x12510
movq %rdx, -0x590(%rbp)
movq %rax, -0x588(%rbp)
jmp 0x11b55
movq -0x590(%rbp), %rax
movq -0x588(%rbp), %rcx
movq %rcx, -0x388(%rbp)
movq %rax, -0x380(%rbp)
leaq -0x378(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x12550
jmp 0x11b86
leaq -0x350(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x124e0
jmp 0x11b9b
leaq -0x378(%rbp), %rdi
callq 0x125d0
leaq -0x3a0(%rbp), %rdi
callq 0x125f0
leaq -0x350(%rbp), %rdi
callq 0x12610
movb %al, -0x591(%rbp)
jmp 0x11bc7
movb -0x591(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x11bd8
jmp 0x11f91
leaq -0x350(%rbp), %rdi
callq 0x12630
movq %rax, -0x5a0(%rbp)
jmp 0x11bed
movq -0x5a0(%rbp), %rsi
leaq -0x3c8(%rbp), %rdi
callq 0x12650
jmp 0x11c02
leaq -0x350(%rbp), %rdi
callq 0x12690
jmp 0x11c10
leaq -0x3a0(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x126b0
jmp 0x11c25
movq -0x3c8(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x1b330
jmp 0x11c3a
leaq -0x421(%rbp), %rdi
movq %rdi, -0x5a8(%rbp)
callq 0x5750
movq -0x5a8(%rbp), %rdx
leaq 0x2572d(%rip), %rsi     # 0x37388
leaq -0x420(%rbp), %rdi
callq 0x7a40
jmp 0x11c69
movq -0x3c8(%rbp), %rsi
leaq -0x468(%rbp), %rdi
callq 0x1acf0
jmp 0x11c7e
leaq -0x448(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0xfaf0
jmp 0x11c93
leaq -0x400(%rbp), %rdi
leaq -0x420(%rbp), %rsi
leaq -0x448(%rbp), %rdx
callq 0x12720
jmp 0x11caf
leaq -0x448(%rbp), %rdi
callq 0x5240
leaq -0x468(%rbp), %rdi
callq 0x5240
leaq -0x420(%rbp), %rdi
callq 0x5240
leaq -0x421(%rbp), %rdi
callq 0x5460
leaq -0x3c8(%rbp), %rdi
addq $0x8, %rdi
callq 0x56c0
testb $0x1, %al
jne 0x11e84
leaq -0x3c0(%rbp), %rsi
leaq 0x254a8(%rip), %rdx     # 0x371ad
leaq -0x4a8(%rbp), %rdi
callq 0x12840
jmp 0x11d13
leaq -0x488(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
leaq -0x400(%rbp), %rdx
callq 0x127f0
jmp 0x11d2f
leaq -0x400(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x5500
leaq -0x488(%rbp), %rdi
callq 0x5240
leaq -0x4a8(%rbp), %rdi
callq 0x5240
jmp 0x11e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x12288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x125d0
jmp 0x12288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x1227c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11f80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11e39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11e2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11e21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x5240
leaq -0x468(%rbp), %rdi
callq 0x5240
leaq -0x420(%rbp), %rdi
callq 0x5240
leaq -0x421(%rbp), %rdi
callq 0x5460
jmp 0x11f74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x11f68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x5240
jmp 0x11f68
movq $0x0, -0x4b0(%rbp)
movq -0x4b0(%rbp), %rax
movq %rax, -0x5b0(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0xe7c0
movq %rax, %rcx
movq -0x5b0(%rbp), %rax
cmpq %rcx, %rax
jae 0x11f3f
movq -0x4b0(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x12900
movq %rax, %rsi
leaq -0x4d8(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x128c0
jmp 0x11ee7
leaq -0x350(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x124e0
jmp 0x11efc
leaq -0x4d8(%rbp), %rdi
callq 0x125d0
movq -0x4b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x4b0(%rbp)
jmp 0x11e8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0x125d0
jmp 0x11f68
leaq -0x400(%rbp), %rdi
callq 0x5240
leaq -0x3e0(%rbp), %rdi
callq 0xbbf0
leaq -0x3c8(%rbp), %rdi
callq 0x125d0
jmp 0x11bb3
leaq -0x400(%rbp), %rdi
callq 0x5240
leaq -0x3e0(%rbp), %rdi
callq 0xbbf0
leaq -0x3c8(%rbp), %rdi
callq 0x125d0
jmp 0x1227c
leaq -0x4e0(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x12920
leaq -0x4e8(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
leaq -0x3a0(%rbp), %rsi
callq 0x129a0
movq -0x5c0(%rbp), %rsi
leaq -0x4e0(%rbp), %rdi
callq 0x12970
movb %al, -0x5b1(%rbp)
jmp 0x11fd9
movb -0x5b1(%rbp), %al
testb $0x1, %al
jne 0x11fe8
jmp 0x12237
leaq -0x4e0(%rbp), %rdi
callq 0x129f0
movq %rax, -0x5c8(%rbp)
jmp 0x11ffd
movq -0x5c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x5d8(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x129f0
movq %rax, -0x5d0(%rbp)
jmp 0x12023
movq -0x5d8(%rbp), %rsi
movq -0x5d0(%rbp), %rdx
addq $0x8, %rdx
leaq -0x500(%rbp), %rdi
callq 0x22330
jmp 0x12043
movq $0x0, -0x508(%rbp)
movq -0x508(%rbp), %rax
movq %rax, -0x5e0(%rbp)
leaq -0x500(%rbp), %rdi
callq 0x12a30
movq %rax, %rcx
movq -0x5e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x120e4
movq -0x508(%rbp), %rsi
leaq -0x500(%rbp), %rdi
callq 0x12a50
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
callq 0x5340
movq %rax, -0x5e8(%rbp)
jmp 0x120a2
movq -0x5e8(%rbp), %rdi
movq 0x38f00(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x120b7
jmp 0x120b9
movq -0x508(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x508(%rbp)
jmp 0x1204e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x12229
leaq -0x4e0(%rbp), %rdi
callq 0x129f0
movq %rax, -0x5f0(%rbp)
jmp 0x120f9
movq -0x5f0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x600(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x129f0
movq %rax, -0x5f8(%rbp)
jmp 0x1211f
movq -0x600(%rbp), %rsi
movq -0x5f8(%rbp), %rdx
addq $0x8, %rdx
leaq -0x520(%rbp), %rdi
callq 0x23420
jmp 0x1213f
movq $0x0, -0x528(%rbp)
movq -0x528(%rbp), %rax
movq %rax, -0x608(%rbp)
leaq -0x520(%rbp), %rdi
callq 0x12a30
movq %rax, %rcx
movq -0x608(%rbp), %rax
cmpq %rcx, %rax
jae 0x121e9
movq -0x528(%rbp), %rsi
leaq -0x520(%rbp), %rdi
callq 0x12a50
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
callq 0x5340
movq %rax, -0x610(%rbp)
jmp 0x1219e
movq -0x610(%rbp), %rdi
movq 0x38e04(%rip), %rsi     # 0x4afb0
callq 0x5440
jmp 0x121b3
jmp 0x121b5
movq -0x528(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x528(%rbp)
jmp 0x1214a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x520(%rbp), %rdi
callq 0x12a70
jmp 0x12229
movq 0x38dc0(%rip), %rsi     # 0x4afb0
leaq -0x218(%rbp), %rdi
callq 0x5440
jmp 0x121fe
leaq -0x520(%rbp), %rdi
callq 0x12a70
leaq -0x500(%rbp), %rdi
callq 0x12a70
leaq -0x4e0(%rbp), %rdi
callq 0x12ad0
jmp 0x12224
jmp 0x11fa4
leaq -0x500(%rbp), %rdi
callq 0x12a70
jmp 0x1227c
leaq -0x3a0(%rbp), %rdi
callq 0x12b00
leaq -0x350(%rbp), %rdi
callq 0x12b60
leaq -0x280(%rbp), %rdi
callq 0x5240
leaq -0x260(%rbp), %rdi
callq 0x28380
leaq -0x218(%rbp), %rdi
callq 0x55e0
addq $0x610, %rsp            # imm = 0x610
popq %rbp
retq
leaq -0x3a0(%rbp), %rdi
callq 0x12b00
leaq -0x350(%rbp), %rdi
callq 0x12b60
leaq -0x280(%rbp), %rdi
callq 0x5240
leaq -0x260(%rbp), %rdi
callq 0x28380
leaq -0x218(%rbp), %rdi
callq 0x55e0
movq -0x220(%rbp), %rdi
callq 0x5740
nopw %cs:(%rax,%rax)