LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/xgp.c
// Function: svc_xgp
int
svc_xgp(Bus *bus, void *dev)
{
	XGP *xgp = dev;
	if(handleclock(&xgp->clk))
		xgp_sync(xgp);
	if(xgp->xcr & FGO)
		xgp->go(xgp, bus);
	if((xgp->xcr & (FDONE|FDIE)) == (FDONE|FDIE))
		return 5;
	else
		return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x6422
testl %eax, %eax
je 0x358e
movq %rbx, %rdi
callq 0x341c
movzwl 0x28(%rbx), %eax
testb $0x1, %al
je 0x35a3
movq %rbx, %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movzwl 0x28(%rbx), %eax
notl %eax
xorl %ecx, %ecx
testb $-0x40, %al
sete %cl
leal (%rcx,%rcx,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/print.c
// Function: print_line
void print_line()
{
	if(lines >= PAPER_MAX)
		return;

	lines++;

	// Clear the line
	position = PAGE_WIDTH;
	do {
		--position;
		print_dot(0);
		--position;
	} while(position > 0);
}

// Assembly:
movl 0x25c5f(%rip), %eax     # 0x2c500
cmpl $0xabdf, %eax           # imm = 0xABDF
jg 0x68fe
leal 0x1(%rax), %ecx
movl %ecx, 0x25c4f(%rip)     # 0x2c500
movl $0x6c0, %ecx            # imm = 0x6C0
imull $0x6c0, %eax, %edx      # imm = 0x6C0
movslq %edx, %rdx
leaq 0x25c4a(%rip), %rsi     # 0x2c510
movslq %ecx, %rdi
decq %rdi
cmpl $0xabdf, %eax           # imm = 0xABDF
je 0x68ec
cmpl $0x6c1, %ecx            # imm = 0x6C1
jge 0x68ec
movl %edi, %r8d
addq %rdx, %rdi
movb $-0x1, (%rsi,%rdi)
movl %ecx, %edi
movl %r8d, %ecx
jmp 0x68f2
addl $-0x2, %ecx
movl %ecx, %r8d
cmpl $0x1, %edi
jg 0x68c6
movl %r8d, 0x25c06(%rip)     # 0x2c504
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/print.c
// Function: print_finish
int print_finish(int offset, char *file, size_t n)
{
	char time[100];
	int error;

	if(lines <= offset + 2) {
		*file = 0;
		return 0;
	}
	lines -= offset;

	timestamp(time, sizeof time);
	snprintf(file, n, "xgp-%s.png", time);
	if(fork()) {
		error = lines;
	} else {
		make_page();
		error = lodepng_encode32_file(file, page, PAGE_WIDTH, lines);
		exit(error == 0 ? 0 : 1);
	}

	memmove(paper, paper + PAGE_WIDTH*lines, PAGE_WIDTH*offset);
	lines = offset;

	return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl 0x25b98(%rip), %eax     # 0x2c500
leal 0x2(%rbx), %ecx
cmpl %ecx, %eax
jle 0x69d8
movq %rdx, %r15
subl %ebx, %eax
movl %eax, 0x25b86(%rip)     # 0x2c500
movq %rsp, %r12
movl $0x64, %esi
movq %r12, %rdi
callq 0x64eb
leaq 0xeead(%rip), %rdx      # 0x1583e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x20c0
callq 0x22f0
testl %eax, %eax
je 0x69ee
movslq 0x25b4f(%rip), %r14     # 0x2c500
imulq $0x6c0, %r14, %rsi      # imm = 0x6C0
leaq 0x25b51(%rip), %rdi     # 0x2c510
addq %rdi, %rsi
imull $0x6c0, %ebx, %eax      # imm = 0x6C0
movslq %eax, %rdx
callq 0x2220
movl %ebx, 0x25b2a(%rip)     # 0x2c500
jmp 0x69df
movb $0x0, (%r14)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x6a1a
movl 0x25b07(%rip), %ecx     # 0x2c500
leaq 0x48a8310(%rip), %rsi   # 0x48aed10
movq %r14, %rdi
movl $0x6c0, %edx            # imm = 0x6C0
callq 0x10c7f
xorl %edi, %edi
testl %eax, %eax
setne %dil
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: lodepng_crc32
unsigned lodepng_crc32(const unsigned char* data, size_t length) {
  /*Using the Slicing by Eight algorithm*/
  unsigned r = 0xffffffffu;
  while(length >= 8) {
    r = lodepng_crc32_table7[(data[0] ^ (r & 0xffu))] ^
        lodepng_crc32_table6[(data[1] ^ ((r >> 8) & 0xffu))] ^
        lodepng_crc32_table5[(data[2] ^ ((r >> 16) & 0xffu))] ^
        lodepng_crc32_table4[(data[3] ^ ((r >> 24) & 0xffu))] ^
        lodepng_crc32_table3[data[4]] ^
        lodepng_crc32_table2[data[5]] ^
        lodepng_crc32_table1[data[6]] ^
        lodepng_crc32_table0[data[7]];
    data += 8;
    length -= 8;
  }
  while(length--) {
    r = lodepng_crc32_table0[(r ^ *data++) & 0xffu] ^ (r >> 8);
  }
  return r ^ 0xffffffffu;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x8, %rsi
jb 0x98a1
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0xff, %ecx
leaq 0xc3db(%rip), %rdx      # 0x15bd0
leaq 0xc7d4(%rip), %r8       # 0x15fd0
leaq 0xcbcd(%rip), %r9       # 0x163d0
leaq 0xcfc6(%rip), %r10      # 0x167d0
leaq 0xd3bf(%rip), %r11      # 0x16bd0
leaq 0xd7b8(%rip), %rbx      # 0x16fd0
leaq 0xdbb1(%rip), %r14      # 0x173d0
leaq 0xdfaa(%rip), %r15      # 0x177d0
movzbl (%rdi), %eax
movl %r12d, %r13d
andl %ecx, %r13d
xorl %eax, %r13d
movzbl 0x1(%rdi), %eax
movl %r12d, %ebp
shrl $0x8, %ebp
andl %ecx, %ebp
xorl %eax, %ebp
movl (%r8,%rbp,4), %eax
xorl (%rdx,%r13,4), %eax
movzbl 0x2(%rdi), %ebp
movl %r12d, %r13d
shrl $0x10, %r13d
andl %ecx, %r13d
xorl %ebp, %r13d
xorl (%r9,%r13,4), %eax
movzbl 0x3(%rdi), %ebp
shrl $0x18, %r12d
xorl %ebp, %r12d
xorl (%r10,%r12,4), %eax
movzbl 0x4(%rdi), %r12d
xorl (%r11,%r12,4), %eax
movzbl 0x5(%rdi), %r12d
xorl (%rbx,%r12,4), %eax
movzbl 0x6(%rdi), %r12d
xorl (%r14,%r12,4), %eax
movzbl 0x7(%rdi), %r12d
xorl (%r15,%r12,4), %eax
addq $0x8, %rdi
addq $-0x8, %rsi
movl %eax, %r12d
cmpq $0x7, %rsi
ja 0x9826
testq %rsi, %rsi
je 0x98c9
xorl %ecx, %ecx
leaq 0xdf21(%rip), %rdx      # 0x177d0
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x98af
notl %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_next
unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end) {
  size_t available_size = (size_t)(end - chunk);
  if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/
  if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47
    && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) {
    /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */
    return chunk + 8;
  } else {
    size_t total_chunk_length;
    if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end;
    if(total_chunk_length > available_size) return end; /*outside of range*/
    return chunk + total_chunk_length;
  }
}

// Assembly:
movq %rsi, %rax
movq %rsi, %rcx
subq %rdi, %rcx
setbe %dl
cmpq $0xc, %rcx
setb %sil
orb %dl, %sil
jne 0x9a3e
movzbl (%rdi), %edx
movl %edx, %r8d
xorb $-0x77, %r8b
movb 0x1(%rdi), %sil
movl %esi, %r9d
xorb $0x50, %r9b
orb %r8b, %r9b
jne 0x9a0e
movb $0x50, %sil
cmpb $0x4e, 0x2(%rdi)
jne 0x9a0e
cmpb $0x47, 0x3(%rdi)
jne 0x9a0e
cmpb $0xd, 0x4(%rdi)
jne 0x9a0e
cmpb $0xa, 0x5(%rdi)
jne 0x9a0e
cmpb $0x1a, 0x6(%rdi)
jne 0x9a0e
cmpb $0xa, 0x7(%rdi)
jne 0x9a0e
addq $0x8, %rdi
movq %rdi, %rax
retq
shll $0x18, %edx
movzbl %sil, %esi
shll $0x10, %esi
orl %edx, %esi
movzbl 0x2(%rdi), %edx
shll $0x8, %edx
orl %esi, %edx
movzbl 0x3(%rdi), %esi
leaq (%rdx,%rsi), %r8
addq %rsi, %rdx
addq $0xc, %rdx
cmpq %rcx, %rdx
leaq 0xc(%rdi,%r8), %rcx
cmovbeq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_next_const
const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end) {
  size_t available_size = (size_t)(end - chunk);
  if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/
  if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47
    && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) {
    /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */
    return chunk + 8;
  } else {
    size_t total_chunk_length;
    if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end;
    if(total_chunk_length > available_size) return end; /*outside of range*/
    return chunk + total_chunk_length;
  }
}

// Assembly:
movq %rsi, %rax
movq %rsi, %rcx
subq %rdi, %rcx
setbe %dl
cmpq $0xc, %rcx
setb %sil
orb %dl, %sil
jne 0x9ad1
movzbl (%rdi), %edx
movl %edx, %r8d
xorb $-0x77, %r8b
movb 0x1(%rdi), %sil
movl %esi, %r9d
xorb $0x50, %r9b
orb %r8b, %r9b
jne 0x9aa1
movb $0x50, %sil
cmpb $0x4e, 0x2(%rdi)
jne 0x9aa1
cmpb $0x47, 0x3(%rdi)
jne 0x9aa1
cmpb $0xd, 0x4(%rdi)
jne 0x9aa1
cmpb $0xa, 0x5(%rdi)
jne 0x9aa1
cmpb $0x1a, 0x6(%rdi)
jne 0x9aa1
cmpb $0xa, 0x7(%rdi)
jne 0x9aa1
addq $0x8, %rdi
movq %rdi, %rax
retq
shll $0x18, %edx
movzbl %sil, %esi
shll $0x10, %esi
orl %edx, %esi
movzbl 0x2(%rdi), %edx
shll $0x8, %edx
orl %esi, %edx
movzbl 0x3(%rdi), %esi
leaq (%rdx,%rsi), %r8
addq %rsi, %rdx
addq $0xc, %rdx
cmpq %rcx, %rdx
leaq 0xc(%rdi,%r8), %rcx
cmovbeq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: lodepng_chunk_createv
static unsigned lodepng_chunk_createv(ucvector* out,
                                      size_t length, const char* type, const unsigned char* data) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type));

  /*3: the data*/
  lodepng_memcpy(chunk + 8, data, length);

  /*4: CRC (of the chunkname characters and the data)*/
  lodepng_chunk_generate_crc(chunk);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %rcx
movq %rsi, %r14
movq %rdi, %rsi
movq %rsp, %rdi
movq %r14, %rdx
callq 0x11d0e
movl %eax, %ebp
testl %eax, %eax
jne 0x9cad
movq (%rsp), %r15
testq %r14, %r14
je 0x9ca5
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2170
movq %r15, %rdi
callq 0x9981
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: lodepng_decode_memory
unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in,
                               size_t insize, LodePNGColorType colortype, unsigned bitdepth) {
  unsigned error;
  LodePNGState state;
  lodepng_state_init(&state);
  state.info_raw.colortype = colortype;
  state.info_raw.bitdepth = bitdepth;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  /*disable reading things that this function doesn't output*/
  state.decoder.read_text_chunks = 0;
  state.decoder.remember_unknown_chunks = 0;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  error = lodepng_decode(out, w, h, &state, in, insize);
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %r8, %rax
movq %rcx, %r8
movl 0x240(%rsp), %ecx
movl $0x1, %r10d
movq %rsp, %rbx
movl %r10d, 0x34(%rbx)
movl $0x1000000, %r11d       # imm = 0x1000000
movq %r11, 0x40(%rbx)
movq %r11, 0x48(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, 0x20(%rbx)
xorl %r11d, %r11d
movl %r11d, 0x30(%rbx)
movaps 0x7421(%rip), %xmm1     # 0x158f0
movaps %xmm1, 0x50(%rbx)
movl $0x80, 0x60(%rbx)
movl %r10d, 0x64(%rbx)
movups %xmm0, 0x68(%rbx)
movq %r11, 0x78(%rbx)
movl $0x5, 0x88(%rbx)
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x80(%rbx)
movaps %xmm0, 0x90(%rbx)
movl %r10d, 0xa0(%rbx)
movaps %xmm0, 0xc0(%rbx)
movaps %xmm0, 0xb0(%rbx)
movups %xmm0, 0xf8(%rbx)
movabsq $0x800000006, %r14      # imm = 0x800000006
movq %r14, 0xe0(%rbx)
movups %xmm0, 0xe8(%rbx)
movl %r11d, 0xd8(%rbx)
movq %r11, 0xd0(%rbx)
movl %r11d, 0x174(%rbx)
movl %r11d, 0x184(%rbx)
movl %r11d, 0x18c(%rbx)
movl %r11d, 0x1b0(%rbx)
movl %r11d, 0x1b8(%rbx)
movl %r11d, 0x158(%rbx)
movups %xmm0, 0x148(%rbx)
movups %xmm0, 0x138(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x108(%rbx)
movaps %xmm0, 0x1c0(%rbx)
movl %r11d, 0x214(%rbx)
movups %xmm0, 0x204(%rbx)
movups %xmm0, 0x1f4(%rbx)
movups %xmm0, 0x1e4(%rbx)
movups %xmm0, 0x1d4(%rbx)
movl %r10d, 0x218(%rbx)
movl %r9d, 0xa8(%rbx)
movl %ecx, 0xac(%rbx)
movq %r11, 0x38(%rbx)
movq %rbx, %rcx
movq %rax, %r9
callq 0xd66f
movl %eax, %ebp
movq %rbx, %rdi
callq 0xe72a
movl %ebp, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: addChunk_PLTE
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk;
  size_t i, j = 8;

  if(info->palettesize == 0 || info->palettesize > 256) {
    return 68; /*invalid palette size, it is only allowed to be 1-256*/
  }

  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE"));

  for(i = 0; i != info->palettesize; ++i) {
    /*add all channels except alpha channel*/
    chunk[j++] = info->palette[i * 4 + 0];
    chunk[j++] = info->palette[i * 4 + 1];
    chunk[j++] = info->palette[i * 4 + 2];
  }

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x10(%rsi), %rcx
leaq -0x101(%rcx), %rdx
movl $0x44, %eax
cmpq $-0x100, %rdx
jb 0x103dd
movq %rdi, %rsi
leaq (%rcx,%rcx,2), %rdx
leaq 0x7d13(%rip), %rcx      # 0x1809d
leaq 0x8(%rsp), %rdi
callq 0x11d0e
testl %eax, %eax
jne 0x103dd
cmpq $0x0, 0x10(%rbx)
movq 0x8(%rsp), %rdi
je 0x103d6
leaq 0xa(%rdi), %rax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
movb (%rdx,%rcx,4), %dl
movb %dl, -0x2(%rax)
movq 0x8(%rbx), %rdx
movb 0x1(%rdx,%rcx,4), %dl
movb %dl, -0x1(%rax)
movq 0x8(%rbx), %rdx
movb 0x2(%rdx,%rcx,4), %dl
movb %dl, (%rax)
incq %rcx
addq $0x3, %rax
cmpq 0x10(%rbx), %rcx
jne 0x103aa
callq 0x9981
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: ucvector_reserve
static unsigned ucvector_reserve(ucvector* p, size_t size) {
  if(size > p->allocsize) {
    size_t newsize = size + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned char*)data;
    }
    else return 0; /*error: not enough memory*/
  }
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r15
movl $0x1, %ebx
cmpq %rsi, %r15
jae 0x10cf6
movq %rdi, %r14
shrq %r15
addq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x21e0
testq %rax, %rax
je 0x10cf4
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0x10cf6
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: huffmanDecodeSymbol
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    advanceBits(reader, FIRSTBITS);
    value += peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[value] - FIRSTBITS);
    return codetree->table_value[value];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
movzbl (%rsi,%r8), %ecx
movl %r8d, %r8d
movzwl (%rdx,%r8,2), %r8d
cmpq $0x9, %rcx
ja 0x10d29
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0x10d79
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r9
leaq 0x9(%r9), %r10
movq %r10, 0x18(%rdi)
addb $-0x9, %cl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
shll %cl, %r10d
notl %r10d
andl %eax, %r10d
addl %r10d, %r8d
movzwl %r8w, %r8d
movzbl (%rsi,%r8), %esi
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %rsi, %rcx
movl %ecx, %esi
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%rsi,%r9), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%r8,2), %r8d
movzwl %r8w, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/lodepng.c
// Function: writeBitsReversed
static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  size_t i;
  for(i = 0; i != nbits; ++i) {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u));
  }
}

// Assembly:
testq %rdx, %rdx
je 0x11bec
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movb 0x8(%rdi), %cl
andb $0x7, %cl
jne 0x11bbe
movq (%r14), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
movq %rsi, 0x8(%rdi)
callq 0x10cbf
testl %eax, %eax
je 0x11be8
movq (%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%r14), %cl
andb $0x7, %cl
decq %rbx
xorl %eax, %eax
btl %ebx, %ebp
setb %al
shll %cl, %eax
movq (%r14), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
movb 0x8(%r14), %cl
incb %cl
movb %cl, 0x8(%r14)
testq %rbx, %rbx
jne 0x11b8c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x11ed5
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
callq *%rax
testl %eax, %eax
je 0x11f3e
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x11f42
cmpq (%rbx), %rax
movl $0x6e, %eax
sbbl $0x0, %eax
jmp 0x11f47
movq (%r15), %rdi
movq (%rbx), %rbp
movq %rdi, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
testq %rdx, %rdx
je 0x11f1a
addq %rbp, %rdx
cmpq %rdx, %rbp
jae 0x11f12
shrq %rbp
addq %rdx, %rbp
movq %rbp, %rsi
callq 0x21e0
testq %rax, %rax
je 0x11f12
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 0x9492
movq (%rbp), %rcx
movq %rcx, (%r15)
movq 0x8(%rbp), %rcx
movq %rcx, (%rbx)
jmp 0x11f47
xorl %eax, %eax
jmp 0x11f47
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_O3/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 0xe5fc
movl %ebx, %r9d
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xd66f
testl %eax, %eax
je 0x13a85
movl %eax, %edi
callq 0x10ca1
leaq 0x59bd(%rip), %rdi      # 0x19434
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x20b0
jmp 0x13aad
movl $0x18, %edi
callq 0x21a0
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_O3/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 0x15c9(%rip), %rsi      # 0x15099
callq 0x2250
testq %rax, %rax
je 0x13b31
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21d0
movq %r14, %rdi
callq 0x2150
movq %rax, %r12
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21d0
movl %r12d, %r13d
movq %r13, %rdi
callq 0x21a0
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 0x13b34
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xe5fc
movq 0x10(%r14), %rdx
movl (%r14), %ecx
movl 0x4(%r14), %r8d
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %r9
callq 0xe9c8
testl %eax, %eax
je 0x13b8d
leaq 0x5952(%rip), %rdi      # 0x194d8
callq 0x2050
jmp 0x13bc2
leaq 0x4501(%rip), %rsi      # 0x18095
movq %rbx, %rdi
callq 0x2250
testq %rax, %rax
je 0x13bcf
movq %rax, %rbx
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
movl $0x1, %esi
movq %rax, %rcx
callq 0x22c0
movq %rbx, %rdi
callq 0x20a0
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %r15
retq
leaq 0x58f0(%rip), %rdi      # 0x194c6
jmp 0x13b86
// File: /workspace/github_c_makefile_star2_O3/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 0x5805(%rip), %xmm1     # 0x19418
minss %xmm0, %xmm1
movaps %xmm1, %xmm2
mulss %xmm1, %xmm2
addss %xmm1, %xmm1
movss 0x57f2(%rip), %xmm0     # 0x1941c
subss %xmm1, %xmm0
mulss %xmm2, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/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 %edx, %ecx
movl (%rdi), %eax
leal (,%rax,4), %edx
cmpl (%rsi), %edx
jne 0x13f4a
movl 0x4(%rdi), %edx
leal (,%rdx,4), %r8d
cmpl 0x4(%rsi), %r8d
jne 0x13f69
testl %edx, %edx
je 0x13f3b
movl %ecx, %r8d
imull %ecx, %r8d
movl %r8d, 0x14(%rsp)
movl %ecx, %r11d
leal (,%rcx,4), %r8d
movl %r8d, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
testl %eax, %eax
movl $0x0, %eax
je 0x13f2d
xorl %ebp, %ebp
xorl %r14d, %r14d
movl $0x0, %eax
testl %ecx, %ecx
jle 0x13ef5
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 0x13ed6
incl %r13d
addl %r15d, %r8d
cmpl %ecx, %r13d
jne 0x13ed0
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
movl (%rdi), %eax
addl 0x10(%rsp), %ebp
cmpl %eax, %r14d
jb 0x13eae
movl 0x4(%rdi), %edx
incl %ebx
addl %ecx, 0xc(%rsp)
cmpl %edx, %ebx
jb 0x13e9c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54f5(%rip), %rdi      # 0x19446
leaq 0x5500(%rip), %rsi      # 0x19458
leaq 0x5504(%rip), %rcx      # 0x19463
movl $0xa2, %edx
callq 0x20e0
leaq 0x551a(%rip), %rdi      # 0x1948a
leaq 0x54e1(%rip), %rsi      # 0x19458
leaq 0x54e5(%rip), %rcx      # 0x19463
movl $0xa3, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O3/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 0x13c33
movq %r14, %rdi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x13e38
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x140e9
movl %edi, %ebp
movq 0x8(%rbx), %rdi
leaq 0x4(%rsp), %rsi
callq 0x13abd
testq %rax, %rax
je 0x140b4
movq %rax, %r15
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x13a2c
testq %rax, %rax
je 0x140bd
movq %rax, %r14
movq %r15, %rdi
callq 0x2030
movl $0x18, %edi
callq 0x21a0
movq %rax, %r15
movl (%r14), %esi
leal (,%rsi,4), %eax
movl %eax, (%r15)
movl 0x4(%r14), %eax
shll $0x2, %eax
movl %eax, 0x4(%r15)
shll $0x4, %esi
movl %esi, 0x8(%r15)
imull %eax, %esi
movl $0x1, %edi
callq 0x2130
movq %rax, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x13c33
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x13e38
cmpl $0x2, %ebp
jne 0x140d0
leaq 0x540c(%rip), %rdi      # 0x194be
jmp 0x140d4
leaq 0x543d(%rip), %rdi      # 0x194f8
jmp 0x140c4
leaq 0x5425(%rip), %rdi      # 0x194e9
callq 0x2050
movl $0x1, %eax
jmp 0x140de
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x13b41
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2411
jmp 0x140c9
// File: /workspace/github_c_makefile_star2_O3/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 0x45a740
testl %eax, %eax
jne 0x4023f7
movzwl 0x8(%rsp), %r15d
movl %r15d, 0xf0fb6(%rip)    # 0x4f3324
movzwl 0xa(%rsp), %r12d
movl %r12d, 0xf0fad(%rip)    # 0x4f3328
movl 0xf0fab(%rip), %ebp     # 0x4f332c
movl 0xf0fa8(%rip), %r14d    # 0x4f3330
movl $0x40, %edi
callq 0x402568
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x40275f
movb $0x6, (%rax)
movb 0xf0f6c(%rip), %cl      # 0x4f3314
movb %cl, 0x1(%rax)
movb %r15b, 0x2(%rax)
movb %r12b, 0x3(%rax)
movq %rbx, %rdi
movl $0x4, %esi
callq 0x40275f
movl %ebp, %edi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x402478
cmpl $-0x1, %eax
jne 0x4023ef
callq 0x405930
movl (%rax), %edi
callq 0x42c040
leaq 0xbcd0e(%rip), %rdi     # 0x4bf0f3
movq %rax, %rsi
xorl %eax, %eax
callq 0x40d5f0
movq %rbx, %rdi
callq 0x4025cc
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x402568
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x40275f
movb $0x2, (%rax)
movb 0xf0ee7(%rip), %cl      # 0x4f3314
movb %cl, 0x1(%rax)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x40275f
movl %r14d, %edi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x402478
cmpl $-0x1, %eax
jne 0x40246c
callq 0x405930
movl (%rax), %edi
callq 0x42c040
leaq 0xbcc91(%rip), %rdi     # 0x4bf0f3
movq %rax, %rsi
xorl %eax, %eax
callq 0x40d5f0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4025cc
// File: /workspace/github_c_makefile_star2_O3/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
leaq 0x10(%rsp), %rax
movq $0x0, -0x4(%rax)
movl $0x0, 0x4(%rax)
movl $0x11680011, -0xc(%rax) # imm = 0x11680011
movb $0x6, -0x1(%rax)
movl %esi, -0x8(%rax)
cmpl $0x0, 0xf0e71(%rip)     # 0x4f3320
je 0x4024c6
movzwl 0xf0e8c(%rip), %ecx     # 0x4f3344
movw %cx, 0x4(%rax)
movl 0xf0e7e(%rip), %ecx     # 0x4f3340
movl %ecx, (%rax)
jmp 0x4024d2
movw $0xffff, 0x4(%rax)      # imm = 0xFFFF
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x38(%rbx), %rsi
movl (%rbx), %edx
leaq 0x4(%rsp), %r8
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x45c740
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %ecx
je 0x40255c
cmpl $0x0, 0xf0e12(%rip)     # 0x4f3310
movl $0x0, %eax
je 0x40255c
movl (%rbx), %esi
leaq 0xbcbf8(%rip), %rdi     # 0x4bf106
xorl %eax, %eax
callq 0x40d5f0
movq $-0x6, %r14
leaq 0xd895a(%rip), %r15     # 0x4dae7d
leaq 0xc296c(%rip), %r12     # 0x4c4e96
leaq 0xbcba9(%rip), %rbx     # 0x4bf0da
movzbl 0x16(%rsp,%r14), %esi
incq %r14
movq %r12, %rdx
cmoveq %r15, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x40d5f0
testq %r14, %r14
jne 0x402531
movl $0xa, %edi
callq 0x41c400
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x40280a
movq %rsi, %r14
movl $0x1, %ebp
movb (%rax), %cl
cmpb $0x2d, %cl
jne 0x4027db
movzbl 0x1(%rax), %ecx
cmpl $0x2d, %ecx
je 0x4027ca
testl %ecx, %ecx
jne 0x4027d0
jmp 0x40280a
cmpb $0x0, 0x2(%rax)
je 0x40280a
testq %r14, %r14
je 0x4027d9
orb $0x8, (%r14)
movb (%rax), %cl
cmpb $0x1, %cl
jne 0x4027ec
cmpb $0x2, 0x1(%rax)
jne 0x4027ec
cmpb $0x0, 0x2(%rax)
je 0x4027fc
incl %ebp
movslq %ebp, %rax
movq (%rbx,%rax,8), %rax
testq %rax, %rax
jne 0x4027b4
jmp 0x40280a
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0x40285b
jmp 0x4027ee
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movq %rbx, %rax
incl %ebp
cmpq $0x0, (%rax)
leaq 0x8(%rax), %rax
jne 0x402812
movq (%rbx), %rax
testq %rax, %rax
je 0x402846
xorl %edx, %edx
cmpb $0x2d, (%rax)
jne 0x402839
cmpb $0x2d, 0x1(%rax)
jne 0x402839
cmpb $0x0, 0x2(%rax)
je 0x40284f
movq 0x8(%rbx,%rdx,8), %rax
incq %rdx
testq %rax, %rax
jne 0x402828
incl %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movl %edx, %esi
callq 0x40285b
jmp 0x402848
// File: /workspace/github_c_makefile_star2_O3/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 0x402860
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
subl %eax, %r8d
sets %cl
cmpl %esi, %r8d
setl %r9b
orb %cl, %r9b
jne 0x4028b8
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 0x4028a4
xorl %r9d, %r9d
jmp 0x4028a8
movq (%rdi,%rcx,8), %r9
movq %r9, (%r8)
addq $0x8, %r8
incq %rcx
incl %esi
cmpl %esi, %eax
jne 0x40289a
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x402c74
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
subl %r12d, %ebx
sets %al
cmpl %ebp, %ebx
setl %dl
orb %al, %dl
jne 0x402d57
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 0x402d20
movq %r15, %rdi
callq 0x42c000
movq %rax, %r14
movb $0x0, (%rax)
movb (%r15), %cl
testb %cl, %cl
movl 0xc(%rsp), %esi
je 0x402cfb
incq %r15
movq %r14, %rax
movsbl %cl, %edx
cmpl %edx, %esi
jne 0x402cec
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x402cf1
movb %cl, (%rax)
incq %rax
movb (%r15), %cl
incq %r15
testb %cl, %cl
jne 0x402cde
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 0x429cd0
notl %r12d
movl 0x8(%rsp), %eax
subl %ebp, %eax
incl %eax
movslq %eax, %rcx
movl %ebx, %eax
addq %rcx, %r14
movq 0x10(%rsp), %rdx
cmpq %rax, %r14
jle 0x402d41
xorl %ecx, %ecx
jmp 0x402d45
movq (%rdx,%r14,8), %rcx
movq %rcx, (%r13)
addq $0x8, %r13
incq %r14
incl %ebp
cmpl %ebp, %r12d
jne 0x402d38
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4028b9
testl %eax, %eax
je 0x402ddc
movq (%rsp), %r15
movq %r15, %rdi
callq 0x40b910
movl %eax, (%r14)
movq %r15, %rdi
callq 0x429cd0
jmp 0x402dde
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x1954
testq %rax, %rax
jle 0x3236
movb $0x0, (%rsp,%rax)
cmpb $0x71, (%rsp)
je 0x3236
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1b6b
testq %rax, %rax
je 0x31fc
movq %rbx, %rdi
callq 0x1c34
movq %rbx, %rdi
callq 0x1030
leaq 0xf99(%rip), %rdi       # 0x41e6
callq 0x1070
xorl %eax, %eax
callq 0x1513
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1954
testq %rax, %rax
jle 0x32b9
leaq 0xe29(%rip), %rsi       # 0x40b3
leaq 0xe75(%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 0x1b6b
movq %rbx, %rdi
callq 0x1c34
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
callq 0x1513
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1890
movq %rsp, %rsi
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
callq 0x1954
testq %rax, %rax
jle 0x33b8
leaq 0xdef(%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 0x1b6b
testq %rax, %rax
jne 0x33b8
leaq 0xe02(%rip), %rsi       # 0x415a
movq %r14, %rdi
xorl %edx, %edx
callq 0x1e50
testl %eax, %eax
js 0x3399
movq %rsp, %r15
movl $0x800, %edx            # imm = 0x800
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f1e
movslq %eax, %rdx
testl %edx, %edx
jle 0x33a7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b6b
testq %rax, %rax
je 0x3369
leaq 0xe2e(%rip), %rdi       # 0x41c5
jmp 0x33a0
leaq 0xe34(%rip), %rdi       # 0x41d4
callq 0x1070
jmp 0x33b8
leaq 0xdc4(%rip), %rdi       # 0x4172
movq %rdx, %rsi
xorl %eax, %eax
callq 0x1120
movq %r14, %rdi
callq 0x203b
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1c34
movq %rbx, %rdi
callq 0x1030
leaq 0xe07(%rip), %rdi       # 0x41e6
callq 0x1070
xorl %eax, %eax
callq 0x1513
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1890
leaq 0xd6f(%rip), %rsi       # 0x4186
movq %rbx, %rdi
movl $0x1f90, %edx           # imm = 0x1F90
callq 0x1924
testl %eax, %eax
jne 0x34ad
leaq 0xdc3(%rip), %rdi       # 0x41f6
callq 0x1070
movq %rsp, %rdi
movl $0x64, %esi
callq 0x1da0
testl %eax, %eax
jne 0x34a4
movq %rsp, %rbx
leaq 0xd6c(%rip), %r14       # 0x41bf
leaq -0x17f(%rip), %r15      # 0x32db
movl $0x38, %edi
callq 0x11f0
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x1890
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e43
testl %eax, %eax
jne 0x34b6
movq %r14, %rdi
movl $0x2800, %esi           # imm = 0x2800
movq %r15, %rdx
movq %r12, %rcx
callq 0x1672
movq %rbx, %rdi
movl $0x64, %esi
callq 0x1da0
testl %eax, %eax
je 0x345a
leaq 0xcf2(%rip), %rdi       # 0x419d
jmp 0x34bd
leaq 0xcda(%rip), %rdi       # 0x418e
jmp 0x34bd
leaq 0xcf1(%rip), %rdi       # 0x41ae
movl %eax, %esi
xorl %eax, %eax
callq 0x1120
movl $0x1, %edi
callq 0x1270
// File: /workspace/github_c_makefile_star2_O3/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 0x14a71
movq %rax, %rbx
movq %rax, %rdi
callq 0x14c74
leaq 0x1c85b(%rip), %rsi     # 0x21004
movq %rbx, %rdi
xorl %edx, %edx
callq 0x141ca
testl %eax, %eax
jne 0x47ce
movq %rbx, %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x5b8f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x4080
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd130
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 0x2b5a
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc394
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2b3b
retq
cmpq $0x0, 0x48(%rsi)
jne 0x2b3a
movq 0x168(%rdi), %rax
movq %rax, 0x28(%rsi)
movq %rax, 0x20(%rsi)
movq %rax, 0x10(%rsi)
incq 0x10(%rdi)
retq