LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0xee10
movq %rax, %r14
movq %rbx, %rdi
callq 0x6402
movq %rax, 0x8(%r14)
leaq 0x18(%r14), %rsi
leaq 0x10(%r14), %rdx
movq %rax, %rdi
callq 0x1345f
movq 0x18(%r14), %rdi
leaq 0x10(%rip), %rsi        # 0x1581c
callq 0xc2e8
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x15862
movq %rdi, %rbx
leaq 0x10(%r14), %rdi
callq 0x66de
leaq 0x18(%r14), %rdi
callq 0xc51f
movq 0x8(%r14), %rdi
callq 0xeebc
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xeecc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x622a(%rip), %rdi      # 0x1c178
callq 0x3040
movq %rax, %rbx
movq %rax, 0x12293(%rip)     # 0x281f0
testq %rax, %rax
jne 0x15f7b
leaq 0x3d69(%rip), %rbx      # 0x19cd2
testl %ebp, %ebp
je 0x15f7b
leaq 0x6268(%rip), %rdi      # 0x1c1dc
xorl %eax, %eax
callq 0xb6c8
movq %rbx, %rdi
callq 0x6402
movq %rax, 0x12266(%rip)     # 0x281f0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x16545
movq %rax, 0x22549(%rip)     # 0x384f0
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
callq 0x15fe0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x66de
movsd (%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1609e
movq 0x224a4(%rip), %rax     # 0x384f0
movl 0x8(%rax), %ecx
cmpl $0x10, %ecx
movsd %xmm0, (%rsp)
je 0x16078
cmpl $0x11, %ecx
jne 0x1609c
movq (%rax), %rax
movq %rax, 0x22488(%rip)     # 0x384f0
callq 0x1609e
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x16090
movq (%rax), %rax
movq %rax, 0x2246e(%rip)     # 0x384f0
callq 0x1609e
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
jmp 0x16045
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x22424(%rip), %rbx     # 0x384f0
cmpl $0xc, 0x8(%rbx)
jne 0x160f3
movq (%rbx), %rax
movq %rax, 0x22414(%rip)     # 0x384f0
callq 0x15fe0
movq 0x22408(%rip), %rax     # 0x384f0
cmpl $0xd, 0x8(%rax)
jne 0x16138
movq (%rax), %rax
jmp 0x1612f
callq 0x37a0
movq (%rax), %rax
movsbq 0xd(%rbx), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x16123
addq $0xd, %rbx
leaq 0x6324(%rip), %rdi      # 0x1c436
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb6c8
movq 0x223cd(%rip), %rbx     # 0x384f0
leaq 0xd(%rbx), %rdi
callq 0x3180
movq (%rbx), %rax
movq %rax, 0x223ba(%rip)     # 0x384f0
jmp 0x16149
leaq 0x62e1(%rip), %rdi      # 0x1c420
xorl %eax, %eax
callq 0xb6c8
xorps %xmm0, %xmm0
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xee10
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 0x165b7
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x165f2
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), %rsi
addq $0x4, %rsi
jmp 0x165f6
leaq 0x4(%rbx), %rsi
movq %rsi, 0x8030(%rbx)
leaq 0x4(%rbx), %rax
movq %rax, 0x8008(%rbx)
movl 0x8038(%rbx), %ebp
subl %esi, %ebp
testl %ebp, %ebp
jle 0x16671
leaq 0x6158(%rip), %r14      # 0x1c773
movl (%rbx), %edi
movl %ebp, %edx
callq 0x33d0
movq %rax, %r15
testl %r15d, %r15d
js 0x16651
movl %r15d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq 0x8030(%rbx), %rsi
movq %rsi, 0x8030(%rbx)
testl %r15d, %r15d
je 0x16671
subl %r15d, %ebp
testl %ebp, %ebp
jg 0x1661b
jmp 0x16671
movq %r14, %rdi
xorl %eax, %eax
callq 0xb7f4
movslq %r15d, %rsi
addq 0x8030(%rbx), %rsi
movq %rsi, 0x8030(%rbx)
subl %r15d, %ebp
jg 0x1661b
movq %rbx, %rdi
callq 0x172d7
movl 0x8020(%rbx), %ecx
movq 0x8030(%rbx), %rax
cmpl $0x2, %ecx
jl 0x16699
cmpq 0x8038(%rbx), %rax
jne 0x16699
decl %ecx
subq %rcx, %rax
movq %rax, 0x8028(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x1671d
movq %rdi, %rbx
leaq 0x5dee(%rip), %r14      # 0x1c4ba
leaq 0x5def(%rip), %r15      # 0x1c4c2
xorl %r12d, %r12d
movsbl %bpl, %esi
movl $0x8, %edx
movq %r14, %rdi
callq 0x33c0
testq %rax, %rax
jne 0x16718
movb %bpl, (%rsp,%r12)
cmpq $0x3ff, %r12            # imm = 0x3FF
jb 0x1670b
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb6c8
movb 0x1(%rbx,%r12), %bpl
incq %r12
testb %bpl, %bpl
jne 0x166d6
movl %r12d, %eax
jmp 0x1671f
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x6402
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x167b6
movq %rax, %r13
leaq 0x5d54(%rip), %r15      # 0x1c4ba
xorl %r12d, %r12d
cmpq %r14, %r13
jbe 0x1679b
movsbl -0x1(%r13), %esi
movl $0x8, %edx
movq %r15, %rdi
callq 0x33c0
testq %rax, %rax
je 0x1679b
movq %rbx, %rdi
callq 0x3200
leaq (%rax,%r13), %rdi
cmpb $0x3d, (%r13,%rax)
jne 0x167a1
jmp 0x167be
incq %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3760
movq %rax, %r13
testq %rax, %rax
jne 0x16769
jmp 0x16843
xorl %r12d, %r12d
jmp 0x16843
leaq 0x1(%rdi), %r13
leaq 0x2(%rdi), %rax
xorl %ecx, %ecx
cmpb $0x22, 0x1(%rdi)
sete %cl
cmoveq %rax, %r13
leaq 0x5140(%rip), %rax      # 0x1b91a
cmoveq %rax, %r15
movb 0x1(%rcx,%rdi), %r12b
testb %r12b, %r12b
je 0x16832
xorl %ebp, %ebp
movsbl %r12b, %esi
movq %r15, %rdi
callq 0x3260
testq %rax, %rax
jne 0x1682e
movb %r12b, (%rsp,%rbp)
cmpq $0x3ff, %rbp            # imm = 0x3FF
jb 0x16821
movl $0x400, %edx            # imm = 0x400
leaq 0x5cef(%rip), %rdi      # 0x1c503
movq %rbx, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0xb6c8
movb 0x1(%r13,%rbp), %r12b
incq %rbp
testb %r12b, %r12b
jne 0x167ea
movl %ebp, %eax
jmp 0x16834
xorl %eax, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x6402
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_O3/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 0x565e(%rip), %r14      # 0x1c7a4
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x1726b
cmpb $0xa, %al
je 0x1717e
movzbl %al, %ecx
cmpl $0xd, %ecx
je 0x1717e
movb %al, (%rsp,%r15)
cmpq $0x3ff, %r15            # imm = 0x3FF
jb 0x17179
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0xb6c8
incq %r15
jmp 0x17149
movl %r15d, %ecx
movb $0x0, (%rsp,%rcx)
movl 0x21371(%rip), %ecx     # 0x384fc
cmpl $0x2, %ecx
je 0x171ba
testl %ecx, %ecx
jne 0x171d2
cmpb $0xd, %al
jne 0x171c8
movl $0x3, 0x2135a(%rip)     # 0x384fc
movq %rbx, %rdi
callq 0x1726b
cmpb $0xa, %al
jne 0x171e7
movl $0x2, 0x21344(%rip)     # 0x384fc
jmp 0x171d2
cmpb $0xd, %al
jne 0x171c8
movq %rbx, %rdi
callq 0x1726b
jmp 0x171d2
movl $0x1, 0x2132a(%rip)     # 0x384fc
movq %rsp, %rdi
callq 0x6402
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
movq 0x8008(%rbx), %rax
leaq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jne 0x1720c
leaq 0x55ea(%rip), %rdi      # 0x1c7e8
xorl %eax, %eax
callq 0xb6c8
movq 0x8008(%rbx), %rax
decq %rax
movq %rax, 0x8008(%rbx)
jmp 0x171d2
// File: /workspace/github_c_makefile_star2_O3/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 0x17232
movq %rsi, %rdi
callq 0x3200
jmp 0x17234
xorl %eax, %eax
movl %eax, 0x8020(%rbx)
movq %rbx, %rdi
callq 0x172d7
movl 0x8020(%rbx), %ecx
movq 0x8030(%rbx), %rax
cmpl $0x2, %ecx
jl 0x17262
cmpq 0x8038(%rbx), %rax
jne 0x17262
decl %ecx
subq %rcx, %rax
movq %rax, 0x8028(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8008(%rdi), %rax
movq 0x8030(%rdi), %rcx
cmpq %rcx, %rax
jb 0x172a0
cmpq 0x8038(%rbx), %rcx
jae 0x172a0
leaq 0x55e0(%rip), %rdi      # 0x1c872
xorl %eax, %eax
callq 0xb6c8
movq 0x8008(%rbx), %rax
cmpq 0x8028(%rbx), %rax
jb 0x172c8
movq 0x8030(%rbx), %rcx
cmpq 0x8038(%rbx), %rcx
jne 0x172c8
movq %rbx, %rdi
callq 0x165b7
movq 0x8008(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8008(%rbx)
movb (%rax), %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xee10
movq %rax, %r12
leaq 0x5531(%rip), %rdx      # 0x1c8ab
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xa0ca
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3420
// File: /workspace/github_c_makefile_star2_O3/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 0x1021c(%rip), %rcx     # 0x275d0
xorl %eax, %eax
callq *0x20(%rcx)
leaq 0x54f1(%rip), %rdx      # 0x1c8b1
movq %rsp, %r14
movq %r14, %rdi
movl $0x80, %esi
movq %rax, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xa0ca
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
testl %eax, %eax
je 0x1740e
movq %rsp, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x30f0
testl %eax, %eax
je 0x1740e
leaq 0x54b3(%rip), %rdi      # 0x1c8b7
movq %rsp, %rsi
xorl %eax, %eax
callq 0xb7f4
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9efa
testl %eax, %eax
jne 0x174a4
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 0x1745b
cmpb $0x0, (%rdi)
je 0x174a1
movl $0x2f, %esi
callq 0x3260
testq %rax, %rax
je 0x17499
movq %rax, %r14
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x110db
movq %r14, %rdi
incq %rdi
movb $0x2f, (%r14)
cmpb $0x0, 0x1(%r14)
jne 0x17469
jmp 0x174a1
movq %rbx, %rdi
callq 0x110db
movq %r15, %rsp
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x78ff(%rip), %r12      # 0x15710
cmpl %ebx, 0x38(%r15,%r12)
jne 0xde66
movl 0x24(%r15,%r12), %eax
cmpl 0x54(%r14), %eax
jne 0xde66
movl 0x3c(%r15,%r12), %ebp
testl %ebp, %ebp
je 0xde42
callq 0x7922
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl $0x1, %eax
cmpl %eax, %ebp
jne 0xde66
movl 0x20(%r15,%r12), %eax
cmpl $-0x1, %eax
je 0xde7e
movl 0x50(%r14), %ecx
movl %ecx, %edx
andl $0xffffdfef, %edx       # imm = 0xFFFFDFEF
cmpl %eax, %edx
je 0xde7e
andl $0xffffdfee, %ecx       # imm = 0xFFFFDFEE
cmpl %eax, %ecx
je 0xde7e
addq $0x20, %r15
cmpq $0x80, %r15
jb 0xde11
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq (%r15,%r12), %rdi
addq $0x30, %rdi
callq *-0x8(%rdi)
movl $0x1, %eax
jmp 0xde75
// File: /workspace/github_c_makefile_star2_O3/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 0x1178c(%rip), %rdx     # 0x14260
xorl %edi, %edi
xorl %esi, %esi
callq 0x2300
leaq 0xe29c(%rip), %rdi      # 0x10d80
xorl %eax, %eax
callq 0x2100
movq 0x114de(%rip), %rax     # 0x13fd0
movq (%rax), %rdi
callq 0x2290
movl $0xa, %edi
popq %rax
jmp 0x2060
// File: /workspace/github_c_makefile_star2_O3/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 0x1174f(%rip), %rsi     # 0x14260
xorl %edi, %edi
callq 0x22f0
movups 0x11741(%rip), %xmm0    # 0x14260
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movups 0x11744(%rip), %xmm0    # 0x14270
movaps %xmm0, 0x10(%rbx)
movups 0x11749(%rip), %xmm0    # 0x14280
movaps %xmm0, 0x20(%rbx)
movups 0x1174a(%rip), %xmm0    # 0x1428c
movups %xmm0, 0x2c(%rbx)
leaq -0x81(%rip), %rdi       # 0x2acc
callq 0xcc00
movq %rbx, %rdi
callq 0x22e0
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2300
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x18(%rsp), %rsi
movups %xmm0, 0x68(%rsi)
movups %xmm0, 0x58(%rsi)
movups %xmm0, 0x48(%rsi)
movups %xmm0, 0x38(%rsi)
movups %xmm0, 0x28(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x8(%rsi)
movq $0x0, 0x78(%rsi)
movq $0x1, (%rsi)
movl $0x1, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2260
addq $0x98, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x11405(%rip), %rax     # 0x13fd0
movq (%rax), %rdi
callq 0x2290
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
xorl %edi, %edi
callq 0x21c0
testl %eax, %eax
js 0x2bf6
je 0x2bf1
movzbl 0x7(%rsp), %eax
jmp 0x2bf6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x111641(%rip)    # 0x1142c4
movl %eax, 0x11163f(%rip)    # 0x1142c8
movl %eax, 0x11163d(%rip)    # 0x1142cc
movl %eax, 0x111623(%rip)    # 0x1142b8
movl %eax, 0x111621(%rip)    # 0x1142bc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x1155a(%rip)     # 0x14200
movl %eax, 0x11558(%rip)     # 0x14204
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x10bce0(%rip)    # 0x114314
jne 0x8707
addl $0xffffff08, %r14d      # imm = 0xFFFFFF08
cmpl $0x3, %r14d
ja 0x8729
leaq 0x584a(%rip), %rax      # 0xde9c
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
andl $0xf, %ebx
shll $0x10, %ebx
leaq 0xbc38(%rip), %rax      # 0x142a0
addq %rbx, %rax
movq %rax, 0xbb7e(%rip)      # 0x141f0
jmp 0x86b8
testb %bl, %bl
js 0x8681
movq 0xbb71(%rip), %rax      # 0x141f0
jmp 0x869d
movl $0x1, 0x10bc15(%rip)    # 0x1142a0
movl %ebx, %ecx
andl $0xf, %ecx
shll $0x6, %ecx
leaq 0xbc06(%rip), %rax      # 0x142a0
addq %rcx, %rax
movq %rax, 0xbb54(%rip)      # 0x141f8
movl %ebx, %eax
andl $0x20, %eax
movl %eax, 0x10bbf5(%rip)    # 0x1142a4
andl $0x40, %ebx
movl %ebx, 0x10bbf0(%rip)    # 0x1142a8
cmpl $0x0, 0x10bbed(%rip)    # 0x1142ac
jne 0x86ff
movl $0x1, 0x10bbe1(%rip)    # 0x1142ac
xorl %eax, %eax
leaq 0xbbcc(%rip), %rcx      # 0x142a0
movw $0x42c3, 0xf800(%rax,%rcx) # imm = 0x42C3
movb $-0x8, 0xf802(%rax,%rcx)
addq $0x3, %rax
cmpl $0x42, %eax
jne 0x86d4
movw $0xeded, 0x1b3ea(%rip)  # imm = 0xEDED
movb $-0x37, 0x1b3e5(%rip)   # 0x23ae4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0xb8ea(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x8688(%rip), %rsi      # 0x10da0
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2200
jmp 0x863a
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2390
// File: /workspace/github_c_makefile_star2_O3/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, 0x10badf(%rip)    # 0x11431a
movl $0x2, %ebx
leaq 0x10bbf9(%rip), %r12    # 0x114440
leaq 0x8580(%rip), %r14      # 0x10dce
leaq 0x8(%rsp), %r15
cmpq $0x0, (%r12,%rbx,8)
jne 0x8894
leaq (,%rbx,8), %r13
leal 0x41(%rbx), %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2380
movq %r15, %rdi
callq 0x2040
movq %rax, (%r13,%r12)
testq %rax, %rax
je 0x8894
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
orw %ax, 0x10ba86(%rip)     # 0x11431a
incq %rbx
cmpq $0x10, %rbx
jne 0x8853
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x88df
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x88df
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 0x88c7
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2280
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2070
movq %rbx, %rdi
callq 0x2240
testq %rax, %rax
leaq 0x85da(%rip), %r14      # 0x10f19
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
cmpb $0x2e, (%rbp)
jne 0x8987
cmpb $0x0, 0x1(%rbp)
jne 0x8987
cmpb $0x2e, (%rbx)
je 0x8987
movb $0x0, (%rbp)
movq %r13, %rdi
movl $0x2e, %esi
callq 0x20f0
testq %rax, %rax
je 0x89b5
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_O3/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 0x8a3e
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0x8a3e
testq %rbx, %rbx
je 0x8a3b
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2110
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rbx, %r15
leaq 0x10baae(%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 0x2370
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8ac8
movq %r8, %r14
movq %rdx, %rsi
movq %rdi, %rbx
movb $0x0, (%rdi)
movq %rcx, %rax
orq %r8, %rax
jne 0x8a78
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2070
movq %rsi, %rdi
movq %rcx, %rsi
callq 0x89d9
testq %rax, %rax
je 0x8a98
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2070
testq %r14, %r14
je 0x8ac8
cmpb $0x2e, (%r14)
je 0x8ab1
movq %rbx, %rdi
callq 0x20e0
movw $0x2e, (%rbx,%rax)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: findPath
char* findPath(char* path, char* env)
{
	char *p, *envp;
	static char name[_MAX_PATH+1];

	if (*path == '/' ||   	/* qualified name */
	    *path == '.')
		return path;
	if ((envp = getenv(env)) != NULL)   /* lookup all pathes */
	  while (*envp) {
		p = name;
		while (*envp && (*p = *envp++) != ':') {
			if ((uint)(p - name) >= sizeof(name))
				break;
			++p;
		}
		if (*--p != '/')
			*++p = '/';
		++p;
		if ((p - name) + strlen(path) >= sizeof(name))
			break;
		strcpy(p, path);
		if (access(name, F_OK) == 0)
			return name;
	  }
    /* search within startdir */
	p=buildname(StartDir, path);
	if (access(p, F_OK) == 0)	/* file exist in current dir */
		return p;
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb (%rdi), %al
andb $-0x2, %al
cmpb $0x2e, %al
je 0x8bb5
movq %rsi, %rdi
callq 0x2040
testq %rax, %rax
je 0x8b91
movq %rax, %r14
leaq 0x10babd(%rip), %r15    # 0x1145c0
movb (%r14), %al
testb %al, %al
je 0x8b91
xorl %r12d, %r12d
movq %r12, %r13
movb %al, (%r12,%r15)
cmpb $0x3a, %al
je 0x8b37
cmpl $0x104, %r13d           # imm = 0x104
ja 0x8b37
movb 0x1(%r14,%r13), %al
leaq 0x1(%r13), %r12
testb %al, %al
jne 0x8b11
addq %r15, %r12
jmp 0x8b3b
leaq (%r15,%r13), %r12
cmpb $0x2f, -0x1(%r12)
jne 0x8b48
decq %r12
jmp 0x8b4d
movb $0x2f, (%r12)
movq %rbx, %rdi
callq 0x20e0
subq %r15, %rax
addq %r12, %rax
incq %rax
cmpq $0x104, %rax            # imm = 0x104
ja 0x8b91
addq %r13, %r14
incq %r14
incq %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2090
movq %r15, %rdi
xorl %esi, %esi
callq 0x2320
testl %eax, %eax
jne 0x8b03
movq %r15, %rbx
jmp 0x8bb5
leaq 0x10bb38(%rip), %rdi    # 0x1146d0
movq %rbx, %rsi
callq 0x89d9
movq %rax, %r14
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2320
testl %eax, %eax
cmoveq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: mkFCB
void mkFCB( byte *p, char *s)
{
    int i, c;

    *p = 0;
    if ( s[ 1] == ':') {
        if (( c = *s) >= 'a') c &= 0x5f;
        *p = (byte)( c - 'A' + 1); s += 2;
    }
    p++;
    for ( i = 0; i < 8; i++) {
        c = ( *s && *s != '.') ? *s++ : ' ';
//	if ( c >= 'a' && c <= 'z') c &= 0x5f;
        *p++ = (byte)c;
    }
    while ( *s && *s != '.') s++;
    if ( *s) s++;
    for ( i = 0; i < 3; i++) {
        c = ( *s) ? *s++ : ' ';
//	if ( c >= 'a' && c <= 'z') c &= 0x5f;
        *p++ = (byte)c;
    }
}

// Assembly:
movb $0x0, (%rdi)
cmpb $0x3a, 0x1(%rsi)
jne 0x917e
movzbl (%rsi), %eax
movl %eax, %ecx
andb $0x5f, %cl
cmpb $0x61, %al
movzbl %cl, %ecx
cmovll %eax, %ecx
addb $-0x40, %cl
movb %cl, (%rdi)
addq $0x2, %rsi
incq %rdi
xorl %eax, %eax
movzbl (%rsi), %edx
movb $0x20, %cl
testl %edx, %edx
je 0x9196
cmpl $0x2e, %edx
je 0x9196
incq %rsi
movl %edx, %ecx
movb %cl, (%rdi,%rax)
incq %rax
cmpl $0x8, %eax
jne 0x9183
jmp 0x91a6
incq %rsi
movzbl (%rsi), %ecx
testl %ecx, %ecx
je 0x91b2
cmpl $0x2e, %ecx
jne 0x91a3
cmpb $0x1, %cl
sbbq $-0x1, %rsi
xorl %ecx, %ecx
movl $0x20, %edx
leaq (%rdi,%rcx), %r8
movzbl (%rsi), %r9d
xorl %r10d, %r10d
testb %r9b, %r9b
setne %r10b
cmovel %edx, %r9d
addq %r10, %rsi
movb %r9b, (%rax,%r8)
incq %rcx
cmpl $0x3, %ecx
jne 0x91c0
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: FindNextFile
int FindNextFile(
    DIR *hFndFile,				    	// handle to search  
    WIN32_FIND_DATA *lpFindFileData) 	// pointer to structure for data on found file  
{
    struct dirent *pDirent;
    struct stat statbuf;
	if (hFndFile==INVALID_HANDLE_VALUE)
		return 0;
    while ((pDirent = readdir(hFndFile)) != NULL) {
       	strncpy(lpFindFileData->cFileName, pDirent->d_name, _MAX_PATH-1);
		if (fnmatch(ffName, CharUpperX(pDirent->d_name), FNM_CASEFOLD)==0) {
			if (stat(buildname(ffDir,lpFindFileData->cFileName), &statbuf)!=0) { 
				DEBUGOUT(stderr, "FindNext ERROR: failed while stat file `%s`\n",lpFindFileData->cFileName);
				break;
			}
			if (!(statbuf.st_mode & S_IFDIR)) {
				lpFindFileData->cAlternateFileName[0]=0;
				lpFindFileData->dwFileAttributes=(*(lpFindFileData->cFileName)=='.' ? FILE_ATTRIBUTE_HIDDEN : 0);	
				lpFindFileData->nFileSizeHigh=0;
				lpFindFileData->nFileSizeLow=(DWORD)statbuf.st_size;
				return 1;
			}
		}
    }
//    if (hFndFile!=INVALID_HANDLE_VALUE) closedir(hFndFile);
//    hFindFile=INVALID_HANDLE_VALUE;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x970b
movq %rsi, %r14
movq %rdi, %r12
callq 0x2270
testq %rax, %rax
je 0x970b
movq %rax, %rbx
movq %r14, (%rsp)
leaq 0x18(%r14), %r15
leaq 0x10c9e2(%rip), %r13    # 0x116000
leaq 0x13(%rbx), %rbp
movl $0x103, %edx            # imm = 0x103
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2070
movb 0x13(%rbx), %r14b
testb %r14b, %r14b
je 0x965c
callq 0x2030
addq $0x14, %rbx
movq (%rax), %rcx
movsbq %r14b, %rdx
movb (%rcx,%rdx,4), %cl
movb %cl, -0x1(%rbx)
movb (%rbx), %r14b
incq %rbx
testb %r14b, %r14b
jne 0x9644
movq %r13, %rdi
movq %rbp, %rsi
movl $0x10, %edx
callq 0x2140
testl %eax, %eax
jne 0x9697
leaq 0x10c879(%rip), %rdi    # 0x115ef0
movq %r15, %rsi
callq 0x89d9
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2230
testl %eax, %eax
jne 0x96af
testb $0x40, 0x21(%rsp)
je 0x96dc
movq %r12, %rdi
callq 0x2270
movq %rax, %rbx
testq %rax, %rax
jne 0x961e
xorl %ebp, %ebp
jmp 0x970b
cmpl $0x0, 0x10ac5e(%rip)    # 0x114314
movl $0x0, %ebp
je 0x970b
movq 0xa934(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x7757(%rip), %rsi      # 0x10e25
xorl %ebp, %ebp
movq %r15, %rdx
xorl %eax, %eax
callq 0x2200
jmp 0x970b
movq (%rsp), %rcx
movb $0x0, 0x11c(%rcx)
xorl %eax, %eax
cmpb $0x2e, 0x18(%rcx)
sete %al
addl %eax, %eax
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rcx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: FindClose
int FindClose(
    DIR *hFndFile 					// file search handle 
   )
{
	int res;
	if (hFndFile && (hFndFile!=INVALID_HANDLE_VALUE)) {
		res=closedir(hFndFile);
		hFindFile=INVALID_HANDLE_VALUE;
		return res==0;
	}
	return TRUE;
}

// Assembly:
testq %rdi, %rdi
je 0x9743
pushq %rax
callq 0x21a0
movl %eax, %ecx
movq $0x0, 0x10c7a9(%rip) # 0x115ee0
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x8, %rsp
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: GetDiskFreeSpace
int GetDiskFreeSpace(
    char* lpRootPathName,			// address of root path 
    DWORD *lpSectorsPerCluster,		// address of sectors per cluster 
    DWORD *lpBytesPerSector,		// address of bytes per sector 
    DWORD *lpNumberOfFreeClusters,	// address of number of free clusters  
    DWORD *lpTotalNumberOfClusters 	// address of total number of clusters  
   )	
{ 
  struct statvfs stat;
  if (statvfs(lpRootPathName, &stat) != 0) {
    // error happens, just quits here
    return 0;
  }
  *lpTotalNumberOfClusters=stat.f_blocks;
  *lpNumberOfFreeClusters=stat.f_bavail;
  *lpBytesPerSector=stat.f_bsize;
  *lpSectorsPerCluster=stat.f_frsize/stat.f_bsize;
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x8(%rsp), %rsi
callq 0x22d0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x979d
movq 0x18(%rsp), %rax
movq %rax, (%r12)
movq 0x28(%rsp), %rax
movq %rax, (%r15)
movq 0x8(%rsp), %rcx
movq %rcx, (%r14)
movq 0x10(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: cpm_findnext
byte cpm_findnext( void)
{
    WIN32_FIND_DATA aFindData;
    char *p;
    struct FCB *fcb = (struct FCB *)(mem + cpm_dma_addr);

    if ( hFindFile == INVALID_HANDLE_VALUE) return 0xff;

    while ( FindNextFile( hFindFile, &aFindData)) {
	p = aFindData.cAlternateFileName;
	if ( !*p) p = aFindData.cFileName;
	if (( aFindData.dwFileAttributes & 
		(FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_HIDDEN)) == 0) {
	    DWORD l = aFindData.nFileSizeLow;
	    if ( aFindData.nFileSizeHigh || l > 0x7fff80) l = 0x7fff80;
	    l = (l + 0x7f) >> 7;
	    fcb->ex = (byte)(l >> 7);
	    fcb->rc = (byte)(l & 0x7f);
	    mkFCB( mem + cpm_dma_addr, p);
	    return 0;
	}
    }
    FindClose( hFindFile); 
    hFindFile = INVALID_HANDLE_VALUE;
    return 0xff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movb $-0x1, %bl
cmpq $0x0, 0x10c71f(%rip)    # 0x115ee0
je 0x9876
movq 0xaa22(%rip), %r15      # 0x141f0
movzwl 0xaa34(%rip), %r12d     # 0x1420a
leaq 0x8(%rsp), %r14
movq 0x10c6fe(%rip), %rdi    # 0x115ee0
movq %r14, %rsi
callq 0x95dc
testl %eax, %eax
je 0x985a
movzwl 0x8(%rsp), %eax
testl $0x4002, %eax           # imm = 0x4002
jne 0x97db
leaq 0x124(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0x20(%rsp), %rax
cmoveq %rax, %rsi
movq -0x8(%rax), %rcx
movl $0x7fff80, %edx         # imm = 0x7FFF80
cmpq %rdx, %rcx
cmovbq %rcx, %rdx
addl $0x7f, %edx
shrl $0x7, %edx
cmpq $0x0, -0x10(%rax)
movl $0xffff, %eax           # imm = 0xFFFF
cmoveq %rdx, %rax
movl %eax, %ecx
shrl $0x7, %ecx
movb %cl, 0xc(%r15,%r12)
andb $0x7f, %al
movb %al, 0xf(%r15,%r12)
movzwl 0xa9c0(%rip), %edi      # 0x1420a
addq 0xa99f(%rip), %rdi      # 0x141f0
callq 0x915c
xorl %ebx, %ebx
jmp 0x9876
movq 0x10c67f(%rip), %rdi    # 0x115ee0
testq %rdi, %rdi
je 0x986b
callq 0x21a0
movq $0x0, 0x10c66a(%rip) # 0x115ee0
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: cpm_findfirst
byte cpm_findfirst( byte *fcbaddr)
{
    WIN32_FIND_DATA aFindData;
    char *p;
    struct FCB *fcb = (struct FCB *)(mem + cpm_dma_addr);
    DWORD l;

    if ( hFindFile != INVALID_HANDLE_VALUE) FindClose( hFindFile);

    if ( !mk_filename( filename, fcbaddr)) return 0xff;

    hFindFile = FindFirstFile( filename, &aFindData);
    if ( hFindFile == INVALID_HANDLE_VALUE) return 0xff;

    p = aFindData.cAlternateFileName;
    if ( !*p) p = aFindData.cFileName;
    if ( aFindData.dwFileAttributes & 
	 (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_HIDDEN)) {
		return cpm_findnext();
    }

    l = aFindData.nFileSizeLow;
    if ( aFindData.nFileSizeHigh || l > 0x7fff80) l = 0x7fff80;
    l = (l + 0x7f) >> 7;
    fcb->ex = (byte)(l >> 7);
    fcb->rc = (byte)(l & 0x7f);
    mkFCB( mem + cpm_dma_addr, p);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdi, %rbx
movq 0xa953(%rip), %r14      # 0x141f0
movzwl 0xa965(%rip), %r15d     # 0x1420a
movq 0x10c634(%rip), %rdi    # 0x115ee0
testq %rdi, %rdi
je 0x98c1
callq 0x21a0
movq $0x0, 0x10c61f(%rip) # 0x115ee0
leaq 0x10c218(%rip), %rdi    # 0x115ae0
movq %rbx, %rsi
callq 0x91e6
movb $-0x1, %bl
testq %rax, %rax
je 0x9968
leaq 0x10c1fe(%rip), %rdi    # 0x115ae0
movq %rsp, %rsi
callq 0x939f
movq %rax, 0x10c5ef(%rip)    # 0x115ee0
testq %rax, %rax
je 0x9968
movzwl (%rsp), %eax
testl $0x4002, %eax           # imm = 0x4002
je 0x990a
callq 0x97a9
movl %eax, %ebx
jmp 0x9968
leaq 0x11c(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0x18(%rsp), %rax
cmoveq %rax, %rsi
movq -0x8(%rax), %rcx
movl $0x7fff80, %edx         # imm = 0x7FFF80
cmpq %rdx, %rcx
cmovbq %rcx, %rdx
addl $0x7f, %edx
shrl $0x7, %edx
cmpq $0x0, -0x10(%rax)
movl $0xffff, %eax           # imm = 0xFFFF
cmoveq %rdx, %rax
movl %eax, %ecx
shrl $0x7, %ecx
movb %cl, 0xc(%r14,%r15)
andb $0x7f, %al
movb %al, 0xf(%r14,%r15)
movzwl 0xa8b0(%rip), %edi      # 0x1420a
addq 0xa88f(%rip), %rdi      # 0x141f0
callq 0x915c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: cpm_file_close
byte cpm_file_close( byte *fcbaddr)
{
    int i;
    struct FCB *fcb = (struct FCB *)fcbaddr;

	if (( i = fcb->d[ 0]) > 0 && --i < MAXFCB) {
DEBUGOUT( stderr, "CLOSE %d - ", i);
	    if ( fcbs[ i].fp) fclose( fcbs[ i].fp);
	    fcbs[ i].fp = 0;
	    fcb->d[ 0] = 0;
	    return 0;
	}
	if ( i == 0) return 0;
	return 0xff;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movb 0x10(%rdi), %al
testb %al, %al
je 0x9c81
movzbl %al, %ebp
decl %ebp
cmpb $0x40, %al
ja 0x9c7b
movq %rdi, %rbx
cmpl $0x0, 0x10a6c7(%rip)    # 0x114314
jne 0x9c88
movl %ebp, %eax
shlq $0x5, %rax
leaq 0x10c4b4(%rip), %rcx    # 0x116110
leaq (%rcx,%rax), %r14
movq (%rax,%rcx), %rdi
testq %rdi, %rdi
je 0x9c6e
callq 0x20c0
movq $0x0, (%r14)
movb $0x0, 0x10(%rbx)
jmp 0x9c81
movb $-0x1, %al
testl %ebp, %ebp
jne 0x9c83
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0xa369(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
leaq 0x71ce(%rip), %rsi      # 0x10e67
movl %ebp, %edx
xorl %eax, %eax
callq 0x2200
jmp 0x9c4f
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: cpm_change_filesize
void cpm_change_filesize( byte *fcbaddr)
{
    int i, sz;
    struct FCB *fcb = (struct FCB *)fcbaddr;

    sz = (fcb->d[ 3] << 16) + (fcb->d[2] << 8) + fcb->d[1];
    if (( sz >> 7) == fcb->ex && (sz & 0x7f) > fcb->rc &&
	 mk_filename( filename, fcbaddr) &&
	 ( i = open( filename, O_RDWR)) != -1) {
		chsize( i, (( fcb->ex << 7) + fcb->rc) << 7);
		close( i);
DEBUGOUT( stderr, "Change file size : %s\n", filename);
    }
}

// Assembly:
movzwl 0x12(%rdi), %ecx
shll $0x8, %ecx
movzbl 0x11(%rdi), %eax
orl %eax, %ecx
shrl $0x7, %ecx
movzbl 0xc(%rdi), %edx
cmpl %edx, %ecx
jne 0x9d29
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x7f, %eax
movzbl 0xf(%rdi), %ecx
cmpl %ecx, %eax
jbe 0x9d23
leaq 0x10be0c(%rip), %rdi    # 0x115ae0
movq %rbx, %rsi
callq 0x91e6
testq %rax, %rax
je 0x9d23
leaq 0x10bdf8(%rip), %rdi    # 0x115ae0
movl $0x2, %esi
xorl %eax, %eax
callq 0x2310
cmpl $-0x1, %eax
je 0x9d23
movl %eax, %ebp
movzbl 0xc(%rbx), %eax
movzbl 0xf(%rbx), %esi
shll $0xe, %eax
shll $0x7, %esi
addq %rax, %rsi
movl %ebp, %edi
callq 0x2120
movl %ebp, %edi
callq 0x2190
cmpl $0x0, 0x10a5f3(%rip)    # 0x114314
jne 0x9d2a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x23d0
jmp 0x9d23
// File: /workspace/github_c_makefile_star2_O3/serge-404[P]CPM32/cpm.c
// Function: cpm_file_size
byte cpm_file_size( byte *fcbaddr)
{
    struct FCB *fcb = (struct FCB *)fcbaddr;
    DWORD d;

    if ( cpm_file_open( fcbaddr, CF_OPEN)) return 0xff;
    d = fcb->d[1] + (fcb->d[2] << 8) + (fcb->d[3] << 16);
    fcb->r0 = (byte)d;
    fcb->r1 = (byte)(d >> 8); 
    fcb->r2 = (byte)(d >> 16);
    cpm_file_close( fcbaddr);

    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x9977
movl %eax, %ecx
movb $-0x1, %al
testb %cl, %cl
jne 0xa08f
movzwl 0x11(%rbx), %eax
movb 0x13(%rbx), %cl
movw %ax, 0x21(%rbx)
movb %cl, 0x23(%rbx)
movq %rbx, %rdi
callq 0x9c2f
xorl %eax, %eax
popq %rbx
retq