// File: /workspace/github_c_makefile_star2_O2/aap[P]pdp11/kd11a.c
// Function: dato
static int
dato(KD11A *cpu, int b)
{
	UNIBUS_DATA = D;
trace("dato %o %06o -> %06o ", cpu->flags, cpu->bus->data, cpu->ba);
	if(remapBA(cpu, 1))
		return 1;
trace(" phys(%o)\n", PBA);

	codes(cpu);

	if(checkbus(cpu, 1, 0))
		return 1;

	if(cpu->wrpg)
		*cpu->wrpg |= 0100;	// set if writing to page

	if(dato_cpu(cpu, b))
		goto ok;

	if((b ? datob_bus : dato_bus)(cpu->bus))
		return buserr(cpu);
ok:
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movzwl 0x22(%rdi), %edx
movq 0x28(%rdi), %rax
movw %dx, 0xc(%rax)
cmpl $0x0, 0x43fec(%rip)     # 0x49d60
je 0x5d8b
movl 0x38(%rbx), %esi
movzwl 0x24(%rbx), %ecx
leaq 0x29f2(%rip), %rdi      # 0x8776
xorl %eax, %eax
callq 0x20a0
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x6b6c
testl %eax, %eax
jne 0x5f3a
cmpl $0x0, 0x43fb7(%rip)     # 0x49d60
je 0x5dc0
movq 0x28(%rbx), %rax
movl 0x8(%rax), %esi
leaq 0x29d3(%rip), %rdi      # 0x878c
xorl %eax, %eax
callq 0x20a0
movq %rbx, %rdi
callq 0x5d3e
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x6cf5
testl %eax, %eax
je 0x5de5
movl %r14d, %r15d
jmp 0x5f3a
movq 0x130(%rbx), %rax
testq %rax, %rax
je 0x5df4
orb $0x40, (%rax)
testl %ebp, %ebp
je 0x5e0b
testb $0x1, 0x24(%rbx)
movl $0xff, %ecx
movl $0xff00, %eax           # imm = 0xFF00
cmovel %ecx, %eax
jmp 0x5e10
movl $0xffff, %eax           # imm = 0xFFFF
movq 0x28(%rbx), %rdi
movl 0x8(%rdi), %esi
cmpl $0x3e001, %esi          # imm = 0x3E001
jb 0x5f10
movl %esi, %ecx
andl $0x3fff0, %ecx          # imm = 0x3FFF0
cmpl $0x3ffa0, %ecx          # imm = 0x3FFA0
je 0x5e73
cmpl $0x3f4e0, %ecx          # imm = 0x3F4E0
je 0x5e55
cmpl $0x3ff80, %ecx          # imm = 0x3FF80
je 0x5e5f
cmpl $0x3f4c0, %ecx          # imm = 0x3F4C0
jne 0x5e87
shrl %esi
andl $0x7, %esi
orl $0x8, %esi
jmp 0x5e64
shrl %esi
andl $0x7, %esi
orl $0x8, %esi
jmp 0x5e78
shrl %esi
andl $0x7, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x6dbc
jmp 0x5f37
shrl %esi
andl $0x7, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x6e11
jmp 0x5f37
movl %esi, %ecx
andl $-0x2, %ecx
cmpl $0x3ff7a, %ecx          # imm = 0x3FF7A
jne 0x5eb4
movl 0x138(%rbx), %ecx
movl 0xc(%rdi), %edx
xorl %ecx, %edx
andl %edx, %eax
andl $0xe101, %eax           # imm = 0xE101
xorl %ecx, %eax
movw %ax, 0x138(%rbx)
jmp 0x5f37
movl %esi, %ecx
andl $-0x4, %ecx
xorl %r15d, %r15d
cmpl $0x3ff7c, %ecx          # imm = 0x3FF7C
je 0x5f3a
movl %esi, %ecx
notl %ecx
testl $0x3ff00, %ecx          # imm = 0x3FF00
jne 0x5f10
movzbl %sil, %ecx
leal -0x78(%rcx), %edx
cmpl $0x2, %edx
jb 0x5f3a
leal -0xfe(%rcx), %edx
cmpl $0x2, %edx
jb 0x5f48
addl $0xffffff04, %ecx       # imm = 0xFFFFFF04
cmpl $0x1, %ecx
ja 0x5f10
movzwl 0x82(%rbx), %ecx
movl 0xc(%rdi), %edx
xorl %ecx, %edx
andl %edx, %eax
andl $0xff00, %eax           # imm = 0xFF00
xorl %ecx, %eax
movw %ax, 0x82(%rbx)
jmp 0x5f3a
testl %ebp, %ebp
jne 0x5f1d
leaq -0x3b88(%rip), %rax     # 0x2393
jmp 0x5f24
leaq -0x3b62(%rip), %rax     # 0x23c2
callq *%rax
testl %eax, %eax
je 0x5f37
movq %rbx, %rdi
callq 0x6d98
jmp 0x5ddd
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
je 0x5f5d
movb 0x30(%rbx), %cl
andb $0x10, %cl
movb 0xc(%rdi), %dl
andb $-0x11, %dl
orb %cl, %dl
movb %dl, 0x30(%rbx)
cmpl $0x100, %eax            # imm = 0x100
jb 0x5f3a
movzwl 0xc(%rdi), %eax
movl %eax, %ecx
shrl $0xc, %ecx
andl $0x3, %ecx
movw %cx, 0x88(%rbx)
shrl $0xe, %eax
movw %ax, 0x86(%rbx)
jmp 0x5f3a