LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: integrity_walker
static void integrity_walker(void* ptr, size_t size, int used, void* user)
{
	block_header_t* block = block_from_ptr(ptr);
	integrity_t* integ = tlsf_cast(integrity_t*, user);
	const int this_prev_status = block_is_prev_free(block) ? 1 : 0;
	const int this_status = block_is_free(block) ? 1 : 0;
	const size_t this_block_size = block_size(block);

	int status = 0;

	if(integ->prev_status != this_prev_status) {
		fprintf(stderr, "%p ps %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	if(size != this_block_size) {
		fprintf(stderr, "%p size %d != %d\n", ptr,
		    integ->prev_status, this_prev_status);
		fail(ptr);
	}

	tlsf_insist(integ->prev_status == this_prev_status && "prev status incorrect");
	tlsf_insist(size == this_block_size && "block size incorrect");

	integ->prev_status = this_status;
	integ->status += status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq -0x8(%rdi), %r12
movl %r12d, %ebp
shrl %ebp
andl $0x1, %ebp
movq %r12, %r13
andq $-0x4, %r13
movl (%rcx), %ecx
cmpl %ebp, %ecx
jne 0x21c0e
cmpq %r14, %r13
jne 0x21c2e
cmpl %ebp, (%rbx)
jne 0x21c50
cmpq %r14, %r13
jne 0x21c6f
andl $0x1, %r12d
movl %r12d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc3db(%rip), %rax      # 0x2dff0
movq (%rax), %rdi
leaq 0x68bf(%rip), %rsi      # 0x284de
movq %r15, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3320
jmp 0x21bea
movq 0xc3bb(%rip), %rax      # 0x2dff0
movq (%rax), %rdi
movl (%rbx), %ecx
leaq 0x68ad(%rip), %rsi      # 0x284ee
movq %r15, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3320
jmp 0x21bef
leaq 0x68a9(%rip), %rdi      # 0x28500
leaq 0x65bc(%rip), %rsi      # 0x2821a
leaq 0x68dd(%rip), %rcx      # 0x28542
movl $0x287, %edx            # imm = 0x287
callq 0x31e0
leaq 0x68ff(%rip), %rdi      # 0x28575
leaq 0x659d(%rip), %rsi      # 0x2821a
leaq 0x68be(%rip), %rcx      # 0x28542
movl $0x288, %edx            # imm = 0x288
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: tlsf_malloc
void* tlsf_malloc(tlsf_pool tlsf, size_t size)
{
	pool_t* pool = tlsf_cast(pool_t*, tlsf);
	const size_t adjust = adjust_request_size(size, ALIGN_SIZE);
	block_header_t* block = block_locate_free(pool, adjust);
	return block_prepare_used(pool, block, adjust);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x1(%rsi), %rax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmpq %rcx, %rax
ja 0x21f06
addq $0x7, %rsi
movabsq $0x1fffffff8, %rax      # imm = 0x1FFFFFFF8
andq %rsi, %rax
cmpq $0x19, %rax
movl $0x18, %r14d
cmovaeq %rax, %r14
jmp 0x21f09
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21f79
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x220a8
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: adjust_request_size
static size_t adjust_request_size(size_t size, size_t align)
{
	size_t adjust = 0;
	if (size && size < block_size_max)
	{
		const size_t aligned = align_up(size, align);
		adjust = tlsf_max(aligned, block_size_min);
	}
	return adjust;
}

// Assembly:
decq %rdi
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpq %rax, %rdi
ja 0x21f56
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x21f59
addq %rsi, %rdi
negq %rsi
andq %rdi, %rsi
cmpq $0x19, %rsi
movl $0x18, %eax
cmovaeq %rsi, %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x66aa(%rip), %rdi      # 0x2860b
leaq 0x62b2(%rip), %rsi      # 0x2821a
leaq 0x67e1(%rip), %rcx      # 0x28750
movl $0x115, %edx            # imm = 0x115
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_locate_free
static block_header_t* block_locate_free(pool_t* pool, size_t size)
{
	int fl = 0, sl = 0;
	block_header_t* block = 0;

	if (size)
	{
		mapping_search(size, &fl, &sl);
		block = search_suitable_block(pool, &fl, &sl);
	}

	if (block)
	{
		tlsf_assert(block_size(block) >= size);
		remove_free_block(pool, block, fl, sl);
	}

	return block;
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x21fc3
movq %rsi, %rax
cmpq $0x20, %rsi
jb 0x21fb4
xorl %eax, %eax
movq %rsi, %rcx
shrq $0x20, %rcx
cmovel %esi, %ecx
setne %al
shll $0x5, %eax
orl $0x1f, %eax
bsrl %ecx, %ecx
xorl %eax, %ecx
xorl $0x1f, %ecx
addb $-0x5, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
notl %eax
addq %rsi, %rax
cmpq $0xff, %rax
ja 0x21fcb
shrl $0x3, %eax
xorl %edx, %edx
jmp 0x21ff4
xorl %edx, %edx
xorl %eax, %eax
xorl %ebx, %ebx
jmp 0x22049
xorl %ecx, %ecx
movq %rax, %rdx
shrq $0x20, %rdx
setne %cl
cmovel %eax, %edx
shll $0x5, %ecx
orl $0x1f, %ecx
bsrl %edx, %edx
xorl %ecx, %edx
xorl $0x1f, %edx
leal -0x5(%rdx), %ecx
shrq %cl, %rax
xorl $0x20, %eax
addl $-0x7, %edx
movslq %edx, %rcx
movl 0x24(%rdi,%rcx,4), %r8d
movl %eax, %ecx
shrl %cl, %r8d
shll %cl, %r8d
testl %r8d, %r8d
jne 0x2202e
movl 0x20(%rdi), %r9d
leal 0x1(%rdx), %ecx
shrl %cl, %r9d
shll %cl, %r9d
testl %r9d, %r9d
je 0x22026
bsfl %r9d, %edx
movl 0x24(%rdi,%rdx,4), %r8d
jmp 0x22029
xorl %r8d, %r8d
testl %r9d, %r9d
je 0x21fc7
testl %r8d, %r8d
je 0x22089
bsfl %r8d, %eax
movslq %edx, %rcx
shlq $0x8, %rcx
addq %rdi, %rcx
movq 0x88(%rcx,%rax,8), %rbx
testq %rbx, %rbx
je 0x22065
movq 0x8(%rbx), %rcx
andq $-0x4, %rcx
cmpq %rsi, %rcx
jb 0x2206a
movq %rbx, %rsi
movl %eax, %ecx
callq 0x225a3
movq %rbx, %rax
popq %rbx
retq
leaq 0x66ff(%rip), %rdi      # 0x28770
leaq 0x61a2(%rip), %rsi      # 0x2821a
leaq 0x670b(%rip), %rcx      # 0x2878a
movl $0x238, %edx            # imm = 0x238
callq 0x31e0
leaq 0x672e(%rip), %rdi      # 0x287be
leaq 0x6183(%rip), %rsi      # 0x2821a
leaq 0x6759(%rip), %rcx      # 0x287f7
movl $0x171, %edx            # imm = 0x171
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_prepare_used
static void* block_prepare_used(pool_t* pool, block_header_t* block, size_t size)
{
	void* p = 0;
	if (block)
	{
		block_trim_free(pool, block, size);
		block_mark_as_used(block);
		p = block_to_ptr(block);
	}
	return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x22101
movq %rsi, %rbx
movq 0x8(%rsi), %rax
testb $0x1, %al
je 0x2210c
andq $-0x4, %rax
leaq 0x20(%rdx), %rcx
cmpq %rcx, %rax
jb 0x220f3
movq %rdi, %r14
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x22647
movq %rax, %r15
movq %rbx, %rdi
callq 0x21e96
orb $0x2, 0x8(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d85
movq %rbx, %rdi
callq 0x2256b
addq $0x10, %rbx
jmp 0x22103
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x67b3(%rip), %rdi      # 0x288c6
leaq 0x6100(%rip), %rsi      # 0x2821a
leaq 0x67d2(%rip), %rcx      # 0x288f3
movl $0x202, %edx            # imm = 0x202
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: tlsf_free
void tlsf_free(tlsf_pool tlsf, void* ptr)
{
	/* Don't attempt to free a NULL pointer. */
	if (ptr)
	{
		pool_t* pool = tlsf_cast(pool_t*, tlsf);
		block_header_t* block = block_from_ptr(ptr);
		block_mark_as_free(block);
		block = block_merge_prev(pool, block);
		block = block_merge_next(pool, block);
		block_insert(pool, block);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x222c5
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x10(%rsi), %r14
movq %r14, %rdi
callq 0x21e96
orb $0x2, 0x8(%rax)
movq -0x8(%r15), %rax
movq %rax, %rcx
orq $0x1, %rcx
movq %rcx, -0x8(%r15)
testb $0x2, %al
jne 0x222cb
movq %r14, %r15
jmp 0x222f0
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %r15
testq %r15, %r15
je 0x2230b
testb $0x1, 0x8(%r15)
je 0x2232a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x226ef
movq %r15, %rdi
movq %r14, %rsi
callq 0x2273f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22349
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x21d85
leaq 0x6735(%rip), %rdi      # 0x28a47
leaq 0x5f01(%rip), %rsi      # 0x2821a
leaq 0x6753(%rip), %rcx      # 0x28a73
movl $0x1e6, %edx            # imm = 0x1E6
callq 0x31e0
leaq 0x677f(%rip), %rdi      # 0x28ab0
leaq 0x5ee2(%rip), %rsi      # 0x2821a
leaq 0x6734(%rip), %rcx      # 0x28a73
movl $0x1e7, %edx            # imm = 0x1E7
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_merge_next
static block_header_t* block_merge_next(pool_t* pool, block_header_t* block)
{
	block_header_t* next = block_next(block);
	tlsf_assert(next && "next physical block can't be null");

	if (block_is_free(next))
	{
		tlsf_assert(!block_is_last(block) && "previous block can't be last!");
		block_remove(pool, next);
		block = block_absorb(block, next);
	}

	return block;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r14
cmpq $0x3, %r14
jbe 0x2238c
movq %rsi, %rbx
andq $-0x4, %r14
addq %rsi, %r14
addq $0x8, %r14
je 0x223ab
testb $0x1, 0x8(%r14)
je 0x22381
movq %r14, %rsi
callq 0x226ef
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2273f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x6214(%rip), %rdi      # 0x285a7
leaq 0x5e80(%rip), %rsi      # 0x2821a
leaq 0x621c(%rip), %rcx      # 0x285bd
movl $0xf8, %edx
callq 0x31e0
leaq 0x67bd(%rip), %rdi      # 0x28b6f
leaq 0x5e61(%rip), %rsi      # 0x2821a
leaq 0x67db(%rip), %rcx      # 0x28b9b
movl $0x1f3, %edx            # imm = 0x1F3
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: remove_free_block
static void remove_free_block(pool_t* pool, block_header_t* block, int fl, int sl)
{
	block_header_t* prev = block->prev_free;
	block_header_t* next = block->next_free;
	tlsf_assert(prev && "prev_free field can not be null");
	tlsf_assert(next && "next_free field can not be null");
	next->prev_free = prev;
	prev->next_free = next;

	/* If this block is the head of the free list, set new head. */
	if (pool->blocks[fl][sl] == block)
	{
		pool->blocks[fl][sl] = next;

		/* If the new head is null, clear the bitmap. */
		if (next == &pool->block_null)
		{
			pool->sl_bitmap[fl] &= ~(1 << sl);

			/* If the second bitmap is now empty, clear the fl bitmap. */
			if (!pool->sl_bitmap[fl])
			{
				pool->fl_bitmap &= ~(1 << fl);
			}
		}
	}
}

// Assembly:
pushq %rax
movq 0x18(%rsi), %rax
testq %rax, %rax
je 0x22609
movq 0x10(%rsi), %r8
testq %r8, %r8
je 0x22628
movq %rax, 0x18(%r8)
movq %r8, 0x10(%rax)
movslq %edx, %rax
movq %rax, %r9
shlq $0x8, %r9
addq %rdi, %r9
movslq %ecx, %r10
cmpq %rsi, 0x88(%r9,%r10,8)
jne 0x22607
leaq (%r9,%r10,8), %rsi
addq $0x88, %rsi
movq %r8, (%rsi)
cmpq %rdi, %r8
jne 0x22607
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
roll %cl, %r8d
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
andl %r8d, 0x24(%rdi,%rax,4)
jne 0x22607
movl %edx, %ecx
roll %cl, %esi
andl %esi, 0x20(%rdi)
popq %rax
retq
leaq 0x6225(%rip), %rdi      # 0x28835
leaq 0x5c03(%rip), %rsi      # 0x2821a
leaq 0x6241(%rip), %rcx      # 0x2885f
movl $0x17e, %edx            # imm = 0x17E
callq 0x31e0
leaq 0x626d(%rip), %rdi      # 0x2889c
leaq 0x5be4(%rip), %rsi      # 0x2821a
leaq 0x6222(%rip), %rcx      # 0x2885f
movl $0x17f, %edx            # imm = 0x17F
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_split
static block_header_t* block_split(block_header_t* block, size_t size)
{
	/* Calculate the amount of space left in the remaining block. */
	block_header_t* remaining =
		offset_to_block(block_to_ptr(block), size - block_header_overhead);

	const size_t remain_size = block_size(block) - (size + block_header_overhead);

	tlsf_assert(block_to_ptr(remaining) == align_ptr(block_to_ptr(remaining), ALIGN_SIZE)
		&& "remaining block not aligned properly");

	tlsf_assert(block_size(block) == remain_size + size + block_header_overhead);
	block_set_size(remaining, remain_size);
	tlsf_assert(block_size(remaining) >= block_size_min && "block split with invalid size");

	block_set_size(block, size);
	block_mark_as_free(remaining);

	return remaining;
}

// Assembly:
pushq %rbx
leaq (%rdi,%rsi), %rax
addq $0x18, %rax
leaq (%rdi,%rsi), %rcx
addq $0x1f, %rcx
andq $-0x8, %rcx
cmpq %rcx, %rax
jne 0x226b1
movq 0x8(%rdi), %rax
andq $-0x4, %rax
subq %rsi, %rax
addq $-0x8, %rax
movq 0x10(%rdi,%rsi), %rcx
andl $0x3, %ecx
orq %rax, %rcx
movq %rcx, 0x10(%rdi,%rsi)
cmpq $0x17, %rax
jbe 0x226d0
leaq (%rdi,%rsi), %rbx
addq $0x8, %rbx
movq 0x8(%rdi), %rax
andl $0x3, %eax
orq %rsi, %rax
movq %rax, 0x8(%rdi)
movq %rbx, %rdi
callq 0x21e96
orb $0x2, 0x8(%rax)
orb $0x1, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x6274(%rip), %rdi      # 0x2892c
leaq 0x5b5b(%rip), %rsi      # 0x2821a
leaq 0x62da(%rip), %rcx      # 0x289a0
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x31e0
leaq 0x62ff(%rip), %rdi      # 0x289d6
leaq 0x5b3c(%rip), %rsi      # 0x2821a
leaq 0x62bb(%rip), %rcx      # 0x289a0
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/cogbee[P]vmir-latest/tlsf/tlsf.c
// Function: block_absorb
static block_header_t* block_absorb(block_header_t* prev, block_header_t* block)
{
	tlsf_assert(!block_is_last(prev) && "previous block can't be last!");
	/* Note: Leaves flags untouched. */
	prev->size += block_size(block) + block_header_overhead;
	block_link_next(prev);
	return prev;
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rax
cmpq $0x3, %rax
jbe 0x2276a
movq %rdi, %rbx
movq 0x8(%rsi), %rcx
andq $-0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, 0x8(%rdi)
callq 0x21e96
movq %rbx, %rax
popq %rbx
retq
leaq 0x6385(%rip), %rdi      # 0x28af6
leaq 0x5aa2(%rip), %rsi      # 0x2821a
leaq 0x63af(%rip), %rcx      # 0x28b2e
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x31e0
// File: /workspace/github_c_makefile_star2_O1/darkautism[P]lfqueue/example.c
// Function: main
int main() {
	long ret;
	struct lfq_ctx ctx;
	lfq_init(&ctx, 1);
	lfq_enqueue(&ctx,(void *)1);
	lfq_enqueue(&ctx,(void *)3);
	lfq_enqueue(&ctx,(void *)5);
	lfq_enqueue(&ctx,(void *)8);
	lfq_enqueue(&ctx,(void *)4);
	lfq_enqueue(&ctx,(void *)6);
	
	while ( (ret = (long)lfq_dequeue(&ctx)) != 0 )
		printf("lfq_dequeue %ld\n", ret);
	
	lfq_clean(&ctx);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
andq $-0x40, %rsp
subq $0xc0, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1220
movl $0x1, %esi
movq %rbx, %rdi
callq 0x14cc
movl $0x3, %esi
movq %rbx, %rdi
callq 0x14cc
movl $0x5, %esi
movq %rbx, %rdi
callq 0x14cc
movl $0x8, %esi
movq %rbx, %rdi
callq 0x14cc
movl $0x4, %esi
movq %rbx, %rdi
callq 0x14cc
movl $0x6, %esi
movq %rbx, %rdi
callq 0x14cc
movq %rbx, %rdi
callq 0x156a
testq %rax, %rax
je 0x120d
leaq 0xe14(%rip), %rbx       # 0x2004
movq %rsp, %r14
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x156a
testq %rax, %rax
jne 0x11f3
movq %rsp, %rdi
callq 0x12f3
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: timing_beh
BEH_DECL(timing_beh)
{
	char* s;

	DBUG_ENTER("timing_beh");
	s = cons_to_str(NOW);
	DBUG_PRINT("", ("[timestamp] %s", s));
	fprintf(stderr, "[timestamp] %s\n", s);
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xbdc1(%rip), %rax      # 0xe004
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x110a6(%rip), %r15     # 0x132f8
movq (%r15), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x19, 0xc(%rdi)
leaq 0xdb17(%rip), %r14      # 0xfd84
movq %r14, 0x10(%rdi)
leaq 0x10ea8(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xcd72
movq 0x50(%rbx), %rdi
movq 0x58(%rbx), %rsi
callq 0x349b
movq %rax, %rdi
callq 0x4ffc
movq %rax, %rbx
leaq 0x115fc(%rip), %rax     # 0x138a0
cmpl $0x0, (%rax)
je 0x22df
movq (%r15), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0xc4e4
testl %eax, %eax
je 0x22df
movq (%r15), %rax
movq 0x50(%rax), %rax
movl $0x1b, 0xc(%rax)
leaq 0xbd3a(%rip), %rdi      # 0xe00f
movq %rbx, %rsi
xorl %eax, %eax
callq 0xcde3
movq 0x10d12(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
leaq 0xbd2e(%rip), %rsi      # 0xe01e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2160
leaq 0x8(%rsp), %rdi
movl $0x1d, 0xc(%rdi)
callq 0xcef7
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: countdown_ring_0_beh
BEH_DECL(countdown_ring_0_beh)
{
	CONS* m = WHAT;
	CONS* first = MINE;
	int m_int = MK_INT(m);

	DBUG_ENTER("countdown_ring_0_beh");
	if (m_int <= 0) {
		BECOME(sink_beh, NIL);
		SEND(timing_actor, NIL);
	} else {
		SEND(first, NUMBER(m_int - 1));
	}
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xb0a5
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0xb006
movq %rax, %rdi
callq 0x3171
movq %rax, %r15
movq %r14, %r12
shrq $0x2, %r12
leaq 0xb7a6(%rip), %rax      # 0xe02e
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x10a63(%rip), %rax     # 0x132f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x2f, 0xc(%rdi)
leaq 0xd4d4(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%rdi)
leaq 0x10865(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xcd72
testl %r12d, %r12d
jle 0x28e9
movabsq $0x3fffffffc, %rax      # imm = 0x3FFFFFFFC
addq %rax, %r14
andq %rax, %r14
orq $0x3, %r14
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x2915
movq 0x30(%rbx), %rdi
callq 0xb006
leaq 0x8ab(%rip), %rsi       # 0x31a4
leaq 0x10968(%rip), %r14     # 0x13268
movq %rax, %rdi
movq %r14, %rdx
callq 0x3380
movq 0x10a36(%rip), %rsi     # 0x13348
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3d77
movq %rsp, %rdi
movl $0x36, 0xc(%rdi)
callq 0xcef7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: countdown_ring_beh
BEH_DECL(countdown_ring_beh)
{
	CONS* m = WHAT;
	CONS* next = MINE;

	DBUG_ENTER("countdown_ring_beh");
	SEND(next, m);
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xb0a5
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0xb006
movq %rax, %rdi
callq 0x3171
movq %rax, %r15
leaq 0xb6d6(%rip), %rax      # 0xe043
movq %rsp, %r12
movq %rax, (%r12)
leaq 0x1097d(%rip), %rax     # 0x132f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%r12)
movl $0x43, 0xc(%r12)
leaq 0xd3ea(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%r12)
leaq 0x1077a(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%r12)
movq %rax, 0x20(%r12)
movq %r12, %rdi
callq 0xcd72
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3d77
movl $0x45, 0xc(%r12)
movq %r12, %rdi
callq 0xcef7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: ring_link_beh
BEH_DECL(ring_link_beh)
{
	CONS* next = MINE;
	CONS* first = WHAT;

	DBUG_ENTER("countdown_ring_beh");
	SEND(next, first);
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xb006
movq %rax, %rdi
callq 0x3171
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0xb0a5
movq %rax, %r15
leaq 0xb3c5(%rip), %rax      # 0xe043
movq %rsp, %r12
movq %rax, (%r12)
leaq 0x1066c(%rip), %rax     # 0x132f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%r12)
movl $0x82, 0xc(%r12)
leaq 0xd0d9(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%r12)
leaq 0x10469(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%r12)
movq %rax, 0x20(%r12)
movq %r12, %rdi
callq 0xcd72
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3d77
movl $0x84, 0xc(%r12)
movq %r12, %rdi
callq 0xcef7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: ring_seed_beh
BEH_DECL(ring_seed_beh)
{
	static int thresh = 1 << 10;
	CONS* n = MINE;
	CONS* first = WHAT;
	CONS* next;
	int n_int = MK_INT(n);

	DBUG_ENTER("ring_seed_beh");
	if (n_int >= thresh) {
		thresh <<= 1;
		TRACE(fprintf(stderr, "%d:", n_int));
		SEND(timing_actor, NIL);
	}
	next = ACTOR(ring_seed_beh, NUMBER(n_int + 1));
	BECOME(ring_link_beh, next);
	SEND(first, first);
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xb006
movq %rax, %rdi
callq 0x3171
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb0a5
movq %rax, %r14
shrq $0x2, %r15
leaq 0xb3ad(%rip), %rax      # 0xe0d8
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x105be(%rip), %rax     # 0x132f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x96, 0xc(%rdi)
leaq 0xd02f(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%rdi)
leaq 0x103c0(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xcd72
movl 0x103bd(%rip), %edi     # 0x13130
cmpl %r15d, %edi
jle 0x2de7
shlq $0x20, %r15
movabsq $0x100000000, %rdx      # imm = 0x100000000
addq %r15, %rdx
sarq $0x1e, %rdx
orq $0x3, %rdx
leaq -0xa4(%rip), %rsi       # 0x2cf4
movq %rbx, %rdi
callq 0x3c9a
movq %rax, %r15
movq 0x30(%rbx), %rdi
callq 0xb006
leaq -0x16a(%rip), %rsi      # 0x2c49
movq %rax, %rdi
movq %r15, %rdx
callq 0x3380
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x3d77
leaq 0x8(%rsp), %rdi
movl $0x9f, 0xc(%rdi)
callq 0xcef7
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %r15d, %esi
movq %rbx, %rdx
callq 0x2315
jmp 0x2d78
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: erlang_challenge
void
erlang_challenge(int n, int m)
{
	CONFIG* cfg;
	int cnt;

	DBUG_ENTER("erlang_challenge");
	cfg = new_configuration(10);
	timing_actor = CFG_ACTOR(cfg, timing_beh, NIL);
	if (n <= 0) {
		CONS* ring;

		TRACE(printf("Seeding unbounded growth message ring.\n"));
		ring = CFG_ACTOR(cfg, ring_seed_beh, NUMBER(0));
		CFG_SEND(cfg, ring, ring);
	} else {
		CONS* countdown;

		TRACE(printf("Sending %d messages around a ring of %d processes.\n", m, n));
		countdown = CFG_ACTOR(cfg, countdown_builder_beh, NUMBER(n));
		CFG_SEND(cfg, countdown, cons(countdown, NUMBER(m)));
	}
	CFG_SEND(cfg, timing_actor, NIL);
	for (cnt = 1; cnt < 1000000; ++cnt) {
		int max = 1000000;
		int rem;

		rem = run_configuration(cfg, max);
/*		TRACE(printf("+ %d messages...\n", (max - rem))); */
		TRACE(fputc('.', stderr));
		if (cfg->q_count <= 0) {
			/* queue empty */
			break;
		}
	}
	TRACE(printf("< %dM messages delivered.\n", cnt));
	report_actor_usage(cfg);
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebp
movl %edi, %r14d
leaq 0xb2e2(%rip), %rax      # 0xe0ea
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x104e1(%rip), %rax     # 0x132f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0xb1, 0xc(%rdi)
leaq 0xcf52(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%rdi)
leaq 0x102e3(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xcd72
movl $0xa, %edi
callq 0x35bf
movq %rax, %rbx
leaq -0xc2e(%rip), %rsi      # 0x2230
leaq 0x10403(%rip), %rdx     # 0x13268
movq %rax, %rdi
callq 0x3c9a
movq %rax, 0x104d4(%rip)     # 0x13348
testl %r14d, %r14d
jle 0x2ec4
leaq 0xb27b(%rip), %rdi      # 0xe0fb
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20e0
movl %r14d, %eax
leaq 0x3(,%rax,4), %rdx
leaq -0x4bb(%rip), %rsi      # 0x29e3
movq %rbx, %rdi
callq 0x3c9a
movq %rax, %r14
movslq %ebp, %rax
leaq 0x3(,%rax,4), %rsi
movq %r14, %rdi
callq 0xafe4
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x2eea
leaq 0xb2d7(%rip), %rdi      # 0xe1a2
callq 0x20a0
leaq -0x1e3(%rip), %rsi      # 0x2cf4
movl $0x3, %edx
movq %rbx, %rdi
callq 0x3c9a
movq %rbx, %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x3d77
movq 0x1044f(%rip), %rsi     # 0x13348
leaq 0x10368(%rip), %rdx     # 0x13268
movq %rbx, %rdi
callq 0x3d77
movl $0x1, %ebp
movq 0x100e4(%rip), %r14     # 0x12ff8
movq %rbx, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x43bf
movq (%r14), %rsi
movl $0x2e, %edi
callq 0x2120
cmpl $0x0, 0x28(%rbx)
jle 0x2f43
incl %ebp
cmpl $0xf4240, %ebp          # imm = 0xF4240
jne 0x2f14
movl $0xf4240, %ebp          # imm = 0xF4240
leaq 0xb1e5(%rip), %rdi      # 0xe12f
movl %ebp, %esi
xorl %eax, %eax
callq 0x20e0
movq %rbx, %rdi
callq 0x4f3b
leaq 0x8(%rsp), %rdi
movl $0xd0, 0xc(%rdi)
callq 0xcef7
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/echallenge.c
// Function: main
int
main(int argc, char** argv)
{
	int c;
	int n = 0;
	int m = 100;

	DBUG_ENTER("main");
	DBUG_PROCESS(argv[0]);
	while ((c = getopt(argc, argv, "n:m:#:V")) != EOF) {
		switch(c) {
		case 'n':	n = atoi(optarg);		break;
		case 'm':	m = atoi(optarg);		break;
		case '#':	DBUG_PUSH(optarg);		break;
		case 'V':	banner();				exit(EXIT_SUCCESS);
		case '?':							usage();
		default:							usage();
		}
	}
	banner();

	erlang_challenge(n, m);	/* this test involves running the dispatch loop */

	report_cons_stats();
	DBUG_RETURN (exit(EXIT_SUCCESS), 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xb19e(%rip), %rax      # 0xe18a
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x102fd(%rip), %r13     # 0x132f8
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0xf0, 0xc(%rdi)
leaq 0xcd6d(%rip), %rcx      # 0xfd84
movq %rcx, 0x10(%rdi)
leaq 0x100fe(%rip), %rcx     # 0x13120
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0xcd72
movq (%r13), %rax
movq 0x18(%rax), %rcx
movq 0xffba(%rip), %rdx      # 0x12ff8
testq %rcx, %rcx
jne 0x3046
movq (%rdx), %rcx
movq %rcx, 0x18(%rax)
callq 0x20b0
movq (%r13), %rcx
movl %eax, 0x10(%rcx)
movq (%rbx), %rax
movq %rax, 0x8(%rcx)
movl $0x64, 0xc(%rsp)
xorl %r15d, %r15d
leaq 0xb120(%rip), %r12      # 0xe18f
movq 0xff62(%rip), %r14      # 0x12fd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x21b0
cmpl $0x23, %eax
jne 0x30a1
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0xf6, 0xc(%rax)
movq (%r14), %rdi
callq 0xc641
jmp 0x3076
cmpl $0x6c, %eax
jle 0x30cb
cmpl $0x6d, %eax
je 0x30bd
cmpl $0x6e, %eax
jne 0x30e1
movq (%r14), %rdi
callq 0x21d0
movl %eax, %r15d
jmp 0x3076
movq (%r14), %rdi
callq 0x21d0
movl %eax, 0xc(%rsp)
jmp 0x3076
cmpl $-0x1, %eax
je 0x310a
cmpl $0x3f, %eax
je 0x30e1
cmpl $0x56, %eax
jne 0x30e1
callq 0x2faf
jmp 0x3131
movq 0xff10(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0xb058(%rip), %rsi      # 0xe14a
leaq 0x1003b(%rip), %rdx     # 0x13134
xorl %eax, %eax
callq 0x2160
movl $0x1, %edi
callq 0x21f0
callq 0x2faf
movl %r15d, %edi
movl 0xc(%rsp), %esi
callq 0x2df4
callq 0x2f75
leaq 0x10(%rsp), %rdi
movl $0x101, 0xc(%rdi)       # imm = 0x101
callq 0xcef7
xorl %edi, %edi
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/rra/rra2wav.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    argIndex = processOptions(argc,argv);

    if (argc-argIndex == 0)
        {
        filter(stdin,stdout);
        }
    else if (argc-argIndex == 1)
        {
        filter(OpenFile(argv[argIndex],"r"),stdout);
        }
    else if (argc-argIndex >= 2 && strstr(argv[argIndex+1],".rra") != 0)
        {
        batch(argc-argIndex,argv+argIndex);
        }
    else if (argc-argIndex == 2)
        {
        filter(OpenFile(argv[argIndex],"r"),OpenFile(argv[argIndex+1],"w"));
        }
    else
        {
        printf("usage: rra2wav [<input rra file> [<output wav file>]]\n");
        printf("       rra2wav <input rra file1> <input rra file2> ...\n");
        exit(-1);
        }

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1de5
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1de5
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x1d80
leaq 0x2(%rsi), %rdi
jmp 0x1d85
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x61, %eax
je 0x1dbe
cmpl $0x73, %eax
je 0x1daf
cmpl $0x76, %eax
je 0x1e97
xorl %r15d, %r15d
leaq 0x32b5(%rip), %rdi      # 0x505b
xorl %eax, %eax
callq 0x2028
jmp 0x1dce
callq 0x1090
movsd %xmm0, 0x63cc(%rip)     # 0x8188
jmp 0x1dcb
callq 0x1090
movsd %xmm0, 0x639d(%rip)     # 0x8168
movb $0x1, %r15b
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x1d65
subl %r12d, %r14d
jne 0x1e00
movq 0x61e7(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
movq 0x61d5(%rip), %rax      # 0x7fd0
movq (%rax), %rsi
jmp 0x1e73
cmpl $0x1, %r14d
jne 0x1e28
movslq %r12d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x3991(%rip), %rsi      # 0x57a5
callq 0x20c2
movq 0x61b0(%rip), %rcx      # 0x7fd0
movq (%rcx), %rsi
movq %rax, %rdi
jmp 0x1e73
movslq %r12d, %r15
jle 0x1e43
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x31d8(%rip), %rsi      # 0x5011
callq 0x1270
testq %rax, %rax
jne 0x1e89
cmpl $0x2, %r14d
jne 0x1eba
movq (%rbx,%r15,8), %rdi
leaq 0x3951(%rip), %rsi      # 0x57a5
callq 0x20c2
movq %rax, %r14
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x31ae(%rip), %rsi      # 0x5016
callq 0x20c2
movq %r14, %rdi
movq %rax, %rsi
callq 0x1edc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%r15,8), %rsi
movl %r14d, %edi
callq 0x12a0
jmp 0x1e78
movq 0x62ba(%rip), %rsi      # 0x8158
movq 0x62bb(%rip), %rdx      # 0x8160
leaq 0x31a0(%rip), %rdi      # 0x504c
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1230
leaq 0x31b4(%rip), %rdi      # 0x5075
callq 0x1070
leaq 0x31de(%rip), %rdi      # 0x50ab
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1230
// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/rra/rra2wav.c
// Function: filter
static void
filter(FILE *in,FILE *out)
    {
    int i,j,amp;
    int skipSamples;
    RRA *h;

    h = newRRAHeader();
    
    readRRAHeader(in,h,0);

    skipSamples = Skip * h->sampleRate;

    writeWaveHeader(out,h->sampleRate,h->channels,
        h->bitsPerSample,h->samples - h->skip - skipSamples);

    amp = readRRAAmplitude(in,out,h->bitsPerSample,discardComment);
    for (i = 0; !feof(in) && i < h->samples; ++i)
        for (j = 0; !feof(in) && j < h->channels; ++j)
            {
            if (i >= (h->skip + skipSamples) * h->channels)
                writeByteInt(out,amp * Amplitude,h->bitsPerSample/8);
            amp = readRRAAmplitude(in,out,h->bitsPerSample,discardComment);
            }

    fclose(in);
    fclose(out);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2eb3
movq %rax, %r15
xorl %r12d, %r12d
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x32c0
movl 0x4(%r15), %esi
cvtsi2sd %esi, %xmm0
mulsd 0x626d(%rip), %xmm0     # 0x8188
movl (%r15), %edx
cvttsd2si %xmm0, %edi
movl 0x8(%r15), %ecx
movl 0xc(%r15), %r8d
movl 0x10(%r15), %eax
movl %edi, -0x34(%rbp)
addl %edi, %eax
subl %eax, %r8d
movq %rbx, %rdi
callq 0x14f5
movl 0x8(%r15), %edx
leaq 0x17ad(%rip), %rcx      # 0x36f6
movq %r14, %rdi
movq %rbx, -0x30(%rbp)
movq %rbx, %rsi
callq 0x37ac
movl %eax, %r13d
movq %r14, %rdi
callq 0x1170
testl %eax, %eax
jne 0x2007
cmpl 0xc(%r15), %r12d
jge 0x2007
movq %r14, %rdi
callq 0x1170
testl %eax, %eax
jne 0x1fff
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl (%r15), %eax
incl %ebx
cmpl %eax, %ebx
jge 0x1fff
movl 0x10(%r15), %ecx
addl -0x34(%rbp), %ecx
imull %eax, %ecx
cmpl %ecx, %r12d
jl 0x1fd9
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
mulsd 0x61ba(%rip), %xmm0     # 0x8168
cvttsd2si %xmm0, %eax
movl 0x8(%r15), %ecx
leal 0x7(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x3, %edx
movl %eax, -0x38(%rbp)
movslq %edx, %rdx
movl $0x1, %esi
leaq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rcx
callq 0x1240
movl 0x8(%r15), %edx
movq %r14, %rdi
movq -0x30(%rbp), %rsi
leaq 0x170b(%rip), %rcx      # 0x36f6
callq 0x37ac
movl %eax, %r13d
movq %r14, %rdi
callq 0x1170
testl %eax, %eax
je 0x1f86
incl %r12d
jmp 0x1f5b
movq %r14, %rdi
callq 0x10a0
movq -0x30(%rbp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
nop
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv11.c
// Function: reconnect
void
reconnect(Ten11 *ten11)
{
	ten11->fd = dial(host, port);
	while (ten11->fd == -1) {
		sleep(5);
		ten11->fd = dial(host, port);
	}
	nodelay(ten11->fd);
	printf("%sconnected to PDP-10\n", re);
	re = "re";
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10882(%rip), %rdi     # 0x13388
movl 0x10884(%rip), %esi     # 0x13390
callq 0x71e6
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
jne 0x2b25
movl $0x5, %edi
callq 0x2310
jmp 0x2aff
movl %eax, %edi
callq 0x72ba
movq 0x1069d(%rip), %rsi     # 0x131d0
leaq 0x54ca(%rip), %rdi      # 0x8004
xorl %eax, %eax
callq 0x20f0
leaq 0x54d3(%rip), %rax      # 0x801b
movq %rax, 0x10681(%rip)     # 0x131d0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv11.c
// Function: dumpmem
void
dumpmem(word start, word end)
{
	start >>= 1;
	end >>= 1;
	for(; start != end; start++)
		printf("%06o: %06o\n", start<<1, memory[start]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
shrl %r14d
shrl %ebx
cmpw %bx, %r14w
je 0x30d9
leaq 0x102ec(%rip), %r12     # 0x133a0
leaq 0x4ff0(%rip), %r15      # 0x80ab
movzwl %r14w, %esi
addl %esi, %esi
movzwl (%rsi,%r12), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x20f0
incl %r14d
cmpw %r14w, %bx
jne 0x30bb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv11.c
// Function: usage
void
usage(void)
{
	fprintf(stderr, "usage: %s [-p port] [-l listenport] [-s time(ms)] [-d] server\n", argv0);
	fprintf(stderr, "\tserver: host running pdp-10\n");
	fprintf(stderr, "\t-p: pdp-10 port; default 1110\n");
	fprintf(stderr, "\t-l: tv11 listen port; default 11100\n");
	fprintf(stderr, "\t-s: sleep (ms); default=0\n");
	fprintf(stderr, "\t-d: write debug log\n");
	exit(0);
}

// Assembly:
pushq %rbx
movq 0xfefb(%rip), %rbx      # 0x12ff8
movq (%rbx), %rdi
movq 0x96df1(%rip), %rdx     # 0x99ef8
leaq 0x4fb7(%rip), %rsi      # 0x80c5
xorl %eax, %eax
callq 0x2190
movq (%rbx), %rcx
leaq 0x4fe5(%rip), %rdi      # 0x8104
movl $0x1d, %esi
movl $0x1, %edx
callq 0x22e0
movq (%rbx), %rcx
leaq 0x4fea(%rip), %rdi      # 0x8122
movl $0x1f, %esi
movl $0x1, %edx
callq 0x22e0
movq (%rbx), %rcx
leaq 0x4ff1(%rip), %rdi      # 0x8142
movl $0x25, %esi
movl $0x1, %edx
callq 0x22e0
movq (%rbx), %rcx
leaq 0x4ffe(%rip), %rdi      # 0x8168
movl $0x1b, %esi
movl $0x1, %edx
callq 0x22e0
movq (%rbx), %rcx
leaq 0x5001(%rip), %rdi      # 0x8184
movl $0x15, %esi
movl $0x1, %edx
callq 0x22e0
xorl %edi, %edi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: vswinfo
void
vswinfo(TV *tv)
{
	int i, j;
	int osw;
	printf("Video switch:\n");
	for(i = 0; i < NUMOUTPUTS; i++)
		printf("%o|%o -> %o\n", tv->vswsect[0][i], tv->vswsect[1][i], i);
	printf("frame buffer output:\n");
	for(i = 0; i < NUMFBUFFERS; i++)
		for(j = 0; j < tv->buffers[i].nosw; j++){
			osw = tv->buffers[i].osw[j];
			printf("%o %o: %o %o\n", i, j, osw, tv->omap[osw]);
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xcfa9(%rip), %rdi      # 0x104ba
callq 0x2070
leaq 0xced1(%rip), %r14      # 0x103ee
xorl %r15d, %r15d
movzbl 0x8088c(%rbx,%r15), %esi
movzbl 0x808ac(%rbx,%r15), %edx
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x20f0
incq %r15
cmpq $0x20, %r15
jne 0x3520
leaq 0xcf79(%rip), %rdi      # 0x104c8
callq 0x2070
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
leaq 0x800c(%rbx), %rbp
leaq 0xce91(%rip), %r14      # 0x103fb
xorl %r15d, %r15d
imulq $0x8088, %r15, %r13     # imm = 0x8088
movq (%rsp), %rax
cmpl $0x0, 0x8084(%rax,%r13)
jle 0x35b6
addq (%rsp), %r13
xorl %r12d, %r12d
movslq (%rbp,%r12,4), %rcx
movl 0x80a60(%rbx,%rcx,4), %r8d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x20f0
incq %r12
movslq 0x8084(%r13), %rax
cmpq %rax, %r12
jl 0x358a
incq %r15
addq $0x8088, %rbp           # imm = 0x8088
cmpq $0x10, %r15
jne 0x356d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: alu
static word
alu(int op, word a, word b)
{
	switch(op){
	case ALU_SETC:	a = ~b; break;
	case ALU_NOR:	a = ~(a|b); break;
	case ALU_ANDC:	a = a&~b; break;
	case ALU_SETZ:	a = 0; break;
	case ALU_NAND:	a = ~(a&b); break;
	case ALU_COMP:	a = ~a; break;
	case ALU_XOR:	a ^= b; break;
	case ALU_ANDCSD: a = ~a&b; break;
	case ALU_ORCSD:	a = a|~b; break;
	case ALU_EQV:	a = ~(a^b); break;
	case ALU_SAME:	break;
	case ALU_AND:	a &= b; break;
	case ALU_ORSCD:	a = ~a|b; break;
	case ALU_SETO:	a = ~0; break;
	case ALU_IOR:	a |= b; break;
	case ALU_SET:	a = b; break;
	default: a = 0;	/* can't happen */
	}
	return a;
}

// Assembly:
cmpl $0xf, %edi
ja 0x389b
movl %edx, %eax
movl %edi, %ecx
leaq 0x495e(%rip), %rdx      # 0x81ec
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
orl %esi, %eax
jmp 0x38bd
xorl %eax, %eax
retq
notl %esi
orl %esi, %eax
retq
notl %eax
orl %eax, %esi
jmp 0x38b8
xorl %eax, %esi
notl %esi
jmp 0x38b8
movw $0xffff, %ax            # imm = 0xFFFF
retq
notl %eax
andl %eax, %esi
movl %esi, %eax
retq
andl %esi, %eax
notl %eax
retq
notl %esi
andl %esi, %eax
retq
xorl %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: sendbuf
void
sendbuf(TV *tv, FBuffer *buffer)
{
	int i;
	for(i = 0; i < buffer->nosw; i++)
		if(buffer->osw[i] >= 0)
			sendfb(tv, buffer->osw[i]);
}

// Assembly:
cmpl $0x0, 0x8084(%rsi)
jle 0x3907
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl 0x8004(%rbx,%r15,4), %esi
testl %esi, %esi
js 0x38f3
movq %r14, %rdi
callq 0x3ab4
incq %r15
movslq 0x8084(%rbx), %rax
cmpq %rax, %r15
jl 0x38df
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: sendupdate
void
sendupdate(TV *tv, FBuffer *buffer, uint16 addr)
{
	uint8 buf[7];
	int i;
	int osw;
	int n1, n2;
	word w1, w2;
	word bw1, bw2;

	/* Don't tell screen to update anything not visible */
	if(addr >= (TVHI-TVLO)/2)
		return;

	msgheader(buf, MSG_WD, 5);
	w2b(buf+3, addr);

//	printf("sending update of %o: %o\n", addr, tv->curbuf->fb[addr]);

	/* Again do the mixing thing for no reason */
	for(i = 0; i < buffer->nosw; i++){
		osw = buffer->osw[i];
		if(osw < 0 || tv->omap[osw] < 0)
			continue;
		n1 = dpymap[0][tv->vswsect[0][osw]];
		n2 = dpymap[1][tv->vswsect[1][osw]];
		w1 = n1 < 0 ? 0 : tv->buffers[n1].fb[addr];
		w2 = n2 < 0 ? 0 : tv->buffers[n2].fb[addr];
		bw1 = n1 < 0 ? 0 : tv->buffers[n1].mask;
		bw2 = n2 < 0 ? 0 : tv->buffers[n2].mask;
		w2b(buf+5, w1^bw1 | w2^bw2);
		writen(tv->cons[tv->omap[osw]].fd, buf, 7);
	}
}

// Assembly:
cmpl $0x3fd7, %edx           # imm = 0x3FD7
ja 0x3a47
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movw $0x5, 0x1(%rsp)
movb $0x3, 0x3(%rsp)
movb %dl, 0x4(%rsp)
movb %dh, 0x5(%rsp)
cmpl $0x0, 0x8084(%rsi)
jle 0x3a39
movq %rdi, %r14
leaq 0x8(%rdi), %r12
movzwl %dx, %eax
leaq (%rdi,%rax,2), %r13
addq $0x8, %r13
leaq 0x808e0(%rdi), %rbp
xorl %r15d, %r15d
leaq 0x490a(%rip), %rdi      # 0x8270
movslq 0x8004(%rbx,%r15,4), %rdx
testq %rdx, %rdx
js 0x3a26
movslq 0x80a60(%r14,%rdx,4), %rax
testq %rax, %rax
js 0x3a26
movzbl 0x8088c(%r14,%rdx), %ecx
movslq (%rdi,%rcx,4), %rsi
testq %rsi, %rsi
js 0x39a9
imulq $0x8088, %rsi, %rcx     # imm = 0x8088
movzwl (%r13,%rcx), %ecx
jmp 0x39ab
xorl %ecx, %ecx
movzbl 0x808ac(%r14,%rdx), %edx
movl 0x40(%rdi,%rdx,4), %edi
testl %edi, %edi
js 0x39cb
imulq $0x8088, %rdi, %rdx     # imm = 0x8088
movzwl (%r13,%rdx), %edx
jmp 0x39cd
xorl %edx, %edx
testl %esi, %esi
js 0x39e3
imulq $0x8088, %rsi, %rsi     # imm = 0x8088
movzwl 0x8000(%r12,%rsi), %esi
jmp 0x39e5
xorl %esi, %esi
testl %edi, %edi
js 0x39fb
imulq $0x8088, %rdi, %rdi     # imm = 0x8088
movzwl 0x8000(%r12,%rdi), %edi
jmp 0x39fd
xorl %edi, %edi
xorl %ecx, %esi
xorl %edx, %edi
orl %esi, %edi
movw %di, 0x6(%rsp)
leaq (%rax,%rax,2), %rax
movl (%rbp,%rax,4), %edi
leaq 0x1(%rsp), %rsi
movl $0x7, %edx
callq 0x719d
leaq 0x484a(%rip), %rdi      # 0x8270
incq %r15
movslq 0x8084(%rbx), %rax
cmpq %rax, %r15
jl 0x3966
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: updatevsw
static void
updatevsw(TV *tv)
{
	int i, j, n;
	for(i = 0; i < NUMFBUFFERS; i++){
		n = 0;
		for(j = 0; j < NUMOUTPUTS; j++)
			if(dpymap[0][tv->vswsect[0][j]] == i ||
			   dpymap[1][tv->vswsect[1][j]] == i)
				tv->buffers[i].osw[n++] = j;
		tv->buffers[i].nosw = n;
	}
}

// Assembly:
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
leaq 0x481b(%rip), %rdx      # 0x8270
imulq $0x8088, %rcx, %rsi     # imm = 0x8088
leaq (%rax,%rsi), %r8
xorl %r10d, %r10d
xorl %r9d, %r9d
movzbl 0x8088c(%rdi,%r10), %r11d
movl (%rdx,%r11,4), %r11d
cmpq %r11, %rcx
je 0x3a8b
movzbl 0x808ac(%rdi,%r10), %r11d
movl 0x40(%rdx,%r11,4), %r11d
cmpq %r11, %rcx
jne 0x3a99
movslq %r9d, %r11
incl %r9d
movl %r10d, 0x8004(%r8,%r11,4)
incq %r10
cmpq $0x20, %r10
jne 0x3a66
movl %r9d, 0x8084(%rax,%rsi)
incq %rcx
cmpq $0x10, %rcx
jne 0x3a55
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: sendfb
void
sendfb(TV *tv, int osw)
{
	TVcon *con = &tv->cons[tv->omap[osw]];
	if(tv->omap[osw] < 0)
		return;
	uint8 *b = largebuf;
	msgheader(b, MSG_FB, 1+8+WIDTH*HEIGHT/8);
	b += 3;
	w2b(b, 0);
	w2b(b+2, 0);
	w2b(b+4, WIDTH/16);
	w2b(b+6, HEIGHT);
	b += 8;
	packfb(tv, b, con->dpy, 0, 0, WIDTH/16, HEIGHT);
	writen(con->fd, largebuf, 3+8+WIDTH*HEIGHT/8);
}

// Assembly:
movslq %esi, %rax
movslq 0x80a60(%rdi,%rax,4), %rax
testq %rax, %rax
js 0x3b2f
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq (%rax,%rax,2), %r15
movw $0x7fb9, 0x96557(%rip)  # imm = 0x7FB9
leaq 0x96550(%rip), %r14     # 0x9a030
movb $0x2, 0x9654b(%rip)     # 0x9a032
movabsq $0x1c6002400000000, %rax # imm = 0x1C6002400000000
movq %rax, 0x9653b(%rip)     # 0x9a033
movl 0x808e4(%rdi,%r15,4), %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x24, %r8d
movl $0x1c6, %r9d            # imm = 0x1C6
callq 0x3ed2
movl 0x808e0(%rbx,%r15,4), %edi
movq %r14, %rsi
movl $0x7fbb, %edx           # imm = 0x7FBB
popq %rbx
popq %r14
popq %r15
jmp 0x719d
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: dati_tv
int
dati_tv(Bus *bus, void *dev)
{
	TV *tv = dev;
	word *creg;
	FBuffer *curbuf;

	creg = tv->ten11->cycle ? &tv->creg10 : &tv->creg11;
	curbuf = (*creg & BUFMASK) < NUMFBUFFERS ? &tv->buffers[*creg & BUFMASK] : nil;
	int waddr = bus->addr>>1;
	if(bus->addr >= TVLO && bus->addr < 0160000){
		if(curbuf == nil)
			return 0;
		/* In Buffer */
		if((bus->addr&~1) == CSA)
			bus->data = curbuf->csa;
		else{
			waddr -= TVLO>>1;
			bus->data = curbuf->fb[waddr];
		}
		return 0;
	}
	switch(bus->addr){
	case CREG:
		bus->data = *creg;
		return 0;
	case CREG+2:
		/* unused, read only as side effect */
		bus->data = 0;
		return 0;
	case KMS:
		bus->data = tv->kms&~037 | tv->kma_hi>>16 & 3;
		return 0;
	case KMA:
		bus->data = tv->kma_hi | tv->kma_lo;
		return 0;
	case VSW:
	case ASW:
		/* write only */
		bus->data = 0;
		return 0;
	}
	return 1;
}

// Assembly:
movq (%rsi), %rax
xorl %ecx, %ecx
cmpl $0x0, (%rax)
setne %cl
movzwl 0x80888(%rsi,%rcx,2), %ecx
movl %ecx, %r9d
andl $0x1f, %r9d
imulq $0x8088, %r9, %rdx      # imm = 0x8088
xorl %eax, %eax
cmpw $0x10, %r9w
leaq 0x8(%rsi,%rdx), %rdx
movl $0x0, %r8d
cmovbq %rdx, %r8
movl 0x8(%rdi), %edx
leal -0x6000(%rdx), %r10d
cmpl $0x7fff, %r10d          # imm = 0x7FFF
ja 0x3d58
cmpw $0xf, %r9w
ja 0x3dc7
movl %edx, %eax
andl $0xfffe, %eax           # imm = 0xFFFE
cmpl $0xdffe, %eax           # imm = 0xDFFE
jne 0x3da6
movzwl 0x7ffe(%r8), %ecx
jmp 0x3dc1
movl $0x1, %eax
leal -0x3e824(%rdx), %r8d
cmpl $0x6, %r8d
ja 0x3d92
leaq 0x44d7(%rip), %rdx      # 0x8248
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
movl 0x808cc(%rsi), %eax
andl $-0x20, %eax
movzwl 0x808d2(%rsi), %ecx
andl $0x3, %ecx
orl %eax, %ecx
jmp 0x3dc1
cmpl $0x3e830, %edx          # imm = 0x3E830
je 0x3da2
cmpl $0x3f1b8, %edx          # imm = 0x3F1B8
jne 0x3dc7
xorl %ecx, %ecx
jmp 0x3dc1
shrl %edx
movl %edx, %eax
movzwl -0x6000(%r8,%rax,2), %ecx
jmp 0x3dc1
movl 0x808d4(%rsi), %ecx
orl 0x808d0(%rsi), %ecx
movw %cx, 0xc(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: inittv
void
inittv(TV *tv)
{
	TVcon *con;
	int i;
	for(con = tv->cons; con < &tv->cons[NUMCONNECTIONS]; con++){
		con->fd = -1;
		con->dpy = -1;
		con->kbd = -1;
	}
	for(i = 0; i < NUMOUTPUTS; i++)
		tv->omap[i] = -1;
	pthread_mutex_init(&lock, nil);
	pthread_mutex_init(&kblock, nil);
	pthread_cond_init(&kbcond, nil);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x808e0, %rdi          # imm = 0x808E0
movl $0x180, %edx            # imm = 0x180
movl $0xff, %esi
callq 0x2130
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x80a60(%rbx)
movdqu %xmm0, 0x80a70(%rbx)
movdqu %xmm0, 0x80a80(%rbx)
movdqu %xmm0, 0x80a90(%rbx)
movdqu %xmm0, 0x80aa0(%rbx)
movdqu %xmm0, 0x80ab0(%rbx)
movdqu %xmm0, 0x80ac0(%rbx)
movdqu %xmm0, 0x80ad0(%rbx)
leaq 0x9615c(%rip), %rdi     # 0x99fb0
xorl %esi, %esi
callq 0x2320
leaq 0x96176(%rip), %rdi     # 0x99fd8
xorl %esi, %esi
callq 0x2320
leaq 0x96190(%rip), %rdi     # 0x9a000
xorl %esi, %esi
popq %rbx
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: packfb
static void
packfb(TV *tv, uint8 *dst, int osw, int x, int y, int w, int h)
{
	int stride;
	int n1, n2;
	word *src1, *src2;
	word bw1, bw2;

	stride = WIDTH/16;

	/* We mix the outputs of both sections for the final output.
	 * This feature does not seem to be used by the TV system
	 * but it's theoretically capable of doing something like this.
	 * External video input is not supported here of course. */
	n1 = dpymap[0][tv->vswsect[0][osw]];
	n2 = dpymap[1][tv->vswsect[1][osw]];
//printf("inbuf: %d %d\n", n1, n2);
	src1 = n1 < 0 ? nullfb : &tv->buffers[n1].fb[stride*y + x];
	src2 = n2 < 0 ? nullfb : &tv->buffers[n2].fb[stride*y + x];
	bw1 = n1 < 0 ? 0 : tv->buffers[n1].mask;
	bw2 = n2 < 0 ? 0 : tv->buffers[n2].mask;
	for(y = 0; y < h; y++){
		for(x = 0; x < w; x++){
			/* We mix with an OR */
			w2b(dst, src1[x]^bw1 | src2[x]^bw2);
			dst += 2;
		}
		src1 += stride;
		src2 += stride;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movslq %esi, %rax
movzbl 0x8088c(%rdi,%rax), %esi
leaq 0x4388(%rip), %r10      # 0x8270
movslq (%r10,%rsi,4), %r14
movzbl 0x808ac(%rdi,%rax), %eax
movslq 0x40(%r10,%rax,4), %r10
leaq 0x8(%rdi), %rsi
imulq $0x8088, %r14, %rbx     # imm = 0x8088
imulq $0x8088, %r10, %r11     # imm = 0x8088
testq %r10, %r10
leal (%rcx,%rcx,8), %eax
leal (%rdx,%rax,4), %ecx
leaq 0x44d5(%rip), %rdx      # 0x83f0
leaq 0x8(%rdi,%r11), %rax
leaq (%rax,%rcx,2), %rax
cmovsq %rdx, %rax
addq %rbx, %rdi
addq $0x8, %rdi
leaq (%rdi,%rcx,2), %rcx
testq %r14, %r14
cmovsq %rdx, %rcx
js 0x3f46
movzwl 0x8000(%rsi,%rbx), %edx
jmp 0x3f48
xorl %edx, %edx
testl %r10d, %r10d
js 0x3f58
movzwl 0x8000(%rsi,%r11), %esi
jmp 0x3f5a
xorl %esi, %esi
testl %r9d, %r9d
jle 0x3faa
movl %r8d, %edi
addq %rdi, %rdi
xorl %r10d, %r10d
leaq 0x960cc(%rip), %r11     # 0x9a03b
testl %r8d, %r8d
jle 0x3f9a
xorl %ebx, %ebx
movzwl (%rcx,%rbx), %ebp
xorw %dx, %bp
movzwl (%rax,%rbx), %r14d
xorw %si, %r14w
orl %ebp, %r14d
movw %r14w, (%r11,%rbx)
addq $0x2, %rbx
cmpq %rbx, %rdi
jne 0x3f76
addq %rbx, %r11
addq $0x48, %rcx
addq $0x48, %rax
incl %r10d
cmpl %r9d, %r10d
jne 0x3f6f
popq %rbx
popq %r14
popq %rbp
retq