LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39d90
movq %rax, %rdi
movq -0x10(%rbp), %rsi
subq $0x8, %rsi
callq 0x39d40
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39c30
movq -0x10(%rbp), %rcx
addq $0x8, %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x39d90
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x39d90
movq %rax, %rdi
movl $0x8, %esi
callq 0x3a500
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jne 0x3b15e
movb $0x1, %al
testb $0x1, %al
jne 0x3b15c
jmp 0x3b15e
jmp 0x3b17d
leaq 0x6ce4(%rip), %rdi      # 0x41e49
leaq 0x639f(%rip), %rsi      # 0x4150b
movl $0x1ca, %edx            # imm = 0x1CA
leaq 0x6d45(%rip), %rcx      # 0x41ebd
callq 0x31c0
movq -0x8(%rbp), %rdi
callq 0x39c30
movq -0x20(%rbp), %rcx
addq -0x10(%rbp), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x3b199
jmp 0x3b1b8
leaq 0x6d53(%rip), %rdi      # 0x41ef3
leaq 0x6364(%rip), %rsi      # 0x4150b
movl $0x1cc, %edx            # imm = 0x1CC
leaq 0x6d0a(%rip), %rcx      # 0x41ebd
callq 0x31c0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a030
movq -0x18(%rbp), %rdi
callq 0x39c30
cmpq $0x18, %rax
jb 0x3b1de
movb $0x1, %al
testb $0x1, %al
jne 0x3b1dc
jmp 0x3b1de
jmp 0x3b1fd
leaq 0x6d6c(%rip), %rdi      # 0x41f51
leaq 0x631f(%rip), %rsi      # 0x4150b
movl $0x1ce, %edx            # imm = 0x1CE
leaq 0x6cc5(%rip), %rcx      # 0x41ebd
callq 0x31c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3a030
movq -0x18(%rbp), %rdi
callq 0x3a660
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x39d60
cmpl $0x0, %eax
jne 0x3b2b8
movb $0x1, %al
testb $0x1, %al
jne 0x3b2b6
jmp 0x3b2b8
jmp 0x3b2d7
leaq 0x6e1f(%rip), %rdi      # 0x420de
leaq 0x6245(%rip), %rsi      # 0x4150b
movl $0x1d9, %edx            # imm = 0x1D9
leaq 0x6e44(%rip), %rcx      # 0x42116
callq 0x31c0
movq -0x10(%rbp), %rdi
callq 0x39c30
movq %rax, %rcx
addq $0x8, %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x3a100
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
andq $-0x40, %rsp
subq $0xc0, %rsp
movl $0x0, 0xac(%rsp)
movq %rsp, %rdi
movl $0x1, %esi
callq 0x1240
movq %rsp, %rdi
movl $0x1, %esi
callq 0x1650
movq %rsp, %rdi
movl $0x3, %esi
callq 0x1650
movq %rsp, %rdi
movl $0x5, %esi
callq 0x1650
movq %rsp, %rdi
movl $0x8, %esi
callq 0x1650
movq %rsp, %rdi
movl $0x4, %esi
callq 0x1650
movq %rsp, %rdi
movl $0x6, %esi
callq 0x1650
movq %rsp, %rdi
callq 0x17c0
movq %rax, 0xa0(%rsp)
cmpq $0x0, %rax
je 0x1223
movq 0xa0(%rsp), %rsi
leaq 0xdea(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1050
jmp 0x11f5
movq %rsp, %rdi
callq 0x13a0
xorl %eax, %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xfce1(%rip), %rax      # 0x12004
movq %rax, -0x38(%rbp)
leaq 0x14fca(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x19, -0x2c(%rbp)
leaq 0x11be7(%rip), %rax     # 0x13f30
movq %rax, -0x28(%rbp)
leaq 0x14dcc(%rip), %rax     # 0x17120
movq %rax, -0x20(%rbp)
leaq 0x14f99(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x10e70
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
callq 0x3620
movq %rax, %rdi
callq 0x5c30
movq %rax, -0x10(%rbp)
leaq 0x15505(%rip), %rax     # 0x178a0
cmpl $0x0, (%rax)
je 0x23f1
leaq 0x14f51(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
leaq 0x11b7b(%rip), %rcx     # 0x13f30
movq %rcx, 0x10(%rax)
leaq 0x11b70(%rip), %rdi     # 0x13f30
callq 0x10280
cmpl $0x0, %eax
je 0x23f1
leaq 0x14f27(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0x1b, 0xc(%rax)
movq -0x10(%rbp), %rsi
leaq 0xfc25(%rip), %rdi      # 0x1200f
movb $0x0, %al
callq 0x10f20
jmp 0x23f3
movq 0x14bfe(%rip), %rax     # 0x16ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xfc16(%rip), %rsi      # 0x1201e
movb $0x0, %al
callq 0x2150
movl $0x1d, -0x2c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x11040
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdef0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
callq 0x2fe0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
sarq $0x2, %rax
movl %eax, -0x1c(%rbp)
leaq 0xfbb6(%rip), %rax      # 0x1202e
movq %rax, -0x48(%rbp)
leaq 0x14e75(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movl $0x2f, -0x3c(%rbp)
leaq 0x11a92(%rip), %rax     # 0x13f30
movq %rax, -0x38(%rbp)
leaq 0x14c77(%rip), %rax     # 0x17120
movq %rax, -0x30(%rbp)
leaq 0x14e44(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x10e70
cmpl $0x0, -0x1c(%rbp)
jg 0x250a
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
leaq 0xb6b(%rip), %rsi       # 0x3050
leaq 0x14d7c(%rip), %rdx     # 0x17268
callq 0x34c0
movq -0x8(%rbp), %rdi
movq 0x14e4c(%rip), %rsi     # 0x17348
leaq 0x14d65(%rip), %rdx     # 0x17268
callq 0x41f0
jmp 0x2528
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
orq $0x3, %rdx
callq 0x41f0
movl $0x36, -0x3c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x11040
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdef0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
callq 0x2fe0
movq %rax, -0x18(%rbp)
leaq 0xfac6(%rip), %rax      # 0x12043
movq %rax, -0x40(%rbp)
leaq 0x14d70(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x43, -0x34(%rbp)
leaq 0x1198d(%rip), %rax     # 0x13f30
movq %rax, -0x30(%rbp)
leaq 0x14b72(%rip), %rax     # 0x17120
movq %rax, -0x28(%rbp)
leaq 0x14d3f(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10e70
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x41f0
movl $0x45, -0x34(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x11040
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
callq 0x2fe0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdef0
movq %rax, -0x18(%rbp)
leaq 0xf6e6(%rip), %rax      # 0x12043
movq %rax, -0x40(%rbp)
leaq 0x14990(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x82, -0x34(%rbp)
leaq 0x115ad(%rip), %rax     # 0x13f30
movq %rax, -0x30(%rbp)
leaq 0x14792(%rip), %rax     # 0x17120
movq %rax, -0x28(%rbp)
leaq 0x1495f(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10e70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x41f0
movl $0x84, -0x34(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x11040
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
callq 0x2fe0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdef0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
sarq $0x2, %rax
movl %eax, -0x24(%rbp)
leaq 0xf6b0(%rip), %rax      # 0x120d8
movq %rax, -0x50(%rbp)
leaq 0x148c5(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x96, -0x44(%rbp)
leaq 0x114e2(%rip), %rax     # 0x13f30
movq %rax, -0x40(%rbp)
leaq 0x146c7(%rip), %rax     # 0x17120
movq %rax, -0x38(%rbp)
leaq 0x14894(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10e70
movl -0x24(%rbp), %eax
cmpl 0x146af(%rip), %eax     # 0x17130
jl 0x2ac3
movl 0x146a7(%rip), %eax     # 0x17130
shll %eax
movl %eax, 0x1469f(%rip)     # 0x17130
movq 0x14560(%rip), %rax     # 0x16ff8
movq (%rax), %rdi
movl -0x24(%rbp), %edx
leaq 0xf641(%rip), %rsi      # 0x120e6
movb $0x0, %al
callq 0x2150
movq -0x8(%rbp), %rdi
movq 0x14891(%rip), %rsi     # 0x17348
leaq 0x147aa(%rip), %rdx     # 0x17268
callq 0x41f0
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
orq $0x3, %rdx
leaq -0xff(%rip), %rsi       # 0x29e0
callq 0x40d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xdd60
movq %rax, %rdi
movq -0x20(%rbp), %rdx
leaq -0x1e3(%rip), %rsi      # 0x2920
callq 0x34c0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x41f0
movl $0x9f, -0x44(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x11040
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x64, -0x1c(%rbp)
leaq 0xf3f7(%rip), %rax      # 0x121b2
movq %rax, -0x48(%rbp)
leaq 0x14532(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movl $0xf0, -0x3c(%rbp)
leaq 0x1114f(%rip), %rax     # 0x13f30
movq %rax, -0x38(%rbp)
leaq 0x14334(%rip), %rax     # 0x17120
movq %rax, -0x30(%rbp)
leaq 0x14501(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x10e70
leaq 0x144e6(%rip), %rax     # 0x172f8
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x2e30
leaq 0x144d5(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x2e3e
movq 0x141c1(%rip), %rax     # 0x16ff8
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
leaq 0x144af(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq %rcx, 0x18(%rax)
callq 0x20a0
movl %eax, %ecx
leaq 0x1449a(%rip), %rax     # 0x172f8
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x14486(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xf330(%rip), %rdx      # 0x121b7
callq 0x21b0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x2f38
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
subl $0x23, %eax
je 0x2ef5
jmp 0x2ea5
movl -0x54(%rbp), %eax
subl $0x3f, %eax
je 0x2f29
jmp 0x2eaf
movl -0x54(%rbp), %eax
subl $0x56, %eax
je 0x2f1d
jmp 0x2eb9
movl -0x54(%rbp), %eax
subl $0x6d, %eax
je 0x2ee1
jmp 0x2ec3
movl -0x54(%rbp), %eax
subl $0x6e, %eax
jne 0x2f2e
jmp 0x2ecd
movq 0x14104(%rip), %rax     # 0x16fd8
movq (%rax), %rdi
callq 0x21d0
movl %eax, -0x18(%rbp)
jmp 0x2f33
movq 0x140f0(%rip), %rax     # 0x16fd8
movq (%rax), %rdi
callq 0x21d0
movl %eax, -0x1c(%rbp)
jmp 0x2f33
jmp 0x2ef7
leaq 0x143fa(%rip), %rax     # 0x172f8
movq (%rax), %rax
movq 0x50(%rax), %rax
movl $0xf6, 0xc(%rax)
movq 0x140c5(%rip), %rax     # 0x16fd8
movq (%rax), %rdi
callq 0x10510
jmp 0x2f33
callq 0x2d60
xorl %edi, %edi
callq 0x21f0
callq 0x2d30
callq 0x2d30
jmp 0x2e79
callq 0x2d60
movl -0x18(%rbp), %edi
movl -0x1c(%rbp), %esi
callq 0x2b30
callq 0x2d10
movl $0x101, -0x3c(%rbp)     # imm = 0x101
leaq -0x48(%rbp), %rdi
callq 0x11040
xorl %edi, %edi
callq 0x21f0
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x14c0
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x13b5
movq 0x7c3a(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movq 0x7c28(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
callq 0x1630
jmp 0x14b7
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x1, %eax
jne 0x13ef
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x53b3(%rip), %rsi      # 0x6786
callq 0x1aa0
movq %rax, %rdi
movq 0x7bee(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
callq 0x1630
jmp 0x14b5
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x2, %eax
jl 0x1439
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4bff(%rip), %rsi      # 0x6011
callq 0x1240
cmpq $0x0, %rax
je 0x1439
movl -0x8(%rbp), %edi
subl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x17d0
jmp 0x14b3
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x2, %eax
jne 0x148b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x532f(%rip), %rsi      # 0x6786
callq 0x1aa0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4b9e(%rip), %rsi      # 0x6016
callq 0x1aa0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x1630
jmp 0x14b1
leaq 0x4b86(%rip), %rdi      # 0x6018
movb $0x0, %al
callq 0x10a0
leaq 0x4baf(%rip), %rdi      # 0x604f
movb $0x0, %al
callq 0x10a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1200
jmp 0x14b3
jmp 0x14b5
jmp 0x14b7
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x34f0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x39f0
movsd 0x7b0e(%rip), %xmm0     # 0x9170
movq -0x28(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x28(%rbp), %rax
movl (%rax), %edx
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0xc(%rax), %r8d
movq -0x28(%rbp), %rax
subl 0x10(%rax), %r8d
subl -0x20(%rbp), %r8d
callq 0x2cf0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x28a3(%rip), %rcx      # 0x3f60
callq 0x4120
movl %eax, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1140
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
jne 0x16f1
movl -0x14(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0xc(%rcx), %eax
setl %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x16fd
jmp 0x17b0
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1140
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2a(%rbp)
jne 0x1728
movl -0x18(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
setl %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x1731
jmp 0x17a0
movl -0x14(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x10(%rcx), %ecx
addl -0x20(%rbp), %ecx
movq -0x28(%rbp), %rdx
imull (%rdx), %ecx
cmpl %ecx, %eax
jl 0x1774
movq -0x10(%rbp), %rdi
cvtsi2sdl -0x1c(%rbp), %xmm0
mulsd 0x79f6(%rip), %xmm0     # 0x9150
cvttsd2si %xmm0, %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %edx
callq 0x1920
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x27d6(%rip), %rcx      # 0x3f60
callq 0x4120
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1704
jmp 0x17a2
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x16cc
movq -0x8(%rbp), %rdi
callq 0x1080
movq -0x10(%rbp), %rdi
callq 0x1080
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/rra/rra2wav.c
// Function: batch
static void
batch(int argc,char **argv)
    {
    int i;
    char buffer[512];
    char *base;
    char *suffix = ".wav";
    FILE *in,*out;

    for (i = 0; i < argc; ++i)
        {
        fprintf(stderr,"converting %s to WAV\n",argv[i]);
        in = OpenFile(argv[i],"r");
        base = strtok(argv[i],".");
        if (strlen(base) > sizeof(buffer) - (strlen(suffix) + 2))
            Fatal("file name too long\n");
        sprintf(buffer,"%s%s",base,suffix);
        out = OpenFile(buffer,"w");
        filter(in,out);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x489e(%rip), %rax      # 0x6087
movq %rax, -0x230(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x190b
movq 0x77ee(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x486c(%rip), %rsi      # 0x608c
movb $0x0, %al
callq 0x1120
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4f4c(%rip), %rsi      # 0x6786
callq 0x1aa0
movq %rax, -0x238(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4849(%rip), %rsi      # 0x60a2
callq 0x11b0
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
callq 0x1090
movq %rax, -0x248(%rbp)
movq -0x230(%rbp), %rdi
callq 0x1090
movq %rax, %rdx
movq -0x248(%rbp), %rax
addq $0x2, %rdx
movl $0x200, %ecx            # imm = 0x200
subq %rdx, %rcx
cmpq %rcx, %rax
jbe 0x18ad
leaq 0x47fe(%rip), %rdi      # 0x60a4
movb $0x0, %al
callq 0x1950
leaq -0x220(%rbp), %rdi
movq -0x228(%rbp), %rdx
movq -0x230(%rbp), %rcx
leaq 0x47ef(%rip), %rsi      # 0x60b8
movb $0x0, %al
callq 0x11f0
leaq -0x220(%rbp), %rdi
leaq 0x4738(%rip), %rsi      # 0x6016
callq 0x1aa0
movq %rax, -0x240(%rbp)
movq -0x238(%rbp), %rdi
movq -0x240(%rbp), %rsi
callq 0x1630
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x17f7
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0xbd25(%rip), %rdi      # 0xe528
movl 0xbd27(%rip), %esi      # 0xe530
callq 0xa730
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x2848
movl $0x5, %edi
callq 0x2300
movq 0xbcf6(%rip), %rdi      # 0xe528
movl 0xbcf8(%rip), %esi      # 0xe530
callq 0xa730
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x2817
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
callq 0xa960
movq 0xb975(%rip), %rsi      # 0xe1d0
leaq 0x87e2(%rip), %rdi      # 0xb044
movb $0x0, %al
callq 0x20f0
leaq 0x87eb(%rip), %rax      # 0xb05b
movq %rax, 0xb959(%rip)      # 0xe1d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movzwl -0x2(%rbp), %eax
sarl %eax
movw %ax, -0x2(%rbp)
movzwl -0x4(%rbp), %eax
sarl %eax
movw %ax, -0x4(%rbp)
movzwl -0x2(%rbp), %eax
movzwl -0x4(%rbp), %ecx
cmpl %ecx, %eax
je 0x3029
movzwl -0x2(%rbp), %esi
shll %esi
movzwl -0x2(%rbp), %eax
movl %eax, %ecx
leaq 0xb537(%rip), %rax      # 0xe540
movzwl (%rax,%rcx,2), %edx
leaq 0x8105(%rip), %rdi      # 0xb119
movb $0x0, %al
callq 0x20f0
movw -0x2(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x2(%rbp)
jmp 0x2fea
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
movq 0xaf8d(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0x92023(%rip), %rdx     # 0x95098
leaq 0x80b7(%rip), %rsi      # 0xb133
movb $0x0, %al
callq 0x2190
movq 0xaf6e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x80de(%rip), %rsi      # 0xb172
movb $0x0, %al
callq 0x2190
movq 0xaf56(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x80e4(%rip), %rsi      # 0xb190
movb $0x0, %al
callq 0x2190
movq 0xaf3e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x80ec(%rip), %rsi      # 0xb1b0
movb $0x0, %al
callq 0x2190
movq 0xaf26(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x80fa(%rip), %rsi      # 0xb1d6
movb $0x0, %al
callq 0x2190
movq 0xaf0e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x80fe(%rip), %rsi      # 0xb1f2
movb $0x0, %al
callq 0x2190
xorl %edi, %edi
callq 0x22c0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x7c9d(%rip), %rdi      # 0xb250
movb $0x0, %al
callq 0x20f0
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x3603
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x8088c(%rax,%rcx), %esi
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x808ac(%rax,%rcx), %edx
movl -0xc(%rbp), %ecx
leaq 0x7c6e(%rip), %rdi      # 0xb25f
movb $0x0, %al
callq 0x20f0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x35c1
leaq 0x7c62(%rip), %rdi      # 0xb26c
movb $0x0, %al
callq 0x20f0
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jge 0x36b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
addq $0x8, %rcx
movslq -0xc(%rbp), %rdx
imulq $0x8088, %rdx, %rdx     # imm = 0x8088
addq %rdx, %rcx
cmpl 0x8084(%rcx), %eax
jge 0x36a0
movq -0x8(%rbp), %rax
addq $0x8, %rax
movslq -0xc(%rbp), %rcx
imulq $0x8088, %rcx, %rcx     # imm = 0x8088
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
movl 0x8004(%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdi
movl 0x80a60(%rax,%rdi,4), %r8d
leaq 0x7bf4(%rip), %rdi      # 0xb282
movb $0x0, %al
callq 0x20f0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3629
jmp 0x36a2
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3618
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movw %dx, %ax
movw %si, %cx
movl %edi, -0x4(%rbp)
movw %cx, -0x6(%rbp)
movw %ax, -0x8(%rbp)
movl -0x4(%rbp), %eax
movq %rax, -0x10(%rbp)
subq $0xf, %rax
ja 0x3b6a
movq -0x10(%rbp), %rax
leaq 0x77af(%rip), %rcx      # 0xb210
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl -0x8(%rbp), %eax
xorl $-0x1, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
movzwl -0x8(%rbp), %ecx
orl %ecx, %eax
xorl $-0x1, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
movzwl -0x8(%rbp), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movw $0x0, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
movzwl -0x8(%rbp), %ecx
andl %ecx, %eax
xorl $-0x1, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
xorl $-0x1, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x8(%rbp), %ecx
movzwl -0x6(%rbp), %eax
xorl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
xorl $-0x1, %eax
movzwl -0x8(%rbp), %ecx
andl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
movzwl -0x8(%rbp), %ecx
xorl $-0x1, %ecx
orl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
movzwl -0x8(%rbp), %ecx
xorl %ecx, %eax
xorl $-0x1, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
jmp 0x3b70
movzwl -0x8(%rbp), %ecx
movzwl -0x6(%rbp), %eax
andl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movzwl -0x6(%rbp), %eax
xorl $-0x1, %eax
movzwl -0x8(%rbp), %ecx
orl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movw $0xffff, -0x6(%rbp)     # imm = 0xFFFF
jmp 0x3b70
movzwl -0x8(%rbp), %ecx
movzwl -0x6(%rbp), %eax
orl %ecx, %eax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movw -0x8(%rbp), %ax
movw %ax, -0x6(%rbp)
jmp 0x3b70
movw $0x0, -0x6(%rbp)
movw -0x6(%rbp), %ax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8084(%rcx), %eax
jge 0x3bdd
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, 0x8004(%rax,%rcx,4)
jl 0x3bd0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x8004(%rax,%rcx,4), %esi
callq 0x3f50
jmp 0x3bd2
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3b97
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: oc_output
static void
oc_output(unsigned char bits)
{
	static int old = -1;
	static int fd = -1;

	if(bits != old) {
		if(fd == -1)
			fd = oc_child();

		(void)write(fd, &bits, 1); /* error? lol yolo */
	}

	old = bits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl 0xa6d8(%rip), %eax      # 0xe4f0
je 0x3e42
cmpl $-0x1, 0xa6d3(%rip)     # 0xe4f4
jne 0x3e2e
callq 0x50f0
movl %eax, 0xa6c6(%rip)      # 0xe4f4
movl 0xa6c0(%rip), %edi      # 0xe4f4
leaq -0x1(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
movzbl -0x1(%rbp), %eax
movl %eax, 0xa6a4(%rip)      # 0xe4f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jge 0x3f3f
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x20, -0x10(%rbp)
jge 0x3f12
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl 0x8088c(%rax,%rcx), %eax
movl %eax, %ecx
leaq 0xa4c6(%rip), %rax      # 0xe370
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
je 0x3ed4
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl 0x808ac(%rax,%rcx), %eax
movl %eax, %ecx
leaq 0xa4a5(%rip), %rax      # 0xe370
movl 0x40(%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x3f02
movl -0x10(%rbp), %edx
movq -0x8(%rbp), %rax
addq $0x8, %rax
movslq -0xc(%rbp), %rcx
imulq $0x8088, %rcx, %rcx     # imm = 0x8088
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movl %edx, 0x8004(%rax,%rcx,4)
jmp 0x3f04
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3e87
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
addq $0x8, %rax
movslq -0xc(%rbp), %rdx
imulq $0x8088, %rdx, %rdx     # imm = 0x8088
addq %rdx, %rax
movl %ecx, 0x8084(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3e6f
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movslq 0x80a60(%rcx,%rdx,4), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, 0x80a60(%rax,%rcx,4)
jge 0x3f9b
jmp 0x404d
leaq 0x9122e(%rip), %rax     # 0x951d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2, %esi
movl $0x7fb9, %edx           # imm = 0x7FB9
callq 0x4770
movq -0x20(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x4740
movq -0x20(%rbp), %rdi
addq $0x2, %rdi
xorl %esi, %esi
callq 0x4740
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movl $0x24, %esi
callq 0x4740
movq -0x20(%rbp), %rdi
addq $0x6, %rdi
movl $0x1c6, %esi            # imm = 0x1C6
callq 0x4740
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
xorl %r8d, %r8d
movl $0x24, %r9d
movl %r8d, %ecx
movl $0x1c6, (%rsp)          # imm = 0x1C6
callq 0x4810
movq -0x18(%rbp), %rax
movl (%rax), %edi
leaq 0x9118d(%rip), %rsi     # 0x951d0
movl $0x7fbb, %edx           # imm = 0x7FBB
callq 0xa6c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: reset_tv
void
reset_tv(void *dev)
{
	TV *tv = dev;
	memset(tv->buffers, 0, sizeof(tv->buffers));
	tv->creg11 = 0;
	tv->creg10 = 0;
	memset(tv->vswsect, 0, sizeof(tv->vswsect));

	tv->kms = 0;
	tv->kma_hi = 0;
	tv->kma_lo = 0;
	tv->km_haskey = 0;
	tv->km_kbd = 0;
	tv->km_key = 0;

	updatevsw(tv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x80880, %edx          # imm = 0x80880
callq 0x2130
movq -0x10(%rbp), %rax
movw $0x0, 0x80888(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x8088a(%rax)
movq -0x10(%rbp), %rdi
addq $0x8088c, %rdi          # imm = 0x8088C
xorl %esi, %esi
movl $0x40, %edx
callq 0x2130
movq -0x10(%rbp), %rax
movw $0x0, 0x808cc(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x808d0(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x808d4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x808d8(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x808dc(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x808de(%rax)
movq -0x10(%rbp), %rdi
callq 0x3e60
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x808e0, %rcx          # imm = 0x808E0
addq $0x180, %rcx            # imm = 0x180
cmpq %rcx, %rax
jae 0x46b3
movq -0x10(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x10(%rbp)
jmp 0x466a
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jge 0x46de
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0xffffffff, 0x80a60(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x46ba
leaq 0x90a6b(%rip), %rdi     # 0x95150
xorl %eax, %eax
movl %eax, %esi
callq 0x2310
leaq 0x90a83(%rip), %rdi     # 0x95178
xorl %eax, %eax
movl %eax, %esi
callq 0x2310
leaq 0x90a9b(%rip), %rdi     # 0x951a0
xorl %eax, %eax
movl %eax, %esi
callq 0x21d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: closetv
void
closetv(TV *tv)
{
	uint8 buf[3];
	int i;
	for(i = 0; i < NUMCONNECTIONS; i++)
		if(tv->cons[i].fd >= 0){
			msgheader(buf, MSG_CLOSE, 1);
			writen(tv->cons[i].fd, buf, 3);
			/* wait for close */
			read(tv->cons[i].fd, buf, 1);
			/* this will cause the handletv thread
			 * to close the connection...if it makes
			 * it that far */
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x20, -0x10(%rbp)
jge 0x4b04
movq -0x8(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jl 0x4af4
leaq -0xb(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x4770
movq -0x8(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
leaq -0xb(%rbp), %rsi
movl $0x3, %edx
callq 0xa6c0
movq -0x8(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
leaq -0xb(%rbp), %rsi
movl $0x1, %edx
callq 0x2160
jmp 0x4af6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4a73
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: accepttv
void
accepttv(int fd, void *arg)
{
	TV *tv = arg;
	int c;
	TVcon *con;

	c = alloccon(tv);
	if(c < 0){
		/* Nothing free */
		setdpykbd(fd, -1, -1);
		close(fd);
		return;
	}
	con = &tv->cons[c];
	GUARD;
	con->dpy = dpykbdlist[c].dpy;
	con->kbd = dpykbdlist[c].kbd;
	con->fd = fd;
	nodelay(con->fd);
	tv->omap[con->dpy] = c;
	UNGUARD;
	setdpykbd(con->fd, con->dpy, con->kbd);
	printf("connected display %o\n", con->dpy);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4c10
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x4b55
movl -0x4(%rbp), %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
callq 0x4a20
movl -0x4(%rbp), %edi
callq 0x2140
jmp 0x4c09
movq -0x18(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movslq -0x1c(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
leaq 0x905db(%rip), %rdi     # 0x95150
callq 0x2330
movslq -0x1c(%rbp), %rcx
leaq 0x986b(%rip), %rax      # 0xe3f0
movl (%rax,%rcx,8), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movslq -0x1c(%rbp), %rcx
leaq 0x9856(%rip), %rax      # 0xe3f0
movl 0x4(%rax,%rcx,8), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x4(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl (%rax), %edi
callq 0xa960
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movl %edx, 0x80a60(%rax,%rcx,4)
leaq 0x9057a(%rip), %rdi     # 0x95150
callq 0x21e0
movq -0x28(%rbp), %rax
movl (%rax), %edi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x4a20
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
leaq 0x66d5(%rip), %rdi      # 0xb2d7
movb $0x0, %al
callq 0x20f0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: alloccon
static int
alloccon(TV *tv)
{
	int i;
	for(i = 0; i < NUMCONNECTIONS; i++)
		if(tv->cons[i].fd < 0 && dpykbdlist[i].dpy >= 0)
			return i;
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jge 0x4c65
movq -0x10(%rbp), %rax
addq $0x808e0, %rax          # imm = 0x808E0
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jge 0x4c58
movslq -0x14(%rbp), %rcx
leaq 0x97a6(%rip), %rax      # 0xe3f0
cmpl $0x0, (%rax,%rcx,8)
jl 0x4c58
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4c6c
jmp 0x4c5a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4c1f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: svc_tv
int
svc_tv(Bus *bus, void *dev)
{
	TV *tv = dev;
	word key, kbd;
	int ch;

	ch = (tv->kms&0100040) == 0100040 ? 5 : 0;
	if(!tv->km_haskey)
		return ch;
	pthread_mutex_lock(&kblock);
	tv->km_haskey = 0;
	key = tv->km_key;
	kbd = tv->km_kbd;
	pthread_cond_signal(&kbcond);
	pthread_mutex_unlock(&kblock);

	bus->addr = tv->kma_hi | tv->kma_lo;
	bus->data = key;
	dato_bus(bus);
	tv->kma_lo = tv->kma_lo+2 & 0177;
	bus->addr = tv->kma_hi | tv->kma_lo;
	bus->data = (kbd&077) << 8;
	dato_bus(bus);
	tv->kma_lo = tv->kma_lo+2 & 0177;
	tv->kms &= ~0200;	/* DMA done */
	tv->kms |= 0100000;	/* interrupt bit */
	ch = (tv->kms&0100040) == 0100040 ? 5 : 0;
	return ch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x808cc(%rax), %edx
andl $0x8020, %edx           # imm = 0x8020
xorl %eax, %eax
movl $0x5, %ecx
cmpl $0x8020, %edx           # imm = 0x8020
cmovel %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x808d8(%rax)
jne 0x4cd4
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4e1b
leaq 0x9049d(%rip), %rdi     # 0x95178
callq 0x2330
movq -0x20(%rbp), %rax
movl $0x0, 0x808d8(%rax)
movq -0x20(%rbp), %rax
movw 0x808de(%rax), %ax
movw %ax, -0x22(%rbp)
movq -0x20(%rbp), %rax
movw 0x808dc(%rax), %ax
movw %ax, -0x24(%rbp)
leaq 0x9048d(%rip), %rdi     # 0x951a0
callq 0x2180
leaq 0x90459(%rip), %rdi     # 0x95178
callq 0x21e0
movq -0x20(%rbp), %rax
movl 0x808d0(%rax), %ecx
movq -0x20(%rbp), %rax
orl 0x808d4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movw -0x22(%rbp), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x2530
movq -0x20(%rbp), %rax
movl 0x808d4(%rax), %ecx
addl $0x2, %ecx
andl $0x7f, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x808d4(%rax)
movq -0x20(%rbp), %rax
movl 0x808d0(%rax), %ecx
movq -0x20(%rbp), %rax
orl 0x808d4(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movzwl -0x24(%rbp), %eax
andl $0x3f, %eax
shll $0x8, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x2530
movq -0x20(%rbp), %rax
movl 0x808d4(%rax), %ecx
addl $0x2, %ecx
andl $0x7f, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x808d4(%rax)
movq -0x20(%rbp), %rax
movzwl 0x808cc(%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movw %cx, 0x808cc(%rax)
movq -0x20(%rbp), %rax
movzwl 0x808cc(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movw %cx, 0x808cc(%rax)
movq -0x20(%rbp), %rax
movzwl 0x808cc(%rax), %edx
andl $0x8020, %edx           # imm = 0x8020
xorl %eax, %eax
movl $0x5, %ecx
cmpl $0x8020, %edx           # imm = 0x8020
cmovel %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: servetv
void
servetv(TV *tv, int port)
{
	pthread_t th;
	struct Serveargs *sa;
	sa = malloc(sizeof(struct Serveargs));
	sa->tv = tv;
	sa->port = port;
	pthread_create(&th, nil, servetv_thread, sa);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x10, %edi
callq 0x21f0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rcx
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xb(%rip), %rdx         # 0x50b0
callq 0x2240
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: servetv_thread
static void*
servetv_thread(void *arg)
{
	struct Serveargs *sa = arg;
	serve(sa->port, accepttv, sa->tv);
	free(sa);
	return nil;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq -0x5c9(%rip), %rsi      # 0x4b10
callq 0xa860
movq -0x10(%rbp), %rdi
callq 0x2040
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/tv.c
// Function: oc_child
static int
oc_child(void)
{
	int fd[2];
	pid_t pid;

	const char *prog = getenv("TV11KMS");
	if(prog == NULL)
		return -1;

	if(pipe(fd) == -1)
		return -1;

	pid = fork();
	if(pid == -1)
		return -1;
	else if(pid == 0) {
		close(0);
		dup2(fd[0], 0);
		close(fd[0]);
		close(fd[1]);
		execlp(prog, prog, NULL);
		exit(1);
	}

	close(fd[0]);
	return fd[1];
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x61ee(%rip), %rdi      # 0xb2ed
callq 0x2030
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x511b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x519d
leaq -0xc(%rbp), %rdi
callq 0x2150
cmpl $-0x1, %eax
jne 0x5132
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x519d
callq 0x2320
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x5149
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x519d
cmpl $0x0, -0x10(%rbp)
jne 0x518d
xorl %edi, %edi
callq 0x2140
movl -0xc(%rbp), %edi
xorl %esi, %esi
callq 0x20e0
movl -0xc(%rbp), %edi
callq 0x2140
movl -0x8(%rbp), %edi
callq 0x2140
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x22f0
movl $0x1, %edi
callq 0x22c0
jmp 0x518f
movl -0xc(%rbp), %edi
callq 0x2140
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)