// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/net.c
// Function: urlFromNetParsedUrl
char *urlFromNetParsedUrl(struct netParsedUrl *npu)
/* Build URL from netParsedUrl structure */
{
struct dyString *dy = newDyString(512);

dyStringAppend(dy, npu->protocol);
dyStringAppend(dy, "://");
if (npu->user[0] != 0)
    {
    char *encUser = cgiEncode(npu->user);
    dyStringAppend(dy, encUser);
    freeMem(encUser);
    if (npu->password[0] != 0)
	{
	dyStringAppend(dy, ":");
	char *encPassword = cgiEncode(npu->password);
	dyStringAppend(dy, encPassword);
	freeMem(encPassword);
	}
    dyStringAppend(dy, "@");
    }
dyStringAppend(dy, npu->host);
/* do not include port if it is the default */
if (!(
 (sameString(npu->protocol, "ftp"  ) && sameString("21", npu->port)) ||
 (sameString(npu->protocol, "http" ) && sameString("80", npu->port)) ||
 (sameString(npu->protocol, "https") && sameString("443",npu->port))
    ))
    {
    dyStringAppend(dy, ":");
    dyStringAppend(dy, npu->port);
    }
dyStringAppend(dy, npu->file);
if (npu->byteRangeStart != -1)
    {
    dyStringPrintf(dy, ";byterange=%lld-", (long long)npu->byteRangeStart);
    if (npu->byteRangeEnd != -1)
	dyStringPrintf(dy, "%lld", (long long)npu->byteRangeEnd);
    }

/* Clean up and return handle. */
return dyStringCannibalize(&dy);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl $0x200, %edi            # imm = 0x200
callq 0x264e0
movq %rax, %rbx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2674f
leaq 0x624f5(%rip), %rsi     # 0x916bc
movq %rbx, %rdi
callq 0x2674f
cmpb $0x0, 0x10(%r14)
je 0x2f242
leaq 0x10(%r14), %rdi
callq 0x450d9
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2674f
movq %r15, %rdi
callq 0x2e0a0
cmpb $0x0, 0x810(%r14)
je 0x2f233
leaq 0x810(%r14), %r15
leaq 0x6b4bd(%rip), %rsi     # 0x9a6ca
movq %rbx, %rdi
callq 0x2674f
movq %r15, %rdi
callq 0x450d9
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2674f
movq %r15, %rdi
callq 0x2e0a0
leaq 0x62da6(%rip), %rsi     # 0x91fe0
movq %rbx, %rdi
callq 0x2674f
leaq 0x1010(%r14), %rsi
movq %rbx, %rdi
callq 0x2674f
leaq 0x65de5(%rip), %rsi     # 0x9503d
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
jne 0x2f290
movzbl 0x1810(%r14), %eax
subl $0x32, %eax
jne 0x2f286
movzbl 0x1811(%r14), %eax
subl $0x31, %eax
jne 0x2f286
movzbl 0x1812(%r14), %eax
negl %eax
testl %eax, %eax
je 0x2f313
leaq 0x62cfb(%rip), %rsi     # 0x91f92
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
jne 0x2f2cb
movzbl 0x1810(%r14), %eax
subl $0x38, %eax
jne 0x2f2c5
movzbl 0x1811(%r14), %eax
subl $0x30, %eax
jne 0x2f2c5
movzbl 0x1812(%r14), %eax
negl %eax
testl %eax, %eax
je 0x2f313
leaq 0x62cc5(%rip), %rsi     # 0x91f97
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
jne 0x2f2f5
leaq 0x1810(%r14), %rsi
leaq 0x62cd4(%rip), %rdi     # 0x91fc0
callq 0x6a50
testl %eax, %eax
je 0x2f313
leaq 0x6b3ce(%rip), %rsi     # 0x9a6ca
movq %rbx, %rdi
callq 0x2674f
leaq 0x1810(%r14), %rsi
movq %rbx, %rdi
callq 0x2674f
leaq 0x1820(%r14), %rsi
movq %rbx, %rdi
callq 0x2674f
movq 0x2820(%r14), %rdx
cmpq $-0x1, %rdx
je 0x2f35e
leaq 0x65e1f(%rip), %rsi     # 0x95155
movq %rbx, %rdi
xorl %eax, %eax
callq 0x26883
movq 0x2828(%r14), %rdx
cmpq $-0x1, %rdx
je 0x2f35e
leaq 0x611f0(%rip), %rsi     # 0x90544
movq %rbx, %rdi
xorl %eax, %eax
callq 0x26883
leaq 0x8(%rsp), %rdi
callq 0x2653c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq