LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: vaHtmlDyStringPrintf
void vaHtmlDyStringPrintf(struct dyString *ds, char *format, va_list args)
/* VarArgs Printf append to dyString
 * Strings are escaped according to format type. */
{
/* attempt to format the string in the current space.  If there
 * is not enough room, increase the buffer size and try again */
int avail, sz;
while (TRUE)
    {
    va_list argscp;
    va_copy(argscp, args);
    avail = ds->bufSize - ds->stringSize;
    if (avail <= 0)
        {
        /* Don't pass zero sized buffers to vsnprintf, because who knows
         * if the library function will handle it. */
        dyStringBumpBufSize(ds, ds->bufSize+ds->bufSize);
        avail = ds->bufSize - ds->stringSize;
        }
    sz = vaHtmlSafefNoAbort(ds->string + ds->stringSize, avail, format, argscp, FALSE, TRUE);
    va_end(argscp);
    /* note that some version return -1 if too small */
    if ((sz < 0) || (sz >= avail))
	{
        dyStringBumpBufSize(ds, ds->bufSize+ds->bufSize);
	}
    else
        {
        ds->stringSize += sz;
        break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %r12
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, (%rsp)
movl 0x10(%r15), %esi
movl %esi, %ebp
subl 0x14(%r15), %ebp
jg 0x47b06
addl %esi, %esi
movq %r15, %rdi
callq 0x262a6
movl 0x10(%r15), %ebp
subl 0x14(%r15), %ebp
movslq 0x14(%r15), %rdi
addq 0x8(%r15), %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x49683
testl %eax, %eax
sets %cl
cmpl %ebp, %eax
setge %bpl
orb %cl, %bpl
cmpb $0x1, %bpl
jne 0x47b48
movl 0x10(%r15), %esi
addl %esi, %esi
movq %r15, %rdi
callq 0x262a6
jmp 0x47b4c
addl %eax, 0x14(%r15)
testb %bpl, %bpl
jne 0x47ad8
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmTextOut
void htmTextOut(FILE *f, char *s)
/* Print out string to file, if necessary replacing > with &gt; and the like */
{
char c;
if (NoEscape)
    {
    fputs(s, f);
    return;
    }

while ((c = *s++) != 0)
    {
    switch (c)
        {
	case '>':
	    fputs("&gt;", f);
	    break;
	case '<':
	    fputs("&lt;", f);
	    break;
	case '&':
	    fputs("&amp;", f);
	    break;
	case '"':
	    fputs("&quot;", f);
	    break;
	default:
	    fputc(c, f);
	    break;
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x8c80b(%rip)     # 0xd4565
je 0x47d75
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6810
leaq 0x4ec82(%rip), %r15     # 0x969fe
leaq 0x4ec75(%rip), %r12     # 0x969f8
leaq 0x4ec69(%rip), %r13     # 0x969f3
leaq 0x4ec5d(%rip), %rbp     # 0x969ee
movzbl (%r14), %eax
incq %r14
cmpl $0x3b, %eax
jg 0x47dac
cmpl $0x22, %eax
je 0x47dbb
cmpl $0x26, %eax
jne 0x47dcd
movq %r12, %rdi
jmp 0x47dc3
cmpl $0x3c, %eax
je 0x47dc0
cmpl $0x3e, %eax
jne 0x47dd1
movq %rbp, %rdi
jmp 0x47dc3
movq %r15, %rdi
jmp 0x47dc3
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6810
jmp 0x47d91
testl %eax, %eax
je 0x47dde
movsbl %al, %edi
movq %rbx, %rsi
callq 0x6930
jmp 0x47d91
addq $0x8, %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/htmshell.c
// Function: htmlTextStripTags
char *htmlTextStripTags(char *s)
/* Returns a cloned string with all html tags stripped out */
{
if (s == NULL)
    return NULL;
char *scrubbed = needMem(strlen(s));
char *from=s;
char *to=scrubbed;
while (*from!='\0')
    {
    if (*from == '<')
        {
        from++;
        while (*from!='\0' && *from != '>')
            from++;
        if (*from == '\0')  // The last open tag was never closed!
            break;
        from++;
        }
    else
        *to++ = *from++;
    }
return scrubbed;
}

// Assembly:
testq %rdi, %rdi
je 0x47e42
pushq %rbx
movq %rdi, %rbx
callq 0x62d0
movq %rax, %rdi
callq 0x2dc95
movq %rax, %rcx
movzbl (%rbx), %edx
cmpl $0x3c, %edx
je 0x47e2b
testl %edx, %edx
je 0x47e40
movb %dl, (%rcx)
incq %rcx
jmp 0x47e3b
movzbl 0x1(%rbx), %edx
testl %edx, %edx
je 0x47e40
incq %rbx
cmpl $0x3e, %edx
jne 0x47e2b
incq %rbx
jmp 0x47e18
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlTextStripJavascriptCssAndTags
char *htmlTextStripJavascriptCssAndTags(char *s)
/* Returns a cloned string with all inline javascript, css, and html tags stripped out */
{
if (s == NULL)
    return NULL;
char *scrubbed = needMem(strlen(s));
char *from=s;
char *to=scrubbed;
while (*from!='\0')
    {
    if (startsWithNoCase("<script", from))
        {
        from++;
        while (*from!='\0' && !startsWithNoCase("</script>", from))
            from++;
        if (*from == '\0')  // The last open tag was never closed!
            break;
        from += strlen("</script>");
        *to++ = ' ';
        }
    else if (startsWithNoCase("<style", from))
        {
        from++;
        while (*from!='\0' && !startsWithNoCase("</style>", from))
            from++;
        if (*from == '\0')  // The last open tag was never closed!
            break;
        from += strlen("</style>");
        *to++ = ' ';
        }
    else if (*from == '<')
        {
        from++;
        while (*from!='\0' && *from != '>')
            from++;
        if (*from == '\0')  // The last open tag was never closed!
            break;
        from++;
        *to++ = ' ';
        }
    else
        *to++ = *from++;
    }
return scrubbed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x47f3b
movq %rdi, %r14
callq 0x62d0
movq %rax, %rdi
callq 0x2dc95
movq %rax, %r12
cmpb $0x0, (%r14)
je 0x47f3e
leaq 0x4eb88(%rip), %r15     # 0x96a05
leaq 0x4eb9a(%rip), %r13     # 0x96a1e
leaq 0x4eb82(%rip), %rbp     # 0x96a0d
movq %r12, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x217e9
testl %eax, %eax
je 0x47ecc
addq $0xa, %r14
movq %r14, %rcx
movq %rcx, %r14
cmpb $0x0, -0x9(%rcx)
je 0x47ec1
leaq -0x9(%r14), %rsi
movq %rbp, %rdi
callq 0x217e9
leaq 0x1(%r14), %rcx
testl %eax, %eax
je 0x47ea4
movb $0x20, %al
cmpb $0x0, -0x9(%r14)
jne 0x47f2a
jmp 0x47f3e
leaq 0x4eb44(%rip), %rdi     # 0x96a17
movq %r14, %rsi
callq 0x217e9
testl %eax, %eax
je 0x47f0e
addq $0x9, %r14
movq %r14, %rcx
movq %rcx, %r14
cmpb $0x0, -0x8(%rcx)
je 0x47f03
leaq -0x8(%r14), %rsi
movq %r13, %rdi
callq 0x217e9
leaq 0x1(%r14), %rcx
testl %eax, %eax
je 0x47ee6
movb $0x20, %al
cmpb $0x0, -0x8(%r14)
jne 0x47f2a
jmp 0x47f3e
movb (%r14), %al
incq %r14
cmpb $0x3c, %al
jne 0x47f2a
movzbl (%r14), %eax
testl %eax, %eax
je 0x47f3e
incq %r14
cmpl $0x3e, %eax
jne 0x47f18
movb $0x20, %al
movb %al, (%rbx)
incq %rbx
cmpb $0x0, (%r14)
jne 0x47e8e
jmp 0x47f3e
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %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/htmshell.c
// Function: htmlTextReplaceTagsWithChar
char *htmlTextReplaceTagsWithChar(char *s, char ch)
/* Returns a cloned string with all html tags replaced with given char (useful for tokenizing) */
{
if (s == NULL)
    return NULL;
char *scrubbed = needMem(strlen(s) + 1);
char *from=s;
char *to=scrubbed;
while(*from!='\0')
    {
    if (*from == '<')
        {
        from++;
        *to++ = ch;
        while (*from!='\0' && *from != '>')
            from++;
        if (*from == '\0')  // The last open tag was never closed!
            break;
        from++;
        }
    else
        *to++ = *from++;
    }
*to = '\0';
return scrubbed;
}

// Assembly:
testq %rdi, %rdi
je 0x47fa9
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x62d0
leaq 0x1(%rax), %rdi
callq 0x2dc95
movq %rax, %rcx
movzbl (%r14), %edx
cmpl $0x3c, %edx
je 0x47f83
testl %edx, %edx
je 0x47f9e
movb %dl, (%rcx)
incq %rcx
jmp 0x47f99
movb %bl, (%rcx)
incq %rcx
movzbl 0x1(%r14), %edx
testl %edx, %edx
je 0x47f9e
incq %r14
cmpl $0x3e, %edx
jne 0x47f88
incq %r14
jmp 0x47f6f
movb $0x0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlWarnEncode
char *htmlWarnEncode(char *s)
/* Returns a cloned string with newlines replaced by BR tag.
   Meant to be displayed with warn popup box. */
{
int size = strlen(s);
size += countChars(s,'\n') * 4;
char *cleanQuote = needMem(size+1);
safecpy(cleanQuote,size+1,s);

strSwapStrs(cleanQuote, size,"\n","<BR>" ); // use BR tag for new lines

return cleanQuote;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x62d0
movq %rax, %r14
movq %rbx, %rdi
movl $0xa, %esi
callq 0x22160
leal (%r14,%rax,4), %ebp
leal (%r14,%rax,4), %eax
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x2dc95
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21264
leaq 0x471a9(%rip), %rdx     # 0x8f1a1
leaq 0x4bd13(%rip), %rcx     # 0x93d12
movq %r15, %rdi
movl %ebp, %esi
callq 0x21e91
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlEncodeTextExtended
int htmlEncodeTextExtended(char *s, char *out, int outSize)
/* Replaces required punctuation characters with html entities to fight XSS. 
 * out result must be large enough to receive the encoded string.
 * Returns size of encoded string or -1 if output larger than outSize. 
 * To just get the final encoded size, pass in NULL for out and 0 for outSize. 
 * To output without checking sizes, pass in non-NULL for out and 0 for outSize. 
 */
{
int total = 0;
char c = 0;
do
    {
    c=*s++;
    int size = 1;
    char *newString = NULL; 
    if (c == '&') { size = 5; newString = "&amp;"; } // '&' start a control char
    if (c == '>') { size = 4; newString = "&gt;" ; } // '>' close of tag
    if (c == '<') { size = 4; newString = "&lt;" ; } // '<' open  of tag
    if (c == '/')  { size = 6; newString = "&#x2F;"; } // forward slash helps end an HTML entity
    if (c == '"')  { size = 6; newString = "&quot;"; } // double quote
    if (c == '\'') { size = 5; newString = "&#39;" ; } // single quote
    if (out)
	{
	if (outSize > 0 && (total+size+1) > outSize) // 1 for terminator
	    {
	    *out = 0;
	    return -1;
	    }
	if (size == 1)
	    *out++ = c;
	else
	    {
	    strncpy(out, newString, size);
	    out += size;
	    }
	}
    total += size;
    } while (c != 0);
return total - 1; // do not count terminating 0
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
leaq 0x4e9c7(%rip), %rdi     # 0x969f8
leaq 0x4e9b6(%rip), %r8      # 0x969ee
movl $0x4, %r9d
leaq 0x4e9ae(%rip), %r10     # 0x969f3
leaq 0x4e9db(%rip), %r11     # 0x96a27
movl $0x6, %r12d
movl %edx, 0x4(%rsp)
movb (%r14), %r13b
xorl %eax, %eax
cmpb $0x26, %r13b
movl $0x0, %esi
cmoveq %rdi, %rsi
sete %al
cmpb $0x3e, %r13b
cmoveq %r8, %rsi
leal 0x1(,%rax,4), %ebp
cmovel %r9d, %ebp
cmpb $0x3c, %r13b
cmovel %r9d, %ebp
cmoveq %r10, %rsi
cmpb $0x2f, %r13b
cmoveq %r11, %rsi
cmovel %r12d, %ebp
cmpb $0x22, %r13b
cmovel %r12d, %ebp
leaq 0x4e959(%rip), %rax     # 0x969fe
cmoveq %rax, %rsi
cmpb $0x27, %r13b
movl $0x5, %eax
cmovel %eax, %ebp
leaq 0x4e972(%rip), %rax     # 0x96a2e
cmoveq %rax, %rsi
movl $0x0, %ecx
testq %r15, %r15
je 0x4812a
testl %edx, %edx
jle 0x480dd
leal (%rbx,%rbp), %eax
cmpl %edx, %eax
jl 0x480dd
movb $0x0, (%r15)
xorl %eax, %eax
jmp 0x48131
cmpl $0x1, %ebp
jne 0x480ea
movb %r13b, (%r15)
incq %r15
jmp 0x48127
movl %ebp, %r12d
movq %r15, %rdi
movq %r12, %rdx
callq 0x6380
leaq 0x4e928(%rip), %r11     # 0x96a27
leaq 0x4e8ed(%rip), %r10     # 0x969f3
movl $0x4, %r9d
leaq 0x4e8db(%rip), %r8      # 0x969ee
leaq 0x4e8de(%rip), %rdi     # 0x969f8
movl 0x4(%rsp), %edx
addq %r12, %r15
movl $0x6, %r12d
movq %r15, %rcx
addl %ebp, %ebx
movb $0x1, %al
movq %rcx, %r15
testb %al, %al
je 0x48145
incq %r14
testb %r13b, %r13b
jne 0x48056
decl %ebx
jmp 0x4814a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %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/htmshell.c
// Function: htmlEncode
char *htmlEncode(char *s)
/* Returns a cloned string with quotes replaced by html codes.
   Changes ',",\n and >,<,& to code equivalents.
   This differs from cgiEncode as it handles text that will
   be displayed in an html page or tooltip style title.  */
{
int size = htmlEncodeTextSize(s);
char *out = needMem(size+1);
htmlEncodeTextExtended(s, out, size+1);
return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
callq 0x48017
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x2dc95
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x48017
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: nonAlphaNumericHexDecodeText
void nonAlphaNumericHexDecodeText(char *s, char *prefix, char *postfix)
/* For html tag attributes, it decodes non-alphanumeric characters
 * with <prefix>HH<postfix> hex codes.
 * Decoding happens in-place, changing the input string s.
 * prefix must not be empty string or null, but postfix can be empty string.
 * Because the decoded string is always equal to or shorter than the input string,
 * the decoding is just done in-place modifying the input string.
 * Accepts upper and lower case values in entities.
 */
{
char *d = s;  // where are we decoding to right now
int pfxLen = strlen(prefix);
int postLen = strlen(postfix);
while (isNotEmpty(s))
    {
    char h;
    if (startsWithNoCase(prefix, s) &&
        decodeTwoHexChars(s+pfxLen, &h) &&
        startsWithNoCase(postfix, s+pfxLen+2))
        {
        *d++ = h;
        s += pfxLen + 2 + postLen;
        }
    else
        *d++ = *s++;
    }
*d = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x483fb
movq %rdx, %r14
movq %rsi, %r15
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
cmpb $0x0, (%rbx)
je 0x483fb
movslq %eax, %r13
leal (%r12,%r13), %eax
addl $0x2, %eax
cltq
movq %rax, (%rsp)
movq %rbx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x217e9
testl %eax, %eax
je 0x483e4
movb (%r12,%r13), %al
leal -0x30(%rax), %ebp
cmpb $0xa, %bpl
jae 0x4835d
xorl %ecx, %ecx
jmp 0x48383
leal -0x41(%rax), %ecx
cmpb $0x5, %cl
ja 0x4836d
addb $-0x37, %al
xorl %ecx, %ecx
movl %eax, %ebp
jmp 0x48383
leal -0x67(%rax), %ecx
addb $-0x57, %al
cmpb $-0x6, %cl
setb %cl
movzbl %al, %ebp
movl $0x0, %eax
cmovbl %eax, %ebp
leaq (%r12,%r13), %rsi
movb $0x1, %al
testb %cl, %cl
jne 0x483c7
movb 0x1(%rsi), %cl
shlb $0x4, %bpl
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x483a5
orb %bpl, %dl
xorl %eax, %eax
movl %edx, %ebp
jmp 0x483c7
leal -0x41(%rcx), %edx
cmpb $0x5, %dl
ja 0x483b5
addb %bpl, %cl
addb $-0x37, %cl
jmp 0x483c3
leal -0x61(%rcx), %edx
cmpb $0x5, %dl
ja 0x483c7
addb %bpl, %cl
addb $-0x57, %cl
xorl %eax, %eax
movl %ecx, %ebp
testb %al, %al
jne 0x483e4
addq $0x2, %rsi
movq %r14, %rdi
callq 0x217e9
testl %eax, %eax
je 0x483e4
movb %bpl, (%rbx)
addq (%rsp), %r12
jmp 0x483ed
movb (%r12), %al
incq %r12
movb %al, (%rbx)
incq %rbx
cmpb $0x0, (%r12)
jne 0x48339
movb $0x0, (%rbx)
addq $0x8, %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/htmshell.c
// Function: attributeEncode
char *attributeEncode(char *s)
/* Returns a cloned string with non-alphanumeric characters replaced by escape codes. */
{
int size = attrEncodeTextSize(s);
char *out = needMem(size+1);
attrEncodeTextExtended(s, out, size+1);
return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4e5ea(%rip), %r14     # 0x96a34
leaq 0x4d9f3(%rip), %r15     # 0x95e44
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dc95
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: cssEncode
char *cssEncode(char *s)
/* Returns a cloned string with non-alphanumeric characters replaced by escape codes. */
{
int size = cssEncodeTextSize(s);
char *out = needMem(size+1);
cssEncodeTextExtended(s, out, size+1);
return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4e557(%rip), %r14     # 0x96a38
leaq 0x45f0a(%rip), %r15     # 0x8e3f2
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dc95
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: javascriptEncode
char *javascriptEncode(char *s)
/* Returns a cloned string with non-alphanumeric characters replaced by escape codes. */
{
int size = javascriptEncodeTextSize(s);
char *out = needMem(size+1);
javascriptEncodeTextExtended(s, out, size+1);
return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4e4c2(%rip), %r14     # 0x96a3a
leaq 0x4fde1(%rip), %r15     # 0x98360
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dc95
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: urlEncode
char *urlEncode(char *s)
/* Returns a cloned string with non-alphanumeric characters replaced by escape codes. */
{
int size = urlEncodeTextSize(s);
char *out = needMem(size+1);
urlEncodeTextExtended(s, out, size+1);
return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4e42e(%rip), %r14     # 0x96a3d
leaq 0x4fd4a(%rip), %r15     # 0x98360
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dc95
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4819c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlVaBadRequestAbort
void htmlVaBadRequestAbort(char *format, va_list args)
/* Print out an HTTP header 400 status code (Bad Request) and message, then exit with error.
 * NOTE: This must be installed using pushWarnHandler (pushAbortHandler optional) because
 * vaErrAbort calls vaWarn and then noWarnAbort.  So if the defaut warn handler is used, then
 * the error message will be printed out by defaultVaWarn before this prints out the header. */
{
puts("Status: 400\r");
puts("Content-Type: text/plain; charset=UTF-8\r");
puts("\r");
if (format != NULL && &args != NULL)
    {
    vfprintf(stdout, format, args);
    fprintf(stdout, "\n");
    }
exit(-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4e743(%rip), %rdi     # 0x96e72
callq 0x6bb0
leaq 0x4e744(%rip), %rdi     # 0x96e7f
callq 0x6bb0
leaq 0x4e736(%rip), %rdi     # 0x96e7d
callq 0x6bb0
testq %r14, %r14
je 0x48773
movq 0x76858(%rip), %r15     # 0xbefb0
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x69e0
movq (%r15), %rsi
movl $0xa, %edi
callq 0x6930
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x68d0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlSetCookie
void htmlSetCookie(char* name, char* value, char* expires, char* path, char* domain, boolean isSecure)
/* create a cookie with the given stats */
{
char* encoded_name;
char* encoded_value;
char* encoded_path = NULL;

encoded_name = cgiEncode(name);
encoded_value = cgiEncode(value);
if(path != NULL)
	encoded_path = cgiEncode(path);

printf("Set-Cookie: %s=%s; ", encoded_name, encoded_value);

if(expires != NULL)
    printf("expires=%s; ", expires);

if(path != NULL)
    printf("path=%s; ", encoded_path);

if(domain != NULL)
    printf("domain=%s; ", domain);

if(isSecure == TRUE)
    printf("secure");

printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
callq 0x44d25
movq %rax, %rbp
movq %rbx, %rdi
callq 0x44d25
movq %rax, %rbx
testq %r15, %r15
je 0x48831
movq %r15, %rdi
callq 0x44d25
movq %rax, %r13
jmp 0x48834
xorl %r13d, %r13d
leaq 0x4e6c0(%rip), %rdi     # 0x96efb
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x4885e
leaq 0x4e6bb(%rip), %rdi     # 0x96f0f
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x48874
leaq 0x4e6b2(%rip), %rdi     # 0x96f1c
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %r14, %r14
je 0x4888a
leaq 0x4e6a6(%rip), %rdi     # 0x96f26
movq %r14, %rsi
xorl %eax, %eax
callq 0x6070
cmpl $0x1, 0x4(%rsp)
jne 0x4889f
leaq 0x4e69a(%rip), %rdi     # 0x96f32
xorl %eax, %eax
callq 0x6070
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: printBodyTag
void printBodyTag(FILE *f)
{
// print starting BODY tag, including any appropriate attributes (class, background and bgcolor). 
fprintf(f, "<BODY");
struct slName *classes = NULL;

slNameAddHead(&classes, "cgi");
char *scriptName = cgiScriptName();
if(isNotEmpty(scriptName))
    {
    char buf[FILENAME_LEN];
    splitPath(scriptName, NULL, buf, NULL);
    slNameAddHead(&classes, cloneString(buf));
}
if (htmlFormClass != NULL )
    slNameAddHead(&classes, htmlFormClass);
fprintf(f, " CLASS=\"%s\"", slNameListToString(classes, ' '));

if (htmlBackground != NULL )
    fprintf(f, " BACKGROUND=\"%s\"", htmlBackground);
if (gotBgColor)
    fprintf(f, " BGCOLOR=\"#%X\"", htmlBgColor);
fputs(">\n",f);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x4e66e(%rip), %rdi     # 0x96f39
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x6e70
leaq 0x8(%rsp), %rdi
movq $0x0, (%rdi)
leaq 0x4f5b5(%rip), %rsi     # 0x97ea5
callq 0x20698
xorl %eax, %eax
callq 0x4400c
testq %rax, %rax
je 0x4892f
cmpb $0x0, (%rax)
je 0x4892f
leaq 0x10(%rsp), %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2852a
movq %r14, %rdi
callq 0x1f9f6
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x20698
movq 0x8bd0a(%rip), %rsi     # 0xd4640
testq %rsi, %rsi
je 0x48945
leaq 0x8(%rsp), %rdi
callq 0x20698
movq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0x20940
leaq 0x4e5e4(%rip), %rsi     # 0x96f3f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6a90
movq 0x8bce1(%rip), %rdx     # 0xd4650
testq %rdx, %rdx
je 0x48985
leaq 0x4e5d0(%rip), %rsi     # 0x96f4b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
cmpl $0x0, 0x8bccc(%rip)     # 0xd4658
je 0x489a5
movl 0x7833c(%rip), %edx     # 0xc0cd0
leaq 0x4e5c1(%rip), %rsi     # 0x96f5c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
leaq 0x4ea06(%rip), %rdi     # 0x973b2
movq %rbx, %rsi
callq 0x6810
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: makeRandomKey
char *makeRandomKey(int numBits)
/* Generate base64 encoding of a random key of at least size numBits returning string to be freed when done */
{
int numBytes = (numBits + 7) / 8;  // round up to nearest whole byte.
numBytes = ((numBytes+2)/3)*3;  // round up to the nearest multiple of 3 to avoid equals-char padding in base64 output
FILE *f = mustOpen("/dev/urandom", "r");   // open random system device for read-only access.
char *binaryString = needMem(numBytes);
mustRead(f, binaryString, numBytes);
carefulClose(&f);
char * result = base64Encode(binaryString, numBytes); // converts 3 binary bytes into 4 printable characters
int len = strlen(result);
memSwapChar(result, len, '+', 'A'); // replace + and / with characters that are URL-friendly.
memSwapChar(result, len, '/', 'a');
freeMem(binaryString);
return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leal 0x7(%rdi), %eax
addl $0xe, %edi
testl %eax, %eax
cmovnsl %eax, %edi
sarl $0x3, %edi
addl $0x2, %edi
movslq %edi, %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
leal (%rax,%rax,2), %ebx
leaq 0x4e571(%rip), %rdi     # 0x96f6b
leaq 0x4d428(%rip), %rsi     # 0x95e29
callq 0x22d5a
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movslq %ebx, %r15
movq %r15, %rdi
callq 0x2dc95
movq %rax, %rbx
movq (%r14), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x22e78
movq %r14, %rdi
callq 0x23400
movq %rbx, %rdi
movq %r15, %rsi
callq 0x42a2c
movq %rax, %r14
movq %rax, %rdi
callq 0x62d0
movq %rax, %r15
movq %r14, %rdi
movl %r15d, %esi
movl $0x2b, %edx
movl $0x41, %ecx
callq 0x21fee
movq %r14, %rdi
movl %r15d, %esi
movl $0x2f, %edx
movl $0x61, %ecx
callq 0x21fee
movq %rbx, %rdi
callq 0x2dd41
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: getCspMetaHeader
char *getCspMetaHeader()
/* return meta CSP header string */
{
char *policy = getCspPolicyString();
char *meta = getCspMetaString(policy);
freeMem(policy);
return meta;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
callq 0x48b06
movq %rax, %rbx
leaq 0x4e52e(%rip), %rdx     # 0x9723a
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rcx
xorl %eax, %eax
callq 0x23c18
movq %r14, %rdi
callq 0x1f9f6
movq %rax, %r14
movq %rbx, %rdi
callq 0x2dd41
movq %r14, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmEmptyShell
void htmEmptyShell(void (*doMiddle)(), char *method)
/* Wrap error recovery and and input processing around call to doMiddle. */
{
int status;

/* Set up error recovery (for out of memory and the like)
 * so that we finish web page regardless of problems. */
pushAbortHandler(htmlAbort);
pushWarnHandler(htmlVaWarn);
status = setjmp(htmlRecover);

/* Do your main thing. */
if (status == 0)
    {
    doMiddle();
    }

popWarnHandler();
popAbortHandler();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq -0x8a8(%rip), %rdi      # 0x4877d
callq 0x26d58
leaq -0x41de7(%rip), %rdi    # 0x724a
callq 0x26b1f
leaq 0x8b533(%rip), %rdi     # 0xd4570
callq 0x6ab0
testl %eax, %eax
jne 0x4904a
xorl %eax, %eax
callq *%rbx
xorl %eax, %eax
movl %eax, %ebx
callq 0x26bef
movl %ebx, %eax
callq 0x26dab
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmShell
void htmShell(char *title, void (*doMiddle)(), char *method)
{
/* Preamble. */
dnaUtilOpen();
htmlStart(title);

/* Call wrapper for error handling. */
htmEmptyShell(doMiddle, method);

/* Post-script. */
htmlEnd();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x25b5c
movq %r14, %rdi
callq 0x48f43
movq %rbx, %rdi
callq 0x4901a
movq 0x75f2c(%rip), %rax     # 0xbefb0
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x48fb0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmShellWithHead
void htmShellWithHead( char *title, char *head, void (*doMiddle)(), char *method)
{
/* Preamble. */
dnaUtilOpen();

puts("Content-Type:text/html");
puts("\n");

puts("<HTML>");
printf("<HEAD>%s<TITLE>%s</TITLE>\n</HEAD>\n\n", head, title);
printBodyTag(stdout);

htmlWarnBoxSetup(stdout);// Sets up a warning box which can be filled with errors as they occur

/* Call wrapper for error handling. */
htmEmptyShell(doMiddle, method);

/* Post-script. */
htmlEnd();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x25b5c
leaq 0x4e37d(%rip), %rdi     # 0x9742c
callq 0x6bb0
leaq 0x460e6(%rip), %rdi     # 0x8f1a1
callq 0x6bb0
leaq 0x4e3e4(%rip), %rdi     # 0x974ab
callq 0x6bb0
leaq 0x4e3df(%rip), %rdi     # 0x974b2
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6070
movq 0x75ec9(%rip), %r14     # 0xbefb0
movq (%r14), %rdi
callq 0x488b7
movq (%r14), %rdi
callq 0x48679
movq %rbx, %rdi
callq 0x4901a
movq (%r14), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x48fb0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlIncludeFile
void htmlIncludeFile(char *path)
{
char *str = NULL;
size_t len = 0;

if (path == NULL)
    errAbort("Program error: including null file");
if (!fileExists(path))
    errAbort("Missing file %s", path);
readInGulp(path, &str, &len);

if (len <= 0)
    errAbort("Error reading included file: %s", path);

puts(str);
freeMem(str);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rdi, %rdi
jne 0x49135
leaq 0x4e3a8(%rip), %rdi     # 0x974d6
xorl %eax, %eax
callq 0x26b6f
movq %rbx, %rdi
callq 0x23942
testl %eax, %eax
jne 0x49152
leaq 0x4e3b1(%rip), %rdi     # 0x974f9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26b6f
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x32524
cmpq $0x0, (%r14)
jne 0x4917e
leaq 0x4e395(%rip), %rdi     # 0x97509
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26b6f
movq 0x8(%rsp), %rdi
callq 0x6bb0
movq 0x8(%rsp), %rdi
callq 0x2dd41
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlSafefAbort
int htmlSafefAbort(boolean noAbort, int errCode, char *format, ...)
/* handle noAbort stderror logging and errAbort */
{
va_list args;
va_start(args, format);
if (noAbort)
    {
    vfprintf(stderr, format, args);
    fprintf(stderr, "\n");
    fflush(stderr);
    }
else
    {
    vaErrAbort(format, args);
    }
va_end(args);
return errCode;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movl %esi, %ebx
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x4922c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rsp)
movq %rsp, %rsi
testl %edi, %edi
jne 0x49266
movq %rdx, %rdi
callq 0x26c4a
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
retq
movq %rdx, %rdi
callq 0x7416
jmp 0x4925b
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: htmlSpecifierToEncoding
char htmlSpecifierToEncoding(char *format, int *pI, boolean noAbort)
/* translate specifier to encoding type */
{
int i = *pI + 1;
int cnt =  0;
char enc;
char spec[7+1];  // only check for 7 characters after |spec| starts.
spec[0] = 0;
if (format[i] == '|')
    {
    ++i;
    while (TRUE)
	{
	char c = format[i++];
	if ((c == 0) || (cnt >= 7)) // end of format string
	    {
	    i = *pI + 1;
	    spec[0] = 0;
	    break;
	    }
	if (c == '|')
	    {
	    spec[cnt] = 0; // terminate spec
	    if (cnt == 0) // double || escapes itself
		i--;      // retain the last | char
	    break;
	    }
	else
	    {
	    spec[cnt++] = c;
	    }
	}
    }
if (sameString(spec,"js"))
    enc  = (enum htmlSafefEncoding) js;
else if (sameString(spec,"css"))
    enc = (enum htmlSafefEncoding) css;
else if (sameString(spec,"attr"))
    enc = (enum htmlSafefEncoding) attr;
else if (sameString(spec,"url"))
    enc = (enum htmlSafefEncoding) url;
else if (sameString(spec,""))
    enc = (enum htmlSafefEncoding) html;
else if (sameString(spec,"none"))
    enc = (enum htmlSafefEncoding) none;
else
    {
    htmlSafefAbort(noAbort, -2, "Unknown spec [%s] in format string [%s].", spec, format);
    return 0;
    }

*pI = i - 1;
return enc;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r8
movslq (%rsi), %rax
movb $0x0, 0x8(%rsp)
cmpb $0x7c, 0x1(%rdi,%rax)
jne 0x495ee
movq %rax, %rcx
incq %rcx
addl $0x2, %eax
xorl %edi, %edi
movslq %eax, %r9
movb (%r8,%r9), %r9b
testb %r9b, %r9b
sete %r10b
cmpl $0x7, %edi
setge %r11b
orb %r10b, %r11b
cmpb $0x1, %r11b
jne 0x495bc
movb $0x0, 0x8(%rsp)
xorl %r9d, %r9d
movl %ecx, %eax
jmp 0x495e7
leal 0x1(%rax), %r10d
movslq %edi, %r11
cmpb $0x7c, %r9b
jne 0x495da
movb $0x0, 0x8(%rsp,%r11)
testl %edi, %edi
cmovel %eax, %r10d
xorl %r9d, %r9d
jmp 0x495e4
incl %edi
movb %r9b, 0x8(%rsp,%r11)
movb $0x1, %r9b
movl %r10d, %eax
testb %r9b, %r9b
jne 0x49592
decl %eax
movzwl 0x8(%rsp), %ecx
xorl $0x736a, %ecx           # imm = 0x736A
movzbl 0xa(%rsp), %edi
orw %cx, %di
je 0x49663
cmpl $0x737363, 0x8(%rsp)    # imm = 0x737363
je 0x49667
movl $0x72747461, %ecx       # imm = 0x72747461
xorl 0x8(%rsp), %ecx
movzbl 0xc(%rsp), %edi
orl %ecx, %edi
je 0x4966b
cmpl $0x6c7275, 0x8(%rsp)    # imm = 0x6C7275
je 0x4966f
cmpb $0x0, 0x8(%rsp)
je 0x49673
movl $0x656e6f6e, %ecx       # imm = 0x656E6F6E
xorl 0x8(%rsp), %ecx
movzbl 0xc(%rsp), %edi
orl %ecx, %edi
je 0x49677
leaq 0x4e059(%rip), %rax     # 0x976a2
xorl %ebx, %ebx
leaq 0x8(%rsp), %rcx
movl %edx, %edi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rax, %rdx
xorl %eax, %eax
callq 0x491d6
jmp 0x4967b
movb $0x3, %bl
jmp 0x49679
movb $0x4, %bl
jmp 0x49679
movb $0x5, %bl
jmp 0x49679
movb $0x6, %bl
jmp 0x49679
movb $0x2, %bl
jmp 0x49679
movb $0x1, %bl
movl %eax, (%rsi)
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/htmshell.c
// Function: vaHtmlFprintf
void vaHtmlFprintf(FILE *f, char *format, va_list args)
/* fprintf using html encoding types */
{
struct dyString *ds = newDyString(1024);
vaHtmlDyStringPrintf(ds, format, args);
fputs(ds->string, f);  // does not append newline
freeDyString(&ds);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x400, %edi            # imm = 0x400
callq 0x261d0
movq %rsp, %r12
movq %rax, (%r12)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x47ac0
movq (%r12), %rax
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x6810
movq %r12, %rdi
callq 0x2620d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/https.c
// Function: openSslInit
void openSslInit()
/* do only once */
{
static boolean done = FALSE;
static pthread_mutex_t osiMutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock( &osiMutex );
if (!done)
    {
    SSL_library_init();
    ERR_load_crypto_strings();
    ERR_load_SSL_strings();
    OpenSSL_add_all_algorithms();
    openssl_pthread_setup();
    done = TRUE;
    }
pthread_mutex_unlock( &osiMutex );
}

// Assembly:
pushq %rax
leaq 0x8ab0f(%rip), %rdi     # 0xd4680
callq 0x6ae0
cmpb $0x0, 0x8aafb(%rip)     # 0xd4678
jne 0x49bc7
xorl %edi, %edi
xorl %esi, %esi
callq 0x6620
movl $0x2, %edi
xorl %esi, %esi
callq 0x6340
callq 0x63e0
movl $0xc, %edi
xorl %esi, %esi
callq 0x6340
movl $0x28, %edi
callq 0x2db04
movq %rax, 0x8aaba(%rip)     # 0xd4670
movq %rax, %rdi
xorl %esi, %esi
callq 0x6b10
movb $0x1, 0x8aab1(%rip)     # 0xd4678
leaq 0x8aab2(%rip), %rdi     # 0xd4680
popq %rax
jmp 0x64f0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/https.c
// Function: netConnectHttps
int netConnectHttps(char *hostName, int port, boolean noProxy)
/* Return socket for https connection with server or -1 if error. */
{

fflush(stdin);
fflush(stdout);
fflush(stderr);

struct netConnectHttpsParams *params;
AllocVar(params);
params->hostName = cloneString(hostName);
params->port = port;
params->noProxy = noProxy;

socketpair(AF_UNIX, SOCK_STREAM, 0, params->sv);

// netBlockBrokenPipes(); works, but is heavy handed 
//  and ignores SIGPIPE on all connections for all threads in the entire application. 
// We are trying something more subtle and library and thread-friendly instead.

int rc;
rc = pthread_create(&params->thread, NULL, netConnectHttpsThread, (void *)params);
if (rc)
    {
    errAbort("Unexpected error %d from pthread_create(): %s",rc,strerror(rc));
    }

/* parent */

return params->sv[0];

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x74a3a(%rip), %rax     # 0xbefd0
movq (%rax), %rdi
callq 0x6870
movq 0x74a0b(%rip), %rax     # 0xbefb0
movq (%rax), %rdi
callq 0x6870
movq 0x74a24(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
callq 0x6870
movl $0x20, %edi
callq 0x2dc95
movq %rax, %r15
movq %r14, %rdi
callq 0x1f9f6
movq %rax, 0x8(%r15)
movl %ebp, 0x10(%r15)
movl %ebx, 0x14(%r15)
leaq 0x18(%r15), %rbx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x65e0
leaq -0xa28(%rip), %rdx      # 0x49bd4
movq %r15, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x6dc0
testl %eax, %eax
je 0x4a629
movl %eax, %ebp
movl %eax, %edi
callq 0x6230
leaq 0x48457(%rip), %rdi     # 0x92a74
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x26b6f
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetIsDottedQuad
boolean internetIsDottedQuad(char *s)
/* Returns TRUE if it looks like s is a dotted quad. */
{
int i;
if (!isdigit(s[0]))
    return FALSE;
for (i=0; i<3; ++i)
    {
    s = strchr(s, '.');
    if (s == NULL)
        return FALSE;
    s += 1;
    if (!isdigit(s[0]))
        return FALSE;
    }
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x6790
movq (%rax), %r15
movsbq (%r14), %rax
xorl %ebx, %ebx
testb $0x8, 0x1(%r15,%rax,2)
je 0x4a68b
movl $0x3, %ebp
movq %r14, %rdi
movl $0x2e, %esi
callq 0x6270
testq %rax, %rax
je 0x4a68b
movq %rax, %r14
movsbq 0x1(%rax), %rax
testb $0x8, 0x1(%r15,%rax,2)
je 0x4a68b
incq %r14
decl %ebp
jne 0x4a65d
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetHostIp
bits32 internetHostIp(char *hostName)
/* Get IP v4 address (in host byte order) for hostName.
 * Warn and return 0 if there's a problem. */
{
bits32 ret;
if (internetIsDottedQuad(hostName))
    {
    internetDottedQuadToIp(hostName, &ret);
    }
else
    {
    /* getaddrinfo is thread-safe and widely supported */
    struct addrinfo hints, *res;
    struct in_addr addr;
    int err;

    zeroBytes(&hints, sizeof(hints));
    hints.ai_family = AF_INET;

    if ((err = getaddrinfo(hostName, NULL, &hints, &res)) != 0) 
	{
	warn("getaddrinfo() error on hostName=%s: %s\n", hostName, gai_strerror(err));
	return 0;
	}

    addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr;

    ret = ntohl((uint32_t)addr.s_addr);

    freeaddrinfo(res);

    }
return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x4a638
testl %eax, %eax
je 0x4a6bd
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x4a72d
movl 0x4(%rsp), %eax
jmp 0x4a726
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x2, 0x4(%rdx)
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6960
movl %eax, %ebp
testl %eax, %eax
je 0x4a709
movl %ebp, %edi
callq 0x6a30
leaq 0x4d3b8(%rip), %rdi     # 0x97ab2
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x268ca
jmp 0x4a720
movq 0x8(%rsp), %rdi
movq 0x18(%rdi), %rax
movl 0x4(%rax), %eax
bswapl %eax
movl %eax, 0x4(%rsp)
callq 0x69a0
xorl %eax, %eax
testl %ebp, %ebp
je 0x4a6b7
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetDottedQuadToIp
boolean internetDottedQuadToIp(char *dottedQuad, bits32 *retIp)
/* Convert dotted quad format address to IP4 address in
 * host byte order.  Warn and return FALSE if there's a 
 * problem. */
{
#ifndef __CYGWIN32__
struct in_addr ia;
if (inet_pton(AF_INET, dottedQuad, &ia) < 0)
    {
    warn("internetDottedQuadToIp problem on %s: %s", dottedQuad, strerror(errno));
    return FALSE;
    }
*retIp = ntohl(ia.s_addr);
return TRUE;
#else
warn("Sorry, internetDottedQuadToIp not supported in Windows.");
return FALSE;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc(%rsp), %rdx
movl $0x2, %edi
movq %rbx, %rsi
callq 0x6e30
testl %eax, %eax
js 0x4a761
movl 0xc(%rsp), %eax
bswapl %eax
movl %eax, (%r14)
movl $0x1, %ebp
jmp 0x4a783
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x4d39f(%rip), %rdi     # 0x97b13
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x268ca
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetFillInAddress
boolean internetFillInAddress(char *hostName, int port, struct sockaddr_in *address)
/* Fill in address. Return FALSE if can't.  */
{
ZeroVar(address);
address->sin_family = AF_INET;
address->sin_port = htons(port);
if (hostName == NULL)
    address->sin_addr.s_addr = INADDR_ANY;
else
    {
    if ((address->sin_addr.s_addr = htonl(internetHostIp(hostName))) == 0)
	return FALSE;
    }
return TRUE;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movw $0x2, (%rdx)
rolw $0x8, %si
movw %si, 0x2(%rdx)
testq %rdi, %rdi
je 0x4a7bc
callq 0x4a698
testl %eax, %eax
bswapl %eax
movl %eax, 0x4(%rbx)
jne 0x4a7c3
xorl %eax, %eax
jmp 0x4a7c8
movl $0x0, 0x4(%rbx)
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetIpToDottedQuad
boolean internetIpToDottedQuad(bits32 ip, char dottedQuad[17])
/* Convert IP4 address in host byte order to dotted quad 
 * notation.  Warn and return FALSE if there's a 
 * problem. */
{
#ifndef __CYGWIN32__
struct in_addr ia;
zeroBytes(dottedQuad, 17);
ZeroVar(&ia);
ia.s_addr = htonl(ip);
if (inet_ntop(AF_INET, &ia, dottedQuad, 16) == NULL)
    {
    warn("conversion problem on 0x%x in internetIpToDottedQuad: %s", 
    	ip, strerror(errno));
    return FALSE;
    }
return TRUE;
#else
warn("Sorry, internetIpToDottedQuad not supported in Windows.");
return FALSE;
#endif
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdx
movl %edi, %ebx
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movb $0x0, 0x10(%rsi)
movl %edi, %eax
bswapl %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl $0x2, %edi
movl $0x10, %ecx
callq 0x6720
movl $0x1, %ebp
testq %rax, %rax
jne 0x4a821
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x4d2c7(%rip), %rdi     # 0x97ada
xorl %ebp, %ebp
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x268ca
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetParseDottedQuad
void internetParseDottedQuad(char *dottedQuad, unsigned char quad[4])
/* Parse dotted quads into quad */
{
char *s = dottedQuad;
int i;
if (!internetIsDottedQuad(s))
    errAbort("%s is not a dotted quad", s);
for (i=0; i<4; ++i)
    {
    quad[i] = atoi(s);
    s = strchr(s, '.') + 1;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4a638
testl %eax, %eax
jne 0x4a84f
leaq 0x4d2f7(%rip), %rdi     # 0x97b3c
movq %r14, %rsi
xorl %eax, %eax
callq 0x26b6f
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x6bd0
movb %al, (%rbx,%r15)
movq %r14, %rdi
movl $0x2e, %esi
callq 0x6270
movq %rax, %r14
incq %r14
incq %r15
cmpq $0x4, %r15
jne 0x4a852
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/internet.c
// Function: internetIpInSubnet
boolean internetIpInSubnet(unsigned char unpackedIp[4], unsigned char subnet[4])
/* Return true if unpacked IP address is in subnet. */
{
int i;
for (i=0; i<4; ++i)
    {
    unsigned char c = subnet[i];
    if (c == 255)
        return TRUE;
    if (c != unpackedIp[i])
        return FALSE;
    }
return TRUE;
}

// Assembly:
xorl %ecx, %ecx
xorl %edx, %edx
movb (%rsi,%rdx), %r8b
cmpb $-0x1, %r8b
je 0x4a8ae
cmpb (%rdi,%rdx), %r8b
sete %r8b
cmovnel %ecx, %eax
jmp 0x4a8b6
movl $0x1, %eax
xorl %r8d, %r8d
testb %r8b, %r8b
je 0x4a8c9
incq %rdx
cmpq $0x4, %rdx
jne 0x4a897
movl $0x1, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/portimpl.c
// Function: pathsInDirAndSubdirs
struct slName *pathsInDirAndSubdirs(char *dir, char *wildcard)
/* Return list of all non-directory files in dir and it's
 * subdirs.  Returns path to files including dir and subdir. */
{
struct slName *list = NULL;
rPathsInDirAndSubdirs(dir, wildcard, &list);
slReverse(&list);
return list;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
movq %rbx, %rdx
callq 0x4be3a
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/portimpl.c
// Function: rPathsInDirAndSubdirs
static void rPathsInDirAndSubdirs(char *dir, char *wildcard, struct slName **pList)
/* Recursively add directory contents that match wildcard (* for all) to list */
{
struct fileInfo *fi, *fiList = listDirX(dir, wildcard, TRUE);
for (fi = fiList; fi != NULL; fi = fi->next)
   {
   if (fi->isDir)
       rPathsInDirAndSubdirs(fi->name, wildcard, pList);
   else
       slNameAddHead(pList, fi->name);
   }
slFreeList(&fiList);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl $0x1, %edx
callq 0x34969
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x4be8b
movq %rax, %r15
leaq 0x20(%r15), %rsi
cmpb $0x0, 0x10(%r15)
je 0x4be7b
movq %rsi, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4be3a
jmp 0x4be83
movq %rbx, %rdi
callq 0x20698
movq (%r15), %r15
testq %r15, %r15
jne 0x4be60
leaq 0x8(%rsp), %rdi
callq 0x1fcd6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/portimpl.c
// Function: setupWss
static void setupWss()
{
if (wss == NULL)
    {
    char *s = getenv("SERVER_SOFTWARE");
    wss = &wssDefault;
    if (s == NULL)
        {
	wss = &wssCommandLine;
        }
    else
        {
        if (strncmp(wssMicrosoftII.name, s, strlen(wssMicrosoftII.name)) == 0)
            wss = &wssMicrosoftII;
        else if (strncmp(wssMicrosoftPWS.name, s, strlen(wssMicrosoftPWS.name)) == 0)
            wss = &wssMicrosoftPWS;
	else 
	    {
	    char *t = getenv("HTTP_HOST");
	    if (t != NULL)
		{
		if (sameWord(t, "Crunx"))
		    wss = &wssLinux;
		else if (endsWith(t, "brc.mcw.edu"))
		    wss = &wssBrcMcw;
		}
	    }
        }
    }
}

// Assembly:
cmpq $0x0, 0x88811(%rip)     # 0xd46b8
je 0x4beaa
retq
pushq %r15
pushq %r14
pushq %rbx
leaq 0x4c188(%rip), %rdi     # 0x9803e
callq 0x68f0
movq %rax, %rbx
leaq 0x74e3b(%rip), %rax     # 0xc0d00
movq %rax, 0x887ec(%rip)     # 0xd46b8
testq %rbx, %rbx
je 0x4bf60
leaq 0x74e9c(%rip), %r15     # 0xc0d78
movq (%r15), %r14
movq %r14, %rdi
callq 0x62d0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6330
testl %eax, %eax
je 0x4bf67
leaq 0x74ea0(%rip), %r15     # 0xc0da0
movq (%r15), %r14
movq %r14, %rdi
callq 0x62d0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6330
testl %eax, %eax
je 0x4bf67
leaq 0x474d1(%rip), %rdi     # 0x933f5
callq 0x68f0
testq %rax, %rax
je 0x4bf6e
movq %rax, %rbx
leaq 0x4c116(%rip), %rsi     # 0x9804e
movq %rax, %rdi
callq 0x2054a
testl %eax, %eax
je 0x4bf74
leaq 0x4c109(%rip), %rsi     # 0x98054
movq %rbx, %rdi
callq 0x21aed
testl %eax, %eax
je 0x4bf6e
leaq 0x74d7a(%rip), %r15     # 0xc0cd8
jmp 0x4bf67
leaq 0x74de9(%rip), %r15     # 0xc0d50
movq %r15, 0x8874a(%rip)     # 0xd46b8
popq %rbx
popq %r14
popq %r15
retq
leaq 0x74dad(%rip), %r15     # 0xc0d28
jmp 0x4bf67
nopl (%rax)