// File: /workspace/github_cpp_makefile_star2_O3/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 0x438f
xorl %r12d, %r12d
leaq -0xb0(%rbp), %r14
xorl %r13d, %r13d
movq (%rax,%r12), %r15
movq -0x60(%rbp), %rbx
movq %r15, %rdi
callq 0x2100
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %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 0x4356
callq 0x21d0
leaq -0xe8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x67e8
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, %r12
cmpq %r13, %rcx
ja 0x42e2
movl -0x34(%rbp), %eax
testl %eax, %eax
jle 0x448c
movl %eax, %eax
movq %rax, -0x30(%rbp)
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 0x442e
callq 0x21d0
leaq -0xe8(%rbp), %rdi
movq %r14, %rsi
callq 0x67e8
movl (%rax), %eax
decl %eax
movq -0x40(%rbp), %rcx
movl %eax, (%rcx,%r12,4)
incq %r12
cmpq %r12, -0x30(%rbp)
jne 0x43b1
xorl %ebx, %ebx
movq -0x40(%rbp), %rdx
cmpl $-0x1, (%rdx)
leaq -0x58(%rbp), %r14
leaq -0x78(%rbp), %r15
jne 0x4499
movl $0x1, %ecx
movq %rcx, %rax
cmpq %rcx, -0x30(%rbp)
je 0x4481
leaq 0x1(%rax), %rcx
cmpl $-0x1, (%rdx,%rax,4)
je 0x446e
xorl %ebx, %ebx
cmpq -0x30(%rbp), %rax
setae %bl
jmp 0x4499
movl $0x1, %ebx
leaq -0x58(%rbp), %r14
leaq -0x78(%rbp), %r15
leaq -0xe8(%rbp), %rdi
callq 0x6748
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x44b6
callq 0x21d0
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x44c4
callq 0x21d0
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44de
jmp 0x44de
jmp 0x44de
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x6748
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4502
callq 0x21d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4514
callq 0x21d0
movq %rbx, %rdi
callq 0x2380