// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/cram/open_trace_file.c
// Function: tokenise_search_path
char *tokenise_search_path(const char *searchpath) {
    char *newsearch;
    unsigned int i, j;
    size_t len;
    char path_sep = HTS_PATH_SEPARATOR_CHAR;

    if (!searchpath)
        searchpath="";

    newsearch = (char *)malloc((len = strlen(searchpath))+5);
    if (!newsearch)
        return NULL;

    for (i = 0, j = 0; i < len; i++) {
        /* "::" => ":". Used for escaping colons in http://foo */
        if (i < len-1 && searchpath[i] == ':' && searchpath[i+1] == ':') {
            newsearch[j++] = ':';
            i++;
            continue;
        }

        /* Handle http:// and ftp:// too without :: */
        if (path_sep == ':') {
            if ((i == 0 || (i > 0 && searchpath[i-1] == ':')) &&
                (!strncmp(&searchpath[i], "http:",     5) ||
                 !strncmp(&searchpath[i], "https:",    6) ||
                 !strncmp(&searchpath[i], "ftp:",      4) ||
                 !strncmp(&searchpath[i], "|http:",    6) ||
                 !strncmp(&searchpath[i], "|https:",   7) ||
                 !strncmp(&searchpath[i], "|ftp:",     5) ||
                 !strncmp(&searchpath[i], "URL=http:", 9) ||
                 !strncmp(&searchpath[i], "URL=https:",10)||
                 !strncmp(&searchpath[i], "URL=ftp:",  8))) {
                do {
                    newsearch[j++] = searchpath[i];
                } while (i<len && searchpath[i++] != ':');
                if (searchpath[i] == ':')
                    i++;
                if (searchpath[i]=='/')
                    newsearch[j++] = searchpath[i++];
                if (searchpath[i]=='/')
                    newsearch[j++] = searchpath[i++];
                // Look for host:port
                do {
                    newsearch[j++] = searchpath[i++];
                } while (i<len && searchpath[i] != ':' && searchpath[i] != '/');
                newsearch[j++] = searchpath[i++];
                if (searchpath[i] == ':')
                    i++;
            }
        }

        if (searchpath[i] == path_sep) {
            /* Skip blank path components */
            if (j && newsearch[j-1] != 0)
                newsearch[j++] = 0;
        } else {
            newsearch[j++] = searchpath[i];
        }
    }

    if (j)
        newsearch[j++] = 0;
    newsearch[j++] = '.';
    newsearch[j++] = '/';
    newsearch[j++] = 0;
    newsearch[j++] = 0;

    return newsearch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movb $0x3a, -0x29(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x81042
leaq 0x6ef37(%rip), %rax     # 0xeff75
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x41b0
movq %rax, %rdi
movq %rdi, -0x28(%rbp)
addq $0x5, %rdi
callq 0x4650
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x81073
movq $0x0, -0x8(%rbp)
jmp 0x814cb
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpq -0x28(%rbp), %rax
jae 0x81454
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x810e6
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x810e6
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x810e6
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x3a, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x81446
movsbl -0x29(%rbp), %eax
cmpl $0x3a, %eax
jne 0x813e1
cmpl $0x0, -0x1c(%rbp)
je 0x8111c
cmpl $0x0, -0x1c(%rbp)
jbe 0x813df
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x813df
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x75023(%rip), %rsi     # 0xf6150
movl $0x5, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x75009(%rip), %rsi     # 0xf615a
movl $0x6, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74ff0(%rip), %rsi     # 0xf6165
movl $0x4, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f9e(%rip), %rsi     # 0xf6137
movl $0x6, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f81(%rip), %rsi     # 0xf613e
movl $0x7, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f65(%rip), %rsi     # 0xf6146
movl $0x5, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f4b(%rip), %rsi     # 0xf614c
movl $0x9, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f35(%rip), %rsi     # 0xf6156
movl $0xa, %edx
callq 0x4200
cmpl $0x0, %eax
je 0x81254
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x74f20(%rip), %rsi     # 0xf6161
movl $0x8, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x813df
jmp 0x81256
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x2a(%rbp)
jae 0x812a2
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
setne %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x81256
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x812c2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x812fa
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x81332
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
jmp 0x81334
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x2b(%rbp)
jae 0x81395
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x2b(%rbp)
je 0x81395
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
setne %al
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %al
testb $0x1, %al
jne 0x81334
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x813dd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x813df
jmp 0x813e1
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x29(%rbp), %ecx
cmpl %ecx, %eax
jne 0x81426
cmpl $0x0, -0x20(%rbp)
je 0x81424
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x81424
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
jmp 0x81444
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
jmp 0x81446
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x81081
cmpl $0x0, -0x20(%rbp)
je 0x8146f
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x2e, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x2f, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)