LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/nautil.c
// Function: maketargetcell
void
maketargetcell(graph *g, int *lab, int *ptn, int level, set *tcell,
           int *tcellsize, int *cellpos, int tc_level, boolean digraph,
	   int hint,
           int (*targetcell)(graph*,int*,int*,int,int,boolean,int,int,int),
           int m, int n)
{
	int i,j,k;

	i = (*targetcell)(g,lab,ptn,level,tc_level,digraph,hint,m,n);
	for (j = i + 1; ptn[j] > level; ++j) {}

	*tcellsize = j - i + 1;

	EMPTYSET(tcell,m);
	for (k = i; k <= j; ++k) ADDELEMENT(tcell,lab[k]);

	*cellpos = i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r14
movl 0x68(%rsp), %r13d
movl 0x48(%rsp), %r8d
movl 0x50(%rsp), %r9d
movl 0x58(%rsp), %eax
movl 0x70(%rsp), %r10d
subq $0x8, %rsp
pushq %r10
pushq %r13
pushq %rax
callq *0x80(%rsp)
addq $0x20, %rsp
movslq %eax, %rdx
leaq (%r12,%rdx,4), %rdi
movl $0x1, %ecx
movl %eax, %esi
movq %rcx, %r8
incq %rcx
incl %esi
cmpl %ebp, (%rdi,%r8,4)
jg 0xeaf7
movl %ecx, (%r15)
movslq %r13d, %rdi
leaq (%rbx,%rdi,4), %rdi
addq $-0x4, %rdi
cmpq %rbx, %rdi
jb 0xeb24
movl $0x0, (%rdi)
addq $-0x4, %rdi
jmp 0xeb13
cmpl %esi, %eax
jg 0xeb52
leaq (%r14,%rdx,4), %rdx
leaq 0x34bd(%rip), %rsi      # 0x11ff0
movl (%rdx), %edi
movl %edi, %r8d
andl $0x1f, %r8d
movl (%rsi,%r8,4), %r8d
sarl $0x5, %edi
movslq %edi, %rdi
orl %r8d, (%rbx,%rdi,4)
addq $0x4, %rdx
decl %ecx
jne 0xeb33
movq 0x40(%rsp), %rcx
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/nautil.c
// Function: breakout
void
breakout(int *lab, int *ptn, int level, int tc, int tv,
         set *active, int m)
{
	int i,prev,next;

	EMPTYSET(active,m);
	ADDELEMENT(active,tc);

	i = tc;
	prev = tv;

	do
	{
	    next = lab[i];
	    lab[i++] = prev;
	    prev = next;
	}
	while (prev != tv);

	ptn[tc] = level;
}

// Assembly:
movslq 0x8(%rsp), %rax
leaq (%r9,%rax,4), %rax
addq $-0x4, %rax
cmpq %r9, %rax
jb 0xeb9d
movl $0x0, (%rax)
addq $-0x4, %rax
jmp 0xeb8c
movl %ecx, %eax
andl $0x1f, %eax
leaq 0x3447(%rip), %r10      # 0x11ff0
movl (%r10,%rax,4), %r10d
movslq %ecx, %rax
sarl $0x5, %ecx
movslq %ecx, %rcx
orl %r10d, (%r9,%rcx,4)
leaq (%rdi,%rax,4), %rcx
movl %r8d, %edi
movl (%rcx), %r9d
movl %edi, (%rcx)
addq $0x4, %rcx
movl %r9d, %edi
cmpl %r8d, %r9d
jne 0xebc1
movl %edx, (%rsi,%rax,4)
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/nautil.c
// Function: longprune
void
longprune(set *tcell, set *fix, set *bottom, set *top, int m)
{
	int i;

	while (bottom < top)
	{
	    for (i = 0; i < M; ++i)
	        if (NOTSUBSET(fix[i],bottom[i])) break;
	    bottom += M;

	    if (i == M)
	        for (i = 0; i < M; ++i) INTERSECT(tcell[i],bottom[i]);
	    bottom += M;
	}
}

// Assembly:
cmpq %rcx, %rdx
jae 0xec3a
pushq %rbx
movl %r8d, %eax
movslq %r8d, %r9
leaq (%rdx,%r9,4), %r10
shlq $0x3, %r9
testl %r8d, %r8d
jle 0xec2e
xorl %r11d, %r11d
movl (%rdx,%r11,4), %ebx
notl %ebx
testl %ebx, (%rsi,%r11,4)
jne 0xec09
incq %r11
cmpq %r11, %rax
jne 0xebf2
movl %eax, %r11d
testl %r8d, %r8d
setle %bl
cmpl %r8d, %r11d
setne %r11b
orb %bl, %r11b
jne 0xec2e
xorl %r11d, %r11d
movl (%r10,%r11,4), %ebx
andl %ebx, (%rdi,%r11,4)
incq %r11
cmpq %r11, %rax
jne 0xec1e
addq %r9, %rdx
addq %r9, %r10
cmpq %rcx, %rdx
jb 0xebea
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/naugraph.c
// Function: isautom
boolean
isautom(graph *g, permutation *perm, boolean digraph, int m, int n)
{
	set *pg;
	int pos;
	set *pgp;
	int posp,i;

	for (pg = g, i = 0; i < n; pg += M, ++i)
	{
	    pgp = GRAPHROW(g,perm[i],M);
	    pos = (digraph ? -1 : i);

	    while ((pos = nextelement(pg,M,pos)) >= 0)
	    {
	        posp = perm[pos];
	        if (!ISELEMENT(pgp,posp)) return FALSE;
	    }
	}
	return TRUE;
}

// Assembly:
movl $0x1, %eax
testl %r8d, %r8d
jle 0xed3c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rsi, %r15
movslq %ecx, %rcx
movl %r8d, %eax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x384f(%rip), %r14      # 0x12500
movq %rdi, %r13
movl %edx, 0xc(%rsp)
movq %rdi, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movslq (%r15,%rbx,4), %rax
imulq %rcx, %rax
leaq (%rdi,%rax,4), %r12
movl %edx, %eax
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %ebx, %eax
movq %r13, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0xded4
testl %eax, %eax
js 0xed08
movl %eax, %ecx
movl (%r15,%rcx,4), %ecx
movl %ecx, %edx
sarl $0x5, %edx
movslq %edx, %rdx
andl $0x1f, %ecx
movl (%r14,%rcx,4), %ecx
testl %ecx, (%r12,%rdx,4)
jne 0xecdb
jmp 0xed2c
movq 0x18(%rsp), %rcx
leaq (%r13,%rcx,4), %r13
incq %rbx
cmpq 0x10(%rsp), %rbx
movl 0xc(%rsp), %edx
movq 0x20(%rsp), %rdi
jne 0xecc2
movl $0x1, %eax
jmp 0xed2e
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/naugraph.c
// Function: testcanlab
int
testcanlab(graph *g, graph *canong, int *lab, int *samerows, int m, int n)
{
	int i,j;
	set *ph;

#if !MAXN
	DYNALLOC1(permutation,workperm,workperm_sz,n,"testcanlab");
	DYNALLOC1(set,workset,workset_sz,m,"testcanlab");
#endif

	for (i = 0; i < n; ++i) workperm[lab[i]] = i;

	for (i = 0, ph = canong; i < n; ++i, ph += M)
	{
	    permset(GRAPHROW(g,lab[i],M),workset,M,workperm);
	    for (j = 0; j < M; ++j)
	        if (workset[j] < ph[j])
	        {
	            *samerows = i;
	            return -1;
	        }
	        else if (workset[j] > ph[j])
	        {
	            *samerows = i;
	            return 1;
	        }
	}

	*samerows = n;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movl %r8d, %r13d
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
movslq %r9d, %rbx
movq 0x1ad47(%rip), %rax     # 0x29ab0
cmpq %rbx, %rax
jae 0xedaa
testq %rax, %rax
je 0xed7f
movq 0x1ad3e(%rip), %rdi     # 0x29ab8
callq 0x2260
movq %rbx, 0x1ad2a(%rip)     # 0x29ab0
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x22a0
movq %rax, 0x1ad1f(%rip)     # 0x29ab8
testq %rax, %rax
jne 0xedaa
leaq 0x3bdb(%rip), %rdi      # 0x12980
callq 0xe47c
movl %ebp, %ebx
movslq %r13d, %r13
movq 0x1ad0a(%rip), %rax     # 0x29ac0
cmpq %r13, %rax
jae 0xedf8
testq %rax, %rax
je 0xedcc
movq 0x1ad01(%rip), %rdi     # 0x29ac8
callq 0x2260
movq %r13, 0x1aced(%rip)     # 0x29ac0
leaq (,%r13,4), %rdi
callq 0x22a0
movq %rax, 0x1ace1(%rip)     # 0x29ac8
testq %rax, %rax
jne 0xedf8
leaq 0x3b8d(%rip), %rdi      # 0x12980
callq 0xe47c
testl %ebp, %ebp
jle 0xee8b
movq 0x1acb1(%rip), %rax     # 0x29ab8
xorl %ecx, %ecx
movslq (%r14,%rcx,4), %rdx
movl %ecx, (%rax,%rdx,4)
incq %rcx
cmpq %rcx, %rbx
jne 0xee09
testl %ebp, %ebp
jle 0xee8b
movq %r12, (%rsp)
movl %r13d, %r12d
leaq (,%r13,4), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movslq (%r14,%rbp,4), %rax
imulq %r13, %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
movq 0x1ac7e(%rip), %rsi     # 0x29ac8
movq 0x1ac67(%rip), %rcx     # 0x29ab8
movl %r13d, %edx
callq 0xdf6d
testl %r13d, %r13d
jle 0xee7a
movq 0x1ac63(%rip), %rax     # 0x29ac8
xorl %ecx, %ecx
movl (%r15,%rcx,4), %edx
cmpl %edx, (%rax,%rcx,4)
jb 0xee8f
ja 0xee96
incq %rcx
cmpq %rcx, %r12
jne 0xee67
incq %rbp
addq 0x8(%rsp), %r15
cmpq %rbx, %rbp
jne 0xee32
xorl %eax, %eax
jmp 0xee9d
xorl %eax, %eax
jmp 0xeea1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xee9b
movl $0x1, %eax
movl %ebp, %ebx
movq (%rsp), %r12
movl %ebx, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/naugraph.c
// Function: updatecan
void
updatecan(graph *g, graph *canong, permutation *lab, int samerows, int m, int n)
{
	int i;
	set *ph;

#if !MAXN
	DYNALLOC1(permutation,workperm,workperm_sz,n,"updatecan");
#endif

	for (i = 0; i < n; ++i) workperm[lab[i]] = i;

	for (i = samerows, ph = GRAPHROW(canong,samerows,M);
                                                   i < n; ++i, ph += M)
	    permset(GRAPHROW(g,lab[i],M),ph,M,workperm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %ebp
movq %rdx, %r15
movq %rdi, %r14
movslq %r9d, %r12
movq 0x1abdc(%rip), %rax     # 0x29ab0
cmpq %r12, %rax
jae 0xef2a
movl %r8d, (%rsp)
movq %rsi, %r13
testq %rax, %rax
je 0xeef1
movq 0x1abcc(%rip), %rdi     # 0x29ab8
callq 0x2260
movq %r12, 0x1abb8(%rip)     # 0x29ab0
shlq $0x2, %r12
movq %r12, %rdi
callq 0x22a0
movq %rax, 0x1abad(%rip)     # 0x29ab8
testq %rax, %rax
movq %r13, %rsi
movl (%rsp), %r8d
jne 0xef2a
leaq 0x3a6d(%rip), %rdi      # 0x1298b
callq 0xe47c
movl (%rsp), %r8d
movq %r13, %rsi
testl %ebx, %ebx
jle 0xef48
movq 0x1ab83(%rip), %rax     # 0x29ab8
movl %ebx, %ecx
xorl %edx, %edx
movslq (%r15,%rdx,4), %rdi
movl %edx, (%rax,%rdi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0xef39
subl %ebp, %ebx
jle 0xefa6
movq %r14, %rdi
movslq %r8d, %r13
movslq %ebp, %rax
movq %r13, %rcx
imulq %rax, %rcx
leaq (%rsi,%rcx,4), %r12
leaq (%r15,%rax,4), %rax
movq %rax, (%rsp)
leaq (,%r13,4), %rbp
xorl %r14d, %r14d
movq (%rsp), %rax
movslq (%rax,%r14,4), %rax
imulq %r13, %rax
movq %rdi, %r15
leaq (%rdi,%rax,4), %rdi
movq 0x1ab2b(%rip), %rcx     # 0x29ab8
movq %r12, %rsi
movl %r13d, %edx
callq 0xdf6d
movq %r15, %rdi
incq %r14
addq %rbp, %r12
cmpl %r14d, %ebx
jne 0xef73
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/nauty/naugraph.c
// Function: cheapautom
boolean
cheapautom(int *ptn, int level, boolean digraph, int n)
{
	int i,k,nnt;

	if (digraph) return FALSE;

	k = n;
	nnt = 0;
	for (i = 0; i < n; ++i)
	{
	    --k;
	    if (ptn[i] > level)
	    {
	        ++nnt;
	        while (ptn[++i] > level) {}
	    }
	}

	return (k <= nnt + 1 || k <= 4);
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
je 0x10056
retq
testl %ecx, %ecx
jle 0x10093
leaq 0x4(%rdi), %r8
xorl %eax, %eax
movl %ecx, %edx
xorl %r9d, %r9d
movslq %r9d, %r10
cmpl %esi, (%rdi,%r10,4)
jle 0x10083
leaq (%r8,%r10,4), %r10
incl %r9d
leaq 0x4(%r10), %r11
cmpl %esi, (%r10)
movq %r11, %r10
jg 0x10072
incl %eax
decl %edx
incl %r9d
cmpl %ecx, %r9d
jl 0x10065
incl %eax
movl %edx, %ecx
jmp 0x10098
movl $0x1, %eax
cmpl %eax, %ecx
setle %al
cmpl $0x5, %ecx
setl %cl
orb %al, %cl
movzbl %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/main.cpp
// Function: main
int main(int argc, char **argv) {

  CmdLine::init(argc, argv);
  CmdLine::decide_action();  
  CmdLine::finish();

  return 0;
}

// Assembly:
pushq %rax
callq 0x3d44
callq 0x3cfa
callq 0x430c
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_chmod
static int xpfs_chmod(lua_State *L)
{
   const char *filename = luaL_checkstring(L, 1);
   const char *szmode = luaL_checkstring(L, 2);
   int n;

	struct stat info;

   /* we only want to change user bits here, so get the current state */
	n = stat(filename, &info);
   if (n == 0) {
      mode_t MMM = info.st_mode;
      char pm = szmode[0];
      if (pm == '+' || pm == '-') {
         ++szmode;
      } else {
         #ifdef _WIN32
            MMM &= ~( _S_IREAD | _S_IWRITE );
         #else
            MMM &= ~S_IRWXU;
         #endif
      }

      for (; *szmode; ++szmode) {
         int bit = 0;
         #ifdef _WIN32
            if (*szmode == 'r') { bit = _S_IREAD; }
            if (*szmode == 'w') { bit = _S_IWRITE; }
         #else
            if (*szmode == 'r') { bit = S_IRUSR; }
            if (*szmode == 'w') { bit = S_IWUSR; }
            if (*szmode == 'x') { bit = S_IXUSR; }
         #endif
         if (pm == '-') {
            MMM &= ~bit;
         } else {
            MMM |= bit;
         }
      }
      n = chmod(filename, MMM);
   }

   if (n==0) {
      lua_pushboolean(L, 1);
      return 1;
   } else {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %r14
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1150
testl %eax, %eax
jne 0x13c1
movl 0x20(%rsp), %ecx
movzbl (%r15), %eax
cmpl $0x2d, %eax
je 0x135c
cmpl $0x2b, %eax
jne 0x1365
movb 0x1(%r15), %dl
incq %r15
jmp 0x136d
andl $0xfffffe3f, %ecx       # imm = 0xFFFFFE3F
movl %eax, %edx
testb %dl, %dl
je 0x13b3
incq %r15
movl $0x80, %edi
movl $0x40, %r8d
xorl %esi, %esi
cmpb $0x72, %dl
sete %sil
shll $0x8, %esi
cmpb $0x77, %dl
cmovel %edi, %esi
cmpb $0x78, %dl
cmovel %r8d, %esi
movl %esi, %edx
notl %edx
andl %ecx, %edx
orl %ecx, %esi
cmpb $0x2d, %al
cmovel %edx, %esi
movb (%r15), %dl
incq %r15
movl %esi, %ecx
testb %dl, %dl
jne 0x137f
jmp 0x13b5
movl %ecx, %esi
movq %r14, %rdi
callq 0x1190
testl %eax, %eax
je 0x13f0
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
jmp 0x13e0
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_remove
static int xpfs_remove(lua_State *L)
{
   const char *filename = luaL_checkstring(L, 1);

   int nerr = remove(filename);

   #ifdef _WIN32
   if (nerr) {
      nerr = chmod(filename, _S_IWRITE | _S_IREAD);
      if (nerr == 0) {
         nerr = remove(filename);
         if (nerr) { chmod(filename, _S_IREAD); }
      }
   }
   #endif

   if (nerr) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   lua_pushboolean(L, 1);
   return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %rdi
callq 0x1060
testl %eax, %eax
je 0x1900
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %ebp
jmp 0x190d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_mkdir
static int xpfs_mkdir(lua_State *L)
{
   const char *dirname = luaL_checkstring(L, 1);

   if (mkdir(dirname, 0777)) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   // success
   lua_pushboolean(L, 1);
   return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x1070
testl %eax, %eax
je 0x1964
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %ebp
jmp 0x1971
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_chdir
static int xpfs_chdir(lua_State *L)
{
   const char *dirname = luaL_checkstring(L, 1);

   if (chdir(dirname)) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   // success
   lua_pushboolean(L, 1);
   return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %rdi
callq 0x10d0
testl %eax, %eax
je 0x19c3
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %ebp
jmp 0x19d0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_rmdir
static int xpfs_rmdir(lua_State *L)
{
   const char *dirname = luaL_checkstring(L, 1);

   if (rmdir(dirname)) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   // success
   lua_pushboolean(L, 1);
   return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %rdi
callq 0x10a0
testl %eax, %eax
je 0x1a22
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %ebp
jmp 0x1a2f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_getcwd
static int xpfs_getcwd(lua_State *L)
{
   char *dir = getcwd(NULL, 0);

   if (dir == NULL) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   // success
   lua_pushstring(L, dir);
   free(dir);
   return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x1100
testq %rax, %rax
je 0x1a6a
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movq %r14, %rdi
callq 0x1040
movl $0x1, %eax
jmp 0x1a8e
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_rename
static int xpfs_rename(lua_State *L)
{
   const char *from = luaL_checkstring(L, 1);
   const char *to = luaL_checkstring(L, 2);;

   if (rename(from, to)) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   // success
   lua_pushboolean(L, 1);
   return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %r14
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1120
movq %r14, %rdi
movq %rax, %rsi
callq 0x11b0
testl %eax, %eax
je 0x1af0
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
jmp 0x1b02
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1180
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/luau/xpfs.c
// Function: xpfs_dir
static int xpfs_dir(lua_State *L)
{
   int nargs = lua_gettop(L);
   const char *dirname = luaL_checkstring(L, 1);
   struct dirent *pde;
   DIR *pdir;
   int ndx;

   if (nargs > 1) {
      (void) luaL_checkstring(L, 2);
   }

   pdir = opendir(dirname);
   ndx = 0;

   if (!pdir) {
      lua_pushnil(L);
      lua_pushstring(L, strerror(errno));
      return 2;
   }

   lua_createtable(L, 2, 0); // at least two entries

   while ( (pde = readdir(pdir)) != NULL ) {
      lua_pushstring(L, pde->d_name);
      lua_rawseti(L, -2, ++ndx);
   }

   closedir(pdir);

   // success
   return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1030
movl %eax, %ebp
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1120
movq %rax, %r14
cmpl $0x2, %ebp
jl 0x1b3d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1120
movq %r14, %rdi
callq 0x1090
testq %rax, %rax
je 0x1baa
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x10b0
movq %r14, %rdi
callq 0x1170
testq %rax, %rax
je 0x1b9b
movl $0x1, %ebp
addq $0x13, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl %ebp, %edx
callq 0x1140
movq %r14, %rdi
callq 0x1170
incl %ebp
testq %rax, %rax
jne 0x1b6e
movq %r14, %rdi
callq 0x1110
movl $0x1, %eax
jmp 0x1bce
movq %rbx, %rdi
callq 0x11a0
callq 0x1050
movl (%rax), %edi
callq 0x11d0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11c0
movl $0x2, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFClose
void  DBFClose(DBFHandle psDBF) {
  if (psDBF != NULL) {
    if (psDBF->bNoHeader)
      DBFWriteHeader(psDBF);
    DBFFlushRecord(psDBF);
    if (psDBF->bUpdated)
      DBFUpdateHeader(psDBF);
    fclose(psDBF->fp);
    free(psDBF->panFieldOffset);
    free(psDBF->panFieldSize);
    free(psDBF->panFieldDecimals);
    free(psDBF->pachFieldType);
    free(psDBF->pszWorkField);
    free(psDBF->pszHeader);
    free(psDBF->pszCurrentRecord);
    free(psDBF->pszCodePage);
    free(psDBF);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x1c95
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x60(%rdi)
je 0x1c26
movq %rbx, %rdi
callq 0x163a
movq %rbx, %rdi
callq 0x16fc
cmpl $0x0, 0x64(%rbx)
je 0x1c3c
movq %rbx, %rdi
callq 0x1590
movq (%rbx), %rdi
callq 0x10c0
movq 0x18(%rbx), %rdi
callq 0x1030
movq 0x20(%rbx), %rdi
callq 0x1030
movq 0x28(%rbx), %rdi
callq 0x1030
movq 0x30(%rbx), %rdi
callq 0x1030
movq 0x58(%rbx), %rdi
callq 0x1030
movq 0x38(%rbx), %rdi
callq 0x1030
movq 0x48(%rbx), %rdi
callq 0x1030
movq 0x78(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFIsAttributeNULL
int  DBFIsAttributeNULL(DBFHandle psDBF, int iRecord, int iField) {
  const char *pszValue;

  pszValue = DBFReadStringAttribute(psDBF, iRecord, iField);

  if (pszValue == NULL)
    return TRUE;

  return DBFIsValueNULL(psDBF->pachFieldType[iField], pszValue);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl $0x43, %ecx
callq 0x2188
testq %rax, %rax
je 0x22fd
movq 0x30(%r14), %rcx
movslq %ebx, %rdx
movsbl (%rcx,%rdx), %edi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x230a
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFIsValueNULL
static int DBFIsValueNULL(char chType, const char *pszValue) {
  int i;

  if (pszValue == NULL)
    return TRUE;

  switch (chType) {
  case 'N':
  case 'F':
    /*
    ** We accept all asterisks or all blanks as NULL
    ** though according to the spec I think it should be all
    ** asterisks.
    */
    if (pszValue[0] == '*')
      return TRUE;
    for (i = 0; pszValue[i] != '\0'; i++) {
      if (pszValue[i] != ' ')
        return FALSE;
    }
    return TRUE;

  case 'D':
    /* NULL date fields have value "00000000" */
    return strncmp(pszValue, "00000000", 8) == 0;

  case 'L':
    /* NULL boolean fields have value "?" */
    return pszValue[0] == '?';

  default:
    /* empty string fields are considered NULL */
    return strlen(pszValue) == 0;
  }
}

// Assembly:
pushq %rax
movb $0x1, %al
testq %rsi, %rsi
je 0x2374
movsbl %dil, %ecx
addl $-0x44, %ecx
rorl %ecx
cmpl $0x5, %ecx
ja 0x236e
leaq 0x1d2d(%rip), %rdx      # 0x4054
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb (%rsi), %cl
cmpb $0x2a, %cl
jne 0x233b
jmp 0x2374
movb (%rsi), %cl
incq %rsi
cmpb $0x20, %cl
je 0x2339
movzbl %cl, %ecx
testl %ecx, %ecx
je 0x2374
xorl %eax, %eax
jmp 0x2374
leaq 0x1d7a(%rip), %rax      # 0x40cf
movl $0x8, %edx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
jmp 0x2371
cmpb $0x3f, (%rsi)
jmp 0x2371
cmpb $0x0, (%rsi)
sete %al
movzbl %al, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFGetFieldInfo
DBFFieldType  DBFGetFieldInfo(DBFHandle psDBF, int iField, char *pszFieldName,
                                         int *pnWidth, int *pnDecimals) {
  if (iField < 0 || iField >= psDBF->nFields)
    return (FTInvalid);

  if (pnWidth != NULL)
    *pnWidth = psDBF->panFieldSize[iField];
  if (pnDecimals != NULL)
    *pnDecimals = psDBF->panFieldDecimals[iField];
  if (pszFieldName != NULL) {
    int i;
    strncpy(pszFieldName, (char *) psDBF->pszHeader + iField * 32, 11);
    pszFieldName[11] = '\0';
    for (i = 10; i > 0 && pszFieldName[i] == ' '; i--)
      pszFieldName[i] = '\0';
  }

  if (psDBF->pachFieldType[iField] == 'L')
    return (FTLogical);
  else if (psDBF->pachFieldType[iField] == 'N'
           || psDBF->pachFieldType[iField] == 'F') {
    if (psDBF->panFieldDecimals[iField] > 0
        || psDBF->panFieldSize[iField] > 10)
      return (FTDouble);
    else
      return (FTInteger);
  } else {
    return (FTString);
  }
}

// Assembly:
movl $0x4, %eax
testl %esi, %esi
js 0x2442
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x14(%rdi)
jle 0x243d
movq %rdx, %r14
movl %esi, %r15d
testq %rcx, %rcx
je 0x23b4
movq 0x20(%rbx), %rax
movl (%rax,%r15,4), %eax
movl %eax, (%rcx)
testq %r8, %r8
je 0x23c4
movq 0x28(%rbx), %rax
movl (%rax,%r15,4), %eax
movl %eax, (%r8)
testq %r14, %r14
je 0x23fa
shll $0x5, %esi
addq 0x38(%rbx), %rsi
movl $0xb, %edx
movq %r14, %rdi
callq 0x1050
movb $0x0, 0xb(%r14)
movl $0xb, %eax
decl %eax
cmpb $0x20, (%r14,%rax)
jne 0x23fa
movb $0x0, (%r14,%rax)
cmpl $0x1, %eax
ja 0x23e7
movq 0x30(%rbx), %rax
movzbl (%rax,%r15), %eax
cmpl $0x4e, %eax
je 0x2412
cmpl $0x4c, %eax
je 0x2434
cmpl $0x46, %eax
jne 0x243b
movq 0x28(%rbx), %rcx
movl $0x2, %eax
cmpl $0x0, (%rcx,%r15,4)
jg 0x243d
movq 0x20(%rbx), %rcx
xorl %eax, %eax
cmpl $0xb, (%rcx,%r15,4)
setge %al
incl %eax
jmp 0x243d
movl $0x3, %eax
jmp 0x243d
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFWriteAttributeDirectly
int  DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,void *pValue) {
  int i, j;
  unsigned char *pabyRec;

  /* Is this a valid record? */
  if (hEntity < 0 || hEntity > psDBF->nRecords)
    return (FALSE);

  if (psDBF->bNoHeader)
    DBFWriteHeader(psDBF);

  /* Is this a brand new record? */
  if (hEntity == psDBF->nRecords) {
    if (!DBFFlushRecord(psDBF))
      return FALSE;

    psDBF->nRecords++;
    for (i = 0; i < psDBF->nRecordLength; i++)
      psDBF->pszCurrentRecord[i] = ' ';
    psDBF->nCurrentRecord = hEntity;
  }

  /* Is this an existing record, but different than the last one */
  /* we accessed? */
  if (!DBFLoadRecord(psDBF, hEntity))
    return FALSE;
  pabyRec = (unsigned char *) psDBF->pszCurrentRecord;

  /* Assign all the record fields. */
  if ((int) strlen((char *) pValue) > psDBF->panFieldSize[iField])
    j = psDBF->panFieldSize[iField];
  else {
    memset(pabyRec + psDBF->panFieldOffset[iField], ' ',psDBF->panFieldSize[iField]);
    j = strlen((char *) pValue);
  }

  strncpy((char *) (pabyRec + psDBF->panFieldOffset[iField]),(char *) pValue, j);
  psDBF->bCurrentRecordModified = TRUE;
  psDBF->bUpdated = TRUE;
  return (TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebp, %ebp
testl %esi, %esi
js 0x2526
movl %esi, %r12d
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpl %esi, %eax
jl 0x2526
movq %rcx, %r14
movl %edx, %r15d
cmpl $0x0, 0x60(%rbx)
je 0x247d
movq %rbx, %rdi
callq 0x163a
movl 0x8(%rbx), %eax
cmpl %r12d, %eax
jne 0x24b5
movq %rbx, %rdi
callq 0x16fc
testl %eax, %eax
je 0x2526
incl 0x8(%rbx)
cmpl $0x0, 0xc(%rbx)
jle 0x24b1
xorl %eax, %eax
movq 0x48(%rbx), %rcx
movb $0x20, (%rcx,%rax)
incq %rax
movslq 0xc(%rbx), %rcx
cmpq %rcx, %rax
jl 0x249d
movl %r12d, 0x40(%rbx)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2531
testl %eax, %eax
je 0x2526
movq 0x48(%rbx), %r12
movq %r14, %rdi
callq 0x10d0
movq %rax, %rcx
movq 0x20(%rbx), %rax
movslq %r15d, %r15
movl (%rax,%r15,4), %eax
cmpl %ecx, %eax
jl 0x2502
movslq %eax, %rdx
movq 0x18(%rbx), %rax
movslq (%rax,%r15,4), %rdi
addq %r12, %rdi
movl $0x20, %esi
callq 0x10f0
movq %r14, %rdi
callq 0x10d0
movq 0x18(%rbx), %rcx
movslq (%rcx,%r15,4), %rcx
addq %rcx, %r12
movslq %eax, %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x1050
movl $0x1, %ebp
movl %ebp, 0x44(%rbx)
movl %ebp, 0x64(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFLoadRecord
static int DBFLoadRecord(DBFHandle psDBF, int iRecord) {
  if (psDBF->nCurrentRecord != iRecord) {
    unsigned long nRecordOffset;
    char szMessage[128];

    if (!DBFFlushRecord(psDBF))
      return FALSE;
    nRecordOffset = psDBF->nRecordLength * (unsigned long) iRecord + psDBF->nHeaderLength;
    if (fseek(psDBF->fp, nRecordOffset, SEEK_SET) != 0) {
      sprintf(szMessage, "fseek(%ld) failed on DBF file.\n",(long) nRecordOffset);
      fprintf(stderr,szMessage);
      return FALSE;
    }
    if (fread(psDBF->pszCurrentRecord,psDBF->nRecordLength, 1, psDBF->fp) != 1) {
      sprintf(szMessage, "fread(%d) failed on DBF file.\n",psDBF->nRecordLength);
      fprintf(stderr,szMessage);
      return FALSE;
    }
    psDBF->nCurrentRecord = iRecord;
  }
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl $0x1, %ebx
cmpl %esi, 0x40(%rdi)
je 0x25e2
movl %esi, %ebp
movq %rdi, %r14
callq 0x16fc
testl %eax, %eax
je 0x25e0
movslq 0xc(%r14), %rax
movl %ebp, %ecx
imulq %rax, %rcx
movslq 0x10(%r14), %r15
addq %rcx, %r15
movq (%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1180
testl %eax, %eax
jne 0x25a1
movq (%r14), %rcx
movq 0x48(%r14), %rdi
movslq 0xc(%r14), %rsi
movl $0x1, %edx
callq 0x10a0
cmpq $0x1, %rax
jne 0x25b7
movl %ebp, 0x40(%r14)
jmp 0x25e2
leaq 0x1b30(%rip), %rsi      # 0x40d8
movq %rsp, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x11d0
jmp 0x25cc
movl 0xc(%r14), %edx
leaq 0x1b36(%rip), %rsi      # 0x40f8
movq %rsp, %rdi
xorl %eax, %eax
callq 0x11d0
movq 0x3a25(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rsp, %rsi
xorl %eax, %eax
callq 0x1140
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFWriteTuple
int  DBFWriteTuple(DBFHandle psDBF, int hEntity, void *pRawTuple) {
  int i;
  unsigned char *pabyRec;

  /* Is this a valid record? */
  if (hEntity < 0 || hEntity > psDBF->nRecords)
    return (FALSE);

  if (psDBF->bNoHeader)
    DBFWriteHeader(psDBF);

  /* Is this a brand new record? */
  if (hEntity == psDBF->nRecords) {
    if (!DBFFlushRecord(psDBF))
      return FALSE;
    psDBF->nRecords++;
    for (i = 0; i < psDBF->nRecordLength; i++)
      psDBF->pszCurrentRecord[i] = ' ';
    psDBF->nCurrentRecord = hEntity;
  }

  /* Is this an existing record, but different than the last one */
  /* we accessed? */
  if (!DBFLoadRecord(psDBF, hEntity))
    return FALSE;
  pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
  memcpy(pabyRec, pRawTuple, psDBF->nRecordLength);
  psDBF->bCurrentRecordModified = TRUE;
  psDBF->bUpdated = TRUE;
  return (TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testl %esi, %esi
js 0x2927
movl %esi, %ebp
movq %rdi, %r14
movl 0x8(%rdi), %eax
cmpl %esi, %eax
jl 0x2927
movq %rdx, %r15
cmpl $0x0, 0x60(%r14)
je 0x28c7
movq %r14, %rdi
callq 0x163a
movl 0x8(%r14), %eax
cmpl %ebp, %eax
jne 0x28fc
movq %r14, %rdi
callq 0x16fc
testl %eax, %eax
je 0x2927
incl 0x8(%r14)
cmpl $0x0, 0xc(%r14)
jle 0x28f8
xorl %eax, %eax
movq 0x48(%r14), %rcx
movb $0x20, (%rcx,%rax)
incq %rax
movslq 0xc(%r14), %rcx
cmpq %rcx, %rax
jl 0x28e4
movl %ebp, 0x40(%r14)
movq %r14, %rdi
movl %ebp, %esi
callq 0x2531
testl %eax, %eax
je 0x2927
movq 0x48(%r14), %rdi
movslq 0xc(%r14), %rdx
movq %r15, %rsi
callq 0x1150
movl $0x1, %ebx
movl %ebx, 0x44(%r14)
movl %ebx, 0x64(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFCloneEmpty
DBFHandle  DBFCloneEmpty(DBFHandle psDBF, const char *pszFilename) {
  DBFHandle newDBF;

  newDBF = DBFCreateEx(pszFilename, psDBF->pszCodePage);
  if (newDBF == NULL)
    return (NULL);

  newDBF->nFields = psDBF->nFields;
  newDBF->nRecordLength = psDBF->nRecordLength;
  newDBF->nHeaderLength = psDBF->nHeaderLength;
  newDBF->pszHeader = (char *) malloc(newDBF->nHeaderLength);
  memcpy(newDBF->pszHeader, psDBF->pszHeader, newDBF->nHeaderLength);
  newDBF->panFieldOffset = (int *) malloc(sizeof(int) * psDBF->nFields);
  memcpy(newDBF->panFieldOffset, psDBF->panFieldOffset,  sizeof(int) * psDBF->nFields);
  newDBF->panFieldSize = (int *) malloc(sizeof(int) * psDBF->nFields);
  memcpy(newDBF->panFieldSize, psDBF->panFieldSize, sizeof(int) * psDBF->nFields);
  newDBF->panFieldDecimals = (int *) malloc(sizeof(int) * psDBF->nFields);
  memcpy(newDBF->panFieldDecimals, psDBF->panFieldDecimals, sizeof(int) * psDBF->nFields);
  newDBF->pachFieldType = (char *) malloc(sizeof(char) * psDBF->nFields);
  memcpy(newDBF->pachFieldType, psDBF->pachFieldType, sizeof(char) * psDBF->nFields);

  newDBF->bNoHeader = TRUE;
  newDBF->bUpdated = TRUE;
  DBFWriteHeader(newDBF);
  DBFClose(newDBF);
  newDBF = DBFOpen(pszFilename, "rb+");
  return (newDBF);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x78(%rdi), %rsi
movq %rbx, %rdi
callq 0x1ca2
testq %rax, %rax
je 0x2a5e
movq %rax, %r14
movslq 0x14(%r15), %r12
movl %r12d, 0x14(%rax)
movl 0xc(%r15), %eax
movl %eax, 0xc(%r14)
movslq 0x10(%r15), %r13
movl %r13d, 0x10(%r14)
movq %r13, %rdi
callq 0x1160
movq %rax, 0x38(%r14)
movq 0x38(%r15), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1150
leaq (,%r12,4), %r13
movq %r13, %rdi
callq 0x1160
movq %rax, 0x18(%r14)
movq 0x18(%r15), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1150
movq %r13, %rdi
callq 0x1160
movq %rax, 0x20(%r14)
movq 0x20(%r15), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1150
movq %r13, %rdi
callq 0x1160
movq %rax, 0x28(%r14)
movq 0x28(%r15), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x1150
movq %r12, %rdi
callq 0x1160
movq %rax, 0x30(%r14)
movq 0x30(%r15), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x1150
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x60(%r14)
movq %r14, %rdi
callq 0x163a
movq %r14, %rdi
callq 0x1c0b
leaq 0x1621(%rip), %rsi      # 0x406e
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1771
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFGetFieldIndex
int  DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName) {
  char name[12], name1[12], name2[12];
  int i;

  strncpy(name1, pszFieldName, 11);
  name1[11] = '\0';
  str_to_upper(name1);
  for (i = 0; i < DBFGetFieldCount(psDBF); i++) {
    DBFGetFieldInfo(psDBF, i, name, NULL, NULL);
    strncpy(name2, name, 11);
    str_to_upper(name2);
    if (!strncmp(name1, name2, 10))
      return (i);
  }
  return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
movl $0xb, %edx
movq %r14, %rdi
callq 0x1050
movb $0x0, 0xb(%r14)
movq %r14, %rdi
callq 0x2b2a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x0, 0x14(%rbx)
jle 0x2b19
xorl %r14d, %r14d
leaq 0x1c(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2381
movl $0xb, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1050
movq %r12, %rdi
callq 0x2b2a
movl $0xa, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x1070
testl %eax, %eax
je 0x2b16
incl %r14d
cmpl 0x14(%rbx), %r14d
jl 0x2acc
jmp 0x2b19
movl %r14d, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: str_to_upper
static void str_to_upper(char *string) {
  int len = strlen(string);
  short i = -1;
  while (++i < len)
    if (isalpha(string[i]) && islower(string[i]))
      string[i] = (char) toupper((int) string[i]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x10d0
movq %rax, %r14
testl %r14d, %r14d
jle 0x2b83
movw $0x1, %r12w
callq 0x11f0
movq %rax, %r15
leal -0x1(%r12), %eax
movq (%r15), %rcx
movswq %ax, %r13
movsbq (%rbx,%r13), %rdi
movzwl (%rcx,%rdi,2), %eax
notl %eax
testl $0x600, %eax            # imm = 0x600
jne 0x2b77
callq 0x1090
movb %al, (%rbx,%r13)
movswl %r12w, %eax
incl %r12d
cmpl %r14d, %eax
jl 0x2b50
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFIsRecordDeleted
int  DBFIsRecordDeleted(DBFHandle psDBF, int iShape) {
  /* Verify selection. */
  if (iShape < 0 || iShape >= psDBF->nRecords)
    return TRUE;

  /* Have we read the record? */
  if (!DBFLoadRecord(psDBF, iShape))
    return FALSE;

  /* '*' means deleted. */
  return psDBF->pszCurrentRecord[0] == '*';
}

// Assembly:
movl $0x1, %eax
testl %esi, %esi
js 0x2bbc
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x8(%rdi)
jle 0x2bbb
movq %rbx, %rdi
callq 0x2531
testl %eax, %eax
je 0x2bb9
movq 0x48(%rbx), %rcx
xorl %eax, %eax
cmpb $0x2a, (%rcx)
sete %al
jmp 0x2bbb
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFMarkRecordDeleted
int  DBFMarkRecordDeleted(DBFHandle psDBF, int iShape, int bIsDeleted) {
  char chNewFlag;

  /* Verify selection. */
  if (iShape < 0 || iShape >= psDBF->nRecords)
    return FALSE;

  /* Is this an existing record, but different than the last one */
  /* we accessed? */
  if (!DBFLoadRecord(psDBF, iShape))
    return FALSE;

  /* Assign value, marking record as dirty if it changes. */
  if (bIsDeleted)
    chNewFlag = '*';
  else
    chNewFlag = ' ';

  if (psDBF->pszCurrentRecord[0] != chNewFlag) {
    psDBF->bCurrentRecordModified = TRUE;
    psDBF->bUpdated = TRUE;
    psDBF->pszCurrentRecord[0] = chNewFlag;
  }

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
testl %esi, %esi
js 0x2c03
movq %rdi, %r14
cmpl %esi, 0x8(%rdi)
jle 0x2c03
movl %edx, %ebp
movq %r14, %rdi
callq 0x2531
testl %eax, %eax
je 0x2c03
testl %ebp, %ebp
movl $0x20, %ecx
movl $0x2a, %eax
cmovel %ecx, %eax
movq 0x48(%r14), %rcx
movl $0x1, %ebx
cmpb %al, (%rcx)
je 0x2c03
movl %ebx, 0x44(%r14)
movl %ebx, 0x64(%r14)
movb %al, (%rcx)
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/dispatch.c
// Function: callback_mrc_timer
static int
callback_mrc_timer(void * cookie)
{
	struct dispatch_state * D = cookie;

	/* If we have no pending cleaning, reset the timer. */
	if (!btree_cleaning_possible(D->T->cstate)) {
		if ((D->mrc_timer = events_timer_register(callback_mrc_timer,
		    D, &fivesec)) == NULL)
			return (-1);
		else
			return (0);
	}

	/* This timer isn't ticking any more. */
	D->mrc_timer = NULL;

	/* We want to force a batch of MRs so that we can clean. */
	D->docleans = 1;

	/* Launch a (possibly empty) batch of MRs if possible. */
	return (poke_mr(D));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x40(%rax), %rdi
callq 0x71ca
testl %eax, %eax
je 0x3900
movq $0x0, 0xb8(%rbx)
movl $0x1, 0xc0(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x3bd8
leaq -0x3a(%rip), %rdi       # 0x38cd
leaq 0x10ad2(%rip), %rdx     # 0x143e0
movq %rbx, %rsi
callq 0xc618
movq %rax, 0xb8(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/dispatch.c
// Function: callback_accept
static int
callback_accept(void * cookie, int s)
{
	struct dispatch_state * D = cookie;

	/* We have a socket. */
	if ((D->s = s) == -1) {
		warnp("Error accepting connection");
		goto err0;
	}

	/* Make the accepted connection non-blocking. */
	if (fcntl(D->s, F_SETFL, O_NONBLOCK) == -1) {
		warnp("Cannot make connection non-blocking");
		goto err1;
	}

	/* Create a buffered writer for the connection. */
	if ((D->writeq = netbuf_write_init(D->s, dropconnection, D)) == NULL) {
		warnp("Cannot create packet write queue");
		goto err1;
	}

	/* Create a buffered reader for the connection. */
	if ((D->readq = netbuf_read_init(D->s)) == NULL) {
		warn0("Cannot create packet read queue");
		goto err2;
	}

	/* Start listening for packets. */
	if (readreqs(D))
		goto err3;

	/* Success! */
	return (0);

err3:
	netbuf_read_free(D->readq);
err2:
	netbuf_write_free(D->writeq);
err1:
	if (close(D->s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, 0x4(%rdi)
cmpl $-0x1, %esi
je 0x399e
movq %rdi, %rbx
movl %esi, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x2120
cmpl $-0x1, %eax
je 0x39c1
movl 0x4(%rbx), %edi
leaq 0xd0c(%rip), %rsi       # 0x4666
movq %rbx, %rdx
callq 0xcca4
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x39d7
movl 0x4(%rbx), %edi
callq 0xc90c
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3a13
movq %rbx, %rdi
callq 0x410a
testl %eax, %eax
je 0x3a40
movq 0x8(%rbx), %rdi
callq 0xcc3a
jmp 0x3a2c
callq 0x20a0
cmpl $0x0, (%rax)
je 0x39fb
movq %rax, %rbx
leaq 0x10bce(%rip), %rdi     # 0x14580
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%rbx)
jmp 0x3a09
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3a37
movq %rax, %r14
leaq 0x10bc6(%rip), %rdi     # 0x1459b
jmp 0x39eb
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3a44
movq %rax, %r14
leaq 0x10bd4(%rip), %rdi     # 0x145bf
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%r14)
jmp 0x3a52
leaq 0x10b7e(%rip), %rdi     # 0x14580
xorl %eax, %eax
callq 0x100ef
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3a95
leaq 0x10bc6(%rip), %rdi     # 0x145e0
xorl %eax, %eax
callq 0x100ef
callq 0x20a0
movl $0x0, (%rax)
movq 0x10(%rbx), %rdi
callq 0xd003
jmp 0x3a52
leaq 0x10b5d(%rip), %rdi     # 0x1459b
jmp 0x3a4b
xorl %ebx, %ebx
jmp 0x3a95
leaq 0x10b74(%rip), %rdi     # 0x145bf
xorl %eax, %eax
callq 0x100ef
movl 0x4(%rbx), %edi
callq 0x21f0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x3a95
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3a87
movq %rax, %r14
leaq 0x1248b(%rip), %rdi     # 0x15f02
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%r14)
jmp 0x3a95
leaq 0x12474(%rip), %rdi     # 0x15f02
xorl %eax, %eax
callq 0x100ef
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{

	/*
	 * There should not be a MR timer running, because there should be
	 * no requests in progress.  We should not be reading a request, and
	 * the connection should be dying.
	 */
	assert(D->mr_timer == NULL);
	assert(D->nrequests == 0);
	assert(D->read_cookie == NULL);
	assert(D->dying == 1);

	/* Stop the cleaning timer. */
	events_timer_cancel(D->mrc_timer);

	/* Free the buffered reader. */
	netbuf_read_free(D->readq);

	/* Free the buffered writer. */
	netbuf_write_free(D->writeq);

	/* Close the socket. */
	while (close(D->s)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err1;
	}

	/* Free the dispatcher state. */
	free(D);

	/* Success! */
	return (0);

err1:
	free(D);

	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x90(%rdi)
jne 0x3b5c
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x3b7b
cmpq $0x0, 0x18(%rbx)
jne 0x3b9a
cmpl $0x1, (%rbx)
jne 0x3bb9
movq 0xb8(%rbx), %rdi
callq 0xc792
movq 0x8(%rbx), %rdi
callq 0xcc3a
movq 0x10(%rbx), %rdi
callq 0xd003
movl 0x4(%rbx), %edi
callq 0x21f0
testl %eax, %eax
je 0x3b36
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3b07
leaq 0x123d9(%rip), %rdi     # 0x15f02
testl %eax, %eax
jne 0x3b3a
xorl %eax, %eax
callq 0x100ef
jmp 0x3b48
xorl %ebp, %ebp
jmp 0x3b4d
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x108a3(%rip), %rdi     # 0x14406
leaq 0x108b0(%rip), %rsi     # 0x1441a
leaq 0x108b4(%rip), %rcx     # 0x14425
movl $0x2e3, %edx            # imm = 0x2E3
callq 0x21c0
leaq 0x108ce(%rip), %rdi     # 0x14450
leaq 0x10891(%rip), %rsi     # 0x1441a
leaq 0x10895(%rip), %rcx     # 0x14425
movl $0x2e4, %edx            # imm = 0x2E4
callq 0x21c0
leaq 0x108c1(%rip), %rdi     # 0x14462
leaq 0x10872(%rip), %rsi     # 0x1441a
leaq 0x10876(%rip), %rcx     # 0x14425
movl $0x2e5, %edx            # imm = 0x2E5
callq 0x21c0
leaq 0x108b9(%rip), %rdi     # 0x14479
leaq 0x10853(%rip), %rsi     # 0x1441a
leaq 0x10857(%rip), %rcx     # 0x14425
movl $0x2e6, %edx            # imm = 0x2E6
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/dispatch.c
// Function: readreqs
static int
readreqs(struct dispatch_state * D)
{

	/* If this connection is dying, do nothing. */
	if (D->dying)
		goto done;

	/* If we don't have a reader, don't try to read. */
	if (D->readq == NULL)
		goto done;

	/* If we are already reading, do nothing. */
	if (D->read_cookie != NULL)
		goto done;

	/* If we have MAXREQS requests in progress, do nothing. */
	if (D->nrequests == MAXREQS)
		goto done;

	/* Wait for a request to arrive. */
	if ((D->read_cookie = wire_readpacket_wait(D->readq,
	    gotrequest, D)) == NULL) {
		warnp("Error reading request from connection");
		goto err0;
	}

done:
	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, (%rdi)
je 0x411f
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4115
cmpq $0x0, 0x18(%r14)
jne 0x4115
cmpq $0x1000, 0x20(%r14)     # imm = 0x1000
je 0x4115
leaq 0x49(%rip), %rsi        # 0x418c
movq %r14, %rdx
callq 0x119da
movq %rax, 0x18(%r14)
testq %rax, %rax
jne 0x4115
callq 0x20a0
cmpl $0x0, (%rax)
je 0x4177
movq %rax, %rbx
leaq 0x103c8(%rip), %rdi     # 0x14530
xorl %eax, %eax
callq 0xffd0
movl $0x0, (%rbx)
jmp 0x4185
leaq 0x103b2(%rip), %rdi     # 0x14530
xorl %eax, %eax
callq 0x100ef
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x4115
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/dispatch.c
// Function: poke_nmr
static int
poke_nmr(struct dispatch_state * D)
{
	struct requestq * RQ;

	/* If we have any queued requests, try to launch them. */
	while ((RQ = D->nmr_head) != NULL) {
		/* How many pages would this request need to touch? */
		if (RQ->R->type == PROTO_KVLDS_GET)
			RQ->npages = (size_t)(D->T->root_shadow->height + 1);
		else
			RQ->npages = (size_t)D->T->root_shadow->height +
			    D->T->pagelen / SERIALIZE_PERCHILD;

		/* Can we handle this request? */
		if ((D->nmr_ip > 0) &&
		    (D->nmr_ip + RQ->npages > D->nmr_concurrency))
			break;

		/* Dequeue this request. */
		D->nmr_head = RQ->next;

		/* Launch the request. */
		RQ->D = D;
		if (dispatch_nmr_launch(D->T, RQ->R, D->writeq,
		    callback_nmr_done, RQ))
			goto err0;
		D->nmr_ip += RQ->npages;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x40(%rdi), %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x465a
movq %rdi, %r14
leaq 0x2fd(%rip), %r12       # 0x48d5
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
movq (%r15), %rsi
cmpl $0x130, 0x8(%rsi)       # imm = 0x130
movq 0x28(%r14), %rdi
movq 0x20(%rdi), %rax
movsbq 0x1d(%rax), %rcx
jne 0x4600
incq %rcx
jmp 0x460d
movq %r13, %rax
mulq (%rdi)
shrq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, 0x18(%r15)
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x4623
addq %rax, %rcx
cmpq 0x58(%r14), %rcx
ja 0x465a
movq 0x8(%r15), %rax
movq %rax, 0x40(%r14)
movq %r14, 0x10(%r15)
movq 0x10(%r14), %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x52c8
testl %eax, %eax
jne 0x4655
movq 0x18(%r15), %rax
addq %rax, 0x50(%r14)
movq 0x40(%r14), %r15
testq %r15, %r15
jne 0x45e2
jmp 0x465a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq