LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chancreate
Channel*
chancreate(int elemsize, int bufsize)
{
	Channel *c;

	c = malloc(sizeof(Channel) + bufsize*elemsize);
	if(c == nil)
		return nil;
	memset(c, 0, sizeof(Channel));
	c->elemsize = elemsize;
	c->bufsize = bufsize;
	c->nbuf = 0;
	c->buf = (uchar*)(c+1);
	c->full.l = &c->lock;
	c->empty.l = &c->lock;
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
movl %esi, %eax
imull %edi, %eax
movslq %eax, %rdi
addq $0xd0, %rdi
callq 0x2210
movq %rax, %r15
testq %rax, %rax
je 0x3a80
leaq 0x10(%r15), %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x2130
movl %r14d, 0x4(%r15)
movl %ebx, (%r15)
leaq 0xd0(%r15), %rax
movq %rax, 0x8(%r15)
movq %r15, %rax
addq $0x20, %rax
movq %rax, 0x58(%r15)
movq %rax, 0x98(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chanclose
void
chanclose(Channel *c)
{
	lock(&c->lock);
	c->closed = 1;
	rwakeupall(&c->full);
	rwakeupall(&c->empty);
	unlock(&c->lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x3698
movl $0x1, 0x18(%rbx)
leaq 0x50(%rbx), %rdi
callq 0x381d
addq $0x90, %rbx
movq %rbx, %rdi
callq 0x381d
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x376c
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chansend
int
chansend(Channel *c, void *p)
{
	lock(&c->lock);
	while(!(c->closed || cansend(c)))
		rsleep(&c->full);
	/* closed or can send */
	if(c->closed){
		/* can never send to closed chan */
		unlock(&c->lock);
		return -1;
	}
	chansend_(c, p);
	rwakeup(&c->empty);
	unlock(&c->lock);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3698
leaq 0x50(%r14), %r13
pushq $-0x1
popq %r12
cmpl $0x0, 0x18(%r14)
jne 0x3b39
movl 0x10(%r14), %eax
cmpl (%r14), %eax
jl 0x3b1b
movq %r13, %rdi
callq 0x3784
jmp 0x3b01
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b53
addq $0x90, %r14
movq %r14, %rdi
callq 0x3800
pushq $0x1
popq %r12
movq %rbx, %rdi
callq 0x376c
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chansend_
static void
chansend_(Channel *c, void *p)
{
	uchar *pp;

	assert(cansend(c));
	pp = c->buf + (c->off+c->nbuf)%c->bufsize * c->elemsize;
	memmove(pp, p, c->elemsize);
	c->nbuf++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl (%rdi), %ecx
movl 0x10(%rdi), %eax
cmpl %ecx, %eax
jge 0x3b8c
movq %rdi, %rbx
addl 0x14(%rdi), %eax
cltd
idivl %ecx
movslq 0x4(%rdi), %rax
movslq %edx, %rdi
imulq %rax, %rdi
addq 0x8(%rbx), %rdi
movq %rax, %rdx
callq 0x2290
incl 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x167f(%rip), %rdi      # 0x5212
leaq 0x1650(%rip), %rsi      # 0x51ea
leaq 0x167c(%rip), %rcx      # 0x521d
movl $0x10e, %edx            # imm = 0x10E
callq 0x2120
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chanrecv
int
chanrecv(Channel *c, void *p)
{
	lock(&c->lock);
	while(!(c->closed || canrecv(c)))
		rsleep(&c->empty);
	/* closed or can receive */
	if(canrecv(c)){
		/* can still receive from closed chan */
		chanrecv_(c, p);
		rwakeup(&c->full);
		unlock(&c->lock);
		return 1;
	}
	unlock(&c->lock);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3698
leaq 0x90(%r14), %r12
cmpl $0x0, 0x18(%r14)
movl 0x10(%r14), %eax
jne 0x3be8
testl %eax, %eax
jg 0x3bec
movq %r12, %rdi
callq 0x3784
jmp 0x3bcf
testl %eax, %eax
jle 0x3c1b
movq %r14, %rdi
movq %r15, %rsi
callq 0x3c1f
addq $0x50, %r14
movq %r14, %rdi
callq 0x3800
pushq $0x1
popq %r14
movq %rbx, %rdi
callq 0x376c
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
jmp 0x3c05
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: chanrecv_
static void
chanrecv_(Channel *c, void *p)
{
	uchar *pp;

	assert(canrecv(c));
	pp = c->buf + c->off*c->elemsize;
	memmove(p, pp, c->elemsize);
	c->nbuf--;
	if(++c->off == c->bufsize)
		c->off = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0x10(%rdi)
jle 0x3c62
movq %rdi, %rbx
movslq 0x14(%rdi), %rax
movslq 0x4(%rdi), %rdx
imulq %rdx, %rax
addq 0x8(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x2290
decl 0x10(%rbx)
movl 0x14(%rbx), %eax
incl %eax
xorl %ecx, %ecx
cmpl (%rbx), %eax
cmovnel %eax, %ecx
movl %ecx, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x15d6(%rip), %rdi      # 0x523f
leaq 0x157a(%rip), %rsi      # 0x51ea
leaq 0x15d3(%rip), %rcx      # 0x524a
movl $0x119, %edx            # imm = 0x119
callq 0x2120
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: channbsend
int
channbsend(Channel *c, void *p)
{
	lock(&c->lock);
	if(c->closed){
		/* can never send to closed chan */
		unlock(&c->lock);
		return -1;
	}
	if(cansend(c)){
		chansend_(c, p);
		rwakeup(&c->empty);
		unlock(&c->lock);
		return 1;
	}
	unlock(&c->lock);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3698
cmpl $0x0, 0x18(%r14)
je 0x3ca9
pushq $-0x1
jmp 0x3cd1
movl 0x10(%r14), %eax
xorl %r12d, %r12d
cmpl (%r14), %eax
jge 0x3cd3
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b53
addq $0x90, %r14
movq %r14, %rdi
callq 0x3800
pushq $0x1
popq %r12
movq %rbx, %rdi
callq 0x376c
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/common/threading.c
// Function: channbrecv
int
channbrecv(Channel *c, void *p)
{
	lock(&c->lock);
	if(canrecv(c)){
		/* can still receive from closed chan */
		chanrecv_(c, p);
		rwakeup(&c->full);
		unlock(&c->lock);
		return 1;
	}
	if(c->closed){
		unlock(&c->lock);
		return -1;
	}
	unlock(&c->lock);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x3698
cmpl $0x0, 0x10(%r14)
jle 0x3d2f
movq %r14, %rdi
movq %r15, %rsi
callq 0x3c1f
addq $0x50, %r14
movq %r14, %rdi
callq 0x3800
movq %rbx, %rdi
callq 0x376c
pushq $0x1
popq %r15
jmp 0x3d41
xorl %r15d, %r15d
cmpl 0x18(%r14), %r15d
sbbl %r15d, %r15d
movq %rbx, %rdi
callq 0x376c
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: depositreg
void
depositreg(int a, Word w)
{
	switch(a){
	case REG_PC: tx0.pc = w & ADDRMASK; break;
	case REG_AC: tx0.ac = w & WORDMASK; break;
	case REG_LR: tx0.lr = w & WORDMASK; break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, %edi
je 0x3db5
cmpl $0x1, %edi
je 0x3da7
testl %edi, %edi
jne 0x3dc1
movzwl %si, %eax
movl %eax, 0x982b(%rip)      # 0xd5d0
jmp 0x3dc1
andl $0x3ffff, %esi          # imm = 0x3FFFF
movl %esi, 0x980d(%rip)      # 0xd5c0
jmp 0x3dc1
andl $0x3ffff, %esi          # imm = 0x3FFFF
movl %esi, 0x9803(%rip)      # 0xd5c4
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: examinereg
Word
examinereg(int a)
{
	switch(a){
	case REG_PC: return tx0.pc;
	case REG_AC: return tx0.ac;
	case REG_LR: return tx0.lr;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, %edi
je 0x3de7
cmpl $0x1, %edi
je 0x3ddf
xorl %eax, %eax
testl %edi, %edi
jne 0x3ded
movl 0x97f3(%rip), %eax      # 0xd5d0
jmp 0x3ded
movl 0x97db(%rip), %eax      # 0xd5c0
jmp 0x3ded
movl 0x97d7(%rip), %eax      # 0xd5c4
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: disasm
char*
disasm(Word w)
{
	static char s[100];
	char *p;
	int op, x;
	char *opstr, *sym;;

	op = w>>16 & 3;
	x = w & ADDRMASK;
	p = s;
	memset(s, 0, 100);
	switch(op){
	case 00: opstr = "sto"; goto symop;
	case 01: opstr = "add"; goto symop;
	case 02: opstr = "trn"; goto symop;
	case 03: opstr = "opr";
		for(op = 0; oprgroup[op].sym; op++)
			if(oprgroup[op].value == w){
				p += sprintf(p, "%s", oprgroup[op].sym);
				return s;
			}
		p += sprintf(p, "%s %o", opstr, x);
		break;

	symop:
		p += sprintf(p, "%s ", opstr);
		sym = x == 0 ? nil : findsym(x);
		if(sym)
			p += sprintf(p, "%s", sym);
		else
			p += sprintf(p, "%o", x);
		break;
	}
	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %eax
shrl $0x10, %eax
andl $0x3, %eax
movzwl %di, %ebx
xorps %xmm0, %xmm0
movaps %xmm0, 0x49852(%rip)    # 0x4d660
movaps %xmm0, 0x4983b(%rip)    # 0x4d650
movaps %xmm0, 0x49824(%rip)    # 0x4d640
movaps %xmm0, 0x4980d(%rip)    # 0x4d630
movaps %xmm0, 0x497f6(%rip)    # 0x4d620
andl $0x0, 0x4983f(%rip)     # 0x4d670
movaps %xmm0, 0x497d8(%rip)    # 0x4d610
leaq 0x142d(%rip), %rcx      # 0x526c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x143d(%rip), %rdx      # 0x528c
jmp 0x3e9b
leaq 0x143c(%rip), %rdx      # 0x5294
jmp 0x3e9b
pushq $-0x10
popq %rcx
leaq 0x3cdc(%rip), %rax      # 0x7b40
leaq 0x10(%rcx), %rdx
cmpq $0x2a0, %rdx            # imm = 0x2A0
je 0x3eeb
cmpl %edi, 0x18(%rcx,%rax)
movq %rdx, %rcx
jne 0x3e64
movq (%rdx,%rax), %rsi
leaq 0x4978b(%rip), %rdi     # 0x4d610
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2090
leaq 0x13f5(%rip), %rdx      # 0x5290
leaq 0x4976e(%rip), %r15     # 0x4d610
leaq 0x13f9(%rip), %rsi      # 0x52a2
movq %r15, %rdi
xorl %eax, %eax
callq 0x2320
movslq %eax, %r14
addq %r15, %r14
testl %ebx, %ebx
je 0x3ed6
movl %ebx, %edi
callq 0x292e
testq %rax, %rax
je 0x3ed6
movq %r14, %rdi
movq %rax, %rsi
callq 0x2090
jmp 0x3f09
leaq 0x13c2(%rip), %rsi      # 0x529f
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2320
jmp 0x3f09
leaq 0x4971e(%rip), %rdi     # 0x4d610
leaq 0x13a3(%rip), %rsi      # 0x529c
leaq 0x1398(%rip), %rdx      # 0x5298
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2320
leaq 0x49700(%rip), %rax     # 0x4d610
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: handleio
void
handleio(TX0 *tx)
{
	int c;

	if(tx->fl->dly == 0){
		if(hasinput(tx->fl->in)){
			c = getfl(tx->fl);
			tx->lr = 0400000;
	// this is correct:
			tx->lr |= (c&077) << 11;
	// this is not:
	//if(c & 001) tx->lr |= 0000001;
	//if(c & 002) tx->lr |= 0000010;
	//if(c & 004) tx->lr |= 0000100;
	//if(c & 010) tx->lr |= 0001000;
	//if(c & 020) tx->lr |= 0010000;
	//if(c & 040) tx->lr |= 0100000;
		}
		// don't wanna poll this all the time
		// around 16cps max
		tx->fl->dly = 10000;
	}else
		tx->fl->dly--;
	if(tx->fl_printing){
		c = 0;
		if(tx->ac & 0000001) c |= 1;
		if(tx->ac & 0000010) c |= 2;
		if(tx->ac & 0000100) c |= 4;
		if(tx->ac & 0001000) c |= 010;
		if(tx->ac & 0010000) c |= 020;
		if(tx->ac & 0100000) c |= 040;
		putfl(tx->fl, c);
		tx->fl_printing = 0;
		iorestart(tx);
	}
	if(tx->displaying){
		if(tx->scope_fd >= 0){
			u32 cmd = 0;
			int x = (tx->ac>>9)&0777;
			int y = tx->ac&0777;
			// Convert [-1.0,+1.0] to [0,1023]
			if(x & 0400) x++;
			if(y & 0400) y++;
			x += 0400;
			y += 0400;
			x &= 0777;
			y &= 0777;
			x <<= 1;
			y <<= 1;
			cmd = x;
			cmd |= y<<10;
			cmd |= 7<<20;
			write(tx->scope_fd, &cmd, 4);
//	usleep(1000);
		}
		tx->displaying = 0;
		iorestart(tx);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40040(%rdi), %rdi
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x3f9f
decl %eax
movl %eax, 0x8(%rdi)
jmp 0x3fd2
movl (%rdi), %edi
callq 0x32f7
testl %eax, %eax
je 0x3fc4
movq 0x40040(%rbx), %rdi
callq 0x3f42
andl $0x3f, %eax
shll $0xb, %eax
orl $0x20000, %eax          # imm = 0x20000
movl %eax, 0x14(%rbx)
movq 0x40040(%rbx), %rdi
movl $0x2710, 0x8(%rdi)      # imm = 0x2710
cmpl $0x0, 0x40048(%rbx)
je 0x4026
movl 0x10(%rbx), %esi
movl %esi, %eax
andl $0x1, %eax
movl %esi, %ecx
shrl $0x2, %ecx
andl $0x2, %ecx
orl %eax, %ecx
movl %esi, %eax
shrl $0x4, %eax
andl $0x4, %eax
orl %ecx, %eax
movl %esi, %ecx
shrl $0x6, %ecx
andl $0x8, %ecx
orl %eax, %ecx
movl %esi, %eax
shrl $0x8, %eax
andl $0x10, %eax
orl %ecx, %eax
shrl $0xa, %esi
andl $0x20, %esi
orl %eax, %esi
callq 0x3f1b
andl $0x0, 0x40048(%rbx)
movl $0x1, 0x4(%rbx)
cmpl $0x0, 0x4004c(%rbx)
je 0x4081
movl 0x40050(%rbx), %edi
testl %edi, %edi
js 0x4073
movl 0x10(%rbx), %eax
movl %eax, %ecx
shrl $0x9, %ecx
btl $0x11, %eax
adcl $0x0, %ecx
btl $0x8, %eax
adcl $0x0, %eax
andl $0x1ff, %ecx            # imm = 0x1FF
shll $0xb, %eax
andl $0xff800, %eax          # imm = 0xFF800
leal (%rax,%rcx,2), %eax
xorl $0x780200, %eax         # imm = 0x780200
leaq -0xc(%rbp), %rsi
movl %eax, (%rsi)
pushq $0x4
popq %rdx
callq 0x20d0
andl $0x0, 0x4004c(%rbx)
movl $0x1, 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: handlemsg
void
handlemsg(TX0 *tx, Msg msg)
{
	switch(msg.cmd){
	case CMD_NONE:
		break;
	case CMD_SET_PC:
		tx->mar = tx->pc = msg.arg & ADDRMASK;
		break;
	case CMD_STEP:
		tx->sw_stop_c0 = 1;
		tx->sw_stop_c1 = 1;
		tx->pbs = 1;
		break;
	case CMD_RUN:
		tx->sw_stop_c0 = 0;
		tx->sw_stop_c1 = 0;
		tx->pbs = 1;
		break;
	case CMD_STOP:
		tx->pbs = 0;
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x40db
leaq 0x11e1(%rip), %rcx      # 0x527c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrq $0x20, %rsi
movzwl %si, %eax
movl %eax, 0x20(%rdi)
movl %eax, 0x1c(%rdi)
jmp 0x40db
andq $0x0, 0x40034(%rdi)
jmp 0x40d4
andl $0x0, 0x8(%rdi)
jmp 0x40db
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x40034(%rdi)
movl $0x1, 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: readmem
void
readmem(TX0 *tx, FILE *f)
{
	char buf[100], *s;
	Word a, w;

	a = 0;
	while(s = fgets(buf, 100, f)){
		while(*s){
			if(*s == ';')
				break;
			else if('0' <= *s && *s <= '7'){
				w = strtol(s, &s, 8);
				if(*s == ':'){
					a = w;
					s++;
				}else if(a < MAXMEM)
					tx->core[a++] = w & 0777777;
			}else
				s++;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
xorl %r15d, %r15d
pushq $0x64
popq %r12
leaq -0x30(%rbp), %r13
pushq $0x8
popq %r14
leaq -0xa0(%rbp), %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x2190
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x442e
movq %rax, %rdi
movzbl (%rdi), %eax
testl %eax, %eax
je 0x43b7
cmpl $0x3b, %eax
je 0x43b7
andb $-0x8, %al
cmpb $0x30, %al
jne 0x4419
movq %r13, %rsi
movl %r14d, %edx
callq 0x21c0
movq -0x30(%rbp), %rdi
cmpb $0x3a, (%rdi)
je 0x4422
cmpl $0xffff, %r15d          # imm = 0xFFFF
ja 0x43d5
andl $0x3ffff, %eax          # imm = 0x3FFFF
movl %r15d, %ecx
incl %r15d
movq -0x38(%rbp), %rdx
movl %eax, 0x2c(%rdx,%rcx,4)
jmp 0x43d5
incq %rdi
movq %rdi, -0x30(%rbp)
jmp 0x43d5
incq %rdi
movq %rdi, -0x30(%rbp)
movl %eax, %r15d
jmp 0x43d5
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: readsyms
void
readsyms(FILE *f)
{
	char buf[100], *s;
	Word w;

	while(s = fgets(buf, 100, f)){
		while(isspace(*s)) s++;
		while(!isspace(*s)) s++;
		*s++ = '\0';
		w = strtol(s, &s, 8);
		defsym(buf, w);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq -0xa0(%rbp), %r14
pushq $0x64
popq %r15
pushq $0x8
popq %r13
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x2190
testq %rax, %rax
je 0x44c5
movq %rax, %r12
callq 0x23d0
movq (%rax), %rax
decq %r12
movsbq 0x1(%r12), %rcx
incq %r12
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x4481
movsbq (%r12), %rcx
incq %r12
testb $0x20, 0x1(%rax,%rcx,2)
je 0x4491
movq %r12, -0x30(%rbp)
movb $0x0, -0x1(%r12)
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
movl %r13d, %edx
callq 0x21c0
movq %r14, %rdi
movl %eax, %esi
callq 0x28d1
jmp 0x4460
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: cpu_start
void
cpu_start(Addr a)
{
	Msg msg;
	msg.cmd = CMD_SET_PC;
	msg.arg = a;
	chansend(cmdchan, &msg);
	msg.cmd = CMD_RUN;
	chansend(cmdchan, &msg);
	dly();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0x10(%rbp), %rbx
movl $0x1, (%rbx)
movl %edi, 0x4(%rbx)
movq 0x4918a(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
movl $0x3, (%rbx)
movq 0x49175(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
callq 0x4517
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: dly
static void
dly(void)
{
	// force a few cycles to happen
	chansend(cmdchan, &msg_none);
	chansend(cmdchan, &msg_none);
	chansend(cmdchan, &msg_none);
	chansend(cmdchan, &msg_none);
	chansend(cmdchan, &msg_none);
	chansend(cmdchan, &msg_none);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x49154(%rip), %rdi     # 0x4d678
leaq 0x49161(%rip), %rbx     # 0x4d68c
movq %rbx, %rsi
callq 0x3ad9
movq 0x4913e(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
movq 0x4912f(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
movq 0x49120(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
movq 0x49111(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
callq 0x3ad9
movq 0x49102(%rip), %rdi     # 0x4d678
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3ad9
// File: /workspace/github_c_makefile_star2_O2/aap[P]rx-0/tx0/mach.c
// Function: initmach
void
initmach(void)
{
	memset(&fl, 0, sizeof(fl));
	fl.in = open("/tmp/fl", O_RDWR);
	if(fl.in < 0)
		panic("can't open /tmp/fl");
	fl.out = fl.in;

	memset(&tx0, 0, sizeof(tx0));
	tx0.pbs = 0;
	tx0.ios = 1;
	tx0.fl = &fl;
	tx0.mar = tx0.pc = 040;

	FILE *mf;
	mf = mustopen("out.mem", "r");
	if(mf){
		readmem(&tx0, mf);
		fclose(mf);
	}
	mf = fopen("out.sym", "r");
	if(mf){
		readsyms(mf);
		fclose(mf);
	}

	tx0.scope_fd = dial("localhost", 3400);

	cmdchan = chancreate(sizeof(Msg), 1);
	threadcreate(simthread, &tx0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
andl $0x0, 0x4904f(%rip)     # 0x4d688
andq $0x0, 0x4903f(%rip)     # 0x4d680
leaq 0xc69(%rip), %rdi       # 0x52b1
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x22d0
movl %eax, 0x49028(%rip)     # 0x4d680
testl %eax, %eax
jns 0x4670
leaq 0xc43(%rip), %rdi       # 0x52a6
xorl %eax, %eax
callq 0x250c
movl 0x49010(%rip), %eax     # 0x4d680
movl %eax, 0x4900e(%rip)     # 0x4d684
leaq 0x49003(%rip), %rbx     # 0x4d680
leaq 0x8f2c(%rip), %rdi      # 0xd5b0
movl $0x40058, %edx          # imm = 0x40058
xorl %esi, %esi
callq 0x2130
movl $0x1, 0x8f1a(%rip)      # 0xd5b4
movq %rbx, 0x48f4f(%rip)     # 0x4d5f0
movabsq $0x2000000020, %rax     # imm = 0x2000000020
movq %rax, 0x8f1a(%rip)      # 0xd5cc
leaq 0xc00(%rip), %rdi       # 0x52b9
leaq 0xc85(%rip), %rsi       # 0x5345
callq 0x25bc
testq %rax, %rax
je 0x46e4
movq %rax, %rbx
leaq 0x8edc(%rip), %rdi      # 0xd5b0
movq %rax, %rsi
callq 0x4390
movq %rbx, %rdi
callq 0x20f0
leaq 0xbd6(%rip), %rdi       # 0x52c1
leaq 0xc53(%rip), %rsi       # 0x5345
callq 0x22e0
testq %rax, %rax
je 0x470f
movq %rax, %rbx
movq %rax, %rdi
callq 0x443d
movq %rbx, %rdi
callq 0x20f0
leaq 0xbb3(%rip), %rdi       # 0x52c9
movl $0xd48, %esi            # imm = 0xD48
callq 0x33f5
movl %eax, 0x48eda(%rip)     # 0x4d600
leaq 0x8e83(%rip), %rbx      # 0xd5b0
pushq $0x8
popq %rdi
pushq $0x1
popq %rsi
callq 0x3a21
movq %rax, 0x48f39(%rip)     # 0x4d678
leaq -0x669(%rip), %rdi      # 0x40dd
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x383a
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq1.c
// Function: any_bc
boolean any_bc(tteam team, int starnum)
{
    boolean any;
    int tf_number;
    any = false;
    if (tf_stars[starnum][team] > 0) {
        tf_number = 1;
        while ((!any) && (tf_number < 27)) {
            any = (tf[team][tf_number].dest == starnum) &&
                (tf[team][tf_number].eta == 0) &&
                ((tf[team][tf_number].c > 0) ||
                 (tf[team][tf_number].b > 0));
            tf_number = tf_number + 1;
        };
    };
    return (any);
}

// Assembly:
movslq %esi, %rcx
movslq %edi, %rax
shlq $0x3, %rcx
addq 0xbda3(%rip), %rcx      # 0xdfe0
cmpl $0x0, (%rcx,%rax,4)
jle 0x2290
imulq $0x57c, %rax, %rax      # imm = 0x57C
leaq 0xd73f(%rip), %rcx      # 0xf990
addq %rax, %rcx
addq $0x58, %rcx
xorl %eax, %eax
pushq $0x1
popq %rdx
pushq $0x1
popq %rdi
testl %eax, %eax
jne 0x2292
cmpq $0x1a, %rdx
ja 0x2292
xorl %eax, %eax
cmpl %esi, -0x4(%rcx)
jne 0x2287
cmpl $0x0, (%rcx)
jne 0x2287
cmpl $0x0, -0xc(%rcx)
movl %edi, %eax
jg 0x2287
xorl %eax, %eax
cmpl $0x0, -0x8(%rcx)
setg %al
incq %rdx
addq $0x34, %rcx
jmp 0x2260
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq1.c
// Function: best_plan
void best_plan(int *St9rnum, int *S9ze, tteam *T9am)
{
    tplanet *pplanet;
    int starnum, size;
    tteam team;
    team = none;
    starnum = *St9rnum;
    size = 0;
    pplanet = stars[starnum].first_planet;
    while (pplanet != nil) {
        if (pplanet->capacity > size) {
            size = pplanet->capacity;
            team = pplanet->team;
        };
        pplanet = pplanet->next;
    };
    *T9am = team;
    *St9rnum = starnum;
    *S9ze = size;
}

// Assembly:
movslq (%rdi), %rax
imulq $0x18, %rax, %rcx
leaq 0xe1ef(%rip), %r8       # 0x10490
addq %r8, %rcx
addq $0x8, %rcx
pushq $0x2
popq %r9
xorl %r8d, %r8d
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x22cd
movl 0x4(%rcx), %r10d
cmpl %r8d, %r10d
jle 0x22c7
movl 0xc(%rcx), %r9d
movl %r10d, %r8d
addq $0x38, %rcx
jmp 0x22af
movl %r9d, (%rdx)
movl %eax, (%rdi)
movl %r8d, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq1.c
// Function: disp_tf
void disp_tf(struct sttf *taskf)
{
    if (taskf->t != 0)
        printw("%2dt", taskf->t);
    else
        printw("   ");
    if (taskf->s != 0)
        printw("%2ds", taskf->s);
    else
        printw("   ");
    if (taskf->c != 0)
        printw("%2dc", taskf->c);
    else
        printw("   ");
    if (taskf->b != 0)
        printw("%2db", taskf->b);
    else
        printw("   ");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %esi
testl %esi, %esi
je 0x2769
leaq 0x69e3(%rip), %rdi      # 0x9143
xorl %eax, %eax
callq 0x2030
jmp 0x2777
leaq 0x6e75(%rip), %rdi      # 0x95e5
xorl %eax, %eax
callq 0x2030
movl 0x10(%rbx), %esi
testl %esi, %esi
je 0x278e
leaq 0x69c3(%rip), %rdi      # 0x9148
xorl %eax, %eax
callq 0x2030
jmp 0x279c
leaq 0x6e50(%rip), %rdi      # 0x95e5
xorl %eax, %eax
callq 0x2030
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x27b3
leaq 0x69a3(%rip), %rdi      # 0x914d
xorl %eax, %eax
callq 0x2030
jmp 0x27c1
leaq 0x6e2b(%rip), %rdi      # 0x95e5
xorl %eax, %eax
callq 0x2030
movl 0x1c(%rbx), %esi
testl %esi, %esi
je 0x27d7
leaq 0x6983(%rip), %rdi      # 0x9152
xorl %eax, %eax
popq %rbx
jmp 0x2030
leaq 0x6e07(%rip), %rdi      # 0x95e5
xorl %eax, %eax
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq2.c
// Function: get_tf
void get_tf(tteam tm, int *I0, int starnum)
{
    int i;
    i = 1;
    while ((tf[tm][i].dest != 0) && (i < 27))
        i = i + 1;
    if (i == 27)
        i = 0;
    else {
        tf[tm][i].s = 0;
        tf[tm][i].t = 0;
        tf[tm][i].c = 0;
        tf[tm][i].b = 0;
        tf[tm][i].eta = 0;
        tf[tm][i].x = stars[starnum].x;
        tf[tm][i].y = stars[starnum].y;
        tf[tm][i].xf = tf[tm][i].x;
        tf[tm][i].yf = tf[tm][i].y;
        tf[tm][i].dest = starnum;
        tf[tm][i].origeta = 0;
        tf[tm][i].blasting = false;
    };
    *I0 = i;
}

// Assembly:
movslq %edi, %rax
imulq $0x57c, %rax, %rdi      # imm = 0x57C
addq 0xb607(%rip), %rdi      # 0xdfa8
pushq $0x1
popq %rax
movq %rax, %r8
incq %rax
leaq 0x34(%rdi), %rcx
cmpq $0x1a, %r8
ja 0x29bd
cmpl $0x0, 0x54(%rdi)
movq %rcx, %rdi
jne 0x29a4
xorl %edi, %edi
cmpq $0x1c, %rax
je 0x29f9
decl %eax
andl $0x0, 0x24(%rcx)
movslq %edx, %rdx
imulq $0x18, %rdx, %rdi
leaq 0xdab7(%rip), %r8       # 0x10490
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
movq (%r8,%rdi), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqu %xmm0, (%rcx)
movl %edx, 0x20(%rcx)
andq $0x0, 0x28(%rcx)
movl %eax, %edi
movl %edi, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq2.c
// Function: joinsilent
void joinsilent(tteam team, struct sttf *parent, struct sttf *child)
{
    parent->t = parent->t + child->t;
    parent->s = parent->s + child->s;
    parent->c = parent->c + child->c;
    parent->b = parent->b + child->b;
    if ((parent->dest != 0) && (child->dest != 0))
        tf_stars[parent->dest][team]--;
    child->dest = 0;
}

// Assembly:
movdqu 0x10(%rsi), %xmm0
movdqu 0x10(%rdx), %xmm1
paddd %xmm0, %xmm1
movdqu %xmm1, 0x10(%rsi)
movslq 0x20(%rsi), %rax
testq %rax, %rax
je 0x2a2f
cmpl $0x0, 0x20(%rdx)
je 0x2a2f
shlq $0x3, %rax
addq 0xb5b7(%rip), %rax      # 0xdfe0
movslq %edi, %rcx
decl (%rax,%rcx,4)
andl $0x0, 0x20(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq2.c
// Function: lose
void lose(int *Ship9s, boolean *L0se_none, char typ, float percent)
{
    int i, sleft;
    int ships;
    boolean lose_none;
    ships = *Ship9s;
    lose_none = *L0se_none;
    if (ships > 0) {
        sleft = ships;
        for (i = 1; i <= ships; i++) {
            if (((float) (rand() & 0x7fff) / (float) (0x7fff)) > percent) {
                lose_none = false;
                sleft = sleft - 1;
            };
        };
        if (sleft < ships) {
            printw(" %2d%c", ships - sleft, typ);
            ships = sleft;
        };
    };
    *Ship9s = ships;
    *L0se_none = lose_none;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movss %xmm0, 0xc(%rsp)
movq %rdi, %r14
movl (%rdi), %ebx
movl (%rsi), %r15d
testl %ebx, %ebx
jle 0x2ab0
movl %edx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
xorl %ebp, %ebp
movl %ebx, %r13d
movl %ebx, %r12d
subl $0x1, %r13d
jb 0x2a94
callq 0x20f0
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x66eb(%rip), %xmm0     # 0x916c
xorl %eax, %eax
ucomiss 0xc(%rsp), %xmm0
seta %al
cmoval %ebp, %r15d
subl %eax, %r12d
jmp 0x2a65
movl %ebx, %esi
subl %r12d, %esi
jle 0x2ab5
movsbl 0x8(%rsp), %edx
leaq 0x66c9(%rip), %rdi      # 0x9170
xorl %eax, %eax
callq 0x2030
jmp 0x2ab8
movl %ebx, %r12d
jmp 0x2abd
movl %ebx, %r12d
movq 0x10(%rsp), %rsi
movl %r12d, (%r14)
movl %r15d, (%rsi)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq4.c
// Function: update_board
void update_board(int x, int y, toption option)
{
    int scren_x, screen_y;
    scren_x = 3 * x + 1;
    screen_y = 16 - y;
    switch (option) {
    case left:
        point(scren_x, screen_y);
        addch(board[x][y].enemy);
        break;

    case right:
        point(scren_x + 2, screen_y);
        addch(board[x][y].tf);
        break;

    case both:
        point(scren_x, screen_y);
        printw("%c%c%c", board[x][y].enemy, board[x][y].star,
               board[x][y].tf);
        break;
    };                          /*switch ( */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
pushq $0x10
popq %rsi
subl %ebx, %esi
testl %edx, %edx
je 0x2d33
leal (%r14,%r14,2), %edi
incl %edi
cmpl $0x2, %edx
je 0x2cf6
cmpl $0x1, %edx
jne 0x2d71
callq 0x4dbd
movq 0xb312(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
movslq %r14d, %rax
movslq %ebx, %rcx
imulq $0xc0, %rax, %rax
addq 0xb2ab(%rip), %rax      # 0xdf98
imulq $0xc, %rcx, %rcx
movl (%rcx,%rax), %esi
jmp 0x2d65
callq 0x4dbd
movslq %r14d, %rax
movslq %ebx, %rcx
imulq $0xc, %rcx, %rcx
imulq $0xc0, %rax, %rax
addq 0xb285(%rip), %rax      # 0xdf98
movl (%rcx,%rax), %esi
movl 0x4(%rcx,%rax), %edx
movl 0x8(%rcx,%rax), %ecx
leaq 0x65a3(%rip), %rdi      # 0x92c8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2030
leal (%r14,%r14,2), %edi
addl $0x3, %edi
callq 0x4dbd
movq 0xb2a2(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
movslq %r14d, %rax
movslq %ebx, %rcx
imulq $0xc0, %rax, %rax
addq 0xb23b(%rip), %rax      # 0xdf98
imulq $0xc, %rcx, %rcx
movl 0x8(%rcx,%rax), %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2090
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq4.c
// Function: withdraw
void withdraw(int starnum, int plnum)
{
    int withnum;
    boolean error;
    printw("ithdraw ");
    cle3r_left();
    point(1, 19);
    split_tf(&plnum, &withnum);
    if (tf[player][withnum].dest != 0) {
        point(1, 20);
        set_des(withnum, &error);
        if (error) {
            tf[player][plnum].dest = starnum;
            joinsilent(player, &tf[player][plnum], &tf[player][withnum]);
            tf_stars[starnum][player] = 1;
        } else
            tf[player][withnum].withdrew = true;
    };
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x8(%rsp), %r14
movl %esi, (%r14)
leaq 0x5e7a(%rip), %rdi      # 0x935f
xorl %eax, %eax
callq 0x2030
callq 0x6f4d
pushq $0x1
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7a00
movslq (%r15), %rax
imulq $0x34, %rax, %rax
leaq 0xc476(%rip), %r15      # 0xf990
cmpl $0x0, 0x59c(%r15,%rax)
je 0x35aa
pushq $0x1
popq %rdi
pushq $0x14
popq %rsi
callq 0x4dbd
movl 0x4(%rsp), %edi
leaq 0xc(%rsp), %r14
movq %r14, %rsi
callq 0x6b1c
cmpl $0x0, (%r14)
je 0x3592
movslq 0x8(%rsp), %rax
imulq $0x34, %rax, %rax
leaq (%r15,%rax), %rsi
addq $0x57c, %rsi            # imm = 0x57C
movl %ebx, 0x20(%rsi)
movslq 0x4(%rsp), %rax
imulq $0x34, %rax, %rax
leaq (%r15,%rax), %rdx
addq $0x57c, %rdx            # imm = 0x57C
pushq $0x1
popq %rdi
callq 0x29fc
movslq %ebx, %rax
leaq 0xb698(%rip), %rcx      # 0xec20
leaq (%rcx,%rax,8), %rax
addq $0x4, %rax
jmp 0x35a4
movslq 0x4(%rsp), %rax
imulq $0x34, %rax, %rax
addq %r15, %rax
addq $0x5ac, %rax            # imm = 0x5AC
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq4.c
// Function: zero_tf
void zero_tf(tteam tm, int tf_num)
{
    int x, y, i;
    if (tf[tm][tf_num].dest != 0) {
        x = tf[tm][tf_num].x;
        y = tf[tm][tf_num].y;
        if ((tf[tm][tf_num].s + tf[tm][tf_num].t + tf[tm][tf_num].c +
             tf[tm][tf_num].b) == 0) {
            if (tf[tm][tf_num].eta == 0) {
                tf_stars[tf[tm][tf_num].dest][tm]--;
            };
            tf[tm][tf_num].dest = 0;
            if (tm == player) {
                board[x][y].tf = ' ';
                for (i = 1; i <= 26; i++) {
                    if ((tf[player][i].dest != 0) &&
                        (tf[player][i].x == x) && (tf[player][i].y == y)) {
                        if (board[x][y].tf == ' ')
                            board[x][y].tf = i + 'a' - 1;
                        else
                            board[x][y].tf = '*';
                    };
                }
                update_board(x, y, right);
            }

        };
    };
}

// Assembly:
movl %edi, %eax
movslq %edi, %rdx
movslq %esi, %rcx
imulq $0x34, %rcx, %rdi
imulq $0x57c, %rdx, %rcx      # imm = 0x57C
addq 0xa9da(%rip), %rcx      # 0xdfa8
movslq 0x20(%rdi,%rcx), %rsi
testq %rsi, %rsi
je 0x368d
addq %rdi, %rcx
movl 0x14(%rcx), %edi
addl 0x10(%rcx), %edi
addl 0x18(%rcx), %edi
addl 0x1c(%rcx), %edi
jne 0x368d
cmpl $0x0, 0x24(%rcx)
jne 0x3605
shlq $0x3, %rsi
addq 0xa9de(%rip), %rsi      # 0xdfe0
decl (%rsi,%rdx,4)
movslq (%rcx), %rdi
movslq 0x4(%rcx), %rsi
andl $0x0, 0x20(%rcx)
cmpl $0x1, %eax
jne 0x368d
imulq $0xc0, %rdi, %rax
addq 0xa975(%rip), %rax      # 0xdf98
imulq $0xc, %rsi, %rcx
addq %rcx, %rax
addq $0x8, %rax
movl $0x20, (%rax)
pushq $0x20
popq %r8
pushq $0x1
popq %rcx
xorl %edx, %edx
leaq 0xc34c(%rip), %r9       # 0xf990
pushq $0x2a
popq %r10
cmpq $0x548, %rdx            # imm = 0x548
je 0x368e
cmpl $0x0, 0x5d0(%r9,%rdx)
je 0x3685
cmpl %edi, 0x5b0(%r9,%rdx)
jne 0x3685
cmpl %esi, 0x5b4(%r9,%rdx)
jne 0x3685
movl %ecx, %r11d
orl $0x60, %r11d
cmpl $0x20, %r8d
cmovnel %r10d, %r11d
movl %r11d, (%rax)
movl %r11d, %r8d
incl %ecx
addq $0x34, %rdx
jmp 0x3648
retq
xorl %edx, %edx
jmp 0x2ca4
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conq4.c
// Function: up_year
void up_year(void)
{
    point(39, 18);
    turn = turn + 1;
    printw("%3d", turn);
    point(48, 19);
    production_year = production_year + 1;
    printw("%d", production_year);
}

// Assembly:
pushq %rax
pushq $0x27
popq %rdi
pushq $0x12
popq %rsi
callq 0x4dbd
leaq 0xd0dc(%rip), %rax      # 0x10784
movl (%rax), %esi
incl %esi
movl %esi, (%rax)
leaq 0x6167(%rip), %rdi      # 0x981c
xorl %eax, %eax
callq 0x2030
pushq $0x30
popq %rdi
pushq $0x13
popq %rsi
callq 0x4dbd
leaq 0xd0ba(%rip), %rax      # 0x10788
movl (%rax), %esi
incl %esi
movl %esi, (%rax)
leaq 0x6154(%rip), %rdi      # 0x982f
xorl %eax, %eax
popq %rcx
jmp 0x2030
nop
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqb2.c
// Function: battle
void battle(void)
{
    boolean first;
    int starnum;
    first = true;
    for (starnum = 1; starnum <= nstars; starnum++) {
        if (tf_stars[starnum][ENEMY] > 0
            && tf_stars[starnum][player] > 0
            && (any_bc(ENEMY, starnum) || any_bc(player, starnum))
            ) {
            if (first) {
                point(33, 20);
                printw("* Tf battle *   ");
                first = false;
            };
            tf_battle(starnum);
        };
        if ((any_bc(ENEMY, starnum)) && (col_stars[starnum][player]
                                         > 0))
            EN2MY_attack(starnum);
        else if ((tf_stars[starnum][player] > 0)
                 && (col_stars[starnum][ENEMY] > 0))
            pl2yerattack(starnum);
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x1
popq %rbp
pushq $0x1
popq %r14
leaq 0xb523(%rip), %r13      # 0xec20
pushq $0x14
popq %r15
leaq 0x5c60(%rip), %r12      # 0x9368
leaq 0xb5c1(%rip), %rbx      # 0xecd0
cmpq $0x16, %r14
je 0x37a8
cmpl $0x0, (%r13,%r14,8)
jle 0x3769
cmpl $0x0, 0x4(%r13,%r14,8)
jle 0x3769
xorl %edi, %edi
movl %r14d, %esi
callq 0x222c
testl %eax, %eax
jne 0x3746
pushq $0x1
popq %rdi
movl %r14d, %esi
callq 0x222c
testl %eax, %eax
je 0x3769
testl %ebp, %ebp
je 0x375f
pushq $0x21
popq %rdi
movl %r15d, %esi
callq 0x4dbd
movq %r12, %rdi
xorl %eax, %eax
callq 0x2030
movl %r14d, %edi
callq 0x2d79
xorl %ebp, %ebp
xorl %edi, %edi
movl %r14d, %esi
callq 0x222c
testl %eax, %eax
je 0x3789
cmpl $0x0, 0x4(%rbx,%r14,8)
jle 0x3789
movl %r14d, %edi
callq 0x27e6
jmp 0x37a0
cmpl $0x0, 0x4(%r13,%r14,8)
jle 0x37a0
cmpl $0x0, (%rbx,%r14,8)
jle 0x37a0
movl %r14d, %edi
callq 0x2b0e
incq %r14
jmp 0x370f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqbat.c
// Function: blast
void blast(tplanet *planet, int factors)
{
    int killed;

    killed = MIN(planet->capacity, factors / 4);
    planet->inhabitants =
        MIN(planet->inhabitants, planet->capacity) - killed;
    planet->iu = MIN(planet->iu - killed, planet->inhabitants * iu_ratio);
    planet->capacity = planet->capacity - killed;
    if (planet->inhabitants <= 0) {
        planet->inhabitants = 0;
        planet->iu = 0;
        planet->mb = 0;
        planet->amb = 0;
        if (planet->team != none) {
            col_stars[planet->pstar][planet->team]--;
            planet->team = none;
            planet->esee_team = none;
            planet->conquered = false;
            on_board(stars[planet->pstar].x, stars[planet->pstar].y);
        };
    };
}

// Assembly:
movl %esi, %eax
pushq $0x4
popq %rcx
cltd
idivl %ecx
movl 0x4(%rdi), %ecx
movl 0x10(%rdi), %edx
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %ecx, %esi
subl %eax, %esi
cmpl %ecx, %edx
cmovgel %esi, %edx
movl %edx, 0x10(%rdi)
movl 0x14(%rdi), %ecx
subl %eax, %ecx
leal (%rdx,%rdx), %eax
cmpl %eax, %ecx
cmovgel %eax, %ecx
movl %ecx, 0x14(%rdi)
movl %esi, 0x4(%rdi)
testl %edx, %edx
jg 0x3802
leaq 0x10(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movslq 0xc(%rdi), %rax
cmpq $0x2, %rax
jne 0x3803
retq
movslq 0x30(%rdi), %rcx
shlq $0x3, %rcx
addq 0xa79e(%rip), %rcx      # 0xdfb0
decl (%rcx,%rax,4)
pushq $0x2
popq %rax
movl %eax, 0xc(%rdi)
movl %eax, 0x28(%rdi)
andl $0x0, 0x20(%rdi)
movslq 0x30(%rdi), %rax
imulq $0x18, %rax, %rax
leaq 0xcc5f(%rip), %rcx      # 0x10490
movl (%rcx,%rax), %edi
movl 0x4(%rcx,%rax), %esi
jmp 0x7107
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqd3.c
// Function: starsum
void starsum(void)
{
    char iline[81];
    int ind, i, value;
    char strs;
    printw("tar summary:");
    cle3r_left();
    point(1, 19);
    addch(':');

    get_line(iline, &ind, true);
    get_token(iline, &ind, &value, &strs);
    point(50, 1);
    if (strs == ' ') {
        for (i = 1; i <= nstars; i++)
            pr5nt_star(i);
    } else {
        do {
            i = strs - 'A' + 1;
            pr5nt_star(i);
            get_token(iline, &ind, &value, &strs);
        }
        while (strs != ' ');
    };
    clear_field();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x5464(%rip), %rdi      # 0x952a
xorl %eax, %eax
callq 0x2030
callq 0x6f4d
pushq $0x1
popq %rbx
pushq $0x13
popq %rsi
movl %ebx, %edi
callq 0x4dbd
movq 0x9f02(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
pushq $0x3a
popq %rsi
callq 0x2090
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x6dae
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x6fc3
pushq $0x32
popq %rdi
movl %ebx, %esi
callq 0x4dbd
movb (%r12), %al
cmpb $0x20, %al
jne 0x4142
cmpl $0x16, %ebx
je 0x417a
movl %ebx, %edi
callq 0x72df
incl %ebx
jmp 0x4132
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %r12
movsbl %al, %edi
addl $-0x40, %edi
callq 0x72df
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x6fc3
movb 0x7(%rsp), %al
cmpb $0x20, %al
jne 0x4156
callq 0x6eef
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqd3.c
// Function: tfsum
void tfsum(void)
{
    int i, value;
    char tfs;
    char iline[81];
    int ind;
    printw("f summary :");
    get_line(iline, &ind, true);
    get_token(iline, &ind, &value, &tfs);
    point(50, 1);
    if (tfs == ' ') {
        for (i = 1; i <= 26; i++)
            pr3nt_tf(i);
    } else {
        do {
            i = tfs - 'A' + 1;
            pr3nt_tf(i);
            get_token(iline, &ind, &value, &tfs);
        }
        while (tfs != ' ');
    };
    clear_field();
    cle3r_left();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x539a(%rip), %rdi      # 0x9537
xorl %eax, %eax
callq 0x2030
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
pushq $0x1
popq %rbx
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x6dae
leaq 0xc(%rsp), %rdx
leaq 0x7(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x6fc3
pushq $0x32
popq %rdi
movl %ebx, %esi
callq 0x4dbd
movb (%r12), %al
cmpb $0x20, %al
jne 0x41f8
cmpl $0x1b, %ebx
je 0x4230
movl %ebx, %edi
callq 0x71d7
incl %ebx
jmp 0x41e8
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x7(%rsp), %r12
movsbl %al, %edi
addl $-0x40, %edi
callq 0x71d7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x6fc3
movb 0x7(%rsp), %al
cmpb $0x20, %al
jne 0x420c
callq 0x6eef
callq 0x6f4d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqi2.c
// Function: revolt
void revolt(int starnum)
{
    tplanet *pplan;
    tteam loses, gets_back;
    pplan = stars[starnum].first_planet;
    if (col_stars[starnum][ENEMY] + col_stars[starnum][player] > 0) {
        while (pplan != nil) {
            if (pplan->conquered) {
                if ((pplan->team == player) && (!any_bc(player, starnum))) {
                    loses = player;
                    gets_back = ENEMY;
                } else if ((pplan->team == ENEMY) &&
                           (!any_bc(ENEMY, starnum))) {
                    loses = ENEMY;
                    gets_back = player;
                } else
                    loses = none;
                if (loses != none) {
                    col_stars[starnum][loses] =
                        col_stars[starnum][loses] - 1;
                    col_stars[starnum][gets_back]++;
                    pplan->team = gets_back;
                    pplan->conquered = false;
                    pplan->psee_capacity = pplan->capacity;
                    on_board(stars[starnum].x, stars[starnum].y);
                };
            };
            pplan = pplan->next;
        };
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edi, %r14
imulq $0x18, %r14, %rax
leaq 0xc22f(%rip), %r15      # 0x10490
movq 0x8(%r15,%rax), %r12
leaq 0xaa63(%rip), %rcx      # 0xecd0
movl 0x4(%rcx,%r14,8), %edx
addl (%rcx,%r14,8), %edx
setg %cl
testq %r12, %r12
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4316
movl %edi, %ebx
addq %rax, %r15
pushq $0x1
popq %rbp
pushq $0x1
popq %r13
shlq $0x3, %r14
addq 0x9d0f(%rip), %r14      # 0xdfb0
cmpl $0x0, 0x20(%r12)
je 0x430c
movl 0xc(%r12), %eax
cmpl $0x1, %eax
jne 0x42c5
movl %ebp, %edi
movl %ebx, %esi
callq 0x222c
testl %eax, %eax
je 0x42dc
movl 0xc(%r12), %eax
testl %eax, %eax
jne 0x430c
xorl %edi, %edi
movl %ebx, %esi
callq 0x222c
testl %eax, %eax
jne 0x430c
xorl %ecx, %ecx
movl %ebp, %eax
jmp 0x42e1
xorl %eax, %eax
movq %r13, %rcx
decl (%r14,%rcx,4)
movl %eax, %ecx
incl (%r14,%rcx,4)
movl %eax, 0xc(%r12)
andl $0x0, 0x20(%r12)
movl 0x4(%r12), %eax
movl %eax, 0x8(%r12)
movl (%r15), %edi
movl 0x4(%r15), %esi
callq 0x7107
movq 0x38(%r12), %r12
testq %r12, %r12
jne 0x42a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqin.c
// Function: assign_planets
void assign_planets(tstar *Ustar0, int starnum)
{
    int i1, nplanets;
    tplanet *pplanet;
    tstar ustar;

    ustar = *Ustar0;
    nplanets = rnd(4) - 2;
    if (nplanets < 0)
        nplanets = 1;
    if (nplanets == 0)
        ustar.first_planet = nil;
    else {
        new(pplanet);
        ustar.first_planet = pplanet;
        for (i1 = 1; i1 <= nplanets; i1++) {
            pplanet->number = rnd(2) + (2 * i1) - 2;
            if (rnd(4) > 2)
                pplanet->capacity = 10 * (rnd(4) + 2);
            else
                pplanet->capacity = 5 * rnd(3);
            pplanet->psee_capacity = pplanet->capacity;
            pplanet->team = none;
            pplanet->inhabitants = 0;
            pplanet->iu = 0;
            pplanet->mb = 0;
            pplanet->amb = 0;
            pplanet->conquered = false;
            pplanet->under_attack = false;
            pplanet->esee_team = none;
            pplanet->esee_def = 1;
            pplanet->pstar = starnum;
            if (i1 == nplanets)
                pplanet->next = nil;
            else {
                new(pplanet->next);
                pplanet = pplanet->next;
            }
        }
    };
    *Ustar0 = ustar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x4(%rsp)
movq %rdi, %r14
movq (%rdi), %r13
movq 0x10(%rdi), %r12
pushq $0x4
popq %rdi
callq 0x4e19
leal -0x2(%rax), %ecx
cmpl $0x2, %eax
pushq $0x1
popq %rbx
cmovgel %ecx, %ebx
xorl %r15d, %r15d
testl %ebx, %ebx
je 0x4463
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r14, 0x20(%rsp)
pushq $0x40
popq %rdi
callq 0x2070
movq %rax, %r13
testl %ebx, %ebx
movl $0x0, %r14d
cmovgl %ebx, %r14d
decl %ebx
pushq $0x4
popq %rbp
xorl %r12d, %r12d
movq %rax, 0x8(%rsp)
cmpl %r12d, %r14d
je 0x444d
pushq $0x2
popq %rdi
callq 0x4e19
addl %r15d, %eax
movl %eax, (%r13)
movl %ebp, %edi
callq 0x4e19
cmpl $0x3, %eax
jl 0x43e2
movl %ebp, %edi
callq 0x4e19
imull $0xa, %eax, %eax
addl $0x14, %eax
jmp 0x43ed
pushq $0x3
popq %rdi
callq 0x4e19
leal (%rax,%rax,4), %eax
movl %eax, 0x4(%r13)
movl %eax, 0x8(%r13)
movl $0x2, 0xc(%r13)
andq $0x0, 0x20(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x28(%r13)
movl 0x4(%rsp), %eax
movl %eax, 0x30(%r13)
cmpl %r12d, %ebx
jne 0x442c
xorl %eax, %eax
movq %r13, %rcx
jmp 0x4437
pushq $0x40
popq %rdi
callq 0x2070
movq %rax, %rcx
pushq $0x4
popq %rbp
movq %rax, 0x38(%r13)
incl %r12d
addl $0x2, %r15d
movq %rcx, %r13
jmp 0x43af
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r12
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rax
jmp 0x4465
xorl %eax, %eax
movq %r13, (%r14)
movq %rax, 0x8(%r14)
movq %r12, 0x10(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/beejjorgensen[P]conquest/conqin.c
// Function: initmach
void initmach(void)
{
    int res_amt, maxx, start_star, starnum, count;
    float slist[nstars + 1];

    en_research = 'V';
    tf[ENEMY][1].c = 1;
    tf[ENEMY][1].s = 2;
    res_amt = 2;
    research(ENEMY, en_research, res_amt);
    maxx = 0;
    start_star = 0;
    for (starnum = 1; starnum <= nstars; starnum++) {
        get_stars(starnum, slist, &count);
        count += rnd(5);
        if (count > maxx) {
            maxx = count;
            start_star = starnum;
        }
    }
    tf[ENEMY][1].dest = start_star;
    tf[ENEMY][1].x = stars[start_star].x;
    tf[ENEMY][1].y = stars[start_star].y;
    stars[start_star].visit[ENEMY] = true;
    tf_stars[start_star][ENEMY] = 1;
    point(50, 1);
    pr5nt_star(tf[player][1].dest);
    clear_field();
    if (start_star == tf[player][1].dest) {
        cle3r_left();
        battle();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0xa143(%rip), %rax      # 0xed80
movb $0x56, (%rax)
leaq 0xad49(%rip), %rax      # 0xf990
movl $0x1, 0x4c(%rax)
movl $0x2, 0x44(%rax)
xorl %r13d, %r13d
pushq $0x56
popq %rsi
pushq $0x2
popq %rdx
xorl %edi, %edi
callq 0x77c6
pushq $0x1
popq %rbx
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
pushq $0x5
popq %rbp
xorl %r12d, %r12d
cmpl $0x16, %ebx
je 0x4ca8
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6e9e
movl %ebp, %edi
callq 0x4e19
addl 0xc(%rsp), %eax
cmpl %r13d, %eax
cmovgl %eax, %r13d
movl %eax, 0xc(%rsp)
cmovgl %ebx, %r12d
incl %ebx
jmp 0x4c78
leaq 0xace1(%rip), %r14      # 0xf990
movl %r12d, 0x54(%r14)
movslq %r12d, %rbx
imulq $0x18, %rbx, %rax
leaq 0xb7cf(%rip), %rcx      # 0x10490
movq (%rcx,%rax), %rdx
movq %rdx, 0x34(%r14)
pushq $0x1
popq %rsi
movl %esi, 0x10(%rcx,%rax)
leaq 0x9f49(%rip), %rax      # 0xec20
movl %esi, (%rax,%rbx,8)
pushq $0x32
popq %rdi
callq 0x4dbd
movl 0x5d0(%r14), %edi
callq 0x72df
callq 0x6eef
cmpl 0x5d0(%r14), %ebx
jne 0x4d06
callq 0x6f4d
callq 0x36e4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)