// File: /workspace/github_cpp_makefile_star2_O1/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, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movl %edx, -0x34(%rbp)
movq %rdi, -0x90(%rbp)
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x78(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xb8(%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)
movq 0x18(%rsi), %rax
movq %rsi, -0x30(%rbp)
cmpq %rax, 0x20(%rsi)
je 0x43b8
xorl %r15d, %r15d
leaq -0xb0(%rbp), %r14
xorl %r13d, %r13d
movq (%rax,%r15), %r12
movq -0x60(%rbp), %rbx
movq %r12, %rdi
callq 0x2100
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x22e0
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2370
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2220
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x2250
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x437f
callq 0x21d0
leaq -0xe8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x67c6
incq %r13
movl %r13d, (%rax)
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rax
movq 0x20(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r15
cmpq %r13, %rcx
ja 0x430b
movl -0x34(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
testl %eax, %eax
jle 0x447f
xorl %r12d, %r12d
leaq -0xb0(%rbp), %r15
leaq -0x88(%rbp), %r14
movq -0x90(%rbp), %rax
movq (%rax,%r12,8), %r13
movq %r15, %rbx
movq -0x60(%rbp), %r15
movq %r13, %rdi
callq 0x2100
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbx, %r15
movq %r13, %rcx
movq %rax, %r8
callq 0x22e0
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2370
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2220
movq %r14, %rdi
movq %r15, %rsi
callq 0x2250
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x4457
callq 0x21d0
leaq -0xe8(%rbp), %rdi
movq %r14, %rsi
callq 0x67c6
movl (%rax), %eax
decl %eax
movq -0x40(%rbp), %rcx
movl %eax, (%rcx,%r12,4)
incq %r12
cmpq %r12, -0x30(%rbp)
jne 0x43da
cmpl $0x0, -0x34(%rbp)
setle %bl
jle 0x44ba
movq -0x40(%rbp), %rdx
cmpl $-0x1, (%rdx)
leaq -0x58(%rbp), %r14
leaq -0x78(%rbp), %r15
jne 0x44c2
movl $0x1, %ecx
movq %rcx, %rax
cmpq %rcx, -0x30(%rbp)
je 0x44b1
leaq 0x1(%rax), %rcx
cmpl $-0x1, (%rdx,%rax,4)
je 0x449e
cmpq -0x30(%rbp), %rax
setae %bl
jmp 0x44c2
leaq -0x58(%rbp), %r14
leaq -0x78(%rbp), %r15
leaq -0xe8(%rbp), %rdi
callq 0x6726
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x44df
callq 0x21d0
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x44ed
callq 0x21d0
movzbl %bl, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4508
jmp 0x4508
jmp 0x4508
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x6726
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x452c
callq 0x21d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x453e
callq 0x21d0
movq %rbx, %rdi
callq 0x2380