// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/net.c
// Function: netUrlOpenSockets
int netUrlOpenSockets(char *url, int *retCtrlSocket)
/* Return socket descriptor (low-level file handle) for read()ing url data,
 * or -1 if error. 
 * If retCtrlSocket is non-NULL and url is FTP, set *retCtrlSocket
 * to the FTP control socket which is left open for a persistent connection.
 * close(result) (and close(*retCtrlSocket) if applicable) when done. 
 * If url is missing :// then it's just treated as a file. */
{
if (stringIn("://", url) == NULL)
    return open(url, O_RDONLY);
else
    {
    if (startsWith("http://",url) || startsWith("https://",url))
	return netGetOpenHttp(url);
    else if (startsWith("ftp://",url))
	return netGetOpenFtpSockets(url, retCtrlSocket);
    else    
	errAbort("Sorry, can only netUrlOpen http, https and ftp currently, not '%s'", url);
    }
return -1;    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6078, %rsp           # imm = 0x6078
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x61793(%rip), %rsi     # 0x916bc
callq 0x6180
testq %rax, %rax
je 0x2ff8a
leaq 0x6176e(%rip), %rdi     # 0x916a8
movq %r12, %rsi
callq 0x21b23
testl %eax, %eax
jne 0x2ff59
leaq 0x61763(%rip), %rdi     # 0x916b0
movq %r12, %rsi
callq 0x21b23
testl %eax, %eax
je 0x2ffa7
leaq 0x6669d(%rip), %rsi     # 0x965fd
leaq 0x621c7(%rip), %rdx     # 0x9212e
leaq 0x621c9(%rip), %rcx     # 0x92137
movq %r12, %rdi
xorl %r8d, %r8d
addq $0x6078, %rsp           # imm = 0x6078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f9e6
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
addq $0x6078, %rsp           # imm = 0x6078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6d10
leaq 0x6170b(%rip), %rdi     # 0x916b9
movq %r12, %rsi
callq 0x21b23
testl %eax, %eax
je 0x3004e
leaq 0x1018(%rsp), %rsi
movq %r12, %rdi
callq 0x2ed79
cmpl $0x707466, 0x1018(%rsp) # imm = 0x707466
je 0x2ffec
leaq 0x62a6b(%rip), %rdi     # 0x92a4d
movq %r12, %rsi
xorl %eax, %eax
callq 0x26e94
leaq 0x2028(%rsp), %r15
movq %r15, %rdi
callq 0x2f978
movl %eax, %ebp
leaq 0x62a77(%rip), %rdi     # 0x92a7c
callq 0x68f0
movq %rax, %r13
testl %ebp, %ebp
setne %al
testq %r13, %r13
sete %cl
orb %al, %cl
movb %cl, 0x7(%rsp)
je 0x30064
leaq 0x2828(%rsp), %rdi
callq 0x6bd0
leaq 0x1028(%rsp), %rdx
leaq 0x1828(%rsp), %rcx
movq %r15, %rdi
movl %eax, %esi
callq 0x2f727
movl %eax, %ebp
jmp 0x30142
leaq 0x6210e(%rip), %rdi     # 0x92163
movq %r12, %rsi
xorl %eax, %eax
callq 0x26e94
jmp 0x302b8
leaq 0x3848(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2ed79
cmpl $0x707466, (%rbp)       # imm = 0x707466
je 0x30099
leaq 0x629ff(%rip), %rdi     # 0x92a86
leaq 0x3848(%rsp), %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x26e94
leaq 0x1028(%rsp), %rcx
movl $0x1810, %r14d          # imm = 0x1810
leaq 0x1018(%rsp), %rax
leaq (%rax,%r14), %r9
leaq 0x629fc(%rip), %rdx     # 0x92ab6
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
leaq 0x2028(%rsp), %r8
xorl %eax, %eax
callq 0x23f33
addq %r14, %rbp
movq %rbp, %rdi
callq 0x6bd0
leaq 0x1828(%rsp), %rcx
leaq 0x4858(%rsp), %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x2f727
movl %eax, %ebp
leaq 0x61f9a(%rip), %rdi     # 0x9209e
callq 0x68f0
leaq 0x5d67e(%rip), %rsi     # 0x8d78e
movq %rax, %rdi
callq 0x21acd
testl %eax, %eax
jne 0x3013a
leaq 0x6299c(%rip), %rsi     # 0x92abf
leaq 0x10(%rsp), %rcx
movl $0x1, %edi
movq %r12, %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x427e5
leaq 0x2028(%rsp), %r15
cmpl $-0x1, %ebp
je 0x302b8
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x62978(%rip), %rsi     # 0x92ad6
movl %ebp, %edi
xorl %ecx, %ecx
callq 0x2f81b
testl %eax, %eax
je 0x302b1
movq 0x3838(%rsp), %rcx
cmpq $-0x1, %rcx
je 0x301ae
leaq 0x62959(%rip), %rdx     # 0x92add
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x23f33
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2f81b
testl %eax, %eax
je 0x302b1
leaq 0x2838(%rsp), %r14
movq %r14, %rdi
callq 0x62d0
leaq 0x1018(%rsp), %rcx
cmpb $0x2f, 0x181f(%rax,%rcx)
leaq 0x62914(%rip), %rax     # 0x92ae9
leaq 0x62912(%rip), %rcx     # 0x92aee
cmoveq %rax, %rcx
leaq 0x61ed0(%rip), %rdx     # 0x920b7
movq %r15, %r12
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %r8
xorl %eax, %eax
callq 0x23f33
movq %r15, %rdi
callq 0x62d0
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x23517
leaq 0x8(%rsp), %r15
movq (%r15), %rax
leaq 0x4858(%rsp), %r14
cmpb $0x0, 0x7(%rsp)
cmovneq %r12, %r14
movq 0x8(%rax), %rdi
callq 0x3181b
movq %r14, %rdi
movl %eax, %esi
callq 0x2e6a5
movl %eax, %r14d
movq %r15, %rdi
callq 0x2651d
testl %r14d, %r14d
js 0x302b1
movl $0xa, %r12d
leaq 0x10(%rsp), %r15
movl %r14d, %edi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2f372
testl %eax, %eax
jne 0x302d3
movl %ebp, %edi
xorl %esi, %esi
callq 0x2f372
testl %eax, %eax
je 0x3028d
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x31650
testl %eax, %eax
je 0x302a5
decl %r12d
jne 0x3025d
leaq 0x6285a(%rip), %rdi     # 0x92af3
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x26bea
movl %ebp, %edi
callq 0x6e80
movl %r14d, %edi
jmp 0x302b3
movl %ebp, %edi
callq 0x6e80
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x6078, %rsp           # imm = 0x6078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
je 0x302dc
movl %ebp, (%rbx)
jmp 0x302be
movq 0x8eced(%rip), %rax     # 0xbefd0
movq (%rax), %rdi
callq 0x6870
movq 0x8ecbe(%rip), %rax     # 0xbefb0
movq (%rax), %rdi
callq 0x6870
movq 0x8ecd7(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
callq 0x6870
movl $0x2848, %edi           # imm = 0x2848
callq 0x2dff4
movq %rax, %r15
movl %ebp, 0x10(%rax)
movl %r14d, 0x14(%rax)
leaq 0x18(%rax), %rdi
leaq 0x1018(%rsp), %rsi
movl $0x2830, %edx           # imm = 0x2830
callq 0x6570
movq %r15, %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x69f0
testl %eax, %eax
je 0x30363
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x627db(%rip), %rdi     # 0x92b34
movq %rax, %rsi
xorl %eax, %eax
callq 0x26e94
leaq 0x1528(%rip), %rdx      # 0x31892
movq %r15, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x6dc0
testl %eax, %eax
je 0x30397
movl %eax, %ebp
movl %eax, %edi
callq 0x6230
leaq 0x627d9(%rip), %rdi     # 0x92b64
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x26e94
movl (%rbx), %r14d
jmp 0x302be