// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/util.C
// Function: GetSpeechIndexClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&, int&)
void GetSpeechIndexClass(std::string filename, int& cls, int& index){
    size_t pos = filename.find_last_of("_");
    if(pos == std::string::npos){
        std::cout<<"Invalid spike response filename: "<<filename<<std::endl;
        exit(EXIT_FAILURE);
    }
    cls = std::stoi(filename.substr(pos + 1));
    
    filename = filename.substr(0, pos);
    pos = filename.find_last_of("_");
    if(pos == std::string::npos){
        std::cout<<"Invalid spike response filename: "<<filename<<std::endl;
        std::cout<<"Cannot find the index before the class id!"<<std::endl;
        exit(EXIT_FAILURE);
    }
    index = std::stoi(filename.substr(pos + 1));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %r15
leaq 0x2664(%rip), %rsi      # 0x1734f
movl $0x1, %ecx
movq $-0x1, %rdx
callq 0x3610
cmpq $-0x1, %rax
je 0x14e91
movq %rax, %r12
leaq 0x1(%rax), %rdx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x3310
movq (%rbx), %rbp
callq 0x3050
movq %rax, %rbx
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%rbx)
leaq 0x8(%rsp), %r14
movq %rbp, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x3400
cmpq %rbp, (%r14)
je 0x14eb1
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x14ebd
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x14ebd
testl %ecx, %ecx
jne 0x14d7a
movl 0x4(%rsp), %ecx
movl %ecx, (%rbx)
movl %eax, (%r13)
leaq 0x20(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x14d99
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3310
movq %r15, %rdi
movq %r14, %rsi
callq 0x3390
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x14dce
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
leaq 0x257a(%rip), %rsi      # 0x1734f
movl $0x1, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x3610
cmpq $-0x1, %rax
je 0x14ec9
incq %rax
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x3310
movq (%r14), %r14
movl (%rbx), %ebp
movl $0x0, (%rbx)
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x3400
cmpq %r14, (%r15)
je 0x14f13
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0x14f1f
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x14f1f
testl %ecx, %ecx
jne 0x14e64
movl %ebp, (%rbx)
movq 0x30(%rsp), %rcx
movl %eax, (%rcx)
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x14e82
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc138(%rip), %rdi      # 0x20fd0
leaq 0x4d1e(%rip), %rsi      # 0x19bbd
callq 0x32c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3270
jmp 0x14f01
leaq 0x4d9a(%rip), %rdi      # 0x19c52
callq 0x3190
leaq 0x4d8e(%rip), %rdi      # 0x19c52
callq 0x3430
movq 0xc100(%rip), %rbx      # 0x20fd0
leaq 0x4ce6(%rip), %rsi      # 0x19bbd
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x4ce6(%rip), %rsi      # 0x19bdf
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
leaq 0x4d38(%rip), %rdi      # 0x19c52
callq 0x3190
leaq 0x4d2c(%rip), %rdi      # 0x19c52
callq 0x3430
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x14f35
movl %ebp, (%rbx)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x394d
jmp 0x14f63
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x14f54
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x396a
movq %r14, %rdi
callq 0x3570