	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vioapic_mmio_rw
_vioapic_mmio_rw:                       ## @vioapic_mmio_rw
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movq	%rcx, %r12
	cmpl	$4, %r8d
	jne	LBB0_3
## %bb.1:
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_VIOAPIC_BASE@GOTPCREL(%rip), %rax
	subq	(%rax), %rbx
	movq	_IOREGSEL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_5
## %bb.2:
	movq	_IOWIN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_5
LBB0_3:
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.4:
	movq	$0, (%r12)
	jmp	LBB0_13
LBB0_5:
	movq	%r14, %rdi
	callq	_VIOAPIC_LOCK
	movq	_IOREGSEL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_9
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.7:
	movq	(%r14), %rax
	movq	%rax, (%r12)
	jmp	LBB0_12
LBB0_9:
	movq	(%r14), %rdx
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_vioapic_read
	movq	%rax, (%r12)
	jmp	LBB0_12
LBB0_8:
	movq	(%r12), %rax
	movq	%rax, (%r14)
	jmp	LBB0_12
LBB0_11:
	movq	(%r12), %rcx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_vioapic_write
LBB0_12:
	movq	%r14, %rdi
	callq	_VIOAPIC_UNLOCK
LBB0_13:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIOAPIC_BASE,8,3               ## @VIOAPIC_BASE
	.comm	_IOREGSEL,8,3                   ## @IOREGSEL
	.comm	_IOWIN,8,3                      ## @IOWIN
	.no_dead_strip	_vioapic_mmio_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vioapic_mmio_rw
_vioapic_mmio_rw:                       ; @vioapic_mmio_rw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x5
	mov	x20, x3
	cmp	w4, #4
	b.ne	LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _VIOAPIC_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIOAPIC_BASE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x23, _IOREGSEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _IOREGSEL@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh5:
	adrp	x10, _IOWIN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _IOWIN@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	sub	x24, x2, x8
	cmp	x24, x9
	ccmp	x24, x10, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	x21, x1
	mov	x19, x0
	bl	_VIOAPIC_LOCK
	ldr	x8, [x23]
	cmp	x24, x8
	b.ne	LBB0_7
; %bb.3:
	cbz	w22, LBB0_9
; %bb.4:
	ldr	x8, [x19]
	str	x8, [x20]
	b	LBB0_11
LBB0_5:
	cbz	w22, LBB0_12
; %bb.6:
	str	xzr, [x20]
	b	LBB0_12
LBB0_7:
	ldr	x2, [x19]
	cbz	w22, LBB0_10
; %bb.8:
	mov	x0, x19
	mov	x1, x21
	bl	_vioapic_read
	str	x0, [x20]
	b	LBB0_11
LBB0_9:
	ldr	x8, [x20]
	str	x8, [x19]
	b	LBB0_11
LBB0_10:
	ldr	x3, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_vioapic_write
LBB0_11:
	mov	x0, x19
	bl	_VIOAPIC_UNLOCK
LBB0_12:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VIOAPIC_BASE,8,3               ; @VIOAPIC_BASE
	.comm	_IOREGSEL,8,3                   ; @IOREGSEL
	.comm	_IOWIN,8,3                      ; @IOWIN
	.no_dead_strip	_vioapic_mmio_rw
.subsections_via_symbols
