// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/ckabstape/ckabstape.c
// Function: disasm
void disasm(unsigned int instr)
{
	char *idx;
	if(instr & 0010000) idx = ",X"; else idx = "  ";

	if((instr & 0700000) != 0700000)
	switch(instr & 0740000){
	 case(0000000):
	  printf("CAL%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0040000):
	  printf("DAC%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0100000):
	  printf("JMS%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0140000):
	  printf("DZM%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0200000):
	  printf("LAC%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0240000):
	  printf("XOR%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0300000):
	  printf("ADD%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0340000):
	  printf("TAD%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0400000):
	  printf("XCT%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0440000):
	  printf("ISZ%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0500000):
	  printf("AND%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0540000):
	  printf("SAD%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 case(0600000):
	  printf("JMP%c %04o%s ", (instr & 0020000)?'*':' ', instr &07777, idx);
	  break;
	 default:
	  printf("????         ");
	  break;
	}
/*
 */
	if((instr & 0700000) == 0700000)
	 switch(instr){
	 case(0700000):
	  printf("IOT        ");
	  break;
	 case(0700002):
	  printf("IOF        ");
	  break;
	 case(0700004):
	  printf("CLOF       ");
	  break;
	 case(0700042):
	  printf("ION        ");
	  break;	

	 case(0700101):
	  printf("RSF (hsrdr)");
	  break;
	 case(0700102):
	  printf("RCF (hsrdr)");
	  break;
	 case(0700104):
	  printf("RSA (hsrdr)");
	  break;
	 case(0700112):
	  printf("RRB (hsrdr)");
	  break;
	 case(0700144):
	  printf("RSB (hsrdr)");
	  break;

	 case(0700201):
	  printf("PSF (hsptp)");
	  break;
	 case(0700202):
	  printf("PCF (hsptp)");
	  break;
	 case(0700204):
	  printf("PSA (hsptp)");
	  break;
	 case(0700244):
	  printf("PSB (hsptp)");
	  break;

	 case(0700301):
	  printf("KSF (ttykb)");
	  break;
	 case(0700312):
	  printf("KRB (ttyrd)");
	  break;
	 case(0700314):
	  printf("IORS       ");
	  break;
	 case(0700322):
	  printf("KRS (ttykb)");
	  break;

	 case(0700401):
	  printf("TSF (ttyout)");
	  break;
	 case(0700402):
	  printf("TCF (ttyout)");
	  break;
	 case(0700406):
	  printf("TLS (ttyout)");
	  break;

	
	 case(0703302):
	  printf("CAF         ");
	  break;

	 case(0707721):
	  printf("SBA         ");
	  break;
	 case(0707722):
	 case(0707762):
	  printf("DBA         ");
	  break;
	 case(0707724):
	 case(0707764):
	  printf("EBA         ");
	  break;

/*
 */
	 case(0720000):
	  printf("AAS         ");
	  break;
	 case(0723000):
	  printf("AAC         ");
	  break;
	 case(0725000):
	  printf("AXS         ");
	  break;
	 case(0736000):
	  printf("CLLR        ");
	  break;
	 case(0735000):
	  printf("CLX         ");
	  break;
	 case(0722000):
	  printf("PAL         ");
	  break;
	 case(0721000):
	  printf("PAX         ");
	  break;
	 case(0730000):
	  printf("PLA         ");
	  break;
	 case(0731000):
	  printf("PLX         ");
	  break;
	 case(0724000):
	  printf("PXA         ");
	  break;
	 case(0726000):
	  printf("PXL         ");
	  break;
	

/*
 * operate instructions
 */
	 case(0740000):
	  printf("NOP         ");
	  break;
	 case(0740001):		/* CMA compliment AC */
	  printf("CMA         ");
	  break;
	 case(0740002):
	  printf("CML         ");
	  break;
	 case(0740004):
	  printf("OAS         ");
	  break;
	 case(0740010):
	  printf("RAL         ");
	  break;
	 case(0740020):
	  printf("RAR         ");
	  break;
	 case(0740030):
	  printf("IAC         ");
	  break;
	 case(0740031):
	  printf("TCA         ");
	  break;
	 case(0740040):
	  printf("HLT         ");
	  break;
	 case(0740100):
	  printf("SMA         ");
	  break;
	 case(0740200):
	  printf("SZA         ");
	  break;
	 case(0740400):
	  printf("SNL         ");
	  break;
	 case(0741000):
	  printf("SKP         ");
	  break;
	 case(0741100):
	  printf("SPA         ");
	  break;
	 case(0741200):
	  printf("SNA         ");
	  break;
	 case(0741400):
	  printf("SZL         ");
	  break;
	 case(0742010):
	  printf("RTL         ");
	  break;
	 case(0742020):
	  printf("RTR         ");
	  break;
	 case(0742030):
	  printf("SWHA        ");
	  break;
	 case(0744000):
	  printf("CLL         ");
	  break;
	 case(0744002):
	  printf("STL         ");
	  break;	
	 case(0744010):
	  printf("CCL         ");
	  break;
	 case(0744020):
	  printf("RCL         ");
	  break;
	 case(0750000):
	  printf("CLA         ");
	  break;
	 case(0750001):
	  printf("LAS         ");
	  break;
	 case(0750004):
	  printf("LAT         ");
	  break;
	 case(0750010):
	  printf("GLK         ");
	  break;
	 case(0760000):
	  printf("LAW         ");
	  break;
	 default:
	  printf("???         ");
	  break;
	}
}

// Assembly:
movl %edi, %edx
btl $0xc, %edi
leaq 0xf0b(%rip), %rax       # 0x21c4
leaq 0xe40(%rip), %rcx       # 0x2100
cmovaeq %rax, %rcx
movl %edi, %eax
notl %eax
testl $0x38000, %eax          # imm = 0x38000
jne 0x157c
leal -0x3c000(%rdx), %eax
cmpl $0x8, %eax
jbe 0x15bc
leal -0x38041(%rdx), %eax
cmpl $0x9, %eax
jbe 0x174e
leal -0x3d000(%rdx), %eax
cmpl $0x8, %eax
jbe 0x176a
cmpl $0x3e000, %edx          # imm = 0x3E000
je 0x1a0e
cmpl $0x38002, %edx          # imm = 0x38002
je 0x1a20
cmpl $0x38004, %edx          # imm = 0x38004
je 0x1822
cmpl $0x38022, %edx          # imm = 0x38022
je 0x18b2
cmpl $0x38064, %edx          # imm = 0x38064
je 0x189a
cmpl $0x38081, %edx          # imm = 0x38081
je 0x1846
cmpl $0x38082, %edx          # imm = 0x38082
je 0x1a17
cmpl $0x38084, %edx          # imm = 0x38084
je 0x19b4
cmpl $0x380a4, %edx          # imm = 0x380A4
je 0x1882
cmpl $0x380c1, %edx          # imm = 0x380C1
je 0x182e
cmpl $0x380ca, %edx          # imm = 0x380CA
je 0x19d8
cmpl $0x380cc, %edx          # imm = 0x380CC
je 0x1942
cmpl $0x380d2, %edx          # imm = 0x380D2
je 0x18ca
cmpl $0x38101, %edx          # imm = 0x38101
je 0x19c6
cmpl $0x38102, %edx          # imm = 0x38102
je 0x19fc
cmpl $0x38106, %edx          # imm = 0x38106
je 0x183a
cmpl $0x386c2, %edx          # imm = 0x386C2
je 0x185e
cmpl $0x38fd1, %edx          # imm = 0x38FD1
je 0x1852
cmpl $0x38fd2, %edx          # imm = 0x38FD2
je 0x1786
cmpl $0x38fd4, %edx          # imm = 0x38FD4
je 0x1792
cmpl $0x38ff2, %edx          # imm = 0x38FF2
je 0x1786
cmpl $0x38ff4, %edx          # imm = 0x38FF4
je 0x1792
cmpl $0x3a000, %edx          # imm = 0x3A000
je 0x19ab
cmpl $0x3a200, %edx          # imm = 0x3A200
je 0x19f3
cmpl $0x3a400, %edx          # imm = 0x3A400
je 0x19ea
cmpl $0x3a600, %edx          # imm = 0x3A600
je 0x186a
cmpl $0x3a800, %edx          # imm = 0x3A800
je 0x1a05
cmpl $0x3aa00, %edx          # imm = 0x3AA00
je 0x18ee
cmpl $0x3ac00, %edx          # imm = 0x3AC00
je 0x18fa
cmpl $0x3b000, %edx          # imm = 0x3B000
je 0x19e1
cmpl $0x3b200, %edx          # imm = 0x3B200
je 0x19bd
cmpl $0x3ba00, %edx          # imm = 0x3BA00
je 0x1966
cmpl $0x3bc00, %edx          # imm = 0x3BC00
je 0x194e
cmpl $0x3c010, %edx          # imm = 0x3C010
je 0x19cf
cmpl $0x3c018, %edx          # imm = 0x3C018
je 0x198a
cmpl $0x3c019, %edx          # imm = 0x3C019
je 0x1936
cmpl $0x3c020, %edx          # imm = 0x3C020
je 0x1876
cmpl $0x3c040, %edx          # imm = 0x3C040
je 0x1912
cmpl $0x3c080, %edx          # imm = 0x3C080
je 0x188e
cmpl $0x3c100, %edx          # imm = 0x3C100
je 0x1972
cmpl $0x3c200, %edx          # imm = 0x3C200
je 0x18d6
cmpl $0x3c240, %edx          # imm = 0x3C240
je 0x18a6
cmpl $0x3c280, %edx          # imm = 0x3C280
je 0x1996
cmpl $0x3c300, %edx          # imm = 0x3C300
je 0x18e2
cmpl $0x3c408, %edx          # imm = 0x3C408
je 0x19a2
cmpl $0x3c410, %edx          # imm = 0x3C410
je 0x192a
cmpl $0x3c418, %edx          # imm = 0x3C418
je 0x197e
cmpl $0x3c800, %edx          # imm = 0x3C800
je 0x195a
cmpl $0x3c802, %edx          # imm = 0x3C802
je 0x18be
cmpl $0x3c808, %edx          # imm = 0x3C808
je 0x191e
cmpl $0x3c810, %edx          # imm = 0x3C810
je 0x1906
cmpl $0x38000, %edx          # imm = 0x38000
jne 0x179e
leaq 0xc50(%rip), %rdi       # 0x21c7
jmp 0x1a27
movl %edx, %eax
shrl $0xe, %eax
andl $0xf, %eax
cmpl $0xc, %eax
ja 0x16e9
leaq 0xa7c(%rip), %rsi       # 0x2010
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xb4c(%rip), %rdi       # 0x2103
jmp 0x1747
leaq 0xaa9(%rip), %rcx       # 0x206c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xdaa(%rip), %rdi       # 0x237d
jmp 0x1a27
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xbab(%rip), %rdi       # 0x219d
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xb2a(%rip), %rdi       # 0x213b
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xb7b(%rip), %rdi       # 0x21ab
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xb32(%rip), %rdi       # 0x2181
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xab1(%rip), %rdi       # 0x211f
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xaa0(%rip), %rdi       # 0x212d
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xab9(%rip), %rdi       # 0x2165
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xa46(%rip), %rdi       # 0x2111
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xa62(%rip), %rdi       # 0x2149
jmp 0x1747
leaq 0xac9(%rip), %rdi       # 0x21b9
jmp 0x1a27
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xa48(%rip), %rdi       # 0x2157
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xa64(%rip), %rdi       # 0x218f
jmp 0x1747
btl $0xd, %edx
pushq $0x20
popq %rax
pushq $0x2a
popq %rsi
cmovael %eax, %esi
andl $0xfff, %edx            # imm = 0xFFF
leaq 0xa2c(%rip), %rdi       # 0x2173
xorl %eax, %eax
jmp 0x1050
leaq 0x8ef(%rip), %rcx       # 0x2044
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa92(%rip), %rdi       # 0x21f7
jmp 0x1a27
leaq 0x91f(%rip), %rcx       # 0x2090
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xd27(%rip), %rdi       # 0x24a8
jmp 0x1a27
leaq 0xb47(%rip), %rdi       # 0x22d4
jmp 0x1a27
leaq 0xb48(%rip), %rdi       # 0x22e1
jmp 0x1a27
leaq 0xa15(%rip), %rdi       # 0x21ba
jmp 0x1a27
leaq 0xa52(%rip), %rdi       # 0x2203
jmp 0x1a27
leaq 0xa5e(%rip), %rdi       # 0x221b
jmp 0x1a27
leaq 0xa46(%rip), %rdi       # 0x220f
jmp 0x1a27
leaq 0xce0(%rip), %rdi       # 0x24b5
jmp 0x1a27
leaq 0xcee(%rip), %rdi       # 0x24cf
jmp 0x1a27
leaq 0xcd5(%rip), %rdi       # 0x24c2
jmp 0x1a27
leaq 0xbb8(%rip), %rdi       # 0x23b1
jmp 0x1a27
leaq 0xb9f(%rip), %rdi       # 0x23a4
jmp 0x1a27
leaq 0xb86(%rip), %rdi       # 0x2397
jmp 0x1a27
leaq 0xb6d(%rip), %rdi       # 0x238a
jmp 0x1a27
leaq 0x9b6(%rip), %rdi       # 0x21df
jmp 0x1a27
leaq 0xa2e(%rip), %rdi       # 0x2263
jmp 0x1a27
leaq 0xa6c(%rip), %rdi       # 0x22ad
jmp 0x1a27
leaq 0x9e6(%rip), %rdi       # 0x2233
jmp 0x1a27
leaq 0xa6e(%rip), %rdi       # 0x22c7
jmp 0x1a27
leaq 0xa55(%rip), %rdi       # 0x22ba
jmp 0x1a27
leaq 0xa8a(%rip), %rdi       # 0x22fb
jmp 0x1a27
leaq 0xb68(%rip), %rdi       # 0x23e5
jmp 0x1a27
leaq 0x9ce(%rip), %rdi       # 0x2257
jmp 0x1a27
leaq 0xb6a(%rip), %rdi       # 0x23ff
jmp 0x1a27
leaq 0x986(%rip), %rdi       # 0x2227
jmp 0x1a27
leaq 0xb79(%rip), %rdi       # 0x2426
jmp 0x1a27
leaq 0x932(%rip), %rdi       # 0x21eb
jmp 0x1a27
leaq 0xbbc(%rip), %rdi       # 0x2481
jmp 0x1a27
leaq 0x9b6(%rip), %rdi       # 0x2287
jmp 0x1a27
leaq 0xb3c(%rip), %rdi       # 0x2419
jmp 0x1a27
leaq 0xb57(%rip), %rdi       # 0x2440
jmp 0x1a27
leaq 0xa13(%rip), %rdi       # 0x2308
jmp 0x1a27
leaq 0xa6f(%rip), %rdi       # 0x2370
jmp 0x1a27
leaq 0xb8e(%rip), %rdi       # 0x249b
jmp 0x1a27
leaq 0xad9(%rip), %rdi       # 0x23f2
jmp 0x1a27
leaq 0xb69(%rip), %rdi       # 0x248e
jmp 0x1a27
leaq 0xb29(%rip), %rdi       # 0x245a
jmp 0x1a27
leaq 0xa9b(%rip), %rdi       # 0x23d8
jmp 0x1a27
leaq 0x932(%rip), %rdi       # 0x227b
jmp 0x1a27
leaq 0x9c0(%rip), %rdi       # 0x2315
jmp 0x1a27
leaq 0xb13(%rip), %rdi       # 0x2474
jmp 0x1a27
leaq 0x9b5(%rip), %rdi       # 0x2322
jmp 0x1a27
leaq 0xa93(%rip), %rdi       # 0x240c
jmp 0x1a27
leaq 0xae2(%rip), %rdi       # 0x2467
jmp 0x1a27
leaq 0xa3a(%rip), %rdi       # 0x23cb
jmp 0x1a27
leaq 0xa96(%rip), %rdi       # 0x2433
jmp 0x1a27
leaq 0xaa4(%rip), %rdi       # 0x244d
jmp 0x1a27
leaq 0x93c(%rip), %rdi       # 0x22ee
jmp 0x1a27
leaq 0x890(%rip), %rdi       # 0x224b
jmp 0x1a27
leaq 0x992(%rip), %rdi       # 0x2356
jmp 0x1a27
leaq 0x8c6(%rip), %rdi       # 0x2293
jmp 0x1a27
leaq 0x9e8(%rip), %rdi       # 0x23be
jmp 0x1a27
leaq 0x890(%rip), %rdi       # 0x226f
jmp 0x1a27
leaq 0x961(%rip), %rdi       # 0x2349
jmp 0x1a27
leaq 0x93e(%rip), %rdi       # 0x232f
jmp 0x1a27
leaq 0x942(%rip), %rdi       # 0x233c
jmp 0x1a27
leaq 0x89d(%rip), %rdi       # 0x22a0
jmp 0x1a27
leaq 0x957(%rip), %rdi       # 0x2363
jmp 0x1a27
leaq 0xac7(%rip), %rdi       # 0x24dc
jmp 0x1a27
leaq 0x821(%rip), %rdi       # 0x223f
jmp 0x1a27
leaq 0x7ac(%rip), %rdi       # 0x21d3
xorl %eax, %eax
jmp 0x1050