LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineNew
static struct pipeline* pipelineNew(char ***cmds, unsigned options)
/* create a new pipeline object. Doesn't start processes */
{
static char *memPseudoCmd[] = {"[mem]", NULL};
struct pipeline *pl;
int iCmd;

AllocVar(pl);
pl->groupLeader = -1;
pl->pipeFd = -1;
pl->options = options;
pl->procName = joinCmds(cmds);

if (cmds[0] == NULL)
    errAbort("no commands in pipeline");

if (options & pipelineMemInput)
    {
    /* add proc for forked process to write memory to pipeline */
    slAddTail(&pl->procs, plProcNew(memPseudoCmd, pl));
    }

for(iCmd = 0; cmds[iCmd] != NULL; iCmd++)
    slAddTail(&pl->procs, plProcNew(cmds[iCmd], pl));

return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl $0x38, %edi
callq 0xee10
movq %rax, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%r14)
movl %eax, 0x18(%r14)
movl %ebp, 0xc(%rsp)
movl %ebp, 0x1c(%r14)
movl $0x200, %edi            # imm = 0x200
callq 0xad14
movq %rax, %r15
movq %rax, 0x10(%rsp)
movq (%rbx), %rax
testq %rax, %rax
je 0x11d46
xorl %ebp, %ebp
leaq 0x9bf9(%rip), %r12      # 0x1b8e1
testq %rbp, %rbp
je 0x11d00
movq %r15, %rdi
leaq 0x9553(%rip), %rsi      # 0x1b24a
callq 0xaf83
movq (%rbx,%rbp,8), %rax
cmpq $0x0, (%rax)
je 0x11d39
xorl %r13d, %r13d
testq %r13, %r13
je 0x11d1d
movq %r15, %rdi
movq %r12, %rsi
callq 0xaf83
movq (%rbx,%rbp,8), %rax
movq (%rax,%r13), %rsi
movq %r15, %rdi
callq 0xaf83
movq (%rbx,%rbp,8), %rax
cmpq $0x0, 0x8(%rax,%r13)
leaq 0x8(%r13), %r13
jne 0x11d09
movq 0x8(%rbx,%rbp,8), %rax
incq %rbp
testq %rax, %rax
jne 0x11ce8
leaq 0x10(%rsp), %rdi
callq 0xad70
movq %rax, 0x10(%r14)
cmpq $0x0, (%rbx)
jne 0x11d68
leaq 0x94d1(%rip), %rdi      # 0x1b232
xorl %eax, %eax
callq 0xb6c8
testb $0x8, 0xc(%rsp)
je 0x11d89
leaq 0x1583a(%rip), %rdi     # 0x275b0
movq %r14, %rsi
callq 0x122f3
movq %r14, %rdi
movq %rax, %rsi
callq 0x664d
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11db4
addq $0x8, %rbx
movq %r14, %rsi
callq 0x122f3
movq %r14, %rdi
movq %rax, %rsi
callq 0x664d
movq (%rbx), %rdi
addq $0x8, %rbx
testq %rdi, %rdi
jne 0x11d95
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineOpen
struct pipeline *pipelineOpen(char ***cmds, unsigned opts,
                              char *otherEndFile, char *stderrFile)
