LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/bPlusTree.c
// Function: bptFileFindMaybeMulti
static boolean bptFileFindMaybeMulti(struct bptFile *bpt, void *key, int keySize, int valSize,
    boolean multi, void *singleVal, struct slRef **multiVal)
/* Do either a single or multiple find depending in multi parameter.  Only one of singleVal
 * or multiVal should be non-NULL, depending on the same parameter. */
{
/* Check key size vs. file key size, and act appropriately.  If need be copy key to a local
 * buffer and zero-extend it. */
if (keySize > bpt->keySize)
    return FALSE;
char keyBuf[bpt->keySize];
if (keySize != bpt->keySize)
    {
    memcpy(keyBuf, key, keySize);
    memset(keyBuf+keySize, 0, bpt->keySize - keySize);
    key = keyBuf;
    }

/* Make sure the valSize matches what's in file. */
if (valSize != bpt->valSize)
    errAbort("Value size mismatch between bptFileFind (valSize=%d) and %s (valSize=%d)",
    	valSize, bpt->fileName, bpt->valSize);

if (multi)
    {
    rFindMulti(bpt, bpt->rootOffset, key, multiVal);
    return *multiVal != NULL;
    }
else
    return rFind(bpt, bpt->rootOffset, key, singleVal);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movl 0x1c(%rdi), %ecx
xorl %eax, %eax
cmpl %edx, %ecx
jb 0x42ff7
movq %rdi, %r14
movq %r9, -0x40(%rbp)
movq %rsp, %r15
movq %rsp, %r12
addq $0xf, %rcx
andq $-0x10, %rcx
subq %rcx, %r12
movq %r12, %rsp
movl 0x1c(%rdi), %ebx
subl %edx, %ebx
jne 0x42f6d
movq %rsi, %r12
jmp 0x42f9b
movq %r15, -0x38(%rbp)
movslq %edx, %r15
movq %r12, %rdi
movq %r15, %rdx
movl %r8d, -0x2c(%rbp)
callq 0x6570
addq %r12, %r15
movq %r15, %rdi
movq -0x38(%rbp), %r15
xorl %esi, %esi
movq %rbx, %rdx
callq 0x63b0
movl -0x2c(%rbp), %r8d
movl 0x20(%r14), %ecx
cmpl %r13d, %ecx
je 0x42fbf
movq 0x8(%r14), %rdx
leaq 0x52643(%rip), %rdi     # 0x955f2
movl %r13d, %esi
xorl %eax, %eax
movl %r8d, %ebx
callq 0x26b6f
movl %ebx, %r8d
movq 0x38(%r14), %rsi
testl %r8d, %r8d
je 0x42fe5
movq 0x10(%rbp), %rbx
movq %r14, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x438d0
xorl %eax, %eax
cmpq $0x0, (%rbx)
setne %al
jmp 0x42ff4
movq %r14, %rdi
movq %r12, %rdx
movq -0x40(%rbp), %rcx
callq 0x43aca
movq %r15, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/bPlusTree.c
// Function: bptFileFindMultiple
struct slRef *bptFileFindMultiple(struct bptFile *bpt, void *key, int keySize, int valSize)
/* Find all values associated with key.  Store this in ->val item of returned list. 
 * Do a slRefFreeListAndVals() on list when done. */
{
struct slRef *list = NULL;
bptFileFindMaybeMulti(bpt, key, keySize, valSize, TRUE, NULL, &list);
slReverse(&list);
return list;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
movq %rbx, (%rsp)
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x42f25
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/bPlusTree.c
// Function: rTraverse
static void rTraverse(struct bptFile *bpt, bits64 blockStart, void *context, 
    void (*callback)(void *context, void *key, int keySize, void *val, int valSize) )
/* Recursively go across tree, calling callback at leaves. */
{
/* 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);

char keyBuf[bpt->keySize], valBuf[bpt->valSize];
if (isLeaf)
    {
    for (i=0; i<childCount; ++i)
        {
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	udcMustRead(bpt->udc, valBuf, bpt->valSize);
	callback(context, keyBuf, bpt->keySize, valBuf, bpt->valSize);
	}
    }
else
    {
    bits64 fileOffsets[childCount];
    /* Loop through to get file offsets of children. */
    for (i=0; i<childCount; ++i)
	{
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	fileOffsets[i] = udcReadBits64(bpt->udc, isSwapped);
	}
    /* Loop through recursing on child offsets. */
    for (i=0; i<childCount; ++i)
	rTraverse(bpt, fileOffsets[i], context, callback);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq %rdi, %r15
movq 0x10(%rdi), %rdi
callq 0x41ab5
movq 0x10(%r15), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x3fef4
movq 0x10(%r15), %rdi
leaq -0x2a(%rbp), %rsi
movl $0x1, %edx
callq 0x3fef4
movl 0x30(%r15), %r14d
movq 0x10(%r15), %rdi
movl %r14d, %esi
callq 0x41783
movl %eax, %r13d
movq %rsp, -0x50(%rbp)
movl 0x1c(%r15), %eax
movq %rsp, %r12
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movl 0x20(%r15), %eax
movq %rsp, %rbx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
leaq -0x29(%rbp), %rax
cmpb $0x0, (%rax)
je 0x43123
testw %r13w, %r13w
movq -0x38(%rbp), %r14
je 0x431a1
movq 0x10(%r15), %rdi
movl 0x1c(%r15), %edx
movq %r12, %rsi
callq 0x3fef4
movq 0x10(%r15), %rdi
movl 0x20(%r15), %edx
movq %rbx, %rsi
callq 0x3fef4
movl 0x1c(%r15), %edx
movl 0x20(%r15), %r8d
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq *-0x40(%rbp)
decw %r13w
jne 0x430e7
jmp 0x431a1
movl %r14d, %ebx
movq %rsp, -0x48(%rbp)
movzwl %r13w, %ecx
leal 0xf(,%rcx,8), %eax
andl $-0x10, %eax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
testw %r13w, %r13w
je 0x4319d
xorl %r13d, %r13d
movl %ebx, -0x30(%rbp)
movq 0x10(%r15), %rdi
movl 0x1c(%r15), %edx
movq %r12, %rsi
movq %rcx, %rbx
callq 0x3fef4
movq 0x10(%r15), %rdi
movl -0x30(%rbp), %esi
callq 0x4171e
movq %rbx, %rcx
movq %rax, (%r14,%r13,8)
incq %r13
cmpq %r13, %rbx
jne 0x4314d
xorl %r12d, %r12d
movq -0x38(%rbp), %r13
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
movq %r13, %rdx
movq -0x40(%rbp), %rcx
callq 0x43046
incq %r12
cmpq %r12, %rbx
jne 0x43182
movq -0x48(%rbp), %rsp
movq -0x50(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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 0x10(%rsp), %rax
movq %rdx, (%rax)
leaq 0xc(%rsp), %rbx
movl %ecx, (%rbx)
leaq 0x8(%rsp), %r13
movl %r9d, (%r13)
leaq 0x24(%rsp), %rsi
movl $0x78ca8c91, (%rsi)     # imm = 0x78CA8C91
leaq 0x20(%rsp), %r12
movl $0x0, (%r12)
movl $0x4, %edx
movq %r14, %rdi
callq 0x22e1e
movl $0x4, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22e1e
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x22e1e
leaq 0x68(%rsp), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x22e1e
movl $0x8, %edx
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x22e1e
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x22e1e
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x22e1e
movq %r14, %rdi
callq 0x6030
movq %rax, %r12
movl (%rbx), %ecx
leaq 0x10(%rsp), %rax
movl (%rax), %eax
movl $0x1, %ebx
cmpl %eax, %ecx
jge 0x432a2
leal -0x1(%rcx), %esi
movl $0x1, %ebx
addl %esi, %eax
cltd
idivl %ecx
incl %ebx
cmpl %ecx, %eax
jg 0x43297
cmpl $0x2, %ebx
jl 0x43311
incl %ebx
leal -0x2(%rbx), %r9d
movzwl 0xc(%rsp), %edi
movq 0x10(%rsp), %rcx
movl 0x8(%rsp), %eax
movl 0x68(%rsp), %r10d
movq %r15, %rsi
movl %ebp, %edx
movl %r12d, %r8d
pushq %r14
pushq %r10
pushq %rax
pushq 0x30(%rsp)
callq 0x4334d
addq $0x20, %rsp
movl %eax, %r13d
movq %r14, %rdi
callq 0x6030
movq %rax, %r12
movl %r13d, %eax
cmpq %rax, %r12
je 0x4330a
leaq 0x4a8c4(%rip), %rdi     # 0x8dbbb
leaq 0x52267(%rip), %rsi     # 0x95565
movl $0x23c, %edx            # imm = 0x23C
xorl %eax, %eax
callq 0x26b6f
decl %ebx
cmpl $0x2, %ebx
jg 0x432a9
movzwl 0xc(%rsp), %edi
movq 0x10(%rsp), %rcx
movl 0x8(%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 0x435ff
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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 0x4f3a0(%rip), %rsi     # 0x92b75
callq 0x22d5a
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 0x431b4
addq $0x20, %rsp
movq %rsp, %rdi
callq 0x23400
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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), %r12
leaq -0x29(%rbp), %r14
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x41ab5
movq 0x10(%rbx), %rdi
movl $0x1, %edx
movq %r14, %rsi
callq 0x3fef4
movb -0x29(%rbp), %r13b
testb %r13b, %r13b
jne 0x438b5
movq 0x10(%rbx), %rdi
movl $0x1, %edx
leaq -0x2a(%rbp), %rsi
callq 0x3fef4
movl 0x30(%rbx), %r12d
movq 0x10(%rbx), %rdi
movl %r12d, %esi
callq 0x41783
movq %rsp, %r15
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 0x3fef4
movq 0x10(%rbx), %rdi
movl %r12d, %esi
callq 0x4171e
movq %rax, %r12
movq %r15, %rsp
testb %r13b, %r13b
je 0x43838
movq %r12, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/cheapcgi.c
// Function: jsInlineF
void jsInlineF(char *format, ...)
/* Add javascript text to output file or memory structure */
{
jsInlineInit(); // init if needed
va_list args;
va_start(args, format);
dyStringVaPrintf(jsInlineLines, format, args);
va_end(args);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
testb %al, %al
je 0x43cef
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
cmpq $0x0, 0x80520(%rip)     # 0xc4230
jne 0x43d23
movl $0x400, %edi            # imm = 0x400
callq 0x261d0
movq %rax, 0x8050d(%rip)     # 0xc4230
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x804e1(%rip), %rdi     # 0xc4230
movq %rbx, %rsi
callq 0x26498
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x804d0(%rip)     # 0xc4238
je 0x43d78
leaq 0x51a2e(%rip), %rdi     # 0x9579f
xorl %eax, %eax
callq 0x268ca
cmpq $0x0, 0x804b0(%rip)     # 0xc4230
jne 0x43d93
movl $0x400, %edi            # imm = 0x400
callq 0x261d0
movq %rax, 0x8049d(%rip)     # 0xc4230
xorl %eax, %eax
callq 0x48a8a
movq 0x8048f(%rip), %rcx     # 0xc4230
movq 0x8(%rcx), %rdx
leaq 0x51a14(%rip), %rdi     # 0x957c0
movq %rax, %rsi
xorl %eax, %eax
callq 0x6070
movq 0x80473(%rip), %rax     # 0xc4230
movl $0x0, 0x14(%rax)
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movl $0x1, 0x80463(%rip)     # 0xc4238
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/cheapcgi.c
// Function: findJsEvent
boolean findJsEvent(char *event)
/* see if it is in the list */
{
int i = 0;
while (TRUE)
    {
    const char *w = jsEvents[i];
    if (sameString(w, event))
	return TRUE;
    if (sameString(w, ""))
	return FALSE;
    ++i;
    }
return FALSE; // should never get here
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x7aa59(%rip), %r12     # 0xbe850
movslq %r15d, %rax
movq (%r12,%rax,8), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6a50
xorl %ecx, %ecx
testl %eax, %eax
je 0x43e1c
cmpb $0x0, (%r14)
je 0x43e23
incl %r15d
movb $0x1, %cl
jmp 0x43e25
movl $0x1, %ebp
jmp 0x43e25
xorl %ebp, %ebp
testb %cl, %cl
jne 0x43df7
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1f9f6
movq %rax, %rbx
movq %rax, %rdi
callq 0x21fb5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a50
testl %eax, %eax
je 0x43e6b
leaq 0x51c50(%rip), %rdi     # 0x95ab1
movq %r14, %rsi
xorl %eax, %eax
callq 0x268ca
movq %rbx, %rdi
callq 0x43de2
testl %eax, %eax
jne 0x43e88
leaq 0x51c6f(%rip), %rdi     # 0x95aed
movq %rbx, %rsi
xorl %eax, %eax
callq 0x268ca
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2dd41
// File: /workspace/github_c_makefile_star2_O1/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 0x43f2c
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 0x43e34
leaq 0x51c39(%rip), %rdi     # 0x95b71
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x43ca9
movq %rsp, %rdx
movq %r12, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rdx)
movq 0x802c4(%rip), %rdi     # 0xc4230
movq %rbx, %rsi
callq 0x26498
leaq 0x52e45(%rip), %rdi     # 0x96dc0
xorl %eax, %eax
callq 0x43ca9
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x51bc6(%rip), %rdi     # 0x95c00
callq 0x68f0
testq %rax, %rax
leaq 0x51bc3(%rip), %rdi     # 0x95c0c
cmovneq %rax, %rdi
callq 0x1f9f6
movq %rsp, %rbx
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2852a
movl $0x200, %edi            # imm = 0x200
callq 0x2dc95
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
movq %rbx, %rdx
callq 0x21264
movq %r14, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x20, %edi
callq 0x2dc95
movq %rax, %r14
movq %rbx, %rdi
callq 0x1f9f6
movq %rax, 0x8(%r14)
leaq 0x10(%r14), %rsi
leaq 0x18(%r14), %rdx
movq %rax, %rdi
callq 0x44640
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x447b8
movq %rdi, %rbx
leaq 0x18(%r14), %rdi
callq 0x1fcd6
leaq 0x10(%r14), %rdi
callq 0x29565
addq $0x8, %r14
movq %r14, %rdi
callq 0x2dd51
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2dd51
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiDictionaryFreeList
void cgiDictionaryFreeList(struct cgiDictionary **pList)
/* Free up a whole list of cgiDictionaries */
{
struct cgiDictionary *el, *next;

for (el = *pList; el != NULL; el = next)
    {
    next = el->next;
    cgiDictionaryFree(&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 0x447f3
leaq 0x8(%rsp), %r14
movq (%r15), %r15
movq %r14, %rdi
callq 0x4477c
movq %r15, 0x8(%rsp)
testq %r15, %r15
jne 0x447de
movq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x448bf
cmpb $0x0, (%r15)
je 0x448bf
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %r15, %rdi
movl $0x3d, %esi
callq 0x6270
movq %rax, %r13
movq %rax, %rbp
testq %rax, %rax
jne 0x44859
leaq 0x51487(%rip), %rdi     # 0x95cd6
movq %r15, %rsi
xorl %eax, %eax
callq 0x26b6f
incq %r13
movb $0x0, (%rbp)
movq %r13, %rdi
movl $0x26, %esi
callq 0x6270
testq %rax, %rax
jne 0x4487f
movq %r13, %rdi
movl $0x3b, %esi
callq 0x6270
testq %rax, %rax
je 0x44891
leaq 0x1(%rax), %rcx
movq %rcx, (%r12)
movb $0x0, (%rax)
jmp 0x448a4
movq %r13, %rdi
callq 0x62d0
addq %r13, %rax
movq $0x0, (%r12)
movq %r15, (%r14)
movq %r13, (%rbx)
subl %r13d, %eax
movq %r13, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x448ce
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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 $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x62d0
movq %rax, %r12
movq %r15, %rdi
callq 0x62d0
addl %eax, %r12d
movl %r12d, %edi
callq 0x261d0
movq %rax, (%rsp)
movq %rbx, %rdi
callq 0x44a76
movq %rax, 0x10(%rsp)
movq 0x10(%rax), %rbp
testq %rbp, %rbp
je 0x44a41
movq %rbx, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x8(%rbp), %r12
movq 0x10(%rbp), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x6a50
testl %eax, %eax
movl $0x1, %eax
cmovel %eax, %ebx
cmoveq %r15, %r13
movq (%rsp), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x44ac1
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x449ff
testl %ebx, %ebx
movq 0x8(%rsp), %rbx
jne 0x44a55
leaq 0x512aa(%rip), %rdi     # 0x95cf2
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x26b6f
leaq 0x10(%rsp), %rdi
callq 0x44b2b
movq %rsp, %rdi
callq 0x2622c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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 0x44d13
movl %edx, %ebp
movq %rdi, %r14
leaq 0x5106e(%rip), %r15     # 0x95d34
leaq 0x4(%rsp), %r12
xorl %r13d, %r13d
leaq 0x1(%r14), %rdi
movb (%r14), %al
cmpb $0x25, %al
jne 0x44d03
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x66d0
cmpl $0x1, %eax
je 0x44cf3
movl $0x3f, 0x4(%rsp)
addq $0x3, %r14
addl $0x2, %r13d
movb 0x4(%rsp), %al
movb %al, (%rbx)
jmp 0x44d08
movb %al, (%rbx)
movq %rdi, %r14
incq %rbx
incl %r13d
cmpl %ebp, %r13d
jl 0x44cce
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/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 0x50a8d(%rip), %rdi     # 0x95e4e
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
je 0x453e1
leaq 0x50aa9(%rip), %rdi     # 0x95e80
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O1/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 0x50a4a(%rip), %rdi     # 0x95e4e
movq %r14, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x45427
leaq 0x50a63(%rip), %rdi     # 0x95e80
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
callq 0x6a40
leaq 0x504b5(%rip), %r15     # 0x958ed
movq %r15, %rdi
callq 0x43e34
leaq 0x506cc(%rip), %rdi     # 0x95b13
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x43ca9
// File: /workspace/github_c_makefile_star2_O1/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 0x509d5(%rip), %rdi     # 0x95f82
movq %rdx, %rsi
xorl %eax, %eax
callq 0x6070
testl %ebx, %ebx
je 0x455c9
leaq 0x509ef(%rip), %rdi     # 0x95fb1
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
popq %rbx
jmp 0x6a40
// File: /workspace/github_c_makefile_star2_O1/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 0x509b7(%rip), %rdx     # 0x95fba
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x23c18
leaq 0x48dce(%rip), %rsi     # 0x8e3f2
leaq 0x5110e(%rip), %r15     # 0x96739
movq %r12, %rdi
movq %r15, %rdx
callq 0x21d64
movq %rax, %r14
leaq 0x4b248(%rip), %rsi     # 0x90888
movq %rax, %rdi
movq %r15, %rdx
callq 0x21d64
movq %rax, %r12
movq %r14, %rdi
callq 0x2dd41
leaq 0x50925(%rip), %rdi     # 0x95f82
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x6070
testl %ebp, %ebp
je 0x4567f
leaq 0x50939(%rip), %rdi     # 0x95fb1
xorl %eax, %eax
callq 0x6070
leaq 0x5093a(%rip), %rdi     # 0x95fc0
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6070
movl $0x3e, %edi
callq 0x6a40
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x43e34
leaq 0x50463(%rip), %rdi     # 0x95b13
movq %r12, %rsi
movq %rbx, %rdx
movq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x43ca9
movq %r12, %rdi
callq 0x2dd41
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x527c3(%rip), %r15     # 0x98360
cmovneq %rsi, %r15
testl %edx, %edx
jne 0x45bb0
movq %r15, %rdi
callq 0x62d0
movq %rax, %rdx
testl %edx, %edx
movl $0x8, %ecx
cmovnel %edx, %ecx
leaq 0x504ad(%rip), %rdi     # 0x9606e
movq %r14, %rsi
movq %r14, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x49a9b
testq %rbx, %rbx
je 0x45c01
cmpb $0x0, (%rbx)
je 0x45c01
leaq 0x4fd99(%rip), %r15     # 0x9597b
movq %r15, %rdi
callq 0x43e34
leaq 0x4ff22(%rip), %rdi     # 0x95b13
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x43ca9
leaq 0x501d2(%rip), %rdi     # 0x95dda
popq %rbx
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O1/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 0x5272c(%rip), %r12     # 0x98360
cmovneq %rsi, %r12
testl %edx, %edx
jne 0x45c49
movq %r12, %rdi
callq 0x62d0
addl %eax, %eax
leal (%rax,%rax,4), %edx
testl %edx, %edx
movl $0x64, %ecx
cmovnel %edx, %ecx
leaq 0x5045c(%rip), %rdi     # 0x960b6
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0x49a9b
testq %r14, %r14
je 0x45c99
movq %r14, %rdi
callq 0x43e34
leaq 0x4fe95(%rip), %rdi     # 0x95b13
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x43ca9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x45d6c
testq %r14, %r14
je 0x45d24
movq %r14, %rdi
callq 0x62d0
addl %eax, %eax
leal (%rax,%rax,4), %ecx
jmp 0x45d6c
movl %ebp, %eax
testq %r15, %r15
je 0x45d33
movq %r15, %rdi
callq 0x6bd0
leal 0x3f1(%rax), %edx
movl $0xa, %ecx
cmpl $0x13, %edx
jb 0x45d6c
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 0x45d48
cmpl $0x42, %ecx
movl $0x41, %eax
cmovgel %ecx, %eax
leaq 0x503d4(%rip), %rdi     # 0x96152
movq %r12, %rsi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
leaq 0x50429(%rip), %rax     # 0x961c3
cmoveq %rax, %r15
testq %r14, %r14
cmoveq %rax, %r14
leaq 0x4fc7c(%rip), %rdi     # 0x95a28
leaq 0x503f0(%rip), %rdx     # 0x961a3
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x43ec6
testq %rbx, %rbx
je 0x45dd9
leaq 0x500b1(%rip), %rdi     # 0x95e80
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4fffa(%rip), %rdi     # 0x95dda
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O1/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 0x45fa3
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 0x50242(%rip), %rdi     # 0x961f7
movq %r15, %rsi
movq %r15, %rdx
movb $0x1, %al
callq 0x6070
testq %r14, %r14
leaq 0x501f7(%rip), %r8      # 0x961c3
cmoveq %r8, %r14
testq %r12, %r12
cmovneq %r12, %r8
leaq 0x4fa4a(%rip), %rdi     # 0x95a28
leaq 0x50263(%rip), %rdx     # 0x96248
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x43ec6
testq %rbx, %rbx
je 0x46008
leaq 0x4fe82(%rip), %rdi     # 0x95e80
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4fdcb(%rip), %rdi     # 0x95dda
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O1/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 0x461c8
movq (%r14), %r8
movq %r8, 0x10(%rsp)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x50087(%rip), %rdi     # 0x9626a
xorl %eax, %eax
callq 0x6070
testq %r15, %r15
je 0x46200
leaq 0x50182(%rip), %rdi     # 0x96378
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
cmoveq %rbp, %r15
testq %rbp, %rbp
cmovneq %rbp, %r15
testq %r15, %r15
je 0x46224
leaq 0x4fde6(%rip), %rdi     # 0x96000
movq %r15, %rsi
xorl %eax, %eax
callq 0x6070
testq %r13, %r13
je 0x4623a
leaq 0x4fd90(%rip), %rdi     # 0x95fc0
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %rbx, %rbx
je 0x46271
leaq 0x4f8cd(%rip), %r13     # 0x95b13
movq 0x8(%rbx), %rbp
movq 0x10(%rbx), %r12
movq %rbp, %rdi
callq 0x43e34
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x43ca9
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x46246
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x46289
leaq 0x4fff0(%rip), %rdi     # 0x96272
xorl %eax, %eax
callq 0x6070
leaq 0x4fb4a(%rip), %rdi     # 0x95dda
callq 0x6bb0
movl 0x4(%rsp), %eax
testl %eax, %eax
movq 0x10(%rsp), %r12
jle 0x462e6
movl %eax, %ebx
leaq 0x520b5(%rip), %r13     # 0x98360
leaq 0x4ffd6(%rip), %r15     # 0x96288
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rdi
movq %r12, %rsi
callq 0x2054a
testl %eax, %eax
movq %r13, %rsi
leaq 0x4ffb2(%rip), %rax     # 0x9627e
cmoveq %rax, %rsi
movq (%r14,%rbp,8), %rdx
movq %r15, %rdi
xorl %eax, %eax
callq 0x6070
incq %rbp
cmpq %rbp, %rbx
jne 0x462b4
leaq 0x50649(%rip), %rdi     # 0x96936
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O1/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 0x4661a
movq (%rsi), %r8
movq %r8, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %r12
leaq 0x4fd3c(%rip), %rdi     # 0x96371
movq %rbp, %rsi
xorl %eax, %eax
callq 0x6070
testq %r13, %r13
je 0x46655
leaq 0x4f975(%rip), %rdi     # 0x95fc0
movq %r13, %rsi
xorl %eax, %eax
callq 0x6070
testq %r12, %r12
je 0x4668a
leaq 0x4f99f(%rip), %rdi     # 0x96000
movq %rbp, %rsi
xorl %eax, %eax
callq 0x6070
movq %r15, %rdi
callq 0x43e34
leaq 0x4f499(%rip), %rdi     # 0x95b13
movq %rbp, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x43ca9
testq %rbx, %rbx
je 0x466a0
leaq 0x4fbdc(%rip), %rdi     # 0x96272
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6070
leaq 0x4f733(%rip), %rdi     # 0x95dda
callq 0x6bb0
movl 0x4(%rsp), %eax
testl %eax, %eax
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %r15
jle 0x46704
movl %eax, %r13d
leaq 0x4fcbb(%rip), %r12     # 0x96383
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
movq %rbp, %rsi
callq 0x2054a
testl %eax, %eax
leaq 0x51c81(%rip), %rsi     # 0x98360
leaq 0x4fb98(%rip), %rax     # 0x9627e
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 0x466ca
leaq 0x5022b(%rip), %rdi     # 0x96936
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb0
// File: /workspace/github_c_makefile_star2_O1/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 0x471e4
leaq 0x8(%rsp), %r14
movq (%r15), %r15
movq %r14, %rdi
callq 0x44b2b
movq %r15, 0x8(%rsp)
testq %r15, %r15
jne 0x471cf
movq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x293e9
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
leaq -0x1de9c(%rip), %rsi    # 0x29379
movq %r14, %rdi
callq 0x1fd04
movq $0x0, (%rsp)
movq (%r14), %r15
testq %r15, %r15
je 0x47286
xorl %eax, %eax
movq %rsp, %r14
testb $0x1, %al
je 0x47243
movq %rbx, %rdi
movl $0x26, %esi
callq 0x2635f
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x26425
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x2635f
movq 0x10(%r15), %rdi
callq 0x44d25
movq %rax, (%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x26425
movq %r14, %rdi
callq 0x2dd51
movq (%r15), %r15
movb $0x1, %al
testq %r15, %r15
jne 0x47232
leaq 0x8(%rsp), %rdi
callq 0x29450
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x792cb(%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 0x1f9f6
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/hex.c
// Function: hexToByte
unsigned char hexToByte(char *hex)
/* convert hexidecimal characters to unsigned char. */
{
unsigned char n = hexToNibble(*hex++);
n <<= 4;
n += hexToNibble(*hex++);
return n;
}

// Assembly:
movb (%rdi), %al
movb 0x1(%rdi), %cl
xorl %edx, %edx
cmpb $0x3a, %al
setge %dl
leal (%rdx,%rdx,8), %edx
addb %al, %dl
shlb $0x4, %dl
cmpb $0x3a, %cl
movl $0xd0, %esi
movl $0xa9, %eax
cmovll %esi, %eax
addb %cl, %al
addb %dl, %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x47a86
testl %esi, %esi
jle 0x47a81
incl %esi
leaq 0x79257(%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
jg 0x47a59
movb $0x0, (%rdx)
popq %rax
retq
leaq 0x4eeb3(%rip), %rdi     # 0x96940
leaq 0x4eec5(%rip), %rsi     # 0x96959
leaq 0x4eec8(%rip), %rcx     # 0x96963
movl $0x3c, %edx
callq 0x6460
nopl (%rax)