LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netUrlHeadExt
int netUrlHeadExt(char *url, char *method, struct hash *hash)
/* Go get head and return status.  Return negative number if
 * can't get head. If hash is non-null, fill it with header
 * lines with upper cased keywords for case-insensitive lookup, 
 * including hopefully CONTENT-TYPE: . */
{
int sd = netOpenHttpExt(url, method, NULL);
int status = EIO;
if (sd >= 0)
    {
    char *line, *word;
    struct lineFile *lf = lineFileAttach(url, TRUE, sd);

    if (lineFileNext(lf, &line, NULL))
	{
	if (startsWith("HTTP/", line))
	    {
	    word = nextWord(&line);
	    word = nextWord(&line);
	    if (word != NULL && isdigit(word[0]))
	        {
		status = atoi(word);
		if (hash != NULL)
		    {
		    while (lineFileNext(lf, &line, NULL))
		        {
			word = nextWord(&line);
			if (word == NULL)
			    break;
			hashAdd(hash, strUpper(word), cloneString(skipLeadingSpaces(line)));
			}
		    }
		}
	    }
	}
    lineFileClose(&lf);
    }
else
    status = errno;
return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x625a0(%rip), %rdx     # 0x9203e
leaq 0x625a2(%rip), %rcx     # 0x92047
xorl %r8d, %r8d
callq 0x2f6c2
testl %eax, %eax
js 0x2fbb2
movq %r14, %rdi
movl $0x1, %esi
movl %eax, %edx
callq 0x29de2
movq %rax, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x2a455
movl $0x5, %ebp
testl %eax, %eax
je 0x2fba6
movq 0x8(%rsp), %rsi
leaq 0x61911(%rip), %rdi     # 0x91402
callq 0x217c8
testl %eax, %eax
je 0x2fba6
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x229cd
movq %r14, %rdi
callq 0x229cd
testq %rax, %rax
je 0x2fba6
movq %rax, %r14
callq 0x6790
movq (%rax), %rax
movsbq (%r14), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x2fba6
movq %r14, %rdi
callq 0x6bd0
movl %eax, %ebp
testq %rbx, %rbx
je 0x2fba6
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x2a455
testl %eax, %eax
je 0x2fba6
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x229cd
testq %rax, %rax
je 0x2fba6
movq %rax, %rdi
callq 0x21d0b
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x21238
movq %rax, %rdi
callq 0x1f9f6
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x28dbe
movq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2a455
testl %eax, %eax
jne 0x2fb5b
leaq 0x10(%rsp), %rdi
callq 0x2ab48
jmp 0x2fbb9
callq 0x6060
movl (%rax), %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netSlurpFile
struct dyString *netSlurpFile(int sd)
/* Slurp file into dynamic string and return. */
{
char buf[4*1024];
int readSize;
struct dyString *dy = newDyString(4*1024);

/* Slurp file into dy and return. */
while ((readSize = read(sd, buf, sizeof(buf))) > 0)
    dyStringAppendN(dy, buf, readSize);
return dy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %edi, %ebx
movl $0x1000, %edi           # imm = 0x1000
callq 0x261d0
movq %rax, %r14
movq %rsp, %rsi
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
callq 0x6aa0
testl %eax, %eax
jle 0x30107
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x262da
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r15, %rsi
callq 0x6aa0
testl %eax, %eax
jg 0x300e7
movq %r14, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netSlurpUrl
struct dyString *netSlurpUrl(char *url)
/* Go grab all of URL and return it as dynamic string. */
{
int sd = netUrlOpen(url);
if (sd < 0)
    errAbort("netSlurpUrl: failed to open socket for [%s]", url);
struct dyString *dy = netSlurpFile(sd);
close(sd);
return dy;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %esi, %esi
callq 0x2fc1b
movl %eax, %ebx
testl %eax, %eax
jns 0x3013c
leaq 0x61f84(%rip), %rdi     # 0x920b6
movq %r14, %rsi
xorl %eax, %eax
callq 0x26b6f
movl %ebx, %edi
callq 0x300b6
movq %rax, %r14
movl %ebx, %edi
callq 0x6e80
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: transferParamsToRedirectedUrl
char *transferParamsToRedirectedUrl(char *url, char *newUrl)
/* Transfer password, byteRange, and any other parameters from url to newUrl and return result.
 * freeMem result. */
{
struct netParsedUrl npu, newNpu;
/* Parse the old URL to make parts available for graft onto the redirected url. */
/* This makes redirection work with byterange urls and user:password@ */
netParseUrl(url, &npu);
netParseUrl(newUrl, &newNpu);
if (npu.byteRangeStart != -1)
    {
    newNpu.byteRangeStart = npu.byteRangeStart;
    newNpu.byteRangeEnd = npu.byteRangeEnd;
    }
if ((npu.user[0] != 0) && (newNpu.user[0] == 0))
    {
    safecpy(newNpu.user,     sizeof newNpu.user,     npu.user);
    safecpy(newNpu.password, sizeof newNpu.password, npu.password);
    }
return urlFromNetParsedUrl(&newNpu);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x5060, %rsp           # imm = 0x5060
movq %rsi, %r15
leaq 0x2830(%rsp), %rbx
movq %rbx, %rsi
callq 0x2ea40
movq %rsp, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2ea40
movq 0x2820(%rbx), %rax
cmpq $-0x1, %rax
je 0x3075c
movq %rax, 0x2820(%rsp)
movq 0x5058(%rsp), %rax
movq %rax, 0x2828(%rsp)
cmpb $0x0, 0x2840(%rsp)
je 0x3079f
cmpb $0x0, 0x10(%rsp)
jne 0x3079f
leaq 0x2840(%rsp), %rdx
leaq 0x10(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x21264
movl $0x810, %eax            # imm = 0x810
addq %rax, %r14
addq %rax, %rbx
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21264
movq %rsp, %rdi
callq 0x2ee5e
addq $0x5060, %rsp           # imm = 0x5060
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netLineFileMayOpen
struct lineFile *netLineFileMayOpen(char *url)
/* Return a lineFile attached to url. http skips header.
 * Supports some compression formats.  Prints warning message, but
 * does not abort, just returning NULL if there's a problem. */
{
int sd = netUrlOpen(url);
if (sd < 0)
    {
    warn("Couldn't open %s", url);
    return NULL;
    }
else
    {
    struct lineFile *lf = NULL;
    char *newUrl = NULL;
    int newSd = 0;
    if (startsWith("http://",url) || startsWith("https://",url))
	{  
	if (!netSkipHttpHeaderLinesHandlingRedirect(sd, url, &newSd, &newUrl))
	    {
	    return NULL;
	    }
	if (newUrl != NULL)
	    {
    	    /*  Update sd with newSd, replace it with newUrl, etc. */
	    sd = newSd;
	    url = newUrl;
	    }
	}
    char *urlDecoded = cloneString(url);
    cgiDecode(url, urlDecoded, strlen(url));
    boolean isCompressed =
	(endsWith(urlDecoded,".gz") ||
   	 endsWith(urlDecoded,".Z")  ||
	 endsWith(urlDecoded,".bz2"));
    freeMem(urlDecoded);
    if (isCompressed)
	{
	lf = lineFileDecompressFd(url, TRUE, sd);
           /* url needed only for compress type determination */
	}
    else
	{
	lf = lineFileAttach(url, TRUE, sd);
	}
    if (newUrl) 
	freeMem(newUrl); 
    return lf;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %esi, %esi
callq 0x2fc1b
testl %eax, %eax
js 0x30a17
movl %eax, %ebp
movq $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
leaq 0x60c5e(%rip), %rdi     # 0x915b8
movq %rbx, %rsi
callq 0x217c8
testl %eax, %eax
jne 0x30979
leaq 0x60c53(%rip), %rdi     # 0x915c0
movq %rbx, %rsi
callq 0x217c8
testl %eax, %eax
je 0x309a6
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x307b4
testl %eax, %eax
je 0x30a2d
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x309a6
movl 0xc(%rsp), %ebp
movq %rax, %rbx
movq %rbx, %rdi
callq 0x1f9f6
movq %rax, %r14
movq %rbx, %rdi
callq 0x62d0
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x448ce
leaq 0x67c47(%rip), %rsi     # 0x98614
movq %r14, %rdi
callq 0x21aed
testl %eax, %eax
jne 0x309ec
leaq 0x5d690(%rip), %rsi     # 0x8e070
movq %r14, %rdi
callq 0x21aed
testl %eax, %eax
je 0x30a3e
movq %r14, %rdi
callq 0x2dd41
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x29e35
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x30a30
callq 0x2dd41
jmp 0x30a30
leaq 0x61972(%rip), %rdi     # 0x92390
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x268ca
jmp 0x30a30
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d62e(%rip), %rsi     # 0x8e073
movq %r14, %rdi
callq 0x21aed
movl %eax, %r15d
movq %r14, %rdi
callq 0x2dd41
testl %r15d, %r15d
jne 0x309f4
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x29de2
jmp 0x30a03
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netUrlMustOpenPastHeader
int netUrlMustOpenPastHeader(char *url)
/* Get socket descriptor for URL.  Process header, handling any forwarding and
 * the like.  Do errAbort if there's a problem, which includes anything but a 200
 * return from http after forwarding. */
{
int sd = netUrlOpen(url);
if (sd < 0)
    noWarnAbort();
int newSd = 0;
if (startsWith("http://",url) || startsWith("https://",url))
    {  
    char *newUrl = NULL;
    if (!netSkipHttpHeaderLinesHandlingRedirect(sd, url, &newSd, &newUrl))
	noWarnAbort();
    if (newUrl != NULL)
	{
	sd = newSd;
	freeMem(newUrl); 
	}
    }
return sd;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
xorl %esi, %esi
callq 0x2fc1b
movl %eax, %ebx
testl %eax, %eax
jns 0x30a8c
xorl %eax, %eax
callq 0x26c27
movl $0x0, 0xc(%rsp)
leaq 0x60b1d(%rip), %rdi     # 0x915b8
movq %r14, %rsi
callq 0x217c8
testl %eax, %eax
jne 0x30aba
leaq 0x60b12(%rip), %rdi     # 0x915c0
movq %r14, %rsi
callq 0x217c8
testl %eax, %eax
je 0x30af3
leaq 0x10(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0xc(%rsp), %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x307b4
testl %eax, %eax
jne 0x30ae0
xorl %eax, %eax
callq 0x26c27
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x30af3
movl 0xc(%rsp), %ebx
callq 0x2dd41
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netLineFileSilentOpen
struct lineFile *netLineFileSilentOpen(char *url)
/* Open a lineFile on a URL.  Just return NULL without any user
 * visible warning message if there's a problem. */
{
pushSilentWarnHandler();
struct lineFile *lf = netLineFileMayOpen(url);
popWarnHandler();
return lf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
callq 0x26e23
movq %rbx, %rdi
callq 0x30924
movq %rax, %rbx
xorl %eax, %eax
callq 0x26bef
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netReadTextFileIfExists
char *netReadTextFileIfExists(char *url)
/* Read entire URL and return it as a string.  URL should be text (embedded zeros will be
 * interpreted as end of string).  If the url doesn't exist or has other problems,
 * returns NULL. */
{
struct lineFile *lf = netLineFileSilentOpen(url);
if (lf == NULL)
    return NULL;
char *text = lineFileReadAll(lf);
lineFileClose(&lf);
return text;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %eax, %eax
callq 0x26e23
movq %rbx, %rdi
callq 0x30924
movq %rax, %rbx
xorl %eax, %eax
callq 0x26bef
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
je 0x30b64
movq %rbx, %rdi
callq 0x2b836
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2ab48
movq %rbx, %rax
jmp 0x30b66
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netLineFileOpen
struct lineFile *netLineFileOpen(char *url)
/* Return a lineFile attached to url.  This one
 * will skip any headers.   Free this with
 * lineFileClose(). */
{
struct lineFile *lf = netLineFileMayOpen(url);
if (lf == NULL)
    noWarnAbort();
return lf;
}

// Assembly:
pushq %rbx
callq 0x30924
movq %rax, %rbx
testq %rax, %rax
jne 0x30b81
xorl %eax, %eax
callq 0x26c27
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netSendString
boolean netSendString(int sd, char *s)
/* Send a string down a socket - length byte first. */
{
int length = strlen(s);
UBYTE len;

if (length > 255)
    errAbort("Trying to send a string longer than 255 bytes (%d bytes)", length);
len = length;
if (write(sd, &len, 1)<0)
    {
    warn("Couldn't send string to socket");
    return FALSE;
    }
if (write(sd, s, length)<0)
    {
    warn("Couldn't send string to socket");
    return FALSE;
    }
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq %rsi, %rdi
callq 0x62d0
movq %rax, %r14
cmpl $0x100, %r14d           # imm = 0x100
jl 0x30bb8
leaq 0x617f3(%rip), %rdi     # 0x923a1
movl %r14d, %esi
xorl %eax, %eax
callq 0x26b6f
leaq 0xf(%rsp), %rsi
movb %r14b, (%rsi)
movl $0x1, %edx
movl %ebp, %edi
callq 0x6260
testq %rax, %rax
js 0x30be8
movslq %r14d, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x6260
movl $0x1, %ebx
testq %rax, %rax
jns 0x30bf8
leaq 0x617eb(%rip), %rdi     # 0x923da
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x268ca
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netSendLongString
boolean netSendLongString(int sd, char *s)
/* Send a long string down socket: two bytes for length. */
{
unsigned length = strlen(s);
UBYTE b[2];

if (length >= 64*1024)
    {
    warn("Trying to send a string longer than 64k bytes (%d bytes)", length);
    return FALSE;
    }
b[0] = (length>>8);
b[1] = (length&0xff);
if (write(sd, b, 2) < 0)
    {
    warn("Couldn't send long string to socket");
    return FALSE;
    }
if (write(sd, s, length)<0)
    {
    warn("Couldn't send long string to socket");
    return FALSE;
    }
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq %rsi, %rdi
callq 0x62d0
movq %rax, %r14
cmpl $0x10000, %r14d         # imm = 0x10000
jb 0x30c39
leaq 0x617ce(%rip), %rdi     # 0x923f9
xorl %ebx, %ebx
movl %r14d, %esi
xorl %eax, %eax
callq 0x268ca
jmp 0x30c81
movl %r14d, %eax
rolw $0x8, %ax
leaq 0xe(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6260
testq %rax, %rax
js 0x30c71
movzwl %r14w, %edx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x6260
movl $0x1, %ebx
testq %rax, %rax
jns 0x30c81
leaq 0x617ba(%rip), %rdi     # 0x92432
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x268ca
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netSendHugeString
boolean netSendHugeString(int sd, char *s)
/* Send a long string down socket: four bytes for length. */
{
unsigned long length = strlen(s);
unsigned long l = length;
UBYTE b[4];
int i;
for (i=3; i>=0; --i)
    {
    b[i] = l & 0xff;
    l >>= 8;
    }
if (write(sd, b, 4) < 0)
    {
    warn("Couldn't send huge string to socket");
    return FALSE;
    }
if (write(sd, s, length) < 0)
    {
    warn("Couldn't send huge string to socket");
    return FALSE;
    }
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq %rsi, %rdi
callq 0x62d0
movq %rax, %r14
movl $0x4, %eax
movq %r14, %rcx
movb %cl, 0xb(%rsp,%rax)
shrq $0x8, %rcx
decq %rax
jne 0x30cac
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movl %ebp, %edi
callq 0x6260
testq %rax, %rax
js 0x30ce6
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6260
movl $0x1, %ebx
testq %rax, %rax
jns 0x30cf6
leaq 0x61769(%rip), %rdi     # 0x92456
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x268ca
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netGetString
char *netGetString(int sd, char buf[256])
/* Read string into buf and return it.  If buf is NULL
 * an internal buffer will be used. Print warning message
 * and return NULL if any problem. */
{
static char sbuf[256];
UBYTE len = 0;
int length;
int sz;
if (buf == NULL) buf = sbuf;
sz = netReadAll(sd, &len, 1);
if (sz == 0)
    return NULL;
if (sz < 0)
    {
    warn("Couldn't read string length");
    return NULL;
    }
length = len;
if (length > 0)
    if (netReadAll(sd, buf, length) < 0)
	{
	warn("Couldn't read string body");
	return NULL;
	}
buf[length] = 0;
return buf;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebp
leaq 0xf(%rsp), %rax
movb $0x0, (%rax)
testq %rsi, %rsi
leaq 0x929f3(%rip), %rbx     # 0xc3710
cmovneq %rsi, %rbx
movl $0x1, %edx
movq %rax, %rsi
callq 0x2e8cb
testl %eax, %eax
je 0x30d58
js 0x30d5c
movzbl 0xf(%rsp), %r14d
testq %r14, %r14
je 0x30d51
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2e8cb
testq %rax, %rax
js 0x30d65
movb $0x0, (%rbx,%r14)
jmp 0x30d75
xorl %ebx, %ebx
jmp 0x30d75
leaq 0x61717(%rip), %rdi     # 0x9247a
jmp 0x30d6c
leaq 0x6172a(%rip), %rdi     # 0x92496
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x268ca
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netGetLongString
char *netGetLongString(int sd)
/* Read string and return it.  freeMem
 * the result when done. */
{
UBYTE b[2];
char *s = NULL;
int length = 0;
int sz;
b[0] = b[1] = 0;
sz = netReadAll(sd, b, 2);
if (sz == 0)
    return NULL;
if (sz < 0)
    {
    warn("Couldn't read long string length");
    return NULL;
    }
length = (b[0]<<8) + b[1];
s = needMem(length+1);
if (length > 0)
    if (netReadAll(sd, s, length) < 0)
	{
	warn("Couldn't read long string body");
	return NULL;
	}
s[length] = 0;
return s;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebp
leaq 0xe(%rsp), %rsi
movw $0x0, (%rsi)
movl $0x2, %edx
callq 0x2e8cb
testl %eax, %eax
je 0x30ddd
js 0x30de1
movzwl 0xe(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
leal 0x1(%r14), %edi
callq 0x2dc95
movq %rax, %rbx
testw %r14w, %r14w
je 0x30dd6
movl %r14d, %edx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2e8cb
testq %rax, %rax
js 0x30dea
movb $0x0, (%rbx,%r14)
jmp 0x30dfa
xorl %ebx, %ebx
jmp 0x30dfa
leaq 0x616c8(%rip), %rdi     # 0x924b0
jmp 0x30df1
leaq 0x616e0(%rip), %rdi     # 0x924d1
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x268ca
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netGetHugeString
char *netGetHugeString(int sd)
/* Read string and return it.  freeMem
 * the result when done. */
{
UBYTE b[4];
char *s = NULL;
unsigned long length = 0;
int sz, i;
sz = netReadAll(sd, b, 4);
if (sz == 0)
    return NULL;
if (sz < 4)
    {
    warn("Couldn't read huge string length");
    return NULL;
    }
for (i=0; i<4; ++i)
    {
    length <<= 8;
    length += b[i];
    }
s = needMem(length+1);
if (length > 0)
    {
    if (netReadAll(sd, s, length) < 0)
	{
	warn("Couldn't read huge string body");
	return NULL;
	}
    }
s[length] = 0;
return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq 0x2e8cb
testl %eax, %eax
je 0x30e3c
cmpl $0x4, %eax
jge 0x30e41
leaq 0x616c0(%rip), %rdi     # 0x924f0
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x268ca
jmp 0x30e87
xorl %r14d, %r14d
jmp 0x30e87
xorl %eax, %eax
xorl %r15d, %r15d
movq %r15, %rcx
shlq $0x8, %rcx
movzbl 0xc(%rsp,%rax), %r15d
orq %rcx, %r15
incq %rax
cmpq $0x4, %rax
jne 0x30e46
leaq 0x1(%r15), %rdi
callq 0x2dc95
movq %rax, %r14
testq %r15, %r15
je 0x30e82
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2e8cb
testq %rax, %rax
js 0x30e94
movb $0x0, (%r14,%r15)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x61676(%rip), %rdi     # 0x92511
jmp 0x30e30
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netRecieveString
char *netRecieveString(int sd, char buf[256])
/* Read string into buf and return it.  If buf is NULL
 * an internal buffer will be used. Abort if any problem. */
{
char *s = netGetString(sd, buf);
if (s == NULL)
     noWarnAbort();   
return s;
}

// Assembly:
pushq %rbx
callq 0x30d01
movq %rax, %rbx
testq %rax, %rax
jne 0x30eb2
xorl %eax, %eax
callq 0x26c27
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netRecieveLongString
char *netRecieveLongString(int sd)
/* Read string and return it.  freeMem
 * the result when done. Abort if any problem*/
{
char *s = netGetLongString(sd);
if (s == NULL)
     noWarnAbort();   
return s;
}

// Assembly:
pushq %rbx
callq 0x30d81
movq %rax, %rbx
testq %rax, %rax
jne 0x30ecc
xorl %eax, %eax
callq 0x26c27
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netRecieveHugeString
char *netRecieveHugeString(int sd)
/* Read string and return it.  freeMem
 * the result when done. Abort if any problem*/
{
char *s = netGetHugeString(sd);
if (s == NULL)
     noWarnAbort();   
return s;
}

// Assembly:
pushq %rbx
callq 0x30e06
movq %rax, %rbx
testq %rax, %rax
jne 0x30ee6
xorl %eax, %eax
callq 0x26c27
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netHttpLineFileMayOpen
struct lineFile *netHttpLineFileMayOpen(char *url, struct netParsedUrl **npu)
/* Parse URL and open an HTTP socket for it but don't send a request yet. */
{
int sd;
struct lineFile *lf;

/* Parse the URL and try to connect. */
AllocVar(*npu);
netParseUrl(url, *npu);
if (!sameString((*npu)->protocol, "http"))
    errAbort("netHttpLineFileMayOpen: url (%s) is not for http.", url);
sd = netConnect((*npu)->host, atoi((*npu)->port));
if (sd < 0)
    return NULL;

/* Return handle. */
lf = lineFileAttach(url, TRUE, sd);
return lf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x2830, %edi           # imm = 0x2830
callq 0x2dc95
movq %rax, (%r14)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2ea40
movq (%r14), %rdi
leaq 0x60f8b(%rip), %rsi     # 0x91ea2
callq 0x6a50
testl %eax, %eax
je 0x30f31
leaq 0x61609(%rip), %rdi     # 0x92530
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26b6f
movq (%r14), %rdi
leaq 0x1010(%rdi), %r14
addq $0x1810, %rdi           # imm = 0x1810
callq 0x6bd0
movq %r14, %rdi
movl %eax, %esi
callq 0x2e349
testl %eax, %eax
js 0x30f6b
movq %rbx, %rdi
movl $0x1, %esi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x29de2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netHttpGet
void netHttpGet(struct lineFile *lf, struct netParsedUrl *npu,
		boolean keepAlive)
/* Send a GET request, possibly with Keep-Alive. */
{
struct dyString *dy = newDyString(512);

/* Ask remote server for the file/query. */
dyStringPrintf(dy, "GET %s HTTP/1.1\r\n", npu->file);
dyStringPrintf(dy, "User-Agent: genome.ucsc.edu/net.c\r\n");
dyStringPrintf(dy, "Host: %s:%s\r\n", npu->host, npu->port);
if (!sameString(npu->user,""))
    {
    char up[256];
    char *b64up = NULL;
    safef(up,sizeof(up), "%s:%s", npu->user, npu->password);
    b64up = base64Encode(up, strlen(up));
    dyStringPrintf(dy, "Authorization: Basic %s\r\n", b64up);
    freez(&b64up);
    }
dyStringAppend(dy, "Accept: */*\r\n");
if (keepAlive)
  {
    dyStringAppend(dy, "Connection: Keep-Alive\r\n");
    dyStringAppend(dy, "Connection: Persist\r\n");
  }
else
    dyStringAppend(dy, "Connection: close\r\n");
dyStringAppend(dy, "\r\n");
mustWriteFd(lf->fd, dy->string, dy->stringSize);
/* Clean up. */
dyStringFree(&dy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x200, %edi            # imm = 0x200
callq 0x261d0
movq %rax, (%rsp)
leaq 0x1820(%r14), %rdx
leaq 0x615ba(%rip), %rsi     # 0x92562
movq %rax, %rdi
xorl %eax, %eax
callq 0x2656a
movq (%rsp), %rdi
leaq 0x615b7(%rip), %rsi     # 0x92574
xorl %eax, %eax
callq 0x2656a
movq (%rsp), %rdi
leaq 0x1010(%r14), %rdx
leaq 0x1810(%r14), %rcx
leaq 0x61003(%rip), %rsi     # 0x91fe0
xorl %eax, %eax
callq 0x2656a
cmpb $0x0, 0x10(%r14)
je 0x31053
leaq 0x10(%r14), %rcx
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
addq $0x810, %r14            # imm = 0x810
leaq 0x619c0(%rip), %rdx     # 0x929c9
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %r8
xorl %eax, %eax
callq 0x23c18
movq %r12, %rdi
callq 0x62d0
movq %r12, %rdi
movq %rax, %rsi
callq 0x42a2c
movq %rax, (%r15)
movq (%rsp), %rdi
leaq 0x61557(%rip), %rsi     # 0x92598
movq %rax, %rdx
xorl %eax, %eax
callq 0x2656a
movq %r15, %rdi
callq 0x2dd51
movq (%rsp), %rdi
leaq 0x60fa4(%rip), %rsi     # 0x92002
callq 0x26425
movq (%rsp), %rdi
testl %ebp, %ebp
je 0x31084
leaq 0x61540(%rip), %rsi     # 0x925b2
callq 0x26425
movq (%rsp), %rdi
leaq 0x61549(%rip), %rsi     # 0x925cb
jmp 0x3108b
leaq 0x61556(%rip), %rsi     # 0x925e1
callq 0x26425
movq %rsp, %r14
movq (%r14), %rdi
leaq 0x66b96(%rip), %rsi     # 0x97c33
callq 0x26425
movl 0x10(%rbx), %edi
movq (%r14), %rax
movq 0x8(%rax), %rsi
movslq 0x14(%rax), %rdx
callq 0x231f9
movq %r14, %rdi
callq 0x2620d
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: netStreamSocket
static int netStreamSocket()
/* Create a TCP/IP streaming socket.  Complain and return something
 * negative if can't */
{
int sd = socket(AF_INET, SOCK_STREAM, 0);
if (sd < 0)
    warn("Couldn't make AF_INET socket.");
return sd;
}

// Assembly:
pushq %rbx
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x6190
movl %eax, %ebx
testl %eax, %eax
jns 0x31351
leaq 0x61420(%rip), %rdi     # 0x9276a
xorl %eax, %eax
callq 0x268ca
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: parsePasvPort
static int parsePasvPort(char *rs)
/* parse PASV reply to get the port and return it */
{
char *words[7];
int wordCount;
char *rsStart = strchr(rs,'(');
char *rsEnd = strchr(rs,')');
int result = 0;
rsStart++;
*rsEnd=0;
wordCount = chopString(rsStart, ",", words, ArraySize(words));
if (wordCount != 6)
    errAbort("PASV reply does not parse correctly");
result = atoi(words[4])*256+atoi(words[5]);    
return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl $0x28, %esi
callq 0x6270
movq %rax, %r14
movq %rbx, %rdi
movl $0x29, %esi
callq 0x6270
incq %r14
movb $0x0, (%rax)
leaq 0x5e47e(%rip), %rsi     # 0x8f9e7
movq %rsp, %rdx
movq %r14, %rdi
movl $0x7, %ecx
callq 0x22314
cmpl $0x6, %eax
je 0x3158c
leaq 0x6151d(%rip), %rdi     # 0x92aa2
xorl %eax, %eax
callq 0x26b6f
movq 0x20(%rsp), %rdi
callq 0x6bd0
movl %eax, %ebx
shll $0x8, %ebx
movq 0x28(%rsp), %rdi
callq 0x6bd0
addl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/net.c
// Function: sendFtpDataToPipeThread
static void *sendFtpDataToPipeThread(void *threadParams)
/* This is to be executed by the child process after the fork in netGetOpenFtpSockets.
 * It keeps the ftp control socket alive while reading from the ftp data socket
 * and writing to the pipe to the parent process, which closes the ftp sockets
 * and reads from the pipe. */
{

struct netConnectFtpParams *params = threadParams;

pthread_detach(params->thread);  // this thread will never join back with it's progenitor

char buf[32768];
int rd = 0;
long long dataPos = 0; 
if (params->npu.byteRangeStart != -1)
    dataPos = params->npu.byteRangeStart;
while((rd = read(params->sdata, buf, 32768)) > 0) 
    {
    if (params->npu.byteRangeEnd != -1 && (dataPos + rd) > params->npu.byteRangeEnd)
	rd = params->npu.byteRangeEnd - dataPos + 1;
    int wt = write(params->pipefd[1], buf, rd);
    if (wt == -1 && params->npu.byteRangeEnd != -1)
	{
	// errAbort in child process is messy; let reader complain if
	// trouble.  If byterange was open-ended, we will hit this point
	// when the parent stops reading and closes the pipe.
	errnoWarn("error writing ftp data to pipe");
	break;
	}
    dataPos += rd;
    if (params->npu.byteRangeEnd != -1 && dataPos >= params->npu.byteRangeEnd)
	break;	    
    }
if (rd == -1)
    // Again, avoid abort in child process.
    errnoWarn("error reading ftp socket");
close(params->pipefd[1]);  /* we are done with it */
close(params->sd);
close(params->sdata);
return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8008, %rsp           # imm = 0x8008
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x64a0
movq 0x2838(%rbx), %rax
xorl %ebp, %ebp
cmpq $-0x1, %rax
cmovneq %rax, %rbp
movq %rsp, %r14
leaq 0x614e0(%rip), %r15     # 0x92ac6
movl 0x14(%rbx), %edi
movl $0x8000, %edx           # imm = 0x8000
movq %r14, %rsi
callq 0x6aa0
movq %rax, %r12
testl %r12d, %r12d
jle 0x31676
movq 0x2840(%rbx), %rax
cmpq $-0x1, %rax
je 0x31623
movl %r12d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rbp, %rcx
cmpq %rax, %rcx
jle 0x31623
subl %ebp, %eax
incl %eax
movl %eax, %r12d
movl 0xc(%rbx), %edi
movslq %r12d, %r13
movq %r14, %rsi
movq %r13, %rdx
callq 0x6260
cmpl $-0x1, %eax
jne 0x31652
cmpq $-0x1, 0x2840(%rbx)
je 0x31652
xorl %r13d, %r13d
movq %r15, %rdi
xorl %eax, %eax
callq 0x26a4e
jmp 0x3166d
addq %r13, %rbp
movq 0x2840(%rbx), %rax
cmpq $-0x1, %rax
sete %cl
cmpq %rax, %rbp
setl %r13b
orb %cl, %r13b
testb %r13b, %r13b
jne 0x315e6
cmpl $-0x1, %r12d
jne 0x3168a
leaq 0x61462(%rip), %rdi     # 0x92ae5
xorl %eax, %eax
callq 0x26a4e
movl 0xc(%rbx), %edi
callq 0x6e80
movl 0x10(%rbx), %edi
callq 0x6e80
movl 0x14(%rbx), %edi
callq 0x6e80
xorl %eax, %eax
addq $0x8008, %rsp           # imm = 0x8008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibLoadPartMasked
struct dnaSeq *nibLoadPartMasked(int options, char *fileName, int start, int size)
/* Load part of an .nib file, with control over handling of masked positions */
{
struct dnaSeq *seq;
FILE *f;
int seqSize;
nibOpenVerify(fileName, &f, &seqSize);
seq = nibLdPartMasked(options, fileName, f, seqSize, start, size);
fclose(f);
return seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %rsi, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3185d
movq (%r12), %r12
movl (%r13), %ecx
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x31a8c
movq %rax, %rbx
movq %r12, %rdi
callq 0x66e0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibLoadAllMasked
struct dnaSeq *nibLoadAllMasked(int options, char *fileName)
/* Load part of a .nib file, with control over handling of masked
 * positions. Subranges of nib files may specified in the file name
 * using the syntax:
 *    /path/file.nib:seqid:start-end
 * or\n"
 *    /path/file.nib:start-end
 * With the first form, seqid becomes the id of the subrange, with the second
 * form, a sequence id of file:start-end will be used.
 */
{
struct dnaSeq *seq;
FILE *f;
int seqSize;
char filePath[PATH_LEN];
char name[PATH_LEN];
unsigned start, end;

nibParseName(options, fileName, filePath, name, &start, &end);
nibOpenVerify(filePath, &f, &seqSize);
if (end == 0)
    end = seqSize;
seq = nibInput(options, fileName, name, f, seqSize, start, end-start);
fclose(f);
return seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x220(%rsp), %r14
leaq 0x20(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0xc(%rsp), %r15
movq %r14, %rdx
movq %r15, %r9
callq 0x316b8
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x3185d
cmpl $0x0, (%r15)
jne 0x31e93
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
movl 0xc(%rsp), %eax
subl %r9d, %eax
movl %eax, (%rsp)
leaq 0x20(%rsp), %rdx
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x31afb
movq %rax, %rbx
movq %r14, %rdi
callq 0x66e0
movq %rbx, %rax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibStreamOpen
struct nibStream *nibStreamOpen(char *fileName)
/* Create a new nib stream.  Open file and stuff. */
{
struct nibStream *ns;
FILE *f;

dnaUtilOpen();
AllocVar(ns);
ns->f = f = mustOpen(fileName, "wb");
ns->fileName = cloneString(fileName);

/* Write header - initially zero.  Will fix it up when we close. */
writeOne(f, ns->size);
writeOne(f, ns->size);

return ns;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x25b5c
movl $0x20, %edi
callq 0x2dc95
movq %rax, %rbx
leaq 0x60ab0(%rip), %rsi     # 0x92b75
movq %r14, %rdi
callq 0x22d5a
movq %rax, %r15
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x1f9f6
movq %rax, 0x8(%rbx)
leaq 0x18(%rbx), %r14
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22e1e
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22e1e
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibStreamClose
void nibStreamClose(struct nibStream **pNs)
/* Close a nib stream.  Flush last nibble if need be.  Fix up header. */
{
struct nibStream *ns = *pNs;
FILE *f;
bits32 sig = nibSig;
if (ns == NULL)
    return;
f = ns->f;
if (ns->size&1)
    writeOne(f, ns->byte);
fseek(f,  0L, SEEK_SET);
writeOne(f, sig);
writeOne(f, ns->size);
fclose(f);
freeMem(ns->fileName);
freez(pNs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r12
movl $0x6be93d3a, 0x4(%rsp)  # imm = 0x6BE93D3A
testq %r12, %r12
je 0x32194
movq %rdi, %rbx
movq 0x10(%r12), %r14
leaq 0x18(%r12), %r15
testb $0x1, 0x18(%r12)
je 0x3214c
leaq 0x1c(%r12), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x22e1e
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x67d0
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x22e1e
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22e1e
movq %r14, %rdi
callq 0x66e0
movq 0x8(%r12), %rdi
callq 0x2dd41
movq %rbx, %rdi
callq 0x2dd51
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibStreamOne
void nibStreamOne(struct nibStream *ns, DNA base)
/* Write out one base to nibStream. */
{
UBYTE ub = ntVal5[(int)base];

if ((++ns->size&1) == 0)
    {
    ub += ns->byte;
    writeOne(ns->f, ub);
    }
else
    {
    ns->byte = (ub<<4);
    }
}

// Assembly:
pushq %rax
movslq %esi, %rax
leaq 0x906e5(%rip), %rcx     # 0xc2890
movb (%rcx,%rax,4), %al
movb %al, 0x7(%rsp)
movl 0x18(%rdi), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x18(%rdi)
testb $0x1, %cl
jne 0x321c8
shlb $0x4, %al
movb %al, 0x1c(%rdi)
jmp 0x321e0
addb 0x1c(%rdi), %al
leaq 0x7(%rsp), %rsi
movb %al, (%rsi)
movq 0x10(%rdi), %rdi
movl $0x1, %edx
callq 0x22e1e
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibIsFile
boolean nibIsFile(char *fileName)
/* Return TRUE if file is a nib file. */
{
boolean isANib;
char *subrange = findNibSubrange(fileName);
if (subrange != NULL)
    *subrange = '\0';
isANib = endsWith(fileName, ".nib") || endsWith(fileName, ".NIB");
if (subrange != NULL)
    *subrange = ':';
return isANib;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x2f, %esi
callq 0x67c0
leaq 0x1(%rax), %rdi
testq %rax, %rax
cmoveq %r14, %rdi
movl $0x3a, %esi
callq 0x6270
movq %rax, %rbx
testq %rax, %rax
je 0x3224c
movb $0x0, (%rbx)
leaq 0x6092f(%rip), %rsi     # 0x92b82
movq %r14, %rdi
callq 0x21aed
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3227e
leaq 0x6090b(%rip), %rsi     # 0x92b78
movq %r14, %rdi
callq 0x21aed
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
testq %rbx, %rbx
je 0x32286
movb $0x3a, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibIsRange
boolean nibIsRange(char *fileName)
/* Return TRUE if file specifies a subrange of a nib file. */
{
boolean isANib;
char *subrange = findNibSubrange(fileName);;
if (subrange == NULL)
    return FALSE;
*subrange = '\0';
isANib = endsWith(fileName, ".nib") || endsWith(fileName, ".NIB");
*subrange = ':';
return isANib;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x67c0
leaq 0x1(%rax), %rdi
testq %rax, %rax
cmoveq %rbx, %rdi
movl $0x3a, %esi
callq 0x6270
testq %rax, %rax
je 0x322f7
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x608bc(%rip), %rsi     # 0x92b82
movq %rbx, %rdi
callq 0x21aed
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x322f1
leaq 0x60898(%rip), %rsi     # 0x92b78
movq %rbx, %rdi
callq 0x21aed
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
movb $0x3a, (%r14)
jmp 0x322f9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibInfoNew
struct nibInfo *nibInfoNew(char *path)
/* Make a new nibInfo with open nib file. */
{
struct nibInfo *nib;
AllocVar(nib);
nib->fileName = cloneString(path);
nibOpenVerify(path, &nib->f, &nib->size);
return nib;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x2dc95
movq %rax, %r14
movq %rbx, %rdi
callq 0x1f9f6
movq %rax, 0x8(%r14)
leaq 0x18(%r14), %rsi
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x3185d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibInfoFree
void nibInfoFree(struct nibInfo **pNib)
/* Free up nib info and close file if open. */
{
struct nibInfo *nib = *pNib;
if (nib != NULL)
    {
    carefulClose(&nib->f);
    freeMem(nib->fileName);
    freez(pNib);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x3236c
movq %rdi, %rbx
leaq 0x18(%r14), %rdi
callq 0x23400
movq 0x8(%r14), %rdi
callq 0x2dd41
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2dd51
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/nib.c
// Function: nibInfoFromCache
struct nibInfo *nibInfoFromCache(struct hash *hash, char *nibDir, char *nibName)
/* Get nibInfo on nibDir/nibName.nib from cache, filling cache if need be. */
{
struct nibInfo *nib;
char path[PATH_LEN];
safef(path, sizeof(path), "%s/%s.nib", nibDir, nibName);
nib = hashFindVal(hash, path);
if (nib == NULL)
    {
    nib = nibInfoNew(path);
    hashAdd(hash, path, nib);
    }
return nib;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
leaq 0x607ed(%rip), %rdx     # 0x92b7d
movq %rsp, %r14
movq %r14, %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x23c18
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29029
movq %rax, %r14
testq %rax, %rax
jne 0x323d1
movq %rsp, %r15
movq %r15, %rdi
callq 0x32301
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x28dbe
movq %r14, %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: hashTwoColumnFile
struct hash *hashTwoColumnFile(char *fileName)
/* Given a two column file (key, value) return a hash. */
{
struct lineFile *lf = lineFileOpen(fileName, TRUE);
struct hash *hash = hashNew(16);
char *row[3];
int fields = 0;
while ((fields = lineFileChop(lf, row)) != 0)
    {
    lineFileExpectWords(lf, 2, fields);
    char *name = row[0];
    char *value = lmCloneString(hash->lm, row[1]);
    hashAdd(hash, name, value);
    }
lineFileClose(&lf);
return hash;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl $0x1, %esi
callq 0x2a1fc
movq %rax, 0x8(%rsp)
movl $0x10, %edi
movl $0x1, %esi
callq 0x29160
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x3, %edx
callq 0x2b03f
testl %eax, %eax
je 0x32822
leaq 0x10(%rsp), %r14
movq 0x8(%rsp), %rdi
movl $0x2, %esi
movl %eax, %edx
callq 0x2ac73
movq 0x20(%rbx), %rdi
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %rsi
callq 0x2c0a2
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x28dbe
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x2b03f
testl %eax, %eax
jne 0x327da
leaq 0x8(%rsp), %rdi
callq 0x2ab48
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: slPairTwoColumnFile
struct slPair *slPairTwoColumnFile(char *fileName)
/* Read in a two column file into an slPair list */
{
char *row[2];
struct slPair *list = NULL;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
while (lineFileRow(lf, row))
    slPairAdd(&list, row[0], cloneString(row[1]));
lineFileClose(&lf);
slReverse(&list);
return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq $0x0, 0x8(%rsp)
movl $0x1, %esi
callq 0x2a1fc
movq %rax, (%rsp)
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movl $0x2, %edx
callq 0x2b1eb
testl %eax, %eax
je 0x328ab
leaq 0x8(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %rdi
callq 0x1f9f6
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20c31
movq (%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x2b1eb
testl %eax, %eax
jne 0x32879
movq %rsp, %rdi
callq 0x2ab48
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: slNameListOfUniqueWords
struct slName *slNameListOfUniqueWords(char *text,boolean respectQuotes)
/* Return list of unique words found by parsing string delimited by whitespace.
 * If respectQuotes then ["Lucy and Ricky" 'Fred and Ethyl'] will yield 2 slNames no quotes */
{
struct slName *list = NULL;
char *word = NULL;
while (text != NULL)
    {
    if (respectQuotes)
        word = nextQuotedWord(&text);
    else
        word = nextWord(&text);
    if (word)
        slNameStore(&list, word);
    else
        break;
    }
slReverse(&list);
return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, 0x8(%rsp)
movq $0x0, (%rsp)
testq %rdi, %rdi
je 0x32cc5
movl %esi, %ebx
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdi
testl %ebx, %ebx
je 0x32ca8
callq 0x32c19
jmp 0x32cad
callq 0x229cd
testq %rax, %rax
je 0x32cc5
movq %r15, %rdi
movq %rax, %rsi
callq 0x20641
cmpq $0x0, 0x8(%rsp)
jne 0x32c9a
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: shuffleArrayOfInts
void shuffleArrayOfInts(int *array, int arraySize)
/* Shuffle array of ints of given size given number of times. */
{
int c;
int i, randIx;

/* Randomly permute an array using the method from Cormen, et al */
for (i=0; i<arraySize; ++i)
    {
    randIx = i + (rand() % (arraySize - i));
    c = array[i];
    array[i] = array[randIx];
    array[randIx] = c;
    }
}

// Assembly:
testl %esi, %esi
jle 0x333d3
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
xorl %r15d, %r15d
callq 0x61d0
cltd
idivl %r14d
movl (%rbx,%r15,4), %eax
movslq %edx, %rcx
addq %r15, %rcx
movl (%rbx,%rcx,4), %edx
movl %edx, (%rbx,%r15,4)
movl %eax, (%rbx,%rcx,4)
incq %r15
decq %r14
jne 0x333a9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: slListRandomReduce
void *slListRandomReduce(void *list, double reduceRatio)
/* Reduce list to approximately reduceRatio times original size. Destroys original list. */
{
if (reduceRatio >= 1.0)
    return list;
int threshold = RAND_MAX * reduceRatio;
struct slList *newList = NULL, *next, *el;
for (el = list; el != NULL; el = next)
    {
    next = el->next;
    if (rand() <= threshold)
        {
	slAddHead(&newList, el);
	}
    }
return newList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
ucomisd 0x5a3a0(%rip), %xmm0    # 0x8d878
jae 0x33509
testq %r14, %r14
je 0x3350e
mulsd 0x5f7e1(%rip), %xmm0    # 0x92cc8
cvttsd2si %xmm0, %ebp
xorl %ebx, %ebx
movq (%r14), %r15
callq 0x61d0
cmpl %ebp, %eax
jg 0x334ff
movq %rbx, (%r14)
movq %r14, %rbx
movq %r15, %r14
testq %r15, %r15
jne 0x334ed
jmp 0x33510
movq %r14, %rbx
jmp 0x33510
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: slListRandomSample
void *slListRandomSample(void *list, int maxCount)
/* Return a sublist of list with at most maxCount. Destroy list in process */
{
if (list == NULL)
    return list;
int initialCount = slCount(list);
if (initialCount <= maxCount)
    return list;
double reduceRatio = (double)maxCount/initialCount;
if (reduceRatio < 0.9)
    {
    double conservativeReduceRatio = reduceRatio * 1.05;
    list = slListRandomReduce(list, conservativeReduceRatio);
    }
int midCount = slCount(list);
if (midCount <= maxCount)
    return list;
shuffleList(list);
struct slList *lastEl = slElementFromIx(list, maxCount-1);
lastEl->next = NULL;
return list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x33590
movl %esi, %ebx
movq %rdi, %r15
callq 0x1fbec
cmpl %ebx, %eax
jle 0x33595
cvtsi2sd %ebx, %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd 0x5b003(%rip), %xmm1    # 0x8e550
ucomisd %xmm0, %xmm1
jbe 0x3359a
mulsd 0x5f775(%rip), %xmm0    # 0x92cd0
ucomisd 0x5a315(%rip), %xmm0    # 0x8d878
jae 0x3359a
mulsd 0x5f75b(%rip), %xmm0    # 0x92cc8
cvttsd2si %xmm0, %ebp
xorl %r14d, %r14d
movq (%r15), %r12
callq 0x61d0
cmpl %ebp, %eax
jg 0x33586
movq %r14, (%r15)
movq %r15, %r14
movq %r12, %r15
testq %r12, %r12
jne 0x33574
jmp 0x3359d
xorl %r14d, %r14d
jmp 0x335c4
movq %r15, %r14
jmp 0x335c4
movq %r15, %r14
movq %r14, %rdi
callq 0x1fbec
cmpl %ebx, %eax
jle 0x335c4
movq %r14, %rdi
callq 0x33413
decl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1fbfb
movq $0x0, (%rax)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/obscure.c
// Function: currentVmPeak
long long currentVmPeak()
/* return value of peak Vm memory usage (if /proc/ business exists) */
{
long long vmPeak = 0;

pid_t pid = getpid();
char temp[256];
safef(temp, sizeof(temp), "/proc/%d/status", (int) pid);
struct lineFile *lf = lineFileMayOpen(temp, TRUE);
if (lf)
    {
    char *line;
    while (lineFileNextReal(lf, &line))
	{	// typical line: 'VmPeak:     62646196 kB'
		// seems to always be kB
	if (stringIn("VmPeak", line))
	    {
	    char *words[3];
	    chopByWhite(line, words, 3);
	    vmPeak = sqlLongLong(words[1]);	// assume always 2nd word
	    break;
	    }
	}
    lineFileClose(&lf);
    }

return vmPeak;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
callq 0x6ac0
leaq 0x5f7d7(%rip), %rdx     # 0x92ea5
xorl %ebx, %ebx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x100, %esi            # imm = 0x100
movl %eax, %ecx
xorl %eax, %eax
callq 0x23c18
movq %r14, %rdi
movl $0x1, %esi
callq 0x2a2af
movq %rax, (%rsp)
testq %rax, %rax
je 0x33758
leaq 0x8(%rsp), %r14
xorl %ebx, %ebx
leaq 0x5f7ab(%rip), %r15     # 0x92eb5
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x2afac
testl %eax, %eax
je 0x33750
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6180
testq %rax, %rax
je 0x3370a
leaq 0x10(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x223ad
movq 0x8(%rbx), %rdi
callq 0x3bac8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2ab48
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r14
popq %r15
retq