// File: /workspace/github_c_makefile_star2_O2/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 $0x60b8, %rsp           # imm = 0x60B8
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x55c4d(%rip), %rsi     # 0x805bc
callq 0x6180
testq %rax, %rax
je 0x2a9c1
leaq 0x55c28(%rip), %rdi     # 0x805a8
movq %r12, %rsi
callq 0x1db41
testl %eax, %eax
jne 0x2a99f
leaq 0x55c1d(%rip), %rdi     # 0x805b0
movq %r12, %rsi
callq 0x1db41
testl %eax, %eax
je 0x2a9de
leaq 0x5ab57(%rip), %rsi     # 0x854fd
movq %r12, %rdi
xorl %edx, %edx
addq $0x60b8, %rsp           # imm = 0x60B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a7d4
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
addq $0x60b8, %rsp           # imm = 0x60B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6d10
leaq 0x55bd4(%rip), %rdi     # 0x805b9
movq %r12, %rsi
callq 0x1db41
testl %eax, %eax
je 0x2aa88
leaq 0x1058(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x29839
cmpl $0x707466, 0x1058(%rsp) # imm = 0x707466
je 0x2aa26
leaq 0x56f31(%rip), %rdi     # 0x8194d
movq %r12, %rsi
xorl %eax, %eax
callq 0x223fb
leaq 0x2068(%rsp), %r14
movq %r14, %rdi
callq 0x2a3e1
movl %eax, %ebp
leaq 0x56f3d(%rip), %rdi     # 0x8197c
callq 0x68f0
movq %rax, %r13
testl %ebp, %ebp
setne %al
testq %r13, %r13
sete %cl
orb %al, %cl
movb %cl, 0x7(%rsp)
je 0x2aa9e
leaq 0x2868(%rsp), %rdi
callq 0x6bd0
leaq 0x1068(%rsp), %rdx
leaq 0x1868(%rsp), %rcx
movq %r14, %rdi
movl %eax, %esi
callq 0x2a191
movl %eax, %ebp
jmp 0x2ab7a
leaq 0x565d4(%rip), %rdi     # 0x81063
movq %r12, %rsi
xorl %eax, %eax
callq 0x223fb
jmp 0x2ad41
leaq 0x3888(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x29839
cmpl $0x707466, (%rbp)       # imm = 0x707466
je 0x2aad3
leaq 0x56ec5(%rip), %rdi     # 0x81986
leaq 0x3888(%rsp), %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x223fb
leaq 0x1068(%rsp), %rcx
movl $0x1810, %r14d          # imm = 0x1810
leaq (%r15,%r14), %r9
leaq 0x56eca(%rip), %rdx     # 0x819b6
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
leaq 0x2068(%rsp), %r8
xorl %eax, %eax
callq 0x1fab2
addq %r14, %rbp
movq %rbp, %rdi
callq 0x6bd0
leaq 0x1868(%rsp), %rcx
leaq 0x4898(%rsp), %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x2a191
movl %eax, %ebp
leaq 0x56468(%rip), %rdi     # 0x80f9e
callq 0x68f0
leaq 0x51c4c(%rip), %rsi     # 0x7c78e
movq %rax, %rdi
callq 0x1daf1
testl %eax, %eax
jne 0x2ab6a
leaq 0x56e6a(%rip), %rsi     # 0x819bf
pushq $0x1
popq %rdi
leaq 0x50(%rsp), %rcx
movq %r12, %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x3c521
leaq 0x2068(%rsp), %r14
leaq 0x1058(%rsp), %r15
cmpl $-0x1, %ebp
je 0x2ad41
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x56e43(%rip), %rsi     # 0x819d6
movl %ebp, %edi
xorl %ecx, %ecx
callq 0x2a280
testl %eax, %eax
je 0x2ad1b
movq 0x3878(%rsp), %rcx
cmpq $-0x1, %rcx
je 0x2abe9
leaq 0x56e24(%rip), %rdx     # 0x819dd
movq %r15, %r12
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x1fab2
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %r15
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2a280
testl %eax, %eax
je 0x2ad1b
leaq 0x2878(%rsp), %r12
movq %r12, %rdi
callq 0x62d0
cmpb $0x2f, 0x181f(%rax,%r15)
leaq 0x56de0(%rip), %rax     # 0x819e9
leaq 0x56dde(%rip), %rcx     # 0x819ee
cmoveq %rax, %rcx
leaq 0x5639c(%rip), %rdx     # 0x80fb7
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r12, %r8
xorl %eax, %eax
callq 0x1fab2
movl %ebp, %edi
movq %r15, %rsi
callq 0x2c04b
movq 0x8(%rsp), %rax
leaq 0x4898(%rsp), %r15
cmpb $0x0, 0x7(%rsp)
cmovneq %r14, %r15
movq 0x8(%rax), %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x6270
movq %rax, %r12
pushq $0x29
popq %rsi
movq %r14, %rdi
callq 0x6270
incq %r12
movb $0x0, (%rax)
leaq 0x53d5b(%rip), %rsi     # 0x7e9d7
leaq 0x10(%rsp), %rdx
pushq $0x7
popq %rcx
movq %r12, %rdi
callq 0x1e51d
cmpl $0x6, %eax
je 0x2ac9f
leaq 0x56dfa(%rip), %rdi     # 0x81a92
xorl %eax, %eax
callq 0x223fb
movq 0x30(%rsp), %rdi
callq 0x6bd0
movl %eax, %r14d
shll $0x8, %r14d
movq 0x38(%rsp), %rdi
callq 0x6bd0
addl %eax, %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0x291f8
movl %eax, %r14d
leaq 0x8(%rsp), %rdi
callq 0x21c07
testl %r14d, %r14d
js 0x2ad1b
pushq $0xa
popq %r12
leaq 0x50(%rsp), %r15
subl $0x1, %r12d
jb 0x2ad1f
movl %r14d, %edi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2c03a
testl %eax, %eax
jne 0x2ad5a
movl %ebp, %edi
xorl %esi, %esi
callq 0x2c03a
testl %eax, %eax
je 0x2ace3
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2c06e
testl %eax, %eax
jne 0x2ace3
jmp 0x2ad32
movl %ebp, %edi
jmp 0x2ad3c
leaq 0x56ccd(%rip), %rdi     # 0x819f3
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x22186
movl %ebp, %edi
callq 0x6e80
movl %r14d, %edi
callq 0x6e80
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x60b8, %rsp           # imm = 0x60B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
je 0x2ad63
movl %ebp, (%rbx)
jmp 0x2ad45
movq 0x88266(%rip), %rax     # 0xb2fd0
movq (%rax), %rdi
callq 0x6870
movq 0x88237(%rip), %rax     # 0xb2fb0
movq (%rax), %rdi
callq 0x6870
movq 0x88250(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
callq 0x6870
movl $0x2848, %edi           # imm = 0x2848
callq 0x28bb0
movq %rax, %r15
movl %ebp, 0x10(%rax)
movl %r14d, 0x14(%rax)
leaq 0x18(%rax), %rdi
leaq 0x1058(%rsp), %rsi
movl $0x2830, %edx           # imm = 0x2830
callq 0x6570
movq %r15, %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x69f0
testl %eax, %eax
je 0x2adea
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x56c54(%rip), %rdi     # 0x81a34
movq %rax, %rsi
xorl %eax, %eax
callq 0x223fb
leaq 0x141d(%rip), %rdx      # 0x2c20e
movq %r15, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x6dc0
testl %eax, %eax
je 0x2ae1e
movl %eax, %ebp
movl %eax, %edi
callq 0x6230
leaq 0x56c52(%rip), %rdi     # 0x81a64
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x223fb
movl (%rbx), %r14d
jmp 0x2ad45