// File: /workspace/github_c_makefile_star2_O1/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 0x61993(%rip), %rsi     # 0x915cc
callq 0x6180
testq %rax, %rax
je 0x2fc9a
leaq 0x6196e(%rip), %rdi     # 0x915b8
movq %r12, %rsi
callq 0x217c8
testl %eax, %eax
jne 0x2fc69
leaq 0x61963(%rip), %rdi     # 0x915c0
movq %r12, %rsi
callq 0x217c8
testl %eax, %eax
je 0x2fcb7
leaq 0x668ad(%rip), %rsi     # 0x9651d
leaq 0x623c7(%rip), %rdx     # 0x9203e
leaq 0x623c9(%rip), %rcx     # 0x92047
movq %r12, %rdi
xorl %r8d, %r8d
addq $0x6078, %rsp           # imm = 0x6078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f6c2
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 0x6190b(%rip), %rdi     # 0x915c9
movq %r12, %rsi
callq 0x217c8
testl %eax, %eax
je 0x2fd5e
leaq 0x1018(%rsp), %rsi
movq %r12, %rdi
callq 0x2ea40
cmpl $0x707466, 0x1018(%rsp) # imm = 0x707466
je 0x2fcfc
leaq 0x62c6b(%rip), %rdi     # 0x9295d
movq %r12, %rsi
xorl %eax, %eax
callq 0x26b6f
leaq 0x2028(%rsp), %r15
movq %r15, %rdi
callq 0x2f654
movl %eax, %ebp
leaq 0x62c77(%rip), %rdi     # 0x9298c
callq 0x68f0
movq %rax, %r13
testl %ebp, %ebp
setne %al
testq %r13, %r13
sete %cl
orb %al, %cl
movb %cl, 0x7(%rsp)
je 0x2fd74
leaq 0x2828(%rsp), %rdi
callq 0x6bd0
leaq 0x1028(%rsp), %rdx
leaq 0x1828(%rsp), %rcx
movq %r15, %rdi
movl %eax, %esi
callq 0x2f3f8
movl %eax, %ebp
jmp 0x2fe52
leaq 0x6230e(%rip), %rdi     # 0x92073
movq %r12, %rsi
xorl %eax, %eax
callq 0x26b6f
jmp 0x2ffc8
leaq 0x3848(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2ea40
cmpl $0x707466, (%rbp)       # imm = 0x707466
je 0x2fda9
leaq 0x62bff(%rip), %rdi     # 0x92996
leaq 0x3848(%rsp), %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x26b6f
leaq 0x1028(%rsp), %rcx
movl $0x1810, %r14d          # imm = 0x1810
leaq 0x1018(%rsp), %rax
leaq (%rax,%r14), %r9
leaq 0x62bfc(%rip), %rdx     # 0x929c6
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
leaq 0x2028(%rsp), %r8
xorl %eax, %eax
callq 0x23c18
addq %r14, %rbp
movq %rbp, %rdi
callq 0x6bd0
leaq 0x1828(%rsp), %rcx
leaq 0x4858(%rsp), %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x2f3f8
movl %eax, %ebp
leaq 0x6219a(%rip), %rdi     # 0x91fae
callq 0x68f0
leaq 0x5d96e(%rip), %rsi     # 0x8d78e
movq %rax, %rdi
callq 0x21769
testl %eax, %eax
jne 0x2fe4a
leaq 0x62b9c(%rip), %rsi     # 0x929cf
leaq 0x10(%rsp), %rcx
movl $0x1, %edi
movq %r12, %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x4246e
leaq 0x2028(%rsp), %r15
cmpl $-0x1, %ebp
je 0x2ffc8
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x62b78(%rip), %rsi     # 0x929e6
movl %ebp, %edi
xorl %ecx, %ecx
callq 0x2f4ec
testl %eax, %eax
je 0x2ffc1
movq 0x3838(%rsp), %rcx
cmpq $-0x1, %rcx
je 0x2febe
leaq 0x62b59(%rip), %rdx     # 0x929ed
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x23c18
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2f4ec
testl %eax, %eax
je 0x2ffc1
leaq 0x2838(%rsp), %r14
movq %r14, %rdi
callq 0x62d0
leaq 0x1018(%rsp), %rcx
cmpb $0x2f, 0x181f(%rax,%rcx)
leaq 0x62b14(%rip), %rax     # 0x929f9
leaq 0x62b12(%rip), %rcx     # 0x929fe
cmoveq %rax, %rcx
leaq 0x620d0(%rip), %rdx     # 0x91fc7
movq %r15, %r12
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %r8
xorl %eax, %eax
callq 0x23c18
movq %r15, %rdi
callq 0x62d0
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x231f9
leaq 0x8(%rsp), %r15
movq (%r15), %rax
leaq 0x4858(%rsp), %r14
cmpb $0x0, 0x7(%rsp)
cmovneq %r12, %r14
movq 0x8(%rax), %rdi
callq 0x31538
movq %r14, %rdi
movl %eax, %esi
callq 0x2e349
movl %eax, %r14d
movq %r15, %rdi
callq 0x2620d
testl %r14d, %r14d
js 0x2ffc1
movl $0xa, %r12d
leaq 0x10(%rsp), %r15
movl %r14d, %edi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2f00f
testl %eax, %eax
jne 0x2ffe3
movl %ebp, %edi
xorl %esi, %esi
callq 0x2f00f
testl %eax, %eax
je 0x2ff9d
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x31355
testl %eax, %eax
je 0x2ffb5
decl %r12d
jne 0x2ff6d
leaq 0x62a5a(%rip), %rdi     # 0x92a03
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x268ca
movl %ebp, %edi
callq 0x6e80
movl %r14d, %edi
jmp 0x2ffc3
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 0x2ffec
movl %ebp, (%rbx)
jmp 0x2ffce
movq 0x8efdd(%rip), %rax     # 0xbefd0
movq (%rax), %rdi
callq 0x6870
movq 0x8efae(%rip), %rax     # 0xbefb0
movq (%rax), %rdi
callq 0x6870
movq 0x8efc7(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
callq 0x6870
movl $0x2848, %edi           # imm = 0x2848
callq 0x2dc95
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 0x30073
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x629db(%rip), %rdi     # 0x92a44
movq %rax, %rsi
xorl %eax, %eax
callq 0x26b6f
leaq 0x1535(%rip), %rdx      # 0x315af
movq %r15, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x6dc0
testl %eax, %eax
je 0x300a7
movl %eax, %ebp
movl %eax, %edi
callq 0x6230
leaq 0x629d9(%rip), %rdi     # 0x92a74
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x26b6f
movl (%rbx), %r14d
jmp 0x2ffce