// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movzwl -0xa(%rbp), %eax
andl $0x3, %eax
movl %eax, -0x1c(%rbp)
movzwl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
leaq 0x49ded(%rip), %rax     # 0x4e8e0
movq %rax, -0x18(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x49e2f(%rip)    # 0x4e930
movaps %xmm0, 0x49e18(%rip)    # 0x4e920
movaps %xmm0, 0x49e01(%rip)    # 0x4e910
movaps %xmm0, 0x49dea(%rip)    # 0x4e900
movaps %xmm0, 0x49dd3(%rip)    # 0x4e8f0
movaps %xmm0, 0x49dbc(%rip)    # 0x4e8e0
movl $0x0, 0x49e12(%rip)     # 0x4e940
movl -0x1c(%rbp), %eax
movq %rax, -0x38(%rbp)
subq $0x3, %rax
ja 0x4cea
movq -0x38(%rbp), %rax
leaq 0x17ce(%rip), %rcx      # 0x6318
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1812(%rip), %rax      # 0x636c
movq %rax, -0x28(%rbp)
jmp 0x4c4c
leaq 0x1806(%rip), %rax      # 0x6370
movq %rax, -0x28(%rbp)
jmp 0x4c4c
leaq 0x17fa(%rip), %rax      # 0x6374
movq %rax, -0x28(%rbp)
jmp 0x4c4c
leaq 0x17ee(%rip), %rax      # 0x6378
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x96b0(%rip), %rax      # 0xe250
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x4c1e
movslq -0x1c(%rbp), %rcx
leaq 0x9698(%rip), %rax      # 0xe250
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x4c0e
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0x967a(%rip), %rax      # 0xe250
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x1615(%rip), %rsi      # 0x61fc
movb $0x0, %al
callq 0x2360
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
leaq 0x49cdb(%rip), %rax     # 0x4e8e0
movq %rax, -0x8(%rbp)
jmp 0x4cf5
jmp 0x4c10
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4b95
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x20(%rbp), %ecx
leaq 0x174c(%rip), %rsi      # 0x637c
movb $0x0, %al
callq 0x2360
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4cea
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x1727(%rip), %rsi      # 0x6382
movb $0x0, %al
callq 0x2360
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x4c80
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x4c8c
movl -0x20(%rbp), %edi
callq 0x2bb0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4cc3
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x1552(%rip), %rsi      # 0x61fc
movb $0x0, %al
callq 0x2360
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4ce8
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %edx
leaq 0x16ae(%rip), %rsi      # 0x637f
movb $0x0, %al
callq 0x2360
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4cea
leaq 0x49bef(%rip), %rax     # 0x4e8e0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop