LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/mi/match.c
// Function: pateq
static int
pateq(Node *a, Node *b)
{
	if (exprop(a) != exprop(b))
		return 0;

	switch (exprop(a)) {
	case Olit:
		return liteq(a->expr.args[0], b->expr.args[0]);
	case Ogap:
	case Ovar:
		return 1;
	default:
		die("unreachable");
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1d422
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1d422
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %ebp
jne 0x2c701
movq %r14, %rdi
callq 0x1d422
movl %eax, %ecx
movl $0x1, %eax
leal -0x33(%rcx), %edx
cmpl $0x2, %edx
jae 0x2c706
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x35, %ecx
jne 0x2c722
movq 0x50(%r14), %rax
movq (%rax), %rdi
movq 0x50(%rbx), %rax
movq (%rax), %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x1e3ae
leaq 0xc901(%rip), %rdi      # 0x3902a
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/mi/match.c
// Function: loadeq
static int
loadeq(Node *a, Node *b)
{
	if (a == b)
		return 1;

	if (exprop(a) != exprop(b))
		return 0;

	switch (exprop(a)) {
	case Outag:
	case Oudata:
	case Oderef:
		return loadeq(a->expr.args[0], b->expr.args[0]);
	case Omemb:
		return loadeq(a->expr.args[0], b->expr.args[0]) && nameeq(a->expr.args[1], b->expr.args[1]);
	case Otupget:
	case Oidx:
		return loadeq(a->expr.args[0], b->expr.args[0]) && liteq(a->expr.args[1]->expr.args[0], b->expr.args[1]->expr.args[0]);
	case Ovar:
		return a == b;
	default:
		die("unreachable");
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movb $0x1, %r15b
cmpq %rsi, %rdi
je 0x2c8a0
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
callq 0x1d422
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1d422
cmpl %eax, %ebp
jne 0x2c89d
movq %r14, %rdi
callq 0x1d422
cmpl $0x32, %eax
jle 0x2c7f8
leal -0x43(%rax), %ecx
cmpl $0x2, %ecx
jb 0x2c7fd
jmp 0x2c851
cmpl $0x13, %eax
jne 0x2c815
movq 0x50(%r14), %rax
movq (%rax), %r14
movq 0x50(%rbx), %rax
movq (%rax), %rbx
cmpq %rbx, %r14
jne 0x2c7c7
jmp 0x2c8a0
cmpl $0x28, %eax
je 0x2c85b
cmpl $0x2a, %eax
jne 0x2c8af
movq 0x50(%r14), %rax
movq (%rax), %rdi
movq 0x50(%rbx), %rax
movq (%rax), %rsi
callq 0x2c7ae
testl %eax, %eax
je 0x2c89d
movq 0x50(%r14), %rax
movq 0x8(%rax), %rdi
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x1e523
jmp 0x2c895
cmpl $0x33, %eax
je 0x2c89d
cmpl $0x45, %eax
jne 0x2c8af
movq 0x50(%r14), %rax
movq (%rax), %rdi
movq 0x50(%rbx), %rax
movq (%rax), %rsi
callq 0x2c7ae
testl %eax, %eax
je 0x2c89d
movq 0x50(%r14), %rax
movq 0x8(%rax), %rax
movq 0x50(%rax), %rax
movq (%rax), %rdi
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x50(%rax), %rax
movq (%rax), %rsi
callq 0x1e3ae
testl %eax, %eax
setne %r15b
jmp 0x2c8a0
xorl %r15d, %r15d
movzbl %r15b, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc774(%rip), %rdi      # 0x3902a
xorl %eax, %eax
callq 0x13844
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/mi/reaching.c
// Function: assignee
Node *
assignee(Node *n)
{
	Node *a;

	switch (exprop(n)) {
	case Oundef: case Odef:
	case Oset:
	case Oasn: case Oaddeq:
	case Osubeq: case Omuleq:
	case Odiveq: case Omodeq:
	case Oboreq: case Obandeq:
	case Obxoreq: case Obsleq:
	case Obsreq:
		return n->expr.args[0];
		break;
	case Oblit:
	case Oclear:
		a = n->expr.args[0];
		if (exprop(a) != Oaddr)
			break;
		a = a->expr.args[0];
		if (exprop(a) != Ovar)
			break;
		return a;
	default:
		break;
	}
	return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1d422
addl $-0x1d, %eax
cmpl $0x2a, %eax
ja 0x2c925
movabsq $0x9800007ff, %rcx      # imm = 0x9800007FF
btq %rax, %rcx
jae 0x2c8ed
movq 0x50(%rbx), %rax
movq (%rax), %rbx
movq %rbx, %rax
popq %rbx
retq
movabsq $0x60000000000, %rcx    # imm = 0x60000000000
btq %rax, %rcx
jae 0x2c925
movq 0x50(%rbx), %rax
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x1d422
cmpl $0x12, %eax
jne 0x2c925
movq 0x50(%rbx), %rax
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x1d422
cmpl $0x33, %eax
je 0x2c8e8
xorl %ebx, %ebx
jmp 0x2c8e8
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/mi/reaching.c
// Function: bsdump
void
bsdump(Bitset *bs)
{
	size_t i;
	for (i = 0; bsiter(bs, &i); i++)
		printf("%zd ", i);
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
callq 0x2d2a6
testl %eax, %eax
je 0x2c979
leaq 0xc740(%rip), %r14      # 0x39091
leaq 0x8(%rsp), %r15
movq 0x8(%rsp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x4140
incq 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2d2a6
testl %eax, %eax
jne 0x2c956
movl $0xa, %edi
callq 0x4050
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/mi/reaching.c
// Function: reachingfree
void
reachingfree(Reaching *r)
{
	size_t i;

	for (i = 0; i < r->nbb; i++) {
		bsfree(r->in[i]);
		bsfree(r->out[i]);
	}
	for (i = 0; i < ndecls; i++)
		free(r->defs[i]);
	free(r->in);
	free(r->out);
	free(r->defs);
	free(r->ndefs);
	free(r);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
je 0x2cdf0
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2d164
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2d164
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x2cdce
leaq 0x34b69(%rip), %r14     # 0x61960
cmpq $0x0, (%r14)
je 0x2ce15
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x4040
incq %r15
cmpq (%r14), %r15
jb 0x2ce00
movq (%rbx), %rdi
callq 0x4040
movq 0x8(%rbx), %rdi
callq 0x4040
movq 0x10(%rbx), %rdi
callq 0x4040
movq 0x18(%rbx), %rdi
callq 0x4040
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4040
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: zalloc
void *
zalloc(size_t sz)
{
	void *mem;

	mem = calloc(1, sz);
	if (!mem && sz)
		die("Out of memory");
	return mem;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movq %rbx, %rsi
callq 0x4220
testq %rax, %rax
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
je 0x2ce6b
popq %rbx
retq
leaq 0xc224(%rip), %rdi      # 0x39096
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: xalloc
void *
xalloc(size_t sz)
{
	void *mem;

	mem = malloc(sz);
	if (!mem && sz)
		die("Out of memory");
	return mem;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4280
testq %rax, %rax
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
je 0x2ce94
popq %rbx
retq
leaq 0xc1fb(%rip), %rdi      # 0x39096
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: zrealloc
void *
zrealloc(void *mem, size_t oldsz, size_t sz)
{
	char *p;

	p = xrealloc(mem, sz);
	if (sz > oldsz)
		memset(&p[oldsz], 0, sz - oldsz);
	return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdx, %rsi
callq 0x2ced6
movq %rax, %r14
subq %r15, %rbx
jbe 0x2cecd
movq %r14, %rdi
addq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x41a0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: xrealloc
void *
xrealloc(void *mem, size_t sz)
{
	mem = realloc(mem, sz);
	if (!mem && sz)
		die("Out of memory");
	return mem;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x42a0
testq %rax, %rax
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
je 0x2cef1
popq %rbx
retq
leaq 0xc19e(%rip), %rdi      # 0x39096
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: lpop
void *
lpop(void *l, size_t *len)
{
	void ***pl;
	void *v;

	pl = l;
	(*len)--;
	v = (*pl)[*len];
	*pl = xrealloc(*pl, *len * sizeof(void *));
	return v;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
leaq -0x1(%rax), %rcx
movq %rcx, (%rsi)
movq (%rdi), %rdi
movq -0x8(%rdi,%rax,8), %r14
leaq -0x8(,%rax,8), %rsi
callq 0x2ced6
movq %rax, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: ldel
void
ldel(void *p, size_t *len, size_t idx)
{
	void ***pl, **l;

	assert(p != NULL);
	assert(idx < *len);
	pl = p;
	l = *pl;
	memmove(&l[idx], &l[idx + 1], (*len - idx - 1) * sizeof(void *));
	(*len)--;
	*pl = xrealloc(l, *len * sizeof(void *));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2d028
movq %rsi, %r14
movq (%rsi), %rax
cmpq %rdx, %rax
jbe 0x2d047
movq %rdi, %rbx
movq (%rdi), %r15
leaq (%r15,%rdx,8), %rdi
leaq (%r15,%rdx,8), %rsi
addq $0x8, %rsi
notq %rdx
addq %rdx, %rax
shlq $0x3, %rax
movq %rax, %rdx
callq 0x42b0
movq (%r14), %rax
leaq -0x1(%rax), %rcx
movq %rcx, (%r14)
leaq -0x8(,%rax,8), %rsi
movq %r15, %rdi
callq 0x2ced6
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0xc075(%rip), %rdi      # 0x390a4
leaq 0xc078(%rip), %rsi      # 0x390ae
leaq 0xc079(%rip), %rcx      # 0x390b6
movl $0x68, %edx
callq 0x4180
leaq 0xc08c(%rip), %rdi      # 0x390da
leaq 0xc059(%rip), %rsi      # 0x390ae
leaq 0xc05a(%rip), %rcx      # 0x390b6
movl $0x69, %edx
callq 0x4180
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: lcat
void
lcat(void *dst, size_t *ndst, void *src, size_t nsrc)
{
	size_t i;
	void ***d, **s;

	d = dst;
	s = src;
	for (i = 0; i < nsrc; i++)
		lappend(d, ndst, s[i]);
}

// Assembly:
testq %rcx, %rcx
je 0x2d0c6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rax
movq (%rsi), %rcx
xorl %r13d, %r13d
movq (%r14,%r13,8), %rbp
leaq 0x8(,%rcx,8), %rsi
movq %rax, %rdi
callq 0x2ced6
movq %rax, (%r12)
movq (%r15), %rcx
movq %rbp, (%rax,%rcx,8)
incq %rcx
movq %rcx, (%r15)
incq %r13
cmpq %r13, %rbx
jne 0x2d08b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/alloc.c
// Function: lfree
void
lfree(void *l, size_t *len)
{
	void ***pl;

	assert(l != NULL);
	pl = l;
	free(*pl);
	*pl = NULL;
	*len = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d0ee
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x4040
xorl %eax, %eax
movq %rax, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x9e0d(%rip), %rdi      # 0x36f02
leaq 0xbfb2(%rip), %rsi      # 0x390ae
leaq 0xbfe2(%rip), %rcx      # 0x390e5
movl $0x82, %edx
callq 0x4180
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: mkbs
Bitset *
mkbs()
{
	Bitset *bs;

	bs = xalloc(sizeof(Bitset));
	bs->nchunks = 1;
	bs->chunks = zalloc(1 * sizeof(size_t));
	return bs;
}

// Assembly:
pushq %rbx
movl $0x10, %edi
callq 0x2ce79
movq %rax, %rbx
movq $0x1, (%rax)
movl $0x8, %edi
callq 0x2ce48
movq %rax, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsdup
Bitset *
bsdup(Bitset *a)
{
	Bitset *bs;

	if (!a)
		return NULL;
	bs = xalloc(sizeof(Bitset));
	bs->nchunks = a->nchunks;
	bs->chunks = xalloc(a->nchunks * sizeof(size_t));
	memcpy(bs->chunks, a->chunks, a->nchunks * sizeof(size_t));
	return bs;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d1c1
movq %rdi, %r14
movl $0x10, %edi
callq 0x2ce79
movq %rax, %rbx
movq (%r14), %rdi
movq %rdi, (%rax)
shlq $0x3, %rdi
callq 0x2ce79
movq %rax, 0x8(%rbx)
movq (%r14), %rdx
movq 0x8(%r14), %rsi
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x4270
jmp 0x2d1c3
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsclear
Bitset *
bsclear(Bitset *bs)
{
	size_t i;

	if (!bs)
		return mkbs();
	for (i = 0; i < bs->nchunks; i++)
		bs->chunks[i] = 0;
	return bs;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2d1f5
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x2d217
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
movq $0x0, (%rax,%rcx,8)
incq %rcx
cmpq (%rbx), %rcx
jb 0x2d1e3
jmp 0x2d217
movl $0x10, %edi
callq 0x2ce79
movq %rax, %rbx
movq $0x1, (%rax)
movl $0x8, %edi
callq 0x2ce48
movq %rax, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bscount
size_t
bscount(Bitset *bs)
{
	size_t i, j, n;

	n = 0;
	for (i = 0; i < bs->nchunks; i++)
		for (j = 0; j < sizeof(size_t) * CHAR_BIT; j++)
			if (bs->chunks[i] & 1ULL << j)
				n++;
	return n;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x2d2a3
movq 0x8(%rdi), %rdx
xorl %eax, %eax
movdqa 0xbede(%rip), %xmm0     # 0x39110
movapd 0xbee6(%rip), %xmm1     # 0x39120
movdqa 0xbeee(%rip), %xmm2     # 0x39130
xorl %esi, %esi
movq %rax, %xmm3
movq (%rdx,%rsi,8), %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
movl $0x40, %eax
movdqa %xmm0, %xmm5
movdqa %xmm4, %xmm6
psrlq %xmm5, %xmm6
pshufd $0xee, %xmm5, %xmm7     # xmm7 = xmm5[2,3,2,3]
movdqa %xmm4, %xmm8
psrlq %xmm7, %xmm8
movsd %xmm6, %xmm8            # xmm8 = xmm6[0],xmm8[1]
andpd %xmm1, %xmm8
paddq %xmm8, %xmm3
paddq %xmm2, %xmm5
addq $-0x2, %rax
jne 0x2d25c
pshufd $0xee, %xmm3, %xmm4     # xmm4 = xmm3[2,3,2,3]
paddq %xmm3, %xmm4
movq %xmm4, %rax
incq %rsi
cmpq %rcx, %rsi
jne 0x2d244
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsiter
int
bsiter(Bitset *bs, size_t *elt)
{
	size_t b, t, i;

	i = *elt;
	t = i/Sizetbits;
	if (t >= bs->nchunks)
		return 0;
	b = bs->chunks[t];
	b &= ~((1ull << (i%Sizetbits)) - 1);
	while (!b) {
		++t;
		if (t >= bs->nchunks)
			return 0;
		b = bs->chunks[t];
	}
	*elt = Sizetbits*t + firstbit(b);
	return 1;
}

// Assembly:
movq (%rsi), %rcx
movq %rcx, %rdx
shrq $0x6, %rdx
movq (%rdi), %r8
xorl %eax, %eax
cmpq %r8, %rdx
jae 0x2d360
movq 0x8(%rdi), %r9
movq (%r9,%rdx,8), %rdi
shrq %cl, %rdi
shlq %cl, %rdi
testq %rdi, %rdi
jne 0x2d2ea
decq %r8
cmpq %rdx, %r8
je 0x2d360
movq 0x8(%r9,%rdx,8), %rdi
incq %rdx
testq %rdi, %rdi
je 0x2d2d4
shlq $0x6, %rdx
movq %rdi, %rax
shrq $0x20, %rax
xorl %ecx, %ecx
testl %edi, %edi
sete %cl
cmovneq %rdi, %rax
shll $0x5, %ecx
leal 0x10(%rcx), %edi
movq %rax, %r8
shrq $0x10, %r8
testw %ax, %ax
cmovneq %rax, %r8
cmovnel %ecx, %edi
leal 0x8(%rdi), %eax
movq %r8, %rcx
shrq $0x8, %rcx
testb %r8b, %r8b
cmovneq %r8, %rcx
cmovnel %edi, %eax
leal 0x4(%rax), %edi
movl %ecx, %r8d
shrl $0x4, %r8d
testb $0xf, %cl
cmovneq %rcx, %r8
cmovnel %eax, %edi
andl $0xf, %r8d
leaq 0xbdf6(%rip), %rax      # 0x39140
movsbq (%r8,%rax), %rax
movslq %edi, %rcx
addq %rdx, %rcx
addq %rax, %rcx
movq %rcx, (%rsi)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsput
void
bsput(Bitset *bs, size_t elt)
{
	size_t sz;
	if (elt >= bs->nchunks * Sizetbits) {
		sz = (elt / Sizetbits) + 1;
		bs->chunks = zrealloc(bs->chunks, bs->nchunks * sizeof(size_t), sz * sizeof(size_t));
		bs->nchunks = sz;
	}
	bs->chunks[elt / Sizetbits] |= 1ULL << (elt % Sizetbits);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rsi
movq %rsi, %rax
shlq $0x6, %rax
cmpq %rbx, %rax
jbe 0x2d393
movq 0x8(%r14), %rax
movq %rbx, %r15
shrq $0x6, %r15
jmp 0x2d3ba
movq %rbx, %r15
shrq $0x6, %r15
leaq 0x1(%r15), %r12
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
leaq 0x8(,%r15,8), %rdx
callq 0x2cea2
movq %rax, 0x8(%r14)
movq %r12, (%r14)
movl $0x1, %edx
movl %ebx, %ecx
shlq %cl, %rdx
orq %rdx, (%rax,%r15,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsunion
void
bsunion(Bitset *a, Bitset *b)
{
	size_t i;

	eqsz(a, b);
	for (i = 0; i < a->nchunks; i++)
		a->chunks[i] |= b->chunks[i];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2d430
cmpq $0x0, (%rbx)
je 0x2d428
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rcx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
orq %rsi, (%rcx,%rdx,8)
incq %rdx
cmpq (%rbx), %rdx
jb 0x2d418
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: eqsz
static void
eqsz(Bitset *a, Bitset *b)
{
	size_t sz;
	size_t i;
	size_t *p;

	if (a->nchunks > b->nchunks)
		sz = a->nchunks;
	else
		sz = b->nchunks;

	if (a->nchunks != sz) {
		p = zalloc(sz * sizeof(size_t));
		for (i = 0; i < a->nchunks; i++)
			p[i] = a->chunks[i];
		free(a->chunks);
		a->chunks = p;
		a->nchunks = sz;
	}

	if (b->nchunks != sz) {
		p = zalloc(sz * sizeof(size_t));
		for (i = 0; i < b->nchunks; i++)
			p[i] = b->chunks[i];
		free(b->chunks);
		b->chunks = p;
		b->nchunks = sz;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %r12
movq (%rsi), %rax
cmpq %rax, %r12
cmovbeq %rax, %r12
jae 0x2d488
movq %rdi, %r14
leaq (,%r12,8), %rdi
callq 0x2ce48
movq %rax, %r15
cmpq $0x0, (%r14)
movq 0x8(%r14), %rdi
je 0x2d479
xorl %eax, %eax
movq (%rdi,%rax,8), %rcx
movq %rcx, (%r15,%rax,8)
incq %rax
cmpq (%r14), %rax
jb 0x2d469
callq 0x4040
movq %r15, 0x8(%r14)
movq %r12, (%r14)
movq (%rbx), %rax
cmpq %r12, %rax
je 0x2d4c5
leaq (,%r12,8), %rdi
callq 0x2ce48
movq %rax, %r14
cmpq $0x0, (%rbx)
movq 0x8(%rbx), %rdi
je 0x2d4b9
xorl %eax, %eax
movq (%rdi,%rax,8), %rcx
movq %rcx, (%r14,%rax,8)
incq %rax
cmpq (%rbx), %rax
jb 0x2d4a9
callq 0x4040
movq %r14, 0x8(%rbx)
movq %r12, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bseq
int
bseq(Bitset *a, Bitset *b)
{
	size_t i;

	if (!a || !b)
		return bsisempty(a) && bsisempty(b);
	eqsz(a, b);
	for (i = 0; i < a->nchunks; i++) {
		if (a->chunks[i] != b->chunks[i])
			return 0;
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
je 0x2d5ad
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d430
movq (%r14), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x2d5fc
movq 0x8(%r14), %rdx
movq 0x8(%rbx), %rsi
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
cmpq (%rsi,%rdi,8), %r8
jne 0x2d5fa
incq %rdi
cmpq %rdi, %rcx
jne 0x2d599
jmp 0x2d5fc
testq %r14, %r14
je 0x2d5d1
movq (%r14), %rcx
testq %rcx, %rcx
je 0x2d5d1
movq 0x8(%r14), %rdx
xorl %eax, %eax
xorl %esi, %esi
cmpq $0x0, (%rdx,%rsi,8)
jne 0x2d5fc
incq %rsi
cmpq %rsi, %rcx
jne 0x2d5c2
movl $0x1, %eax
testq %rbx, %rbx
je 0x2d5fc
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x2d5fc
movq 0x8(%rbx), %rdx
xorl %esi, %esi
cmpq $0x0, (%rdx,%rsi,8)
jne 0x2d5fa
incq %rsi
cmpq %rsi, %rcx
jne 0x2d5e9
jmp 0x2d5fc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsisempty
int
bsisempty(Bitset *set)
{
	size_t i;

	if (!set)
		return 1;
	for (i = 0; i < set->nchunks; i++)
		if (set->chunks[i])
			return 0;
	return 1;
}

// Assembly:
movl $0x1, %eax
testq %rdi, %rdi
je 0x2d62b
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x2d62b
movq 0x8(%rdi), %rdx
xorl %esi, %esi
cmpq $0x0, (%rdx,%rsi,8)
jne 0x2d62c
incq %rsi
cmpq %rsi, %rcx
jne 0x2d61c
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/bitset.c
// Function: bsissubset
int
bsissubset(Bitset *set, Bitset *sub)
{
	size_t i;

	eqsz(set, sub);
	for (i = 0; i < set->nchunks; i++)
		if ((sub->chunks[i] & set->chunks[i]) != set->chunks[i])
			return 0;
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2d430
movq (%rbx), %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x2d66e
movq 0x8(%r14), %rdx
movq 0x8(%rbx), %rsi
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
notq %r8
testq %r8, (%rsi,%rdi,8)
jne 0x2d66c
incq %rdi
cmpq %rdi, %rcx
jne 0x2d655
jmp 0x2d66e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: mkht
Htab *
mkht(ulong (*hash)(void *key), int (*cmp)(void *k1, void *k2))
{
	Htab *ht;

	ht = xalloc(sizeof(Htab));
	ht->nelt = 0;
	ht->ndead = 0;
	ht->sz = Initsz;
	ht->hash = hash;
	ht->cmp = cmp;
	ht->keys = zalloc(Initsz * sizeof(void *));
	ht->vals = zalloc(Initsz * sizeof(void *));
	ht->hashes = zalloc(Initsz * sizeof(void *));
	ht->dead = zalloc(Initsz * sizeof(char));

	return ht;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x2ce79
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x10, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
movl $0x80, %edi
callq 0x2ce48
movq %rax, 0x28(%rbx)
movl $0x80, %edi
callq 0x2ce48
movq %rax, 0x30(%rbx)
movl $0x80, %edi
callq 0x2ce48
movq %rax, 0x38(%rbx)
movl $0x10, %edi
callq 0x2ce48
movq %rax, 0x40(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: htfree
void
htfree(Htab *ht)
{
	if (!ht)
		return;
	free(ht->keys);
	free(ht->vals);
	free(ht->hashes);
	free(ht->dead);
	free(ht);
}

// Assembly:
testq %rdi, %rdi
je 0x2d71d
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x4040
movq 0x30(%rbx), %rdi
callq 0x4040
movq 0x38(%rbx), %rdi
callq 0x4040
movq 0x40(%rbx), %rdi
callq 0x4040
movq %rbx, %rdi
popq %rbx
jmp 0x4040
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: htput
int
htput(Htab *ht, void *k, void *v)
{
	int i;
	ulong h;
	int di;

	di = 0;
	h = hash(ht, k);
	i = h & (ht->sz - 1);
	while (ht->hashes[i] && !ht->dead[i]) {
		/* second insertion overwrites first. nb, we shouldn't touch the
		 * keys for dead values */
		if (ht->hashes[i] == h) {
			if (ht->dead[i])
				break;
			else if (ht->cmp(ht->keys[i], k))
				goto conflicted;
		}
		di++;
		i = (h + di) & (ht->sz - 1);
	}
	ht->nelt++;
conflicted:
	if (ht->dead[i])
		ht->ndead--;
	ht->hashes[i] = h;
	ht->keys[i] = k;
	ht->vals[i] = v;
	ht->dead[i] = 0;

	if (ht->sz < ht->nelt * 2)
		grow(ht, ht->sz * 2);
	if (ht->sz < ht->ndead * 4)
		grow(ht, ht->sz);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %rsi, %rdi
callq *0x18(%rbx)
movq %rax, %r12
cmpq $0x1, %rax
adcq $0x0, %r12
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
leal (%rax,%r13), %edx
movl %r12d, %esi
andl %edx, %esi
movslq %esi, %rbp
movq (%rcx,%rbp,8), %rdx
testq %rdx, %rdx
je 0x2d7ad
leaq 0x1(%r12), %r14
movq 0x40(%rbx), %rsi
cmpb $0x0, (%rsi,%rbp)
jne 0x2d7ad
cmpq %r12, %rdx
jne 0x2d795
movq 0x28(%rbx), %rax
movq (%rax,%rbp,8), %rdi
movq %r15, %rsi
callq *0x20(%rbx)
testl %eax, %eax
jne 0x2d7b0
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
leal (%rax,%r13), %edx
movl %r14d, %esi
andl %edx, %esi
movslq %esi, %rbp
movq (%rcx,%rbp,8), %rdx
incq %r14
testq %rdx, %rdx
jne 0x2d76c
incq (%rbx)
movq 0x40(%rbx), %rax
cmpb $0x0, (%rax,%rbp)
je 0x2d7be
decq 0x8(%rbx)
movq 0x38(%rbx), %rax
movq %r12, (%rax,%rbp,8)
movq 0x28(%rbx), %rax
movq %r15, (%rax,%rbp,8)
movq 0x30(%rbx), %rax
movq (%rsp), %rcx
movq %rcx, (%rax,%rbp,8)
movq 0x40(%rbx), %rax
movb $0x0, (%rax,%rbp)
movq (%rbx), %rax
movq 0x10(%rbx), %rsi
addq %rax, %rax
cmpq %rax, %rsi
jae 0x2d7ff
addl %esi, %esi
movq %rbx, %rdi
callq 0x2d828
movq 0x10(%rbx), %rsi
movq 0x8(%rbx), %rax
shlq $0x2, %rax
cmpq %rax, %rsi
jae 0x2d814
movq %rbx, %rdi
callq 0x2d828
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: grow
static void
grow(Htab *ht, int sz)
{
	void **oldk;
	void **oldv;
	ulong *oldh;
	char *oldd;
	int oldsz;
	int i;

	oldk = ht->keys;
	oldv = ht->vals;
	oldh = ht->hashes;
	oldd = ht->dead;
	oldsz = ht->sz;

	ht->nelt = 0;
	ht->ndead = 0;
	ht->sz = sz;
	ht->keys = zalloc(sz * sizeof(void *));
	ht->vals = zalloc(sz * sizeof(void *));
	ht->hashes = zalloc(sz * sizeof(void *));
	ht->dead = zalloc(sz * sizeof(void *));

	for (i = 0; i < oldsz; i++)
		if (oldh[i] && !oldd[i])
			htput(ht, oldk[i], oldv[i]);

	free(oldh);
	free(oldk);
	free(oldv);
	free(oldd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
movq 0x10(%rdi), %r14
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %rax
movq %rax, (%rsp)
movq 0x38(%rdi), %r13
movq 0x40(%rdi), %rbx
movslq %esi, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rbp, 0x10(%rdi)
shlq $0x3, %rbp
movq %rbp, %rdi
callq 0x2ce48
movq %rax, 0x28(%r12)
movq %rbp, %rdi
callq 0x2ce48
movq %rax, 0x30(%r12)
movq %rbp, %rdi
callq 0x2ce48
movq %rax, 0x38(%r12)
movq %rbp, %rdi
callq 0x2ce48
movq %rax, 0x40(%r12)
testl %r14d, %r14d
jle 0x2d8cb
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
cmpq $0x0, (%r13,%rbp,8)
je 0x2d8c3
cmpb $0x0, (%rbx,%rbp)
jne 0x2d8c3
movq (%r15,%rbp,8), %rsi
movq (%rsp), %rax
movq (%rax,%rbp,8), %rdx
movq %r12, %rdi
callq 0x2d71e
incq %rbp
cmpq %rbp, %r14
jne 0x2d8a1
movq %r13, %rdi
callq 0x4040
movq %r15, %rdi
callq 0x4040
movq (%rsp), %rdi
callq 0x4040
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4040
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: htidx
static ssize_t
htidx(Htab *ht, void *k)
{
	ssize_t i;
	ulong h;
	int di;

	di = 0;
	h = hash(ht, k);
	i = h & (ht->sz - 1);
	while (ht->hashes[i] && !ht->dead[i] && ht->hashes[i] != h) {
searchmore:
		di++;
		i = (h + di) & (ht->sz - 1);
	}
	if (!ht->hashes[i])
		return -1;
	if ((ht->hashes[i] == h && ht->dead[i]) || !ht->cmp(ht->keys[i], k))
		goto searchmore; /* collision */
	return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq *0x18(%r14)
movq %rax, %r15
cmpq $0x1, %rax
adcq $0x0, %r15
movq 0x10(%r14), %rax
movq 0x38(%r14), %rcx
leaq -0x1(%rax), %r12
andq %r15, %r12
movq (%rcx,%r12,8), %rdx
testq %rdx, %rdx
je 0x2d999
leaq 0x1(%r15), %r13
movq 0x40(%r14), %rsi
cmpb $0x0, (%rsi,%r12)
sete %sil
cmpq %r15, %rdx
sete %dl
cmpb %sil, %dl
jne 0x2d986
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
callq *0x20(%r14)
testl %eax, %eax
jne 0x2d9a0
movq 0x10(%r14), %rax
movq 0x38(%r14), %rcx
leaq -0x1(%rax), %r12
andq %r13, %r12
movq (%rcx,%r12,8), %rdx
incq %r13
testq %rdx, %rdx
jne 0x2d953
movq $-0x1, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: htdel
void
htdel(Htab *ht, void *k)
{
	ssize_t i;

	i = htidx(ht, k);
	if (i < 0)
		return;
	assert(!ht->dead[i]);
	assert(ht->hashes[i]);
	ht->dead[i] = 1;
	ht->nelt--;
	ht->ndead++;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2d916
testq %rax, %rax
js 0x2d9e4
movq 0x40(%rbx), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x2d9e6
movq 0x38(%rbx), %rdx
cmpq $0x0, (%rdx,%rax,8)
je 0x2da05
movb $0x1, (%rcx,%rax)
movdqu (%rbx), %xmm0
paddq 0xb770(%rip), %xmm0     # 0x39150
movdqu %xmm0, (%rbx)
popq %rbx
retq
leaq 0xb783(%rip), %rdi      # 0x39170
leaq 0xb789(%rip), %rsi      # 0x3917d
leaq 0xb789(%rip), %rcx      # 0x39184
movl $0xbe, %edx
callq 0x4180
leaq 0xb793(%rip), %rdi      # 0x3919f
leaq 0xb76a(%rip), %rsi      # 0x3917d
leaq 0xb76a(%rip), %rcx      # 0x39184
movl $0xbf, %edx
callq 0x4180
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: htkeys
void **
htkeys(Htab *ht, size_t *nkeys)
{
	void **k;
	size_t i, j;

	j = 0;
	k = xalloc(sizeof(void *) * ht->nelt);
	for (i = 0; i < ht->sz; i++)
		if (ht->hashes[i] && !ht->dead[i])
			k[j++] = ht->keys[i];
	*nkeys = ht->nelt;
	return k;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
shlq $0x3, %rdi
callq 0x2ce79
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x2da85
xorl %edx, %edx
xorl %esi, %esi
movq 0x38(%r14), %rdi
cmpq $0x0, (%rdi,%rsi,8)
je 0x2da7d
movq 0x40(%r14), %rdi
cmpb $0x0, (%rdi,%rsi)
jne 0x2da7d
movq 0x28(%r14), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rax,%rdx,8)
incq %rdx
incq %rsi
cmpq %rsi, %rcx
jne 0x2da59
movq (%r14), %rcx
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: murmurhash2
ulong
murmurhash2 (void *ptr, size_t len)
{
	uint32_t m = 0x5bd1e995;
	uint32_t r = 24;
	uint32_t h, k, n;
	uint8_t *p, *end;
	
	h = Seed ^ len;
	n = len & ~0x3ull;
	end = ptr;
	end += n;
	for (p = ptr; p != end; p += 4) {
		k = (p[0] <<  0) |
			(p[1] <<  8) |
			(p[2] << 16) |
			(p[3] << 24);

		k *= m;
		k ^= k >> r;
		k *= m;

		h *= m;
		h ^= k;
	}

	switch (len & 0x3) {
	case 3:	h ^= p[2] << 16;
	case 2:	h ^= p[1] << 8;
	case 1:	h ^= p[0] << 0;
		h *= m;
	}

	h ^= h >> 13;
	h *= m;
	h ^= h >> 15;

	return h;
}

// Assembly:
movl %esi, %eax
xorl $0xae88fef5, %eax       # imm = 0xAE88FEF5
movl %esi, %ecx
andl $-0x4, %ecx
je 0x2daf6
leaq (%rdi,%rcx), %rdx
xorl %r8d, %r8d
imull $0x5bd1e995, (%rdi,%r8), %r9d # imm = 0x5BD1E995
movl %r9d, %r10d
shrl $0x18, %r10d
xorl %r9d, %r10d
imull $0x5bd1e995, %r10d, %r9d # imm = 0x5BD1E995
imull $0x5bd1e995, %eax, %eax # imm = 0x5BD1E995
xorl %r9d, %eax
addq $0x4, %r8
cmpq %r8, %rcx
jne 0x2dac8
movq %rdx, %rdi
andl $0x3, %esi
leaq 0xb660(%rip), %rcx      # 0x39160
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movzbl 0x2(%rdi), %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movzbl 0x1(%rdi), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movzbl (%rdi), %ecx
xorl %eax, %ecx
imull $0x5bd1e995, %ecx, %eax # imm = 0x5BD1E995
movl %eax, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
imull $0x5bd1e995, %ecx, %ecx # imm = 0x5BD1E995
movl %ecx, %eax
shrl $0xf, %eax
xorl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/htab.c
// Function: strliteq
int
strliteq(void *_a, void *_b)
{
	Str *a, *b;

	a = _a;
	b = _b;
	if (a == b)
		return 1;
	if (a == NULL || b == NULL)
		return 0;
	if (a->len != b->len)
		return 0;
	return !memcmp(a->buf, b->buf, a->len);
}

// Assembly:
cmpq %rsi, %rdi
je 0x2dbbe
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x2dbbd
movq (%rdi), %rdx
cmpq (%rsi), %rdx
jne 0x2dbbd
pushq %rax
movq 0x8(%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0x4290
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x8, %rsp
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: wrbuf
void
wrbuf(FILE *fd, void *p, size_t sz)
{
	size_t n;
	char *buf;

	n = 0;
	buf = p;
	while (n < sz) {
		n += fwrite(buf + n, 1, sz - n, fd);
		if (feof(fd))
			die("Unexpected EOF");
		if (ferror(fd))
			die("Error writing");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
movq %rbx, %rdx
subq %r13, %rdx
jbe 0x2dcb0
leaq (%r14,%r13), %rdi
movl $0x1, %esi
movq %r15, %rcx
callq 0x4330
movq %rax, %r12
movq %r15, %rdi
callq 0x4250
testl %eax, %eax
jne 0x2dcba
addq %r12, %r13
movq %r15, %rdi
callq 0x40c0
testl %eax, %eax
je 0x2dc70
leaq 0xb50e(%rip), %rdi      # 0x391bc
jmp 0x2dcc1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xb4ec(%rip), %rdi      # 0x391ad
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: rdbuf
void
rdbuf(FILE *fd, void *buf, size_t sz)
{
	size_t n;

	n = sz;
	while (n > 0) {
		n -= fread(buf, 1, n, fd);
		if (feof(fd))
			die("Unexpected EOF");
		if (ferror(fd))
			die("Error writing");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rbx, %rbx
je 0x2dd18
movl $0x1, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x40e0
movq %rax, %r12
movq %r15, %rdi
callq 0x4250
testl %eax, %eax
jne 0x2dd24
subq %r12, %rbx
movq %r15, %rdi
callq 0x40c0
testl %eax, %eax
je 0x2dcd9
leaq 0xb4a6(%rip), %rdi      # 0x391bc
jmp 0x2dd2b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xb482(%rip), %rdi      # 0x391ad
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: rdbyte
char
rdbyte(FILE *fd)
{
	int c;
	c = fgetc(fd);
	if (c == EOF)
		die("Unexpected EOF");
	return c;
}

// Assembly:
pushq %rax
callq 0x41d0
cmpl $-0x1, %eax
je 0x2dd62
popq %rcx
retq
leaq 0xb444(%rip), %rdi      # 0x391ad
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: wrstr
void
wrstr(FILE *fd, char *val)
{
	size_t len;

	if (!val) {
		wrint(fd, -1);
	} else {
		wrint(fd, strlen(val));
		len = strlen(val);
		wrbuf(fd, val, len);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x2de13
movq %rsi, %r14
movq %rsi, %rdi
callq 0x4120
bswapl %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dc5b
movq %r14, %rdi
callq 0x4120
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2dc5b
movq %rsp, %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dc5b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: rdstr
char *
rdstr(FILE *fd)
{
	ssize_t len;
	char *s;

	len = rdint(fd);
	if (len == -1) {
		return NULL;
	} else {
		s = xalloc(len + 1);
		rdbuf(fd, s, len);
		s[len] = '\0';
		return s;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movl $0x4, %edx
movq %r14, %rsi
callq 0x2dcc8
movzbl (%r14), %eax
shll $0x18, %eax
movzbl 0x1(%r14), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x2(%r14), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x3(%r14), %r14d
orq %rcx, %r14
cmpl $-0x1, %r14d
je 0x2de9d
leaq 0x1(%r14), %rdi
callq 0x2ce79
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2dcc8
movb $0x0, (%r15,%r14)
jmp 0x2dea0
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/pack.c
// Function: rdlenstr
void
rdlenstr(FILE *fd, Str *str)
{
	str->len = rdint(fd);
	str->buf = xalloc(str->len + 1);
	rdbuf(fd, str->buf, str->len);
	str->buf[str->len] = '\0';
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %r15
movl $0x4, %edx
movq %r15, %rsi
callq 0x2dcc8
movzbl (%r15), %eax
shll $0x18, %eax
movzbl 0x1(%r15), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0x2(%r15), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0x3(%r15), %eax
leaq (%rcx,%rax), %rdx
movq %rdx, (%rbx)
leaq (%rax,%rcx), %rdi
incq %rdi
callq 0x2ce79
movq %rax, 0x8(%rbx)
movq (%rbx), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2dcc8
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: xstrdup
char *
xstrdup(char *s)
{
	char *p;

	p = strdup(s);
	if (!p && s)
		die("Out of memory");
	return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4340
testq %rax, %rax
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
je 0x2e0ba
popq %rbx
retq
leaq 0xafd5(%rip), %rdi      # 0x39096
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: strjoin
char *
strjoin(char *u, char *v)
{
	size_t n;
	char *s;

	n = strlen(u) + strlen(v) + 1;
	s = xalloc(n);
	bprintf(s, n + 1, "%s%s", u, v);
	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4120
movq %rax, %r15
movq %rbx, %rdi
callq 0x4120
movq %rax, %r12
leaq (%rax,%r15), %rdi
incq %rdi
callq 0x2ce79
movq %rax, %r13
leaq (%r12,%r15), %rsi
addq $0x2, %rsi
leaq 0x3a3b(%rip), %rdx      # 0x31b43
movq %rax, %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2dfae
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: swapsuffix
char *
swapsuffix(char *buf, size_t sz, char *s, char *suf, char *swap)
{
	size_t slen, suflen, swaplen;

	slen = strlen(s);
	suflen = strlen(suf);
	swaplen = strlen(swap);

	if (slen < suflen)
		return NULL;
	if (slen + swaplen >= sz)
		die("swapsuffix: buf too small");

	buf[0] = '\0';
	/* if we have matching suffixes */
	if (suflen < slen && !strcmp(suf, &s[slen - suflen])) {
		strncat(buf, s, slen - suflen);
		strncat(buf, swap, swaplen);
	} else {
		bprintf(buf, sz, "%s%s", s, swap);
	}

	return buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %rbp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, 0x10(%rsp)
movq %rdx, %rdi
callq 0x4120
movq %rax, %r13
movq %rbp, %rdi
callq 0x4120
movq %rax, %r12
movq %r15, (%rsp)
movq %r15, %rdi
callq 0x4120
cmpq %r12, %r13
jae 0x2e16f
xorl %ebx, %ebx
jmp 0x2e1b4
movq %rax, 0x8(%rsp)
addq %r13, %rax
cmpq %r14, %rax
jae 0x2e1f3
movb $0x0, (%rbx)
subq %r12, %r13
movq 0x10(%rsp), %r15
jbe 0x2e199
leaq (%r15,%r13), %rsi
movq %rbp, %rdi
callq 0x4230
testl %eax, %eax
je 0x2e1c6
leaq 0x39a3(%rip), %rdx      # 0x31b43
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
movq (%rsp), %r8
xorl %eax, %eax
callq 0x2dfae
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x41c0
movq %rbx, %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41c0
leaq 0xafd0(%rip), %rdi      # 0x391ca
xorl %eax, %eax
callq 0x13844
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: vfindentf
void
vfindentf(FILE *fd, int depth, char *fmt, va_list ap)
{
	ssize_t i;

	for (i = 0; i < depth; i++)
		fprintf(fd, "\t");
	vfprintf(fd, fmt, ap);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
testl %esi, %esi
jle 0x2e2ef
movslq %esi, %r12
movl $0x9, %edi
movq %r15, %rsi
callq 0x41f0
decq %r12
jne 0x2e2dd
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4300
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: findnextopt
static int
findnextopt(Optctx *ctx)
{
	size_t i;

	for (i = ctx->argidx + 1; i < ctx->noptargs; i++) {
		if (ctx->optargs[i][0] == '-')
			goto foundopt;
		else
			lappend(&ctx->args, &ctx->nargs, ctx->optargs[i]);
	}
	ctx->finished = 1;
	return 0;
foundopt
:
	ctx->argidx = i;
	ctx->curarg = ctx->optargs[i] + 1; /* skip initial '-' */
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %r12
incq %r12
cmpq 0x28(%rdi), %r12
jae 0x2e3ed
leaq 0x8(%rbx), %r14
leaq 0x10(%rbx), %r15
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdx
cmpb $0x2d, (%rdx)
je 0x2e3f6
movq %r14, %rdi
movq %r15, %rsi
callq 0x2ceff
incq %r12
cmpq 0x28(%rbx), %r12
jb 0x2e3cc
movl $0x1, 0x3c(%rbx)
jmp 0x2e401
movq %r12, 0x30(%rbx)
incq %rdx
movq %rdx, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/oridb[P]mc/util/util.c
// Function: optnext
int
optnext(Optctx *ctx)
{
	int take, mand;
	int c;

	c = *ctx->curarg;
	ctx->curarg++;
	if (!optinfo(ctx, c, &take, &mand)) {
		printf("Unexpected argument %c\n", c);
		exit(1);
	}

	ctx->optarg = NULL;
	if (take) {
		if (*ctx->curarg) {
			ctx->optarg = ctx->curarg;
			ctx->curarg += strlen(ctx->optarg);
		} else if (ctx->argidx < ctx->noptargs - 1) {
			ctx->optarg = ctx->optargs[ctx->argidx + 1];
			ctx->argidx++;
		} else if (mand) {
			fprintf(stderr, "expected argument for %c\n", *ctx->curarg);
		}
		findnextopt(ctx);
	} else {
		if (*ctx->curarg == '\0')
			findnextopt(ctx);
	}
	return c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rax
movq 0x40(%rdi), %r15
movsbl (%r15), %ebx
incq %r15
movq %r15, 0x40(%rdi)
movb (%rax), %cl
testb %cl, %cl
je 0x2e441
movq %rdi, %r14
incq %rax
cmpb %bl, %cl
movb (%rax), %cl
movzbl %cl, %edx
je 0x2e45b
incq %rax
testl %edx, %edx
jne 0x2e431
leaq 0xad9c(%rip), %rdi      # 0x391e4
movl %ebx, %esi
xorl %eax, %eax
callq 0x4140
movl $0x1, %edi
callq 0x4320
cmpl $0x3a, %edx
je 0x2e469
cmpl $0x3f, %edx
jne 0x2e48c
movb $0x1, %al
jmp 0x2e46b
xorl %eax, %eax
movq $0x0, (%r14)
cmpb $0x0, (%r15)
je 0x2e49b
movq %r15, (%r14)
movq %r15, %rdi
callq 0x4120
addq %r15, %rax
movq %rax, 0x40(%r14)
jmp 0x2e4c4
movq $0x0, (%r14)
cmpb $0x0, (%r15)
jne 0x2e4cc
jmp 0x2e4c4
movq 0x28(%r14), %rdx
movq 0x30(%r14), %rcx
decq %rdx
cmpq %rdx, %rcx
jae 0x2e4c0
movq 0x20(%r14), %rax
movq 0x8(%rax,%rcx,8), %rax
movq %rax, (%r14)
incq %rcx
movq %rcx, 0x30(%r14)
jmp 0x2e4c4
testb %al, %al
je 0x2e4d4
movq %r14, %rdi
callq 0x2e3ac
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x480e
jmp 0x2e4c4
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/extracters/dbtap/tapeio.c
// Function: OpenTapeForRead
int OpenTapeForRead(
  char *name
)
{
  if ((tfile = fopen(name, "r")) != NULL) {
    int status;

    status = verifyFormat();
    rewind(tfile);
    if ((status != TIO_SUCCESS) && (status != TIO_ERROR))
      CloseTape();
    return status;
  }
  return TIO_OPENFAIL;
}

// Assembly:
pushq %rbx
leaq 0x194a(%rip), %rsi      # 0x34ba
callq 0x1190
movq %rax, 0x36a4(%rip)      # 0x5220
testq %rax, %rax
je 0x1bbb
callq 0x1bc4
movl %eax, %ebx
movq 0x3691(%rip), %rdi      # 0x5220
callq 0x10f0
movl %ebx, %eax
decl %eax
cmpl $-0x3, %eax
ja 0x1bc0
movq 0x367c(%rip), %rdi      # 0x5220
testq %rdi, %rdi
je 0x1bae
callq 0x10b0
movq $0x0, 0x3667(%rip) # 0x5220
jmp 0x1bc0
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/extracters/dbtap/tapeio.c
// Function: OpenTapeForWrite
int OpenTapeForWrite(
  char *name
)
{
  /*
   * Fail if the file exists
   */
  if (access(name, F_OK) == 0)
    return TIO_CREATEFAIL;

  if ((tfile = fopen(name, "w+")) != NULL) {
    uint32 tm = 0;
    int status = TIO_SUCCESS;

    /*
     * Write 2 tape marks
     */
    if (fwrite(&tm, sizeof(tm), 2, tfile) != 2)
      status = TIO_IOERROR;

    if (status == TIO_SUCCESS) {
      rewind(tfile);
      return TIO_SUCCESS;
    }

    /*
     * Failed to write the 2 tape marks. Try to delete the file before
     * returning an error.
     */
    CloseTape();
    unlink(name);
    return TIO_IOERROR;
  }
  return TIO_CREATEFAIL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0x1180
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x1e00
leaq 0x16fc(%rip), %rsi      # 0x3493
movq %rbx, %rdi
callq 0x1190
movq %rax, 0x347a(%rip)      # 0x5220
testq %rax, %rax
je 0x1e00
leaq 0x4(%rsp), %rdi
movl $0x0, (%rdi)
movl $0x4, %esi
movl $0x2, %edx
movq %rax, %rcx
callq 0x11e0
movq 0x3451(%rip), %rdi      # 0x5220
cmpq $0x2, %rax
jne 0x1dde
callq 0x10f0
xorl %ebp, %ebp
jmp 0x1e00
testq %rdi, %rdi
je 0x1de8
callq 0x10b0
movq $0x0, 0x342d(%rip) # 0x5220
movq %rbx, %rdi
callq 0x1060
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/extracters/dbtap/tapeio.c
// Function: OpenTapeForAppend
int OpenTapeForAppend(
  char *name
)
{
  if ((tfile =fopen(name, "r+")) != NULL) {
    int status;

    status = verifyFormat();
    if ((status != TIO_SUCCESS) && (status != TIO_ERROR))
      CloseTape();
    return status;
  }
  return TIO_OPENFAIL;
}

// Assembly:
pushq %rbx
leaq 0x1685(%rip), %rsi      # 0x3496
callq 0x1190
movq %rax, 0x3403(%rip)      # 0x5220
testq %rax, %rax
je 0x1e4e
callq 0x1bc4
movl %eax, %ebx
decl %eax
cmpl $-0x3, %eax
ja 0x1e53
movq 0x33e9(%rip), %rdi      # 0x5220
testq %rdi, %rdi
je 0x1e41
callq 0x10b0
movq $0x0, 0x33d4(%rip) # 0x5220
jmp 0x1e53
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/extracters/dbtap/tapeio.c
// Function: ReadTapeRecord
uint32 ReadTapeRecord(
  void *buf,
  int len
)
{
  long pos = ftell(tfile);
  uint8 meta[4];
  uint32 bc, erflag, length;

  /*
   * Note: any I/O errors are treated as "end of medium" detection.
   */
  if (fread(meta, sizeof(meta), 1, tfile) != 1)
    return ST_EOM;

  bc = (((unsigned int)meta[3]) << 24) |
       (((unsigned int)meta[2]) << 16) |
       (((unsigned int)meta[1]) << 8) |
       (unsigned int)meta[0];

  switch (bc) {
    case ST_EOM:
    case ST_TM:
      return bc;

    default:
      erflag = bc & ST_ERROR;
      bc &= ST_LENGTH;

      length = (uint32)len;
      if (bc < length)
        length = bc;

      if (fread(buf, sizeof(uint8), length, tfile) != length)
        return ST_EOM;

      /*
       * Now position the file after this record.
       */
      pos += RECLEN(bc) + (2 * sizeof(meta));
      if (fseek(tfile, pos, SEEK_SET) != 0)
        return ST_EOM;

      return erflag | length;
  }
  return ST_EOM;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
movq 0x33b2(%rip), %rdi      # 0x5220
callq 0x1130
movq %rax, %r14
movq 0x33a3(%rip), %rcx      # 0x5220
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x10a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x1, %rax
jne 0x1ec8
movzbl 0x7(%rsp), %r12d
shll $0x18, %r12d
movzbl 0x6(%rsp), %eax
shll $0x10, %eax
movzwl 0x4(%rsp), %r13d
orl %eax, %r13d
leal (%r12,%r13), %eax
incl %eax
cmpl $0x2, %eax
jae 0x1ed9
orl %r12d, %r13d
movl %r13d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %ebx, %r13d
cmovbl %r13d, %ebx
movq 0x3339(%rip), %rcx      # 0x5220
movl $0x1, %esi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x10a0
cmpq %rbx, %rax
jne 0x1ec8
andl $0x80000000, %r12d      # imm = 0x80000000
incl %r13d
andl $-0x2, %r13d
leaq (%r14,%r13), %rsi
addq $0x8, %rsi
movq 0x3307(%rip), %rdi      # 0x5220
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x1170
orl %r12d, %ebx
negl %eax
sbbl %ebp, %ebp
orl %ebx, %ebp
jmp 0x1ec8
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/extracters/dbtap/tapeio.c
// Function: ReadTapeRecordLength
uint32 ReadTapeRecordLength(void)
 {
   long pos = ftell(tfile);
   uint8 meta[4];
   uint32 bc, erflag;

   /*
    * Note: any I/O errors are treated as "end of medium" detection.
    */
   if (fread(meta, sizeof(meta), 1, tfile) != 1)
     return ST_EOM;

   bc = (((unsigned int)meta[3]) << 24) |
        (((unsigned int)meta[2]) << 16) |
        (((unsigned int)meta[1]) << 8) |
        (unsigned int)meta[0];

   switch (bc) {
     case ST_EOM:
     case ST_TM:
       return bc;

     default:
       erflag = bc & ST_ERROR;
       bc &= ST_LENGTH;

       /*
        * Now position the file after this record.
        */
       pos += RECLEN(bc) + (2 * sizeof(meta));
       if (fseek(tfile, pos, SEEK_SET) != 0)
         return ST_EOM;

       return erflag | bc;
   }
   return ST_EOM;
 }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x32e4(%rip), %rdi      # 0x5220
callq 0x1130
movq %rax, %r14
movq 0x32d5(%rip), %rcx      # 0x5220
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x10a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x1, %rax
jne 0x1fba
movzbl 0x7(%rsp), %r15d
shll $0x18, %r15d
movzwl 0x5(%rsp), %eax
shll $0x8, %eax
movzbl 0x4(%rsp), %r12d
orl %eax, %r12d
leal (%r15,%r12), %eax
incl %eax
cmpl $0x2, %eax
jae 0x1f98
orl %r15d, %r12d
movl %r12d, %ebx
jmp 0x1fba
leal 0x1(%r12), %eax
andl $-0x2, %eax
leaq (%rax,%r14), %rsi
addq $0x8, %rsi
movq 0x3271(%rip), %rdi      # 0x5220
xorl %edx, %edx
callq 0x1170
testl %eax, %eax
je 0x1fc8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
andl $0x80000000, %r15d      # imm = 0x80000000
jmp 0x1f90