LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/xtanitfy[P]Murphy/src/blob.c
// Function: BLOB_print
void BLOB_print(BLOB_s *pBlob)
{
	CHECK_EXPR_RET_VOID(pBlob==NULL);
	
	unsigned long batches = 1/*pBlob->batches*/;
	unsigned long width = pBlob->widthSize;
	unsigned long height = pBlob->heightSize;
	unsigned long num = pBlob->numSize;
	unsigned long channels = pBlob->channelSize;
	
	BLOB_DATA_PTR(pBlob,ptr);
	for (int i_channel = 0;i_channel  < channels;i_channel++) {
		for (int i_batch = 0;i_batch < batches;i_batch++) {
			for (int i_num = 0;i_num < num;i_num++) {	
				for (int i_height = 0;i_height < height;i_height++) {	
					for (int i_width = 0;i_width < width;i_width++) {	
						printf("%lf ",ptr[i_num][i_channel][i_height+pBlob->pady][i_width+pBlob->padx]);	
					}
					printf(" ");
				}
				printf("  ");
			}
			printf("\n");
		}
		printf(" ");
	}
}

// Assembly:
testq %rdi, %rdi
je 0x2171
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x2162
movq 0x28(%rbx), %r13
movq 0x20(%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x40(%rsp)
movq 0x10(%rbx), %rcx
movq %rcx, 0x28(%rsp)
movq %rax, %rcx
imulq %r13, %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x30(%rsp)
imulq 0x20(%rsp), %rax
imulq %r13, %rax
movq %rax, 0x48(%rsp)
movq $0x0, 0x8(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x2136
movq 0x38(%rsp), %rax
imulq 0x8(%rsp), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x2110
movq 0x48(%rsp), %rax
imulq 0x10(%rsp), %rax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax,8), %r12
movq $0x0, 0x18(%rsp)
testq %r13, %r13
leaq 0x1103(%rip), %r14      # 0x31bc
je 0x20f2
movslq 0x18(%rsp), %rbp
xorl %r15d, %r15d
movslq 0x38(%rbx), %rax
addq %rbp, %rax
imulq %r13, %rax
leaq (%r12,%rax,8), %rax
movl 0x3c(%rbx), %ecx
addl %r15d, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x1030
incq %r15
cmpq %r15, %r13
jne 0x20c3
movl $0x20, %edi
callq 0x10b0
movq 0x18(%rsp), %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
cmpq 0x30(%rsp), %rcx
jne 0x20af
leaq 0x10aa(%rip), %rdi      # 0x31c1
xorl %eax, %eax
callq 0x1030
movq 0x10(%rsp), %rcx
incq %rcx
movq %rcx, 0x10(%rsp)
cmpq 0x28(%rsp), %rcx
jne 0x208a
movl $0xa, %edi
callq 0x10b0
movl $0x20, %edi
callq 0x10b0
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, 0x8(%rsp)
cmpq 0x20(%rsp), %rcx
jne 0x205c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xec8(%rip), %rdi       # 0x3040
leaq 0xf7e(%rip), %rsi       # 0x30fd
leaq 0x102b(%rip), %rdx      # 0x31b1
movl $0xae, %ecx
xorl %eax, %eax
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/aparrish[P]rwet-examples-c/markov.c
// Function: main
int main(int argc, char** argv) {

	int len, n, i, line_count;
	char* line;
	markov_gen_t* gen;

	if (argc != 3) {
		fprintf(stderr, "usage: markov n line_count\n");
		exit(-1);
	}

	n = atoi(argv[1]);
	line_count = atoi(argv[2]);

	gen = markov_gen_new(n, 100);
	while (!feof(stdin)) {
		len = ap_getline(&line, stdin);
		markov_gen_feed(gen, line);
		free(line);
	}

	/* uncomment to dump markov chain data */
	/*markov_gen_dump(gen);*/

	for (i = 0; i < line_count; i++) {
		markov_gen_generate_new(gen, &line);
		printf("%s\n", line);
		free(line);
	}

	markov_gen_free(gen);

	return 0;
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x3, %edi
jne 0x1355
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x10f0
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x10f0
movl %eax, %ebx
movl %ebp, %edi
movl $0x64, %esi
callq 0x1758
movq %rax, %r14
movq 0x3d08(%rip), %r12      # 0x4fd8
movq (%r12), %rdi
callq 0x1090
testl %eax, %eax
jne 0x1312
leaq 0x8(%rsp), %r15
movq (%r12), %rsi
movq %r15, %rdi
callq 0x2b50
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x17ab
movq 0x8(%rsp), %rdi
callq 0x1030
movq (%r12), %rdi
callq 0x1090
testl %eax, %eax
je 0x12e2
testl %ebx, %ebx
jle 0x133e
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x22cc
movq 0x8(%rsp), %rdi
callq 0x1050
movq 0x8(%rsp), %rdi
callq 0x1030
decl %ebx
jne 0x131b
movq %r14, %rdi
callq 0x292e
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x1170
nop
// File: /workspace/github_c_makefile_star2_O3/aparrish[P]rwet-examples-c/markov_gen.c
// Function: markov_gen_new
markov_gen_t* markov_gen_new(int n, int max) {
	markov_gen_t* mg;
	mg = (markov_gen_t*)malloc(sizeof(markov_gen_t));
	mg->n = n;
	mg->max = max;
	mg->ngrams = NULL;
	utarray_new(mg->beginnings, &ptr_icd);
	return mg;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl $0x18, %edi
callq 0x10b0
movq %rax, %r14
movl %ebp, (%rax)
movl %ebx, 0x4(%rax)
movq $0x0, 0x8(%rax)
movl $0x1, %edi
movl $0x30, %esi
callq 0x1080
movq %rax, 0x10(%r14)
movups 0x392c(%rip), %xmm0     # 0x50c0
movups %xmm0, 0x8(%rax)
movups 0x3931(%rip), %xmm0     # 0x50d0
movups %xmm0, 0x18(%rax)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aparrish[P]rwet-examples-c/markov_gen.c
// Function: markov_gen_dump
void markov_gen_dump(markov_gen_t* mg) {
	ngram_t* current, * tmp;
	char* joined_nexts, * joined_ngram;
	int joined_len, i;

	printf("ngrams:\n");
	HASH_ITER(hh, mg->ngrams, current, tmp) {
		joined_len = join_new(&joined_ngram, current->ngram, " ");
		joined_len = join_new(&joined_nexts, current->possible_nexts, ", ");
		printf("\t%s -> %s\n", joined_ngram, joined_nexts);
		free(joined_ngram);
		free(joined_nexts);
	}

	printf("beginnings:\n");
	for (i = 0; i < utarray_len(mg->beginnings); i++) {
		current = *((ngram_t**)utarray_eltptr(mg->beginnings, i));
		printf("\t%s\n", current->ngram_key);
	}

	printf("a random beginning:\n");
	current = *((ngram_t**)utarray_choice(mg->beginnings));
	printf("\t%s\n", current->ngram_key);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8a9(%rip), %rdi       # 0x30c2
callq 0x1050
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x2892
leaq 0x881(%rip), %r12       # 0x30af
leaq 0x10(%rsp), %r13
leaq 0x878(%rip), %rbp       # 0x30b2
movq 0x8(%r14), %rsi
movq 0x28(%r14), %r15
leaq 0x8(%rsp), %rdi
leaq 0x862(%rip), %rdx       # 0x30b0
callq 0x164f
movq 0x10(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x164f
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1070
movq 0x8(%rsp), %rdi
callq 0x1030
movq 0x10(%rsp), %rdi
callq 0x1030
movq %r15, %r14
testq %r15, %r15
jne 0x283a
leaq 0x831(%rip), %rdi       # 0x30ca
callq 0x1050
movq 0x10(%rbx), %rax
cmpl $0x0, (%rax)
je 0x28dc
leaq 0x80f(%rip), %r14       # 0x30bd
xorl %r15d, %r15d
movq 0x28(%rax), %rcx
movq 0x8(%rax), %rax
imulq %r15, %rax
movq (%rcx,%rax), %rax
movq (%rax), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
incq %r15
movq 0x10(%rbx), %rax
movl (%rax), %ecx
cmpq %rcx, %r15
jb 0x28b1
leaq 0x7f3(%rip), %rdi       # 0x30d6
callq 0x1050
callq 0x1150
movq 0x10(%rbx), %rax
movq 0x8(%rax), %r14
movq 0x28(%rax), %r15
callq 0x1150
movq 0x10(%rbx), %rcx
xorl %edx, %edx
divl (%rcx)
imulq %r14, %rdx
movq (%r15,%rdx), %rax
movq (%rax), %rsi
leaq 0x7a5(%rip), %rdi       # 0x30bd
xorl %eax, %eax
callq 0x1070
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aparrish[P]rwet-examples-c/markov_gen.c
// Function: markov_gen_free
void markov_gen_free(markov_gen_t* mg) {

	ngram_t* current, * tmp;

	/* free individual ngram structs here */
	HASH_ITER(hh, mg->ngrams, current, tmp) {
		HASH_DEL(mg->ngrams, current);
		free(current->ngram_key);
		utarray_free(current->possible_nexts);
		utarray_free(current->ngram);
		free(current);
	}

	utarray_free(mg->beginnings);
	free(mg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x2acd
leaq 0x8(%rbx), %r15
movq 0x20(%r14), %rax
movq 0x28(%r14), %r12
testq %rax, %rax
je 0x295d
movq (%r15), %rcx
jmp 0x296b
cmpq $0x0, 0x28(%r14)
movq (%r15), %rcx
je 0x2aa9
movq 0x18(%rcx), %rdx
movq 0x18(%rdx), %rdi
movq 0x20(%rdx), %rsi
subq %rsi, %rdi
cmpq %rdi, %r14
jne 0x2987
leaq (%rax,%rsi), %rdi
movq %rdi, 0x18(%rdx)
testq %rax, %rax
movq 0x28(%r14), %rdx
leaq 0x10(%rax,%rsi), %rsi
cmoveq %r15, %rsi
cmoveq %rdx, %rcx
movq %rdx, (%rsi)
movq 0x18(%rcx), %rcx
testq %rdx, %rdx
je 0x29b0
movq 0x20(%rcx), %rsi
movq %rax, 0x8(%rdx,%rsi)
movl 0x8(%rcx), %eax
decl %eax
andl 0x4c(%r14), %eax
movq (%rcx), %rdx
shlq $0x4, %rax
decl 0x8(%rdx,%rax)
leaq 0x18(%r14), %rsi
cmpq %rsi, (%rdx,%rax)
jne 0x29d8
addq %rax, %rdx
movq 0x38(%r14), %rax
movq %rax, (%rdx)
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
testq %rax, %rax
je 0x29e9
movq %rdx, 0x20(%rax)
testq %rdx, %rdx
je 0x29f2
movq %rax, 0x18(%rdx)
decl 0x10(%rcx)
movq (%r14), %rdi
callq 0x1030
movq 0x10(%r14), %rax
cmpl $0x0, 0x4(%rax)
je 0x2a40
cmpq $0x0, 0x20(%rax)
je 0x2a33
cmpl $0x0, (%rax)
je 0x2a33
xorl %r13d, %r13d
movq 0x8(%rax), %rdi
imulq %r13, %rdi
addq 0x28(%rax), %rdi
callq *0x20(%rax)
incq %r13
movq 0x10(%r14), %rax
movl (%rax), %ecx
cmpq %rcx, %r13
jb 0x2a16
movq 0x28(%rax), %rdi
callq 0x1030
movq 0x10(%r14), %rax
movq %rax, %rdi
callq 0x1030
movq 0x8(%r14), %rax
cmpl $0x0, 0x4(%rax)
je 0x2a8b
cmpq $0x0, 0x20(%rax)
je 0x2a7e
cmpl $0x0, (%rax)
je 0x2a7e
xorl %r13d, %r13d
movq 0x8(%rax), %rdi
imulq %r13, %rdi
addq 0x28(%rax), %rdi
callq *0x20(%rax)
incq %r13
movq 0x8(%r14), %rax
movl (%rax), %ecx
cmpq %rcx, %r13
jb 0x2a61
movq 0x28(%rax), %rdi
callq 0x1030
movq 0x8(%r14), %rax
movq %rax, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r12, %r14
testq %r12, %r12
jne 0x294b
jmp 0x2acd
movq 0x18(%rcx), %rax
movq (%rax), %rdi
callq 0x1030
movq (%r15), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq $0x0, (%r15)
jmp 0x29f5
movq 0x10(%rbx), %rax
cmpl $0x0, 0x4(%rax)
je 0x2b10
cmpq $0x0, 0x20(%rax)
je 0x2b03
cmpl $0x0, (%rax)
je 0x2b03
xorl %r14d, %r14d
movq 0x8(%rax), %rdi
imulq %r14, %rdi
addq 0x28(%rax), %rdi
callq *0x20(%rax)
incq %r14
movq 0x10(%rbx), %rax
movl (%rax), %ecx
cmpq %rcx, %r14
jb 0x2ae6
movq 0x28(%rax), %rdi
callq 0x1030
movq 0x10(%rbx), %rax
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/cgaebel[P]pipe/pipe.c
// Function: pipe_consumer_free
void pipe_consumer_free(pipe_consumer_t* handle)
{
    pipe_t* p = PIPIFY(handle);
    size_t new_consumer_refcount;

    mutex_lock(&p->end_lock);
        new_consumer_refcount = --p->consumer_refcount;
    mutex_unlock(&p->end_lock);

    if(unlikely(new_consumer_refcount == 0))
    {
        size_t producer_refcount;

        mutex_lock(&p->begin_lock);
            producer_refcount = p->producer_refcount;
        mutex_unlock(&p->begin_lock);

        // If there are still producers, wake them up if they're waiting on
        // room to free up from a consumer. Otherwise, since we're the last
        // handle altogether, we can free the pipe.
        if(likely(producer_refcount > 0))
            cond_broadcast(&p->just_popped);
        else
            deallocate(p);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x70(%rdi), %r14
movq %r14, %rdi
callq 0x1150
decq 0x40(%rbx)
setne %r15b
movq %r14, %rdi
callq 0x10f0
testb %r15b, %r15b
je 0x1a2a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x12b9
jmp 0x1a1f
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_try_accept
static int xpsocket_try_accept(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   XPSocket *ps = xpsocket_new(L);

   ps->s = accept(me->s, NULL, NULL);
   if (ps->s == -1) {
      return pushError(L, isRetry(errno) ? "retry" : NULL);
   }

   // Linux: accepted socket does not inherit file status (the nerve!)
   if (setNonBlocking(ps->s, 1) == -1) {
      (void) close(ps->s);
      ps->s = -1;
      return pushError(L, NULL);
   }

   return 1;  // success => return new socket
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1bfd5(%rip), %rdx     # 0x1f950
leaq 0x136c3(%rip), %rcx     # 0x17045
movl $0x1, %ebp
movl $0x1, %esi
callq 0x4834
movq %rax, %r15
leaq 0x136a9(%rip), %rdx     # 0x17044
movl $0x4, %esi
movq %rbx, %rdi
callq 0x43d1
movq %rax, %r14
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl (%r15), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3380
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0x39eb
movl %eax, %edi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x442e
cmpl $-0x1, %eax
jne 0x3a25
movl (%r14), %edi
callq 0x31c0
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
xorl %esi, %esi
jmp 0x3a18
callq 0x3060
movl (%rax), %eax
leaq 0x137fa(%rip), %rsi     # 0x171f3
cmpl $0x4, %eax
je 0x3a18
cmpl $0xb, %eax
je 0x3a18
cmpl $0x73, %eax
je 0x3a18
xorl %esi, %esi
cmpl $0x72, %eax
leaq 0x137df(%rip), %rax     # 0x171f3
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x437c
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: addrFromString
static int addrFromString(struct sockaddr_in *psin, const char *psz)
{
   unsigned nums[4] = {0};
   unsigned port = 0;
   size_t i;

   for (i=0; ; ++i) {
      if (!*psz) {
         break;
      }
      if (*psz == ':') {
         psz = scanNum(psz+1, &port);
         break;
      }
      if (i >= ARRAY_LENGTH(nums)) {
         return -1;
      }
      psz = scanNum(psz, &nums[i]);
      if (*psz == '.') {
         ++psz;
      }
   }

   // TODO: syntax validation
   // TODO: range validation

   // POSIX fail: I can find no specifications or docs (POSIX, Linux,
   // MacOS) that indicate to zero the unused fields, but trial and error
   // indicates that it is necessary (at least on MacOS).
   ZERO_REC(*psin);

   if (i > 1) nums[0] *= 0x1000000;
   if (i > 2) nums[1] *= 0x10000;
   if (i > 3) nums[2] *= 0x100;

   // POSIX fail: Port and addr are typed as numbers *yet* stored in network
   // byte order, requiring htons/htonl (still...).
   psin->sin_family = AF_INET;
   psin->sin_addr.s_addr = htonl(nums[0] + nums[1] + nums[2] + nums[3]);
   psin->sin_port = htons(port);
   return 0;
}

// Assembly:
xorps %xmm0, %xmm0
movaps %xmm0, -0x18(%rsp)
xorl %eax, %eax
movzbl (%rsi), %ecx
testl %ecx, %ecx
je 0x3d93
cmpl $0x3a, %ecx
je 0x3d6b
cmpq $0x4, %rax
je 0x3de1
movsbl %cl, %edx
addl $-0x30, %edx
xorl %ecx, %ecx
cmpl $0x9, %edx
ja 0x3d57
xorl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
leal (%rdx,%rcx,2), %ecx
movsbl 0x1(%rsi), %edx
incq %rsi
addl $-0x30, %edx
cmpl $0xa, %edx
jb 0x3d42
movl %ecx, -0x18(%rsp,%rax,4)
xorl %ecx, %ecx
cmpb $0x2e, (%rsi)
sete %cl
addq %rcx, %rsi
incq %rax
jmp 0x3d1d
movsbl 0x1(%rsi), %edx
addl $-0x30, %edx
xorl %ecx, %ecx
cmpl $0x9, %edx
ja 0x3d95
addq $0x2, %rsi
leal (%rcx,%rcx,4), %ecx
leal (%rdx,%rcx,2), %ecx
movsbl (%rsi), %edx
addl $-0x30, %edx
incq %rsi
cmpl $0xa, %edx
jb 0x3d7d
jmp 0x3d95
xorl %ecx, %ecx
movq $0x0, 0x8(%rdi)
movl -0x18(%rsp), %edx
cmpq $0x2, %rax
jb 0x3dc0
shll $0x18, %edx
cmpq $0x2, %rax
je 0x3dc0
shll $0x10, -0x14(%rsp)
cmpq $0x4, %rax
jb 0x3dc0
shll $0x8, -0x10(%rsp)
movw $0x2, (%rdi)
addl -0x14(%rsp), %edx
addl -0x10(%rsp), %edx
addl -0xc(%rsp), %edx
bswapl %edx
movl %edx, 0x4(%rdi)
rolw $0x8, %cx
movw %cx, 0x2(%rdi)
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio_socket
static int xpio_socket(lua_State *L)
{
   XPSocket *me = xpsocket_new(L);
   const char *typeName = luaL_checkstring(L, 1);
   int type;

   if (0 == strcmp(typeName, "TCP")) {
      type = SOCK_STREAM;
   } else if (0 == strcmp(typeName, "UDP")) {
      type = SOCK_DGRAM;
   } else {
      lua_pushnil(L);
      lua_pushstring(L, "xpio: unsupported socket type");
      return 2;
   }

   me->s = socket(AF_INET, type, 0);
   if (me->s == -1) {
      return pushError(L, NULL);
   }

   // Note: *me and me->s will be cleaned up when userdata is collected

   if (setNonBlocking(me->s, 1) == -1) {
      return pushError(L, NULL);
   }

   return 1;   // success => return userdata
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x1324b(%rip), %rdx     # 0x17044
movl $0x4, %esi
callq 0x43d1
movq %rax, %r14
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7c9c
movq %rax, %r12
leaq 0x132b1(%rip), %rsi     # 0x170dc
movq %rax, %rdi
callq 0x3230
testl %eax, %eax
je 0x3e69
leaq 0x132a2(%rip), %rsi     # 0x170e0
movq %r12, %rdi
callq 0x3230
testl %eax, %eax
je 0x3e63
movq %rbx, %rdi
callq 0x6478
leaq 0x1328b(%rip), %rsi     # 0x170e4
movq %rbx, %rdi
callq 0x6526
jmp 0x3ea7
movl $0x2, %r15d
movl $0x2, %ebp
movl $0x2, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3450
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0x3eae
movl %eax, %edi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x442e
movl $0x1, %ebp
cmpl $-0x1, %eax
jne 0x3eb8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %ebp
jmp 0x3eb8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio_tqueue
static int xpio_tqueue(lua_State *L)
{
   XPQueue *me = XPIO_NEWOBJECT(L, XPQueue);

   me->pfds = 0;
   me->nfds = 0;

   lua_createtable(L, 2, 0);             // uservalue
   lua_newtable(L);
   lua_rawseti(L, -2, XPQUEUE_READ);     // uservalue[1] = readers
   lua_newtable(L);
   lua_rawseti(L, -2, XPQUEUE_WRITE);    // uservalue[2] = writers
   lua_newtable(L);
   lua_rawseti(L, -2, XPQUEUE_CHILD);    // uservalue[2] = childWaiters
   lua_setuservalue(L, -2);

   return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x13162(%rip), %rdx     # 0x17030
movl $0x10, %esi
callq 0x43d1
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x68d0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x68d0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x6b2f
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x68d0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x2, %edx
callq 0x6b2f
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x68d0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x3, %edx
callq 0x6b2f
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6cb5
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio_fdopen
static int xpio_fdopen(lua_State *L)
{
   XPSocket *ps = xpsocket_new(L);

   // dup() creates a descriptor for the xpsocket to own (and close on
   // finalization). This avoids one xpsocket unpredictably closing a
   // descriptor used by another xpsocket.
   ps->s = dup((int) checkUInt(L, 1));
   if (ps->s == -1) {
      return pushError(L, NULL);
   }
   return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1306a(%rip), %rdx     # 0x17044
movl $0x4, %esi
callq 0x43d1
movq %rax, %r14
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4538
movl %eax, %edi
callq 0x3180
movl %eax, (%r14)
cmpl $-0x1, %eax
jne 0x401d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio__nextfd
static int xpio__nextfd(lua_State *L)
{
   struct rlimit rl;
   int fd = 0;
   int flags;
   int fdMax = -1;

   fd = tointegerDefault(L, 2, -1) + 1;

   if (fdMax < 0) {
      if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
         return luaL_error(L, "xpio: getrlimit failed");
      }
      // rlim_max is negative in OSX => use rlim_cur ?
      fdMax = rl.rlim_max - 1;
      if (fdMax < 0) {
         fdMax = rl.rlim_cur - 1;
      }
   }

   for (; fd <= fdMax; ++fd) {
      flags = fcntl(fd, F_GETFD);
      if (flags >= 0 && (flags & FD_CLOEXEC) == 0) {
         lua_pushinteger(L, fd);
         return 1;
      }
   }

   lua_pushnil(L);
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movl $0x2, %esi
movq %r15, %rdx
callq 0x6237
movq %rax, %r14
movl (%r15), %ebp
leaq 0x8(%rsp), %rsi
movl $0x7, %edi
callq 0x33f0
testl %eax, %eax
js 0x4351
cmpl $0x1, %ebp
movl $0x0, %ebp
sbbl %ebp, %ebp
orl %r14d, %ebp
movl 0x8(%rsp), %r14d
movl 0x10(%rsp), %eax
decl %eax
decl %r14d
testl %eax, %eax
cmovnsl %eax, %r14d
cmpl %ebp, %r14d
cmovlel %ebp, %r14d
cmpl %ebp, %r14d
je 0x4364
incl %ebp
movl %ebp, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x30e0
testl $0x80000001, %eax       # imm = 0x80000001
jne 0x4328
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0x64a1
jmp 0x436c
leaq 0x12e30(%rip), %rsi     # 0x17188
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7750
jmp 0x4371
movq %rbx, %rdi
callq 0x6478
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio_newObject
static void *xpio_newObject(lua_State *L, size_t size, const char *mtName)
{
   void *pv;

   lua_getfield(L, lua_upvalueindex(1), mtName);
   pv = xlua_newObject(L, -1, size);
   lua_remove(L, -2);

   return pv;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0xfff0b9d7, %esi       # imm = 0xFFF0B9D7
callq 0x67cf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5c5f
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x716f
movq %rax, %r14
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5f7e
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6c07
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5df9
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: fcntl_mod_FL
static int fcntl_mod_FL(int fd, int flagsAdd, int flagsRemove)
{
   int flags = fcntl(fd, F_GETFL);
   if (flags != -1) {
      flags = fcntl(fd, F_SETFL, (flags & ~flagsRemove) | flagsAdd);
   }
   return flags;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movl %edi, %ebx
movl $0x3, %esi
xorl %eax, %eax
callq 0x30e0
cmpl $-0x1, %eax
je 0x4466
notl %r14d
andl %r14d, %eax
orl %ebp, %eax
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x30e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpio_pair
static int xpio_pair(lua_State *L, int nPairType)
{
   XPSocket *psA = xpsocket_new(L);
   XPSocket *psB = xpsocket_new(L);
   int spOut[2];
   int n, err;

   if (nPairType == PAIR_PIPE) {
      err = pipe(spOut);
   } else {
      err = socketpair(AF_UNIX, SOCK_STREAM, 0, spOut);
   }

   if (err) {
      return pushError(L, NULL);
   }

   psA->s = spOut[0];
   psB->s = spOut[1];

   for (n = 0; n <= 1; ++n) {
      if (setNonBlocking(spOut[n], 1) == -1) {
         return pushError(L, NULL);
      }
   }

   return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x12bbc(%rip), %r15     # 0x17044
movl $0x4, %esi
movq %r15, %rdx
callq 0x43d1
movq %rax, %r14
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, (%rax)
movl $0x4, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x43d1
movq %rax, %r15
movl %r12d, (%rax)
cmpl $0x1, %ebp
jne 0x44c8
leaq 0x8(%rsp), %rdi
callq 0x31d0
jmp 0x44de
leaq 0x8(%rsp), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3290
testl %eax, %eax
je 0x44f9
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc(%rsp), %r12
movl -0x4(%r12), %eax
movl %eax, (%r14)
movl (%r12), %eax
movl %eax, (%r15)
leaq 0x8(%rsp), %rax
movb $0x1, %bpl
movl (%rax), %edi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x442e
cmpl $-0x1, %eax
je 0x44e2
movq %r12, %rax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x4515
jmp 0x44ec
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: checkUInt
static unsigned checkUInt(lua_State *L, int ndx)
{
   lua_Number num = luaL_checknumber(L, ndx);
   if (! (num >= 0)) {
      return luaL_error(L, "xpio: invalid argument #%d", ndx);
   }
   if (num > UINT_MAX) {
      return UINT_MAX;
   }
   return (unsigned) num;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x7d93
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0x456a
leaq 0x12bab(%rip), %rsi     # 0x17102
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7750
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
ucomisd 0x12a99(%rip), %xmm0    # 0x17010
ja 0x457e
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: readStringArray
static char **readStringArray(lua_State *L, int ndxArray)
{
   int numStrings = lengthOf(L, ndxArray);
   char **ptrs = (char**) calloc(numStrings + 1, sizeof(char*));
   if (!ptrs) {
      return NULL;
   }

   int offset = 0;
   for (offset = 0; offset < numStrings; ++offset) {
      lua_rawgeti(L, ndxArray, offset+1);
      size_t len;
      const char *pc = lua_tolstring(L, -1, &len);
      ptrs[offset] = pc ? strdup(pc) : NULL;
      lua_pop(L, 1);
      if (! ptrs[offset]) {
         break;
      }
   }

   return ptrs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4670
movl %eax, %r14d
leal 0x1(%r14), %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x3220
movq %rax, %r15
testq %rax, %rax
je 0x4625
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
cmpq %r12, %r14
je 0x4625
leal 0x1(%r12), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6855
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rsp, %rdx
callq 0x62f6
testq %rax, %rax
je 0x4610
movq %rax, %rdi
callq 0x3400
movq %rax, %r13
movq %rax, (%r15,%r12,8)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5c94
incq %r12
testq %r13, %r13
jne 0x45c1
jmp 0x4625
movq $0x0, (%r15,%r12,8)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5c94
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: handleSIGCHLD
static void handleSIGCHLD(int sig)
{
   int n;
   int oldErrno = errno;
   //printf("SIGCHLD!\n");
   do {
      n = write(sigchldPipe[1], "\1", 1);
   } while (n == -1 && errno == EINTR);
   errno = oldErrno;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x3060
movq %rax, %rbx
movl (%rax), %ebp
leaq 0x12b3a(%rip), %r14     # 0x17186
movl 0x1bbf2(%rip), %edi     # 0x20244
movl $0x1, %edx
movq %r14, %rsi
callq 0x30f0
cmpl $-0x1, %eax
jne 0x4669
cmpl $0x4, (%rbx)
je 0x464c
movl %ebp, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: lengthOf
static int lengthOf(lua_State *L, int ndx)
{
   int len;
   lua_len(L, ndx);
   len = lua_tointeger(L, -1);
   lua_pop(L, 1);
   return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x712c
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x6237
movq %rax, %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5c94
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpproc_dtor
static int xpproc_dtor(lua_State *L)
{
   XPProc *me = XLUA_CAST(L, 1, XPProc);

   // dequeue from global list
   SLL_DEQUEUE(me, gpHeadProc, XPProc, next);

   if (me->pid) {
      (void) kill(me->pid, SIGKILL);
      me->pid = 0;
   }
   return 0;
}

// Assembly:
pushq %rbx
leaq 0x1b212(%rip), %rdx     # 0x1f8c0
leaq 0x12974(%rip), %rcx     # 0x17029
movl $0x1, %esi
callq 0x4834
movq %rax, %rbx
leaq 0x1bb87(%rip), %rax     # 0x20250
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
je 0x46df
cmpq %rbx, %rax
jne 0x46c9
movq (%rbx), %rax
movq %rax, (%rcx)
movl 0x8(%rbx), %edi
testl %edi, %edi
je 0x46f7
movl $0x9, %esi
callq 0x32a0
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpproc_kill
static int xpproc_kill(lua_State *L)
{
   XPProc *me = XLUA_CAST(L, 1, XPProc);

   if (me->pid <= 0) {
      return pushError(L, "process not running");
   }

   if (kill(me->pid, SIGKILL) == -1) {
      return pushError(L, NULL);
   }

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1b1b8(%rip), %rdx     # 0x1f8c0
leaq 0x1291a(%rip), %rcx     # 0x17029
movl $0x1, %esi
callq 0x4834
movl 0x8(%rax), %edi
testl %edi, %edi
jle 0x4743
movl $0x9, %esi
callq 0x32a0
cmpl $-0x1, %eax
je 0x474f
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x66f1
jmp 0x475e
leaq 0x12a95(%rip), %rsi     # 0x171df
movq %rbx, %rdi
jmp 0x4754
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpproc_try_wait
static int xpproc_try_wait(lua_State *L)
{
   XPProc *me = XLUA_CAST(L, 1, XPProc);

   if (me->pid > 0) {
      lua_pushnil(L);
      lua_pushstring(L, "retry");
      //printf("... try_wait(%d) --> retry\n", me->pid);
      return 2;
   }

   //printf("... try_wait() --> %x\n", me->status);
   if (WIFEXITED(me->status)) {
      lua_pushstring(L, "exit");
      lua_pushinteger(L, WEXITSTATUS(me->status));
      return 2;
   } else if (WIFSIGNALED(me->status)) {
      lua_pushstring(L, "signal");
      lua_pushinteger(L, WSTOPSIG(me->status));
      return 2;
   } else {
      // exit status not ready
      return pushError(L, "retry");
   }

   // should not happen
   return pushError(L, "xpio: unexpected waitpid() result");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1b14b(%rip), %rdx     # 0x1f8c0
leaq 0x128ad(%rip), %rcx     # 0x17029
movl $0x1, %esi
callq 0x4834
cmpl $0x0, 0x8(%rax)
jle 0x47a5
movq %rbx, %rdi
callq 0x6478
leaq 0x12a58(%rip), %rsi     # 0x171f3
movq %rbx, %rdi
callq 0x6526
jmp 0x47f5
movq %rax, %r14
movl 0xc(%rax), %eax
andl $0x7f, %eax
je 0x47c8
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x47e6
leaq 0x12a38(%rip), %rsi     # 0x171fe
jmp 0x47cf
leaq 0x12a2a(%rip), %rsi     # 0x171f9
movq %rbx, %rdi
callq 0x6526
movzbl 0xd(%r14), %esi
movq %rbx, %rdi
callq 0x64a1
jmp 0x47f5
leaq 0x12a06(%rip), %rsi     # 0x171f3
movq %rbx, %rdi
callq 0x437c
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xlua.h
// Function: xlua_checkudata
static inline void*
xlua_checkudata(lua_State *L,
              int narg,
              const luaL_Reg *regs,
              const char *typeName)
{
   // if REGISTRY[getmetatable(udata)] == regs then
   //    return touserdata(udata)
   // else
   //    error(...)
   // end

   void *me = lua_touserdata(L, narg);

   if (me != NULL && lua_getmetatable(L, narg)) {
      lua_rawget(L, LUA_REGISTRYINDEX);
      void *tptr = lua_touserdata(L, -1);
      lua_pop(L, 1);
      if ((const void *)tptr == (const void*) regs) {
         return me;
      }
   }

   const char *msg = lua_pushfstring(L, "%s object expected, got %s",
                                     typeName, luaL_typename(L, narg));
   (void) luaL_argerror(L, narg, msg);
   return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, %r14
callq 0x63c9
testq %rax, %rax
je 0x4894
movq %rax, %r12
movq %r14, %rdi
movl %ebx, %esi
callq 0x692f
testl %eax, %eax
je 0x4894
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x6829
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x63c9
movq %rax, %rbp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5c94
cmpq %r13, %rbp
je 0x48cf
movq %r14, %rdi
movl %ebx, %esi
callq 0x5f9e
movq %r14, %rdi
movl %eax, %esi
callq 0x5fbf
leaq 0x12915(%rip), %rsi     # 0x171c4
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x65c0
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
callq 0x766a
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpqueue_enqueue
static int xpqueue_enqueue(lua_State *L, int ndxTask, int ndxKey, int mode)
{
   ndxTask = lua_absindex(L, ndxTask);
   ndxKey = lua_absindex(L, ndxKey);

   // assert(not task._dequeue)
   lua_getfield(L, ndxTask, "_dequeue");
   if (!lua_isnil(L, -1)) {
      luaL_error(L, "xpio: task scheduled twice");
   }

   // readers/writers/childWaiters[key] = task

   xpqueue_tableFromTask(L, ndxTask, mode);
   lua_pushvalue(L, ndxKey);   // key
   lua_pushvalue(L, ndxTask);  // value
   lua_rawset(L, -3);

   // task.dequeue = xpqueue_dequeue[R/W/C]

   lua_pushcfunction(L, (mode == XPQUEUE_READ ? xpqueue_dequeueR :
                         mode == XPQUEUE_WRITE ? xpqueue_dequeueW :
                         xpqueue_dequeueC));
   lua_setfield(L, ndxTask, "_dequeue");

   // task._dequeuedata = key

   lua_pushvalue(L, ndxKey);
   lua_setfield(L, ndxTask, "_dequeuedata");

   // leave 4 items on the stack
   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
movl $0x2, %esi
callq 0x5c5f
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5c5f
movl %eax, %r14d
leaq 0x128f3(%rip), %rdx     # 0x17205
movq %rbx, %rdi
movl %ebp, %esi
callq 0x67cf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5f9e
testl %eax, %eax
je 0x493e
leaq 0x128da(%rip), %rsi     # 0x1720e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7750
movq %rbx, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x49d3
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5f7e
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5f7e
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x6ac0
cmpl $0x2, %r15d
leaq 0xbd(%rip), %rax        # 0x4a35
leaq 0xc5(%rip), %rcx        # 0x4a44
cmoveq %rax, %rcx
cmpl $0x1, %r15d
leaq 0x98(%rip), %rsi        # 0x4a26
cmovneq %rcx, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x666d
leaq 0x12862(%rip), %rdx     # 0x17205
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6a5a
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5f7e
leaq 0x1286a(%rip), %rdx     # 0x17229
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a5a
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpqueue_tableFromTask
static void xpqueue_tableFromTask(lua_State *L, int ndxTask, int mode)
{
   lua_getfield(L, ndxTask, "_queue");  // task.tqueue
   (void) XLUA_CAST(L, -1, XPQueue);    // validate queue
   lua_getuservalue(L, -1);
   lua_rawgeti(L, -1, mode);            // readers/writers
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
leaq 0x12853(%rip), %rdx     # 0x17236
callq 0x67cf
leaq 0x1af21(%rip), %rdx     # 0x1f910
leaq 0x1263b(%rip), %rcx     # 0x17031
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4834
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x6986
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6855
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpqueue_dequeue
static int xpqueue_dequeue(lua_State *L, int mode)
{
   xpqueue_tableFromTask(L, 1, mode);
   lua_getfield(L, 1, "_dequeuedata");  // key = fd
   lua_pushnil(L);                      // value = nil
   lua_rawset(L, -3);                   // readers/writers[fd] = nil

   lua_pushnil(L);
   lua_setfield(L, 1, "_dequeue");      // task.dequeue = nil
   return 0;
}

// Assembly:
pushq %rbx
movl %esi, %edx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x49d3
leaq 0x127bf(%rip), %rdx     # 0x17229
movq %rbx, %rdi
movl $0x1, %esi
callq 0x67cf
movq %rbx, %rdi
callq 0x6478
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x6ac0
movq %rbx, %rdi
callq 0x6478
leaq 0x1276a(%rip), %rdx     # 0x17205
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmp 0x6a5a
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpqueue_dtor
static int xpqueue_dtor(lua_State *L)
{
   XPQueue *me = XLUA_CAST(L, 1, XPQueue);
   if (me->pfds) {
      free(me->pfds);
      me->pfds = NULL;
      me->nfds = 0;
   }
   return 0;
}

// Assembly:
pushq %rbx
leaq 0x1ae5f(%rip), %rdx     # 0x1f910
leaq 0x12579(%rip), %rcx     # 0x17031
movl $0x1, %esi
callq 0x4834
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4ae0
movq %rax, %rbx
callq 0x3040
movq $0x0, (%rbx)
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpqueue_isEmpty
static int xpqueue_isEmpty(lua_State *L)
{
   int mode;
   int isEmpty = 1;

   lua_getuservalue(L, 1);

   for (mode = 1; mode <= 3; ++mode) {
      lua_rawgeti(L, -1, mode);
      lua_pushnil(L);
      if (lua_next(L, -2) != 0) {
         isEmpty = 0;
         break;
      }
      lua_pop(L, 1);
   }

   lua_pushboolean(L, isEmpty);
   return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
callq 0x6986
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %ebp, %edx
callq 0x6855
movq %rbx, %rdi
callq 0x6478
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x7095
testl %eax, %eax
jne 0x500c
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x5c94
incl %ebp
cmpl $0x4, %ebp
jne 0x4fc9
movl $0x1, %esi
jmp 0x500e
xorl %esi, %esi
movq %rbx, %rdi
callq 0x66f1
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_dtor
static int xpsocket_dtor(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);

   if (me->s) {
      close(me->s);
      me->s = -1;
   }
   return 0;
}

// Assembly:
pushq %rbx
leaq 0x1a6e5(%rip), %rdx     # 0x1f950
leaq 0x11dd3(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
movl (%rax), %edi
testl %edi, %edi
je 0x5290
movq %rax, %rbx
callq 0x31c0
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_try_connect
static int xpsocket_try_connect(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   const char *addr = luaL_checkstring(L, 2);
   struct sockaddr_in sin;
   int e;

   if (addrFromString(&sin, addr)) {
      return pushError(L, "xpio: mal-formed address");
   }
   e = connect(me->s, (struct sockaddr *)&sin, sizeof sin);

   // POSIX fail: Asynchronous connect oddness.  Instead of EAGAIN or
   // EWOULDBLOCK, we may get either EINPROGRESS or EALREADY to indicate
   // "try again later". Finally, success is indicated by another error code
   // EISCONN. Spec is unclear on whether an actual success result (return
   // value of 0) is possible, and on what the state of the sockaddr must be
   // on calls other than the first.

   if (e && errno != EISCONN) {
      return pushError(L, (isRetry(errno) ? "retry" : NULL));
   }

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x1a6a9(%rip), %rdx     # 0x1f950
leaq 0x11d97(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
movq %rax, %r15
movl $0x2, %ebx
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x7c9c
movq %rsp, %rdi
movq %rax, %rsi
callq 0x3d13
testl %eax, %eax
je 0x52f9
leaq 0x12013(%rip), %rsi     # 0x172f8
movq %r14, %rdi
callq 0x437c
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl (%r15), %edi
movq %rsp, %rsi
movl $0x10, %edx
callq 0x33d0
testl %eax, %eax
je 0x5348
callq 0x3060
movl (%rax), %eax
leaq 0x11ed8(%rip), %rsi     # 0x171f3
cmpl $0x69, %eax
jg 0x532c
cmpl $0x4, %eax
je 0x52e5
cmpl $0xb, %eax
je 0x52e5
jmp 0x5336
cmpl $0x6a, %eax
je 0x5348
cmpl $0x73, %eax
je 0x52e5
xorl %esi, %esi
cmpl $0x72, %eax
leaq 0x11eb1(%rip), %rax     # 0x171f3
cmoveq %rax, %rsi
jmp 0x52e5
movl $0x1, %ebx
movq %r14, %rdi
movl $0x1, %esi
callq 0x66f1
jmp 0x52ed
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_try_read
static int xpsocket_try_read(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   size_t size = checkUInt(L, 2);
   luaL_Buffer b;
   int n;

   if (size == 0) {
      // POSIX fail: reading zero bytes may or may not test for error
      //   conditions on the socket (depending on implementation).  Here we
      //   avoid potential portability issues.
      lua_pushinteger(L, 0);
      return 1;
   }

   char *pbuf = luaL_buffinitsize(L, &b, size);

   n = read(me->s, pbuf, size);
   if (n >= (size ? 1 : 0)) {
      // success
      luaL_pushresultsize(&b, n);
      return 1;
   } else if (n == 0) {
      // end of stream
      lua_pushnil(L);
      return 1;
   } if (isRetry(errno)) {
      // wait for more
      return pushError(L, "retry");
   } else {
      // actual error
      return pushError(L, NULL);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rdi, %rbx
leaq 0x1a5dd(%rip), %rdx     # 0x1f950
leaq 0x11ccb(%rip), %rcx     # 0x17045
movl $0x1, %ebp
movl $0x1, %esi
callq 0x4834
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x4538
testl %eax, %eax
je 0x53db
movl %eax, %r15d
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x80ff
movl (%r14), %edi
movq %rax, %rsi
movq %r15, %rdx
callq 0x31e0
testl %eax, %eax
jle 0x53e7
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x8057
movl $0x1, %ebp
jmp 0x5416
movq %rbx, %rdi
xorl %esi, %esi
callq 0x64a1
jmp 0x5416
je 0x5426
callq 0x3060
movl (%rax), %eax
leal -0x72(%rax), %ecx
cmpl $0x2, %ecx
jb 0x5402
cmpl $0xb, %eax
je 0x5402
cmpl $0x4, %eax
jne 0x5430
leaq 0x11dea(%rip), %rsi     # 0x171f3
movq %rbx, %rdi
callq 0x437c
movl $0x2, %ebp
movl %ebp, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x6478
jmp 0x53d4
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x540c
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_try_write
static int xpsocket_try_write(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   const char *data = luaL_checkstring(L, 2);
   int n;

   n = write(me->s, data, lua_rawlen(L, 2));
   if (n < 0) {
      return pushError(L, isRetry(errno) ? "retry" : NULL);
   }

   lua_pushinteger(L, n);
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1a508(%rip), %rdx     # 0x1f950
leaq 0x11bf6(%rip), %rcx     # 0x17045
movl $0x1, %ebp
movl $0x1, %esi
callq 0x4834
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x7c9c
movq %rax, %r15
movl (%r14), %r14d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x6369
movl %r14d, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x30f0
testl %eax, %eax
js 0x54a7
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rbx, %rdi
movq %rax, %rsi
callq 0x64a1
jmp 0x54e1
callq 0x3060
movl (%rax), %eax
leaq 0x11d3e(%rip), %rsi     # 0x171f3
cmpl $0x4, %eax
je 0x54d4
cmpl $0xb, %eax
je 0x54d4
cmpl $0x73, %eax
je 0x54d4
xorl %esi, %esi
cmpl $0x72, %eax
leaq 0x11d23(%rip), %rax     # 0x171f3
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x437c
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_bind
static int xpsocket_bind(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   const char *addr = luaL_checkstring(L, 2);
   struct sockaddr_in sin;

   if (addrFromString(&sin, addr)) {
      return pushError(L, "xpio: mal-formed address argument");
   }
   if (bind(me->s, (struct sockaddr *) &sin, sizeof(sin))) {
      return pushError(L, NULL);
   }

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x1a3d5(%rip), %rdx     # 0x1f950
leaq 0x11ac3(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
movq %rax, %r15
movl $0x2, %ebx
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x7c9c
movq %rsp, %rdi
movq %rax, %rsi
callq 0x3d13
testl %eax, %eax
je 0x55be
leaq 0x11d58(%rip), %rsi     # 0x17311
movq %r14, %rdi
jmp 0x55d7
movl (%r15), %edi
movq %rsp, %rsi
movl $0x10, %edx
callq 0x3350
testl %eax, %eax
je 0x55e8
movq %r14, %rdi
xorl %esi, %esi
callq 0x437c
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %ebx
movq %r14, %rdi
movl $0x1, %esi
callq 0x66f1
jmp 0x55dc
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_listen
static int xpsocket_listen(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);

   int nargs = lua_gettop(L);
   int backlog = 10;

   if (nargs > 1) {
      backlog = checkUInt(L, 2);
   }

   if (listen(me->s, backlog)) {
      return pushError(L, NULL);
   }

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1a346(%rip), %rdx     # 0x1f950
leaq 0x11a34(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
movq %rax, %r14
movq %rbx, %rdi
callq 0x5c80
movl $0xa, %esi
cmpl $0x2, %eax
jl 0x563f
movq %rbx, %rdi
movl $0x2, %esi
callq 0x4538
movl %eax, %esi
movl (%r14), %edi
callq 0x32e0
testl %eax, %eax
je 0x565c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %ebp
jmp 0x566e
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x66f1
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_getsockname
static int xpsocket_getsockname(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   struct sockaddr_in sin;
   socklen_t len = sizeof(sin);
   if (getsockname(me->s, (struct sockaddr*) &sin, &len))
      return pushError(L, NULL);
   return xpsocket_getXname(L, &sin);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x1a2cc(%rip), %rdx     # 0x1f950
leaq 0x119ba(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl (%rax), %edi
leaq 0x10(%rsp), %rsi
callq 0x3390
testl %eax, %eax
je 0x56c1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %eax
jmp 0x56ce
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5ae7
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bhk[P]tooltree/monoglot/./xpio_c.c
// Function: xpsocket_getpeername
static int xpsocket_getpeername(lua_State *L)
{
   XPSocket *me = XLUA_CAST(L, 1, XPSocket);
   struct sockaddr_in sin;
   socklen_t len = sizeof(sin);
   if (getpeername(me->s, (struct sockaddr *) &sin, &len))
      return pushError(L, NULL);
   return xpsocket_getXname(L, &sin);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x1a26d(%rip), %rdx     # 0x1f950
leaq 0x1195b(%rip), %rcx     # 0x17045
movl $0x1, %esi
callq 0x4834
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl (%rax), %edi
leaq 0x10(%rsp), %rsi
callq 0x3110
testl %eax, %eax
je 0x5720
movq %rbx, %rdi
xorl %esi, %esi
callq 0x437c
movl $0x2, %eax
jmp 0x572d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5ae7
addq $0x20, %rsp
popq %rbx
retq