// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/udc.c
// Function: udcParseUrlFull
void udcParseUrlFull(char *url, char **retProtocol, char **retAfterProtocol, char **retColon,
		     char **retAuth)
/* Parse the URL into components that udc treats separately.
 * *retAfterProtocol is Q-encoded to keep special chars out of filenames.  
 * Free all *ret's except *retColon when done. */
{
char *protocol, *afterProtocol;
char *colon = strchr(url, ':');
if (!colon)
    {
    *retColon = NULL;
    return;
    }
int colonPos = colon - url;
protocol = cloneStringZ(url, colonPos);
afterProtocol = url + colonPos + 1;
while (afterProtocol[0] == '/')
   afterProtocol += 1;
char *userPwd = strchr(afterProtocol, '@');
if (userPwd)
    {
    if (retAuth)
	{
	char auth[1024];
	safencpy(auth, sizeof(auth), afterProtocol, userPwd+1-afterProtocol);
	*retAuth = qEncode(auth);
	}
    char *afterHost = strchr(afterProtocol, '/');
    if (!afterHost)
	{
	afterHost = afterProtocol+strlen(afterProtocol);
	}
    if (userPwd < afterHost)
	afterProtocol = userPwd + 1;
    }
else if (retAuth)
    *retAuth = NULL;
afterProtocol = qEncode(afterProtocol);
*retProtocol = protocol;
*retAfterProtocol = afterProtocol;
*retColon = colon;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
callq 0x6260
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x5c7d8
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
jmp 0x5c925
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x2a3a0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x5c823
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5c809
movq -0x38(%rbp), %rdi
movl $0x40, %esi
callq 0x6260
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x5c8e3
cmpq $0x0, -0x28(%rbp)
je 0x5c881
leaq -0x450(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x50(%rbp), %rcx
addq $0x1, %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
movl $0x400, %esi            # imm = 0x400
callq 0x31130
leaq -0x450(%rbp), %rdi
callq 0x5c930
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rdi
movl $0x2f, %esi
callq 0x6260
movq %rax, -0x458(%rbp)
cmpq $0x0, -0x458(%rbp)
jne 0x5c8c8
movq -0x38(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x38(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x460(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x458(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x458(%rbp), %rax
jae 0x5c8e1
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5c8f7
cmpq $0x0, -0x28(%rbp)
je 0x5c8f5
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
jmp 0x5c8f7
movq -0x38(%rbp), %rdi
callq 0x5c930
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
nop