LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: bptFileAttach
struct bptFile *bptFileAttach(char *fileName, struct udcFile *udc)
/* Open up index file on previously open file, with header at current file position. */
{
/* Open file and allocate structure to hold info from header etc. */
struct bptFile *bpt = needMem(sizeof(*bpt));
bpt->fileName = fileName;
bpt->udc = udc;

/* Read magic number at head of file and use it to see if we are proper file type, and
 * see if we are byte-swapped. */
bits32 magic;
boolean isSwapped = FALSE;
udcMustReadOne(udc, magic);
if (magic != bptSig)
    {
    magic = byteSwap32(magic);
    isSwapped = bpt->isSwapped = TRUE;
    if (magic != bptSig)
       errAbort("%s is not a bpt b-plus tree index file", fileName);
    }

/* Read rest of defined bits of header, byte swapping as needed. */
bpt->blockSize = udcReadBits32(udc, isSwapped);
bpt->keySize = udcReadBits32(udc, isSwapped);
bpt->valSize = udcReadBits32(udc, isSwapped);
bpt->itemCount = udcReadBits64(udc, isSwapped);

/* Skip over reserved bits of header. */
bits32 reserved32;
udcMustReadOne(udc, reserved32);
udcMustReadOne(udc, reserved32);

/* Save position of root block of b+ tree. */
bpt->rootOffset = udcTell(udc);

return bpt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x40, %edi
callq 0x40c50
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl $0x4, %edx
callq 0x5c730
cmpl $0x78ca8c91, -0x1c(%rbp) # imm = 0x78CA8C91
je 0x60f92
movl -0x1c(%rbp), %edi
callq 0x30770
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl $0x1, 0x30(%rax)
movl $0x1, -0x20(%rbp)
cmpl $0x78ca8c91, -0x1c(%rbp) # imm = 0x78CA8C91
je 0x60f90
movq -0x8(%rbp), %rsi
leaq 0x7e4c9(%rip), %rdi     # 0xdf452
movb $0x0, %al
callq 0x35d40
jmp 0x60f92
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x5e5b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x5e5b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x5e5b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x5e570
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
callq 0x5c730
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
callq 0x5c730
movq -0x10(%rbp), %rdi
callq 0x5eaa0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: bptFileClose
void bptFileClose(struct bptFile **pBpt)
/* Close down and deallocate index file. */
{
struct bptFile *bpt = *pBpt;
if (bpt != NULL)
    {
    udcFileClose(&bpt->udc);
    freeMem(bpt->fileName);
    bptFileDetach(pBpt);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x610e1
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x5d870
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x40d40
movq -0x8(%rbp), %rdi
callq 0x61030
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: bptDataOffset
static bits64 bptDataOffset(struct bptFile *bpt, bits64 itemPos)
/* Return position of file of data corresponding to given itemPos.  For first piece of
 * data pass in 0. */
{
if (itemPos >= bpt->itemCount)
    errAbort("Item index %lld greater than item count %lld in %s", 
	itemPos, bpt->itemCount, bpt->fileName);
bits64 blockPos = itemPos/bpt->blockSize;
bits32 insidePos = itemPos - blockPos*bpt->blockSize;
int blockHeaderSize = 4;
bits64 itemByteSize = bpt->valSize + bpt->keySize;
bits64 blockByteSize = bpt->blockSize * itemByteSize + blockHeaderSize;
bits64 blockOffset = blockByteSize*blockPos + bptDataStart(bpt);
bits64 itemOffset = blockOffset + blockHeaderSize + itemByteSize * insidePos;
return itemOffset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jb 0x61190
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x7e367(%rip), %rdi     # 0xdf4f0
movb $0x0, %al
callq 0x35d40
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x18(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rdx
movl 0x18(%rdx), %edx
imulq %rdx, %rcx
subq %rcx, %rax
movl %eax, -0x1c(%rbp)
movl $0x4, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
addl 0x1c(%rcx), %eax
movl %eax, %eax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
imulq -0x28(%rbp), %rax
movslq -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
imulq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x61f30
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jbe 0x6133a
movl $0x0, -0x4(%rbp)
jmp 0x6143a
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x50(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
je 0x613a9
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x6570
movq -0x50(%rbp), %rdi
movslq -0x1c(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x63a0
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
je 0x613d5
movl -0x20(%rbp), %esi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
leaq 0x7e155(%rip), %rdi     # 0xdf523
movb $0x0, %al
callq 0x35d40
cmpl $0x0, -0x24(%rbp)
je 0x61410
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x18(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x62010
movq 0x10(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x44(%rbp)
jmp 0x61433
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x622d0
movl %eax, -0x4(%rbp)
movl $0x1, -0x44(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
leaq -0x20(%rbp), %rax
movq %rax, (%rsp)
callq 0x61300
leaq -0x20(%rbp), %rdi
callq 0x2aad0
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: bptCountLevels
static int bptCountLevels(int maxBlockSize, int itemCount)
/* Count up number of levels needed in tree of given maximum block size. */
{
int levels = 1;
while (itemCount > maxBlockSize)
    {
    itemCount = (itemCount + maxBlockSize - 1)  / maxBlockSize;
    levels += 1;
    }
return levels;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jle 0x61904
movl -0x8(%rbp), %eax
addl -0x4(%rbp), %eax
subl $0x1, %eax
cltd
idivl -0x4(%rbp)
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x618e1
movl -0xc(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq 0x20(%rbp), %rdi
leaq 0x7ab41(%rip), %rsi     # 0xdca15
callq 0x2f780
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %r8
movl -0x2c(%rbp), %r9d
movq 0x10(%rbp), %r11
movl 0x18(%rbp), %r10d
movq -0x38(%rbp), %rax
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x61710
leaq -0x38(%rbp), %rdi
callq 0x301d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x5ea30
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x11(%rbp), %rsi
movl $0x1, %edx
callq 0x5c730
cmpb $0x0, -0x11(%rbp)
je 0x61f7a
jmp 0x62006
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x12(%rbp), %rsi
movl $0x1, %edx
callq 0x5c730
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %esi
callq 0x5e5f0
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rsi
subq %rcx, %rsi
movq %rsi, %rsp
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %esi
callq 0x5e570
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rsp
jmp 0x61f48
movq -0x10(%rbp), %rax
movq %rbp, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: xToY
static long xToY(int x, unsigned y)
/* Return x to the Y power, with y usually small. */
{
long i, val = 1;
for (i=0; i<y; ++i)
    val *= x;
return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq $0x1, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
cmpq %rcx, %rax
jge 0x62521
movslq -0x4(%rbp), %rax
imulq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x624fa
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
cmpl $0x0, 0xa803d(%rip)     # 0x10a678
je 0x6264b
leaq 0x7d0c8(%rip), %rdi     # 0xdf70c
movb $0x0, %al
callq 0x358e0
callq 0x62530
movb $0x0, %al
callq 0x69d20
movq %rax, %rsi
movq 0xa800f(%rip), %rax     # 0x10a670
movq 0x8(%rax), %rdx
leaq 0x7d0c1(%rip), %rdi     # 0xdf72d
movb $0x0, %al
callq 0x6070
movq 0xa7ff6(%rip), %rax     # 0x10a670
movl $0x0, 0x14(%rax)
movq 0xa7fe8(%rip), %rax     # 0x10a670
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movl $0x1, 0xa7fdf(%rip)     # 0x10a678
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0xa2322(%rip), %rax     # 0x1049f0
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6a40
cmpl $0x0, %eax
jne 0x626f1
movl $0x1, -0x4(%rbp)
jmp 0x6271a
movq -0x20(%rbp), %rdi
leaq 0x82d0a(%rip), %rsi     # 0xe5406
callq 0x6a40
cmpl $0x0, %eax
jne 0x6270f
movl $0x0, -0x4(%rbp)
jmp 0x6271a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x626c3
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a450
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e1c0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x6a40
cmpl $0x0, %eax
je 0x62776
movq -0x8(%rbp), %rsi
leaq 0x7d2af(%rip), %rdi     # 0xdfa1e
movb $0x0, %al
callq 0x358e0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x626b0
cmpl $0x0, %eax
jne 0x6279e
movq -0x8(%rbp), %rsi
leaq 0x7d2c3(%rip), %rdi     # 0xdfa5a
movb $0x0, %al
callq 0x358e0
movq -0x8(%rbp), %rdi
callq 0x40d40
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0x62828
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62730
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
leaq 0x7d27d(%rip), %rdi     # 0xdfade
xorl %eax, %eax
movb %al, -0xe1(%rbp)
callq 0x62590
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x18, -0x30(%rbp)
movq 0xa7dda(%rip), %rdi     # 0x10a670
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x35460
movb -0xe1(%rbp), %al
leaq 0x7e4e9(%rip), %rdi     # 0xe0d99
callq 0x62590
addq $0xf0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiScriptName
char *cgiScriptName()
/* Return name of script so libs can do context-sensitive stuff. */
{
char *scriptName = getenv("SCRIPT_NAME");
if (scriptName == NULL)
    scriptName = "cgiSpoofedScript";
return scriptName;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x7d1ae(%rip), %rdi     # 0xdfb6d
callq 0x68d0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x629da
leaq 0x7d1a3(%rip), %rax     # 0xdfb79
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
callq 0x629b0
movq %rax, %rdi
callq 0x2a450
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x385d0
movl $0x200, %edi            # imm = 0x200
callq 0x40c50
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rdi
leaq -0x210(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x2caf0
movq -0x218(%rbp), %rax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x20, %edi
callq 0x40c50
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movq -0x10(%rbp), %rdx
addq $0x18, %rdx
callq 0x632d0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x634de
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x2ab30
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x3a080
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x40d70
movq -0x8(%rbp), %rdi
callq 0x40d70
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6352c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x63490
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x63507
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x63572
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x6357e
movl $0x0, -0x4(%rbp)
jmp 0x63666
movq -0x28(%rbp), %rdi
movl $0x3d, %esi
callq 0x6260
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x635a9
movq -0x28(%rbp), %rsi
leaq 0x7c6a1(%rip), %rdi     # 0xdfc43
movb $0x0, %al
callq 0x35d40
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movb $0x0, (%rax)
movq -0x30(%rbp), %rdi
movl $0x26, %esi
callq 0x6260
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x635e6
movq -0x30(%rbp), %rdi
movl $0x3b, %esi
callq 0x6260
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x63619
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
jmp 0x6362f
movq -0x38(%rbp), %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x63670
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62c0
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
movl %eax, %edi
callq 0x35020
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x63900
movq %rax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x638c9
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x6a40
cmpl $0x0, %eax
jne 0x638a7
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x1, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x63970
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6386f
cmpl $0x0, -0x34(%rbp)
jne 0x638e5
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
leaq 0x7c381(%rip), %rdi     # 0xdfc5f
movb $0x0, %al
callq 0x35d40
leaq -0x28(%rbp), %rdi
callq 0x639e0
leaq -0x20(%rbp), %rdi
callq 0x350c0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x63e76
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
cmpl $0x25, %eax
jne 0x63e52
movq -0x8(%rbp), %rdi
leaq 0x7be93(%rip), %rsi     # 0xdfca1
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x66d0
cmpl $0x1, %eax
je 0x63e25
movl $0x3f, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x63e66
movb -0x15(%rbp), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x63e68
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x63dda
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeClearButton
void cgiMakeClearButton(char *form, char *field)
/* Make button to clear a text field. */
{
char id[256];
safef(id, sizeof id, "%s_clickBut", form);
char javascript[1024];
safef(javascript, sizeof(javascript),
    "document.%s.%s.value = ''; document.%s.submit();", form, field, form);
cgiMakeOnClickButton(id, javascript, " Clear  ");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x7b61f(%rip), %rdx     # 0xdfd49
movb $0x0, %al
callq 0x31090
leaq -0x510(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movq -0x8(%rbp), %r9
movl $0x400, %esi            # imm = 0x400
leaq 0x7b605(%rip), %rdx     # 0xdfd55
movb $0x0, %al
callq 0x31090
leaq -0x110(%rbp), %rdi
leaq -0x510(%rbp), %rsi
leaq 0x7b61a(%rip), %rdx     # 0xdfd86
callq 0x64780
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/cheapcgi.c
// Function: cgiMakeClearButtonNoSubmit
void cgiMakeClearButtonNoSubmit(char *form, char *field)
/* Make button to clear a text field, without resubmitting the form. */
{
char id[256];
safef(id, sizeof id, "%s_clear", field);
char javascript[1024];
safef(javascript, sizeof javascript,
        "document.%s.%s.value = '';", form, field);
cgiMakeOnClickButton(id, javascript, " Clear ");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x7b595(%rip), %rdx     # 0xdfd8f
movb $0x0, %al
callq 0x31090
leaq -0x510(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x400, %esi            # imm = 0x400
leaq 0x7b57c(%rip), %rdx     # 0xdfd98
movb $0x0, %al
callq 0x31090
leaq -0x110(%rbp), %rdi
leaq -0x510(%rbp), %rsi
leaq 0x7b57b(%rip), %rdx     # 0xdfdb3
callq 0x64780
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0x7b544(%rip), %rdi     # 0xdfdbb
movb $0x0, %al
callq 0x6070
cmpq $0x0, -0x18(%rbp)
je 0x64897
movq -0x18(%rbp), %rsi
leaq 0x7b55d(%rip), %rdi     # 0xdfded
movb $0x0, %al
callq 0x6070
leaq 0x7b4a9(%rip), %rdi     # 0xdfd47
movb $0x0, %al
callq 0x6070
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0x7b4e0(%rip), %rdi     # 0xdfdbb
movb $0x0, %al
callq 0x6070
cmpq $0x0, -0x18(%rbp)
je 0x648fb
movq -0x18(%rbp), %rsi
leaq 0x7b4f9(%rip), %rdi     # 0xdfded
movb $0x0, %al
callq 0x6070
leaq 0x7b445(%rip), %rdi     # 0xdfd47
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x7af42(%rip), %rdi     # 0xdf85a
callq 0x627b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0x7b309(%rip), %rdi     # 0xdff0f
movb $0x0, %al
callq 0x6070
cmpl $0x0, -0x14(%rbp)
je 0x64c21
leaq 0x7b324(%rip), %rdi     # 0xdff3e
movb $0x0, %al
callq 0x6070
leaq 0x7b11f(%rip), %rdi     # 0xdfd47
movb $0x0, %al
callq 0x6070
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x130(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0x100, %esi            # imm = 0x100
leaq 0x7b2ca(%rip), %rdx     # 0xdff47
movb $0x0, %al
callq 0x31090
leaq -0x130(%rbp), %rdi
leaq 0x73698(%rip), %rsi     # 0xd832a
leaq 0x7ba2d(%rip), %rdx     # 0xe06c6
callq 0x2de30
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
leaq 0x75a4d(%rip), %rsi     # 0xda700
leaq 0x7ba0c(%rip), %rdx     # 0xe06c6
callq 0x2de30
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rdi
callq 0x40d40
movq -0x8(%rbp), %rsi
movq -0x140(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0x7b227(%rip), %rdi     # 0xdff0f
movb $0x0, %al
callq 0x6070
cmpl $0x0, -0x14(%rbp)
je 0x64d03
leaq 0x7b242(%rip), %rdi     # 0xdff3e
movb $0x0, %al
callq 0x6070
movq -0x20(%rbp), %rsi
leaq 0x7b23f(%rip), %rdi     # 0xdff4d
movb $0x0, %al
callq 0x6070
leaq 0x7b02b(%rip), %rdi     # 0xdfd47
movb $0x0, %al
callq 0x6070
movq -0x28(%rbp), %rdi
movq -0x140(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x627b0
movq -0x140(%rbp), %rdi
callq 0x40d40
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x65489
leaq 0x7ff81(%rip), %rax     # 0xe5406
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x6549b
movq -0x10(%rbp), %rdi
callq 0x62c0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x654a8
movl $0x8, -0x14(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %r8
leaq 0x7ab3d(%rip), %rdi     # 0xdfffb
movb $0x0, %al
callq 0x6b100
cmpq $0x0, -0x20(%rbp)
je 0x654ec
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x654ec
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x7a401(%rip), %rdi     # 0xdf8e8
callq 0x627b0
leaq 0x7bea8(%rip), %rdi     # 0xe139b
movb $0x0, %al
callq 0x6070
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x6555d
leaq 0x7fead(%rip), %rax     # 0xe5406
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x65573
movq -0x10(%rbp), %rdi
callq 0x62c0
imulq $0xa, %rax, %rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x65580
movl $0x64, -0x14(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %r8
leaq 0x7aaad(%rip), %rdi     # 0xe0043
movb $0x0, %al
callq 0x6b100
cmpq $0x0, -0x20(%rbp)
je 0x655b5
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x627b0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x656f9
cmpq $0x0, -0x30(%rbp)
je 0x656ad
movq -0x30(%rbp), %rdi
callq 0x62c0
imulq $0xa, %rax, %rax
movl %eax, -0x1c(%rbp)
jmp 0x656f7
movl -0xc(%rbp), %eax
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x656d0
movq -0x28(%rbp), %rdi
callq 0x6bd0
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, -0x34(%rbp)
movl $0xa, -0x1c(%rbp)
movl -0x34(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x656f5
movl -0x1c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x1c(%rbp)
jmp 0x656d7
jmp 0x656f7
jmp 0x656f9
cmpl $0x41, -0x1c(%rbp)
jge 0x65706
movl $0x41, -0x1c(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl -0xc(%rbp), %r8d
leaq 0x7a9c3(%rip), %rdi     # 0xe00df
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6573c
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x65749
leaq 0x7aa0d(%rip), %rax     # 0xe0150
movq %rax, -0x48(%rbp)
jmp 0x65749
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x65762
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x6576f
leaq 0x7a9e7(%rip), %rax     # 0xe0150
movq %rax, -0x58(%rbp)
jmp 0x6576f
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %r8
leaq 0x7a213(%rip), %rdi     # 0xdf995
leaq 0x7a9a7(%rip), %rdx     # 0xe0130
movb $0x0, %al
callq 0x627f0
cmpq $0x0, -0x18(%rbp)
je 0x657a9
movq -0x18(%rbp), %rsi
leaq 0x7a64b(%rip), %rdi     # 0xdfded
movb $0x0, %al
callq 0x6070
leaq 0x7bbeb(%rip), %rdi     # 0xe139b
movb $0x0, %al
callq 0x6070
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x659df
cmpq $0x0, -0x30(%rbp)
je 0x659dd
movq -0x30(%rbp), %rdi
callq 0x62c0
imulq $0xa, %rax, %rax
movl %eax, -0x1c(%rbp)
jmp 0x659df
cmpl $0x41, -0x1c(%rbp)
jge 0x659ec
movl $0x41, -0x1c(%rbp)
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movsd -0x10(%rbp), %xmm0
leaq 0x7a781(%rip), %rdi     # 0xe0184
movb $0x1, %al
callq 0x6070
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x65a23
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x65a30
leaq 0x7a726(%rip), %rax     # 0xe0150
movq %rax, -0x40(%rbp)
jmp 0x65a30
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x65a49
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x65a56
leaq 0x7a700(%rip), %rax     # 0xe0150
movq %rax, -0x50(%rbp)
jmp 0x65a56
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %r8
leaq 0x79f2c(%rip), %rdi     # 0xdf995
leaq 0x7a765(%rip), %rdx     # 0xe01d5
movb $0x0, %al
callq 0x627f0
cmpq $0x0, -0x18(%rbp)
je 0x65a90
movq -0x18(%rbp), %rsi
leaq 0x7a364(%rip), %rdi     # 0xdfded
movb $0x0, %al
callq 0x6070
leaq 0x7b904(%rip), %rdi     # 0xe139b
movb $0x0, %al
callq 0x6070
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x65ca9
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0x7a547(%rip), %rdi     # 0xe01f7
movb $0x0, %al
callq 0x6070
cmpq $0x0, -0x8(%rbp)
je 0x65cd0
movq -0x8(%rbp), %rsi
leaq 0x7a63c(%rip), %rdi     # 0xe0305
movb $0x0, %al
callq 0x6070
cmpq $0x0, 0x18(%rbp)
je 0x65ce6
cmpq $0x0, -0x10(%rbp)
jne 0x65ce6
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x65cff
movq -0x10(%rbp), %rsi
leaq 0x7a295(%rip), %rdi     # 0xdff8d
movb $0x0, %al
callq 0x6070
cmpq $0x0, -0x30(%rbp)
je 0x65d18
movq -0x30(%rbp), %rsi
leaq 0x7a23c(%rip), %rdi     # 0xdff4d
movb $0x0, %al
callq 0x6070
cmpq $0x0, 0x18(%rbp)
je 0x65d56
movq 0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x65d54
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x627b0
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x65d27
jmp 0x65d56
cmpq $0x0, 0x10(%rbp)
je 0x65d6f
movq 0x10(%rbp), %rsi
leaq 0x7a497(%rip), %rdi     # 0xe01ff
movb $0x0, %al
callq 0x6070
leaq 0x7b625(%rip), %rdi     # 0xe139b
movb $0x0, %al
callq 0x6070
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x65de7
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rsi
callq 0x2b9f0
cmpl $0x0, %eax
jne 0x65db3
leaq 0x7a45e(%rip), %rax     # 0xe020b
movq %rax, -0x40(%rbp)
jmp 0x65dbe
leaq 0x7f64c(%rip), %rax     # 0xe5406
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x7a440(%rip), %rdi     # 0xe0215
movb $0x0, %al
callq 0x6070
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x65d84
leaq 0x7a43e(%rip), %rdi     # 0xe022c
movb $0x0, %al
callq 0x6070
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)