// File: /workspace/github_cpp_makefile_star2_O2/WeiqiangZhou[P]BIRD/source/predict_function.cpp
// Function: MatchExon_sep(char**, Exondata*, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int MatchExon_sep(char **lib_TC, Exondata *indata, int Length, int *match_idx, std::string sep_str)
{
    int error_flag = 1;
    std::string id_str;
    std::size_t sep_pos;
    std::string temp_id;
    std::unordered_map<std::string, int> id_map;
    
    for (int i = 0; i < indata->TC_name.size(); i++)
    {
        id_str = indata->TC_name[i].c_str();
        sep_pos = id_str.find(sep_str);
        temp_id = id_str.substr(0, sep_pos);
        id_map[temp_id] = i+1;
    }
    
    for (int i = 0; i < Length; i++)
    {
        id_str = lib_TC[i];
        sep_pos = id_str.find(sep_str);
        temp_id = id_str.substr(0, sep_pos);
        
        match_idx[i] = id_map[temp_id] - 1;
    }
    
    for (int i = 0; i < Length; i++)
    {
        if(match_idx[i] != -1)
        {
            error_flag = 0;
            break;
        }
    }
    
    if(error_flag == 1)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, -0x40(%rbp)
movq %rcx, -0x38(%rbp)
movl %edx, -0x2c(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, -0x48(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %r15d, %r15d
movb %r15b, (%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %r15b, (%rax)
leaq -0x98(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq -0x90(%rbp), %rbx
leaq -0xe8(%rbp), %r12
xorl %r14d, %r14d
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rax
movq 0x20(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r14, %rcx
jbe 0x3e2c
movq (%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x2390
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x23b0
movq %r12, %rdi
movq %rbx, %r13
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2200
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2220
movq %r12, %rdi
callq 0x2110
leaq -0xc8(%rbp), %rdi
movq %rbx, %rsi
callq 0x59fc
movq %r13, %rbx
incq %r14
movl %r14d, (%rax)
addq $0x20, %r15
jmp 0x3db2
xorl %r13d, %r13d
movl -0x2c(%rbp), %eax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
leaq -0x90(%rbp), %rbx
leaq -0xe8(%rbp), %r14
leaq -0x70(%rbp), %r12
cmpq %r13, %r15
je 0x3eb6
movq -0x48(%rbp), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x2390
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x23b0
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2200
movq %r12, %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2110
leaq -0xc8(%rbp), %rdi
movq %r12, %rsi
callq 0x59fc
movl (%rax), %eax
decl %eax
movq -0x38(%rbp), %rcx
movl %eax, (%rcx,%r13,4)
incq %r13
jmp 0x3e50
xorl %ecx, %ecx
movq -0x38(%rbp), %rdx
movq %rcx, %rax
cmpq %rcx, %r15
je 0x3ece
leaq 0x1(%rax), %rcx
cmpl $-0x1, (%rdx,%rax,4)
je 0x3ebc
movslq -0x2c(%rbp), %rcx
xorl %ebx, %ebx
cmpq %rcx, %rax
setge %bl
leaq -0xc8(%rbp), %rdi
callq 0x5938
leaq -0x70(%rbp), %rdi
callq 0x2110
leaq -0x90(%rbp), %rdi
callq 0x2110
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f15
jmp 0x3f15
jmp 0x3f15
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x5938
leaq -0x70(%rbp), %rdi
callq 0x2110
leaq -0x90(%rbp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2340