// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/open_trace_file.c
// Function: tokenise_search_path
char *tokenise_search_path(char *searchpath) {
    char *newsearch;
    unsigned int i, j;
    size_t len;
#ifdef _WIN32
    char path_sep = ';';
#else
    char path_sep = ':';
#endif

    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], "ftp:",      4) ||
		 !strncmp(&searchpath[i], "|http:",    6) ||
		 !strncmp(&searchpath[i], "|ftp:",     5) ||
		 !strncmp(&searchpath[i], "URL=http:", 9) ||
		 !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 0x8f072
leaq 0x56398(%rip), %rax     # 0xe5406
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x62c0
movq %rax, %rdi
movq %rdi, -0x28(%rbp)
addq $0x5, %rdi
callq 0x69c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8f0a3
movq $0x0, -0x8(%rbp)
jmp 0x8f48f
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpq -0x28(%rbp), %rax
jae 0x8f418
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x8f116
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x8f116
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x8f116
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 0x8f40a
movsbl -0x29(%rbp), %eax
cmpl $0x3a, %eax
jne 0x8f3a5
cmpl $0x0, -0x1c(%rbp)
je 0x8f14c
cmpl $0x0, -0x1c(%rbp)
jbe 0x8f3a3
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x8f3a3
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x542d4(%rip), %rsi     # 0xe3431
movl $0x5, %edx
callq 0x6320
cmpl $0x0, %eax
je 0x8f218
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x542ba(%rip), %rsi     # 0xe343b
movl $0x4, %edx
callq 0x6320
cmpl $0x0, %eax
je 0x8f218
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x5427b(%rip), %rsi     # 0xe3420
movl $0x6, %edx
callq 0x6320
cmpl $0x0, %eax
je 0x8f218
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x54262(%rip), %rsi     # 0xe3427
movl $0x5, %edx
callq 0x6320
cmpl $0x0, %eax
je 0x8f218
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x54248(%rip), %rsi     # 0xe342d
movl $0x9, %edx
callq 0x6320
cmpl $0x0, %eax
je 0x8f218
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
leaq 0x54232(%rip), %rsi     # 0xe3437
movl $0x8, %edx
callq 0x6320
cmpl $0x0, %eax
jne 0x8f3a3
jmp 0x8f21a
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 0x8f266
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 0x8f21a
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x8f286
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 0x8f2be
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 0x8f2f6
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 0x8f2f8
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 0x8f359
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x2b(%rbp)
je 0x8f359
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 0x8f2f8
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 0x8f3a1
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8f3a3
jmp 0x8f3a5
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x29(%rbp), %ecx
cmpl %ecx, %eax
jne 0x8f3ea
cmpl $0x0, -0x20(%rbp)
je 0x8f3e8
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x8f3e8
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 0x8f408
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 0x8f40a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8f0b1
cmpl $0x0, -0x20(%rbp)
je 0x8f433
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
nopl (%rax)