// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0x35020
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x353b0
movq -0x10(%rbp), %rdi
leaq 0x98cd2(%rip), %rsi     # 0xdb474
callq 0x353b0
movq -0x8(%rbp), %rax
movsbl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x42839
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x63e90
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x353b0
movq -0x18(%rbp), %rdi
callq 0x40d40
movq -0x8(%rbp), %rax
movsbl 0x810(%rax), %eax
cmpl $0x0, %eax
je 0x42829
movq -0x10(%rbp), %rdi
leaq 0x97f23(%rip), %rsi     # 0xda71d
callq 0x353b0
movq -0x8(%rbp), %rdi
addq $0x810, %rdi            # imm = 0x810
callq 0x63e90
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x353b0
movq -0x20(%rbp), %rdi
callq 0x40d40
movq -0x10(%rbp), %rdi
leaq 0x99564(%rip), %rsi     # 0xdbd98
callq 0x353b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x1010, %rsi           # imm = 0x1010
callq 0x353b0
movq -0x8(%rbp), %rdi
leaq 0x9c5d8(%rip), %rsi     # 0xdee30
callq 0x6a40
cmpl $0x0, %eax
jne 0x42882
movq -0x8(%rbp), %rsi
addq $0x1810, %rsi           # imm = 0x1810
leaq 0x99508(%rip), %rdi     # 0xdbd7c
callq 0x6a40
cmpl $0x0, %eax
je 0x42908
movq -0x8(%rbp), %rdi
leaq 0x994bd(%rip), %rsi     # 0xdbd4a
callq 0x6a40
cmpl $0x0, %eax
jne 0x428b3
movq -0x8(%rbp), %rsi
addq $0x1810, %rsi           # imm = 0x1810
leaq 0x994cc(%rip), %rdi     # 0xdbd75
callq 0x6a40
cmpl $0x0, %eax
je 0x42908
movq -0x8(%rbp), %rdi
leaq 0x99491(%rip), %rsi     # 0xdbd4f
callq 0x6a40
cmpl $0x0, %eax
jne 0x428e4
movq -0x8(%rbp), %rsi
addq $0x1810, %rsi           # imm = 0x1810
leaq 0x9949e(%rip), %rdi     # 0xdbd78
callq 0x6a40
cmpl $0x0, %eax
je 0x42908
movq -0x10(%rbp), %rdi
leaq 0x97e2e(%rip), %rsi     # 0xda71d
callq 0x353b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x1810, %rsi           # imm = 0x1810
callq 0x353b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x1820, %rsi           # imm = 0x1820
callq 0x353b0
movq -0x8(%rbp), %rax
cmpq $-0x1, 0x2820(%rax)
je 0x42974
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x2820(%rax), %rdx
leaq 0x9c61f(%rip), %rsi     # 0xdef5f
movb $0x0, %al
callq 0x35540
movq -0x8(%rbp), %rax
cmpq $-0x1, 0x2828(%rax)
je 0x42972
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x2828(%rax), %rdx
leaq 0x97991(%rip), %rsi     # 0xda2fc
movb $0x0, %al
callq 0x35540
jmp 0x42974
leaq -0x10(%rbp), %rdi
callq 0x350c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)