/* Create a pipeline from an array of commands.  See pipeline.h for
 * full documentation */
{
int otherEndFd;
int stderrFd = (stderrFile == NULL) ? STDERR_FILENO : openWrite(stderrFile, FALSE);

checkOpts(opts);
boolean append = ((opts & pipelineAppend) != 0);
if (opts & pipelineRead)
    otherEndFd = (otherEndFile == NULL) ? STDIN_FILENO : openRead(otherEndFile);
else
    otherEndFd = (otherEndFile == NULL) ? STDOUT_FILENO : openWrite(otherEndFile, append);
struct pipeline *pl = pipelineOpenFd(cmds, opts, otherEndFd, stderrFd);
safeClose(&otherEndFd);
if (stderrFile != NULL)
    safeClose(&stderrFd);
return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
testq %rcx, %rcx
je 0x11e49
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11ef3
movl %eax, %r15d
jmp 0x11e4f
movl $0x2, %r15d
movl %r15d, (%rsp)
movl %ebp, %edi
callq 0x11c58
testb $0x1, %bpl
jne 0x11e7a
testq %r12, %r12
je 0x11ea5
movl %ebp, %esi
shrl $0x4, %esi
andl $0x1, %esi
movq %r12, %rdi
callq 0x11ef3
movl %eax, %r13d
jmp 0x11eb0
testq %r12, %r12
je 0x11ead
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x35b0
movl %eax, %r13d
testl %eax, %eax
jns 0x11eb0
leaq 0x96b7(%rip), %rdi      # 0x1b550
movq %r12, %rsi
xorl %eax, %eax
callq 0xb7f4
jmp 0x11eb0
movl $0x1, %r13d
jmp 0x11eb0
xorl %r13d, %r13d
leaq 0x4(%rsp), %r12
movl %r13d, (%r12)
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r15d, %ecx
callq 0x11bdb
movq %rax, %r14
movq %r12, %rdi
callq 0x11f36
testq %rbx, %rbx
je 0x11ee1
movq %rsp, %rdi
callq 0x11f36
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: openWrite
static int openWrite(char *fname, boolean append)
/* open a file for write access */
{
int flags = O_WRONLY|O_CREAT;
if (append)
    flags |= O_APPEND;
else
    flags |= O_TRUNC;
int fd = open(fname, flags, 0666);
if (fd < 0)
    errnoAbort("can't open for write access: %s", fname);
return fd;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
testl %esi, %esi
setne %al
shll $0x9, %eax
addl $0x241, %eax            # imm = 0x241
movl %eax, %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x35b0
movl %eax, %ebp
testl %eax, %eax
jns 0x11f2d
leaq 0x960d(%rip), %rdi      # 0x1b530
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb7f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: safeClose
static void safeClose(int *fdPtr)
/* Close with error checking.  *fdPtr == -1 indicated already closed */
{
int fd = *fdPtr;
if (fd != -1)
    {
    if (close(fd) < 0)
        errnoAbort("close failed on fd %d", fd);
    *fdPtr = -1;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl (%rdi), %ebp
cmpl $-0x1, %ebp
je 0x11f64
movq %rdi, %rbx
movl %ebp, %edi
callq 0x3350
testl %eax, %eax
jns 0x11f5e
leaq 0x961a(%rip), %rdi      # 0x1b56f
movl %ebp, %esi
xorl %eax, %eax
callq 0xb7f4
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineOpenMem
struct pipeline *pipelineOpenMem(char ***cmds, unsigned opts,
                                 void *otherEndBuf, size_t otherEndBufSize,
                                 int stderrFd)
/* Create a pipeline from an array of commands, with the pipeline input/output
 * in a memory buffer.  See pipeline.h for full documentation.  Currently only
 * input to a read pipeline is supported  */
{
struct pipeline *pl;
checkOpts(opts);
if (opts & pipelineWrite)
    errAbort("pipelineOpenMem only supports read pipelines at this time");
opts |= pipelineMemInput;

pl = pipelineNew(cmds, opts);
pipelineStartRead(pl, STDIN_FILENO, stderrFd, otherEndBuf, otherEndBufSize);
return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
movl %esi, %edi
callq 0x11c58
testb $0x2, %r15b
je 0x11f9d
leaq 0x90fd(%rip), %rdi      # 0x1b093
xorl %eax, %eax
callq 0xb6c8
orl $0x8, %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x11c90
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x11dc6
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineFile
FILE *pipelineFile(struct pipeline *pl)
/* Get a FILE object wrapped around the pipeline.  Do not close the FILE, is
 * owned by the pipeline object.  A FILE is created on first call to this
 * function.  Subsequent calls return the same FILE.*/
{
if (pl->pipeFh == NULL)
    {
    /* create FILE* on first access */
    char *mode = (pl->options & pipelineRead) ? "r" : "w";
    if (pl->pipeLf != NULL)
        errAbort("can't call pipelineFile after having associated a lineFile with a pipeline");
    pl->pipeFh = fdopen(pl->pipeFd, mode);
    if (pl->pipeFh == NULL)
        errnoAbort("fdopen failed for: %s", pl->procName);
    pl->stdioBuf = needLargeMem(FILE_BUF_SIZE);
    setvbuf(pl->pipeFh, pl->stdioBuf,  _IOFBF, FILE_BUF_SIZE);
    }
return pl->pipeFh;
}

// Assembly:
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x1203d
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x1, 0x1c(%rdi)
leaq 0x79e4(%rip), %rax      # 0x19a33
leaq 0xa7da(%rip), %r14      # 0x1c830
cmoveq %rax, %r14
cmpq $0x0, 0x30(%rdi)
je 0x1206f
leaq 0x9065(%rip), %rdi      # 0x1b0cd
xorl %eax, %eax
callq 0xb6c8
movl 0x18(%rbx), %edi
movq %r14, %rsi
callq 0x3580
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x12095
movq 0x10(%rbx), %rsi
leaq 0x908a(%rip), %rdi      # 0x1b118
xorl %eax, %eax
callq 0xb7f4
movl $0x10000, %edi          # imm = 0x10000
callq 0xec18
movq %rax, 0x28(%rbx)
movq 0x20(%rbx), %rdi
movl $0x10000, %ecx          # imm = 0x10000
movq %rax, %rsi
xorl %edx, %edx
callq 0x3590
movq 0x20(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineLineFile
struct lineFile *pipelineLineFile(struct pipeline *pl)
/* Get a lineFile object wrapped around the pipeline.  Do not close the
 * lineFile, is owned by the pipeline object.  A lineFile is created on first
 * call to this function.  Subsequent calls return the same object.*/
{
if (pl->pipeLf == NULL)
    {
    /* create line on first acess */
    if (pl->pipeFh != NULL)
        errAbort("can't call pipelineLineFile after having associated a FILE with a pipeline");
    if (pl->options & pipelineWrite)
        errAbort("can't associated a lineFile with a write pipeline");
    pl->pipeLf = lineFileAttach(pipelineDesc(pl), TRUE, pl->pipeFd);
    }
return pl->pipeLf;
}

// Assembly:
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x120cc
retq
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
je 0x120e5
leaq 0x9050(%rip), %rdi      # 0x1b12e
xorl %eax, %eax
callq 0xb6c8
testb $0x2, 0x1c(%rbx)
je 0x120f9
leaq 0x9087(%rip), %rdi      # 0x1b179
xorl %eax, %eax
callq 0xb6c8
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %edx
movl $0x1, %esi
callq 0xcc75
movq %rax, 0x30(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineDumpCmds
void pipelineDumpCmds(char ***cmds)
/* Dump out pipeline-formatted commands to stdout for debugging. */
{
char **cmd;
boolean first = TRUE;
while ((cmd = *cmds++) != NULL)
   {
   char *word;
   if (first)
      first = FALSE;
   else
      printf("| ");
   while ((word = *cmd++) != NULL)
       printf("%s ", word);
   }
printf("<BR>\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r12
testq %r12, %r12
je 0x122dc
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8fb6(%rip), %r14      # 0x1b24b
leaq 0x9340(%rip), %r15      # 0x1b5dc
testb $0x1, %al
je 0x122aa
movq %r14, %rdi
xorl %eax, %eax
callq 0x3270
movq (%r12), %rsi
testq %rsi, %rsi
je 0x122ce
addq $0x8, %r12
movq %r15, %rdi
xorl %eax, %eax
callq 0x3270
movq (%r12), %rsi
addq $0x8, %r12
testq %rsi, %rsi
jne 0x122b7
addq $0x8, %rbx
movq (%rbx), %r12
movb $0x1, %al
testq %r12, %r12
jne 0x1229c
leaq 0x9377(%rip), %rdi      # 0x1b65a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3100
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: plProcNew
static struct plProc* plProcNew(char **cmd, struct pipeline *pl)
/* create a new plProc object for a command. */
{
struct plProc* proc;
AllocVar(proc);
proc->pl = pl;
proc->cmd = cloneCmdVector(cmd);
proc->state = procStateNew;
return proc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0xee10
movq %rax, %rbx
movq %r15, 0x8(%rax)
cmpq $0x0, (%r14)
je 0x1232a
xorl %r13d, %r13d
cmpq $0x0, 0x8(%r14,%r13,8)
leaq 0x1(%r13), %r13
jne 0x1231c
jmp 0x1232d
xorl %r13d, %r13d
movl %r13d, %r12d
leaq 0x8(,%r12,8), %rdi
callq 0xee10
movq %rax, %r15
testl %r13d, %r13d
je 0x1235f
xorl %r13d, %r13d
movq (%r14,%r13,8), %rdi
callq 0x6402
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x12348
jmp 0x12362
xorl %r12d, %r12d
movq $0x0, (%r15,%r12,8)
movq %r15, 0x10(%rbx)
movl $0x0, 0x1c(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipeCreate
static int pipeCreate(int *writeFd)
/* create a pipe or die, return readFd */
{
int pipeFds[2];
if (pipe(pipeFds) < 0)
    errnoAbort("can't create pipe");
*writeFd = pipeFds[1];
return pipeFds[0];
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3360
testl %eax, %eax
jns 0x123a6
leaq 0x8eaf(%rip), %rdi      # 0x1b24e
xorl %eax, %eax
callq 0xb7f4
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movl 0x8(%rsp), %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineExec
static void pipelineExec(struct pipeline* pl, int stdinFd, int stdoutFd, int stderrFd,
                         void *otherEndBuf, size_t otherEndBufSize)
/* Fork the group leader, which then launches all all processes in a pipeline,
 * stdinFd and stdoutFd are the ends of the pipeline, stderrFd is applied to
 * all processes, including group leader */
{
assert(pl->groupLeader < 0);  // should not be set
if ((pl->groupLeader = fork()) < 0)
    errnoAbort("can't fork");
if (pl->groupLeader == 0)
    {
    groupLeaderRun(pl, stdinFd, stdoutFd, stderrFd, otherEndBuf, otherEndBufSize);
    exit(1); // doesn't return to here
    }
else
    {
    // parent also must also setpgid to prevent race condition
    if (setpgid(pl->groupLeader, pl->groupLeader) != 0)
        errnoAbort("error from parent setpgid(%d, %d)", pl->groupLeader, pl->groupLeader);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0xc(%rdi)
jns 0x12436
movq %r9, %r14
movq %r8, %r15
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
callq 0x3750
movl %eax, 0xc(%rbx)
testl %eax, %eax
jns 0x123f5
leaq 0x8ed8(%rip), %rdi      # 0x1b2c3
xorl %eax, %eax
callq 0xb7f4
movl 0xc(%rbx), %eax
testl %eax, %eax
je 0x12455
movl %eax, %edi
movl %eax, %esi
callq 0x36c0
testl %eax, %eax
je 0x12427
movl 0xc(%rbx), %edx
leaq 0x8ebe(%rip), %rdi      # 0x1b2ce
movl %edx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb7f4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8e23(%rip), %rdi      # 0x1b260
leaq 0x8e30(%rip), %rsi      # 0x1b274
leaq 0x8e34(%rip), %rcx      # 0x1b27f
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x32e0
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebp, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x1246b
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: groupLeaderRun
static void groupLeaderRun(struct pipeline* pl, int stdinFd, int stdoutFd, int stderrFd,
                           void *otherEndBuf, size_t otherEndBufSize)
/* group leader process */
{
pl->groupLeader = getpid();
if (setpgid(pl->groupLeader, pl->groupLeader) != 0)
    errnoAbort("error from child setpgid(%d, %d)", pl->groupLeader, pl->groupLeader);
pipelineGroupExec(pl, stdinFd, stdoutFd, stderrFd, otherEndBuf, otherEndBufSize);

// only keep stderr open
close(STDIN_FILENO);
close(STDOUT_FILENO);
closeNonStdDescriptors();
groupWait(pl);
exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
callq 0x31b0
movl %eax, 0xc(%rbx)
movl %eax, %edi
movl %eax, %esi
callq 0x36c0
testl %eax, %eax
je 0x124af
movl 0xc(%rbx), %edx
leaq 0x8e4a(%rip), %rdi      # 0x1b2f0
movl %edx, %esi
xorl %eax, %eax
callq 0xb7f4
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebp, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x124ea
xorl %edi, %edi
callq 0x3350
movl $0x1, %edi
callq 0x3350
callq 0x126e5
movq %rbx, %rdi
callq 0x12722
xorl %edi, %edi
callq 0x36e0
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: pipelineGroupExec
static void pipelineGroupExec(struct pipeline* pl, int stdinFd, int stdoutFd, int stderrFd,
                              void *otherEndBuf, size_t otherEndBufSize)
/* Start all processes in a pipeline, stdinFd and stdoutFd are the ends of
 * the pipeline, stderrFd is applied to all processed */
{
struct plProc *proc;
int prevStdoutFd = -1;
for (proc = pl->procs; proc != NULL; proc = proc->next)
    {
    prevStdoutFd = pipelineExecProc(pl, proc, prevStdoutFd,
                                    stdinFd, stdoutFd, stderrFd,
                                    otherEndBuf, otherEndBufSize);
    otherEndBuf = NULL;  /* only for first process (read pipes) */
    otherEndBufSize = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x8(%rsp)
movl %edx, 0x10(%rsp)
movq (%rdi), %r12
testq %r12, %r12
je 0x126c5
movq %r9, %rbx
movq %r8, %rbp
movl %esi, %r14d
movq %rdi, %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %esi, (%rsp)
cmpq %r12, (%r15)
movl %eax, %r13d
cmovel %r14d, %r13d
movl %r13d, 0x14(%rsp)
cmpq $0x0, (%r12)
je 0x12546
leaq 0x4(%rsp), %rdi
callq 0x12382
movl %eax, 0xc(%rsp)
jmp 0x12552
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x3750
movl %eax, 0x18(%r12)
testl %eax, %eax
jns 0x12573
leaq 0x8d5c(%rip), %rdi      # 0x1b2c3
xorl %eax, %eax
callq 0xb7f4
movl 0x18(%r12), %eax
testl %eax, %eax
jne 0x12661
movl 0x4(%rsp), %r14d
movl $0x1, %esi
movl $0xd, %edi
callq 0x3450
cmpq $-0x1, %rax
jne 0x125a3
leaq 0x8d75(%rip), %rdi      # 0x1b311
xorl %eax, %eax
callq 0xb7f4
callq 0x31b0
movl 0xc(%r15), %esi
movl %eax, %edi
callq 0x36c0
testl %eax, %eax
je 0x125d0
callq 0x31b0
movl 0xc(%r15), %edx
leaq 0x8d61(%rip), %rdi      # 0x1b328
movl %eax, %esi
xorl %eax, %eax
callq 0xb7f4
testq %rbp, %rbp
je 0x1261b
xorl %edi, %edi
movl %r14d, %esi
movl 0x8(%rsp), %edx
callq 0x128c1
movl $0x1, %edi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x31a0
testq %rax, %rax
js 0x1264f
cmpq %rbx, %rax
movl (%rsp), %r14d
je 0x126d4
leaq 0x8d5a(%rip), %rdi      # 0x1b366
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb6c8
jmp 0x12661
movl %r13d, %edi
movl %r14d, %esi
movl 0x8(%rsp), %edx
callq 0x128c1
movq 0x10(%r12), %rsi
movq (%rsi), %rdi
callq 0x3690
movq 0x10(%r12), %rax
movq (%rax), %rsi
leaq 0x8a3d(%rip), %rdi      # 0x1b083
xorl %eax, %eax
callq 0xb7f4
jmp 0x1265d
leaq 0x8ced(%rip), %rdi      # 0x1b343
xorl %eax, %eax
callq 0xb7f4
movl (%rsp), %r14d
movl 0x1c(%r12), %esi
testl %esi, %esi
je 0x1267d
leaq 0x8d8a(%rip), %rdi      # 0x1b3fb
movl $0x1, %edx
xorl %eax, %eax
callq 0xb6c8
movl $0x1, 0x1c(%r12)
incl 0x8(%r15)
cmpq %r12, (%r15)
je 0x12699
leaq 0x14(%rsp), %rdi
callq 0x11f36
cmpq $0x0, (%r12)
je 0x126c5
leaq 0x4(%rsp), %rdi
callq 0x11f36
movq (%r12), %r12
movl $0x0, %ebx
movl $0x0, %ebp
testq %r12, %r12
movl 0xc(%rsp), %eax
jne 0x12520
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x3350
xorl %edi, %edi
callq 0x36e0
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: closeNonStdDescriptors
static void closeNonStdDescriptors(void)
/* close non-standard file descriptors */
{
long maxFd = sysconf(_SC_OPEN_MAX);
if (maxFd < 0)
    maxFd = 4096;  // shouldn't really happen
int fd;
for (fd = STDERR_FILENO+1; fd < maxFd; fd++)
    close(fd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x4, %edi
callq 0x3650
testq %rax, %rax
movl $0x1000, %r14d          # imm = 0x1000
cmovnsq %rax, %r14
cmpq $0x4, %r14
jl 0x1271a
movl $0x3, %ebx
movl %ebx, %edi
callq 0x3350
incq %rbx
cmpq %rbx, %r14
jne 0x1270b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: plProcSetup
static void plProcSetup(struct plProc* proc, int stdinFd, int stdoutFd, int stderrFd)
/* setup signal, error handling, and file descriptors after fork */
{
/* treat a closed pipe as an EOF rather than getting SIGPIPE */
struct sigaction sigAct;
ZeroVar(&sigAct);
sigAct.sa_handler = SIG_IGN;
if (sigaction(SIGPIPE, &sigAct, NULL) != 0)
    errnoAbort("failed to set SIGPIPE to SIG_IGN");

/* child, first setup stdio files */
if (stdinFd != STDIN_FILENO)
    {
    if (dup2(stdinFd, STDIN_FILENO) < 0)
        errnoAbort("can't dup2 to stdin");
    }
    
if (stdoutFd != STDOUT_FILENO)
    {
    if (dup2(stdoutFd, STDOUT_FILENO) < 0)
        errnoAbort("can't dup2 to stdout");
    }
    
if (stderrFd != STDERR_FILENO)
    {
    if (dup2(stderrFd, STDERR_FILENO) < 0)
        errnoAbort("can't dup2 to stderr");
    }
closeNonStdDescriptors();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
leaq 0x8(%rsp), %r15
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3300
movq $0x1, -0x8(%r15)
movq %rsp, %rsi
movl $0xd, %edi
xorl %edx, %edx
callq 0x3140
testl %eax, %eax
je 0x12912
leaq 0x8a91(%rip), %rdi      # 0x1b39c
xorl %eax, %eax
callq 0xb7f4
testl %r14d, %r14d
je 0x12933
movl %r14d, %edi
xorl %esi, %esi
callq 0x3240
testl %eax, %eax
jns 0x12933
leaq 0x8a91(%rip), %rdi      # 0x1b3bd
xorl %eax, %eax
callq 0xb7f4
cmpl $0x1, %ebp
je 0x12956
movl %ebp, %edi
movl $0x1, %esi
callq 0x3240
testl %eax, %eax
jns 0x12956
leaq 0x8a82(%rip), %rdi      # 0x1b3d1
xorl %eax, %eax
callq 0xb7f4
cmpl $0x2, %ebx
je 0x12979
movl %ebx, %edi
movl $0x2, %esi
callq 0x3240
testl %eax, %eax
jns 0x12979
leaq 0x8a74(%rip), %rdi      # 0x1b3e6
xorl %eax, %eax
callq 0xb7f4
callq 0x126e5
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/pipeline.c
// Function: joinCmd
static char* joinCmd(char **cmd)
/* join an cmd vector into a space separated string */
{
struct dyString *str = dyStringNew(512);
int i;
for (i = 0; cmd[i] != NULL; i++)
    {
    if (i > 0)
        dyStringAppend(str, " ");
    dyStringAppend(str, cmd[i]);
    }
return dyStringCannibalize(&str);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x200, %edi            # imm = 0x200
callq 0xad14
movq %rax, (%rsp)
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x129e3
movq %rax, %r14
xorl %r12d, %r12d
leaq 0x8f27(%rip), %r15      # 0x1b8e1
testq %r12, %r12
je 0x129ce
movq %r14, %rdi
movq %r15, %rsi
callq 0xaf83
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0xaf83
movq 0x8(%rbx,%r12,8), %rsi
incq %r12
testq %rsi, %rsi
jne 0x129ba
movq %rsp, %rdi
callq 0xad70
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/verbose.c
// Function: verboseVa
void verboseVa(int verbosity, char *format, va_list args)
/* Log with at given verbosity vprintf formatted args. */
{
if (verbosity <= logVerbosity)
    {
    if (logFile == NULL)
        logFile = stderr;
    vfprintf(logFile, format, args);
    fflush(logFile);
    }
}

// Assembly:
cmpl %edi, 0x14bc2(%rip)     # 0x275c0
jge 0x12a01
retq
movq 0x157b0(%rip), %rdi     # 0x281b8
testq %rdi, %rdi
jne 0x12a1e
movq 0x145e4(%rip), %rax     # 0x26ff8
movq (%rax), %rdi
movq %rdi, 0x1579a(%rip)     # 0x281b8
pushq %rax
callq 0x3670
movq 0x1578d(%rip), %rdi     # 0x281b8
popq %rax
jmp 0x3520
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/verbose.c
// Function: verboseTime
void verboseTime(int verbosity, char *label, ...)
/* Print label and how long it's been since last call.  Start time can be
 * initialized with verboseTimeInit, otherwise the elapsed time will be
 * zero. */
{
assert(label != NULL);  // original version allowed this, but breaks some GCCs
if (lastTime < 0)
    verboseTimeInit();
long time = clock1000();
va_list args;
va_start(args, label);
verboseVa(verbosity, label, args);
verbose(verbosity, ": %ld millis\n", time - lastTime);
lastTime = time;
va_end(args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x12b21
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rsi, %rsi
je 0x12bae
movq %rsi, %r14
movl %edi, %ebx
cmpq $0x0, 0x14a91(%rip)     # 0x275c8
jns 0x12b47
xorl %eax, %eax
callq 0x10dba
movq %rax, 0x14a81(%rip)     # 0x275c8
xorl %eax, %eax
callq 0x10dba
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movl %ebx, %edi
movq %r14, %rsi
callq 0x129f8
movq %r15, %rdx
subq 0x14a3e(%rip), %rdx     # 0x275c8
leaq 0x8b09(%rip), %rsi      # 0x1b69a
movl %ebx, %edi
xorl %eax, %eax
callq 0x12a31
movq %r15, 0x14a27(%rip)     # 0x275c8
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8aaa(%rip), %rdi      # 0x1b65f
leaq 0x8ab1(%rip), %rsi      # 0x1b66d
leaq 0x8ab4(%rip), %rcx      # 0x1b677
movl $0x34, %edx
callq 0x32e0
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/verbose.c
// Function: verboseDotsEnabled
boolean verboseDotsEnabled()
/* check if outputting of happy dots are enabled.  They will be enabled if the
 * verbosity is > 0, stderr is a tty and we don't appear to be running an
 * emacs shell. */
{
if (!checkedDotsEnabled)
    {
    if (logFile == NULL)
        logFile = stderr;
    dotsEnabled = (logVerbosity > 0) && isatty(fileno(logFile));
    if (dotsEnabled)
        {
        /* check for an possible emacs shell */
        char *emacs = getenv("emacs");
        char *term = getenv("TERM");
        if ((emacs != NULL) && (emacs[0] == 't'))
            dotsEnabled = FALSE;
        else if ((term != NULL) && sameString(term, "dumb"))
            dotsEnabled = FALSE;
        }
    checkedDotsEnabled = TRUE;
    }
return dotsEnabled;
}

// Assembly:
pushq %rbx
cmpb $0x1, 0x155eb(%rip)     # 0x281c0
jne 0x12be2
movl 0x155e7(%rip), %ebx     # 0x281c4
jmp 0x12c78
movq 0x155cf(%rip), %rdi     # 0x281b8
testq %rdi, %rdi
jne 0x12bff
movq 0x14403(%rip), %rax     # 0x26ff8
movq (%rax), %rdi
movq %rdi, 0x155b9(%rip)     # 0x281b8
cmpl $0x0, 0x149ba(%rip)     # 0x275c0
jle 0x12c65
callq 0x34e0
movl %eax, %edi
callq 0x3130
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0x155a3(%rip)     # 0x281c4
je 0x12c6f
leaq 0x8a7e(%rip), %rdi      # 0x1b6a8
callq 0x3040
movq %rax, %rbx
leaq 0x9495(%rip), %rdi      # 0x1c0ce
callq 0x3040
testq %rbx, %rbx
je 0x12c48
cmpb $0x74, (%rbx)
je 0x12c65
movl $0x1, %ebx
testq %rax, %rax
je 0x12c71
leaq 0x8a55(%rip), %rsi      # 0x1b6ae
movq %rax, %rdi
callq 0x3440
testl %eax, %eax
jne 0x12c71
movl $0x0, 0x15555(%rip)     # 0x281c4
xorl %ebx, %ebx
movb $0x1, 0x15548(%rip)     # 0x281c0
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/verbose.c
// Function: verboseSetLogFile
void verboseSetLogFile(char *name)
/* Set logFile for verbose messages overrides stderr. */
{
if (sameString(name, "stdout"))
    logFile = stdout;
else if (sameString(name, "stderr"))
    logFile = stderr;
else
    logFile = mustOpen(name, "w");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x8723(%rip), %rsi      # 0x1b3df
callq 0x3440
testl %eax, %eax
je 0x12ce9
leaq 0x8728(%rip), %rsi      # 0x1b3f4
movq %rbx, %rdi
callq 0x3440
testl %eax, %eax
je 0x12cf2
leaq 0x6d54(%rip), %rsi      # 0x19a33
movq %rbx, %rdi
callq 0x932b
jmp 0x12cfc
movq 0x142d8(%rip), %rax     # 0x26fc8
jmp 0x12cf9
movq 0x142ff(%rip), %rax     # 0x26ff8
movq (%rax), %rax
movq %rax, 0x154b5(%rip)     # 0x281b8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/wildcmp.c
// Function: globMatch
static boolean globMatch(const char *wildCard, const char *string, char single, char multi)
/* does a case sensitive wild card match with a string.
 * * matches any string or no character.
 * ? matches any single character.
 * anything else etc must match the character exactly. */
{
boolean matchStar = 0;
int starMatchSize;
char c;

for(;;)
    {
NEXT_WILD:
    c = *wildCard;
    if (c == 0)
	{
	if(matchStar)
	    {
	    while(*string++)
		;
	    return TRUE;
	    }
	else if(*string)
	    return FALSE;
	else
	    return TRUE;
	}
    else if (c == multi)
	{
	matchStar = TRUE;
	}
    else if (c == single)
	{
	if(*string == 0)
	    return FALSE; /* out of string, no match for ? */
	++string;
	}
    else
	{
	if(matchStar)
	    {
	    for(;;)
		{
		if(*string == 0) /* if out of string no match */
		    return FALSE;

		/* note matchStar is re-used here for substring
		 * after star match length */
		if((starMatchSize = subMatch(string,wildCard,single,multi)) != 0)
		    {
		    string += starMatchSize;
		    wildCard += starMatchSize;
		    matchStar = FALSE;
		    goto NEXT_WILD;
		    }
		++string;
		}
	    }

	/* default: they must be equal or no match */
	if(toupper(*string) != toupper(*wildCard))
	    return FALSE;
	++string;
	}
    ++wildCard;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movb (%rdi), %r12b
testb %r12b, %r12b
je 0x12e48
movl %ecx, %ebp
movl %edx, %r14d
xorl %r15d, %r15d
movq %rdi, %r13
cmpb %bpl, %r12b
jne 0x12d8e
movb 0x1(%r13), %r12b
incq %r13
movl $0x1, %r15d
testb %r12b, %r12b
jne 0x12d72
jmp 0x12e52
cmpb %r14b, %r12b
jne 0x12da1
cmpb $0x0, (%rbx)
jne 0x12e27
jmp 0x12e64
testl %r15d, %r15d
je 0x12e0c
xorl %r15d, %r15d
cmpb $0x0, (%rbx)
je 0x12e52
callq 0x3030
movq (%rax), %rax
movq %rbx, %rcx
movl %r12d, %edx
movq %r13, %rdi
movq %rcx, %rbx
movsbq (%rbx), %rsi
movl (%rax,%rsi,4), %esi
movsbq %dl, %rdx
cmpl (%rax,%rdx,4), %esi
jne 0x12def
incq %rbx
movb 0x1(%rdi), %dl
incq %rdi
cmpb %bpl, %dl
je 0x12dfb
testb %dl, %dl
je 0x12dfb
cmpb %r14b, %dl
jne 0x12dc6
jmp 0x12dfb
cmpb $0x0, 0x1(%rcx)
leaq 0x1(%rcx), %rcx
jne 0x12dbd
jmp 0x12e52
movb (%rdi), %r12b
xorl %r15d, %r15d
testb %r12b, %r12b
jne 0x12d6f
jmp 0x12e48
callq 0x3030
movq (%rax), %rax
movsbq (%rbx), %rcx
movl (%rax,%rcx,4), %ecx
movsbq %r12b, %rdx
xorl %r15d, %r15d
cmpl (%rax,%rdx,4), %ecx
jne 0x12e52
incq %rbx
movb 0x1(%r13), %r12b
incq %r13
movq %r13, %rdi
testb %r12b, %r12b
jne 0x12d6f
testl %r15d, %r15d
movl $0x1, %r15d
jne 0x12e52
xorl %r15d, %r15d
cmpb $0x0, (%rbx)
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x12e52
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiServerNamePort
char *cgiServerNamePort()
/* Return name of server with port if different than 80 */
{
char *port = cgiServerPort();
char *name = cgiServerName();
struct dyString *result = newDyString(256);
char *defaultPort = "80";
if (cgiServerHttpsIsOn())
    defaultPort = "443";

if (name)
    {
    dyStringPrintf(result,"%s",name);
    if (differentString(port, defaultPort))
	dyStringPrintf(result,":%s",port);
    return dyStringCannibalize(&result);
    }
else
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x8798(%rip), %rdi      # 0x1b701
callq 0x3040
movq %rax, %rbx
testq %rax, %rax
leaq 0x8792(%rip), %r13      # 0x1b70d
cmoveq %r13, %rbx
leaq 0x876f(%rip), %rdi      # 0x1b6f5
callq 0x3040
movq %rax, %r15
movl $0x100, %edi            # imm = 0x100
callq 0xad14
movq %rax, %r14
movq %rax, 0x8(%rsp)
callq 0x12f28
testq %r15, %r15
je 0x12ffa
testl %eax, %eax
leaq 0x8763(%rip), %r12      # 0x1b716
cmoveq %r13, %r12
leaq 0x65fe(%rip), %rsi      # 0x195bc
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xb0b7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3440
testl %eax, %eax
je 0x12fee
leaq 0x955e(%rip), %rsi      # 0x1c53f
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0b7
leaq 0x8(%rsp), %rdi
callq 0xad70
jmp 0x12ffc
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: findCookieData
char *findCookieData(char *varName)
/* Get the string associated with varName from the cookie string. */
{
struct hashEl *hel;
char *firstResult;

/* make sure that the cookie hash table has been created */
parseCookies(&cookieHash, &cookieList);
if (cookieHash == NULL)
    return NULL;
/* Watch out for multiple cookies with the same name (hel is a list) --
 * warn if we find them. */
hel = hashLookup(cookieHash, varName);
if (hel == NULL)
    return NULL;
else
    firstResult = ((struct cgiVar *)hel->val)->val;
hel = hel->next;
while (hel != NULL)
    {
    char *val = ((struct cgiVar *)(hel->val))->val;
    if (sameString(varName, hel->name) && !sameString(firstResult, val))
	{
	/* This is too early to call warn -- it will mess up html output. */
	fprintf(stderr,
		"findCookieData: Duplicate cookie value from IP=%s: "
		"%s has both %s and %s\n",
		cgiRemoteAddr(),
		varName, firstResult, val);
	}
    hel = hel->next;
    }
return firstResult;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x132ff
movq 0x14fad(%rip), %rdi     # 0x281f8
testq %rdi, %rdi
je 0x132ea
movq %rbx, %rsi
callq 0xbb8c
testq %rax, %rax
je 0x132ea
movq (%rax), %r15
movq 0x10(%rax), %rax
movq 0x10(%rax), %r14
testq %r15, %r15
je 0x132ed
movq 0x13d7c(%rip), %rbp     # 0x26ff8
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rax
movq 0x10(%rax), %r13
movq %rbx, %rdi
callq 0x3440
testl %eax, %eax
jne 0x132a3
movq %r14, %rdi
movq %r13, %rsi
callq 0x3440
testl %eax, %eax
jne 0x132ad
movq (%r15), %r15
testq %r15, %r15
jne 0x1327c
jmp 0x132ed
movq (%rbp), %r12
leaq 0x8462(%rip), %rdi      # 0x1b71a
callq 0x3040
testq %rax, %rax
leaq 0x7ba9(%rip), %rcx      # 0x1ae70
cmoveq %rcx, %rax
movq %r12, %rdi
leaq 0x8496(%rip), %rsi      # 0x1b76b
movq %rax, %rdx
movq %rbx, %rcx
movq %r14, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x3470
jmp 0x132a3
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: parseCookies
static void parseCookies(struct hash **retHash, struct cgiVar **retList)
/* parses any cookies and puts them into the given hash and list */
{
char* str;
char *namePt, *dataPt, *nextNamePt;
struct hash *hash;
struct cgiVar *list = NULL, *el;

/* don't build the hash table again */
if(haveCookiesHash == TRUE)
	return;

str = cloneString(getenv("HTTP_COOKIE"));
if(str == NULL) /* don't have a cookie */
	return;

hash = newHash(6);

namePt = str;
while (isNotEmpty(namePt))
    {
    dataPt = strchr(namePt, '=');
    if (dataPt == NULL)
	errAbort("Mangled Cookie input string: no = in '%s' (offset %d in complete cookie string: '%s')",
		 namePt, (int)(namePt - str), getenv("HTTP_COOKIE"));
    *dataPt++ = 0;
    nextNamePt = strchr(dataPt, ';');
    if (nextNamePt != NULL)
	{
         *nextNamePt++ = 0;
	 if (*nextNamePt == ' ')
	     nextNamePt++;
	}
    cgiDecode(dataPt,dataPt,strlen(dataPt));
    AllocVar(el);
    el->val = dataPt;
    slAddHead(&list, el);
    hashAddSaveName(hash, namePt, el, &el->name);
    namePt = nextNamePt;
    }

haveCookiesHash = TRUE;

slReverse(&list);
*retList = list;
*retHash = hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $0x0, 0x8(%rsp)
cmpb $0x0, 0x251c3(%rip)     # 0x384e0
jne 0x13450
leaq 0x8d3f(%rip), %rdi      # 0x1c069
callq 0x3040
movq %rax, %rdi
callq 0x6402
testq %rax, %rax
je 0x13450
movq %rax, %rbx
movl $0x6, %edi
movl $0x1, %esi
callq 0xc1ee
movq %rax, %r14
xorl %r12d, %r12d
movq %rbx, 0x10(%rsp)
cmpb $0x0, (%rbx)
je 0x1342b
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x3260
movq %rax, %rbp
testq %rax, %rax
jne 0x133a6
movl %ebx, %r15d
subl 0x10(%rsp), %r15d
leaq 0x8cdf(%rip), %rdi      # 0x1c069
callq 0x3040
leaq 0x8cdf(%rip), %rdi      # 0x1c075
movq %rbx, %rsi
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xb6c8
movq %rbp, %rax
incq %rbp
movb $0x0, (%rax)
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x3260
testq %rax, %rax
je 0x133d9
leaq 0x1(%rax), %rcx
movb $0x0, (%rax)
movq %rax, %r13
addq $0x2, %r13
cmpb $0x20, 0x1(%rax)
cmovneq %rcx, %r13
jmp 0x133dc
xorl %r13d, %r13d
movq %rbp, %rdi
callq 0x3200
movq %rbp, %rdi
movq %rbp, %rsi
movl %eax, %edx
callq 0x13598
movl $0x20, %edi
callq 0xee10
movq %rax, %r15
movq %rbp, 0x10(%rax)
movq %r12, (%rax)
movq %rax, 0x8(%rsp)
leaq 0x8(%rax), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xbf9e
movq %r15, %r12
movq %r13, %rbx
testq %r13, %r13
jne 0x1335d
movb $0x1, 0x250ae(%rip)     # 0x384e0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x66bb
movq (%rbx), %rax
movq %rax, 0x14d87(%rip)     # 0x281d0
movq %r14, 0x14da8(%rip)     # 0x281f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiParseInputAbort
void cgiParseInputAbort(char *input, struct hash **retHash,
        struct cgiVar **retList)
/* Parse cgi-style input into a hash table and list.  This will alter
 * the input data.  The hash table will contain references back
 * into input, so please don't free input until you're done with
 * the hash. Prints message aborts if there's an error.
 * To clean up - slFreeList, hashFree, and only then free input. */
{
char *namePt, *dataPt, *nextNamePt;
struct hash *hash = *retHash;
struct cgiVar *list = *retList, *el;

if (!hash)
  hash = newHash(6);
slReverse(&list);

namePt = input;
while (namePt != NULL && namePt[0] != 0)
    {
    dataPt = strchr(namePt, '=');
    if (dataPt == NULL)
	{
	errAbort("Mangled CGI input string %s", namePt);
	}
    *dataPt++ = 0;
    nextNamePt = strchr(dataPt, '&');
    if (nextNamePt == NULL)
	nextNamePt = strchr(dataPt, ';');	/* Accomodate DAS. */
    if (nextNamePt != NULL)
         *nextNamePt++ = 0;
    cgiDecode(namePt,namePt,strlen(namePt));	/* for unusual ct names */
    cgiDecode(dataPt,dataPt,strlen(dataPt));
    AllocVar(el);
    el->val = dataPt;
    slAddHead(&list, el);
    hashAddSaveName(hash, namePt, el, &el->name);
    namePt = nextNamePt;
    }
slReverse(&list);
*retList = list;
*retHash = hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
movq (%rsi), %r15
movq (%rdx), %rax
movq %rax, (%rsp)
testq %r15, %r15
jne 0x13494
movl $0x6, %edi
movl $0x1, %esi
callq 0xc1ee
movq %rax, %r15
movq %rsp, %rdi
callq 0x66bb
testq %r13, %r13
je 0x13574
cmpb $0x0, (%r13)
je 0x13574
movq %r13, %rdi
movl $0x3d, %esi
callq 0x3260
movq %rax, %rbp
testq %rax, %rax
jne 0x134d6
leaq 0x82e9(%rip), %rdi      # 0x1b7b5
movq %r13, %rsi
xorl %eax, %eax
callq 0xb6c8
movq %rbp, %rax
incq %rbp
movb $0x0, (%rax)
movq %rbp, %rdi
movl $0x26, %esi
callq 0x3260
testq %rax, %rax
jne 0x13503
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x3260
testq %rax, %rax
je 0x1356f
movq %rax, %r12
movb $0x0, (%rax)
incq %r12
movq %r13, %rdi
callq 0x3200
movq %r13, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x13598
movq %rbp, %rdi
callq 0x3200
movq %rbp, %rdi
movq %rbp, %rsi
movl %eax, %edx
callq 0x13598
movl $0x20, %edi
callq 0xee10
movq %rbp, 0x10(%rax)
movq (%rsp), %rcx
movq %rcx, (%rax)
movq %rax, (%rsp)
leaq 0x8(%rax), %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0xbf9e
movq %r12, %r13
testq %r12, %r12
jne 0x134a5
jmp 0x13574
xorl %r12d, %r12d
jmp 0x1350c
movq %rsp, %r12
movq %r12, %rdi
callq 0x66bb
movq (%r12), %rax
movq %rax, (%r14)
movq %r15, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiDecode
void cgiDecode(char *in, char *out, int inLength)
/* Decode from cgi pluses-for-spaces format to normal.
 * Out will be a little shorter than in typically, and
 * can be the same buffer. */
{
char c;
int i;
for (i=0; i<inLength;++i)
    {
    c = *in++;
    if (c == '+')
	*out++ = ' ';
    else if (c == '%')
	{
	int code;
        if (sscanf(in, "%2x", &code) != 1)
	    code = '?';
	in += 2;
	i += 2;
	*out++ = code;
	}
    else
	*out++ = c;
    }
*out++ = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
testl %edx, %edx
jle 0x13611
movl %edx, %ebp
movq %rdi, %r12
leaq 0x8246(%rip), %r14      # 0x1b7fc
leaq 0x4(%rsp), %r15
xorl %r13d, %r13d
leaq 0x1(%r12), %rdi
movzbl (%r12), %eax
cmpl $0x25, %eax
je 0x135d7
cmpl $0x2b, %eax
jne 0x13601
movb $0x20, (%rbx)
jmp 0x13603
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3530
movl $0x3f, %ecx
cmpl $0x1, %eax
jne 0x135f2
movl 0x4(%rsp), %ecx
addq $0x3, %r12
addl $0x2, %r13d
movb %cl, (%rbx)
movq %r12, %rdi
jmp 0x13603
movb %al, (%rbx)
incq %rbx
incl %r13d
movq %rdi, %r12
cmpl %ebp, %r13d
jl 0x135be
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiParseInput
boolean cgiParseInput(char *input, struct hash **retHash,
        struct cgiVar **retList)
/* Parse cgi-style input into a hash table and list.  This will alter
 * the input data.  The hash table will contain references back
 * into input, so please don't free input until you're done with
 * the hash. Prints message and returns FALSE if there's an error.
 * To clean up - slFreeList, hashFree, and only then free input. */
{
boolean ok = TRUE;
int status = setjmp(cgiParseRecover);
if (status == 0)    /* Always true except after long jump. */
    {
    pushAbortHandler(cgiParseAbort);
    cgiParseInputAbort(input, retHash, retList);
    }
else    /* They long jumped here because of an error. */
    {
    ok = FALSE;
    }
popAbortHandler();
return ok;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x14bc8(%rip), %rdi     # 0x28200
callq 0x3410
xorl %ecx, %ecx
testl %eax, %eax
jne 0x13662
leaq 0x2220(%rip), %rdi      # 0x1586a
callq 0xb8ad
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1345f
movl $0x1, %ecx
movl %ecx, %ebx
xorl %eax, %eax
callq 0xb8fd
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: initSigHandlers
void initSigHandlers(boolean dumpStack)
/* set handler for various terminal signals for logging purposes.
 * if dumpStack is TRUE, attempt to dump the stack. */
{
if (cgiIsOnWeb())
    {
    // SIGKILL is not trappable or ignorable
    signal(SIGTERM, catchSignal);
    signal(SIGHUP, catchSignal);
    signal(SIGABRT, catchSignal);
    signal(SIGSEGV, catchSignal);
    signal(SIGFPE, catchSignal);
    signal(SIGBUS, catchSignal);
    dumpStackOnSignal = dumpStack;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x803f(%rip), %rdi      # 0x1b6bf
callq 0x3040
testq %rax, %rax
je 0x136e5
leaq -0xfe60(%rip), %r14     # 0x3831
movl $0xf, %edi
movq %r14, %rsi
callq 0x3450
movl $0x1, %edi
movq %r14, %rsi
callq 0x3450
movl $0x6, %edi
movq %r14, %rsi
callq 0x3450
movl $0xb, %edi
movq %r14, %rsi
callq 0x3450
movl $0x8, %edi
movq %r14, %rsi
callq 0x3450
movl $0x7, %edi
movq %r14, %rsi
callq 0x3450
movl %ebx, 0x14be3(%rip)     # 0x282c8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiEncode
char *cgiEncode(char *inString)
/* Return a cgi-encoded version of inString.
 * Alphanumerics kept as is, space translated to plus,
 * and all other characters translated to %hexVal. */
{
char c;
int outSize = 0;
char *outString, *out, *in;

if (inString == NULL)
    return(cloneString(""));

/* Count up how long it will be */
in = inString;
while ((c = *in++) != 0)
    {
    if (isalnum(c) || c == ' ' || c == '.' || c == '_')
        outSize += 1;
    else
        outSize += 3;
    }
outString = needMem(outSize+1);

/* Encode string */
in = inString;
out = outString;
while ((c = *in++) != 0)
    {
    if (isalnum(c) || c == '.' || c == '_')
        *out++ = c;
    else if (c == ' ')
        *out++ = '+';
    else
        {
        unsigned char uc = c;
        char buf[4];
        *out++ = '%';
        safef(buf, sizeof(buf), "%02X", uc);
        *out++ = buf[0];
        *out++ = buf[1];
        }
    }
*out++ = 0;
return outString;
}

// Assembly:
testq %rdi, %rdi
je 0x13820
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x1382c
callq 0x37a0
movq (%rax), %rax
leaq 0x1(%rbx), %rcx
xorl %edi, %edi
movabsq $-0x7fffffffffffbfff, %rdx # imm = 0x8000000000004001
movsbq %bpl, %rsi
movzwl (%rax,%rsi,2), %r8d
movl $0x1, %esi
testb $0x8, %r8b
jne 0x1380f
movzbl %bpl, %r8d
addl $-0x20, %r8d
cmpl $0x3f, %r8d
ja 0x1380a
btq %r8, %rdx
jb 0x1380f
movl $0x3, %esi
addl %esi, %edi
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x137e2
incl %edi
jmp 0x13831
leaq 0x64ab(%rip), %rdi      # 0x19cd2
jmp 0x6402
movl $0x1, %edi
callq 0xee10
movq %rax, %r14
movb (%rbx), %r12b
movq %rax, %rbp
testb %r12b, %r12b
je 0x138c2
callq 0x37a0
movq %rax, %r15
incq %rbx
leaq 0x4(%rsp), %r13
movq %r14, %rbp
movq (%r15), %rax
movsbq %r12b, %rcx
movzwl (%rax,%rcx,2), %eax
testb $0x8, %al
jne 0x1387a
cmpb $0x20, %r12b
je 0x1388e
movzbl %r12b, %ecx
cmpl $0x5f, %ecx
je 0x1387a
cmpl $0x2e, %ecx
jne 0x13894
movb %r12b, (%rbp)
incq %rbp
movb (%rbx), %r12b
incq %rbx
testb %r12b, %r12b
jne 0x13857
jmp 0x138c2
movb $0x2b, (%rbp)
jmp 0x1387e
movb $0x25, (%rbp)
movq %r13, %rdi
movl $0x4, %esi
leaq 0x7f59(%rip), %rdx      # 0x1b800
xorl %eax, %eax
callq 0xa0ca
movb 0x4(%rsp), %al
movb %al, 0x1(%rbp)
movb 0x5(%rsp), %al
movb %al, 0x2(%rbp)
addq $0x3, %rbp
jmp 0x13881
movb $0x0, (%rbp)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: cgiEncodeFull
char *cgiEncodeFull(char *inString)
/* Return a cgi-encoded version of inString (no + for space!).
 * Alphanumerics/./_ kept as is and all other characters translated to
 * %hexVal. */
{
char c;
int outSize = 0;
char *outString, *out, *in;

if (inString == NULL)
    return(cloneString(""));

/* Count up how long it will be */
in = inString;
while ((c = *in++) != 0)
    {
    if (isalnum(c) || c == '.' || c == '_')
        outSize += 1;
    else
        outSize += 3;
    }
outString = needMem(outSize+1);

/* Encode string */
in = inString;
out = outString;
while ((c = *in++) != 0)
    {
    if (isalnum(c) || c == '.' || c == '_')
        *out++ = c;
    else
        {
        unsigned char uc = c;
        char buf[4];
        *out++ = '%';
        safef(buf, sizeof(buf), "%02X", uc);
        *out++ = buf[0];
        *out++ = buf[1];
        }
    }
*out++ = 0;
return outString;
}

// Assembly:
testq %rdi, %rdi
je 0x13941
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x1394d
callq 0x37a0
movq (%rax), %rax
leaq 0x1(%rbx), %rcx
xorl %edi, %edi
movl $0x1, %edx
movsbq %bpl, %rsi
xorl %r8d, %r8d
cmpb $0x2e, %sil
setne %r8b
addl %r8d, %r8d
orl %edx, %r8d
cmpb $0x5f, %sil
cmovel %edx, %r8d
movzwl (%rax,%rsi,2), %esi
testb $0x8, %sil
cmovnel %edx, %r8d
addl %r8d, %edi
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x13906
incl %edi
jmp 0x13952
leaq 0x638a(%rip), %rdi      # 0x19cd2
jmp 0x6402
movl $0x1, %edi
callq 0xee10
movq %rax, %r14
movb (%rbx), %r12b
movq %rax, %rbp
testb %r12b, %r12b
je 0x139d8
callq 0x37a0
movq %rax, %r15
incq %rbx
leaq 0x4(%rsp), %r13
movq %r14, %rbp
movq (%r15), %rax
movsbq %r12b, %rcx
movzwl (%rax,%rcx,2), %eax
testb $0x8, %al
jne 0x13996
cmpb $0x5f, %r12b
je 0x13996
movzbl %r12b, %ecx
cmpl $0x2e, %ecx
jne 0x139aa
movb %r12b, (%rbp)
incq %rbp
movb (%rbx), %r12b
incq %rbx
testb %r12b, %r12b
jne 0x13978
jmp 0x139d8
movb $0x25, (%rbp)
movq %r13, %rdi
movl $0x4, %esi
leaq 0x7e43(%rip), %rdx      # 0x1b800
xorl %eax, %eax
callq 0xa0ca
movb 0x4(%rsp), %al
movb %al, 0x1(%rbp)
movb 0x5(%rsp), %al
movb %al, 0x2(%rbp)
addq $0x3, %rbp
jmp 0x1399d
movb $0x0, (%rbp)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq