	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vhpet_mmio_read                ## -- Begin function vhpet_mmio_read
	.p2align	4, 0x90
_vhpet_mmio_read:                       ## @vhpet_mmio_read
	.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	%r8d, %ebx
	movq	%rcx, %r14
	movl	%edx, %r13d
	callq	_vm_hpet
	movq	%rax, %r15
	movq	_VHPET_BASE@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	%r15, %rdi
	callq	_VHPET_LOCK
	cmpl	$4, %ebx
	je	LBB0_3
## %bb.1:
	cmpl	$8, %ebx
	jne	LBB0_2
LBB0_3:
	leal	-1(%rbx), %eax
	testl	%eax, %r13d
	je	LBB0_4
LBB0_2:
	movl	16(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	callq	_VM_CTR2
	xorl	%r12d, %r12d
LBB0_30:
	movq	%r15, %rdi
	callq	_VHPET_UNLOCK
	movl	%r12d, (%r14)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_HPET_CAPABILITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	je	LBB0_6
## %bb.5:
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_6
## %bb.7:
	movq	_HPET_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	je	LBB0_9
## %bb.8:
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_9
## %bb.10:
	movq	_HPET_ISR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	je	LBB0_12
## %bb.11:
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_12
## %bb.13:
	movq	_HPET_MAIN_COUNTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	je	LBB0_17
## %bb.14:
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_17
## %bb.15:
	movq	_VHPET_NUM_TIMERS@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.18:
	xorl	%ebx, %ebx
	movl	$8, %edx
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_HPET_TIMER_CAP_CNF
	cmpl	%eax, %r13d
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %edi
	callq	_HPET_TIMER_CAP_CNF
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %edi
	callq	_HPET_TIMER_COMPARATOR
	cmpl	%eax, %r13d
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %edi
	callq	_HPET_TIMER_COMPARATOR
	addl	$4, %eax
	cmpl	%eax, %r13d
	je	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %edi
	callq	_HPET_TIMER_FSB_VAL
	cmpl	%eax, %r13d
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %edi
	callq	_HPET_TIMER_FSB_ADDR
	cmpl	%eax, %r13d
	je	LBB0_27
## %bb.31:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	%ebx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addq	$12, %rdx
                                        ## implicit-def: $eax
	movq	_VHPET_NUM_TIMERS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jl	LBB0_19
	jmp	LBB0_29
LBB0_6:
	xorl	%eax, %eax
	callq	_vhpet_capabilities
	movl	%eax, %r12d
	jmp	LBB0_30
LBB0_9:
	movl	(%r15), %r12d
	jmp	LBB0_30
LBB0_12:
	movl	4(%r15), %r12d
	jmp	LBB0_30
LBB0_17:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vhpet_counter
	movl	%eax, %r12d
	jmp	LBB0_30
LBB0_16:
	xorl	%ebx, %ebx
                                        ## implicit-def: $eax
	jmp	LBB0_29
LBB0_21:
	movq	8(%r15), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, %rcx
	addq	$-8, %rcx
	jmp	LBB0_28
LBB0_24:
	movq	8(%r15), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, %rcx
	addq	$-4, %rcx
	jmp	LBB0_28
LBB0_27:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	8(%r15), %rcx
LBB0_28:
	movl	(%rcx), %eax
LBB0_29:
	movq	_VHPET_NUM_TIMERS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	cmovll	%eax, %r12d
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_VHPET_BASE,4,2                 ## @VHPET_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hpet invalid mmio read: offset 0x%08x, size %d"

	.comm	_HPET_CAPABILITIES,4,2          ## @HPET_CAPABILITIES
	.comm	_HPET_CONFIG,4,2                ## @HPET_CONFIG
	.comm	_HPET_ISR,4,2                   ## @HPET_ISR
	.comm	_HPET_MAIN_COUNTER,4,2          ## @HPET_MAIN_COUNTER
	.comm	_VHPET_NUM_TIMERS,4,2           ## @VHPET_NUM_TIMERS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vhpet_mmio_read                ; -- Begin function vhpet_mmio_read
	.p2align	2
_vhpet_mmio_read:                       ; @vhpet_mmio_read
	.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, x4
	mov	x19, x3
	mov	x21, x2
	bl	_vm_hpet
	mov	x20, x0
Lloh0:
	adrp	x8, _VHPET_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VHPET_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w21, w21, w8
	bl	_VHPET_LOCK
	cmp	w22, #4
	b.eq	LBB0_2
; %bb.1:
	cmp	w22, #8
	b.ne	LBB0_3
LBB0_2:
	sub	w8, w22, #1
	tst	w21, w8
	b.eq	LBB0_5
LBB0_3:
	ldr	w0, [x20, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x22
	bl	_VM_CTR2
	mov	w21, #0
LBB0_4:
	mov	x0, x20
	bl	_VHPET_UNLOCK
	str	w21, [x19]
	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
LBB0_5:
Lloh5:
	adrp	x8, _HPET_CAPABILITIES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HPET_CAPABILITIES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w9, w8, #4
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_7
; %bb.6:
	bl	_vhpet_capabilities
	mov	x21, x0
	b	LBB0_4
LBB0_7:
Lloh8:
	adrp	x8, _HPET_CONFIG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HPET_CONFIG@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	w9, w8, #4
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_9
; %bb.8:
	ldr	w21, [x20]
	b	LBB0_4
LBB0_9:
Lloh11:
	adrp	x8, _HPET_ISR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HPET_ISR@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	w9, w8, #4
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_11
; %bb.10:
	ldr	w21, [x20, #4]
	b	LBB0_4
LBB0_11:
Lloh14:
	adrp	x8, _HPET_MAIN_COUNTER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HPET_MAIN_COUNTER@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	add	w9, w8, #4
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, #0
	bl	_vhpet_counter
	mov	x21, x0
	b	LBB0_4
LBB0_13:
Lloh17:
	adrp	x23, _VHPET_NUM_TIMERS@GOTPAGE
Lloh18:
	ldr	x23, [x23, _VHPET_NUM_TIMERS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.14:
	mov	w22, #0
	mov	w24, #8
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_CAP_CNF
	cmp	w21, w0
	b.eq	LBB0_23
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_CAP_CNF
	add	w8, w0, #4
	cmp	w21, w8
	b.eq	LBB0_23
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_COMPARATOR
	cmp	w21, w0
	b.eq	LBB0_24
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_COMPARATOR
	add	w8, w0, #4
	cmp	w21, w8
	b.eq	LBB0_24
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_FSB_VAL
	cmp	w21, w0
	b.eq	LBB0_25
; %bb.20:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_HPET_TIMER_FSB_ADDR
	cmp	w21, w0
	b.eq	LBB0_25
; %bb.21:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w22, w22, #1
	ldr	w9, [x23]
	add	x24, x24, #12
                                        ; implicit-def: $w8
	cmp	w22, w9
	b.lt	LBB0_15
	b	LBB0_27
LBB0_22:
	mov	w22, #0
                                        ; implicit-def: $w8
	b	LBB0_27
LBB0_23:
	ldr	x8, [x20, #8]
	add	x8, x8, x24
	sub	x8, x8, #8
	b	LBB0_26
LBB0_24:
	ldr	x8, [x20, #8]
	add	x8, x8, x24
	sub	x8, x8, #4
	b	LBB0_26
LBB0_25:
	ldr	x8, [x20, #8]
	add	x8, x8, x24
LBB0_26:
	ldr	w8, [x8]
LBB0_27:
	ldr	w9, [x23]
	cmp	w22, w9
	csel	w21, w8, wzr, lt
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_VHPET_BASE,4,2                 ; @VHPET_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hpet invalid mmio read: offset 0x%08x, size %d"

	.comm	_HPET_CAPABILITIES,4,2          ; @HPET_CAPABILITIES
	.comm	_HPET_CONFIG,4,2                ; @HPET_CONFIG
	.comm	_HPET_ISR,4,2                   ; @HPET_ISR
	.comm	_HPET_MAIN_COUNTER,4,2          ; @HPET_MAIN_COUNTER
	.comm	_VHPET_NUM_TIMERS,4,2           ; @VHPET_NUM_TIMERS
.subsections_via_symbols
