// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/udc.c
// Function: udcDataViaHttpOrFtp
int udcDataViaHttpOrFtp( char *url, bits64 offset, int size, void *buffer, struct udcFile *file)
/* Fetch a block of data of given size into buffer using url's protocol,
 * which must be http, https or ftp.  Returns number of bytes actually read.
 * Does an errAbort on error.
 * Typically will be called with size in the 8k-64k range. */
{
if (startsWith("http://",url) || startsWith("https://",url) || startsWith("ftp://",url))
    verbose(4, "reading http/https/ftp data - %d bytes at %lld - on %s\n", size, offset, url);
else
    errAbort("Invalid protocol in url [%s] in udcDataViaFtp, only http, https, or ftp supported",
	     url); 
int sd = connInfoGetSocket(file, url, offset, size);
if (sd < 0)
    errAbort("Can't get data socket for %s", url);
int rd = 0, total = 0, remaining = size;
char *buf = (char *)buffer;
while ((remaining > 0) && ((rd = ourRead(&file->ios.net, sd, buf, remaining)) > 0))
    {
    total += rd;
    buf += rd;
    remaining -= rd;
    }
if (rd == -1)
    errnoAbort("udcDataViaHttpOrFtp: error reading socket");
struct connInfo *ci = &file->connInfo;
if (ci == NULL)
    mustCloseFd(&sd);
else
    ci->offset += total;
return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x7fa3a(%rip), %rdi     # 0xdb460
callq 0x2d3d0
cmpl $0x0, %eax
jne 0x5ba5a
movq -0x8(%rbp), %rsi
leaq 0x7fa2d(%rip), %rdi     # 0xdb468
callq 0x2d3d0
cmpl $0x0, %eax
jne 0x5ba5a
movq -0x8(%rbp), %rsi
leaq 0x7fa21(%rip), %rdi     # 0xdb471
callq 0x2d3d0
cmpl $0x0, %eax
je 0x5ba7a
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %r8
movl $0x4, %edi
leaq 0x82e46(%rip), %rsi     # 0xde8b7
movb $0x0, %al
callq 0x60040
jmp 0x5ba8c
movq -0x8(%rbp), %rsi
leaq 0x82e6a(%rip), %rdi     # 0xde8ef
movb $0x0, %al
callq 0x35d40
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
callq 0x5bb90
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x5babb
movq -0x8(%rbp), %rsi
leaq 0x82e8d(%rip), %rdi     # 0xde941
movb $0x0, %al
callq 0x35d40
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x38(%rbp)
movb %al, -0x49(%rbp)
jle 0x5bb0d
movq -0x28(%rbp), %rdi
addq $0xb8, %rdi
addq $0x78, %rdi
movl -0x2c(%rbp), %esi
movq -0x40(%rbp), %rdx
movslq -0x38(%rbp), %rcx
callq 0x5be50
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
setg %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x5bb16
jmp 0x5bb3d
movl -0x30(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x30(%rbp), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
jmp 0x5bad7
cmpl $-0x1, -0x30(%rbp)
jne 0x5bb51
leaq 0x82e14(%rip), %rdi     # 0xde95e
movb $0x0, %al
callq 0x35ee0
movq -0x28(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x5bb71
leaq -0x2c(%rbp), %rdi
callq 0x2ff60
jmp 0x5bb81
movslq -0x34(%rbp), %rcx
movq -0x48(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x34(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)