// File: /workspace/github_cpp_makefile_star2_O1/BGI-Qingdao[P]metaSLR/classify.cpp
// Function: getHap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<int, int, std::less<int>, std::allocator<std::pair<int const, int>>> const&)
int getHap(const std::string & barcode , const std::map<int,int> & data){
    if( barcode == "0_0_0" || barcode == "0_0" || barcode == "0" )
        return -1;
    int first = 0 , second = 0 , first_index = -1;
    for( int i = 0 ; i< (int)g_kmers.size() ; i++ ){
        if( data.find(i) == data.end() ) 
            continue;
        else if( data.at(i) > first ) {
            second = first ;
            first = data.at(i);
            first_index = i ;
        }
        else if( data.at(i) > second ){
            second = data.at(i);
        }
    }
    if( first > 0 && first_index != -1 && first > second )
        return first_index;
    else 
        return -1 ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
movq %rdi, %r15
leaq 0x65de(%rip), %rsi      # 0xa07b
callq 0x30a0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x3c1a
leaq 0x65c6(%rip), %rsi      # 0xa07d
movq %r15, %rdi
callq 0x30a0
testl %eax, %eax
je 0x3c1a
leaq 0x6876(%rip), %rsi      # 0xa344
movq %r15, %rdi
callq 0x30a0
testl %eax, %eax
je 0x3c1a
movl $0x0, -0x2c(%rbp)
movq 0xa834(%rip), %rax      # 0xe320
subq 0xa825(%rip), %rax      # 0xe318
shrq $0x3, %rax
imull $0xb6db6db7, %eax, %eax # imm = 0xB6DB6DB7
testl %eax, %eax
jle 0x3bef
leaq 0x8(%r13), %rdi
xorl %r12d, %r12d
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
xorl %r15d, %r15d
xorl %eax, %eax
movq %r13, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movq 0x10(%r13), %rdx
movq %rdi, %rcx
testq %rdx, %rdx
je 0x3b46
movq %rdi, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x3b2f
movq %rdi, %rdx
cmpq %rdi, %rcx
je 0x3b58
cmpl 0x20(%rcx), %eax
cmovlq %rdi, %rcx
movq %rcx, %rdx
cmpq %rdi, %rdx
je 0x3b89
movq %r13, %rdi
leaq -0x2c(%rbp), %rbx
movq %rbx, %rsi
callq 0x57a2
movl (%rax), %r14d
movq %r13, %rdi
movq %rbx, %rsi
callq 0x57a2
movl (%rax), %ecx
cmpl %r15d, %r14d
jle 0x3b91
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x3bb4
movl %r15d, %ecx
movl %r12d, %r15d
jmp 0x3bbc
cmpl %r12d, %ecx
jle 0x3bae
movq -0x40(%rbp), %r13
movq %r13, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x57a2
movl %r15d, %ecx
movl (%rax), %r15d
jmp 0x3bb8
movl %r15d, %ecx
movl %r12d, %r15d
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
movq 0xa755(%rip), %rdx      # 0xe320
subq 0xa746(%rip), %rdx      # 0xe318
shrq $0x3, %rdx
imull $0xb6db6db7, %edx, %esi # imm = 0xB6DB6DB7
movl %r15d, %edx
movl %r15d, %r12d
movl %ecx, %r15d
cmpl %esi, %eax
jl 0x3b20
jmp 0x3bfa
xorl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
cmpl %edx, %ecx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl -0x30(%rbp), %edx
cmovgl %edx, %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %eax, %edx
cmovel %edx, %r14d
testl %ecx, %ecx
cmovlel %eax, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq