// File: /workspace/github_c_makefile_star2_O1/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 0x2313(%rip), %rsi      # 0x1732f
movl $0x1, %ecx
movq $-0x1, %rdx
callq 0x3610
cmpq $-0x1, %rax
je 0x151c2
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 0x151e2
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x151ee
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x151ee
testl %ecx, %ecx
jne 0x150ab
movl 0x4(%rsp), %ecx
movl %ecx, (%rbx)
movl %eax, (%r13)
leaq 0x20(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x150ca
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 0x150ff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
leaq 0x2229(%rip), %rsi      # 0x1732f
movl $0x1, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x3610
cmpq $-0x1, %rax
je 0x151fa
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 0x15244
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0x15250
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x15250
testl %ecx, %ecx
jne 0x15195
movl %ebp, (%rbx)
movq 0x30(%rsp), %rcx
movl %eax, (%rcx)
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x151b3
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 0xbe07(%rip), %rdi      # 0x20fd0
leaq 0x4935(%rip), %rsi      # 0x19b05
callq 0x32c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3270
jmp 0x15232
leaq 0x49b1(%rip), %rdi      # 0x19b9a
callq 0x3190
leaq 0x49a5(%rip), %rdi      # 0x19b9a
callq 0x3430
movq 0xbdcf(%rip), %rbx      # 0x20fd0
leaq 0x48fd(%rip), %rsi      # 0x19b05
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x48fd(%rip), %rsi      # 0x19b27
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
leaq 0x494f(%rip), %rdi      # 0x19b9a
callq 0x3190
leaq 0x4943(%rip), %rdi      # 0x19b9a
callq 0x3430
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x15266
movl %ebp, (%rbx)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39e1
jmp 0x15294
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x15285
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39fe
movq %r14, %rdi
callq 0x3570