// File: 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
subq $0x190, %rsp            # imm = 0x190
movq %r8, -0x128(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x22b0
leaq -0x80(%rbp), %rdi
callq 0x22b0
leaq -0xb8(%rbp), %rdi
callq 0x9970
movl $0x0, -0xbc(%rbp)
movslq -0xbc(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x4a90
movq %rax, %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
jae 0x6aae
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movslq -0xbc(%rbp), %rsi
callq 0x9950
movq %rax, %rdi
callq 0x20d0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x2290
jmp 0x69bc
movq -0x128(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x138(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x2440
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rcx
leaq -0xf0(%rbp), %rdi
callq 0x21f0
jmp 0x6a02
leaq -0x80(%rbp), %rdi
movq %rdi, -0x158(%rbp)
leaq -0xf0(%rbp), %rsi
movq %rsi, -0x160(%rbp)
callq 0x2230
movq -0x160(%rbp), %rdi
callq 0x2140
movq -0x158(%rbp), %rsi
movl -0xbc(%rbp), %eax
incl %eax
movl %eax, -0x14c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x9990
movq %rax, -0x148(%rbp)
jmp 0x6a56
movq -0x148(%rbp), %rax
movl -0x14c(%rbp), %ecx
movl %ecx, (%rax)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x6964
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x99c0
leaq -0x80(%rbp), %rdi
callq 0x2140
leaq -0x58(%rbp), %rdi
callq 0x2140
jmp 0x6c31
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6b9b
movq -0x10(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x58(%rbp), %rdi
callq 0x2290
jmp 0x6ae1
movq -0x128(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x168(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x2440
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rcx
leaq -0x118(%rbp), %rdi
callq 0x21f0
jmp 0x6b27
leaq -0x80(%rbp), %rdi
movq %rdi, -0x180(%rbp)
leaq -0x118(%rbp), %rsi
movq %rsi, -0x188(%rbp)
callq 0x2230
movq -0x188(%rbp), %rdi
callq 0x2140
movq -0x180(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x9990
movq %rax, -0x178(%rbp)
jmp 0x6b6d
movq -0x178(%rbp), %rax
movl (%rax), %edx
subl $0x1, %edx
movq -0x28(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x6ab8
movl $0x0, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6bdd
movq -0x28(%rbp), %rax
movslq -0x11c(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0x6bca
movl $0x0, -0x34(%rbp)
jmp 0x6bdd
jmp 0x6bcc
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x6ba5
cmpl $0x1, -0x34(%rbp)
jne 0x6bf6
movl $0x1, -0x4(%rbp)
movl $0x1, -0x120(%rbp)
jmp 0x6c07
movl $0x0, -0x4(%rbp)
movl $0x1, -0x120(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x99c0
leaq -0x80(%rbp), %rdi
callq 0x2140
leaq -0x58(%rbp), %rdi
callq 0x2140
movl -0x4(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0xc8(%rbp), %rdi
callq 0x23b0
nopl (%rax)