LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x41ba3
movq %rdi, %r14
callq 0x62d0
movq %rax, %rdi
callq 0x28bb0
movq %rax, %r12
leaq 0x43efb(%rip), %r15     # 0x859e5
leaq 0x43f0d(%rip), %r13     # 0x859fe
leaq 0x43ef5(%rip), %rbp     # 0x859ed
movq %rax, %rbx
cmpb $0x0, (%r14)
je 0x41ba6
movq %r15, %rdi
movq %r14, %rsi
callq 0x1db5c
testl %eax, %eax
je 0x41b41
addq $0x9, %r14
cmpb $0x0, -0x8(%r14)
je 0x41ba6
leaq -0x8(%r14), %rsi
movq %rbp, %rdi
callq 0x1db5c
incq %r14
testl %eax, %eax
je 0x41b18
movb $0x20, %al
cmpb $0x0, -0x9(%r14)
jne 0x41b99
jmp 0x41ba6
leaq 0x43eaf(%rip), %rdi     # 0x859f7
movq %r14, %rsi
callq 0x1db5c
testl %eax, %eax
je 0x41b7d
addq $0x8, %r14
cmpb $0x0, -0x7(%r14)
je 0x41ba6
leaq -0x7(%r14), %rsi
movq %r13, %rdi
callq 0x1db5c
incq %r14
testl %eax, %eax
je 0x41b58
movb $0x20, %al
cmpb $0x0, -0x8(%r14)
jne 0x41b99
jmp 0x41ba6
movb (%r14), %al
incq %r14
cmpb $0x3c, %al
jne 0x41b99
movzbl (%r14), %eax
testl %eax, %eax
je 0x41ba6
incq %r14
cmpl $0x3e, %eax
jne 0x41b87
movb $0x20, %al
movb %al, (%rbx)
incq %rbx
jmp 0x41afb
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_O2/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 0x41c11
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x62d0
leaq 0x1(%rax), %rdi
callq 0x28bb0
movq %rax, %rcx
movzbl (%r14), %edx
cmpl $0x3c, %edx
je 0x41beb
testl %edx, %edx
je 0x41c06
movb %dl, (%rcx)
incq %rcx
jmp 0x41c01
movb %bl, (%rcx)
incq %rcx
movzbl 0x1(%r14), %edx
testl %edx, %edx
je 0x41c06
incq %r14
cmpl $0x3e, %edx
jne 0x41bf0
incq %r14
jmp 0x41bd7
movb $0x0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x1e3ef
leal (%r14,%rax,4), %ebp
leal (%r14,%rax,4), %eax
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1d6d3
leaq 0x3c533(%rip), %rdx     # 0x7e191
leaq 0x4107a(%rip), %rcx     # 0x82cdf
movq %r15, %rdi
movl %ebp, %esi
callq 0x1e16e
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %eax, %eax
leaq 0x43d41(%rip), %rdi     # 0x859d8
leaq 0x43d30(%rip), %r9      # 0x859ce
pushq $0x4
popq %r10
leaq 0x43d2a(%rip), %r11     # 0x859d3
leaq 0x43d57(%rip), %rbx     # 0x85a07
pushq $0x6
popq %rbp
leaq 0x43d24(%rip), %r12     # 0x859de
movl %edx, 0x4(%rsp)
movb (%r14), %r13b
xorl %ecx, %ecx
cmpb $0x26, %r13b
sete %cl
leal 0x1(,%rcx,4), %r8d
movl $0x0, %esi
cmoveq %rdi, %rsi
cmpb $0x3e, %r13b
cmoveq %r9, %rsi
cmovel %r10d, %r8d
cmpb $0x3c, %r13b
cmovel %r10d, %r8d
cmoveq %r11, %rsi
cmpb $0x2f, %r13b
cmoveq %rbx, %rsi
cmovel %ebp, %r8d
cmpb $0x22, %r13b
cmovel %ebp, %r8d
cmoveq %r12, %rsi
cmpb $0x27, %r13b
pushq $0x5
popq %rcx
cmovel %ecx, %r8d
leaq 0x43cf1(%rip), %rcx     # 0x85a0e
cmoveq %rcx, %rsi
addl %r8d, %eax
movl $0x0, %ecx
testq %r15, %r15
je 0x41d8b
testl %edx, %edx
jle 0x41d36
cmpl %edx, %eax
jge 0x41d9e
cmpl $0x1, %r8d
jne 0x41d44
movb %r13b, (%r15)
incq %r15
jmp 0x41d88
movl %r8d, %r12d
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rbx
movq %r9, %rbp
callq 0x6380
leaq 0x43c74(%rip), %r11     # 0x859d3
pushq $0x4
popq %r10
movq %rbp, %r9
pushq $0x6
popq %rbp
movq %rbx, %rax
leaq 0x43c94(%rip), %rbx     # 0x85a07
leaq 0x43c5e(%rip), %rdi     # 0x859d8
movl 0x4(%rsp), %edx
addq %r12, %r15
leaq 0x43c56(%rip), %r12     # 0x859de
movq %r15, %rcx
incq %r14
movq %rcx, %r15
testb %r13b, %r13b
jne 0x41cbe
decl %eax
jmp 0x41da5
movb $0x0, (%r15)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x41db4
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x41c7d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/htmshell.c
// Function: nonAlphaNumericHexEncodeText
int nonAlphaNumericHexEncodeText(char *s, char *out, int outSize, 
   char *prefix, char *postfix)
/* For html tag attributes, it replaces non-alphanumeric characters
 * with <prefix>HH<postfix> hex codes 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 encodedSize = strlen(prefix) + 2 + strlen(postfix);
int total = 0;
char c = 0;
do
    {
    c=*s++;
    int size = 1;
    if (!isalnum(c)) // alpha-numeric
	{
	size = encodedSize;
	}
    if (c == 0)
	size = 1;    // do not encode the terminating 0
    if (out)
	{
	if (outSize > 0 && (total+size+1) > outSize) // 1 for terminator
	    {
	    *out = 0;
	    return -1;
	    }
	if (size == 1)
	    *out++ = c;
	else
	    {
	    char x;
	    char *pf = prefix;
	    while ((x = *pf++) != 0)
		*out++ = x;
	    // use (unsigned char) to shift without sign-extension. We want zeros to be added on left side.
	    char h1 = ((unsigned char) c >> 4 ) + 0x30; if (h1 > 0x39) h1 += 7; 
	    *out++ = h1;
	    char h2 = (c & 0xF) + 0x30; if (h2 > 0x39) h2 += 7;
	    *out++ = h2;
	    pf = postfix;
	    while ((x = *pf++) != 0)
		*out++ = x;
	    }
	}
    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 %r8, %rbx
movq %rcx, (%rsp)
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movq %rcx, %rdi
callq 0x62d0
movq %rax, %r13
movq %rbx, %rdi
callq 0x62d0
leal (%rax,%r13), %r14d
addl $0x2, %r14d
xorl %r13d, %r13d
callq 0x6790
movq (%rsp), %r8
pushq $0x1
popq %rcx
movsbq (%r12), %rdx
movq (%rax), %rsi
testb $0x8, (%rsi,%rdx,2)
movl %ecx, %esi
cmovel %r14d, %esi
testq %rdx, %rdx
cmovel %ecx, %esi
addl %esi, %r13d
testq %r15, %r15
je 0x41e6f
testl %ebp, %ebp
jle 0x41e62
cmpl %ebp, %r13d
jge 0x41ef6
cmpl $0x1, %esi
jne 0x41e74
movb %dl, (%r15)
incq %r15
jmp 0x41ee6
xorl %r15d, %r15d
jmp 0x41ee6
addq $0x2, %r15
movq %r8, %rsi
movb (%rsi), %dil
testb %dil, %dil
je 0x41e8f
incq %rsi
movb %dil, -0x2(%r15)
incq %r15
jmp 0x41e7b
movl %edx, %esi
shrb $0x4, %sil
leal 0x30(%rsi), %edi
addb $0x37, %sil
cmpb $0x3a, %dil
movzbl %sil, %esi
movzbl %dil, %edi
cmovael %esi, %edi
movb %dil, -0x2(%r15)
movl %edx, %esi
andb $0xf, %sil
leal 0x30(%rsi), %edi
addb $0x37, %sil
cmpb $0x3a, %dil
movzbl %sil, %esi
movzbl %dil, %edi
cmovael %esi, %edi
movb %dil, -0x1(%r15)
xorl %esi, %esi
movb (%rbx,%rsi), %dil
testb %dil, %dil
je 0x41ee3
movb %dil, (%r15,%rsi)
incq %rsi
jmp 0x41ed1
addq %rsi, %r15
incq %r12
testb %dl, %dl
jne 0x41e35
decl %r13d
jmp 0x41efe
movb $0x0, (%r15)
pushq $-0x1
popq %r13
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x62d0
movq %rax, %r12
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x62d0
movslq %r12d, %rbx
addl %ebx, %eax
addl $0x2, %eax
cltq
movq %rax, 0x8(%rsp)
leaq 0x7(%rsp), %r12
movq %r14, %r13
testq %r13, %r13
je 0x41fce
cmpb $0x0, (%r13)
je 0x41fce
movq %r15, %rdi
movq %r13, %rsi
callq 0x1db5c
testl %eax, %eax
je 0x41fbf
movb $0x0, 0x7(%rsp)
movsbl (%r13,%rbx), %edi
movq %r12, %rsi
callq 0x436c8
testl %eax, %eax
je 0x41fbf
leaq (%rbx,%r13), %rbp
movsbl 0x1(%rbp), %edi
movq %r12, %rsi
callq 0x436c8
testl %eax, %eax
je 0x41fbf
addq $0x2, %rbp
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x1db5c
testl %eax, %eax
je 0x41fbf
movb 0x7(%rsp), %al
movb %al, (%r14)
addq 0x8(%rsp), %r13
jmp 0x41fc9
movb (%r13), %al
incq %r13
movb %al, (%r14)
incq %r14
jmp 0x41f56
movb $0x0, (%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0x41ff4
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x41fe1
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0x42057
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x42044
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0x420ba
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x420a7
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0x4211d
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x28bb0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x4210a
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x43ac9(%rip), %rdi     # 0x85e52
callq 0x6bb0
leaq 0x43aca(%rip), %rdi     # 0x85e5f
callq 0x6bb0
leaq 0x43abc(%rip), %rdi     # 0x85e5d
callq 0x6bb0
testq %r14, %r14
je 0x423cb
movq 0x70bfe(%rip), %r15     # 0xb2fb0
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x69e0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x6930
pushq $-0x1
popq %rdi
callq 0x68d0
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/htmshell.c
// Function: earlyWarningHandler
static void earlyWarningHandler(char *format, va_list args)
/* Write an error message so user can see it before page is really started. */
{
static boolean initted = FALSE;
if (!initted && !errorsNoHeader)
    {
    htmlStart("Very Early Error");
    initted = TRUE;
    }
printf("%s", htmlWarnStartPattern());
fputs("<P>", stdout);
htmlVaEncodeErrorText(format,args);
fputs("</P>\n", stdout);
printf("%s", htmlWarnEndPattern());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x8626b(%rip)     # 0xc8688
jne 0x4243b
testb $0x1, 0x8615e(%rip)     # 0xc8584
jne 0x4243b
leaq 0x442ef(%rip), %rdi     # 0x8671e
callq 0x42ba0
movb $0x1, 0x8624d(%rip)     # 0xc8688
leaq 0x44377(%rip), %rdi     # 0x867b9
callq 0x6bb0
movq 0x70b62(%rip), %r15     # 0xb2fb0
movq (%r15), %rsi
leaq 0x4353e(%rip), %rdi     # 0x85996
callq 0x6810
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41660
movq (%r15), %rsi
leaq 0x43528(%rip), %rdi     # 0x8599a
callq 0x6810
leaq 0x44352(%rip), %rdi     # 0x867d0
popq %rbx
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O2/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 0x3eba3
movq %rax, %rbp
movq %rbx, %rdi
callq 0x3eba3
movq %rax, %rbx
testq %r15, %r15
je 0x42502
movq %r15, %rdi
callq 0x3eba3
movq %rax, %r13
jmp 0x42505
xorl %r13d, %r13d
leaq 0x439cf(%rip), %rdi     # 0x85edb
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x4252f
leaq 0x439ca(%rip), %rdi     # 0x85eef
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x42545
leaq 0x439c1(%rip), %rdi     # 0x85efc
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %r14, %r14
je 0x4255b
leaq 0x439b5(%rip), %rdi     # 0x85f06
movq %r14, %rsi
xorl %eax, %eax
callq 0x6070
cmpl $0x1, 0x4(%rsp)
jne 0x42570
leaq 0x439a9(%rip), %rdi     # 0x85f12
xorl %eax, %eax
callq 0x6070
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O2/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 0x4397f(%rip), %rdi     # 0x85f19
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x6e70
leaq 0x8(%rsp), %rdi
andq $0x0, (%rdi)
leaq 0x448a9(%rip), %rsi     # 0x86e61
callq 0x1ce5e
xorl %eax, %eax
callq 0x3deab
testq %rax, %rax
je 0x425f7
cmpb $0x0, (%rax)
je 0x425f7
leaq 0x10(%rsp), %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x23b2e
movq %r14, %rdi
callq 0x1c306
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x1ce5e
movq 0x86062(%rip), %rsi     # 0xc8660
testq %rsi, %rsi
je 0x4260d
leaq 0x8(%rsp), %rdi
callq 0x1ce5e
movq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x1d061
leaq 0x438fe(%rip), %rsi     # 0x85f1f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6a90
movq 0x8603b(%rip), %rdx     # 0xc8670
testq %rdx, %rdx
je 0x4264b
leaq 0x438ea(%rip), %rsi     # 0x85f2b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
cmpl $0x0, 0x86026(%rip)     # 0xc8678
je 0x4266b
movl 0x72696(%rip), %edx     # 0xb4cf0
leaq 0x438db(%rip), %rsi     # 0x85f3c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6a90
leaq 0x43d20(%rip), %rdi     # 0x86392
movq %rbx, %rsi
callq 0x6810
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
leal 0x7(%rdi), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %eax, %ebx
addl $0x2, %ebx
pushq $0x3
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
subl %edx, %ebx
leaq 0x4389f(%rip), %rdi     # 0x85f4b
leaq 0x42756(%rip), %rsi     # 0x84e09
callq 0x1ec79
movq %rax, %r14
movq %rsp, %r15
movq %rax, (%r15)
movslq %ebx, %r12
movq %r12, %rdi
callq 0x28bb0
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x1ed97
movq %r15, %rdi
callq 0x1f2ea
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ca30
movq %rax, %r14
movq %rax, %rdi
callq 0x62d0
movq %rax, %r15
pushq $0x2b
popq %rdx
pushq $0x41
popq %rcx
movq %r14, %rdi
movl %r15d, %esi
callq 0x1e2a1
pushq $0x2f
popq %rdx
pushq $0x61
popq %rcx
movq %r14, %rdi
movl %r15d, %esi
callq 0x1e2a1
movq %rbx, %rdi
callq 0x28c2d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
callq 0x42795
movq %rax, %rbx
movq %rax, %rdi
callq 0x42924
movq %rax, %r14
movq %rbx, %rdi
callq 0x28c2d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 -0x8a4(%rip), %rdi      # 0x423d3
callq 0x225bd
leaq -0xa5b(%rip), %rdi      # 0x42228
callq 0x223b0
leaq 0x85901(%rip), %rdi     # 0xc8590
callq 0x6ab0
testl %eax, %eax
jne 0x42c9c
xorl %eax, %eax
callq *%rbx
xorl %eax, %eax
movl %eax, %ebx
callq 0x2247b
movl %ebx, %eax
callq 0x2260b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x21578
movq %r14, %rdi
callq 0x42ba0
movq %rbx, %rdi
callq 0x42c6c
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42c29
// File: /workspace/github_c_makefile_star2_O2/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 0x21578
leaq 0x43715(%rip), %rdi     # 0x8640c
callq 0x6bb0
leaq 0x3b48e(%rip), %rdi     # 0x7e191
callq 0x6bb0
leaq 0x4377c(%rip), %rdi     # 0x8648b
callq 0x6bb0
leaq 0x43777(%rip), %rdi     # 0x86492
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6070
movq 0x70281(%rip), %r14     # 0xb2fb0
movq (%r14), %rdi
callq 0x42586
movq (%r14), %rdi
callq 0x4217d
movq %rbx, %rdi
callq 0x42c6c
popq %rbx
popq %r14
popq %r15
jmp 0x42c29
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
testq %rdi, %rdi
jne 0x42d7a
leaq 0x43743(%rip), %rdi     # 0x864b6
xorl %eax, %eax
callq 0x223fb
movq %rbx, %rdi
callq 0x1f807
testl %eax, %eax
jne 0x42d97
leaq 0x4374c(%rip), %rdi     # 0x864d9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x223fb
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2d134
cmpq $0x0, (%r14)
jne 0x42dc3
leaq 0x43730(%rip), %rdi     # 0x864e9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x223fb
movq 0x8(%rsp), %rdi
callq 0x6bb0
movq 0x8(%rsp), %rdi
callq 0x28c2d
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x42e73
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 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rsp)
testl %edi, %edi
jne 0x42eaf
movq %rsp, %rsi
movq %rdx, %rdi
callq 0x224d7
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq 0x70122(%rip), %r14     # 0xb2fd8
movq (%r14), %rdi
movq %rsp, %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0x69e0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x6930
movq (%r14), %rdi
callq 0x6870
jmp 0x42ea2
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rsi), %r12
movb $0x0, 0x8(%rsp)
cmpb $0x7c, 0x1(%rdi,%r12)
jne 0x4315b
leal 0x2(%r12), %eax
movslq %eax, %rdx
addq %r14, %rdx
xorl %ecx, %ecx
movb (%rdx,%rcx), %sil
testb %sil, %sil
je 0x4313d
cmpq $0x7, %rcx
jae 0x4313d
cmpb $0x7c, %sil
je 0x43144
movb %sil, 0x8(%rsp,%rcx)
incq %rcx
jmp 0x4311e
movb $0x0, 0x8(%rsp)
jmp 0x4315b
movb $0x0, 0x8(%rsp,%rcx)
leal (%rax,%rcx), %edx
testq %rcx, %rcx
leal 0x1(%rax,%rcx), %r12d
cmovel %edx, %r12d
decl %r12d
leaq 0x42e98(%rip), %rsi     # 0x85ffa
leaq 0x8(%rsp), %rdi
pushq $0x3
popq %rdx
callq 0x6710
testl %eax, %eax
je 0x431de
cmpl $0x737363, 0x8(%rsp)    # imm = 0x737363
je 0x431e3
leaq 0x3f3aa(%rip), %rsi     # 0x8252e
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x6710
testl %eax, %eax
je 0x431e8
cmpl $0x6c7275, 0x8(%rsp)    # imm = 0x6C7275
je 0x431ed
cmpb $0x0, 0x8(%rsp)
je 0x431f2
leaq 0x434d0(%rip), %rsi     # 0x8667d
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x6710
testl %eax, %eax
je 0x431f7
leaq 0x434bd(%rip), %rdx     # 0x86682
xorl %r15d, %r15d
pushq $-0x2
popq %rsi
leaq 0x8(%rsp), %rcx
movl %ebp, %edi
movq %r14, %r8
xorl %eax, %eax
callq 0x42e1b
jmp 0x431fd
movb $0x3, %r15b
jmp 0x431fa
movb $0x4, %r15b
jmp 0x431fa
movb $0x5, %r15b
jmp 0x431fa
movb $0x6, %r15b
jmp 0x431fa
movb $0x2, %r15b
jmp 0x431fa
movb $0x1, %r15b
movl %r12d, (%rbx)
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x400, %edi            # imm = 0x400
callq 0x21bcc
movq %rax, %r12
leaq 0x8(%rsp), %r13
movq %rax, (%r13)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x41743
movq 0x8(%r12), %rdi
movq %r15, %rsi
callq 0x6810
movq %r13, %rdi
callq 0x21c07
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/htmshell.c
// Function: decodeOneHexChar
static boolean decodeOneHexChar(char c, char *h)
/* Return true if c is a hex char and decode it to h. */
{
*h = *h << 4;
if (c >= '0' && c <= '9')
    *h += (c - '0');	    
else if (c >= 'A' && c <= 'F')
    *h += (c - 'A' + 10);	    
else if (c >= 'a' && c <= 'f')
    *h += (c - 'a' + 10);
else
    return FALSE;
return TRUE;
}

