LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/lodepng.c
// Function: zlib_decompress
static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size,
                                const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) {
  unsigned error;
  if(settings->custom_zlib) {
    error = settings->custom_zlib(out, outsize, in, insize, settings);
    if(error) {
      /*the custom zlib is allowed to have its own error codes, however, we translate it to code 110*/
      error = 110;
      /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/
      if(settings->max_output_size && *outsize > settings->max_output_size) error = 109;
    }
  } else {
    ucvector v = ucvector_init(*out, *outsize);
    if(expected_size) {
      /*reserve the memory to avoid intermediate reallocations*/
      ucvector_resize(&v, *outsize + expected_size);
      v.size = *outsize;
    }
    error = lodepng_zlib_decompressv(&v, in, insize, settings);
    *out = v.data;
    *outsize = v.size;
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %r12
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%r9), %rax
testq %rax, %rax
je 0x11c74
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
callq *%rax
testl %eax, %eax
je 0x11ce2
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x11ce6
cmpq (%rbx), %rax
movl $0x6e, %eax
sbbl $0x0, %eax
jmp 0x11ceb
movq (%r15), %rdi
movq (%rbx), %rbp
movq %rdi, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
testq %rdx, %rdx
je 0x11cbe
addq %rbp, %rdx
movq %rdx, 0x8(%rsp)
cmpq %rdx, %rbp
jae 0x11cb6
shrq %rbp
addq %rdx, %rbp
movq %rbp, %rsi
callq 0x21d0
testq %rax, %rax
je 0x11cb6
movq %rbp, 0x10(%rsp)
movq %rax, (%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x8db4
movq (%rbp), %rcx
movq %rcx, (%r15)
movq 0x8(%rbp), %rcx
movq %rcx, (%rbx)
jmp 0x11ceb
xorl %eax, %eax
jmp 0x11ceb
movl $0x6e, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: loadpng
Image*
loadpng(u8 *data, u32 len)
{
	u32 w, h, error;
	u8 *pixels;
        LodePNGState state;
	Image *img;

        lodepng_state_init(&state);
	error = lodepng_decode(&pixels, &w, &h, &state, data, len);
	if(error) {
		printf("lodepng error %s\n", lodepng_error_text(error));
		return nil;
	}

	img = malloc(sizeof(Image));
	img->w = w;
	img->stride = w*4;
	img->h = h;
	img->pixels = pixels;
	return img;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movl %esi, %ebx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xe236
movl %ebx, %r9d
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xd0f1
testl %eax, %eax
je 0x13dbd
movl %eax, %edi
callq 0x109de
leaq 0x5561(%rip), %rdi      # 0x19310
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x20b0
jmp 0x13de5
movl $0x18, %edi
callq 0x2190
movq %rax, %rbx
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
shll $0x2, %eax
movl %eax, 0x8(%rbx)
movl (%rsp), %eax
movl %eax, 0x4(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rbx)
movq %rbx, %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: loadfile
u8*
loadfile(const char *path, u32 *plen)
{
	FILE *f;
	u8 *data;
	u32 len;

	f = fopen(path, "rb");
	if(f == nil)
		return nil;
	fseek(f, 0, SEEK_END);
	len = ftell(f);
	fseek(f, 0, SEEK_SET);
	data = malloc(len);
	fread(data, 1, len, f);
	fclose(f);

	*plen = len;
	return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
leaq 0x1291(%rip), %rsi      # 0x15099
callq 0x2240
testq %rax, %rax
je 0x13e69
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21c0
movq %r14, %rdi
callq 0x2140
movq %rax, %r12
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21c0
movl %r12d, %r13d
movq %r13, %rdi
callq 0x2190
movq %rax, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x2060
movq %r14, %rdi
callq 0x20a0
movl %r12d, (%rbx)
jmp 0x13e6c
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: writeimg
void
writeimg(const char *path, Image *img)
{
	FILE *f;
	u8 *raw;
	size_t len;
	u32 error;
        LodePNGState state;

        lodepng_state_init(&state);
	error = lodepng_encode(&raw, &len, img->pixels, img->w, img->h, &state);
	if(error) {
		printf("can't encode png\n");
		return;
	}

	f = fopen(path, "wb");
	if(f == nil) {
		printf("can't open output\n");
		return;
	}
	fwrite(raw, 1, len, f);
	fclose(f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xe236
movq 0x10(%r14), %rdx
movl (%r14), %ecx
movl 0x4(%r14), %r8d
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %r9
callq 0xe605
testl %eax, %eax
je 0x13ec5
leaq 0x54f6(%rip), %rdi      # 0x193b4
callq 0x2050
jmp 0x13efa
leaq 0x40a5(%rip), %rsi      # 0x17f71
movq %rbx, %rdi
callq 0x2240
testq %rax, %rax
je 0x13f07
movq %rax, %rbx
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x22b0
movq %rbx, %rdi
callq 0x20a0
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5494(%rip), %rdi      # 0x193a2
jmp 0x13ebe
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: smoothstep
float
smoothstep(float e0, float e1, float x)
{
	x = (x-e0)/(e1-e0);
	if(x < 0.0f) x = 0.0f;
	if(x > 1.0f) x = 1.0f;
	return x*x*(3.0f - 2.0f*x);
}

// Assembly:
subss %xmm0, %xmm2
subss %xmm0, %xmm1
divss %xmm1, %xmm2
xorps %xmm0, %xmm0
maxss %xmm2, %xmm0
movss 0x53a9(%rip), %xmm1     # 0x192f4
minss %xmm0, %xmm1
movaps %xmm1, %xmm2
mulss %xmm1, %xmm2
addss %xmm1, %xmm1
movss 0x5396(%rip), %xmm0     # 0x192f8
subss %xmm1, %xmm0
mulss %xmm2, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: downsample
void
downsample(Image *out, Image *in, int mag)
{
	u32 x, y;
	u8 *p;

	assert(out->w*4 == in->w);
	assert(out->h*4 == in->h);

	for(y = 0; y < out->h; y++)
		for(x = 0; x < out->w; x++) {
			p = &out->pixels[y*out->stride + x*4];

			int c = 0;
			for(int i = 0; i < mag; i++)
			for(int j = 0; j < mag; j++)
				c += in->pixels[(y*mag+i)*in->stride + (x*mag+j)*4];
			c /= (mag*mag);

			p[0] = c;
			p[1] = c;
			p[2] = c;
			p[3] = 255;
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
shll $0x2, %eax
cmpl (%rsi), %eax
jne 0x1425e
movl 0x4(%rdi), %eax
shll $0x2, %eax
cmpl 0x4(%rsi), %eax
jne 0x1427d
cmpl $0x0, 0x4(%rdi)
je 0x1424f
movl %edx, %ecx
movl %edx, %eax
imull %ecx, %eax
movl %eax, 0x14(%rsp)
movl %edx, %r11d
leal (,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
cmpl $0x0, (%rdi)
je 0x14240
xorl %ebp, %ebp
xorl %r14d, %r14d
movl $0x0, %eax
testl %ecx, %ecx
jle 0x1420d
movq 0x10(%rsi), %rdx
movl 0x8(%rsi), %r15d
movl 0xc(%rsp), %r8d
imull %r15d, %r8d
addl %ebp, %r8d
xorl %r13d, %r13d
xorl %eax, %eax
movq %r11, %r9
movl %r8d, %r12d
movl %r12d, %r10d
movzbl (%rdx,%r10), %r10d
addl %r10d, %eax
addl $0x4, %r12d
decq %r9
jne 0x141ee
incl %r13d
addl %r15d, %r8d
cmpl %ecx, %r13d
jne 0x141e8
movl 0x8(%rdi), %edx
imull %ebx, %edx
movq 0x10(%rdi), %r8
leal (%rdx,%r14,4), %r9d
cltd
idivl 0x14(%rsp)
movb %al, (%r8,%r9)
movb %al, 0x1(%r8,%r9)
movb %al, 0x2(%r8,%r9)
movb $-0x1, 0x3(%r8,%r9)
incl %r14d
addl 0x10(%rsp), %ebp
cmpl (%rdi), %r14d
jb 0x141c6
incl %ebx
addl %ecx, 0xc(%rsp)
cmpl 0x4(%rdi), %ebx
jb 0x141bc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50bd(%rip), %rdi      # 0x19322
leaq 0x50c8(%rip), %rsi      # 0x19334
leaq 0x50cc(%rip), %rcx      # 0x1933f
movl $0xa2, %edx
callq 0x20e0
leaq 0x50e2(%rip), %rdi      # 0x19366
leaq 0x50a9(%rip), %rsi      # 0x19334
leaq 0x50ad(%rip), %rcx      # 0x1933f
movl $0xa3, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: meatball
void meatball(int width, int height, unsigned char *paper, unsigned char *image, unsigned char *page)
{
	Image in, meatball, out;
	int mag = 4;

	in.w = width;
	in.h = height;
	in.stride = in.w;
	in.pixels = paper;

	meatball.w = mag*width;
	meatball.h = mag*height;
	meatball.stride = 4*meatball.w;
	meatball.pixels = image;

	out.w = width;
	out.h = height;
	out.stride = 4*in.w;
	out.pixels = page;

	metaballize(&in, &meatball, mag);
	downsample(&out, &meatball, mag);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0x30(%rsp), %rax
movl %edi, (%rax)
movl %esi, 0x4(%rax)
movl %edi, 0x8(%rax)
movq %rdx, 0x10(%rax)
leal (,%rdi,4), %edx
leaq 0x18(%rsp), %rbx
movl %edx, (%rbx)
leal (,%rsi,4), %r9d
movl %r9d, 0x4(%rbx)
movq %rsp, %r14
movl %edi, (%r14)
shll $0x4, %edi
movl %edi, 0x8(%rbx)
movq %rcx, 0x10(%rbx)
movl %esi, 0x4(%r14)
movl %edx, 0x8(%r14)
movq %r8, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x13f6b
movq %r14, %rdi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x14165
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/meatball.c
// Function: omain
int
omain(int argc, char *argv[])
{
	FILE *f;
	u8 *raw;
	u32 len;
	Image *img, *out;

	if(argc < 2) {
		fprintf(stderr, "usage: %s input.png [output.png]\n", argv[0]);
		return 1;
	}
	raw = loadfile(argv[1], &len);
	if(raw == nil) {
		printf("can't open input\n");
		return 1;
	}
	img = loadpng(raw, len);
	if(img == nil) {
		printf("can't read png\n");
		return 1;
	}
	free(raw);

	int mag = 4;

	out = malloc(sizeof(Image));
	out->w = img->w*mag;
	out->h = img->h*mag;
	out->stride = out->w*4;
	out->pixels = malloc(out->w*out->h*4);
	memset(out->pixels, 0, out->w*out->h*4);

	metaballize(img, out, mag);
//	writeimg("out.png", out);

	downsample(img, out, mag);
	if(argc > 2)
		writeimg(argv[2], img);
	else
		writeimg("out.png", img);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x14420
movl %edi, %ebp
movq 0x8(%rbx), %rdi
leaq 0x4(%rsp), %rsi
callq 0x13df5
testq %rax, %rax
je 0x143e5
movq %rax, %r15
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x13d64
testq %rax, %rax
je 0x143ee
movq %rax, %r14
movq %r15, %rdi
callq 0x2030
movl $0x18, %edi
callq 0x2190
movq %rax, %r12
movl (%r14), %r13d
leal (,%r13,4), %eax
movl %eax, (%r12)
movl 0x4(%r14), %eax
shll $0x2, %eax
movl %eax, 0x4(%r12)
shll $0x4, %r13d
movl %r13d, 0x8(%r12)
imull %eax, %r13d
movq %r13, %rdi
callq 0x2190
movq %rax, 0x10(%r12)
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x20f0
movq %r14, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x13f6b
movq %r14, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x14165
cmpl $0x2, %ebp
jne 0x14402
leaq 0x4fb7(%rip), %rdi      # 0x1939a
jmp 0x14406
leaq 0x4fe8(%rip), %rdi      # 0x193d4
jmp 0x143f5
leaq 0x4fd0(%rip), %rdi      # 0x193c5
callq 0x2050
movl $0x1, %r15d
jmp 0x1440e
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x13e79
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x254c
jmp 0x143fa
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/econsole.c
// Function: winch_handler
static void winch_handler(int sig)
{
	struct winsize winp;

	if(!ioctl( 0, TIOCGWINSZ, &winp))
	{
		conf.row = winp.ws_row;
		conf.col = winp.ws_col;
		console_winch(conf.s, conf.ifindex, conf.row, conf.col);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rdx
movl $0x5413, %esi           # imm = 0x5413
xorl %edi, %edi
xorl %eax, %eax
callq 0x45a840
testl %eax, %eax
jne 0x4023ee
movzwl 0x8(%rsp), %r15d
movl %r15d, 0xf0fbf(%rip)    # 0x4f3324
movzwl 0xa(%rsp), %r12d
movl %r12d, 0xf0fb6(%rip)    # 0x4f3328
movl 0xf0fb4(%rip), %ebp     # 0x4f332c
movl 0xf0fb1(%rip), %r14d    # 0x4f3330
movl $0x40, %edi
callq 0x40255c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x40279a
movb $0x6, (%rax)
movb 0xf0f75(%rip), %cl      # 0x4f3314
movb %cl, 0x1(%rax)
movb %r15b, 0x2(%rax)
movb %r12b, 0x3(%rax)
movq %rbx, %rdi
movl $0x4, %esi
callq 0x40279a
movl %ebp, %edi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x40246f
cmpl $-0x1, %eax
jne 0x4023e6
callq 0x405a20
movl (%rax), %edi
callq 0x42c130
leaq 0xbcd17(%rip), %rdi     # 0x4bf0f3
movq %rax, %rsi
xorl %eax, %eax
callq 0x40d6e0
movq %rbx, %rdi
callq 0x4025cd
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/econsole.c
// Function: console_hup
static int console_hup(int s, int ifindex)
{
	int rc;
	uint8_t *p;
	struct sk_buff *skb = alloc_skb(64);

	p = skb_put(skb, 0);
	*p++ = EGETTY_HUP;
	*p++ = conf.console;
	p = skb_put(skb, 2);
	
	rc = console_send(s, ifindex, skb);
	if(rc == -1) {
		printf("sendto failed: %s\n", strerror(errno));
		free_skb(skb);
		return -1;
	}
	free_skb(skb);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
movl $0x40, %edi
callq 0x40255c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x40279a
movb $0x2, (%rax)
movb 0xf0ef0(%rip), %cl      # 0x4f3314
movb %cl, 0x1(%rax)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x40279a
movl %r14d, %edi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x40246f
cmpl $-0x1, %eax
jne 0x402463
callq 0x405a20
movl (%rax), %edi
callq 0x42c130
leaq 0xbcc9a(%rip), %rdi     # 0x4bf0f3
movq %rax, %rsi
xorl %eax, %eax
callq 0x40d6e0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4025cd
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/econsole.c
// Function: console_send
static int console_send(int s, int ifindex, struct sk_buff *skb)
{
	struct sockaddr_ll dest;
	socklen_t destlen = sizeof(dest);
	int rc;

	memset(&dest, 0, sizeof(dest));

	dest.sll_family = AF_PACKET;
	dest.sll_halen = 6;
	dest.sll_protocol = htons(ETH_P_EGETTY);
	dest.sll_ifindex = ifindex;
	if(conf.ucast)
		memcpy(dest.sll_addr, conf.dest.sll_addr, 6);
	else
		memset(dest.sll_addr, 255, 6);
	
	rc = sendto(s, skb->data, skb->len, 0, (const struct sockaddr *)&dest, destlen);
	if(rc == -1) {
		return -1;
	}
	if(conf.debug) {
		int i;
		printf("sent %d bytes to ", skb->len);
		for(i=0;i<6;i++)
			printf("%02x%s", dest.sll_addr[i], i==5?"":":");
		printf("\n");
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
xorps %xmm0, %xmm0
leaq 0xc(%rsp), %rax
movaps %xmm0, -0xc(%rax)
movl $0x0, 0x4(%rax)
movl $0x11680011, -0xc(%rax) # imm = 0x11680011
movb $0x6, -0x1(%rax)
movl %esi, -0x8(%rax)
cmpl $0x0, 0xf0e7b(%rip)     # 0x4f3320
je 0x4024bc
movzwl 0xf0e96(%rip), %ecx     # 0x4f3344
movw %cx, 0x4(%rax)
movl 0xf0e88(%rip), %ecx     # 0x4f3340
movl %ecx, (%rax)
jmp 0x4024c8
movw $0xffff, 0x4(%rax)      # imm = 0xFFFF
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x38(%rbx), %rsi
movl (%rbx), %edx
movq %rsp, %r8
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x45c840
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %ecx
je 0x402550
cmpl $0x0, 0xf0e1e(%rip)     # 0x4f3310
movl $0x0, %eax
je 0x402550
movl (%rbx), %esi
leaq 0xbcc04(%rip), %rdi     # 0x4bf106
xorl %eax, %eax
callq 0x40d6e0
movq $-0x6, %r14
leaq 0xd8966(%rip), %r15     # 0x4dae7d
leaq 0xc2978(%rip), %r12     # 0x4c4e96
leaq 0xbcbb5(%rip), %rbx     # 0x4bf0da
movzbl 0x12(%rsp,%r14), %esi
incq %r14
movq %r12, %rdx
cmoveq %r15, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x40d6e0
testq %r14, %r14
jne 0x402525
movl $0xa, %edi
callq 0x41c4f0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/jelopt.c
// Function: jelopt_final
int jelopt_final(char **argv, int *err)
{
  int i, last=-1;
  
  for(i=1;argv[i];)
    {
      char *a = argv[i];
      if(*a == '-')
	{
	  if(*(a+1) == '-')
	    {
	      if(*(a+2) == 0)
		break;
	      if(err) *err |= ERR_JELOPT_UNKNOWN;
	    }
	  else
	    {
	      if(*(a+1) == 0)
		break;
	      if(err) *err |= ERR_JELOPT_UNKNOWN;
	    }
	}
      if(strcmp(argv[i], OPT_VALUE_USED))
	i++;
      else
	rem_opt(argv, i, i);
    }
  
  for(i = 0;argv[i]; i++)
    last = i;

  for(i=0;argv[i];i++)
    {
      char *a = argv[i];
      if(*a == '-' && *(a+1) == '-' && *(a+2) == 0)
	{
	  rem_opt(argv, i, i);
	  return last;
	}
    }
  return last+1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %ebp
leaq 0xbc9e7(%rip), %r15     # 0x4bf1d4
movslq %ebp, %rax
movq (%rbx,%rax,8), %rdi
testq %rdi, %rdi
je 0x402840
cmpb $0x2d, (%rdi)
jne 0x40281a
movzbl 0x1(%rdi), %eax
testl %eax, %eax
je 0x40283a
cmpl $0x2d, %eax
jne 0x402811
cmpb $0x0, 0x2(%rdi)
je 0x40283a
testq %r14, %r14
je 0x40281a
orb $0x8, (%r14)
movq %r15, %rsi
callq 0x4010b0
testl %eax, %eax
je 0x40282a
incl %ebp
jmp 0x402836
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x4028a2
movb $0x1, %al
jmp 0x40283c
xorl %eax, %eax
testb %al, %al
jne 0x4027ed
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movq %rbx, %rax
incl %ebp
cmpq $0x0, (%rax)
leaq 0x8(%rax), %rax
jne 0x402848
movq (%rbx), %rax
testq %rax, %rax
je 0x402893
xorl %r14d, %r14d
movb $0x1, %cl
cmpb $0x2d, (%rax)
jne 0x402882
cmpb $0x2d, 0x1(%rax)
jne 0x402882
cmpb $0x0, 0x2(%rax)
jne 0x402882
movq %rbx, %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x4028a2
xorl %ecx, %ecx
testb %cl, %cl
je 0x402895
movq 0x8(%rbx,%r14,8), %rax
incq %r14
testq %rax, %rax
jne 0x40285f
incl %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/jelopt.c
// Function: rem_opt
static int rem_opt(char **argv, int begin, int end)
{
  int i;
  int dist = end-begin+1;
  int last = -1;

  for(i = 0;argv[i]; i++)
    last = i;

  if(last < 0)
    return 0;
  
  for(i = begin;i <= last; i++)
    if((i+dist) > last)
      argv[i] = NULL;
    else
      argv[i] = argv[i+dist];
  
  return 0;
}

// Assembly:
xorl %eax, %eax
movq %rdi, %rcx
decl %eax
cmpq $0x0, (%rcx)
leaq 0x8(%rcx), %rcx
jne 0x4028a7
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
subl %eax, %r8d
sets %cl
cmpl %esi, %r8d
setl %r9b
orb %cl, %r9b
jne 0x4028ff
notl %eax
subl %esi, %edx
incl %edx
movslq %esi, %r9
movslq %edx, %rcx
movl %r8d, %edx
leaq (%rdi,%r9,8), %r8
addq %r9, %rcx
cmpq %rdx, %rcx
jle 0x4028eb
xorl %r9d, %r9d
jmp 0x4028ef
movq (%rdi,%rcx,8), %r9
movq %r9, (%r8)
addq $0x8, %r8
incq %rcx
incl %esi
cmpl %esi, %eax
jne 0x4028e1
retq
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/jelopt.c
// Function: rem_short_opt
static int rem_short_opt(char **argv, int opt_short, int begin, int end)
{
  int i;
  int dist = end-begin+1;
  int last = -1;

  for(i = 0;argv[i]; i++)
    last = i;

  if(last < 0)
    return 0;
  
  if(begin > last)
    return 0;

  if(strlen(argv[begin]) > 2)
    {
      char *s, *sn, *p;
      /* not a lonly opt */
      s = sn = strdup(argv[begin]);
      *s = 0;
      for(p=argv[begin];*p;p++)
	if(*p != opt_short)
	  *s++ = *p;
	else
	  opt_short = -1;
      *s = 0;
      strcpy(argv[begin], sn);
      free(sn);
      return 0;
    }

  for(i = begin;i <= last; i++)
    if((i+dist) > last)
      argv[i] = NULL;
    else
      argv[i] = argv[i+dist];
  
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
xorl %r12d, %r12d
movq %rdi, %rax
decl %r12d
cmpq $0x0, (%rax)
leaq 0x8(%rax), %rax
jne 0x402d4e
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
subl %r12d, %ebx
sets %al
cmpl %ebp, %ebx
setl %dl
orb %al, %dl
je 0x402d7e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
movslq %ebp, %r14
movq %rdi, 0x10(%rsp)
leaq (%rdi,%r14,8), %r13
movq (%r13), %r15
movq %r15, %rdi
callq 0x4010e0
cmpq $0x2, %rax
jbe 0x402e05
movq %r15, %rdi
callq 0x42c0f0
movq %rax, %r14
movb $0x0, (%rax)
movb (%r15), %cl
testb %cl, %cl
movl 0xc(%rsp), %esi
je 0x402de0
incq %r15
movq %r14, %rax
movsbl %cl, %edx
cmpl %edx, %esi
jne 0x402dd1
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x402dd6
movb %cl, (%rax)
incq %rax
movb (%r15), %cl
incq %r15
testb %cl, %cl
jne 0x402dc3
movb $0x0, (%rax)
movq (%r13), %rdi
movq %r14, %rsi
callq 0x401020
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x429dc0
cmpl %ebp, %ebx
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %eax
jl 0x402d6f
notl %r12d
subl %ebp, %eax
incl %eax
movslq %eax, %rcx
movl %ebx, %eax
addq %rcx, %r14
cmpq %rax, %r14
jle 0x402e2e
xorl %ecx, %ecx
jmp 0x402e32
movq (%rdx,%r14,8), %rcx
movq %rcx, (%r13)
addq $0x8, %r13
incq %r14
incl %ebp
cmpl %ebp, %r12d
jne 0x402e25
jmp 0x402d6f
// File: /workspace/github_c_makefile_star2_O1/jelaas[P]egetty/jelopt.c
// Function: jelopt_int
int jelopt_int(char **argv, int opt_short, char *opt_long,
	       int *value, int *err)
{
  char *cvalue;
  if(jelopt(argv, opt_short, opt_long, &cvalue, err))
    {
      *value = atoi(cvalue);
      free(cvalue);
      return 1;
    }
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %r9
movq %rcx, %r14
movl $0x1, %ebx
movq %rsp, %r8
movl $0x1, %ecx
callq 0x402900
testl %eax, %eax
je 0x402ec4
movq (%rsp), %r15
movq %r15, %rdi
callq 0x40ba00
movl %eax, (%r14)
movq %r15, %rdi
callq 0x429dc0
jmp 0x402ec6
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/main.c
// Function: worker
void worker(void *ptr){
	uvc_io *io=(uvc_io *)ptr;
	char buf[256];
	ssize_t cnt=0;
	while(1){
		cnt = uvc_read(io,buf,sizeof(buf));
		if(cnt <=0){
			break;
		}
		buf[cnt]='\0';
		if(buf[0]=='q'){break;}
		//printf("server read: %s\n",buf);

		cnt=uvc_write(io,buf,strlen(buf));
		if(cnt!=0){
			break;
		}
	}
	uvc_close(io);
	free(io);
	printf("connection exit\n");
	uvc_return();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movq %rsp, %r14
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1966
testq %rax, %rax
jle 0x32b2
movb $0x0, (%rsp,%rax)
cmpb $0x71, (%rsp)
je 0x32b2
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1b7d
testq %rax, %rax
je 0x3278
movq %rbx, %rdi
callq 0x1c46
movq %rbx, %rdi
callq 0x1030
leaq 0xf1d(%rip), %rdi       # 0x41e6
callq 0x1070
xorl %eax, %eax
callq 0x1516
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/main.c
// Function: http_hello
void http_hello(void *ptr){

	uvc_io *io=ptr;
	ssize_t cnt=0;
	char buf[256];
	 cnt = uvc_read(io,buf,sizeof(buf));
	 if(cnt <=0){
		 goto err;
	 }	
	 sprintf(buf,"HTTP/1.1 200 OK\r\nContent-Length: %d\r\nContent-Type: text/html; Charset=gb2312\r\n\r\n%s",strlen("hello wrold!"),"hello wrold!");
	 cnt=uvc_write(io,buf,strlen(buf));
	 if(cnt!=0){
        goto err;
     }
	
err:
	uvc_close(io);
    free(io);
    //printf("connection exit\n");
    uvc_return();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1966
testq %rax, %rax
jle 0x3335
leaq 0xdad(%rip), %rsi       # 0x40b3
leaq 0xdf9(%rip), %rcx       # 0x4106
movq %rsp, %r14
movl $0xc, %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1260
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1b7d
movq %rbx, %rdi
callq 0x1c46
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
callq 0x1516
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/main.c
// Function: download
void download(void *ptr){

	uvc_io *fs = malloc(sizeof(uvc_io));
	uvc_io_create(fs,UVC_IO_FS);
	uvc_io *io=ptr;
	ssize_t cnt=0;
	char buf[2048];
	 cnt = uvc_read(io,buf,sizeof(buf));
	 if(cnt <=0){
		 goto err;
	 }	
	 sprintf(buf,"HTTP/1.1 200 OK\r\nContent-Length: %d\r\nContent-Type: application/zip\r\n\r\n",2735243);
	cnt=uvc_write(io,buf,strlen(buf));
	if(cnt!=0){
        goto err;
    }
	if(uvc_fs_open(fs,"/opt/nfshost/master.zip",O_RDONLY) <0){
		printf("uvc_fs_open error\n");
		goto err;
	}
	while(1){
		cnt = uvc_fs_read(fs,buf,sizeof(buf));
		if(cnt>0){
			 //printf("uvc_fs_read ok\n");
			cnt=uvc_write(io,buf,cnt);
			if(cnt!=0){
				 printf("write file err\n");
				goto err;
			}
		}else{
			 printf("uvc_fs_read err:%d\n",cnt);
			break;
		}
		
	
	}
err:
	uvc_fs_close(fs);
	free(fs);
	uvc_close(io);
    free(io);
    printf("connection exit\n");
    uvc_return();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %rdi, %rbx
movl $0x38, %edi
callq 0x11f0
movq %rax, %r14
movq %rax, %rdi
movl $0x3, %esi
callq 0x18a2
movq %rsp, %rsi
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
callq 0x1966
testq %rax, %rax
jle 0x3434
leaq 0xd73(%rip), %rsi       # 0x4113
movq %rsp, %r15
movq %r15, %rdi
movl $0x29bc8b, %edx         # imm = 0x29BC8B
xorl %eax, %eax
callq 0x1260
movq %r15, %rdi
callq 0x10e0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1b7d
testq %rax, %rax
jne 0x3434
leaq 0xd86(%rip), %rsi       # 0x415a
movq %r14, %rdi
xorl %edx, %edx
callq 0x1e62
testl %eax, %eax
js 0x3415
movq %rsp, %r15
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f30
movslq %eax, %rdx
testl %edx, %edx
jle 0x3423
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b7d
testq %rax, %rax
je 0x33e5
leaq 0xdb2(%rip), %rdi       # 0x41c5
jmp 0x341c
leaq 0xdb8(%rip), %rdi       # 0x41d4
callq 0x1070
jmp 0x3434
leaq 0xd48(%rip), %rdi       # 0x4172
movq %rdx, %rsi
xorl %eax, %eax
callq 0x1120
movq %r14, %rdi
callq 0x204d
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1c46
movq %rbx, %rdi
callq 0x1030
leaq 0xd8b(%rip), %rdi       # 0x41e6
callq 0x1070
xorl %eax, %eax
callq 0x1516
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/whtc123[P]libuvc/main.c
// Function: server
void server(void *ptr)
{
	int ret=0;
	uvc_io io;
	uvc_io *io_client;
	uvc_io_create(&io,UVC_IO_TCP);
	ret = uvc_tcp_bind(&io,"0.0.0.0",8080);
	if(ret!=0){
		printf("error bind:%d\n",ret);
		exit(1);
	}
	printf("start listen\n");
	while(1){
		ret = uvc_listen(&io,100);
		if(ret!=0){
			printf("error listen:%d\n",ret);
			exit(1);
		}

		io_client = (uvc_io *)malloc(sizeof(uvc_io));
		uvc_io_create(io_client,UVC_IO_TCP);
		ret = uvc_accept(&io,io_client);
		if(ret !=0){
			printf("error accept:%d\n",ret);
			exit(1);
		}
		//printf("get a new connection\n");
		uvc_create("hello",10*1024,download,io_client);
	}
	uvc_close(&io);
	uvc_return();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18a2
leaq 0xcf3(%rip), %rsi       # 0x4186
movq %rbx, %rdi
movl $0x1f90, %edx           # imm = 0x1F90
callq 0x1936
testl %eax, %eax
jne 0x3529
leaq 0xd47(%rip), %rdi       # 0x41f6
callq 0x1070
movq %rsp, %rdi
movl $0x64, %esi
callq 0x1db2
testl %eax, %eax
jne 0x3520
movq %rsp, %rbx
leaq 0xcf0(%rip), %r14       # 0x41bf
leaq -0x17f(%rip), %r15      # 0x3357
movl $0x38, %edi
callq 0x11f0
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x18a2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e55
testl %eax, %eax
jne 0x3532
movq %r14, %rdi
movl $0x2800, %esi           # imm = 0x2800
movq %r15, %rdx
movq %r12, %rcx
callq 0x1675
movq %rbx, %rdi
movl $0x64, %esi
callq 0x1db2
testl %eax, %eax
je 0x34d6
leaq 0xc76(%rip), %rdi       # 0x419d
jmp 0x3539
leaq 0xc5e(%rip), %rdi       # 0x418e
jmp 0x3539
leaq 0xc75(%rip), %rdi       # 0x41ae
movl %eax, %esi
xorl %eax, %eax
callq 0x1120
movl $0x1, %edi
callq 0x1270
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch1/doscript.c
// Function: main
int main() {
  lua_State *L = luaL_newstate();
  luaL_openlibs(L);
  luaL_dofile(L, "script.lua");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x13f86
movq %rax, %rbx
movq %rax, %rdi
callq 0x14188
leaq 0x1b84b(%rip), %rsi     # 0x20004
movq %rbx, %rdi
xorl %edx, %edx
callq 0x136f9
testl %eax, %eax
jne 0x47de
movq %rbx, %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5a4a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_print_state
void af_print_state(af_global_t* global, af_task_t* task) {
  af_byte_t length = AF_WORD_NAME_LEN(task->current_word);
  af_byte_t* buffer = malloc((length + 1) * sizeof(af_byte_t));
  af_cell_t* data_stack = task->data_stack_current;
  af_cell_t return_count = task->return_stack_base - task->return_stack_current;
  af_cell_t stack_count = 4;
  memcpy(buffer, AF_WORD_NAME_DATA(task->current_word),
	 length * sizeof(af_byte_t));
  buffer[length] = 0;
  fprintf(stderr, "Entering: ");
  while(return_count--) {
    fprintf(stderr, "  ");
  }
  fprintf(stderr, "%s", buffer);
  while(stack_count && data_stack < task->data_stack_base) {
    fprintf(stderr, " %lld", *data_stack++);
    stack_count--;
  }
  if(!stack_count && data_stack != task->data_stack_base) {
    fprintf(stderr, " ...");
  }
  fprintf(stderr, "\n");
  free(buffer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0xf8(%rsi), %r15
movzbl -0x1(%r15), %r12d
decq %r15
leaq 0x1(%r12), %rdi
callq 0x2220
movq %rax, %rbp
movq 0x60(%r14), %rax
movq %rax, 0x8(%rsp)
movq 0x70(%r14), %r13
movq 0xa0(%r14), %rbx
subq %r12, %r15
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21f0
movq %rbp, 0x10(%rsp)
movb $0x0, (%rbp,%r12)
movq 0x1fc64(%rip), %rbp     # 0x21ff8
movq (%rbp), %rcx
leaq 0xbc81(%rip), %rdi      # 0xe020
pushq $0xa
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
subq %r13, %rbx
je 0x23d9
sarq $0x3, %rbx
leaq 0xbc71(%rip), %r15      # 0xe02b
pushq $0x2
popq %r12
pushq $0x1
popq %r13
movq (%rbp), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x22e0
decq %rbx
jne 0x23c2
movq (%rbp), %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x2170
leaq 0xbc3d(%rip), %r15      # 0xe02e
xorl %ebx, %ebx
movq 0x8(%rsp), %r13
leaq (%rbx,%r13), %rax
cmpq 0x90(%r14), %rax
jae 0x242c
movq (%rbp), %rdi
movq (%rax), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x21e0
addq $0x8, %rbx
cmpq $0x20, %rbx
jne 0x23f8
addq %rbx, %r13
cmpq 0x90(%r14), %r13
jne 0x244e
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0x21b0
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
movq (%rbp), %rcx
leaq 0xbbdb(%rip), %rdi      # 0xe034
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
jmp 0x242c
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/main.c
// Function: main
int main(int argc, char** argv) {
  af_global_t* global = af_global_init(argc, argv);
  if(!global) {
    abort();
  }
  af_global_execute(global);
  return 0;
}

// Assembly:
pushq %rax
callq 0x2578
testq %rax, %rax
je 0x2573
movq %rax, %rdi
callq 0x278e
xorl %eax, %eax
popq %rcx
retq
callq 0x2060
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_global_execute
void af_global_execute(af_global_t* global) {
  af_task_t* task = af_spawn(global, NULL);
  if(!task) {
    return;
  }
  af_register_prims(global, task);
  af_compile_builtin(global, task);
  task->interpreter_pointer = &global->base_interpreter_code[0];
  af_start(global, task);
  af_task_loop(global);
  af_io_cleanup_stdin();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0x2806
testq %rax, %rax
je 0x27fe
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4088
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd300
leaq 0x1f0(%rbx), %rax
movq %rax, 0x58(%r14)
cmpq $0x0, 0x10(%r14)
jne 0x27ea
cmpq $0x0, 0x48(%r14)
jne 0x27ea
movq 0x168(%rbx), %rax
movq %rax, 0x28(%r14)
movq %rax, 0x20(%r14)
movq %rax, 0x10(%r14)
incq 0x10(%rbx)
movq %rbx, %rdi
callq 0x2b40
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc4e6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_start
void af_start(af_global_t* global, af_task_t* task) {
  if(!task->base_cycles_before_yield && !task->is_to_be_freed) {
    task->base_cycles_before_yield = task->current_cycles_before_yield =
      task->current_cycles_left = global->default_cycles_before_yield;
    af_schedule(global, task);
  }
}

// Assembly:
cmpq $0x0, 0x10(%rsi)
je 0x2b21
retq
cmpq $0x0, 0x48(%rsi)
jne 0x2b20
movq 0x168(%rdi), %rax
movq %rax, 0x28(%rsi)
movq %rax, 0x20(%rsi)
movq %rax, 0x10(%rsi)
incq 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_task_loop
void af_task_loop(af_global_t* global) {
  pthread_mutex_lock(&global->mutex);
  while(global->first_task) {
    while(global->tasks_active_count) {
      af_task_t* task = global->first_task;
      af_task_t* prev_task = NULL;
      while(task) {
	if(task->is_to_be_freed) {
	  af_task_t* old_task = task;
	  task = task->next_task;
	  if(prev_task) {
	    prev_task->next_task = task;
	  } else {
	    global->first_task = task;
	  }
	  if(global->atomic_task == old_task) {
	    global->atomic_task = NULL;
	  }
	  af_free_task(old_task);
	} else {
	  if(!global->atomic_task || global->atomic_task == task) {
	    pthread_mutex_unlock(&global->mutex);
	    pthread_mutex_lock(&global->mutex);
	    af_inner_loop(global, task);
	  }
	  prev_task = task;
	  task = task->next_task;
	}
      }
      task = global->first_task;
      prev_task = NULL;
      while(task) {
	if(task->is_to_be_freed) {
	  af_task_t* old_task = task;
	  task = task->next_task;
	  if(prev_task) {
	    prev_task->next_task = task;
	  } else {
	    global->first_task = task;
	  }
	  if(global->atomic_task == old_task) {
	    global->atomic_task = NULL;
	  }
	  af_free_task(old_task);
	} else {
	  prev_task = task;
	  task = task->next_task;
	}
      }
    }
    if(global->first_task) {
      pthread_mutex_unlock(&global->mutex);
      af_cond_wait(&global->cond);
      pthread_mutex_lock(&global->mutex);
    }
  }
  pthread_mutex_unlock(&global->mutex);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x80(%rdi), %rbx
movq %rbx, %rdi
callq 0x2310
cmpq $0x0, (%r14)
je 0x2c72
leaq 0x20(%r14), %r15
cmpq $0x0, 0x10(%r14)
je 0x2c4a
movq (%r14), %r12
testq %r12, %r12
je 0x2bf6
xorl %r13d, %r13d
cmpq $0x0, 0x48(%r12)
je 0x2bba
leaq 0x8(%r13), %rax
testq %r13, %r13
cmoveq %r14, %rax
movq 0x8(%r12), %rbp
movq %rbp, (%rax)
cmpq %r12, 0x218(%r14)
jne 0x2bb0
movq $0x0, 0x218(%r14)
movq %r12, %rdi
callq 0x2c88
jmp 0x2bee
movq 0x218(%r14), %rax
testq %rax, %rax
je 0x2bcb
cmpq %r12, %rax
jne 0x2be6
movq %rbx, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x2310
movq %r14, %rdi
movq %r12, %rsi
callq 0x2ce4
movq 0x8(%r12), %rbp
movq %r12, %r13
movq %rbp, %r12
testq %rbp, %rbp
jne 0x2b81
movq (%r14), %rdi
testq %rdi, %rdi
je 0x2b6b
xorl %r12d, %r12d
cmpq $0x0, 0x48(%rdi)
movq 0x8(%rdi), %r13
je 0x2c3a
leaq 0x8(%r12), %rax
testq %r12, %r12
cmoveq %r14, %rax
movq %r13, (%rax)
cmpq %rdi, 0x218(%r14)
jne 0x2c33
movq $0x0, 0x218(%r14)
callq 0x2c88
jmp 0x2c3d
movq %rdi, %r12
movq %r13, %rdi
testq %r13, %r13
jne 0x2c05
jmp 0x2b6b
cmpq $0x0, (%r14)
je 0x2c68
movq %rbx, %rdi
callq 0x2210
movq %r15, %rdi
callq 0xbdf2
movq %rbx, %rdi
callq 0x2310
cmpq $0x0, (%r14)
jne 0x2b6b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_free_task
void af_free_task(af_task_t* task) {
  if(task->free_data_on_exit) {
    free(task->data_space_base);
  }
  free(task->task_local_space_base);
  free(task->wordlist_order);
  free(task->data_stack_top);
  free(task->float_stack_top);
  free(task->return_stack_top);
  free(task);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x118(%rdi)
je 0x2ca2
movq 0xd8(%rbx), %rdi
callq 0x2050
movq 0x120(%rbx), %rdi
callq 0x2050
movq 0xb0(%rbx), %rdi
callq 0x2050
movq 0x78(%rbx), %rdi
callq 0x2050
movq 0x80(%rbx), %rdi
callq 0x2050
movq 0x88(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_inner_loop
void af_inner_loop(af_global_t* global, af_task_t* task) {
  if(!task->current_cycles_before_yield) {
    return;
  }
  global->current_task = task;
  task->current_cycles_left =
    task->current_cycles_before_yield + task->extra_cycles;
  if(task->current_cycles_left > global->max_cycles_before_yield) {
    task->extra_cycles =
      task->current_cycles_left - global->max_cycles_before_yield;
    task->current_cycles_left = global->max_cycles_before_yield;
    if(task->extra_cycles > global->max_extra_cycles) {
      task->extra_cycles = global->max_extra_cycles;
    }
  }
  if(task->init_word) {
    AF_WORD_EXECUTE(task, task->init_word);
  }
  task->init_word = NULL;
  while(task->current_cycles_left--) {
    af_compiled_t* interpreter_pointer = task->interpreter_pointer;
    af_word_t* word = interpreter_pointer->compiled_call;
    AF_WORD_EXECUTE(task, word);
  }
  task->yields++;
  global->current_task = NULL;
}

// Assembly:
movq 0x20(%rsi), %rax
testq %rax, %rax
je 0x2d7d
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, 0x8(%rdi)
addq 0x18(%rsi), %rax
movq %rax, 0x28(%rsi)
movq 0x170(%rdi), %rcx
subq %rcx, %rax
jbe 0x2d2b
movq %rax, 0x18(%r14)
movq %rcx, 0x28(%r14)
movq 0x178(%rbx), %rcx
cmpq %rcx, %rax
jbe 0x2d2b
movq %rcx, 0x18(%r14)
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x2d40
movq %rax, 0xf8(%r14)
movq %r14, %rdi
callq *(%rax)
movq $0x0, 0x50(%r14)
subq $0x1, 0x28(%r14)
jb 0x2d64
movq 0x58(%r14), %rax
movq (%rax), %rax
movq %rax, 0xf8(%r14)
movq %r14, %rdi
callq *(%rax)
jmp 0x2d48
addq $0x1, 0x30(%r14)
adcq $0x0, 0x38(%r14)
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_bye
void af_bye(af_global_t* global) {
  af_task_t* task = global->first_task;
  while(task) {
    af_terminate(global, task);
    task = task->next_task;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x2db3
movq %rdi, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2dbb
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x2d9f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_terminate
void af_terminate(af_global_t* global, af_task_t* task) {
  if(!task->is_to_be_freed) {
    if(task->terminate) {
      if(!task->current_cycles_before_yield) {
	task->current_cycles_before_yield =
	  global->default_cycles_before_yield;
	af_schedule(global, task);
      }
      AF_WORD_EXECUTE(task, task->terminate);
    } else {
      af_kill(global, task);
    }
  }
}

// Assembly:
cmpq $0x0, 0x48(%rsi)
je 0x2dc3
retq
movq 0x108(%rsi), %rax
testq %rax, %rax
je 0x3130
cmpq $0x0, 0x20(%rsi)
jne 0x2de9
movq 0x168(%rdi), %rcx
movq %rcx, 0x20(%rsi)
incq 0x10(%rdi)
movq %rax, 0xf8(%rsi)
movq %rsi, %rdi
jmpq *(%rax)
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_kill
void af_kill(af_global_t* global, af_task_t* task) {
  task->current_cycles_before_yield = 0;
  task->current_cycles_left = 0;
  task->is_to_be_freed = TRUE;
  global->task_count--;
  af_deschedule(global, task);
  af_handle_kill(global, task);
}

// Assembly:
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsi)
movq $-0x1, 0x48(%rsi)
decq 0x18(%rdi)
decq 0x10(%rdi)
movq 0x220(%rdi), %rsi
testq %rsi, %rsi
je 0x315e
cmpq $0x0, 0x48(%rsi)
je 0x327e
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_wait
void af_wait(af_global_t* global, af_task_t* task) {
  task->current_cycles_before_yield = 0;
  task->extra_cycles += task->current_cycles_left;
  if(task->extra_cycles > global->max_extra_cycles) {
    task->extra_cycles = global->max_extra_cycles;
  }
  task->current_cycles_left = 0;
  af_deschedule(global, task);
}

// Assembly:
xorl %eax, %eax
movq %rax, 0x20(%rsi)
movq 0x18(%rsi), %rcx
addq 0x28(%rsi), %rcx
movq %rcx, 0x18(%rsi)
movq 0x178(%rdi), %rdx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
movq %rcx, 0x18(%rsi)
movq %rax, 0x28(%rsi)
decq 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_end_atomic
void af_end_atomic(af_global_t* global, af_task_t* task) {
  af_task_t* next_atomic_task;
  if(task == global->atomic_task) {
    next_atomic_task = af_get_nested_task(global);
    if(next_atomic_task && global->current_task != next_atomic_task) {
      next_atomic_task->nesting_level = -1;
      global->atomic_task = next_atomic_task;
      if(global->current_task) {
	af_yield(global, global->current_task);
      }
      af_wake(global, global->atomic_task);
    } else {
      global->atomic_task = NULL;
    }
  }
}

// Assembly:
cmpq %rsi, 0x218(%rdi)
je 0x3201
retq
pushq %rbx
movq %rdi, %rbx
callq 0x3349
testq %rax, %rax
je 0x3255
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
je 0x3255
movq $-0x1, 0x130(%rax)
movq %rax, 0x218(%rbx)
testq %rcx, %rcx
je 0x3239
xorl %edx, %edx
movq %rdx, 0x28(%rcx)
movq %rdx, 0x18(%rcx)
cmpq $0x0, 0x20(%rax)
jne 0x3260
cmpq $0x0, 0x48(%rax)
jne 0x3260
movq 0x10(%rax), %rcx
movq %rcx, 0x20(%rax)
incq 0x10(%rbx)
jmp 0x3260
movq $0x0, 0x218(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_begin_atomic
void af_begin_atomic(af_global_t* global, af_task_t* task) {
  if(!global->atomic_task) {
    task->nesting_level = -1;
    global->atomic_task = task;
    if(global->current_task != global->atomic_task) {
      if(global->current_task) {
	af_yield(global, global->current_task);
      }
      af_wake(global, global->atomic_task);
    }
  } else if(task->nesting_level < 0 && task != global->atomic_task) {
    af_sign_cell_t level = af_get_nesting_level(global);
    level = level < 0 ? 0 : level + 1;
    task->nesting_level = level;
  }
}

// Assembly:
movq 0x218(%rdi), %rax
testq %rax, %rax
je 0x32c3
cmpq %rsi, %rax
je 0x32f4
cmpq $0x0, 0x130(%rsi)
jns 0x32f4
movq (%rdi), %rcx
movq 0x130(%rcx), %rax
testq %rcx, %rcx
je 0x32f5
cmpq $0x0, 0x48(%rcx)
jne 0x32bd
movq 0x130(%rcx), %rdx
cmpq %rdx, %rax
cmovleq %rdx, %rax
movq 0x8(%rcx), %rcx
jmp 0x32a3
movq $-0x1, 0x130(%rsi)
movq %rsi, 0x218(%rdi)
movq 0x8(%rdi), %rax
cmpq %rsi, %rax
je 0x32f4
testq %rax, %rax
je 0x32ed
xorl %ecx, %ecx
movq %rcx, 0x28(%rax)
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x20(%rsi)
je 0x330a
retq
leaq 0x1(%rax), %rcx
xorl %edx, %edx
testq %rax, %rax
cmovnsq %rcx, %rdx
movq %rdx, 0x130(%rsi)
retq
cmpq $0x0, 0x48(%rsi)
jne 0x32f4
movq 0x10(%rsi), %rax
movq %rax, 0x20(%rsi)
incq 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_get_nesting_level
af_sign_cell_t af_get_nesting_level(af_global_t* global) {
  af_task_t* current_task = global->first_task;
  af_sign_cell_t level = current_task->nesting_level;
  while(current_task) {
    if(!current_task->is_to_be_freed && level < current_task->nesting_level ) {
      level = current_task->nesting_level;
    }
    current_task = current_task->next_task;
  }
  return level;
}

// Assembly:
movq (%rdi), %rcx
movq 0x130(%rcx), %rax
testq %rcx, %rcx
je 0x3348
cmpq $0x0, 0x48(%rcx)
jne 0x3342
movq 0x130(%rcx), %rdx
cmpq %rdx, %rax
cmovleq %rdx, %rax
movq 0x8(%rcx), %rcx
jmp 0x3328
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_get_nested_task
af_task_t* af_get_nested_task(af_global_t* global) {
  af_task_t* current_task = global->first_task;
  af_task_t* nested_task = NULL;
  af_sign_cell_t level = current_task->nesting_level;
  while(current_task) {
    if(!current_task->is_to_be_freed) {
      if(((level > -1) && (current_task->nesting_level < level)) ||
	 ((level < 0) && (current_task->nesting_level > -1))) {
	nested_task = current_task;
	level = current_task->nesting_level;
      }
    }
    current_task = current_task->next_task;
  }
  return nested_task;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x3392
movq 0x130(%rcx), %rdx
xorl %eax, %eax
cmpq $0x0, 0x48(%rcx)
jne 0x3388
testq %rdx, %rdx
js 0x336f
cmpq %rdx, 0x130(%rcx)
jl 0x337e
testq %rdx, %rdx
jns 0x3388
cmpq $0x0, 0x130(%rcx)
js 0x3388
movq 0x130(%rcx), %rdx
movq %rcx, %rax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x335a
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_reset
void af_reset(af_global_t* global, af_task_t* task) {
  task->base_cycles_before_yield = global->default_cycles_before_yield;
  task->extra_cycles = 0;
  task->current_cycles_before_yield = global->default_cycles_before_yield;
  task->is_compiling = FALSE;
  task->interpreter_pointer = NULL;
  task->data_stack_current = task->data_stack_base;
  task->float_stack_current = task->float_stack_base;
  task->return_stack_current = task->return_stack_base;
  task->most_recent_word = NULL;
  task->base = 10;
  if(task->abort) {
    AF_WORD_EXECUTE(task, task->abort);
  } else {
    af_kill(global, task);
  }
}

// Assembly:
movq 0x168(%rdi), %rax
movq %rax, 0x10(%rsi)
xorl %ecx, %ecx
movq %rcx, 0x18(%rsi)
movq %rax, 0x20(%rsi)
movq %rcx, 0x40(%rsi)
movq %rcx, 0x58(%rsi)
movq 0x90(%rsi), %rax
movq %rax, 0x60(%rsi)
movups 0x98(%rsi), %xmm0
movups %xmm0, 0x68(%rsi)
movq %rcx, 0xe0(%rsi)
movq $0xa, 0xf0(%rsi)
movq 0x100(%rsi), %rax
testq %rax, %rax
je 0x3130
movq %rax, 0xf8(%rsi)
movq %rsi, %rdi
jmpq *(%rax)
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_guarantee
void* af_guarantee(af_global_t* global, af_task_t* task, size_t size) {
  size_t size_remaining = task->data_space_top - task->data_space_current;
  if((size <= size_remaining) &&
     (global->min_guaranteed_data_space_size <= size_remaining ||
      task->free_data_on_exit)) {
    return task->data_space_current;
  } else if(!task->free_data_on_exit) {
    void* new_data_space_base = malloc(global->default_data_space_size);
    task->data_space_base = new_data_space_base;
    task->data_space_current = new_data_space_base;
    task->data_space_top =
      new_data_space_base + global->default_data_space_size;
    return new_data_space_base;
  } else {
    af_handle_data_space_overflow(global, task);
    return NULL;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0xc8(%rsi), %rax
movq 0xd0(%rsi), %rcx
subq %rax, %rcx
cmpq %rdx, %rcx
jae 0x36ef
cmpq $0x0, 0x118(%rbx)
je 0x3704
leaq 0xa9ed(%rip), %rdi      # 0xe0c8
callq 0x2090
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3395
xorl %eax, %eax
jmp 0x372e
cmpq %rcx, 0x158(%r14)
jbe 0x372e
cmpq $0x0, 0x118(%rbx)
jne 0x372e
jmp 0x36ca
movq 0x160(%r14), %r14
movq %r14, %rdi
callq 0x2220
movq %rax, 0xd8(%rbx)
movq %rax, 0xc8(%rbx)
movq %rax, %rcx
addq %r14, %rcx
movq %rcx, 0xd0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tabemann[P]attoforth/src/runtime/inner.c
// Function: af_allocate
void* af_allocate(af_global_t* global, af_task_t* task, size_t size) {
  void* base = af_guarantee(global, task, size);
  if(base) {
    task->data_space_current += size;
  }
  return base;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
callq 0x36aa
testq %rax, %rax
je 0x3751
addq %rbx, 0xc8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq