// File: WinChua[P]MLDemo/DecisionTree.cpp
// Function: TreeNode::divide_node()
void TreeNode::divide_node() {
    std::vector<int> index_of_lchild, index_of_rchild;
    std::set<std::string> feature_of_lchild(feature_sets);
    std::set<std::string> feature_of_rchild(feature_sets);
    struct FeatureGain feature_gain = choose_attr(index_of_lchild, index_of_rchild);
    attr = feature_gain.field;
    gain = feature_gain.gain;
    if(attr != "no divided")
    {
        feature_of_lchild.erase(attr);
        feature_of_rchild.erase(attr);
        if(index_of_lchild.size() > 0)
            lchild = new TreeNode(data, index_of_lchild, feature_of_lchild);
        if(index_of_rchild.size() > 0)
            rchild = new TreeNode(data, index_of_rchild, feature_of_rchild);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3a80
leaq -0x38(%rbp), %rdi
callq 0x3a80
movq -0x178(%rbp), %rsi
addq $0x48, %rsi
leaq -0x68(%rbp), %rdi
callq 0x3aa0
jmp 0x27c2
movq -0x178(%rbp), %rsi
addq $0x48, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3aa0
jmp 0x27db
movq -0x178(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
leaq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x2c60
jmp 0x27f8
movq -0x178(%rbp), %rdi
addq $0x20, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2040
jmp 0x2811
movq -0x178(%rbp), %rdi
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, 0x40(%rdi)
addq $0x20, %rdi
leaq 0x97ec(%rip), %rsi      # 0xc01c
callq 0x3ce0
movb %al, -0x179(%rbp)
jmp 0x283d
movb -0x179(%rbp), %al
testb $0x1, %al
jne 0x284c
jmp 0x2afc
movq -0x178(%rbp), %rsi
addq $0x20, %rsi
leaq -0x68(%rbp), %rdi
callq 0x3d10
jmp 0x2862
movq -0x178(%rbp), %rsi
addq $0x20, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3d10
jmp 0x287b
leaq -0x20(%rbp), %rdi
callq 0x3d40
cmpq $0x0, %rax
jbe 0x29de
movl $0x90, %edi
callq 0x2200
movq %rax, -0x188(%rbp)
jmp 0x28a1
movq -0x178(%rbp), %rax
movb $0x1, -0x119(%rbp)
movq (%rax), %rax
movq %rax, -0x190(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3bf0
jmp 0x28cb
leaq -0x118(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3aa0
jmp 0x28dd
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
leaq -0x118(%rbp), %rcx
callq 0x2b80
jmp 0x2900
movq -0x178(%rbp), %rax
movq -0x188(%rbp), %rcx
movb $0x0, -0x119(%rbp)
movq %rcx, 0x80(%rax)
leaq -0x118(%rbp), %rdi
callq 0x3b70
leaq -0xe8(%rbp), %rdi
callq 0x3b90
jmp 0x29de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2b59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2b50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2b44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2b38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x29bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x29b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x3b70
leaq -0xe8(%rbp), %rdi
callq 0x3b90
testb $0x1, -0x119(%rbp)
jne 0x29c8
jmp 0x29d9
movq -0x188(%rbp), %rdi
movl $0x90, %esi
callq 0x2210
jmp 0x2b38
leaq -0x38(%rbp), %rdi
callq 0x3d40
cmpq $0x0, %rax
jbe 0x2afa
movl $0x90, %edi
callq 0x2200
movq %rax, -0x198(%rbp)
jmp 0x2a04
movq -0x178(%rbp), %rax
movb $0x1, -0x169(%rbp)
movq (%rax), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3bf0
jmp 0x2a2e
leaq -0x168(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3aa0
jmp 0x2a43
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdi
leaq -0x138(%rbp), %rdx
leaq -0x168(%rbp), %rcx
callq 0x2b80
jmp 0x2a66
movq -0x178(%rbp), %rax
movq -0x198(%rbp), %rcx
movb $0x0, -0x169(%rbp)
movq %rcx, 0x88(%rax)
leaq -0x168(%rbp), %rdi
callq 0x3b70
leaq -0x138(%rbp), %rdi
callq 0x3b90
jmp 0x2afa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2adc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x2ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3b70
leaq -0x138(%rbp), %rdi
callq 0x3b90
testb $0x1, -0x169(%rbp)
jne 0x2ae7
jmp 0x2af8
movq -0x198(%rbp), %rdi
movl $0x90, %esi
callq 0x2210
jmp 0x2b38
jmp 0x2afc
leaq -0xd0(%rbp), %rdi
callq 0x3d60
leaq -0xa8(%rbp), %rdi
callq 0x3b70
leaq -0x68(%rbp), %rdi
callq 0x3b70
leaq -0x38(%rbp), %rdi
callq 0x3b90
leaq -0x20(%rbp), %rdi
callq 0x3b90
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0xd0(%rbp), %rdi
callq 0x3d60
leaq -0xa8(%rbp), %rdi
callq 0x3b70
leaq -0x68(%rbp), %rdi
callq 0x3b70
leaq -0x38(%rbp), %rdi
callq 0x3b90
leaq -0x20(%rbp), %rdi
callq 0x3b90
movq -0x70(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)