	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_ctl_write
_vdp_ctl_write:                         ## @vdp_ctl_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_Pico@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movzbl	%dil, %ebx
	movl	%ebx, %r15d
	shrl	$6, %r15d
	cmpl	$2, %r15d
	jne	LBB0_3
## %bb.2:
	movl	16(%r14), %eax
	movq	8(%r14), %rcx
	movl	%ebx, %edx
	andl	$15, %edx
	movl	%eax, (%rcx,%rdx,4)
	movq	_EL_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	16(%r14), %ecx
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_elprintf
	movl	(%r14), %eax
LBB0_3:
	movb	%r15b, 20(%r14)
	movzbl	16(%r14), %ecx
	andl	$63, %ebx
	shll	$8, %ebx
	orl	%ecx, %ebx
	jmp	LBB0_5
LBB0_4:
	movl	$16128, %eax                    ## imm = 0x3F00
	andl	16(%r14), %eax
	movzbl	%dil, %ebx
	orl	%eax, %ebx
	xorl	%eax, %eax
LBB0_5:
	movl	%ebx, 16(%r14)
	xorl	$1, %eax
	movl	%eax, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,24,3                      ## @Pico
	.comm	_EL_IO,4,2                      ## @EL_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  VDP r%02x=%02x"

	.no_dead_strip	_vdp_ctl_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdp_ctl_write
_vdp_ctl_write:                         ; @vdp_ctl_write
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, _Pico@GOTPAGE
Lloh1:
	ldr	x20, [x20, _Pico@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_4
; %bb.1:
	lsr	w9, w19, #6
	cmp	w9, #2
	b.ne	LBB0_3
; %bb.2:
	ldr	w8, [x20, #16]
	ldr	x9, [x20, #8]
	and	w2, w19, #0xf
	str	w8, [x9, w2, uxtw #2]
Lloh2:
	adrp	x8, _EL_IO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EL_IO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldrb	w3, [x20, #16]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elprintf
	ldr	w8, [x20]
LBB0_3:
	lsr	w9, w19, #6
	strb	w9, [x20, #20]
	ldrb	w9, [x20, #16]
	bfi	w9, w19, #8, #6
	b	LBB0_5
LBB0_4:
	ldr	w9, [x20, #16]
	and	w9, w9, #0x3f00
	orr	w9, w9, w19
LBB0_5:
	str	w9, [x20, #16]
	eor	w8, w8, #0x1
	str	w8, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,24,3                      ; @Pico
	.comm	_EL_IO,4,2                      ; @EL_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  VDP r%02x=%02x"

	.no_dead_strip	_vdp_ctl_write
.subsections_via_symbols
