LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: twoBitOutMaskBeds
void twoBitOutMaskBeds(struct twoBitFile *tbf, char *seqName, FILE *outF)
/* output a series of bed3's that enumerate the number of masked bases in a sequence*/
{
struct twoBit *header = readTwoBitSeqHeader(tbf, seqName);

int ii;
for (ii = 0; ii < header->maskBlockCount; ++ii)
    {
    fprintf(outF, "%s\t%d\t%d\n", seqName, header->maskStarts[ii], header->maskStarts[ii] + header->maskSizes[ii]);
    }

twoBitFree(&header);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
callq 0x3e65a
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x30(%rax)
je 0x3f44c
movq %rax, %r15
leaq 0x5560f(%rip), %r12     # 0x94a29
xorl %r13d, %r13d
movq 0x38(%r15), %rax
movq 0x40(%r15), %rdx
movl (%rax,%r13,4), %ecx
movl (%rdx,%r13,4), %r8d
addl %ecx, %r8d
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x6a90
incq %r13
movl 0x30(%r15), %eax
cmpq %rax, %r13
jb 0x3f41d
leaq 0x8(%rsp), %rdi
callq 0x3e363
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: twoBitOutNBeds
void twoBitOutNBeds(struct twoBitFile *tbf, char *seqName, FILE *outF)
/* output a series of bed3's that enumerate the number of N's in a sequence*/
{
int nBlockCount;

twoBitSeekTo(tbf, seqName);

(*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

/* Read in blocks of N. */
nBlockCount = (*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

if (nBlockCount > 0)
    {
    bits32 *nStarts = NULL, *nSizes = NULL;
    int i;

    AllocArray(nStarts, nBlockCount);
    AllocArray(nSizes, nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nStarts, sizeof(nStarts[0]) * nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nSizes, sizeof(nSizes[0]) * nBlockCount);
    if (tbf->isSwapped)
	{
	for (i=0; i<nBlockCount; ++i)
	    {
	    nStarts[i] = byteSwap32(nStarts[i]);
	    nSizes[i] = byteSwap32(nSizes[i]);
	    }
	}

    for (i=0; i<nBlockCount; ++i)
	{
	fprintf(outF, "%s\t%d\t%d\n", seqName, nStarts[i], nStarts[i] + nSizes[i]);
	}

    freez(&nStarts);
    freez(&nSizes);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
callq 0x3ec2d
movq 0x10(%r13), %rdi
movl 0x18(%r13), %esi
callq *0x68(%r13)
movq 0x10(%r13), %rdi
movl 0x18(%r13), %esi
callq *0x68(%r13)
testl %eax, %eax
jle 0x3f560
movq %r14, (%rsp)
movq %rbx, %r14
movl %eax, %ebp
leaq (,%rbp,4), %rbx
movq %rbx, %rdi
callq 0x2de63
movq %rax, %r15
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x2de63
movq %rax, %r12
movq %rax, 0x8(%rsp)
movq 0x10(%r13), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *0x88(%r13)
movq 0x10(%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *0x88(%r13)
cmpl $0x0, 0x18(%r13)
je 0x3f51f
xorl %r13d, %r13d
movl (%r15,%r13,4), %edi
callq 0x239ea
movl %eax, (%r15,%r13,4)
movl (%r12,%r13,4), %edi
callq 0x239ea
movl %eax, (%r12,%r13,4)
incq %r13
cmpq %r13, %rbp
jne 0x3f4fd
xorl %ebx, %ebx
movq (%rsp), %r13
movl (%r15,%rbx,4), %ecx
movl (%r12,%rbx,4), %r8d
addl %ecx, %r8d
movq %r14, %rdi
leaq 0x554ef(%rip), %rsi     # 0x94a29
movq %r13, %rdx
xorl %eax, %eax
callq 0x6a90
incq %rbx
cmpq %rbx, %rbp
jne 0x3f525
leaq 0x10(%rsp), %rdi
callq 0x2e0b0
leaq 0x8(%rsp), %rdi
callq 0x2e0b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: twoBitSeqSizeNoNs
int twoBitSeqSizeNoNs(struct twoBitFile *tbf, char *seqName)
/* return the size of the sequence, not counting N's*/
{
int nBlockCount;
int size;

twoBitSeekTo(tbf, seqName);

size = (*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

/* Read in blocks of N. */
nBlockCount = (*tbf->ourReadBits32)(tbf->f, tbf->isSwapped);

if (nBlockCount > 0)
    {
    bits32 *nStarts = NULL, *nSizes = NULL;
    
    int i;

    AllocArray(nStarts, nBlockCount);
    AllocArray(nSizes, nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nStarts, sizeof(nStarts[0]) * nBlockCount);
    (*tbf->ourMustRead)(tbf->f, nSizes, sizeof(nSizes[0]) * nBlockCount);
    if (tbf->isSwapped)
	{
	for (i=0; i<nBlockCount; ++i)
	    {
	    nStarts[i] = byteSwap32(nStarts[i]);
	    nSizes[i] = byteSwap32(nSizes[i]);
	    }
	}

    for (i=0; i<nBlockCount; ++i)
	{
	size -= nSizes[i];
	}

    freez(&nStarts);
    freez(&nSizes);
    }

return(size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
callq 0x3ec2d
movq 0x10(%r15), %rdi
movl 0x18(%r15), %esi
callq *0x68(%r15)
movl %eax, %ebx
movq 0x10(%r15), %rdi
movl 0x18(%r15), %esi
callq *0x68(%r15)
testl %eax, %eax
jle 0x3f641
movl %eax, %ebp
leaq (,%rbp,4), %r13
movq %r13, %rdi
callq 0x2de63
movq %rax, %r12
movq %rax, 0x10(%rsp)
movq %r13, %rdi
callq 0x2de63
movq %rax, %r14
movq %rax, 0x8(%rsp)
movq 0x10(%r15), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *0x88(%r15)
movq 0x10(%r15), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq *0x88(%r15)
cmpl $0x0, 0x18(%r15)
je 0x3f61f
xorl %r15d, %r15d
movl (%r12,%r15,4), %edi
callq 0x239ea
movl %eax, (%r12,%r15,4)
movl (%r14,%r15,4), %edi
callq 0x239ea
movl %eax, (%r14,%r15,4)
incq %r15
cmpq %r15, %rbp
jne 0x3f5fd
xorl %eax, %eax
subl (%r14,%rax,4), %ebx
incq %rax
cmpq %rax, %rbp
jne 0x3f621
leaq 0x10(%rsp), %rdi
callq 0x2e0b0
leaq 0x8(%rsp), %rdi
callq 0x2e0b0
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: twoBitTotalSizeNoN
long long twoBitTotalSizeNoN(struct twoBitFile *tbf)
/* return the size of the all the sequence in file, not counting N's*/
{
struct twoBitIndex *index;
long long totalSize = 0;
for (index = tbf->indexList; index != NULL; index = index->next)
    {
    int size = twoBitSeqSizeNoNs(tbf, index->name);
    totalSize += size;
    }
return totalSize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x3f680
movq %rdi, %r14
xorl %ebx, %ebx
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x3f56f
cltq
addq %rax, %rbx
movq (%r15), %r15
testq %r15, %r15
jne 0x3f665
jmp 0x3f682
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: twoBitChromHash
struct hash *twoBitChromHash(char *fileName)
/* Build a hash of chrom names with their sizes. */
{
struct twoBitFile *tbf = twoBitOpen(fileName);
struct twoBitIndex *index;
struct hash *hash = hashNew(digitsBaseTwo(tbf->seqCount));
for (index = tbf->indexList; index != NULL; index = index->next)
    {
    hashAddInt(hash, index->name, twoBitSeqSize(tbf, index->name));
    }

twoBitClose(&tbf);
return hash;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x3e405
movq %rax, %rbx
movq %rax, (%rsp)
movl 0x20(%rax), %edi
callq 0x32789
movl %eax, %edi
movl $0x1, %esi
callq 0x294ea
movq %rax, %r14
movq 0x28(%rbx), %r12
testq %r12, %r12
je 0x3f702
movq 0x8(%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ec2d
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
callq *0x68(%rbx)
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2941f
movq (%r12), %r12
jmp 0x3f6d0
movq %rsp, %rdi
callq 0x3e30e
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/twoBit.c
// Function: readBlockCoords
static void readBlockCoords(struct twoBitFile *tbf, boolean isSwapped, bits32 *retBlockCount,
			    bits32 **retBlockStarts, bits32 **retBlockSizes)
/* Read in blockCount, starts and sizes from file. (Same structure used for
 * both blocks of N's and masked blocks.) */
{
bits32 blkCount = (*tbf->ourReadBits32)(tbf->f, isSwapped);
*retBlockCount = blkCount;
if (blkCount == 0)
    {
    *retBlockStarts = NULL;
    *retBlockSizes = NULL;
    }
else
    {
    bits32 *nStarts, *nSizes;
    AllocArray(nStarts, blkCount);
    AllocArray(nSizes, blkCount);
    (*tbf->ourMustRead)(tbf->f, nStarts, sizeof(nStarts[0]) * blkCount);
    (*tbf->ourMustRead)(tbf->f, nSizes, sizeof(nSizes[0]) * blkCount);
    if (isSwapped)
	{
	int i;
	for (i=0; i<blkCount; ++i)
	    {
	    nStarts[i] = byteSwap32(nStarts[i]);
	    nSizes[i] = byteSwap32(nSizes[i]);
	    }
	}
    *retBlockStarts = nStarts;
    *retBlockSizes = nSizes;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r13
movq 0x10(%rdi), %rdi
callq *0x68(%r13)
movl %eax, (%r15)
testl %eax, %eax
je 0x3f7c9
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movl %eax, %r14d
leaq (,%r14,4), %rbx
movq %rbx, %rdi
callq 0x2de63
movq %rax, %r15
movq %rbx, %rdi
callq 0x2de63
movq %rax, %r12
movq 0x10(%r13), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *0x88(%r13)
movq 0x10(%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *0x88(%r13)
testl %ebp, %ebp
je 0x3f7bd
xorl %ebx, %ebx
movl (%r15,%rbx,4), %edi
callq 0x239ea
movl %eax, (%r15,%rbx,4)
movl (%r12,%rbx,4), %edi
callq 0x239ea
movl %eax, (%r12,%rbx,4)
incq %rbx
cmpq %rbx, %r14
jne 0x3f79b
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
jmp 0x3f7cf
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r15, (%r14)
movq %r12, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcInfoViaFtp
boolean udcInfoViaFtp(char *url, struct udcRemoteFileInfo *retInfo)
/* Gets size and last modified time of FTP URL */
{
verbose(4, "checking ftp remote info on %s\n", url);
long long size = 0;
time_t t, tUtc;
struct tm *tm = NULL;
// TODO: would be nice to add int *retCtrlSocket to netGetFtpInfo so we can stash 
// in retInfo->connInfo and keep socket open.
boolean ok = netGetFtpInfo(url, &size, &tUtc);
if (!ok)
    return FALSE;
// Convert UTC to localtime
tm = localtime(&tUtc);
t = mktimeFromUtc(tm);
if (t == -1)
    { /* Handle error */;
    errAbort("mktimeFromUtc failed while converting FTP UTC last-modified time %ld to local time", (long) tUtc);
    }
retInfo->size = size;
retInfo->updateTime = t;
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x54eb6(%rip), %rsi     # 0x94da6
xorl %ebp, %ebp
movl $0x4, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x427e5
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movq %rsp, %rdx
movq %r14, %rdi
callq 0x2f460
testl %eax, %eax
je 0x3ff58
movq %rsp, %rdi
callq 0x64d0
movq %rax, %rdi
callq 0x2449f
movq %rax, %r14
cmpq $-0x1, %rax
jne 0x3ff47
movq (%rsp), %rsi
leaq 0x54e86(%rip), %rdi     # 0x94dc6
xorl %eax, %eax
callq 0x26e94
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r14, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcFastReadString
boolean udcFastReadString(struct udcFile *f, char buf[256])
/* Read a string into buffer, which must be long enough
 * to hold it.  String is in 'writeString' format. */
{
UBYTE bLen;
int len;
if (!udcReadOne(f, bLen))
    return FALSE;
if ((len = bLen)> 0)
    udcMustRead(f, buf, len);
buf[len] = 0;
return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x3ffbc
testq %rax, %rax
je 0x3ffa1
movzbl 0xf(%rsp), %r15d
testq %r15, %r15
je 0x3ffa5
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x40215
jmp 0x3ffa8
xorl %eax, %eax
jmp 0x3ffb2
xorl %r15d, %r15d
movb $0x0, (%rbx,%r15)
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcParseUrlFull
void udcParseUrlFull(char *url, char **retProtocol, char **retAfterProtocol, char **retColon,
		     char **retAuth)
/* Parse the URL into components that udc treats separately.
 * *retAfterProtocol is Q-encoded to keep special chars out of filenames.  
 * Free all *ret's except *retColon when done. */
{
char *protocol, *afterProtocol;
char *colon = strchr(url, ':');
if (!colon)
    {
    *retColon = NULL;
    return;
    }
int colonPos = colon - url;
protocol = cloneStringZ(url, colonPos);
afterProtocol = url + colonPos + 1;
while (afterProtocol[0] == '/')
   afterProtocol += 1;
char *userPwd = strchr(afterProtocol, '@');
if (userPwd)
    {
    if (retAuth)
	{
	char auth[1024];
	safencpy(auth, sizeof(auth), afterProtocol, userPwd+1-afterProtocol);
	*retAuth = qEncode(auth);
	}
    char *afterHost = strchr(afterProtocol, '/');
    if (!afterHost)
	{
	afterHost = afterProtocol+strlen(afterProtocol);
	}
    if (userPwd < afterHost)
	afterProtocol = userPwd + 1;
    }
else if (retAuth)
    *retAuth = NULL;
afterProtocol = qEncode(afterProtocol);
*retProtocol = protocol;
*retAfterProtocol = afterProtocol;
*retColon = colon;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
movl $0x3a, %esi
callq 0x6270
movq %rax, %r12
testq %rax, %rax
je 0x40355
movq %rbp, 0x18(%rsp)
movq %r15, 0x8(%rsp)
movq %r12, %rbp
subq %r14, %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x1fe6b
movq %rax, 0x10(%rsp)
movslq %ebp, %rax
leaq (%r14,%rax), %rbp
leaq (%r14,%rax), %r15
decq %r15
incq %r15
cmpb $0x2f, 0x1(%rbp)
leaq 0x1(%rbp), %rbp
je 0x402b3
movq %rbp, %rdi
movl $0x40, %esi
callq 0x6270
testq %rax, %rax
je 0x4032b
movq %rax, %r14
testq %r13, %r13
je 0x40301
movq %r14, %rcx
subq %r15, %rcx
leaq 0x20(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %rbp, %rdx
callq 0x23fb3
movq %r15, %rdi
callq 0x4036a
movq %rax, (%r13)
movq %rbp, %rdi
movl $0x2f, %esi
callq 0x6270
testq %rax, %rax
jne 0x4031e
movq %rbp, %rdi
callq 0x62d0
addq %rbp, %rax
leaq 0x1(%r14), %rcx
cmpq %rax, %r14
cmovbq %rcx, %rbp
jmp 0x40338
testq %r13, %r13
je 0x40338
movq $0x0, (%r13)
movq 0x8(%rsp), %r14
movq %rbp, %rdi
callq 0x4036a
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq %rdx, (%rcx)
movq %rax, (%r14)
movq %r12, (%rbx)
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: qEncode
static char *qEncode(char *input)
/* Do a simple encoding to convert input string into "normal" characters.
 * Abnormal letters, and '!' get converted into Q followed by two hexadecimal digits. */
{
/* First go through and figure out encoded size. */
int size = 0;
char *s, *d, c;
s = input;
while ((c = *s++) != 0)
    {
    if (qEscaped(c))
	size += 3;
    else
	size += 1;
    }

/* Allocate and fill in output. */
char *output = needMem(size+1);
s = input;
d = output;
while ((c = *s++) != 0)
    {
    if (qEscaped(c))
        {
	sprintf(d, "Q%02X", (unsigned)c);
	d += 3;
	}
    else
        *d++ = c;
    }
return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %al
testb %al, %al
je 0x403aa
leaq 0x1(%rbx), %r15
xorl %r14d, %r14d
movsbl %al, %edi
callq 0x422ef
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%r14,%rcx,2), %r14d
incl %r14d
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x40385
incl %r14d
jmp 0x403b0
movl $0x1, %r14d
movq %r14, %rdi
callq 0x2dff4
movq %rax, %r14
movb (%rbx), %r13b
testb %r13b, %r13b
je 0x40406
incq %rbx
leaq 0x54e07(%rip), %r15     # 0x951d4
movq %r14, %r12
movsbl %r13b, %ebp
movl %ebp, %edi
callq 0x422ef
testl %eax, %eax
je 0x403f4
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x6170
addq $0x3, %r12
jmp 0x403fb
movb %r13b, (%r12)
incq %r12
movb (%rbx), %r13b
incq %rbx
testb %r13b, %r13b
jne 0x403d0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcPathAndFileNames
void udcPathAndFileNames(struct udcFile *file, char *cacheDir, char *protocol, char *afterProtocol)
/* Initialize udcFile path and names */
{
if (cacheDir==NULL)
    return;
char *hashedAfterProtocol = longDirHash(afterProtocol);
int len = strlen(cacheDir) + 1 + strlen(protocol) + 1 + strlen(hashedAfterProtocol) + 1;
file->cacheDir = needMem(len);
safef(file->cacheDir, len, "%s/%s/%s", cacheDir, protocol, hashedAfterProtocol);

/* Create file names for bitmap and data portions. */
file->bitmapFileName = fileNameInCacheDir(file, bitmapName);
file->sparseFileName = fileNameInCacheDir(file, sparseDataName);
file->redirFileName = fileNameInCacheDir(file, redirName);
}

// Assembly:
testq %rsi, %rsi
je 0x40564
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, 0x8(%rsp)
movq %rcx, %rdi
callq 0x62d0
movl %eax, %edi
callq 0x264e0
movq %rax, %r13
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movl $0x2f, %esi
callq 0x6270
testq %rax, %rax
je 0x404ad
movq %rax, %r14
leaq 0x54dfd(%rip), %rbp     # 0x95275
movb $0x0, (%r14)
movq %r13, %rdi
movq %r12, %rsi
callq 0x42331
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2674f
movq %r14, %r12
incq %r12
movq %r12, %rdi
movl $0x2f, %esi
callq 0x6270
movq %rax, %r14
testq %rax, %rax
jne 0x40478
movq %r13, %rdi
movq %r12, %rsi
callq 0x42331
leaq 0x10(%rsp), %rdi
callq 0x2653c
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
movq %rax, %r14
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0x62d0
movq %rax, %r13
movq %r12, %rdi
callq 0x62d0
addl %r14d, %r13d
addl %r13d, %eax
addl $0x3, %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x2dff4
movq %rax, 0x38(%rbx)
leaq 0x52700(%rip), %rdx     # 0x92c07
movq %rax, %rdi
movl %r14d, %esi
movq %r15, %rcx
movq %rbp, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x23f33
leaq 0x54cb6(%rip), %rsi     # 0x951da
movq %rbx, %rdi
callq 0x40565
movq %rax, 0x40(%rbx)
leaq 0x54caa(%rip), %rsi     # 0x951e1
movq %rbx, %rdi
callq 0x40565
movq %rax, 0x48(%rbx)
leaq 0x54ca2(%rip), %rsi     # 0x951ec
movq %rbx, %rdi
callq 0x40565
movq %rax, 0x50(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcProtocolNew
static struct udcProtocol *udcProtocolNew(char *upToColon)
/* Build up a new protocol around a string such as "http" or "local" */
{
struct udcProtocol *prot;
AllocVar(prot);
if (sameString(upToColon, "local"))
    {
    prot->fetchData = udcDataViaLocal;
    prot->fetchInfo = udcInfoViaLocal;
    prot->type = "local";
    }
else if (sameString(upToColon, "slow"))
    {
    prot->fetchData = udcDataViaSlow;
    prot->fetchInfo = udcInfoViaSlow;
    prot->type = "slow";
    }
else if (sameString(upToColon, "http") || sameString(upToColon, "https"))
    {
    prot->fetchData = udcDataViaHttpOrFtp;
    prot->fetchInfo = udcInfoViaHttp;
    prot->type = "http";
    }
else if (sameString(upToColon, "ftp"))
    {
    prot->fetchData = udcDataViaHttpOrFtp;
    prot->fetchInfo = udcInfoViaFtp;
    prot->type = "ftp";
    }
else if (sameString(upToColon, "transparent"))
    {
    prot->fetchData = udcDataViaTransparent;
    prot->fetchInfo = udcInfoViaTransparent;
    prot->type = "transparent";
    }
else
    {
    errAbort("Unrecognized protocol %s in udcProtNew", upToColon);
    }
return prot;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x2dff4
movq %rax, %rbx
leaq 0x544a6(%rip), %r15     # 0x951f2
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x40de1
leaq 0x54492(%rip), %r15     # 0x951f8
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x40e09
leaq 0x51212(%rip), %r15     # 0x91f92
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x40df5
leaq 0x51201(%rip), %rsi     # 0x91f97
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x40df5
leaq 0x54294(%rip), %r15     # 0x9503d
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x40e2c
leaq 0x54078(%rip), %r15     # 0x94e37
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x40e40
leaq 0x54428(%rip), %rdi     # 0x951fd
movq %r14, %rsi
xorl %eax, %eax
callq 0x26e94
jmp 0x40e23
leaq 0x15bc(%rip), %rax      # 0x423a4
movq %rax, 0x8(%rbx)
leaq 0x169a(%rip), %rax      # 0x4248d
jmp 0x40e1b
leaq -0x157d(%rip), %rax     # 0x3f87f
movq %rax, 0x8(%rbx)
leaq -0x122b(%rip), %rax     # 0x3fbdc
jmp 0x40e1b
leaq 0x16e1(%rip), %rax      # 0x424f1
movq %rax, 0x8(%rbx)
leaq 0x1838(%rip), %rax      # 0x42653
movq %rax, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq -0x15b4(%rip), %rax     # 0x3f87f
movq %rax, 0x8(%rbx)
leaq -0xf63(%rip), %rax      # 0x3fedb
jmp 0x40e1b
leaq 0x1873(%rip), %rax      # 0x426ba
movq %rax, 0x8(%rbx)
leaq 0x1889(%rip), %rax      # 0x426db
jmp 0x40e1b
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcCacheAge
unsigned long udcCacheAge(char *url, char *cacheDir)
/* Return the age in seconds of the oldest cache file.  If a cache file is
 * missing, return the current time (seconds since the epoch). */
{
unsigned long now = clock1(), oldestTime = now;
if (cacheDir == NULL)
    cacheDir = udcDefaultDir();
struct slName *sl, *slList = udcFileCacheFiles(url, cacheDir);
if (slList == NULL)
    return now;
for (sl = slList;  sl != NULL;  sl = sl->next)
    if (endsWith(sl->name, bitmapName))
	{
	if (fileExists(sl->name))
	    oldestTime = min(fileModTime(sl->name), oldestTime);
	else
	    return now;
	}
return (now - oldestTime);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x347aa
movq %rax, %rbx
testq %r14, %r14
jne 0x40e79
movq 0x7fe1f(%rip), %r14     # 0xc0c98
movq %r15, %rdi
movq %r14, %rsi
callq 0x40f15
testq %rax, %rax
je 0x40ed8
movq %rax, %r14
leaq 0x54347(%rip), %r15     # 0x951da
movq %rbx, %r12
leaq 0x8(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x21e4c
testl %eax, %eax
je 0x40ecd
movq %r13, %rdi
callq 0x23c5d
testl %eax, %eax
je 0x40ed8
movq %r13, %rdi
callq 0x34c1a
cmpq %r12, %rax
jae 0x40ecd
movq %r13, %rdi
callq 0x34c1a
movq %rax, %r12
movq (%r14), %r14
testq %r14, %r14
jne 0x40e96
subq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcFileOpen
struct udcFile *udcFileOpen(char *url, char *cacheDir)
/* Open up a cached file.  cacheDir may be null in which case udcDefaultDir() will be
 * used.  Abort if file doesn't exist. */
{
struct udcFile *udcFile = udcFileMayOpen(url, cacheDir);
if (udcFile == NULL)
    errAbort("Couldn't open %s", url);
return udcFile;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x405d1
movq %rax, %r14
testq %rax, %rax
jne 0x40f0a
leaq 0x51580(%rip), %rdi     # 0x92480
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26e94
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcFileCacheFiles
struct slName *udcFileCacheFiles(char *url, char *cacheDir)
/* Return low-level list of files used in cache. */
{
char *protocol, *afterProtocol, *colon;
struct udcFile *file;
udcParseUrl(url, &protocol, &afterProtocol, &colon);
if (colon == NULL)
    return NULL;
AllocVar(file);
udcPathAndFileNames(file, cacheDir, protocol, afterProtocol);
struct slName *list = NULL;
slAddHead(&list, slNameNew(file->bitmapFileName));
slAddHead(&list, slNameNew(file->sparseFileName));
slAddHead(&list, slNameNew(file->redirFileName));
slReverse(&list);
freeMem(file->cacheDir);
freeMem(file->bitmapFileName);
freeMem(file->sparseFileName);
freeMem(file);
freeMem(protocol);
freeMem(afterProtocol);
return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r12
xorl %ebx, %ebx
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
leaq 0x18(%rsp), %r14
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x40250
cmpq $0x0, (%r14)
je 0x40fe6
movl $0x168, %edi            # imm = 0x168
callq 0x2dff4
movq %rax, %r15
movq 0x8(%rsp), %r14
movq (%rsp), %rbx
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x40420
movq 0x40(%r15), %rdi
callq 0x20830
movq %rax, %r12
movq $0x0, (%rax)
movq 0x48(%r15), %rdi
callq 0x20830
movq %rax, %r13
movq %r12, (%rax)
movq 0x50(%r15), %rdi
callq 0x20830
movq %r13, (%rax)
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %r12, %rdi
callq 0x20173
movq 0x38(%r15), %rdi
callq 0x2e0a0
movq 0x40(%r15), %rdi
callq 0x2e0a0
movq 0x48(%r15), %rdi
callq 0x2e0a0
movq %r15, %rdi
callq 0x2e0a0
movq %r14, %rdi
callq 0x2e0a0
movq %rbx, %rdi
callq 0x2e0a0
movq (%r12), %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcBitmapClose
static void udcBitmapClose(struct udcBitmap **pBits)
/* Free up resources associated with udcBitmap. */
{
struct udcBitmap *bits = *pBits;
if (bits != NULL)
    {
    mustCloseFd(&(bits->fd));
    freez(pBits);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x411b3
addq $0x3c, %rdi
callq 0x235bf
movq %rbx, %rdi
popq %rbx
jmp 0x2e0b0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcPathToUrl
char *udcPathToUrl(const char *path, char *buf, size_t size, char *cacheDir)
/* Translate path into an URL, store in buf, return pointer to buf if successful
 * and NULL if not. */
{
if (cacheDir == NULL)
    cacheDir = udcDefaultDir();
int offset = 0;
if (startsWith(cacheDir, (char *)path))
    offset = strlen(cacheDir);
if (path[offset] == '/')
    offset++;
char protocol[16];
strncpy(protocol, path+offset, sizeof(protocol));
protocol[ArraySize(protocol)-1] = '\0';
char *p = strchr(protocol, '/');
if (p == NULL)
    {
    errAbort("unable to parse protocol (first non-'%s' directory) out of path '%s'\n",
	     cacheDir, path);
    return NULL;
    }
*p++ = '\0';
char afterProtocol[4096];
qDecode(path+1+strlen(protocol)+1, afterProtocol, sizeof(afterProtocol));
safef(buf, size, "%s://%s", protocol, afterProtocol);
return buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
testq %rcx, %rcx
jne 0x411de
movq 0x7faba(%rip), %r12     # 0xc0c98
movq %r12, %rdi
movq %r15, %rsi
callq 0x21b23
testl %eax, %eax
je 0x411f7
movq %r12, %rdi
callq 0x62d0
jmp 0x411f9
xorl %eax, %eax
cltq
xorl %ecx, %ecx
cmpb $0x2f, (%r15,%rax)
sete %cl
addl %ecx, %eax
movslq %eax, %rsi
addq %r15, %rsi
leaq 0x20(%rsp), %rbx
movl $0x10, %edx
movq %rbx, %rdi
callq 0x6380
movb $0x0, 0xf(%rbx)
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x6270
testq %rax, %rax
je 0x412ff
movq %r13, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movb $0x0, (%rax)
leaq 0x20(%rsp), %rdi
callq 0x62d0
addq %rax, %r15
addq $0x2, %r15
leaq 0x30(%rsp), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %r15, %rdx
callq 0x21600
leaq 0x53f62(%rip), %r12     # 0x951d5
leaq 0xc(%rsp), %r13
movq %r14, %rbp
leaq 0x1(%r14), %rbx
movzbl (%r14), %eax
cmpl $0x51, %eax
je 0x41297
testl %eax, %eax
je 0x412d4
movb %al, (%rbp)
incq %rbp
movq %rbx, %r14
jmp 0x4127b
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x66d0
testl %eax, %eax
je 0x412bb
movb 0xc(%rsp), %al
movb %al, (%rbp)
incq %rbp
addq $0x3, %r14
jmp 0x4127b
leaq 0x5419c(%rip), %rdi     # 0x9545e
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x26e94
movq %rbx, %r14
jmp 0x4127b
movb $0x0, (%rbp)
leaq 0x53c50(%rip), %rdx     # 0x94f2f
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x23f33
jmp 0x41315
leaq 0x53be3(%rip), %rdi     # 0x94ee9
xorl %ebx, %ebx
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x26e94
movq %rbx, %rax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcSizeFromCache
long long int udcSizeFromCache(char *url, char *cacheDir)
/* Look up the file size from the local cache bitmap file, or -1 if there
 * is no cache for url. */
{
long long int ret = -1;
if (cacheDir == NULL)
    cacheDir = udcDefaultDir();
struct slName *sl, *slList = udcFileCacheFiles(url, cacheDir);
for (sl = slList;  sl != NULL;  sl = sl->next)
    if (endsWith(sl->name, bitmapName))
	{
	ret = udcSizeAndModTimeFromBitmap(sl->name, NULL);
	break;
	}
slNameFreeList(&slList);
return ret;
}

// Assembly:
testq %rsi, %rsi
jne 0x41336
movq 0x7f962(%rip), %rsi     # 0xc0c98
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x40f15
movq %rax, (%rsp)
movq $-0x1, %rbx
testq %rax, %rax
je 0x41387
movq %rax, %r14
leaq 0x53e7d(%rip), %r15     # 0x951da
leaq 0x8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x21e4c
testl %eax, %eax
jne 0x4137a
movq (%r14), %r14
testq %r14, %r14
jne 0x4135d
jmp 0x41387
movq %r12, %rdi
xorl %esi, %esi
callq 0x4139e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20196
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcSizeAndModTimeFromBitmap
static long long int udcSizeAndModTimeFromBitmap(char *bitmapFileName, time_t *retTime)
/* Look up the file size from the local cache bitmap file, or -1 if there
 * is no cache for url. If retTime is non-null, store the remote update time in it. */
{
long long int ret = -1;
struct udcBitmap *bits = udcBitmapOpen(bitmapFileName);
if (bits != NULL)
    {
    ret = bits->fileSize;
    if (retTime)
	*retTime = bits->remoteUpdate;
    }
udcBitmapClose(&bits);
return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
callq 0x41523
movq %rax, (%rsp)
testq %rax, %rax
je 0x413c5
movq 0x18(%rax), %rbx
testq %r14, %r14
je 0x413cc
movq 0x10(%rax), %rax
movq %rax, (%r14)
jmp 0x413cc
movq $-0x1, %rbx
movq %rsp, %rdi
callq 0x41195
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcTimeFromCache
time_t udcTimeFromCache(char *url, char *cacheDir)
/* Look up the file datetime from the local cache bitmap file, or 0 if there
 * is no cache for url. */
{
time_t t = 0;
long long int ret = -1;
if (cacheDir == NULL)
    cacheDir = udcDefaultDir();
struct slName *sl, *slList = udcFileCacheFiles(url, cacheDir);
for (sl = slList;  sl != NULL;  sl = sl->next)
    if (endsWith(sl->name, bitmapName))
	{
	ret = udcSizeAndModTimeFromBitmap(sl->name, &t);
	if (ret == -1)
	    t = 0;
	break;
	}
slNameFreeList(&slList);
return t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq $0x0, (%rsp)
testq %rsi, %rsi
jne 0x413fc
movq 0x7f89c(%rip), %rsi     # 0xc0c98
callq 0x40f15
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x4144b
movq %rax, %rbx
leaq 0x53dc5(%rip), %r14     # 0x951da
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x21e4c
testl %eax, %eax
jne 0x41432
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x41415
jmp 0x4144b
movq %rsp, %rsi
movq %r15, %rdi
callq 0x4139e
cmpq $-0x1, %rax
jne 0x4144b
movq $0x0, (%rsp)
leaq 0x8(%rsp), %rdi
callq 0x20196
movq (%rsp), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcCheckCacheBits
boolean udcCheckCacheBits(struct udcFile *file, int startBlock, int endBlock)
/* Warn and return TRUE if any bit in (startBlock,endBlock] is not set. */
{
boolean gotUnset = FALSE;
struct udcBitmap *bitmap = udcBitmapOpen(file->bitmapFileName);
int partOffset;
Bits *bits;
readBitsIntoBuf(file, bitmap->fd, udcBitmapHeaderSize, startBlock, endBlock, &bits, &partOffset);

int partBitStart = startBlock - partOffset;
int partBitEnd = endBlock - partOffset;
int nextClearBit = bitFindClear(bits, partBitStart, partBitEnd);
while (nextClearBit < partBitEnd)
    {
    int clearBlock = nextClearBit + partOffset;
    warn("... udcFile 0x%04lx: bit for block %d (%lld..%lld] is not set",
	 (unsigned long)file, clearBlock,
	 ((long long)clearBlock * udcBlockSize), (((long long)clearBlock+1) * udcBlockSize));
    gotUnset = TRUE;
    int nextSetBit = bitFindSet(bits, nextClearBit, partBitEnd);
    nextClearBit = bitFindClear(bits, nextSetBit, partBitEnd);
    }
return gotUnset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %r13d
movq %rdi, %r14
movq 0x40(%rdi), %rdi
callq 0x41523
movl 0x3c(%rax), %esi
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movl %r13d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x41665
movl (%r12), %ebp
subl %ebp, %r13d
subl %ebp, %ebx
movq (%r15), %r15
movq %r15, %rdi
movl %r13d, %esi
movl %ebx, %edx
callq 0x1be37
movl %eax, %r13d
xorl %eax, %eax
cmpl %ebx, %r13d
jge 0x41514
leaq 0x53a6b(%rip), %r12     # 0x94f37
leal (%r13,%rbp), %eax
movslq %eax, %rdx
movq %rdx, %rcx
shlq $0xd, %rcx
leaq 0x2000(%rcx), %r8
movq %r12, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x26bea
movq %r15, %rdi
movl %r13d, %esi
movl %ebx, %edx
callq 0x1be2b
movq %r15, %rdi
movl %eax, %esi
movl %ebx, %edx
callq 0x1be37
movl %eax, %r13d
cmpl %ebx, %eax
jl 0x414cc
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: readBitsIntoBuf
static void readBitsIntoBuf(struct udcFile *file, int fd, int headerSize, int bitStart, int bitEnd,
	Bits **retBits, int *retPartOffset)
/* Do some bit-to-byte offset conversions and read in all the bytes that
 * have information in the bits we're interested in. */
{
int byteStart = bitStart/8;
int byteEnd = bitToByteSize(bitEnd);
int byteSize = byteEnd - byteStart;
Bits *bits = needLargeMem(byteSize);
ourMustLseek(&file->ios.bit,fd, headerSize + byteStart, SEEK_SET);
ourMustRead(&file->ios.bit, fd, bits, byteSize);
*retBits = bits;
*retPartOffset = byteStart*8;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
leal 0x7(%rdx), %r14d
testl %edx, %edx
cmovnsl %edx, %r14d
movl %esi, %ebp
movl %r14d, %ebx
sarl $0x3, %ebx
leal 0x7(%rcx), %eax
addl $0xe, %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movq %rdi, %r15
sarl $0x3, %ecx
subl %ebx, %ecx
movslq %ecx, %r12
movq %r12, %rdi
callq 0x2ddfc
movq %rax, %r13
addl $0x40, %ebx
movslq %ebx, %rsi
incq 0xb8(%r15)
movl %ebp, %edi
xorl %edx, %edx
callq 0x23550
movdqu 0xc0(%r15), %xmm0
movq %r12, %xmm1
movdqa 0x53404(%rip), %xmm2    # 0x94ae0
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0xc0(%r15)
movl %ebp, %edi
movq %r13, %rsi
movq %r12, %rdx
callq 0x234a5
movq 0x8(%rsp), %rax
movq %r13, (%rax)
andl $-0x8, %r14d
movq 0x10(%rsp), %rax
movl %r14d, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadBits64
bits64 udcReadBits64(struct udcFile *file, boolean isSwapped)
/* Read and optionally byte-swap 64 bit entity. */
{
bits64 val;
udcMustRead(file, &val, sizeof(val));
if (isSwapped)
    val = byteSwap64(val);
return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rsp, %r14
movl $0x8, %edx
movq %r14, %rsi
callq 0x40215
movq (%r14), %rax
testl %ebx, %ebx
je 0x41ad1
movq %rax, %rdi
callq 0x2396f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadBits32
bits32 udcReadBits32(struct udcFile *file, boolean isSwapped)
/* Read and optionally byte-swap 32 bit entity. */
{
bits32 val;
udcMustRead(file, &val, sizeof(val));
if (isSwapped)
    val = byteSwap32(val);
return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x4(%rsp), %r14
movl $0x4, %edx
movq %r14, %rsi
callq 0x40215
movl (%r14), %eax
testl %ebx, %ebx
je 0x41aff
movl %eax, %edi
callq 0x239ea
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadBits16
bits16 udcReadBits16(struct udcFile *file, boolean isSwapped)
/* Read and optionally byte-swap 16 bit entity. */
{
bits16 val;
udcMustRead(file, &val, sizeof(val));
if (isSwapped)
    val = byteSwap16(val);
return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x6(%rsp), %r14
movl $0x2, %edx
movq %r14, %rsi
callq 0x40215
movzwl (%r14), %eax
testl %ebx, %ebx
je 0x41b2f
movzwl %ax, %edi
callq 0x23a5d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadFloat
float udcReadFloat(struct udcFile *file, boolean isSwapped)
/* Read and optionally byte-swap floating point number. */
{
float val;
udcMustRead(file, &val, sizeof(val));
if (isSwapped)
    val = byteSwapFloat(val);
return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x4(%rsp), %r14
movl $0x4, %edx
movq %r14, %rsi
callq 0x40215
movss (%r14), %xmm0
testl %ebx, %ebx
je 0x41b5d
callq 0x23b3e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadDouble
double udcReadDouble(struct udcFile *file, boolean isSwapped)
/* Read and optionally byte-swap double-precision floating point number. */
{
double val;
udcMustRead(file, &val, sizeof(val));
if (isSwapped)
    val = byteSwapDouble(val);
return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rsp, %r14
movl $0x8, %edx
movq %r14, %rsi
callq 0x40215
movsd (%r14), %xmm0
testl %ebx, %ebx
je 0x41b89
callq 0x23adb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadLine
char *udcReadLine(struct udcFile *file)
/* Fetch next line from udc cache or NULL. */
{
char shortBuf[2], *longBuf = NULL, *buf = shortBuf;
int i, bufSize = sizeof(shortBuf);
for (i=0; ; ++i)
    {
    /* See if need to expand buffer, which is initially on stack, but if it gets big goes into 
     * heap. */
    if (i >= bufSize)
        {
	int newBufSize = bufSize*2;
	char *newBuf = needLargeMem(newBufSize);
	memcpy(newBuf, buf, bufSize);
	freeMem(longBuf);
	buf = longBuf = newBuf;
	bufSize = newBufSize;
	}

    char c;
    bits64 sizeRead = udcRead(file, &c, 1);
    if (sizeRead == 0)
	return NULL;
    buf[i] = c;
    if (c == '\n')
	{
	buf[i] = 0;
	break;
	}
    }
char *retString = cloneString(buf);
freeMem(longBuf);
return retString;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbp
leaq 0x16(%rsp), %r15
movl $0x2, %r14d
xorl %r12d, %r12d
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movslq %r14d, %r13
cmpq %r13, %rbx
jl 0x41bff
leal (,%r13,2), %r14d
movslq %r14d, %rdi
callq 0x2ddfc
movq %rbp, %r12
movq %rax, %rbp
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x6570
movq 0x8(%rsp), %rdi
callq 0x2e0a0
movq %rbp, %r15
movq %rbp, 0x8(%rsp)
movq %r12, %rbp
xorl %r12d, %r12d
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x7(%rsp), %rsi
callq 0x3ffbc
testq %rax, %rax
je 0x41c2c
movzbl 0x7(%rsp), %eax
cmpb $0xa, %al
cmovel %r12d, %eax
movb %al, (%r15,%rbx)
je 0x41c30
incq %rbx
jmp 0x41bbb
xorl %ebx, %ebx
jmp 0x41c45
movq %r15, %rdi
callq 0x1feba
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x2e0a0
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_O3/icebert[P]pblat/lib/udc.c
// Function: udcReadStringAndZero
char *udcReadStringAndZero(struct udcFile *file)
/* Read in zero terminated string from file.  Do a freeMem of result when done. */
{
char shortBuf[2], *longBuf = NULL, *buf = shortBuf;
int i, bufSize = sizeof(shortBuf);
for (i=0; ; ++i)
    {
    /* See if need to expand buffer, which is initially on stack, but if it gets big goes into 
     * heap. */
    if (i >= bufSize)
        {
	int newBufSize = bufSize*2;
	char *newBuf = needLargeMem(newBufSize);
	memcpy(newBuf, buf, bufSize);
	freeMem(longBuf);
	buf = longBuf = newBuf;
	bufSize = newBufSize;
	}
    char c = udcGetChar(file);
    buf[i] = c;
    if (c == 0)
        break;
    }
char *retString = cloneString(buf);
freeMem(longBuf);
return retString;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbp
leaq 0x16(%rsp), %r15
movl $0x2, %ebx
xorl %r14d, %r14d
leaq 0x7(%rsp), %r12
movq $0x0, 0x8(%rsp)
movslq %ebx, %r13
cmpq %r13, %r14
jl 0x41ccd
leal (,%r13,2), %ebx
movslq %ebx, %rdi
callq 0x2ddfc
movq %r15, %rsi
movq %r12, %r15
movq %rbp, %r12
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rdx
callq 0x6570
movq 0x8(%rsp), %rdi
callq 0x2e0a0
movq %rbp, %rax
movq %rbp, 0x8(%rsp)
movq %r12, %rbp
movq %r15, %r12
movq %rax, %r15
movl $0x1, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x40215
movb 0x7(%rsp), %al
movb %al, (%r15,%r14)
incq %r14
testb %al, %al
jne 0x41c83
movq %r15, %rdi
callq 0x1feba
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x2e0a0
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_O3/icebert[P]pblat/lib/udc.c
// Function: udcFileReadAll
char *udcFileReadAll(char *url, char *cacheDir, size_t maxSize, size_t *retSize)
/* Read a complete file via UDC. The cacheDir may be null in which case udcDefaultDir()
 * will be used.  If maxSize is non-zero, check size against maxSize
 * and abort if it's bigger.  Returns file data (with an extra terminal for the
 * common case where it's treated as a C string).  If retSize is non-NULL then
 * returns size of file in *retSize. Do a freeMem or freez of the returned buffer
 * when done. */
{
struct udcFile  *file = udcFileOpen(url, cacheDir);
size_t size = file->size;
if (maxSize != 0 && size > maxSize)
    errAbort("%s is %lld bytes, but maxSize to udcFileReadAll is %lld",
    	url, (long long)size, (long long)maxSize);
char *buf = needLargeMem(size+1);
udcMustRead(file, buf, size);
buf[size] = 0;	// add trailing zero for string processing
udcFileClose(&file);
if (retSize != NULL)
    *retSize = size;
return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rdi, %r13
callq 0x40ee5
movq %rax, %r15
movq %rax, 0x8(%rsp)
movq 0x28(%rax), %r14
testq %r12, %r12
setne %al
cmpq %r12, %r14
seta %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x41d64
leaq 0x5326c(%rip), %rdi     # 0x94fc0
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x26e94
movq %r14, %rdi
incq %rdi
callq 0x2ddfc
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x40215
movb $0x0, (%r12,%r14)
leaq 0x8(%rsp), %rdi
callq 0x40ff7
testq %rbx, %rbx
je 0x41d97
movq %r14, (%rbx)
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcSeekCur
void udcSeekCur(struct udcFile *file, bits64 offset)
/* Seek to a particular position in file. */
{
file->ios.udc.numSeeks++;
file->offset += offset;
if (udcCacheEnabled())
    ourMustLseek(&file->ios.sparse,file->fdSparse, offset, SEEK_CUR);
}

// Assembly:
incq 0x108(%rdi)
addq %rsi, 0x30(%rdi)
cmpq $0x0, 0x7eeb5(%rip)     # 0xc0c98
je 0x41dfb
movl 0x58(%rdi), %eax
incq 0xe0(%rdi)
movl %eax, %edi
movl $0x1, %edx
jmp 0x23550
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcSeek
void udcSeek(struct udcFile *file, bits64 offset)
/* Seek to a particular position in file. */
{
file->ios.udc.numSeeks++;
file->offset = offset;
if (udcCacheEnabled())
    ourMustLseek(&file->ios.sparse,file->fdSparse, offset, SEEK_SET);
}

// Assembly:
incq 0x108(%rdi)
movq %rsi, 0x30(%rdi)
cmpq $0x0, 0x7ee89(%rip)     # 0xc0c98
je 0x41e24
movl 0x58(%rdi), %eax
incq 0xe0(%rdi)
movl %eax, %edi
xorl %edx, %edx
jmp 0x23550
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcCleanup
bits64 udcCleanup(char *cacheDir, double maxDays, boolean testOnly)
/* Remove cached files older than maxDays old. If testOnly is set
 * no clean up is done, but the size of the files that would be
 * cleaned up is still. */

{
time_t maxSeconds = maxDays * 24 * 60 * 60;
char *curPath = cloneString(getCurrentDir());
setCurrentDir(cacheDir);
time_t deleteTime = time(NULL) - maxSeconds;
bits64 result = rCleanup(deleteTime, testOnly);
setCurrentDir(curPath);
return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
mulsd 0x52cb1(%rip), %xmm0    # 0x94af0
movsd 0x52cb1(%rip), %xmm1    # 0x94af8
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %r12
xorl %eax, %eax
callq 0x347c5
movq %rax, %rdi
callq 0x1feba
movq %rax, %r15
movq %r14, %rdi
callq 0x347f3
xorl %edi, %edi
callq 0x6660
subq %r12, %rax
movq %rax, %rdi
movl %ebx, %esi
callq 0x41e9c
movq %rax, %rbx
movq %r15, %rdi
callq 0x347f3
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcUpdateTime
time_t udcUpdateTime(struct udcFile *udc)
/* return udc->updateTime */
{
if (sameString("transparent", udc->protocol))
    {
    struct stat status;
    int ret = stat(udc->url, &status);
    if (ret < 0)
	return 0;
    else
	return  status.st_mtime;
    }
return udc->updateTime;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
leaq 0x52d76(%rip), %rdi     # 0x94e37
callq 0x6a50
testl %eax, %eax
je 0x420d0
movq 0x20(%rbx), %rax
jmp 0x420e9
movq 0x8(%rbx), %rdi
movq %rsp, %rsi
callq 0x6d00
testl %eax, %eax
js 0x420e7
movq 0x58(%rsp), %rax
jmp 0x420e9
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcFileSize
off_t udcFileSize(char *url)
/* fetch file size from given URL or local path 
 * returns -1 if not found. */
{
if (udcIsLocal(url))
    return fileSize(url);

// don't go to the network if we can avoid it
int cacheSize = udcSizeFromCache(url, NULL);
if (cacheSize!=-1)
    return cacheSize;

off_t ret = -1;
struct udcRemoteFileInfo info;

if (startsWith("http://",url) || startsWith("https://",url))
    {
    if (udcInfoViaHttp(url, &info))
	ret = info.size;
    }
else if (startsWith("ftp://",url))
    {
    if (udcInfoViaFtp(url, &info))
	ret = info.size;
    }
else
    errAbort("udc/udcFileSize: invalid protocol for url %s, can only do http/https/ftp", url);

return ret;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0x4219d
testl %eax, %eax
je 0x42110
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
jmp 0x34694
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4132a
cmpl $-0x1, %eax
jne 0x4215b
leaq 0x4f582(%rip), %rdi     # 0x916a8
movq %rbx, %rsi
callq 0x21b23
testl %eax, %eax
jne 0x42145
leaq 0x4f577(%rip), %rdi     # 0x916b0
movq %rbx, %rsi
callq 0x21b23
testl %eax, %eax
je 0x4215f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3fbdc
testl %eax, %eax
je 0x42190
movq 0x8(%rsp), %rax
jmp 0x42197
cltq
jmp 0x42197
leaq 0x4f553(%rip), %rdi     # 0x916b9
movq %rbx, %rsi
callq 0x21b23
testl %eax, %eax
je 0x4217f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3fedb
jmp 0x42150
leaq 0x52e72(%rip), %rdi     # 0x94ff8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26e94
movq $-0x1, %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/udc.c
// Function: udcIsLocal
boolean udcIsLocal(char *url) 
/* return true if file is not a http or ftp file, just a local file */
{
// copied from above
char *protocol = NULL, *afterProtocol = NULL, *colon;
udcParseUrl(url, &protocol, &afterProtocol, &colon);
freez(&protocol);
freez(&afterProtocol);
return colon==NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r12d, %r12d
leaq 0x10(%rsp), %rbx
movq %r12, (%rbx)
leaq 0x8(%rsp), %r14
movq %r12, (%r14)
movq %rsp, %r15
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x40250
movq %rbx, %rdi
callq 0x2e0b0
movq %r14, %rdi
callq 0x2e0b0
xorl %eax, %eax
cmpq %r12, (%r15)
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq