// File: /workspace/github_cpp_makefile_star2_O1/WinChua[P]MLDemo/DecisionTree.cpp
// Function: TreeNode::choose_attr(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
struct TreeNode::FeatureGain TreeNode::choose_attr(std::vector<int> &max_l_index, std::vector<int> &max_r_index)
{
    std::string max_attr("no");
    double max_entropy=0.0;
    std::vector<int> l_index, r_index;
    for(auto feature : data.featureset)
    {
        double gain = gain_of_attr(feature, l_index, r_index);
        if(gain > max_entropy)
        {
            max_attr = feature;
            swap(max_l_index, l_index);
            swap(max_r_index, r_index);
            max_entropy = gain;
        }
        r_index.clear();
        l_index.clear();
    }
    if(max_entropy <  0.005)
    {
        return {"no divided", 0.0};
    }
    return {max_attr, max_entropy};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0xb0(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x3689(%rip), %rsi      # 0x60a4
leaq 0x3684(%rip), %rdx      # 0x60a6
leaq 0x70(%rsp), %rdi
callq 0x418a
xorl %eax, %eax
movq %rax, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movq (%rbx), %rbp
movq 0x50(%rbp), %r13
addq $0x40, %rbp
cmpq %rbp, %r13
je 0x2bca
movq %rbx, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x90(%rsp), %rbx
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x3b98
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3b98
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x330e
movsd %xmm0, 0x48(%rsp)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2af5
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
movsd 0x48(%rsp), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x2b76
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x20e0
movups (%r15), %xmm0
movq 0x10(%r15), %rax
movq 0x30(%rsp), %rcx
movq %rcx, (%r15)
movq 0x38(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%r15)
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
movups (%r14), %xmm0
movq 0x10(%r14), %rax
movq 0x10(%rsp), %rcx
movq %rcx, (%r14)
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%r14)
movq 0x20(%rsp), %rcx
movq %rcx, 0x10(%r14)
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x2b87
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x2b98
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2bb4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %r13, %rdi
callq 0x21e0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x2a71
jmp 0x2bd4
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xb0(%rsp), %rbx
leaq 0x10(%rbx), %rax
movsd 0x3448(%rip), %xmm0     # 0x6030
ucomisd 0x8(%rsp), %xmm0
movq %rax, (%rbx)
jbe 0x2c0f
leaq 0x344a(%rip), %rsi      # 0x6044
leaq 0x344d(%rip), %rdx      # 0x604e
movq %rbx, %rdi
callq 0x418a
xorpd %xmm0, %xmm0
jmp 0x2c2a
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3b98
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2c46
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2c5d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2c7f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c98
jmp 0x2c98
movq %rax, %rbx
jmp 0x2ce6
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2cca
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2cca
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2ce6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2cfd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2d14
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2d36
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2290