LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiStringNewValForVar
char *cgiStringNewValForVar(char *cgiIn, char *varName, char *newVal)
/* Return a cgi-encoded string with newVal in place of what was oldVal.
 * It is an error for var not to exist.   Do a freeMem of this string
 * when you are through. */
{
struct dyString *dy = dyStringNew(strlen(cgiIn) + strlen(newVal));
struct cgiParsedVars *cpv = cgiParsedVarsNew(cgiIn);
struct cgiVar *var;
boolean doneSub = FALSE;
for (var = cpv->list; var != NULL; var = var->next)
    {
    char *val = var->val;
    if (sameString(var->name, varName))
	{
        val = newVal;
	doneSub = TRUE;
	}
    cgiEncodeIntoDy(var->name, val, dy);
    }
if (!doneSub)
    errAbort("Couldn't find %s in %s", varName, cgiIn);
cgiParsedVarsFree(&cpv);
return dyStringCannibalize(&dy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
callq 0x62d0
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
addl %eax, %r12d
movl %r12d, %edi
callq 0x264e0
movq %rax, %rbp
movq %rax, 0x20(%rsp)
movq %r14, %rdi
callq 0x44e2d
movq %rax, 0x18(%rsp)
movq 0x10(%rax), %rbx
testq %rbx, %rbx
je 0x44df6
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
movq %r15, %r12
movq %r13, 0x8(%rsp)
movq 0x8(%rbx), %r13
movq %rbp, %r15
movq 0x10(%rbx), %rbp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x6a50
testl %eax, %eax
movl $0x1, %eax
cmovel %eax, %r14d
cmoveq %r12, %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rbp
movq %r15, %rdx
callq 0x44e78
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x44da7
testl %r14d, %r14d
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r13
jne 0x44e0a
leaq 0x50fd5(%rip), %rdi     # 0x95dd2
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x26e94
leaq 0x18(%rsp), %rdi
callq 0x44ee2
leaq 0x20(%rsp), %rdi
callq 0x2653c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiDecodeFull
void cgiDecodeFull(char *in, char *out, int inLength)
/* Out will be a cgi-decoded version of in (no space from plus!).
 * Out will be a little shorter than in typically, and
 * can be the same buffer. */
{
char c;
int i;
for (i=0; i<inLength;++i)
    {
    c = *in++;
    if (c == '%')
	{
	int code;
        if (sscanf(in, "%2x", &code) != 1)
	    code = '?';
	in += 2;
	i += 2;
	*out++ = code;
	}
    else
	*out++ = c;
    }
*out++ = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
testl %edx, %edx
jle 0x450c7
movl %edx, %ebp
movq %rdi, %r14
leaq 0x50d97(%rip), %r15     # 0x95e14
leaq 0x4(%rsp), %r12
xorl %r13d, %r13d
leaq 0x1(%r14), %rdi
movb (%r14), %al
cmpb $0x25, %al
jne 0x450b7
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x66d0
movl $0x3f, %ecx
cmpl $0x1, %eax
jne 0x450ab
movl 0x4(%rsp), %ecx
addq $0x3, %r14
addl $0x2, %r13d
movb %cl, (%rbx)
jmp 0x450bc
movb %al, (%rbx)
movq %rdi, %r14
incq %rbx
incl %r13d
cmpl %ebp, %r13d
jl 0x45085
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_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeButtonWithMsg
void cgiMakeButtonWithMsg(char *name, char *value, char *msg)
/* Make 'submit' type button. Display msg on mouseover, if present*/
{
printf("<input type='submit' name='%s' id='%s' value='%s'",
        name, name, value);
if (msg)
    printf(" title='%s'", msg);
printf(">");
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rcx
movq %rdi, %rdx
leaq 0x507b9(%rip), %rdi     # 0x95f2e
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
je 0x45795
leaq 0x507d5(%rip), %rdi     # 0x95f60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeButtonWithOnClick
void cgiMakeButtonWithOnClick(char *name, char *value, char *msg, char *onClick)
/* Make 'submit' type button, with onclick javascript */
{
printf("<input type='submit' name='%s' id='%s' value='%s'",
        name, name, value);
if (msg)
    printf(" title='%s'", msg);
printf(">");

jsOnEventById("click", name, onClick);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %rcx
movq %rdi, %r14
leaq 0x50776(%rip), %rdi     # 0x95f2e
movq %r14, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x457db
leaq 0x5078f(%rip), %rdi     # 0x95f60
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
callq 0x6a40
leaq 0x501e1(%rip), %r15     # 0x959cd
movq %r15, %rdi
callq 0x441cf
leaq 0x503f8(%rip), %rdi     # 0x95bf3
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x4403b
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeRadioButton
void cgiMakeRadioButton(char *name, char *value, boolean checked)
/* Make radio type button.  A group of radio buttons should have the
 * same name but different values.   The default selection should be
 * sent with checked on. */
{
printf("<input type=radio name='%s' id='%s' value='%s'",
        name, name, value);
if (checked)
   printf(" CHECKED");
printf(">");
}

// Assembly:
pushq %rbx
movl %edx, %ebx
movq %rsi, %rcx
movq %rdi, %rdx
leaq 0x50701(%rip), %rdi     # 0x96062
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testl %ebx, %ebx
je 0x4597d
leaq 0x5071b(%rip), %rdi     # 0x96091
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeOnEventRadioButtonWithClass
void cgiMakeOnEventRadioButtonWithClass(char *name, char *value, boolean checked,
    char *class, char *event, char *command)
/* Make radio type button with an event and an optional class attribute.
 *  A group of radio buttons should have the
 * same name but different values.   The default selection should be
 * sent with checked on. If class is non-null it is included. */
{
char temp[256];
safef(temp, sizeof temp, "%s_%s", name, value);
char *valNoSpc = replaceChars(temp, " ", "_"); // replace spaces with underscore
char *id = replaceChars(valNoSpc, ".", "_"); // replace dots with underscore, js does not like dots in ids
freeMem(valNoSpc);
printf("<input type=radio name='%s' id='%s' value='%s'",
        name, id, value);
if (checked)
   printf(" CHECKED");
printf(" class='%s'", class);
printf(">");
jsOnEventById(event, id, command);
freeMem(id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x506e3(%rip), %rdx     # 0x9609a
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x23f33
leaq 0x48a5a(%rip), %rsi     # 0x8e432
leaq 0x50e3a(%rip), %r15     # 0x96819
movq %r12, %rdi
movq %r15, %rdx
callq 0x220c3
movq %rax, %r14
leaq 0x4af84(%rip), %rsi     # 0x90978
movq %rax, %rdi
movq %r15, %rdx
callq 0x220c3
movq %rax, %r12
movq %r14, %rdi
callq 0x2e0a0
leaq 0x50651(%rip), %rdi     # 0x96062
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x6070
testl %ebp, %ebp
je 0x45a33
leaq 0x50665(%rip), %rdi     # 0x96091
xorl %eax, %eax
callq 0x6070
leaq 0x50666(%rip), %rdi     # 0x960a0
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
callq 0x6a40
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x441cf
leaq 0x5018f(%rip), %rdi     # 0x95bf3
movq %r12, %rsi
movq %rbx, %rdx
movq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x4403b
movq %r12, %rdi
callq 0x2e0a0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeOnKeypressTextVar
void cgiMakeOnKeypressTextVar(char *varName, char *initialVal, int charSize,
			      char *script)
/* Make a text control filled with initial value, with a (java)script
 * to execute every time a key is pressed.  If charSize is zero it's
 * calculated from initialVal size. */
{
if (initialVal == NULL)
    initialVal = "";
if (charSize == 0) charSize = strlen(initialVal);
if (charSize == 0) charSize = 8;

htmlPrintf("<INPUT TYPE=TEXT NAME='%s|attr|' ID='%s|attr|' SIZE=%d VALUE='%s|attr|'", 
	varName, varName, charSize, initialVal);
if (isNotEmpty(script))
    jsOnEventById("keypress", varName, script);
printf(">\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
testq %rsi, %rsi
leaq 0x52503(%rip), %r15     # 0x98454
cmovneq %rsi, %r15
testl %edx, %edx
jne 0x45f64
movq %r15, %rdi
callq 0x62d0
movq %rax, %rdx
testl %edx, %edx
movl $0x8, %ecx
cmovnel %edx, %ecx
leaq 0x501d9(%rip), %rdi     # 0x9614e
movq %r14, %rsi
movq %r14, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x49d03
testq %rbx, %rbx
je 0x45fb5
cmpb $0x0, (%rbx)
je 0x45fb5
leaq 0x4fac5(%rip), %r15     # 0x95a5b
movq %r15, %rdi
callq 0x441cf
leaq 0x4fc4e(%rip), %rdi     # 0x95bf3
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4403b
leaq 0x4fefe(%rip), %rdi     # 0x95eba
popq %rbx
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeTextVarWithJs
void cgiMakeTextVarWithJs(char *varName, char *initialVal, int width, char *event, char *javascript)
/* Make a text control filled with initial value. */
{
if (initialVal == NULL)
    initialVal = "";
if (width==0)
    width=strlen(initialVal)*10;
if (width==0)
    width = 100;

htmlPrintf("<INPUT TYPE=TEXT class='inputBox' NAME='%s|attr|' id='%s' style='width:%dpx' VALUE='%s|attr|'>\n",
       varName, varName, width, initialVal);
if (event)
    jsOnEventById(event, varName, javascript);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
testq %rsi, %rsi
leaq 0x5246c(%rip), %r12     # 0x98454
cmovneq %rsi, %r12
testl %edx, %edx
jne 0x45ffd
movq %r12, %rdi
callq 0x62d0
addl %eax, %eax
leal (%rax,%rax,4), %edx
testl %edx, %edx
movl $0x64, %ecx
cmovnel %edx, %ecx
leaq 0x50188(%rip), %rdi     # 0x96196
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0x49d03
testq %r14, %r14
je 0x4604d
movq %r14, %rdi
callq 0x441cf
leaq 0x4fbc1(%rip), %rdi     # 0x95bf3
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4403b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeIntVarInRange
void cgiMakeIntVarInRange(char *varName, int initialVal, char *title, int width,
                          char *min, char *max)
/* Make a integer control filled with initial value.
   If min and/or max are non-NULL will enforce range
   Requires utils.js jQuery.js and inputBox class */
{
if (width==0)
    {
    if (max)
        width=strlen(max)*10;
    else
        {
        int sz=initialVal+1000;
        if (min)
            sz=atoi(min) + 1000;
        width = 10;
        while (sz/=10)
            width+=10;
        }
    }
if (width < 65)
    width = 65;

printf("<INPUT TYPE=TEXT class='inputBox' name='%s' id='%s' style='width: %dpx' value=%d",
       varName,varName,width,initialVal);
jsOnEventByIdF("change", varName, "return validateInt(this,%s,%s);",
       (min ? min : "\"null\""),(max ? max : "\"null\""));
if (title)
    printf(" title='%s'",title);
printf(">\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %r15
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r12
testl %ecx, %ecx
jne 0x46120
testq %r14, %r14
je 0x460d8
movq %r14, %rdi
callq 0x62d0
addl %eax, %eax
leal (%rax,%rax,4), %ecx
jmp 0x46120
movl %ebp, %eax
testq %r15, %r15
je 0x460e7
movq %r15, %rdi
callq 0x6bd0
leal 0x3f1(%rax), %edx
movl $0xa, %ecx
cmpl $0x13, %edx
jb 0x46120
addl $0x3e8, %eax            # imm = 0x3E8
cltq
imulq $0x66666667, %rax, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x22, %rdx
leal (%rdx,%rsi), %eax
addl $0xa, %ecx
addl %esi, %edx
addl $0x9, %edx
cmpl $0x12, %edx
ja 0x460fc
cmpl $0x42, %ecx
movl $0x41, %eax
cmovgel %ecx, %eax
leaq 0x50100(%rip), %rdi     # 0x96232
movq %r12, %rsi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
leaq 0x50155(%rip), %rax     # 0x962a3
cmoveq %rax, %r15
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x4f9a8(%rip), %rdi     # 0x95b08
leaq 0x5011c(%rip), %rdx     # 0x96283
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x44261
testq %rbx, %rbx
je 0x4618d
leaq 0x4fddd(%rip), %rdi     # 0x95f60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4fd26(%rip), %rdi     # 0x95eba
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeDoubleVarInRange
void cgiMakeDoubleVarInRange(char *varName, double initialVal, char *title, int width,
                             char *min, char *max)
/* Make a floating point control filled with initial value.
   If min and/or max are non-NULL will enforce range
   Requires utils.js jQuery.js and inputBox class */
{
if (width==0)
    {
    if (max)
        width=strlen(max)*10;
    }
if (width < 65)
    width = 65;

printf("<INPUT TYPE=TEXT class='inputBox' name='%s' id='%s' style='width: %dpx' value=%g",
       varName,varName,width,initialVal);
jsOnEventByIdF("change", varName, "return validateFloat(this,%s,%s);",
       (min ? min : "\"null\""),(max ? max : "\"null\""));
if (title)
    printf(" title='%s'",title);
printf(">\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testl %edx, %edx
setne %al
testq %r8, %r8
sete %cl
orb %al, %cl
jne 0x46357
movq %r12, %rdi
movsd %xmm0, (%rsp)
callq 0x62d0
movsd (%rsp), %xmm0
addl %eax, %eax
leal (%rax,%rax,4), %edx
cmpl $0x42, %edx
movl $0x41, %ecx
cmovgel %edx, %ecx
leaq 0x4ff6e(%rip), %rdi     # 0x962d7
movq %r15, %rsi
movq %r15, %rdx
movb $0x1, %al
callq 0x6070
testq %r14, %r14
leaq 0x4ff23(%rip), %r8      # 0x962a3
cmoveq %r8, %r14
testq %r12, %r12
cmovneq %r12, %r8
leaq 0x4f776(%rip), %rdi     # 0x95b08
leaq 0x4ff8f(%rip), %rdx     # 0x96328
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x44261
testq %rbx, %rbx
je 0x463bc
leaq 0x4fbae(%rip), %rdi     # 0x95f60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4faf7(%rip), %rdi     # 0x95eba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeDropListClassWithIdStyleAndJavascript
void cgiMakeDropListClassWithIdStyleAndJavascript(char *name, char *id, char *menu[],
        int menuSize, char *checked, char *class, char *style, struct slPair *events)
/* Make a drop-down list with name, id, text class, style and javascript. */
{
int i;
char *selString;
if (checked == NULL) checked = menu[0];
printf("<SELECT");
if (name)
    printf(" NAME='%s'", name);
if (events && !id)  // use name as id
    id = name;
if (id)
    printf(" id='%s'", id);
if (class)
    printf(" class='%s'", class);
if (events)
    {
    struct slPair *e;
    for(e = events; e; e = e->next)
	{
	jsOnEventById(e->name, id, e->val);
	}    
    }
if (style)
    printf(" style='%s'", style);
printf(">\n");
for (i=0; i<menuSize; ++i)
    {
    if (sameWord(menu[i], checked))
        selString = " SELECTED";
    else
        selString = "";
    printf("<OPTION%s>%s</OPTION>\n", selString, menu[i]);
    }
printf("</SELECT>\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movl %ecx, 0x4(%rsp)
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, %r15
testq %r8, %r8
jne 0x4657c
movq (%r14), %r8
movq %r8, 0x10(%rsp)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x4fdb3(%rip), %rdi     # 0x9634a
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x465b4
leaq 0x4feae(%rip), %rdi     # 0x96458
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
cmoveq %rbp, %r15
testq %rbp, %rbp
cmovneq %rbp, %r15
testq %r15, %r15
je 0x465d8
leaq 0x4fb12(%rip), %rdi     # 0x960e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
testq %r13, %r13
je 0x465ee
leaq 0x4fabc(%rip), %rdi     # 0x960a0
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
je 0x46625
leaq 0x4f5f9(%rip), %r13     # 0x95bf3
movq 0x8(%rbx), %rbp
movq 0x10(%rbx), %r12
movq %rbp, %rdi
callq 0x441cf
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x4403b
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x465fa
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x4663d
leaq 0x4fd1c(%rip), %rdi     # 0x96352
xorl %eax, %eax
callq 0x6070
leaq 0x4f876(%rip), %rdi     # 0x95eba
callq 0x6bb0
movl 0x4(%rsp), %eax
testl %eax, %eax
movq 0x10(%rsp), %r12
jle 0x4669a
movl %eax, %ebx
leaq 0x51df5(%rip), %r13     # 0x98454
leaq 0x4fd02(%rip), %r15     # 0x96368
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rdi
movq %r12, %rsi
callq 0x209d6
testl %eax, %eax
movq %r13, %rsi
leaq 0x4fcde(%rip), %rax     # 0x9635e
cmoveq %rax, %rsi
movq (%r14,%rbp,8), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x6070
incq %rbp
cmpq %rbp, %rbx
jne 0x46668
leaq 0x50375(%rip), %rdi     # 0x96a16
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeDropListFullExt
void cgiMakeDropListFullExt(char *name, char *menu[], char *values[],
                         int menuSize, char *checked, char *event, char *javascript, char *style, char *class)
/* Make a drop-down list with names and values.
 * Optionally include values for style and class */
{
int i;
char *selString;
if (checked == NULL) checked = menu[0];

printf("<SELECT NAME='%s'", name);
if (class)
    printf(" class='%s'", class);
if (javascript)
    {
    printf(" id='%s'", name);
    jsOnEventById(event, name, javascript);
    }
if (style)
    printf(" style='%s'", style);
printf(">\n");

for (i=0; i<menuSize; ++i)
    {
    if (sameWord(values[i], checked))
        selString = " SELECTED";
    else
        selString = "";
    printf("<OPTION%s VALUE=\"%s\">%s</OPTION>\n", selString, values[i], menu[i]);
    }
printf("</SELECT>\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movl %ecx, 0x4(%rsp)
movq %rdx, %r14
movq %rdi, %rbp
movq 0x60(%rsp), %r13
testq %r8, %r8
jne 0x469c8
movq (%rsi), %r8
movq %r8, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %r12
leaq 0x4fa6e(%rip), %rdi     # 0x96451
movq %rbp, %rsi
xorl %eax, %eax
callq 0x6070
testq %r13, %r13
je 0x46a03
leaq 0x4f6a7(%rip), %rdi     # 0x960a0
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x46a38
leaq 0x4f6d1(%rip), %rdi     # 0x960e0
movq %rbp, %rsi
xorl %eax, %eax
callq 0x6070
movq %r15, %rdi
callq 0x441cf
leaq 0x4f1cb(%rip), %rdi     # 0x95bf3
movq %rbp, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x4403b
testq %rbx, %rbx
je 0x46a4e
leaq 0x4f90e(%rip), %rdi     # 0x96352
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4f465(%rip), %rdi     # 0x95eba
callq 0x6bb0
movl 0x4(%rsp), %eax
testl %eax, %eax
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %r15
jle 0x46ab2
movl %eax, %r13d
leaq 0x4f9ed(%rip), %r12     # 0x96463
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
movq %rbp, %rsi
callq 0x209d6
testl %eax, %eax
leaq 0x519c7(%rip), %rsi     # 0x98454
leaq 0x4f8ca(%rip), %rax     # 0x9635e
cmoveq %rax, %rsi
movq (%r14,%rbx,8), %rdx
movq (%r15,%rbx,8), %rcx
movq %r12, %rdi
xorl %eax, %eax
callq 0x6070
incq %rbx
cmpq %rbx, %r13
jne 0x46a78
leaq 0x4ff5d(%rip), %rdi     # 0x96a16
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiParsedVarsFreeList
void cgiParsedVarsFreeList(struct cgiParsedVars **pList)
/* Free up list of cgiParsedVars */
{
struct cgiParsedVars *el, *next;

for (el = *pList; el != NULL; el = next)
    {
    next = el->next;
    cgiParsedVarsFree(&el);
    }
*pList = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %r15
movq %r15, 0x8(%rsp)
testq %r15, %r15
je 0x47597
leaq 0x8(%rsp), %r14
movq (%r15), %r15
movq %r14, %rdi
callq 0x44ee2
movq %r15, 0x8(%rsp)
testq %r15, %r15
jne 0x47582
movq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiEncodeHash
void cgiEncodeHash(struct hash *hash, struct dyString *dy)
/* Put a cgi-encoding of a string valued hash into dy.  Tags are always
 * alphabetical to make it easier to compare if two hashes are same. */
{
struct hashEl *el, *elList = hashElListHash(hash);
slSort(&elList, hashElCmp);
boolean firstTime = TRUE;
char *s = NULL;
for (el = elList; el != NULL; el = el->next)
    {
    if (firstTime)
	firstTime = FALSE;
    else
	dyStringAppendC(dy, '&');
    dyStringAppend(dy, el->name);
    dyStringAppendC(dy, '=');
    s = cgiEncode(el->val);
    dyStringAppend(dy, s);
    freez(&s);
    }
hashElFreeList(&elList);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
callq 0x29786
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
leaq -0x1deb2(%rip), %rsi    # 0x29716
movq %r14, %rdi
callq 0x201c4
movq $0x0, (%rsp)
movq (%r14), %r15
testq %r15, %r15
je 0x47639
xorl %eax, %eax
movq %rsp, %r14
testb $0x1, %al
je 0x475f6
movq %rbx, %rdi
movl $0x26, %esi
callq 0x26677
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x2674f
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x26677
movq 0x10(%r15), %rdi
callq 0x450d9
movq %rax, (%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2674f
movq %r14, %rdi
callq 0x2e0b0
movq (%r15), %r15
movb $0x1, %al
testq %r15, %r15
jne 0x475e5
leaq 0x8(%rsp), %rdi
callq 0x297e7
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/hex.c
// Function: byteToHexString
char *byteToHexString(unsigned char n)
/* convert byte to hexidecimal string. 0 <= n <= 255. */
{
char hex[3];
byteToHex(n, hex);
hex[2] = 0;
return cloneString(hex);
}

// Assembly:
pushq %rax
movl %edi, %eax
shrl $0x4, %eax
leaq 0x78f1f(%rip), %rcx     # 0xc0cb0
movb (%rax,%rcx), %dl
leaq 0x5(%rsp), %rax
movb %dl, (%rax)
andl $0xf, %edi
movb (%rdi,%rcx), %cl
movb %cl, 0x1(%rax)
movb $0x0, 0x2(%rax)
movq %rax, %rdi
callq 0x1feba
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/hex.c
// Function: hexBinaryString
void hexBinaryString(unsigned char *in, int inSize, char *out, int outSize)
/* Convert possibly long binary string to hex string.
 * Out size needs to be at least 2x inSize+1 */
{
assert(inSize * 2 +1 <= outSize);
while (--inSize >= 0)
    {
    unsigned char c = *in++;
    *out++ = hexTab[c>>4];
    *out++ = hexTab[c&0xf];
    }
*out = 0;
}

// Assembly:
pushq %rax
leal (%rsi,%rsi), %eax
cmpl %ecx, %eax
jge 0x47e32
testl %esi, %esi
jle 0x47e2d
incl %esi
leaq 0x78eab(%rip), %rax     # 0xc0cb0
movzbl (%rdi), %ecx
incq %rdi
movl %ecx, %r8d
shrl $0x4, %r8d
movb (%r8,%rax), %r8b
movb %r8b, (%rdx)
andl $0xf, %ecx
movb (%rcx,%rax), %cl
movb %cl, 0x1(%rdx)
addq $0x2, %rdx
decl %esi
cmpl $0x1, %esi
ja 0x47e05
movb $0x0, (%rdx)
popq %rax
retq
leaq 0x4ebe7(%rip), %rdi     # 0x96a20
leaq 0x4ebf9(%rip), %rsi     # 0x96a39
leaq 0x4ebfc(%rip), %rcx     # 0x96a43
movl $0x3c, %edx
callq 0x6460
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r12
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %eax
movl %esi, %ebp
subl %eax, %ebp
jg 0x47eb3
addl %esi, %esi
movq %rbx, %rdi
callq 0x265b6
movl 0x10(%rbx), %ebp
movl 0x14(%rbx), %eax
subl %eax, %ebp
movslq %eax, %rdi
addq 0x8(%rbx), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x498fb
testl %eax, %eax
js 0x47ed8
cmpl %ebp, %eax
jl 0x47ee7
movl 0x10(%rbx), %esi
addl %esi, %esi
movq %rbx, %rdi
callq 0x265b6
jmp 0x47e84
addl %eax, 0x14(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x8c472(%rip)     # 0xd4565
je 0x4810e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6810
leaq 0x4e9c9(%rip), %r15     # 0x96ade
leaq 0x4e9bc(%rip), %r12     # 0x96ad8
leaq 0x4e9b0(%rip), %r13     # 0x96ad3
leaq 0x4e9a4(%rip), %rbp     # 0x96ace
movzbl (%r14), %eax
incq %r14
cmpl $0x3b, %eax
jg 0x48145
cmpl $0x22, %eax
je 0x48154
cmpl $0x26, %eax
jne 0x48166
movq %r12, %rdi
jmp 0x4815c
cmpl $0x3c, %eax
je 0x48159
cmpl $0x3e, %eax
jne 0x4816a
movq %rbp, %rdi
jmp 0x4815c
movq %r15, %rdi
jmp 0x4815c
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6810
jmp 0x4812a
testl %eax, %eax
je 0x48177
movsbl %al, %edi
movq %rbx, %rsi
callq 0x6930
jmp 0x4812a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/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 0x481db
pushq %rbx
movq %rdi, %rbx
callq 0x62d0
movq %rax, %rdi
callq 0x2dff4
movq %rax, %rcx
movzbl (%rbx), %edx
cmpl $0x3c, %edx
je 0x481c4
testl %edx, %edx
je 0x481d9
movb %dl, (%rcx)
incq %rcx
jmp 0x481d4
movzbl 0x1(%rbx), %edx
testl %edx, %edx
je 0x481d9
incq %rbx
cmpl $0x3e, %edx
jne 0x481c4
incq %rbx
jmp 0x481b1
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x482cc
movq %rdi, %r14
callq 0x62d0
movq %rax, %rdi
callq 0x2dff4
movq %rax, %r12
cmpb $0x0, (%r14)
je 0x482cf
leaq 0x4e8cf(%rip), %r15     # 0x96ae5
leaq 0x4e8e1(%rip), %r13     # 0x96afe
leaq 0x4e8c9(%rip), %rbp     # 0x96aed
movq %r12, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b44
testl %eax, %eax
je 0x48263
addq $0x9, %r14
cmpb $0x0, -0x8(%r14)
je 0x482cf
leaq -0x8(%r14), %rsi
movq %rbp, %rdi
callq 0x21b44
incq %r14
testl %eax, %eax
je 0x4823a
movb $0x20, %al
cmpb $0x0, -0x9(%r14)
jne 0x482bb
jmp 0x482cf
leaq 0x4e88d(%rip), %rdi     # 0x96af7
movq %r14, %rsi
callq 0x21b44
testl %eax, %eax
je 0x4829f
addq $0x8, %r14
cmpb $0x0, -0x7(%r14)
je 0x482cf
leaq -0x7(%r14), %rsi
movq %r13, %rdi
callq 0x21b44
incq %r14
testl %eax, %eax
je 0x4827a
movb $0x20, %al
cmpb $0x0, -0x8(%r14)
jne 0x482bb
jmp 0x482cf
movb (%r14), %al
incq %r14
cmpb $0x3c, %al
jne 0x482bb
movzbl (%r14), %eax
testl %eax, %eax
je 0x482cf
incq %r14
cmpl $0x3e, %eax
jne 0x482a9
movb $0x20, %al
movb %al, (%rbx)
incq %rbx
cmpb $0x0, (%r14)
jne 0x48227
jmp 0x482cf
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_O3/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 0x4833a
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x62d0
leaq 0x1(%rax), %rdi
callq 0x2dff4
movq %rax, %rcx
movzbl (%r14), %edx
cmpl $0x3c, %edx
je 0x48314
testl %edx, %edx
je 0x4832f
movb %dl, (%rcx)
incq %rcx
jmp 0x4832a
movb %bl, (%rcx)
incq %rcx
movzbl 0x1(%r14), %edx
testl %edx, %edx
je 0x4832f
incq %r14
cmpl $0x3e, %edx
jne 0x48319
incq %r14
jmp 0x48300
movb $0x0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x224b3
leal (%r14,%rax,4), %ebp
leal (%r14,%rax,4), %eax
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x2dff4
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21600
leaq 0x46ed8(%rip), %rdx     # 0x8f261
leaq 0x4ba4f(%rip), %rcx     # 0x93ddf
movq %r15, %rdi
movl %ebp, %esi
callq 0x221f0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e716(%rip), %rdi     # 0x96ad8
leaq 0x4e705(%rip), %r9      # 0x96ace
movl $0x4, %r10d
leaq 0x4e6fd(%rip), %r11     # 0x96ad3
leaq 0x4e72a(%rip), %rbx     # 0x96b07
movl $0x6, %ebp
leaq 0x4e6f5(%rip), %r12     # 0x96ade
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
movl $0x5, %ecx
cmovel %ecx, %r8d
leaq 0x4e6c0(%rip), %rcx     # 0x96b0e
cmoveq %rcx, %rsi
addl %r8d, %eax
movl $0x0, %ecx
testq %r15, %r15
je 0x484c0
testl %edx, %edx
jle 0x48467
cmpl %edx, %eax
jge 0x484d3
cmpl $0x1, %r8d
jne 0x48475
movb %r13b, (%r15)
incq %r15
jmp 0x484bd
movl %r8d, %r12d
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rbx
movq %r9, %rbp
callq 0x6380
leaq 0x4e643(%rip), %r11     # 0x96ad3
movl $0x4, %r10d
movq %rbp, %r9
movl $0x6, %ebp
movq %rbx, %rax
leaq 0x4e65f(%rip), %rbx     # 0x96b07
leaq 0x4e629(%rip), %rdi     # 0x96ad8
movl 0x4(%rsp), %edx
addq %r12, %r15
leaq 0x4e621(%rip), %r12     # 0x96ade
movq %r15, %rcx
incq %r14
movq %rcx, %r15
testb %r13b, %r13b
jne 0x483ed
decl %eax
jmp 0x484dc
movb $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/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 0x483a8
incl %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x2dff4
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x483a8
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movq %rcx, %rdi
callq 0x62d0
movq %rax, %r13
movq %rbx, %rdi
callq 0x62d0
addl %eax, %r13d
addl $0x2, %r13d
callq 0x6790
movq %rax, %rcx
leaq 0x1(%r14), %rdx
leaq 0x1(%rbx), %rsi
xorl %eax, %eax
movl $0x1, %edi
movsbq (%r12), %r8
movq (%rcx), %r9
testb $0x8, (%r9,%r8,2)
movl $0x1, %r9d
cmovel %r13d, %r9d
testq %r8, %r8
cmovel %edi, %r9d
addl %r9d, %eax
testq %r15, %r15
je 0x485b9
testl %ebp, %ebp
jle 0x485a8
cmpl %ebp, %eax
jge 0x4864c
cmpl $0x1, %r9d
jne 0x485be
movb %r8b, (%r15)
incq %r15
jmp 0x4863c
xorl %r15d, %r15d
jmp 0x4863c
movb (%r14), %r10b
movq %rdx, %r9
testb %r10b, %r10b
je 0x485d7
movb %r10b, (%r15)
incq %r15
movb (%r9), %r10b
incq %r9
jmp 0x485c4
movl %r8d, %r9d
shrb $0x4, %r9b
leal 0x30(%r9), %r10d
addb $0x37, %r9b
cmpb $0x3a, %r10b
movzbl %r9b, %r9d
movzbl %r10b, %r10d
cmovael %r9d, %r10d
movb %r10b, (%r15)
movl %r8d, %r9d
andb $0xf, %r9b
leal 0x30(%r9), %r10d
addb $0x37, %r9b
cmpb $0x3a, %r10b
movzbl %r9b, %r9d
movzbl %r10b, %r10d
cmovael %r9d, %r10d
movb %r10b, 0x1(%r15)
addq $0x2, %r15
movb (%rbx), %r9b
testb %r9b, %r9b
je 0x4863c
movq %rsi, %r10
movb %r9b, (%r15)
incq %r15
movb (%r10), %r9b
incq %r10
testb %r9b, %r9b
jne 0x4862b
incq %r12
testb %r8b, %r8b
jne 0x48576
decl %eax
jmp 0x48655
movb $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/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 %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
cmpb $0x0, (%rbx)
je 0x4873d
movslq %eax, %r13
leal (%r12,%r13), %eax
addl $0x2, %eax
cltq
movq %rax, (%rsp)
movq %rbx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x21b44
testl %eax, %eax
je 0x48726
movb (%r12,%r13), %cl
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x486d9
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x486cd
addb $-0x37, %cl
jmp 0x486d7
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x48726
addb $-0x57, %cl
movl %ecx, %eax
leaq (%r12,%r13), %rsi
movb 0x1(%rsi), %cl
shlb $0x4, %al
leal -0x30(%rcx), %ebp
cmpb $0x9, %bpl
ja 0x486f1
orb %al, %bpl
jmp 0x4870d
leal -0x41(%rcx), %edx
cmpb $0x5, %dl
ja 0x486ff
addb %cl, %al
addb $-0x37, %al
jmp 0x4870b
leal -0x61(%rcx), %edx
cmpb $0x5, %dl
ja 0x48726
addb %cl, %al
addb $-0x57, %al
movl %eax, %ebp
addq $0x2, %rsi
movq %r14, %rdi
callq 0x21b44
testl %eax, %eax
je 0x48726
movb %bpl, (%rbx)
addq (%rsp), %r12
jmp 0x4872f
movb (%r12), %al
incq %r12
movb %al, (%rbx)
incq %rbx
cmpb $0x0, (%r12)
jne 0x486a7
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_O3/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 0x4e388(%rip), %r14     # 0x96b14
leaq 0x4d791(%rip), %r15     # 0x95f24
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dff4
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e2f5(%rip), %r14     # 0x96b18
leaq 0x45c08(%rip), %r15     # 0x8e432
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dff4
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e260(%rip), %r14     # 0x96b1a
leaq 0x4fb93(%rip), %r15     # 0x98454
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dff4
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e1cc(%rip), %r14     # 0x96b1d
leaq 0x4fafc(%rip), %r15     # 0x98454
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
incl %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2dff4
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
movl %r12d, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x4852c
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e4d8(%rip), %rdi     # 0x96f52
callq 0x6bb0
leaq 0x4e4d9(%rip), %rdi     # 0x96f5f
callq 0x6bb0
leaq 0x4e4cb(%rip), %rdi     # 0x96f5d
callq 0x6bb0
testq %r14, %r14
je 0x48abe
movq 0x7650d(%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_O3/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 0x450d9
movq %rax, %rbp
movq %rbx, %rdi
callq 0x450d9
movq %rax, %rbx
testq %r15, %r15
je 0x48b7c
movq %r15, %rdi
callq 0x450d9
movq %rax, %r13
jmp 0x48b7f
xorl %r13d, %r13d
leaq 0x4e455(%rip), %rdi     # 0x96fdb
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x48ba9
leaq 0x4e450(%rip), %rdi     # 0x96fef
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x48bbf
leaq 0x4e447(%rip), %rdi     # 0x96ffc
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %r14, %r14
je 0x48bd5
leaq 0x4e43b(%rip), %rdi     # 0x97006
movq %r14, %rsi
xorl %eax, %eax
callq 0x6070
cmpl $0x1, 0x4(%rsp)
jne 0x48bea
leaq 0x4e42f(%rip), %rdi     # 0x97012
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