// Assembly:
movb (%rsi), %cl
shlb $0x4, %cl
movb %cl, (%rsi)
leal -0x30(%rdi), %eax
cmpb $0x9, %al
ja 0x436da
orb %al, %cl
jmp 0x436f9
leal -0x41(%rdi), %eax
cmpb $0x5, %al
ja 0x436e9
addb %dil, %cl
addb $-0x37, %cl
jmp 0x436f9
leal -0x61(%rdi), %edx
xorl %eax, %eax
cmpb $0x5, %dl
ja 0x436fe
addb %dil, %cl
addb $-0x57, %cl
movb %cl, (%rsi)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x84f65(%rip), %rdi     # 0xc86a0
callq 0x6ae0
cmpb $0x0, 0x84f51(%rip)     # 0xc8698
jne 0x43777
xorl %edi, %edi
xorl %esi, %esi
callq 0x6620
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x6340
callq 0x63e0
pushq $0xc
popq %rdi
xorl %esi, %esi
callq 0x6340
callq 0x43718
movb $0x1, 0x84f21(%rip)     # 0xc8698
leaq 0x84f22(%rip), %rdi     # 0xc86a0
popq %rax
jmp 0x64f0
// File: /workspace/github_c_makefile_star2_O2/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 0x6ef6f(%rip), %rax     # 0xb2fd0
movq (%rax), %rdi
callq 0x6870
movq 0x6ef40(%rip), %rax     # 0xb2fb0
movq (%rax), %rdi
callq 0x6870
movq 0x6ef59(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
callq 0x6870
pushq $0x20
popq %rdi
callq 0x28bb0
movq %rax, %r15
movq %r14, %rdi
callq 0x1c306
movq %rax, 0x8(%r15)
movl %ebp, 0x10(%r15)
movl %ebx, 0x14(%r15)
leaq 0x18(%r15), %rbx
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x65e0
leaq -0x93c(%rip), %rdx      # 0x43784
movq %r15, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x6dc0
testl %eax, %eax
je 0x440ed
movl %eax, %ebp
movl %eax, %edi
callq 0x6230
leaq 0x3d983(%rip), %rdi     # 0x81a64
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x223fb
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
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 0x44157
pushq $0x4
popq %r13
pushq $0x1
popq %r12
pushq $0x2e
popq %rbp
decl %r13d
je 0x44154
movq %r14, %rdi
movl %ebp, %esi
callq 0x6270
testq %rax, %rax
je 0x44157
movq %rax, %r14
incq %r14
movsbq 0x1(%rax), %rax
testb $0x8, 0x1(%r15,%rax,2)
jne 0x4412b
jmp 0x44157
movl %r12d, %ebx
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_O2/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x440fc
testl %eax, %eax
je 0x44190
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x441fd
movl (%r14), %r14d
jmp 0x441f2
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x2, 0x4(%rdx)
xorl %r14d, %r14d
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6960
testl %eax, %eax
je 0x441dd
movl %eax, %edi
callq 0x6a30
leaq 0x428c4(%rip), %rdi     # 0x86a92
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x22186
jmp 0x441f2
movq 0x8(%rsp), %rdi
movq 0x18(%rdi), %rax
movl 0x4(%rax), %r14d
bswapl %r14d
callq 0x69a0
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2
popq %rdi
leaq 0xc(%rsp), %rdx
movq %rbx, %rsi
callq 0x6e30
testl %eax, %eax
js 0x4422d
movl 0xc(%rsp), %eax
bswapl %eax
movl %eax, (%r14)
pushq $0x1
popq %rbp
jmp 0x4424f
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x428b3(%rip), %rdi     # 0x86af3
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x22186
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x2
popq %rdi
pushq $0x10
popq %rcx
callq 0x6720
testq %rax, %rax
je 0x442c1
pushq $0x1
popq %rbp
jmp 0x442e2
callq 0x6060
movl (%rax), %edi
callq 0x6230
leaq 0x427e6(%rip), %rdi     # 0x86aba
xorl %ebp, %ebp
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x22186
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x440fc
testl %eax, %eax
jne 0x44312
leaq 0x42814(%rip), %rdi     # 0x86b1c
movq %r14, %rsi
xorl %eax, %eax
callq 0x223fb
xorl %r15d, %r15d
pushq $0x2e
popq %rbp
cmpq $0x4, %r15
je 0x4433f
movq %r14, %rdi
callq 0x6bd0
movb %al, (%rbx,%r15)
movq %r14, %rdi
movl %ebp, %esi
callq 0x6270
movq %rax, %r14
incq %r14
incq %r15
jmp 0x44318
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/internet.c
// Function: internetUnpackIp
void internetUnpackIp(bits32 packed, unsigned char unpacked[4])
/* Convert from 32 bit to 4-byte format with most significant
 * byte first. */
{
int i;
for (i=3; i>=0; --i)
    {
    unpacked[i] = (packed&0xff);
    packed >>= 8;
    }
}

// Assembly:
pushq $0x3
popq %rax
testl %eax, %eax
js 0x4435e
movl %eax, %ecx
movb %dil, (%rsi,%rcx)
shrl $0x8, %edi
decl %eax
jmp 0x4434d
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rax
cmpq $0x4, %rcx
je 0x44380
movb (%rsi,%rcx), %dl
cmpb $-0x1, %dl
je 0x44380
leaq 0x1(%rcx), %r8
cmpb (%rdi,%rcx), %dl
movq %r8, %rcx
je 0x44364
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%rbx)
movq %rbx, %rdx
callq 0x45858
movq %rbx, %rdi
callq 0x1c567
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdx
callq 0x2f288
movq %rax, %r15
movq %rax, 0x8(%rsp)
testq %r15, %r15
je 0x458a4
leaq 0x20(%r15), %rsi
cmpb $0x0, 0x10(%r15)
je 0x45897
movq %rsi, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x45858
jmp 0x4589f
movq %rbx, %rdi
callq 0x1ce5e
movq (%r15), %r15
jmp 0x45877
leaq 0x8(%rsp), %rdi
callq 0x1c583
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x82e18(%rip)     # 0xc86d8
je 0x458c3
retq
pushq %r15
pushq %r14
pushq %rbx
leaq 0x4172b(%rip), %rdi     # 0x86ffa
callq 0x68f0
movq %rax, %rbx
leaq 0x6f442(%rip), %rax     # 0xb4d20
movq %rax, 0x82df3(%rip)     # 0xc86d8
testq %rbx, %rbx
je 0x45979
leaq 0x6f4a3(%rip), %r15     # 0xb4d98
movq (%r15), %r14
movq %r14, %rdi
callq 0x62d0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6330
testl %eax, %eax
je 0x45980
leaq 0x6f4a7(%rip), %r15     # 0xb4dc0
movq (%r15), %r14
movq %r14, %rdi
callq 0x62d0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6330
testl %eax, %eax
je 0x45980
leaq 0x3ca85(%rip), %rdi     # 0x823c2
callq 0x68f0
testq %rax, %rax
je 0x45987
movq %rax, %rbx
leaq 0x416b9(%rip), %rsi     # 0x8700a
movq %rax, %rdi
callq 0x1cd23
testl %eax, %eax
je 0x4598d
leaq 0x416ac(%rip), %rsi     # 0x87010
movq %rbx, %rdi
callq 0x1de0f
testl %eax, %eax
je 0x45987
leaq 0x6f381(%rip), %r15     # 0xb4cf8
jmp 0x45980
leaq 0x6f3f0(%rip), %r15     # 0xb4d70
movq %r15, 0x82d51(%rip)     # 0xc86d8
popq %rbx
popq %r14
popq %r15
retq
leaq 0x6f3b4(%rip), %r15     # 0xb4d48
jmp 0x45980
nop
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/servCrunx.c
// Function: makeTempName
static void _makeTempName(struct tempName *tn, char *base, char *suffix)
/* Figure out a temp name, and how CGI and HTML will access it. */
{
char *tname;
char *tempDirCgi = __trashDir;
char *tempDirHtml = "/trash";
int tlcLen = strlen(tempDirCgi);
int tlhLen = strlen(tempDirHtml);

tname = rTempName(tempDirCgi, base, suffix);
strcpy(tn->forCgi, tname);
memcpy(tn->forHtml, tempDirHtml, tlhLen);
strcpy(tn->forHtml+tlhLen, tn->forCgi+tlcLen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x415f4(%rip), %rdi     # 0x8703f
callq 0x2f4f8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6680
movl $0x6172742f, 0x1000(%rbx) # imm = 0x6172742F
movw $0x6873, 0x1004(%rbx)   # imm = 0x6873
leaq 0x1006(%rbx), %rdi
addq $0x16, %rbx
movq %rbx, %rsi
popq %rbx
jmp 0x6680