LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/bPlusTree.c
// Function: bptFileBulkIndexToOpenFile
void bptFileBulkIndexToOpenFile(void *itemArray, int itemSize, bits64 itemCount, bits32 blockSize,
	void (*fetchKey)(const void *va, char *keyBuf), bits32 keySize,
	void* (*fetchVal)(const void *va), bits32 valSize, FILE *f)
/* Create a b+ tree index from a sorted array, writing output starting at current position
 * of an already open file.  See bptFileCreate for explanation of parameters. */
{
bits32 magic = bptSig;
bits32 reserved = 0;
writeOne(f, magic);
writeOne(f, blockSize);
writeOne(f, keySize);
writeOne(f, valSize);
writeOne(f, itemCount);
writeOne(f, reserved);
writeOne(f, reserved);
bits64 indexOffset = ftell(f);

/* Write non-leaf nodes. */
int levels = bptCountLevels(blockSize, itemCount);
int i;
for (i=levels-1; i > 0; --i)
    {
    bits32 endLevelOffset = writeIndexLevel(blockSize, itemArray, itemSize, itemCount, indexOffset, 
    	i, fetchKey, keySize, valSize, f);
    indexOffset = ftell(f);
    if (endLevelOffset != indexOffset)
        internalErr();
    }

/* Write leaf nodes */
writeLeafLevel(blockSize, itemArray, itemSize, itemCount, 
	fetchKey, keySize, fetchVal, valSize, f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x18(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movq 0x70(%rsp), %r14
leaq 0x8(%rsp), %rax
movq %rdx, (%rax)
leaq 0x14(%rsp), %rbx
movl %ecx, (%rbx)
leaq 0x4(%rsp), %r13
movl %r9d, (%r13)
leaq 0x24(%rsp), %rsi
movl $0x78ca8c91, (%rsi)     # imm = 0x78CA8C91
leaq 0x10(%rsp), %rax
andl $0x0, (%rax)
pushq $0x4
popq %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x1ed3f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1ed3f
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1ed3f
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x1ed3f
pushq $0x8
popq %rdx
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1ed3f
movq %r14, %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
movq %r12, %rdx
callq 0x1ed3f
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1ed3f
movq %r14, %rdi
callq 0x6030
movq %rax, %r13
movl (%rbx), %ecx
leaq 0x8(%rsp), %rax
movl (%rax), %eax
leal -0x1(%rcx), %esi
pushq $0x1
popq %r12
cmpl %ecx, %eax
jle 0x3d280
addl %esi, %eax
cltd
idivl %ecx
incl %r12d
jmp 0x3d21b
decl %r12d
movl 0x4(%rsp), %eax
movl 0x68(%rsp), %r10d
movq %r15, %rsi
movl %ebp, %edx
movl %r13d, %r8d
movl %r12d, %r9d
pushq %r14
pushq %r10
pushq %rax
pushq 0x30(%rsp)
callq 0x3d2c2
addq $0x20, %rsp
movl %eax, %ebx
movq %r14, %rdi
callq 0x6030
movq %rax, %r13
movl %ebx, %eax
cmpq %rax, %r13
je 0x3d280
leaq 0x3f92e(%rip), %rdi     # 0x7cb9b
leaq 0x472d1(%rip), %rsi     # 0x84545
movl $0x23c, %edx            # imm = 0x23C
xorl %eax, %eax
callq 0x223fb
movq 0x8(%rsp), %rcx
movzwl 0x14(%rsp), %edi
cmpl $0x2, %r12d
jge 0x3d229
movl 0x4(%rsp), %r9d
movl 0x68(%rsp), %eax
subq $0x8, %rsp
movq %r15, %rsi
movl %ebp, %edx
movq 0x20(%rsp), %r8
pushq %r14
pushq %rax
pushq 0x78(%rsp)
callq 0x3d53f
addq $0x48, %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/bPlusTree.c
// Function: bptFileCreate
void bptFileCreate(
	void *itemArray, 	/* Sorted array of things to index. */
	int itemSize, 		/* Size of each element in array. */
	bits64 itemCount, 	/* Number of elements in array. */
	bits32 blockSize,	/* B+ tree block size - # of children for each node. */
	void (*fetchKey)(const void *va, char *keyBuf),  /* Given item, copy key to keyBuf */ 
	bits32 keySize,					 /* Size of key */
	void* (*fetchVal)(const void *va), 		 /* Given item, return pointer to value */
	bits32 valSize, 				 /* Size of value */
	char *fileName)                                  /* Name of output file. */
/* Create a b+ tree index file from a sorted array. */

{
/* Open file and write header. */
FILE *f = mustOpen(fileName, "wb");
bptFileBulkIndexToOpenFile(itemArray, itemSize, itemCount, blockSize, fetchKey, keySize, 
	fetchVal, valSize, f);
carefulClose(&f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r13
movq 0x50(%rsp), %rdi
leaq 0x44452(%rip), %rsi     # 0x81b46
callq 0x1ec79
movq %rsp, %rcx
movq %rax, (%rcx)
subq $0x8, %rsp
movq %r13, %rdi
movl %r12d, %esi
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
movl %ebx, %r9d
pushq %rax
movl 0x58(%rsp), %eax
pushq %rax
pushq 0x58(%rsp)
callq 0x3d14c
addq $0x20, %rsp
movq %rsp, %rdi
callq 0x1f2ea
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/bPlusTree.c
// Function: bptDataStart
static bits64 bptDataStart(struct bptFile *bpt)
/* Return offset of first bit of data (as opposed to index) in file.  In hind sight I wish
 * this were stored in the header, but fortunately it's not that hard to compute. */
{
bits64 offset = bpt->rootOffset;
for (;;)
    {
    /* Seek to block start */
    udcSeek(bpt->udc, offset);

    /* Read block header,  break if we are leaf. */
    UBYTE isLeaf;
    UBYTE reserved;
    udcMustReadOne(bpt->udc, isLeaf);
    if (isLeaf)
         break;
    udcMustReadOne(bpt->udc, reserved);
    boolean isSwapped = bpt->isSwapped;
    udcReadBits16(bpt->udc, isSwapped);  // childCount

    /* Read and discard first key. */
    char keyBuf[bpt->keySize];
    udcMustRead(bpt->udc, keyBuf, bpt->keySize);

    /* Get file offset of sub-block. */
    offset = udcReadBits64(bpt->udc, isSwapped);
    }
return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %r13
leaq -0x29(%rbp), %r14
pushq $0x1
popq %r15
movq 0x10(%rbx), %rdi
movq %r13, %rsi
callq 0x3bb5a
movq 0x10(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3a0ac
cmpb $0x0, -0x29(%rbp)
jne 0x3d7d3
movq 0x10(%rbx), %rdi
leaq -0x2a(%rbp), %rsi
movq %r15, %rdx
callq 0x3a0ac
movl 0x30(%rbx), %r13d
movq 0x10(%rbx), %rdi
movl %r13d, %esi
callq 0x3b899
movq %rsp, %r12
movl 0x1c(%rbx), %eax
movq %rsp, %rsi
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rsi
movq %rsi, %rsp
movq 0x10(%rbx), %rdi
movl 0x1c(%rbx), %edx
callq 0x3a0ac
movq 0x10(%rbx), %rdi
movl %r13d, %esi
callq 0x3b842
movq %rax, %r13
movq %r12, %rsp
jmp 0x3d75b
movq %r13, %rax
leaq -0x28(%rbp), %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/bPlusTree.c
// Function: rFind
static boolean rFind(struct bptFile *bpt, bits64 blockStart, void *key, void *val)
/* Find value corresponding to key.  If found copy value to memory pointed to by val and return 
 * true. Otherwise return false. */
{
/* Seek to start of block. */
udcSeek(bpt->udc, blockStart);

/* Read block header. */
UBYTE isLeaf;
UBYTE reserved;
bits16 i, childCount;
udcMustReadOne(bpt->udc, isLeaf);
udcMustReadOne(bpt->udc, reserved);
boolean isSwapped = bpt->isSwapped;
childCount = udcReadBits16(bpt->udc, isSwapped);

UBYTE keyBuf[bpt->keySize];   /* Place to put a key, buffered on stack. */

if (isLeaf)
    {
    for (i=0; i<childCount; ++i)
        {
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	udcMustRead(bpt->udc, val, bpt->valSize);
	if (memcmp(key, keyBuf, bpt->keySize) == 0)
	    return TRUE;
	}
    return FALSE;
    }
else
    {
    /* Read and discard first key. */
    udcMustRead(bpt->udc, keyBuf, bpt->keySize);

    /* Scan info for first file offset. */
    bits64 fileOffset = udcReadBits64(bpt->udc, isSwapped);

    /* Loop through remainder. */
    for (i=1; i<childCount; ++i)
	{
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	if (memcmp(key, keyBuf, bpt->keySize) < 0)
	    break;
	fileOffset = udcReadBits64(bpt->udc, isSwapped);
	}
    return rFind(bpt, fileOffset, key, val);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, -0x38(%rbp)
movq %rdi, %r15
movq 0x10(%rdi), %rdi
callq 0x3bb5a
movq 0x10(%r15), %rdi
leaq -0x29(%rbp), %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x3a0ac
movq 0x10(%r15), %rdi
leaq -0x2a(%rbp), %rsi
movq %r12, %rdx
callq 0x3a0ac
movl 0x30(%r15), %ebx
movq 0x10(%r15), %rdi
movl %ebx, %esi
callq 0x3b899
movl %eax, %r12d
movq %rsp, -0x50(%rbp)
movl 0x1c(%r15), %eax
movq %rsp, %r13
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
leaq -0x29(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3dab8
incl %r12d
pushq $0x1
popq %rbx
decw %r12w
je 0x3db37
movq 0x10(%r15), %rdi
movl 0x1c(%r15), %edx
movq %r13, %rsi
callq 0x3a0ac
movq 0x10(%r15), %rdi
movl 0x20(%r15), %edx
movq %r14, %rsi
callq 0x3a0ac
movl 0x1c(%r15), %edx
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x6710
testl %eax, %eax
jne 0x3da75
jmp 0x3db39
movq %r14, -0x48(%rbp)
movq 0x10(%r15), %rdi
movl 0x1c(%r15), %edx
movq %r13, %rsi
callq 0x3a0ac
movq 0x10(%r15), %rdi
movl %ebx, -0x3c(%rbp)
movl %ebx, %esi
callq 0x3b842
movq %rax, %rbx
movw $0x1, %r14w
cmpw %r12w, %r14w
jae 0x3db20
movq 0x10(%r15), %rdi
movl 0x1c(%r15), %edx
movq %r13, %rsi
callq 0x3a0ac
movl 0x1c(%r15), %edx
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x62e0
testl %eax, %eax
js 0x3db20
movq 0x10(%r15), %rdi
movl -0x3c(%rbp), %esi
callq 0x3b842
movq %rax, %rbx
incl %r14d
jmp 0x3dae2
movq %r15, %rdi
movq %rbx, %rsi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x3d9f3
movl %eax, %ebx
jmp 0x3db39
xorl %ebx, %ebx
movq -0x50(%rbp), %rsp
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: jsInlineFinish
void jsInlineFinish()
/* finish outputting accumulated inline javascript */
{
if (jsInlineFinishCalled)
    {
    // jsInlineFinish can be called multiple times when generating framesets or genomeSpace.
    warn("jsInlineFinish() called already.");
    }
jsInlineInit(); // init if needed
printf("<script type='text/javascript' nonce='%s'>\n%s</script>\n", getNonce(), jsInlineLines->string);
dyStringClear(jsInlineLines);
jsInlineFinishCalled = TRUE;
}

// Assembly:
pushq %rax
cmpl $0x0, 0x7a625(%rip)     # 0xb8258
je 0x3dc43
leaq 0x46b43(%rip), %rdi     # 0x8477f
xorl %eax, %eax
callq 0x22186
callq 0x3db50
xorl %eax, %eax
callq 0x42737
movq 0x7a5fa(%rip), %rcx     # 0xb8250
movq 0x8(%rcx), %rdx
leaq 0x46b3f(%rip), %rdi     # 0x847a0
movq %rax, %rsi
xorl %eax, %eax
callq 0x6070
movq 0x7a5de(%rip), %rax     # 0xb8250
andl $0x0, 0x14(%rax)
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movl $0x1, 0x7a5d1(%rip)     # 0xb8258
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: checkValidEvent
void checkValidEvent(char *event)
/* check if it is lowercase and a known valid event name */
{
char *temp = cloneString(event);
tolowers(temp);
if (!sameString(temp, event))
    warn("jsInline: javascript event %s should be given in lower-case", event);
event = temp; 
if (!findJsEvent(event))
    warn("jsInline: unknown javascript event %s", event);
freeMem (event);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1c306
movq %rax, %rbx
movq %rax, %rdi
callq 0x1e270
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a50
testl %eax, %eax
je 0x3dd0d
leaq 0x46d8e(%rip), %rdi     # 0x84a91
movq %r14, %rsi
xorl %eax, %eax
callq 0x22186
movq %rbx, %rdi
callq 0x3dc91
testl %eax, %eax
jne 0x3dd2a
leaq 0x46dad(%rip), %rdi     # 0x84acd
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22186
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x28c2d
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: jsOnEventByIdF
void jsOnEventByIdF(char *eventName, char *idText, char *format, ...)
/* Add js mapping for inline event with printf formatting */
{
checkValidEvent(eventName);
jsInlineF("document.getElementById('%s').on%s = function(event) {if (!event) {event=window.event}; ", idText, eventName);
va_list args;
va_start(args, format);
dyStringVaPrintf(jsInlineLines, format, args);
va_end(args);
jsInlineF("};\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %r12
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x3ddce
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)
callq 0x3dcd6
leaq 0x46d77(%rip), %rdi     # 0x84b51
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3db8b
movq %rsp, %rdx
movq %r12, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rdx)
movq 0x7a442(%rip), %rdi     # 0xb8250
movq %rbx, %rsi
callq 0x21e44
leaq 0x47f83(%rip), %rdi     # 0x85da0
xorl %eax, %eax
callq 0x3db8b
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiScriptDirUrl
char *cgiScriptDirUrl()
/* Return the absolute cgi-bin directory on this webserver.
 * This is not the local directory but the <path> part after the server
 * in external URLs to this webserver.
 * e.g. if CGI is called http://localhost/subdir/cgi-bin/cgiTest
 * then returned value is /subdir/
 * return value must be free'd. */
{
char* cgiPath = cloneString(cgiScriptName());
char dir[PATH_LEN];
splitPath(cgiPath, dir, NULL, NULL);
char* dirStr = needMem(PATH_LEN);
safecpy(dirStr, PATH_LEN, dir);
return dirStr;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
callq 0x3deab
movq %rax, %rdi
callq 0x1c306
movq %rsp, %rbx
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x23b2e
movl $0x200, %edi            # imm = 0x200
callq 0x28bb0
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
movq %rbx, %rdx
callq 0x1d6d3
movq %r14, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiDictionaryFromEncodedString
struct cgiDictionary *cgiDictionaryFromEncodedString(char *encodedString)
/* Giving a this=that&this=that string,  return cgiDictionary parsed out from it. 
 * This does *not* destroy input like the lower level cgiParse functions do. */
{
struct cgiDictionary *d;
AllocVar(d);
d->stringData = cloneString(encodedString);
cgiParseInputAbort(d->stringData, &d->hash, &d->list);
return d;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x28bb0
movq %rax, %r14
movq %rbx, %rdi
callq 0x1c306
movq %rax, 0x8(%r14)
leaq 0x10(%r14), %rsi
leaq 0x18(%r14), %rdx
movq %rax, %rdi
callq 0x3e476
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiDictionaryFree
void cgiDictionaryFree(struct cgiDictionary **pD)
/* Free up resources associated with dictionary. */
{
struct cgiDictionary *d = *pD;
if (d != NULL)
    {
    slFreeList(&d->list);
    hashFree(&d->hash);
    freez(&d->stringData);
    freez(pD);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x3e5ee
movq %rdi, %rbx
leaq 0x18(%r14), %rdi
callq 0x1c583
leaq 0x10(%r14), %rdi
callq 0x2494c
addq $0x8, %r14
movq %r14, %rdi
callq 0x28c3d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x28c3d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiParseNext
boolean cgiParseNext(char **pInput, char **retVar, char **retVal)
/* Parse out next var/val in a var=val&var=val... cgi formatted string 
 * This will insert zeroes and other things into string. 
 * Usage:
 *     char *pt = cgiStringStart;
 *     char *var, *val
 *     while (cgiParseNext(&pt, &var, &val))
 *          printf("%s\t%s\n", var, val); */
{
char *var = *pInput;
if (var == NULL || var[0] == 0)
    return FALSE;
char *val = strchr(var, '=');
if (val == NULL)
    errAbort("Mangled CGI input string %s", var);
*val++ = 0;
char *end = strchr(val, '&');
if (end == NULL)
    end = strchr(val, ';');  // For DAS
if (end == NULL)
    {
    end = val + strlen(val);
    *pInput = NULL;
    }
else
    {
    *pInput = end+1;
    *end = 0;
    }
*retVar = var;
*retVal = val;
cgiDecode(val,val,end-val);
return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
xorl %eax, %eax
testq %r15, %r15
je 0x3e6c9
cmpb $0x0, (%r15)
je 0x3e6c9
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
pushq $0x3d
popq %rsi
movq %r15, %rdi
callq 0x6270
movq %rax, %r13
movq %rax, %rbp
testq %rax, %rax
jne 0x3e67e
leaq 0x46642(%rip), %rdi     # 0x84cb6
movq %r15, %rsi
xorl %eax, %eax
callq 0x223fb
incq %r13
movb $0x0, (%rbp)
pushq $0x26
popq %rsi
movq %r13, %rdi
callq 0x6270
testq %rax, %rax
jne 0x3e6a5
pushq $0x3b
popq %rsi
movq %r13, %rdi
callq 0x6270
testq %rax, %rax
je 0x3e6d8
leaq 0x1(%rax), %rcx
movq %rcx, (%r12)
movb $0x0, (%rax)
movq %r15, (%r14)
movq %r13, (%rbx)
subl %r13d, %eax
movq %r13, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x3e6ea
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x62d0
addq %r13, %rax
andq $0x0, (%r12)
jmp 0x3e6b0
// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movq %rdi, %rbx
callq 0x62d0
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
addl %eax, %r12d
movl %r12d, %edi
callq 0x21bcc
movq %rax, %r12
movq %rax, 0x20(%rsp)
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x3e893
movq %rax, %r13
movq %rax, 0x18(%rsp)
addq $0x10, %r13
xorl %r14d, %r14d
movq (%r13), %r13
testq %r13, %r13
je 0x3e853
movq 0x8(%r13), %rbp
movq 0x10(%r13), %rbx
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x6a50
testl %eax, %eax
pushq $0x1
popq %rax
cmovel %eax, %r14d
cmoveq %r15, %rbx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3e8dc
jmp 0x3e818
testl %r14d, %r14d
jne 0x3e870
leaq 0x46473(%rip), %rdi     # 0x84cd2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x223fb
leaq 0x18(%rsp), %rdi
callq 0x3e942
leaq 0x20(%rsp), %rdi
callq 0x21c26
addq $0x28, %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/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
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x4(%rsp), %r12
pushq $0x3f
popq %r13
xorl %r14d, %r14d
cmpl %ebp, %r14d
jge 0x3eb91
leaq 0x1(%r15), %rdi
movb (%r15), %al
cmpb $0x25, %al
jne 0x3eb84
leaq 0x461b2(%rip), %rsi     # 0x84d14
movq %r12, %rdx
xorl %eax, %eax
callq 0x66d0
movl %r13d, %ecx
cmpl $0x1, %eax
jne 0x3eb78
movl 0x4(%rsp), %ecx
addq $0x3, %r15
addl $0x2, %r14d
movb %cl, (%rbx)
jmp 0x3eb89
movb %al, (%rbx)
movq %rdi, %r15
incq %rbx
incl %r14d
jmp 0x3eb4b
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_O2/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 0x45cad(%rip), %rdi     # 0x84e2e
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
je 0x3f1a1
leaq 0x45cc9(%rip), %rdi     # 0x84e60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
pushq $0x3e
popq %rdi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O2/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 0x45c6c(%rip), %rdi     # 0x84e2e
movq %r14, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x3f1e5
leaq 0x45c85(%rip), %rdi     # 0x84e60
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
pushq $0x3e
popq %rdi
callq 0x6a40
leaq 0x456d9(%rip), %rdi     # 0x848cd
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3dd39
// File: /workspace/github_c_makefile_star2_O2/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 0x45c22(%rip), %rdi     # 0x84f62
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testl %ebx, %ebx
je 0x3f35c
leaq 0x45c3c(%rip), %rdi     # 0x84f91
xorl %eax, %eax
callq 0x6070
pushq $0x3e
popq %rdi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O2/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 0x45c06(%rip), %rdx     # 0x84f9a
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x1fab2
leaq 0x3e01d(%rip), %rsi     # 0x7d3d2
leaq 0x4635d(%rip), %r14     # 0x85719
movq %r12, %rdi
movq %r14, %rdx
callq 0x1e06b
movq %rax, %r15
leaq 0x404a7(%rip), %rsi     # 0x7f878
movq %rax, %rdi
movq %r14, %rdx
callq 0x1e06b
movq %rax, %r12
movq %r15, %rdi
callq 0x28c2d
leaq 0x45b74(%rip), %rdi     # 0x84f62
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x6070
testl %ebp, %ebp
je 0x3f410
leaq 0x45b88(%rip), %rdi     # 0x84f91
xorl %eax, %eax
callq 0x6070
leaq 0x45b89(%rip), %rdi     # 0x84fa0
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6070
pushq $0x3e
popq %rdi
callq 0x6a40
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
callq 0x3dd39
movq %r12, %rdi
callq 0x28c2d
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x47b03(%rip), %r15     # 0x8737d
cmovneq %rsi, %r15
testl %edx, %edx
jne 0x3f88d
movq %r15, %rdi
callq 0x62d0
movq %rax, %rdx
testl %edx, %edx
pushq $0x8
popq %rcx
cmovnel %edx, %ecx
leaq 0x457b2(%rip), %rdi     # 0x8504e
movq %r14, %rsi
movq %r14, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x43630
testq %rbx, %rbx
je 0x3f8c8
cmpb $0x0, (%rbx)
je 0x3f8c8
leaq 0x4509e(%rip), %rdi     # 0x8495b
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3dd39
leaq 0x454eb(%rip), %rdi     # 0x84dba
popq %rbx
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O2/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 0x47a82(%rip), %r12     # 0x8737d
cmovneq %rsi, %r12
testl %edx, %edx
jne 0x3f90e
movq %r12, %rdi
callq 0x62d0
imull $0xa, %eax, %edx
testl %edx, %edx
pushq $0x64
popq %rcx
cmovnel %edx, %ecx
leaq 0x45779(%rip), %rdi     # 0x85096
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0x43630
testq %r14, %r14
je 0x3f94b
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3dd39
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3f9b7
testq %r14, %r14
je 0x3fa36
movq %r14, %rdi
callq 0x62d0
imull $0xa, %eax, %ecx
cmpl $0x42, %ecx
pushq $0x41
popq %rax
cmovgel %ecx, %eax
leaq 0x4576b(%rip), %rdi     # 0x85132
movq %r12, %rsi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
leaq 0x457c0(%rip), %rax     # 0x851a3
cmoveq %rax, %r15
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x45013(%rip), %rdi     # 0x84a08
leaq 0x45787(%rip), %rdx     # 0x85183
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x3dd68
testq %rbx, %rbx
je 0x3fa22
leaq 0x45448(%rip), %rdi     # 0x84e60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x45391(%rip), %rdi     # 0x84dba
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
movl %ebp, %eax
testq %r15, %r15
je 0x3fa45
movq %r15, %rdi
callq 0x6bd0
addl $0x3e8, %eax            # imm = 0x3E8
pushq $0xa
popq %rsi
movl %esi, %ecx
leal 0x9(%rax), %edx
cmpl $0x13, %edx
jb 0x3f9b7
cltd
idivl %esi
addl $0xa, %ecx
jmp 0x3fa4f
// File: /workspace/github_c_makefile_star2_O2/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 0x3fc0d
movq %r12, %rdi
movsd %xmm0, (%rsp)
callq 0x62d0
movsd (%rsp), %xmm0
imull $0xa, %eax, %edx
cmpl $0x42, %edx
pushq $0x41
popq %rcx
cmovgel %edx, %ecx
leaq 0x455ba(%rip), %rdi     # 0x851d7
movq %r15, %rsi
movq %r15, %rdx
movb $0x1, %al
callq 0x6070
testq %r14, %r14
leaq 0x4556f(%rip), %r8      # 0x851a3
cmoveq %r8, %r14
testq %r12, %r12
cmovneq %r12, %r8
leaq 0x44dc2(%rip), %rdi     # 0x84a08
leaq 0x455db(%rip), %rdx     # 0x85228
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3dd68
testq %rbx, %rbx
je 0x3fc70
leaq 0x451fa(%rip), %rdi     # 0x84e60
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x45143(%rip), %rdi     # 0x84dba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movq %r8, 0x8(%rsp)
testq %r8, %r8
jne 0x3fe32
movq (%r15), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %r14
leaq 0x45407(%rip), %rdi     # 0x8524a
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x3fe60
leaq 0x45502(%rip), %rdi     # 0x85358
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbp, %rbp
cmoveq %r13, %r12
testq %r13, %r13
cmovneq %r13, %r12
testq %r12, %r12
je 0x3fe84
leaq 0x45166(%rip), %rdi     # 0x84fe0
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x3fe9c
leaq 0x4510b(%rip), %rdi     # 0x84fa0
xorl %eax, %eax
callq 0x6070
testq %rbp, %rbp
je 0x3febc
testq %rbp, %rbp
je 0x3febc
movq 0x8(%rbp), %rdi
movq 0x10(%rbp), %rdx
movq %r12, %rsi
callq 0x3dd39
movq (%rbp), %rbp
jmp 0x3fea1
testq %r14, %r14
je 0x3fed2
leaq 0x4538a(%rip), %rdi     # 0x85252
movq %r14, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x44ee1(%rip), %rdi     # 0x84dba
callq 0x6bb0
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0x45372(%rip), %r13     # 0x8525e
leaq 0x4748a(%rip), %rbp     # 0x8737d
leaq 0x4536e(%rip), %r12     # 0x85268
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x3ff2c
movq (%r15,%r14,8), %rdi
movq 0x8(%rsp), %rsi
callq 0x1cd23
testl %eax, %eax
movq %rbp, %rsi
cmoveq %r13, %rsi
movq (%r15,%r14,8), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x6070
incq %r14
jmp 0x3fefd
leaq 0x459e3(%rip), %rdi     # 0x85916
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, (%rsp)
movq %rdi, %r13
movq 0x60(%rsp), %rbp
movq %r8, 0x8(%rsp)
testq %r8, %r8
jne 0x401fa
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r14
leaq 0x45146(%rip), %rdi     # 0x85351
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbp, %rbp
je 0x4022b
leaq 0x44d7f(%rip), %rdi     # 0x84fa0
movq %rbp, %rsi
xorl %eax, %eax
callq 0x6070
testq %r14, %r14
je 0x40251
leaq 0x44da9(%rip), %rdi     # 0x84fe0
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3dd39
testq %r12, %r12
je 0x40267
leaq 0x44ff5(%rip), %rdi     # 0x85252
movq %r12, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x44b4c(%rip), %rdi     # 0x84dba
callq 0x6bb0
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0x44fdd(%rip), %rbp     # 0x8525e
leaq 0x470f5(%rip), %r12     # 0x8737d
leaq 0x450d4(%rip), %r13     # 0x85363
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x402c9
movq (%r15,%r14,8), %rdi
movq 0x8(%rsp), %rsi
callq 0x1cd23
testl %eax, %eax
movq %r12, %rsi
cmoveq %rbp, %rsi
movq (%r15,%r14,8), %rdx
movq (%rsp), %rax
movq (%rax,%r14,8), %rcx
movq %r13, %rdi
xorl %eax, %eax
callq 0x6070
incq %r14
jmp 0x40292
leaq 0x45646(%rip), %rdi     # 0x85916
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x8(%rsp), %r14
movq %r15, 0x8(%rsp)
testq %r15, %r15
je 0x40dc9
movq (%r15), %r15
movq %r14, %rdi
callq 0x3e942
jmp 0x40db2
andq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
callq 0x2481e
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
leaq -0x1c643(%rip), %rsi    # 0x247b7
movq %r14, %rdi
callq 0x1c5ab
movq %rsp, %r15
andq $0x0, (%r15)
xorl %eax, %eax
pushq $0x26
popq %rbp
pushq $0x3d
popq %r12
movq (%r14), %r14
testq %r14, %r14
je 0x40e63
testb $0x1, %al
je 0x40e28
movq %rbx, %rdi
movl %ebp, %esi
callq 0x21d3a
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x21dda
movq %rbx, %rdi
movl %r12d, %esi
callq 0x21d3a
movq 0x10(%r14), %rdi
callq 0x3eba3
movq %rax, (%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x21dda
movq %r15, %rdi
callq 0x28c3d
movb $0x1, %al
jmp 0x40e12
leaq 0x8(%rsp), %rdi
callq 0x2487c
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/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 0x73747(%rip), %rcx     # 0xb4cd0
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 0x1c306
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
leal (%rsi,%rsi), %eax
cmpl %ecx, %eax
jge 0x41629
xorl %eax, %eax
leaq 0x736d8(%rip), %rcx     # 0xb4cd0
testl %esi, %esi
jle 0x41624
decl %esi
movzbl (%rdi,%rax), %r8d
movl %r8d, %r9d
shrl $0x4, %r9d
movb (%r9,%rcx), %r9b
movb %r9b, (%rdx,%rax,2)
andl $0xf, %r8d
movb (%r8,%rcx), %r8b
movb %r8b, 0x1(%rdx,%rax,2)
incq %rax
jmp 0x415f8
movb $0x0, (%rdx,%rax,2)
retq
pushq %rax
leaq 0x442ef(%rip), %rdi     # 0x85920
leaq 0x44301(%rip), %rsi     # 0x85939
leaq 0x44304(%rip), %rcx     # 0x85943
pushq $0x3c
popq %rdx
callq 0x6460
nop
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/htmshell.c
// Function: htmlVaEncodeErrorText
void htmlVaEncodeErrorText(char *format, va_list args)
/* Write an error message encoded against XSS. */
{
va_list argscp;
va_copy(argscp, args);
char warning[1024];

struct dyString *ds = newDyString(1024);
vaHtmlDyStringPrintf(ds, format, args);
int n = ds->stringSize;
int nLimit = sizeof(warning) - 1;
if (ds->stringSize > nLimit)
    n = nLimit;
safencpy(warning, sizeof warning, ds->string, n);
if (ds->stringSize > nLimit)
    strcpy(warning+n-5,"[...]");  // indicated trucation
freeDyString(&ds);

fprintf(stdout, "%s\n", warning);
/* write warning/error message to stderr so they get logged. */
vfprintf(stderr, format, argscp);
fprintf(stderr, "\n");
fflush(stderr);
va_end(argscp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x430, %rsp            # imm = 0x430
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rax
movq %rax, 0x20(%rsp)
movups (%rsi), %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x21bcc
movq %rax, %r15
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x41743
movl 0x14(%r15), %eax
movl $0x3ff, %ecx            # imm = 0x3FF
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x8(%r15), %rdx
movslq %ecx, %r14
leaq 0x30(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rcx
callq 0x1fb32
cmpl $0x400, 0x14(%r15)      # imm = 0x400
jl 0x416e5
movw $0x5d, 0x2f(%rsp,%r14)
movl $0x2e2e2e5b, 0x2b(%rsp,%r14) # imm = 0x2E2E2E5B
leaq 0x8(%rsp), %rdi
callq 0x21c07
movq 0x718ba(%rip), %rax     # 0xb2fb0
movq (%rax), %rdi
leaq 0x3e6db(%rip), %rsi     # 0x7fddb
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x6a90
movq 0x718c5(%rip), %r14     # 0xb2fd8
movq (%r14), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x69e0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x6930
movq (%r14), %rdi
callq 0x6870
addq $0x430, %rsp            # imm = 0x430
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r12
pushq $0x1
popq %rbp
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %eax
movl %esi, %r13d
subl %eax, %r13d
jg 0x41793
addl %esi, %esi
movq %rbx, %rdi
callq 0x21c93
movl 0x10(%rbx), %r13d
movl 0x14(%rbx), %eax
subl %eax, %r13d
movslq %eax, %rdi
addq 0x8(%rbx), %rdi
movl %r13d, %esi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x4320d
testl %eax, %eax
js 0x417b7
cmpl %r13d, %eax
jl 0x417c6
movl 0x10(%rbx), %esi
addl %esi, %esi
movq %rbx, %rdi
callq 0x21c93
jmp 0x41760
addl %eax, 0x14(%rbx)
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: 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, 0x86baf(%rip)     # 0xc8585
je 0x419f1
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6810
leaq 0x43fe6(%rip), %r15     # 0x859de
leaq 0x43fd9(%rip), %r12     # 0x859d8
leaq 0x43fcd(%rip), %r13     # 0x859d3
leaq 0x43fc1(%rip), %rbp     # 0x859ce
movzbl (%r14), %eax
incq %r14
cmpl $0x22, %eax
je 0x41a48
cmpl $0x26, %eax
je 0x41a39
cmpl $0x3c, %eax
je 0x41a43
cmpl $0x3e, %eax
je 0x41a3e
testl %eax, %eax
je 0x41a55
movsbl %al, %edi
movq %rbx, %rsi
callq 0x6930
jmp 0x41a0d
movq %r12, %rdi
jmp 0x41a4b
movq %rbp, %rdi
jmp 0x41a4b
movq %r13, %rdi
jmp 0x41a4b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6810
jmp 0x41a0d
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: 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 0x41ab9
pushq %rbx
movq %rdi, %rbx
callq 0x62d0
movq %rax, %rdi
callq 0x28bb0
movq %rax, %rcx
movzbl (%rbx), %edx
cmpl $0x3c, %edx
je 0x41aa2
testl %edx, %edx
je 0x41ab7
movb %dl, (%rcx)
incq %rcx
jmp 0x41ab2
movzbl 0x1(%rbx), %edx
testl %edx, %edx
je 0x41ab7
incq %rbx
cmpl $0x3e, %edx
jne 0x41aa2
incq %rbx
jmp 0x41a8f
popq %rbx
retq
xorl %eax, %eax
retq