// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
shrl $0xb, %eax
andl $0x1f, %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0xc38c(%rip)     # 0x10720
movaps %xmm0, 0xc375(%rip)     # 0x10710
movaps %xmm0, 0xc35e(%rip)     # 0x10700
movaps %xmm0, 0xc347(%rip)     # 0x106f0
movaps %xmm0, 0xc330(%rip)     # 0x106e0
movaps %xmm0, 0xc319(%rip)     # 0x106d0
movl $0x0, 0xc36f(%rip)      # 0x10730
leaq 0x2ecc(%rip), %rcx      # 0x7294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3010(%rip), %rdx      # 0x73e8
jmp 0x454d
leaq 0x314b(%rip), %rax      # 0x752f
jmp 0x4513
leaq 0x3001(%rip), %rdx      # 0x73f1
jmp 0x454d
leaq 0x2fef(%rip), %rdx      # 0x73eb
jmp 0x454d
leaq 0x2fdd(%rip), %rdx      # 0x73e5
jmp 0x454d
leaq 0x2fbc(%rip), %rdx      # 0x73d0
jmp 0x454d
leaq 0x2fbf(%rip), %rdx      # 0x73df
jmp 0x454d
leaq 0x2fe0(%rip), %rdx      # 0x740c
jmp 0x454d
leaq 0x2fd1(%rip), %rdx      # 0x7409
jmp 0x454d
leaq 0x2f86(%rip), %rdx      # 0x73ca
jmp 0x454d
leaq 0x2f9e(%rip), %rdx      # 0x73ee
jmp 0x454d
leaq 0x2f71(%rip), %rdx      # 0x73cd
jmp 0x454d
leaq 0x2f71(%rip), %rdx      # 0x73d9
jmp 0x454d
leaq 0x2f50(%rip), %rdx      # 0x73c4
jmp 0x454d
leaq 0x2f47(%rip), %rdx      # 0x73c7
jmp 0x454d
leaq 0x2f89(%rip), %rdx      # 0x7415
jmp 0x454d
leaq 0x2f5c(%rip), %rdx      # 0x73f4
jmp 0x454d
leaq 0x2f2f(%rip), %rdx      # 0x73d3
jmp 0x454d
leaq 0x2f26(%rip), %rdx      # 0x73d6
jmp 0x454d
leaq 0x2f41(%rip), %rdx      # 0x73fd
jmp 0x454d
leaq 0x2f38(%rip), %rdx      # 0x7400
jmp 0x454d
leaq 0x2f0e(%rip), %rdx      # 0x73e2
jmp 0x454d
leaq 0x2eff(%rip), %rdx      # 0x73dc
jmp 0x454d
leaq 0x2f11(%rip), %rdx      # 0x73f7
jmp 0x454d
leaq 0x3050(%rip), %rax      # 0x753f
jmp 0x4513
leaq 0x2f0b(%rip), %rdx      # 0x7403
jmp 0x454d
leaq 0x2ef9(%rip), %rdx      # 0x73fa
jmp 0x454d
leaq 0x2efc(%rip), %rdx      # 0x7406
jmp 0x454d
leaq 0x3024(%rip), %rax      # 0x7537
movl %ebx, %edx
shrl $0x7, %edx
andl $0x4, %edx
addq %rax, %rdx
andl $0x5ff, %ebx            # imm = 0x5FF
leaq 0xc1a5(%rip), %rdi      # 0x106d0
leaq 0x2ee6(%rip), %rsi      # 0x7418
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2350
jmp 0x45a1
leaq 0x2ece(%rip), %rdx      # 0x7412
jmp 0x454d
leaq 0x2ec2(%rip), %rdx      # 0x740f
andl $0x7ff, %ebx            # imm = 0x7FF
leaq 0xc176(%rip), %r15      # 0x106d0
leaq 0x2ebd(%rip), %rsi      # 0x741e
movq %r15, %rdi
xorl %eax, %eax
callq 0x2350
movslq %eax, %r14
addq %r15, %r14
testl %ebx, %ebx
je 0x458e
movl %ebx, %edi
callq 0x29cb
testq %rax, %rax
je 0x458e
movq %r14, %rdi
movq %rax, %rsi
callq 0x2090
jmp 0x45a1
leaq 0x2e86(%rip), %rsi      # 0x741b
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2350
leaq 0xc128(%rip), %rax      # 0x106d0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq