// File: /workspace/github_c_makefile_star2_O2/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, 0xb7af(%rip)     # 0xf720
movaps %xmm0, 0xb798(%rip)     # 0xf710
movaps %xmm0, 0xb781(%rip)     # 0xf700
movaps %xmm0, 0xb76a(%rip)     # 0xf6f0
movaps %xmm0, 0xb753(%rip)     # 0xf6e0
andl $0x0, 0xb79c(%rip)      # 0xf730
movaps %xmm0, 0xb735(%rip)     # 0xf6d0
leaq 0x22f2(%rip), %rcx      # 0x6294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2446(%rip), %rdx      # 0x63f8
jmp 0x4127
leaq 0x25a1(%rip), %rax      # 0x655f
jmp 0x40ed
leaq 0x2437(%rip), %rdx      # 0x6401
jmp 0x4127
leaq 0x2425(%rip), %rdx      # 0x63fb
jmp 0x4127
leaq 0x2413(%rip), %rdx      # 0x63f5
jmp 0x4127
leaq 0x23f2(%rip), %rdx      # 0x63e0
jmp 0x4127
leaq 0x23f5(%rip), %rdx      # 0x63ef
jmp 0x4127
leaq 0x2416(%rip), %rdx      # 0x641c
jmp 0x4127
leaq 0x2407(%rip), %rdx      # 0x6419
jmp 0x4127
leaq 0x23bc(%rip), %rdx      # 0x63da
jmp 0x4127
leaq 0x23d4(%rip), %rdx      # 0x63fe
jmp 0x4127
leaq 0x23a7(%rip), %rdx      # 0x63dd
jmp 0x4127
leaq 0x23a7(%rip), %rdx      # 0x63e9
jmp 0x4127
leaq 0x2386(%rip), %rdx      # 0x63d4
jmp 0x4127
leaq 0x237d(%rip), %rdx      # 0x63d7
jmp 0x4127
leaq 0x23bf(%rip), %rdx      # 0x6425
jmp 0x4127
leaq 0x2392(%rip), %rdx      # 0x6404
jmp 0x4127
leaq 0x2365(%rip), %rdx      # 0x63e3
jmp 0x4127
leaq 0x235c(%rip), %rdx      # 0x63e6
jmp 0x4127
leaq 0x2377(%rip), %rdx      # 0x640d
jmp 0x4127
leaq 0x236e(%rip), %rdx      # 0x6410
jmp 0x4127
leaq 0x2344(%rip), %rdx      # 0x63f2
jmp 0x4127
leaq 0x2335(%rip), %rdx      # 0x63ec
jmp 0x4127
leaq 0x2347(%rip), %rdx      # 0x6407
jmp 0x4127
leaq 0x24a6(%rip), %rax      # 0x656f
jmp 0x40ed
leaq 0x2341(%rip), %rdx      # 0x6413
jmp 0x4127
leaq 0x232f(%rip), %rdx      # 0x640a
jmp 0x4127
leaq 0x2332(%rip), %rdx      # 0x6416
jmp 0x4127
leaq 0x247a(%rip), %rax      # 0x6567
movl %ebx, %edx
shrl $0x7, %edx
andl $0x4, %edx
addq %rax, %rdx
andl $0x5ff, %ebx            # imm = 0x5FF
leaq 0xb5cb(%rip), %rdi      # 0xf6d0
leaq 0x231c(%rip), %rsi      # 0x6428
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2350
jmp 0x417b
leaq 0x2304(%rip), %rdx      # 0x6422
jmp 0x4127
leaq 0x22f8(%rip), %rdx      # 0x641f
andl $0x7ff, %ebx            # imm = 0x7FF
leaq 0xb59c(%rip), %r15      # 0xf6d0
leaq 0x22f3(%rip), %rsi      # 0x642e
movq %r15, %rdi
xorl %eax, %eax
callq 0x2350
movslq %eax, %r14
addq %r15, %r14
testl %ebx, %ebx
je 0x4168
movl %ebx, %edi
callq 0x296c
testq %rax, %rax
je 0x4168
movq %r14, %rdi
movq %rax, %rsi
callq 0x2090
jmp 0x417b
leaq 0x22bc(%rip), %rsi      # 0x642b
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2350
leaq 0xb54e(%rip), %rax      # 0xf6d0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq