// File: /workspace/github_c_makefile_star2_O1/aap[P]rx-0/ww1/mach.c
// Function: disasm
char*
disasm(Word w)
{
	static char s[100];
	char *p;
	int op, x;
	char *opstr, *sym;;

	op = w>>11 & 037;
	x = w & ADDRMASK;
	p = s;
	memset(s, 0, 100);
	switch(op){
	case 000: opstr = "si"; goto symop;
	case 001: opstr = "rs"; goto symop;
	case 002: opstr = "bi"; goto symop;
	case 003: opstr = "rd"; goto symop;
	case 004: opstr = "bo"; goto symop;
	case 005: opstr = "rc"; goto symop;
	case 006: opstr = "sd"; goto symop;
	case 007: opstr = "cf"; goto symop;
	case 010: opstr = "ts"; goto symop;
	case 011: opstr = "td"; goto symop;
	case 012: opstr = "ta"; goto symop;
	case 013: opstr = "ck"; goto symop;
	case 014: opstr = "ad"; goto symop;
	case 015: opstr = "ex"; goto symop;
	case 016: opstr = "cp"; goto symop;
	case 017: opstr = "sp"; goto symop;
	case 020: opstr = "ca"; goto symop;
	case 021: opstr = "cs"; goto symop;
	case 022: opstr = "ad"; goto symop;
	case 023: opstr = "su"; goto symop;
	case 024: opstr = "cm"; goto symop;
	case 025: opstr = "sa"; goto symop;
	case 026: opstr = "ao"; goto symop;
	case 027: opstr = "dm"; goto symop;
	case 030: opstr = "mr"; goto symop;
	case 031: opstr = "mh"; goto symop;
	case 032: opstr = "dv"; goto symop;
	case 033: opstr = "slr\0slh"; goto sh_rot;
	case 034: opstr = "srr\0srh"; goto sh_rot;
	case 035: opstr = "sf"; goto symop;
	case 036: opstr = "clc\0clh"; goto sh_rot;
	case 037: opstr = "md"; goto symop;

	sh_rot:
		if(x & 01000)
			opstr += 4;
		x &= ~01000;
		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 %r12
pushq %rbx
movl %edi, %ebx
movl %edi, %eax
shrl $0xb, %eax
andl $0x1f, %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0xc32f(%rip)     # 0x10720
movaps %xmm0, 0xc318(%rip)     # 0x10710
movaps %xmm0, 0xc301(%rip)     # 0x10700
movaps %xmm0, 0xc2ea(%rip)     # 0x106f0
movaps %xmm0, 0xc2d3(%rip)     # 0x106e0
movaps %xmm0, 0xc2bc(%rip)     # 0x106d0
movl $0x0, 0xc312(%rip)      # 0x10730
leaq 0x2e6f(%rip), %rcx      # 0x7294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2fb3(%rip), %rdx      # 0x73e8
jmp 0x45aa
leaq 0x310b(%rip), %rax      # 0x754c
jmp 0x4570
leaq 0x2fa4(%rip), %rdx      # 0x73f1
jmp 0x45aa
leaq 0x2f92(%rip), %rdx      # 0x73eb
jmp 0x45aa
leaq 0x2f80(%rip), %rdx      # 0x73e5
jmp 0x45aa
leaq 0x2f5f(%rip), %rdx      # 0x73d0
jmp 0x45aa
leaq 0x2f62(%rip), %rdx      # 0x73df
jmp 0x45aa
leaq 0x2f83(%rip), %rdx      # 0x740c
jmp 0x45aa
leaq 0x2f74(%rip), %rdx      # 0x7409
jmp 0x45aa
leaq 0x2f29(%rip), %rdx      # 0x73ca
jmp 0x45aa
leaq 0x2f41(%rip), %rdx      # 0x73ee
jmp 0x45aa
leaq 0x2f14(%rip), %rdx      # 0x73cd
jmp 0x45aa
leaq 0x2f14(%rip), %rdx      # 0x73d9
jmp 0x45aa
leaq 0x2ef3(%rip), %rdx      # 0x73c4
jmp 0x45aa
leaq 0x2eea(%rip), %rdx      # 0x73c7
jmp 0x45aa
leaq 0x2f2c(%rip), %rdx      # 0x7415
jmp 0x45aa
leaq 0x2eff(%rip), %rdx      # 0x73f4
jmp 0x45aa
leaq 0x2ed2(%rip), %rdx      # 0x73d3
jmp 0x45aa
leaq 0x2ec9(%rip), %rdx      # 0x73d6
jmp 0x45aa
leaq 0x2ee4(%rip), %rdx      # 0x73fd
jmp 0x45aa
leaq 0x2edb(%rip), %rdx      # 0x7400
jmp 0x45aa
leaq 0x2eb1(%rip), %rdx      # 0x73e2
jmp 0x45aa
leaq 0x2ea2(%rip), %rdx      # 0x73dc
jmp 0x45aa
leaq 0x2eb4(%rip), %rdx      # 0x73f7
jmp 0x45aa
leaq 0x3010(%rip), %rax      # 0x755c
jmp 0x4570
leaq 0x2eae(%rip), %rdx      # 0x7403
jmp 0x45aa
leaq 0x2e9c(%rip), %rdx      # 0x73fa
jmp 0x45aa
leaq 0x2e9f(%rip), %rdx      # 0x7406
jmp 0x45aa
leaq 0x2fe4(%rip), %rax      # 0x7554
movl %ebx, %edx
shrl $0x7, %edx
andl $0x4, %edx
addq %rax, %rdx
andl $0x5ff, %ebx            # imm = 0x5FF
leaq 0xc148(%rip), %rdi      # 0x106d0
leaq 0x2e89(%rip), %rsi      # 0x7418
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2360
jmp 0x4604
leaq 0x2e71(%rip), %rdx      # 0x7412
jmp 0x45aa
leaq 0x2e65(%rip), %rdx      # 0x740f
andl $0x7ff, %ebx            # imm = 0x7FF
leaq 0xc119(%rip), %r14      # 0x106d0
leaq 0x2e60(%rip), %rsi      # 0x741e
xorl %r15d, %r15d
movq %r14, %rdi
xorl %eax, %eax
callq 0x2360
movslq %eax, %r12
testl %ebx, %ebx
je 0x45dc
movl %ebx, %edi
callq 0x2aeb
movq %rax, %r15
addq %r12, %r14
testq %r15, %r15
je 0x45f1
movq %r14, %rdi
movq %r15, %rsi
callq 0x2090
jmp 0x4604
leaq 0x2e23(%rip), %rsi      # 0x741b
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2360
leaq 0xc0c5(%rip), %rax      # 0x106d0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq