LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiMakeDropListWithVals
void cgiMakeDropListWithVals(char *name, char *menu[], char *values[],
                         int menuSize, char *checked)
/* Make a drop-down list with names and values. In this case checked
 * corresponds to a value, not a menu. */
{
int i;
char *selString;
if (checked == NULL) checked = values[0];

printf("<SELECT NAME=\"%s\">\n", name);
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
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rsi
testq %r8, %r8
jne 0x15269
movq (%r14), %rbx
leaq 0x6bda(%rip), %rdi      # 0x1be4a
xorl %eax, %eax
callq 0x3270
testl %ebp, %ebp
jle 0x152c1
movl %ebp, %r13d
leaq 0x6bd9(%rip), %r12      # 0x1be5e
xorl %ebp, %ebp
movq (%r14,%rbp,8), %rdi
movq %rbx, %rsi
callq 0x6f18
testl %eax, %eax
leaq 0x4a26(%rip), %rsi      # 0x19cc2
leaq 0x6a9d(%rip), %rax      # 0x1bd40
cmoveq %rax, %rsi
movq (%r14,%rbp,8), %rdx
movq (%r15,%rbp,8), %rcx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3270
incq %rbp
cmpq %rbp, %r13
jne 0x15287
leaq 0x7130(%rip), %rdi      # 0x1c3f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3100
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiDropDownWithTextValsAndExtra
void cgiDropDownWithTextValsAndExtra(char *name, char *text[], char *values[],
                                     int count, char *selected, char *extra)
/* Make a drop-down list with both text and values. */
{
int i;
char *selString;
assert(values != NULL && text != NULL);
if (selected == NULL)
    selected = values[0];
printf("<SELECT");
if (name)
    printf(" NAME='%s'", name);
if (extra)
    printf("%s", extra);
printf(">\n");
for (i=0; i<count; ++i)
    {
    if (sameWord(values[i], selected))
        selString = " SELECTED";
    else
        selString = "";
    printf("<OPTION%s value='%s'>%s</OPTION>\n", selString, values[i], text[i]);
    }
printf("</SELECT>\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x153bb
movq %rdx, %r14
testq %rdx, %rdx
je 0x153bb
movq %r9, %r12
movl %ecx, %ebx
movq %rdi, %r13
movq %rsi, %r15
testq %r8, %r8
jne 0x1530e
movq (%r14), %r8
movq %r8, %rbp
leaq 0x6a14(%rip), %rdi      # 0x1bd2c
xorl %eax, %eax
callq 0x3270
testq %r13, %r13
je 0x15335
leaq 0x679c(%rip), %rdi      # 0x1bac7
movq %r13, %rsi
xorl %eax, %eax
callq 0x3270
testq %r12, %r12
je 0x1534b
leaq 0x426b(%rip), %rdi      # 0x195ac
movq %r12, %rsi
xorl %eax, %eax
callq 0x3270
leaq 0x6548(%rip), %rdi      # 0x1b89a
callq 0x3100
testl %ebx, %ebx
jle 0x153a1
movl %ebx, %r13d
leaq 0x6c01(%rip), %r12      # 0x1bf66
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
movq %rbp, %rsi
callq 0x6f18
testl %eax, %eax
leaq 0x4946(%rip), %rsi      # 0x19cc2
leaq 0x69bd(%rip), %rax      # 0x1bd40
cmoveq %rax, %rsi
movq (%r14,%rbx,8), %rdx
movq (%r15,%rbx,8), %rcx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3270
incq %rbx
cmpq %rbx, %r13
jne 0x15367
leaq 0x7050(%rip), %rdi      # 0x1c3f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3100
leaq 0x6b26(%rip), %rdi      # 0x1bee8
leaq 0x6b3e(%rip), %rsi      # 0x1bf07
leaq 0x6b42(%rip), %rcx      # 0x1bf12
movl $0x735, %edx            # imm = 0x735
callq 0x32e0
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiVarExcludeExcept
void cgiVarExcludeExcept(char **varNames)
/* Exclude all variables except for those in NULL
 * terminated array varNames.  varNames may be NULL
 * in which case nothing is excluded. */
{
struct hashEl *list, *el;
struct hash *exclude = newHash(8);
char *s;

/* Build up hash of things to exclude */
if (varNames != NULL)
   {
   while ((s = *varNames++) != NULL)
       hashAdd(exclude, s, NULL);
   }

/* Step through variable list and remove them if not
 * excluded. */
initCgiInput();
list = hashElListHash(inputHash);
for (el = list; el != NULL; el = el->next)
    {
    if (!hashLookup(exclude, el->name))
        cgiVarExclude(el->name);
    }
hashElFreeList(&list);
freeHash(&exclude);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x8, %edi
movl $0x1, %esi
callq 0xc3f1
movq %rax, (%rsp)
testq %rbx, %rbx
je 0x154a3
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x154a3
addq $0x8, %rbx
movq (%rsp), %rdi
xorl %edx, %edx
callq 0xc04f
movq (%rbx), %rsi
addq $0x8, %rbx
testq %rsi, %rsi
jne 0x1548c
callq 0x15afe
movq 0x12e29(%rip), %rdi     # 0x282d8
callq 0xc5db
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x154e4
movq %rax, %rbx
movq (%rsp), %rdi
movq 0x8(%rbx), %rsi
callq 0xbd98
testq %rax, %rax
jne 0x154dc
movq 0x8(%rbx), %rdi
callq 0x15422
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x154c1
leaq 0x8(%rsp), %rdi
callq 0xc642
movq %rsp, %rdi
callq 0xc757
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiVarSet
void cgiVarSet(char *varName, char *val)
/* Set a cgi variable to a particular value. */
{
struct cgiVar *var;
initCgiInput();
AllocVar(var);
var->val = cloneString(val);
hashAddSaveName(inputHash, varName, var, &var->name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x15afe
movl $0x20, %edi
callq 0xf07d
movq %rax, %r15
movq %rbx, %rdi
callq 0x647e
movq %rax, 0x10(%r15)
movq 0x12dac(%rip), %rdi     # 0x282d8
leaq 0x8(%r15), %rcx
movq %r14, %rsi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0xc1a7
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiUrlString
struct dyString *cgiUrlString()
/* Get URL-formatted that expresses current CGI variable state. */
{
struct dyString *dy = newDyString(0);
struct cgiVar *cv;
char *e;


for (cv = inputList; cv != NULL; cv = cv->next)
    {
    if (cv != inputList)
       dyStringAppend(dy, "&");
    e = cgiEncode(cv->val);
    dyStringPrintf(dy, "%s=", cv->name);
    dyStringAppend(dy, e);
    freez(&e);
    }
return dy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %edi, %edi
callq 0xaf38
movq %rax, %rbx
movq 0x12d72(%rip), %r13     # 0x282d0
testq %r13, %r13
je 0x155c7
leaq 0x3eb8(%rip), %r14      # 0x19422
leaq 0x8(%rsp), %r15
leaq 0x6a3a(%rip), %r12      # 0x1bfb0
cmpq 0x12d53(%rip), %r13     # 0x282d0
je 0x1558a
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb18d
movq 0x10(%r13), %rdi
callq 0x13a1f
movq %rax, 0x8(%rsp)
movq 0x8(%r13), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xb2d2
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xb18d
movq %r15, %rdi
callq 0xf139
movq (%r13), %r13
testq %r13, %r13
jne 0x15576
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiEncodeIntoDy
void cgiEncodeIntoDy(char *var, char *val, struct dyString *dy)
/* Add a CGI-encoded &var=val string to dy. */
{
if (dy->stringSize != 0)
    dyStringAppendC(dy, '&');
dyStringAppend(dy, var);
dyStringAppendC(dy, '=');
char *s = cgiEncode(val);
dyStringAppend(dy, s);
freez(&s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0x14(%rdx)
je 0x155fd
movq %rbx, %rdi
movl $0x26, %esi
callq 0xb0c7
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb18d
movq %rbx, %rdi
movl $0x3d, %esi
callq 0xb0c7
movq %r14, %rdi
callq 0x13a1f
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xb18d
movq %r14, %rdi
callq 0xf139
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiFromFile
boolean cgiFromFile(char *fileName)
/* Set up a cgi environment using parameters stored in a file.
 * Takes file with arguments in the form:
 *       argument1=someVal
 *       # This is a comment
 *       argument2=someOtherVal
 *       ...
 * and puts them into the cgi environment so that the usual
 * cgiGetVar() commands can be used. Useful when a program
 * has a lot of possible parameters.
 */
{
char **argv = NULL;
int argc = 0;
int maxArgc = 10;
int i;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *line;
boolean spoof= FALSE;
AllocArray(argv, maxArgc);
/* Remember that first arg is program name.
   Put filename there instead. */
argc = 1;
argv[0] = cloneString(fileName);
for(;;)
    {
    /* If we are at the end we're done. */
    if(!lineFileNext(lf, &line, NULL))
	break;
    /* If it is a comment or blank line skip it. */
    if (line[0] == '#' || sameString(line, ""))
        continue;
    /* If our argv array is full expand it. */
    if((argc+1) >= maxArgc)
	{
	ExpandArray(argv, maxArgc, 2*maxArgc);
	maxArgc *= 2;
	}
    /* Fill in another argument to our psuedo arguments. */
    argv[argc++] = cloneString(line);
    }
spoof = cgiSpoof(&argc, argv);
/* Cleanup. */
lineFileClose(&lf);
for(i=0; i<argc; i++)
    freez(&argv[i]);
freez(&argv);
return spoof;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x1, %r15d
movl $0x1, %esi
callq 0xd12a
movq %rax, 0x18(%rsp)
movl $0x50, %edi
callq 0xeeec
movq %rax, 0x8(%rsp)
movl $0x1, 0x14(%rsp)
movq %rbx, %rdi
callq 0x647e
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x18(%rsp), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0xd274
testl %eax, %eax
je 0x1596b
movl $0xa, %ebp
movl $0x1, %r15d
leaq 0x20(%rsp), %rbx
movq %r15, %r14
movq 0x20(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x15903
testl %eax, %eax
jne 0x15918
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xd274
testl %eax, %eax
jne 0x158f2
jmp 0x15968
leaq 0x1(%r14), %r15
cmpl %r15d, %ebp
jg 0x15940
movq 0x8(%rsp), %rdi
movslq %ebp, %rsi
shlq $0x3, %rsi
addl %ebp, %ebp
movslq %ebp, %rdx
shlq $0x3, %rdx
callq 0xf0eb
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x647e
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xd274
testl %eax, %eax
jne 0x158ef
jmp 0x1596b
movl %r14d, %r15d
leaq 0x14(%rsp), %r14
movl %r15d, (%r14)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x15689
movl %eax, %ebx
leaq 0x18(%rsp), %rdi
callq 0xd800
movslq (%r14), %r14
testq %r14, %r14
jle 0x159b6
shlq $0x3, %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
addq %r15, %rdi
callq 0xf139
addq $0x8, %r15
cmpq %r15, %r14
jne 0x159a0
leaq 0x8(%rsp), %rdi
callq 0xf139
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiResetState
void cgiResetState()
/* This is for reloading CGI settings multiple times in the same program
 * execution.  No effect if state has not yet been initialized. */
{
freez(&inputString);
inputString = NULL;
if (inputHash != NULL)
    hashFree(&inputHash);
inputHash = NULL;
inputList = NULL;

haveCookiesHash = FALSE;
if (cookieHash != NULL)
    hashFree(&cookieHash);
cookieHash = NULL;
cookieList = NULL;
}

// Assembly:
pushq %rax
leaq 0x1281b(%rip), %rdi     # 0x281f0
callq 0xf139
movq $0x0, 0x1280b(%rip) # 0x281f0
cmpq $0x0, 0x128eb(%rip)     # 0x282d8
je 0x159fb
leaq 0x128e2(%rip), %rdi     # 0x282d8
callq 0xc757
xorl %eax, %eax
movq %rax, 0x128d4(%rip)     # 0x282d8
movq %rax, 0x128c5(%rip)     # 0x282d0
movb $0x0, 0x22ace(%rip)     # 0x384e0
cmpq %rax, 0x127df(%rip)     # 0x281f8
je 0x15a27
leaq 0x127d6(%rip), %rdi     # 0x281f8
callq 0xc757
xorl %eax, %eax
movq %rax, 0x127c8(%rip)     # 0x281f8
movq %rax, 0x12799(%rip)     # 0x281d0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiParsedVarsNew
struct cgiParsedVars *cgiParsedVarsNew(char *cgiString)
/* Build structure containing parsed out cgiString */
{
struct cgiParsedVars *tags;
AllocVar(tags);
tags->stringBuf = cloneString(cgiString);
cgiParseInputAbort(tags->stringBuf, &tags->hash, &tags->list);
hashTraverseEls(tags->hash, turnCgiVarsToVals);
return tags;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0xf07d
movq %rax, %r14
movq %rbx, %rdi
callq 0x647e
movq %rax, 0x8(%r14)
leaq 0x18(%r14), %rsi
leaq 0x10(%r14), %rdx
movq %rax, %rdi
callq 0x136c9
movq 0x18(%r14), %rdi
leaq 0x10(%rip), %rsi        # 0x15a9e
callq 0xc4e9
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiParsedVarsFree
void cgiParsedVarsFree(struct cgiParsedVars **pTags)
/* Free up memory associated with cgiParsedVars */
{
struct cgiParsedVars *tags = *pTags;
if (tags != NULL)
    {
    slFreeList(&tags->list);
    hashFree(&tags->hash);
    freeMem(tags->stringBuf);
    freez(pTags);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x15ae4
movq %rdi, %rbx
leaq 0x10(%r14), %rdi
callq 0x675e
leaq 0x18(%r14), %rdi
callq 0xc757
movq 0x8(%r14), %rdi
callq 0xf129
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf139
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/cheapcgi.c
// Function: getQueryInputExt
static void getQueryInputExt(boolean abortOnErr)
/* Get query string from environment if they've used GET method. */
{
inputString = getenv("QUERY_STRING");
if (inputString == NULL)
    {
    if (abortOnErr)
	errAbort("No QUERY_STRING in environment.");
    inputString = cloneString("");
    return;
    }
inputString = cloneString(inputString);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
leaq 0x5f92(%rip), %rdi      # 0x1c16b
callq 0x3040
movq %rax, %rbx
movq %rax, 0x12008(%rip)     # 0x281f0
testq %rax, %rax
jne 0x16206
leaq 0x3ace(%rip), %rbx      # 0x19cc2
testl %ebp, %ebp
je 0x16206
leaq 0x5fd0(%rip), %rdi      # 0x1c1cf
xorl %eax, %eax
callq 0xb8d7
movq %rbx, %rdi
callq 0x647e
movq %rax, 0x11fdb(%rip)     # 0x281f0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/intExp.c
// Function: doubleExp
double doubleExp(char *text)
/* Convert text to double expression and evaluate. */
{
double val;
struct kxTok *tokList = tok = kxTokenize(text, FALSE);
val = expression();
slFreeList(&tokList);
return val;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %esi, %esi
callq 0x167bf
movq %rax, 0x222c1(%rip)     # 0x384f0
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
callq 0x16268
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x675e
movsd (%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/intExp.c
// Function: mulDiv
static double mulDiv()
/* Multiplication or division. */
{
double val = uMinus();
for (;;)
    {
    if (tok->type == kxtMul)
	{
	nextTok();
	val *= uMinus();
	}
    else if (tok->type == kxtDiv)
	{
	nextTok();
	val /= uMinus();
	}
    else
        break;
    }
return val;
}

// Assembly:
pushq %rax
callq 0x16326
movq 0x2221c(%rip), %rax     # 0x384f0
movl 0x8(%rax), %ecx
cmpl $0x10, %ecx
movsd %xmm0, (%rsp)
je 0x16300
cmpl $0x11, %ecx
jne 0x16324
movq (%rax), %rax
movq %rax, 0x22200(%rip)     # 0x384f0
callq 0x16326
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x16318
movq (%rax), %rax
movq %rax, 0x221e6(%rip)     # 0x384f0
callq 0x16326
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
jmp 0x162cd
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/intExp.c
// Function: atom
static double atom()
/* Return parenthetical expression or number. */
{
double val;
if (tok->type == kxtOpenParen)
    {
    nextTok();
    val = expression();
    if (tok->type == kxtCloseParen)
	{
        nextTok();
	return val;
	}
    else
	{
        errAbort("Unmatched parenthesis");
	return 0;
	}
    }
else
    return number();
}

// Assembly:
pushq %rbx
movq 0x2219c(%rip), %rax     # 0x384f0
cmpl $0xc, 0x8(%rax)
jne 0x1637b
movq (%rax), %rax
movq %rax, 0x2218c(%rip)     # 0x384f0
callq 0x16268
movq 0x22180(%rip), %rax     # 0x384f0
cmpl $0xd, 0x8(%rax)
jne 0x163d7
movq (%rax), %rax
jmp 0x163ce
testq %rax, %rax
jne 0x1638e
leaq 0x60af(%rip), %rdi      # 0x1c436
xorl %eax, %eax
callq 0xb8d7
callq 0x37a0
movq (%rax), %rax
movq 0x22153(%rip), %rsi     # 0x384f0
movsbq 0xd(%rsi), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x163bb
addq $0xd, %rsi
leaq 0x60a6(%rip), %rdi      # 0x1c45a
xorl %eax, %eax
callq 0xb8d7
movq 0x2212e(%rip), %rbx     # 0x384f0
leaq 0xd(%rbx), %rdi
callq 0x3180
movq (%rbx), %rax
movq %rax, 0x2211b(%rip)     # 0x384f0
jmp 0x163e8
leaq 0x6042(%rip), %rdi      # 0x1c420
xorl %eax, %eax
callq 0xb8d7
xorps %xmm0, %xmm0
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: initMimeBuf
struct mimeBuf * initMimeBuf(int d)
/* d is a descriptor for a file or socket or some other descriptor 
   that the MIME input can be read from. 
   Initializes the mimeBuf structure. */
{
struct mimeBuf *b=AllocA(*b);
b->d = d;
b->boundary = NULL;
b->blen = 0;
b->eom = b->buf+MIMEBUFSIZE;
b->eoi = b->eom;
b->eod = b->eom;
b->i = b->eom;
moreMimeBuf(b);
return b;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x8040, %edi           # imm = 0x8040
callq 0xf07d
movq %rax, %r14
movl %ebx, (%rax)
movq $0x0, 0x8018(%rax)
movl $0x0, 0x8020(%rax)
addq $0x8004, %rax           # imm = 0x8004
movq %rax, 0x8038(%r14)
movq %rax, 0x8030(%r14)
movq %rax, 0x8028(%r14)
movq %rax, 0x8008(%r14)
movq %r14, %rdi
callq 0x1682f
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: moreMimeBuf
static void moreMimeBuf(struct mimeBuf *b)
{
int bytesRead = 0, bytesToRead = 0;
if (b->blen > 1)
    {
    int r = b->eoi - b->i;
    memmove(b->buf, b->i, r);
    b->eoi = b->buf+r;
    }
else
    {
    b->eoi = b->buf;
    }
b->i = b->buf+0;
bytesToRead = b->eom - b->eoi;
while (bytesToRead > 0)
    {
    bytesRead = read(b->d, b->eoi, bytesToRead);
    if (bytesRead < 0)
        errnoAbort("moreMimeBuf: error reading MIME input descriptor");
    b->eoi += bytesRead;
    if (bytesRead == 0)
        break;
    bytesToRead = bytesToRead - bytesRead;
    }
setEopMB(b);
setEodMB(b);
//debug
//fprintf(stderr,"post-moreMime dumpMB: ");
//dumpMB(b);  //debug
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, 0x8020(%rdi)
jl 0x1686a
movl 0x8030(%rbx), %eax
movq 0x8008(%rbx), %rsi
subl %esi, %eax
leaq 0x4(%rbx), %rdi
movslq %eax, %r14
movq %r14, %rdx
callq 0x35d0
leaq (%rbx,%r14), %rax
addq $0x4, %rax
jmp 0x1686e
leaq 0x4(%rbx), %rax
movq %rax, 0x8030(%rbx)
leaq 0x4(%rbx), %rax
movq %rax, 0x8008(%rbx)
movl 0x8038(%rbx), %ebp
subl 0x8030(%rbx), %ebp
testl %ebp, %ebp
jle 0x168cf
leaq 0x5efd(%rip), %r14      # 0x1c794
movl (%rbx), %edi
movq 0x8030(%rbx), %rsi
movl %ebp, %edx
callq 0x33d0
movq %rax, %r15
testl %r15d, %r15d
jns 0x168b9
movq %r14, %rdi
xorl %eax, %eax
callq 0xba00
movslq %r15d, %rax
addq %rax, 0x8030(%rbx)
testl %r15d, %r15d
je 0x168cf
subl %r15d, %ebp
testl %ebp, %ebp
jg 0x16897
movq %rbx, %rdi
callq 0x174eb
movl 0x8020(%rbx), %ecx
cmpl $0x2, %ecx
jl 0x168f2
movq 0x8030(%rbx), %rax
cmpq 0x8038(%rbx), %rax
je 0x1690b
movq 0x8030(%rbx), %rax
movq %rax, 0x8028(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
decl %ecx
subq %rcx, %rax
jmp 0x168f9
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: getMimeHeaderMainVal
char *getMimeHeaderMainVal(char *header)
/* Parse a typical mime header line returning the first
 * main value up to whitespace, punctuation, or end. 
 * freeMem the returned string when done */
{
char value[1024]; 
char *h = header;
int i = 0;
char *puncChars = ",;: \t\r\n"; /* punctuation chars */
i=0;
/* The header should have already been trimmed of leading and trailing spaces */
while(TRUE)
    {
    char c = *h++;
    if (c==0 || strchr(puncChars,c))
	break;
    value[i++] = c;
    if (i >= sizeof(value))
	errAbort("error: main value too long (>%lu) in MIME header Content-type:%s",(unsigned long)sizeof(value),header);
    }
value[i] = 0;    

return cloneString(value);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x5bb1(%rip), %r14      # 0x1c4de
leaq 0x5bb2(%rip), %r15      # 0x1c4e6
xorl %r12d, %r12d
movq %rdi, %r13
movsbl (%r13), %ebp
testl %ebp, %ebp
je 0x16957
movl $0x8, %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x33c0
testq %rax, %rax
je 0x16963
xorl %ebp, %ebp
incq %r13
testb %bpl, %bpl
jne 0x1693a
jmp 0x1698d
movslq %r12d, %rax
incl %r12d
movb %bpl, (%rsp,%rax)
movb $0x1, %bpl
cmpl $0x400, %r12d           # imm = 0x400
jb 0x16959
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb8d7
jmp 0x16959
movslq %r12d, %rax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x647e
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: getMimeHeaderFieldVal
char *getMimeHeaderFieldVal(char *header, char *field)
/* Parse a typical mime header line looking for field=
 * and return the value which may be quoted.
 * freeMem the returned string when done */
{
char value[1024]; 
char *fld = header;
int i = 0;
char *puncChars = ",;: \t\r\n"; /* punctuation chars */
while (TRUE)
    {
    fld = strstr(fld,field);
    if (!fld)
	return NULL;
    if (fld > header && strchr(puncChars,fld[-1]))
	{
	fld+=strlen(field);
	if (*fld == '=')
	    {
	    ++fld;
	    break;
	    }
	}    
    else
	{
	++fld;
	}
    }	
if (*fld == '"')
    {
    puncChars = "\"";  /* quoted */
    ++fld;
    }
i=0;
while(TRUE)
    {
    char c = *fld++;
    if (c==0 || strchr(puncChars,c))
	break;
    value[i++] = c;
    if (i >= sizeof(value))
	errAbort("error: %s= value too long (>%lu) in MIME header Content-type:%s",field,(unsigned long)sizeof(value),header);
    }
value[i] = 0;    

return cloneString(value);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3760
testq %rax, %rax
je 0x16a29
movq %rax, %r13
leaq 0x5b05(%rip), %r15      # 0x1c4de
xorl %r12d, %r12d
cmpq %r14, %r13
jbe 0x16a0e
movsbl -0x1(%r13), %esi
movl $0x8, %edx
movq %r15, %rdi
callq 0x33c0
testq %rax, %rax
je 0x16a0e
movq %rbx, %rdi
callq 0x3200
leaq (%rax,%r13), %rdi
cmpb $0x3d, (%r13,%rax)
jne 0x16a14
jmp 0x16a31
incq %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3760
movq %rax, %r13
testq %rax, %rax
jne 0x169dc
jmp 0x16ab6
xorl %r12d, %r12d
jmp 0x16ab6
leaq 0x1(%rdi), %r13
cmpb $0x22, 0x1(%rdi)
leaq 0x2(%rdi), %rax
cmoveq %rax, %r13
leaq 0x4ec5(%rip), %rax      # 0x1b90d
cmoveq %rax, %r15
xorl %r12d, %r12d
movsbl (%r13), %ebp
testl %ebp, %ebp
je 0x16a67
movq %r15, %rdi
movl %ebp, %esi
callq 0x3260
testq %rax, %rax
je 0x16a73
xorl %ebp, %ebp
incq %r13
testb %bpl, %bpl
jne 0x16a4f
jmp 0x16aa4
movslq %r12d, %rax
incl %r12d
movb %bpl, (%rsp,%rax)
movb $0x1, %bpl
cmpl $0x400, %r12d           # imm = 0x400
jb 0x16a69
movl $0x400, %edx            # imm = 0x400
leaq 0x5a92(%rip), %rdi      # 0x1c527
movq %rbx, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0xb8d7
jmp 0x16a69
movslq %r12d, %rax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x647e
movq %rax, %r12
movq %r12, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: getLineMB
static char *getLineMB(struct mimeBuf *b)
/* Reads one line up to CRLF, returned string does not include CRLF however. 
   Use freeMem when done with string. */
{
char line[MAXPARTLINESIZE];
int i = 0;
char c = 0;
line[0]=0;
while(TRUE)
    {
    c =getcMB(b);
    if ((c == 0x0d) || (c == 0x0a))  /* CR or LF is end of line */
	break;
    line[i++] = c;
    if (i >= MAXPARTLINESIZE)
	errAbort("getLineMB error - MIME input header too long, "
		    "greater than %d chars",MAXPARTLINESIZE);
    }
line[i] = 0; /* terminate string */ 
if (nlType == nlt_undet)  /* determine newline type */
    {
    if (c == 0x0d)
	{
	nlType = nlt_mac;
	c = getcMB(b);
	if (c == 0x0a)
	    nlType = nlt_dos;
	else
    	    putBackMB(b);
	}
    else
	{
	nlType = nlt_unix;
	}
    }
else if (nlType == nlt_dos)
    {
    if (c == 0x0d)
    	getcMB(b); /* just waste the LF */
    else
	nlType = nlt_unix;
    }
return cloneString(line);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
movb $0x0, (%rsp)
leaq 0x5464(%rip), %r14      # 0x1c7c5
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x17482
cmpb $0xa, %al
je 0x17399
movzbl %al, %ecx
cmpl $0xd, %ecx
je 0x17399
movb %al, (%rsp,%r15)
cmpq $0x3ff, %r15            # imm = 0x3FF
jb 0x17394
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0xb8d7
incq %r15
jmp 0x17364
movl %r15d, %ecx
movb $0x0, (%rsp,%rcx)
movl 0x21156(%rip), %ecx     # 0x384fc
cmpl $0x2, %ecx
je 0x173d5
testl %ecx, %ecx
jne 0x173ed
cmpb $0xd, %al
jne 0x173e3
movl $0x3, 0x2113f(%rip)     # 0x384fc
movq %rbx, %rdi
callq 0x17482
cmpb $0xa, %al
jne 0x17402
movl $0x2, 0x21129(%rip)     # 0x384fc
jmp 0x173ed
cmpb $0xd, %al
jne 0x173e3
movq %rbx, %rdi
callq 0x17482
jmp 0x173ed
movl $0x1, 0x2110f(%rip)     # 0x384fc
movq %rsp, %rdi
callq 0x647e
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4(%rbx), %rax
cmpq %rax, 0x8008(%rbx)
jne 0x1741d
leaq 0x53f3(%rip), %rdi      # 0x1c809
xorl %eax, %eax
callq 0xb8d7
decq 0x8008(%rbx)
jmp 0x173ed
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: setBoundaryMB
static void setBoundaryMB(struct mimeBuf *b, char *boundary)
/* set boundary in b */
{
b->boundary = boundary;
b->blen = boundary ? strlen(b->boundary) : 0;
setEopMB(b);
setEodMB(b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x8018(%rdi)
testq %rsi, %rsi
je 0x17440
movq %rsi, %rdi
callq 0x3200
jmp 0x17442
xorl %eax, %eax
movl %eax, 0x8020(%rbx)
movq %rbx, %rdi
callq 0x174eb
movl 0x8020(%rbx), %ecx
cmpl $0x2, %ecx
jl 0x1746b
movq 0x8030(%rbx), %rax
cmpq 0x8038(%rbx), %rax
je 0x1747b
movq 0x8030(%rbx), %rax
movq %rax, 0x8028(%rbx)
popq %rbx
retq
decl %ecx
subq %rcx, %rax
jmp 0x17472
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: getcMB
static char getcMB(struct mimeBuf *b)
/* read just one char from MIME buffer */
{
if (b->i >= b->eoi && b->eoi < b->eom)  /* at end of input */
    errAbort("getcMB error - requested input beyond end of MIME input.");
if (b->i >= b->eod && b->eoi == b->eom) /* at end of buffer */
    moreMimeBuf(b);
    
//fprintf(stderr,"b->buf:%lu b->i:%lu %c \n",
//    (unsigned long) b->buf,
//    (unsigned long) b->i,
//    *b->i
//    );
//fprintf(stderr,"%c",*b->i);
//fflush(stderr); 
return *b->i++;    
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8030(%rdi), %rax
cmpq %rax, 0x8008(%rdi)
jb 0x174ad
cmpq 0x8038(%rbx), %rax
jae 0x174ad
leaq 0x53ed(%rip), %rdi      # 0x1c893
xorl %eax, %eax
callq 0xb8d7
movq 0x8008(%rbx), %rax
cmpq 0x8028(%rbx), %rax
jb 0x174d5
movq 0x8030(%rbx), %rax
cmpq 0x8038(%rbx), %rax
jne 0x174d5
movq %rbx, %rdi
callq 0x1682f
movq 0x8008(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8008(%rbx)
movb (%rax), %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/mime.c
// Function: getChunkMB
static void getChunkMB(struct mimeBuf *b, char **address, int *size, boolean *hasZeros)
/* Pass back address and size of chunk, and whether it contains embedded zeros.
   The chunk is the largest piece of data left in the buffer up to the eod or eop. */
{
char *eoc = b->eop ? b->eop : b->eod; /* end of chunk */
//debug
//fprintf(stderr,"pre-getChunkMB dumpMB: ");
//dumpMB(b);  //debug
*address=b->i;
*size=eoc - b->i;
*hasZeros = (memMatch("", 1,*address, *size) != NULL);
b->i = eoc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
movq 0x8010(%rdi), %r15
testq %r15, %r15
jne 0x1753f
movq 0x8028(%r14), %r15
movq 0x8008(%r14), %rax
movq %rax, (%rsi)
movl 0x8008(%r14), %esi
movl %r15d, %ecx
subl %esi, %ecx
movl %ecx, (%rdx)
leaq 0x2764(%rip), %rdi      # 0x19cc2
movl $0x1, %esi
movq %rax, %rdx
callq 0x85a2
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, (%rbx)
movq %r15, 0x8008(%r14)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/portimpl.c
// Function: envUpdate
void envUpdate(char *name, char *value)
/* Update an environment string */
{
int size = strlen(name) + strlen(value) + 2;
char *s = needMem(size);
safef(s, size, "%s=%s", name, value);
putenv(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3200
movq %rax, %r15
movq %rbx, %rdi
callq 0x3200
addl %r15d, %eax
addl $0x2, %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0xf07d
movq %rax, %r12
leaq 0x52de(%rip), %rdx      # 0x1c8cc
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xa2ce
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3420
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/portimpl.c
// Function: mkdirTrashDirectory
void mkdirTrashDirectory(char *prefix)
/*	create the specified trash directory if it doesn't exist */
{
struct stat buf;
char trashDirName[128];
safef(trashDirName, sizeof(trashDirName), "%s/%s", trashDir(), prefix);
if (stat(trashDirName,&buf))
    {
    int result = mkdir (trashDirName, S_IRWXU | S_IRWXG | S_IRWXO);
    if (0 != result)
	errnoAbort("failed to create directory %s", trashDirName);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
leaq 0xffa8(%rip), %rcx      # 0x275d0
xorl %eax, %eax
callq *0x20(%rcx)
leaq 0x529e(%rip), %rdx      # 0x1c8d2
movq %rsp, %r14
movq %r14, %rdi
movl $0x80, %esi
movq %rax, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xa2ce
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
testl %eax, %eax
je 0x17682
movq %rsp, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x30f0
testl %eax, %eax
je 0x17682
leaq 0x5260(%rip), %rdi      # 0x1c8d8
movq %rsp, %rsi
xorl %eax, %eax
callq 0xba00
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/JimKent[P]linearSat/lib/portimpl.c
// Function: makeDirsOnPath
void makeDirsOnPath(char *pathName)
/* Create directory specified by pathName.  If pathName contains
 * slashes, create directory at each level of path if it doesn't
 * already exist.  Abort with error message if there's a problem.
 * (It's not considered a problem for the directory to already
 * exist. ) */
{

/* shortcut for paths that already exist */
if (fileExists(pathName))
    return;

/* Make local copy of pathName. */
int len = strlen(pathName);
char pathCopy[len+1];
strcpy(pathCopy, pathName);

/* Tolerate double-slashes in path, everyone else does it. */

/* Start at root if it's an absolute path name. */
char *s = pathCopy, *e;
while (*s++ == '/')
    /* do nothing */;

/* Step through it one slash at a time 
 * making directory if possible, else dying. */
for (; !isEmpty(s); s = e)
    {
    /* Find end of this section and terminate string there. */
    e = strchr(s, '/');
    if (e != NULL)
	*e = 0;
    makeDir(pathCopy);
    if (e != NULL)
	*e++ = '/';
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xa0fe
testl %eax, %eax
jne 0x1771a
movq %r14, %rdi
callq 0x3200
movq %rsp, %r15
incl %eax
movq %rsp, %rbx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30e0
movq %rbx, %rdi
cmpb $0x2f, (%rdi)
leaq 0x1(%rdi), %rdi
je 0x176cf
jmp 0x17712
movl $0x2f, %esi
callq 0x3260
testq %rax, %rax
je 0x17703
movq %rax, %r14
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x11334
movq %r14, %rdi
incq %rdi
movb $0x2f, (%r14)
jmp 0x1770d
movq %rbx, %rdi
callq 0x11334
xorl %edi, %edi
testq %rdi, %rdi
je 0x17717
cmpb $0x0, (%rdi)
jne 0x176da
movq %r15, %rsp
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/abdalazizrashid[P]st-HiDPI/x.c
// Function: mouseaction
int
mouseaction(XEvent *e, uint release)
{
	MouseShortcut *ms;

	for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
		if (ms->release == release &&
		    ms->button == e->xbutton.button &&
		    (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
		    (match(ms->mod, e->xbutton.state) ||  /* exact or forced */
		     match(ms->mod, e->xbutton.state & ~forcemousemod))) {
			ms->func(&(ms->arg));
			return 1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq $-0x20, %r15
leaq 0x7dd1(%rip), %r12      # 0x15710
cmpl %ebx, 0x38(%r15,%r12)
jne 0xd999
movl 0x24(%r15,%r12), %eax
cmpl 0x54(%r14), %eax
jne 0xd999
movl 0x3c(%r15,%r12), %ebp
testl %ebp, %ebp
je 0xd970
callq 0x771b
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl $0x1, %eax
cmpl %eax, %ebp
jne 0xd999
movl 0x20(%r15,%r12), %eax
cmpl $-0x1, %eax
je 0xd9aa
movl 0x50(%r14), %ecx
movl %ecx, %edx
andl $0xffffdfef, %edx       # imm = 0xFFFFDFEF
cmpl %eax, %edx
je 0xd9aa
cmpl $-0x1, %eax
je 0xd9aa
andl $0xffffdfee, %ecx       # imm = 0xFFFFDFEE
cmpl %eax, %ecx
je 0xd9aa
addq $0x20, %r15
cmpq $0x80, %r15
jb 0xd93f
xorl %eax, %eax
jmp 0xd9ba
leaq (%r15,%r12), %rdi
addq $0x30, %rdi
callq *-0x8(%rdi)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-zoe/mdx-parser.c
// Function: snap0
unsigned int snap0(unsigned int data) {
	if(data < 26) return 5*data+0x80;
	else if(data < 52) return 5*data+0x8100;
	else if(data < 76) return 5*data+0x8180;
	else if(data < 102) return 5*data+0x8200;
	else if(data < 127) return 5*data+0x8280;
	else if(data < 153) return 5*data+0x8300;
	else if(data < 179) return 5*data+0x8380;
	else if(data < 205) return 5*data+0x8400;
	else if(data < 283) return 5*data+0x8480;
	else {
		printf("snap0: data is %d\n", data);
		return 0;
	}
}

// Assembly:
pushq %rbx
movl %edi, %esi
cmpl $0x19, %edi
ja 0x24f2
leal (%rsi,%rsi,4), %ebx
addl $0x80, %ebx
jmp 0x2591
cmpl $0x33, %esi
ja 0x2505
leal (%rsi,%rsi,4), %ebx
addl $0x8100, %ebx           # imm = 0x8100
jmp 0x2591
cmpl $0x4b, %esi
ja 0x2515
leal (%rsi,%rsi,4), %ebx
addl $0x8180, %ebx           # imm = 0x8180
jmp 0x2591
cmpl $0x65, %esi
ja 0x2525
leal (%rsi,%rsi,4), %ebx
addl $0x8200, %ebx           # imm = 0x8200
jmp 0x2591
cmpl $0x7e, %esi
ja 0x2535
leal (%rsi,%rsi,4), %ebx
addl $0x8280, %ebx           # imm = 0x8280
jmp 0x2591
cmpl $0x98, %esi
ja 0x2548
leal (%rsi,%rsi,4), %ebx
addl $0x8300, %ebx           # imm = 0x8300
jmp 0x2591
cmpl $0xb2, %esi
ja 0x255b
leal (%rsi,%rsi,4), %ebx
addl $0x8380, %ebx           # imm = 0x8380
jmp 0x2591
cmpl $0xcc, %esi
ja 0x256e
leal (%rsi,%rsi,4), %ebx
addl $0x8400, %ebx           # imm = 0x8400
jmp 0x2591
cmpl $0x11a, %esi            # imm = 0x11A
ja 0x2581
leal (%rsi,%rsi,4), %ebx
addl $0x8480, %ebx           # imm = 0x8480
jmp 0x2591
leaq 0xd71(%rip), %rdi       # 0x32f9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2070
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/./conio.h
// Function: reset_terminal_mode_ex
void reset_terminal_mode_ex()
{
	reset_terminal_mode();
	printf("\x1b[0m");                               // Reset colors
	fflush(stdout);
	printf("\n");
}

// Assembly:
pushq %rax
leaq 0x1177c(%rip), %rdx     # 0x14260
xorl %edi, %edi
xorl %esi, %esi
callq 0x2310
leaq 0xe25c(%rip), %rdi      # 0x10d50
xorl %eax, %eax
callq 0x2100
movq 0x114ce(%rip), %rax     # 0x13fd0
movq (%rax), %rdi
callq 0x22a0
movl $0xa, %edi
popq %rax
jmp 0x2060
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/./conio.h
// Function: set_conio_terminal_mode
void set_conio_terminal_mode()
{
    struct termios new_termios;

    /* take two copies - one for now, one for later */
    tcgetattr(0, &orig_termios);
    memcpy(&new_termios, &orig_termios, sizeof(new_termios));

    /* register cleanup handler, and set the new terminal mode */
    atexit(reset_terminal_mode_ex);
    cfmakeraw(&new_termios);
    tcsetattr(0, TCSANOW, &new_termios);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
leaq 0x1173f(%rip), %rsi     # 0x14260
xorl %edi, %edi
callq 0x2300
movups 0x11731(%rip), %xmm0    # 0x14260
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movups 0x11734(%rip), %xmm0    # 0x14270
movaps %xmm0, 0x10(%rbx)
movups 0x11739(%rip), %xmm0    # 0x14280
movaps %xmm0, 0x20(%rbx)
movups 0x1173a(%rip), %xmm0    # 0x1428c
movups %xmm0, 0x2c(%rbx)
leaq -0x81(%rip), %rdi       # 0x2adc
callq 0xc7c0
movq %rbx, %rdi
callq 0x22f0
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2310
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/./conio.h
// Function: kbhit
int kbhit()
{
    struct timeval tv = { 0L, 0L };
    fd_set fds;
    FD_ZERO(&fds);
    FD_SET(0, &fds);
    return select(1, &fds, NULL, NULL, &tv);
}

// Assembly:
subq $0x98, %rsp
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movq $0x1, (%rsi)
movl $0x1, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2270
addq $0x98, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/./conio.h
// Function: getch
int getch()
{
    int r;
    unsigned char c;
    fflush(stdout);
    if ((r = read(0, &c, sizeof(c))) < 0) {
        return r;
    } else {
        if (r==0) 
		return -1;
	else
		return c;
    }
}

// Assembly:
pushq %rax
movq 0x113fa(%rip), %rax     # 0x13fd0
movq (%rax), %rdi
callq 0x22a0
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
xorl %edi, %edi
callq 0x21c0
testl %eax, %eax
js 0x2c01
je 0x2bfc
movzbl 0x7(%rsp), %eax
jmp 0x2c01
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/./cpu.h
// Function: Z80reset
void Z80reset(void) {
	PC = 0;
	IFF = 0;
	IR = 0;
	Status = 0;
	Debug = 0;
	Break = -1;
	Step = -1;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x111636(%rip)    # 0x1142c4
movl %eax, 0x111634(%rip)    # 0x1142c8
movl %eax, 0x111632(%rip)    # 0x1142cc
movl %eax, 0x111618(%rip)    # 0x1142b8
movl %eax, 0x111616(%rip)    # 0x1142bc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x11557(%rip)     # 0x14208
movl %eax, 0x11555(%rip)     # 0x1420c
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: io_output
void io_output( int add, int data) {
	int p,i;
	DEBUGOUT( stderr, "ERROR: i/o write port:%04x <- %02x\n", add, data);
 	switch (add) {
 		case 0xf9:  mem=&mem1024[(data & 0x0f) * 0x10000];
			 		goto ori128;
 		case 0xfb:  if (data & 0x80) {
 			            dispatcher=TRUE;
 						mem16=&mem1024[((int)data & 0x0f)<<6];
 					}
		 			else mem16=mem;
 					fullram=data & 0x20;
 					int50hz=data & 0x40;
 		case 0xf8:
 		case 0xfa:  
ori128:				if (orion128==FALSE) {		/* Switch to Orion128 mode and init F800 ROM area */
 	 					orion128=TRUE;
						p = ROM_ORG;
						for ( i = 0; i < ROM_CNT; i++) {
							mem1024[ p++] = 0xC3;
							setword( mem1024[ p++], 3*ROM_CNT+ROM_ORG);	    /*   JP MMMM */
						}
						mem1024[ p++] = 0xED; mem1024[ p++] = 0xED;         /* SPECIAL OPCODE */
						mem1024[ p++] = 0xC9;				          		/*   RET */
 					}
 					break;
 		default: exit( -1);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
cmpl $0x0, 0x10c0d7(%rip)    # 0x114314
jne 0x8310
addl $0xffffff08, %r14d      # imm = 0xFFFFFF08
cmpl $0x3, %r14d
ja 0x8332
leaq 0x5c41(%rip), %rax      # 0xde9c
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
andl $0xf, %ebx
shll $0x10, %ebx
leaq 0xc02f(%rip), %rax      # 0x142a0
addq %rbx, %rax
movq %rax, 0xbf7d(%rip)      # 0x141f8
jmp 0x82c1
testb %bl, %bl
js 0x828a
movq 0xbf70(%rip), %rax      # 0x141f8
jmp 0x82a6
movl $0x1, 0x10c00c(%rip)    # 0x1142a0
movl %ebx, %ecx
andl $0xf, %ecx
shll $0x6, %ecx
leaq 0xbffd(%rip), %rax      # 0x142a0
addq %rcx, %rax
movq %rax, 0xbf53(%rip)      # 0x14200
movl %ebx, %eax
andl $0x20, %eax
movl %eax, 0x10bfec(%rip)    # 0x1142a4
andl $0x40, %ebx
movl %ebx, 0x10bfe7(%rip)    # 0x1142a8
cmpl $0x0, 0x10bfe4(%rip)    # 0x1142ac
jne 0x8308
movl $0x1, 0x10bfd8(%rip)    # 0x1142ac
xorl %eax, %eax
leaq 0xbfc3(%rip), %rcx      # 0x142a0
movw $0x42c3, 0xf800(%rax,%rcx) # imm = 0x42C3
movb $-0x8, 0xf802(%rax,%rcx)
addq $0x3, %rax
cmpl $0x42, %eax
jne 0x82dd
movw $0xeded, 0x1b7e1(%rip)  # imm = 0xEDED
movb $-0x37, 0x1b7dc(%rip)   # 0x23ae4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0xbce1(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x8a4f(%rip), %rsi      # 0x10d70
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2210
jmp 0x8243
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x23a0
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: setup_disk_vct
void setup_disk_vct( void)
{
    int i;
    char envname[ 8];

    cpm_disk_vct = 3;
    for ( i = 2; i < MAXDRV; i++) {
	if ( cpm_drive[ i]) continue;
	sprintf( envname, "CPM%c", i + 'A');
	if (( cpm_drive[ i] = getenv( envname)) != NULL) {
	    cpm_disk_vct |= (word)( 1 << i);
	}
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movw $0x3, 0x10bede(%rip)    # 0x11431a
movl $0x2, %ebx
leaq 0x10bff8(%rip), %r12    # 0x114440
leaq 0x894f(%rip), %r14      # 0x10d9e
leaq 0x8(%rsp), %r15
cmpq $0x0, (%r12,%rbx,8)
jne 0x8495
leaq (,%rbx,8), %r13
leal 0x41(%rbx), %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2390
movq %r15, %rdi
callq 0x2040
movq %rax, (%r13,%r12)
testq %rax, %rax
je 0x8495
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
orw %ax, 0x10be85(%rip)     # 0x11431a
incq %rbx
cmpq $0x10, %rbx
jne 0x8454
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: CharUpperX
char* CharUpperX(char* st)
{
  char* ss=st;
  if (st==NULL) 
		return st;
  while (*ss) {
    *ss=toupper(*ss);
    ss++;
  }
  return st;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x84e0
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x84e0
callq 0x2030
leaq 0x1(%rbx), %rcx
movq (%rax), %rdx
movsbq %bpl, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x84c8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: splitpath
void _splitpath(char *path, char *drive, char *dir, char *name, char *ext)
{
	char* cc, sz;
	void* pp;
	*dir=0; *name=0; *ext=0;
	pp=malloc((sz=strlen(path))+1);
	strncpy(pp,path,sz);										/* because dirname flushes `path` */
	strncpy(name, (cc=basename(path)) ? cc: "", _MAX_FNAME);
	strncpy(dir,  (cc=dirname(path)) ? cc: "", _MAX_DIR);
	if ((strcmp(dir,".")==0)&&(*path!='.'))
		*dir=0;								
	if ((cc=strstr(name, "."))!=NULL) {
		strncpy(ext, &cc[1], _MAX_EXT);
		*cc='\0';
	}
	strncpy(path,pp,sz);
	free(pp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rdi, %rbx
xorl %eax, %eax
movb %al, (%rdx)
movb %al, (%rcx)
movq %r8, (%rsp)
movb %al, (%r8)
callq 0x20e0
movsbq %al, %r15
leaq 0x1(%r15), %rdi
callq 0x2290
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2070
movq %rbx, %rdi
callq 0x2250
testq %rax, %rax
leaq 0x89a9(%rip), %r14      # 0x10ee9
cmoveq %r14, %rax
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
movq %rax, %rsi
callq 0x2070
movq %rbx, %rdi
callq 0x2130
testq %rax, %rax
cmovneq %rax, %r14
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2070
leaq 0x8d4c(%rip), %rsi      # 0x112c6
movq %rbp, %rdi
callq 0x21e0
testl %eax, %eax
jne 0x858f
cmpb $0x2e, (%rbx)
je 0x858f
movb $0x0, (%rbp)
movq %r13, %rdi
movl $0x2e, %esi
callq 0x20f0
testq %rax, %rax
je 0x85bd
movq %rax, %r13
movq %rax, %rsi
incq %rsi
movl $0x100, %edx            # imm = 0x100
movq (%rsp), %rdi
callq 0x2070
movb $0x0, (%r13)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2070
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: buildname
char *buildname(char* dirnm, char* filenm)
{
	char *cp;
	static char buf[_MAX_DIR];

	if ((dirnm == NULL) || (*dirnm == '\0'))
		return filenm;
	if (filenm == NULL)
		return dirnm;
	if ((cp = strrchr(filenm, '/')) != NULL)
		filenm = cp + 1;
	strcpy(buf, dirnm);
	strcat(buf, "/");
	strcat(buf, filenm);
	return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x8646
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0x8646
testq %rbx, %rbx
je 0x8643
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2110
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rbx, %r15
leaq 0x10bea6(%rip), %rbx    # 0x1144c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2090
movq %rbx, %rdi
callq 0x20e0
movw $0x2f, (%rax,%rbx)
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2380
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/serge-404[P]CPM32/cpm.c
// Function: makepath
void _makepath(char *path, char *drive, char *dir, char *name, char *ext)
{
  char *cc;
  if (path) {
	*path=0; 
	if ((name==NULL)&&(ext==NULL))
	   strncpy(path, dir, _MAX_DIR);
    else {
		cc=buildname(dir,name);
	    if (cc) strncpy(path, cc, _MAX_DIR);
	}
	if (ext) {
		if (*ext!='.')
			strcat(path, ".");
		strncat(path, ext, 4);		/* CPM have 3-char ext + dot */
	}
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x86bc
movq %r8, %rbx
movq %rdx, %rsi
movq %rdi, %r14
movb $0x0, (%rdi)
movq %rcx, %rax
orq %r8, %rax
je 0x867f
movq %rsi, %rdi
movq %rcx, %rsi
callq 0x85e1
movq %rax, %rsi
testq %rax, %rax
je 0x868c
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0x2070
testq %rbx, %rbx
je 0x86bc
cmpb $0x2e, (%rbx)
je 0x86a5
movq %r14, %rdi
callq 0x20e0
movw $0x2e, (%r14,%rax)
movl $0x4, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
addq $0x8, %rsp
popq %rbx
popq %r14
retq