// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x3691(%rip), %rsi      # 0x60a4
leaq 0x368c(%rip), %rdx      # 0x60a6
leaq 0x60(%rsp), %rdi
callq 0x4186
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movapd %xmm0, (%rsp)
movq %r13, %r12
movq (%r13), %rbp
movq 0x50(%rbp), %r13
addq $0x40, %rbp
cmpq %rbp, %r13
je 0x2bd8
movq %rbx, 0xa0(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x80(%rsp), %rbx
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3b8e
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3b8e
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
callq 0x3304
movsd %xmm0, 0x38(%rsp)
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x2af3
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21a0
movsd 0x38(%rsp), %xmm0
ucomisd 0x18(%rsp), %xmm0
jbe 0x2b6c
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x20e0
movq 0x10(%r15), %rax
movaps 0x20(%rsp), %xmm0
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15)
movups (%r15), %xmm1
movups %xmm0, (%r15)
movaps %xmm1, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
movaps (%rsp), %xmm0
movups %xmm0, (%r14)
movq 0x10(%rsp), %rsi
movq %rsi, 0x10(%r14)
movq %rax, (%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x2b75
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x2b7f
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x2b90
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2bac
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %r13, %rdi
callq 0x21e0
movq %rax, %r13
cmpq %rbp, %rax
jne 0x2a71
movsd 0x3468(%rip), %xmm0     # 0x6030
ucomisd 0x18(%rsp), %xmm0
movq 0xa0(%rsp), %rbx
jbe 0x2bfb
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x345e(%rip), %rsi      # 0x6044
leaq 0x3461(%rip), %rdx      # 0x604e
movq %rbx, %rdi
callq 0x4186
xorpd %xmm0, %xmm0
jmp 0x2c1d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3b8e
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2c38
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2c4f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2c6b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c84
jmp 0x2c84
movq %rax, %rbx
jmp 0x2cd2
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x2cb6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x2cb6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2cd2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2ce8
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2cff
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2d1b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2290
nop