	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i8254_get_timecount
_i8254_get_timecount:                   ## @i8254_get_timecount
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %edi
	callq	_device_get_softc
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_read_rflags
	movl	%eax, %r14d
	movq	_clock_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock_spin
	movq	_TIMER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TIMER_SEL0@GOTPCREL(%rip), %rax
	movq	_TIMER_LATCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_outb
	movq	_TIMER_CNTR0@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_inb
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_inb
	movq	_i8254_max_count@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	shll	$8, %eax
	orl	%ebx, %eax
	movl	%ecx, %ebx
	subl	%eax, %ebx
	movq	_i8254_lastcount@GOTPCREL(%rip), %r15
	cmpl	(%r15), %ebx
	jge	LBB0_3
LBB0_10:
	movq	_i8254_ticked@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movslq	%ecx, %rax
	movq	_i8254_offset@GOTPCREL(%rip), %rcx
	addq	%rax, (%rcx)
	jmp	LBB0_11
LBB0_1:
	movq	_i8254_max_count@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_getit
	subl	%eax, %ebx
	jmp	LBB0_12
LBB0_3:
	movq	_i8254_ticked@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
LBB0_11:
	movl	%ebx, (%r15)
	movq	_i8254_offset@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	_clock_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_clkintr_pending@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_10
## %bb.5:
	cmpl	$20, %ebx
	jl	LBB0_8
## %bb.6:
	movq	_PSL_I@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_11
## %bb.7:
	shrl	%ecx
	cmpl	%ecx, %ebx
	jae	LBB0_11
LBB0_8:
	movq	_i8254_intsrc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i8254_pending
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movl	(%r12), %ecx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_i8254_max_count,4,2            ## @i8254_max_count
	.comm	_clock_lock,4,2                 ## @clock_lock
	.comm	_TIMER_MODE,4,2                 ## @TIMER_MODE
	.comm	_TIMER_SEL0,4,2                 ## @TIMER_SEL0
	.comm	_TIMER_LATCH,4,2                ## @TIMER_LATCH
	.comm	_TIMER_CNTR0,4,2                ## @TIMER_CNTR0
	.comm	_i8254_lastcount,4,2            ## @i8254_lastcount
	.comm	_i8254_ticked,4,2               ## @i8254_ticked
	.comm	_clkintr_pending,8,3            ## @clkintr_pending
	.comm	_PSL_I,4,2                      ## @PSL_I
	.comm	_i8254_intsrc,4,2               ## @i8254_intsrc
	.comm	_i8254_offset,8,3               ## @i8254_offset
	.no_dead_strip	_i8254_get_timecount
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i8254_get_timecount
_i8254_get_timecount:                   ; @i8254_get_timecount
	.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
	ldr	w0, [x0]
	bl	_device_get_softc
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	bl	_read_eflags
	mov	x19, x0
Lloh0:
	adrp	x0, _clock_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _clock_lock@GOTPAGEOFF]
	bl	_mtx_lock_spin
Lloh2:
	adrp	x8, _TIMER_MODE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TIMER_MODE@GOTPAGEOFF]
Lloh4:
	adrp	x9, _TIMER_SEL0@GOTPAGE
Lloh5:
	ldr	x9, [x9, _TIMER_SEL0@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	ldr	w8, [x9]
Lloh8:
	adrp	x9, _TIMER_LATCH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TIMER_LATCH@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_outb
Lloh11:
	adrp	x21, _TIMER_CNTR0@GOTPAGE
Lloh12:
	ldr	x21, [x21, _TIMER_CNTR0@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_inb
	mov	x20, x0
	ldr	w0, [x21]
	bl	_inb
Lloh13:
	adrp	x23, _i8254_max_count@GOTPAGE
Lloh14:
	ldr	x23, [x23, _i8254_max_count@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w9, w20, w0, lsl #8
Lloh15:
	adrp	x21, _i8254_lastcount@GOTPAGE
Lloh16:
	ldr	x21, [x21, _i8254_lastcount@GOTPAGEOFF]
	ldr	w10, [x21]
	sub	w20, w8, w9
	cmp	w20, w10
Lloh17:
	adrp	x24, _i8254_ticked@GOTPAGE
Lloh18:
	ldr	x24, [x24, _i8254_ticked@GOTPAGEOFF]
Lloh19:
	adrp	x22, _i8254_offset@GOTPAGE
Lloh20:
	ldr	x22, [x22, _i8254_offset@GOTPAGEOFF]
	b.ge	LBB0_4
LBB0_2:
	mov	w9, #1
	str	w9, [x24]
	ldr	x9, [x22]
	add	x8, x9, w8, sxtw
	str	x8, [x22]
	b	LBB0_5
LBB0_3:
Lloh21:
	adrp	x8, _i8254_max_count@GOTPAGE
Lloh22:
	ldr	x8, [x8, _i8254_max_count@GOTPAGEOFF]
Lloh23:
	ldr	w19, [x8]
	bl	_getit
	sub	w19, w19, w0
	b	LBB0_6
LBB0_4:
	ldr	w9, [x24]
	cbz	w9, LBB0_7
LBB0_5:
	str	w20, [x21]
	ldr	w8, [x22]
	add	w19, w20, w8
Lloh24:
	adrp	x0, _clock_lock@GOTPAGE
Lloh25:
	ldr	x0, [x0, _clock_lock@GOTPAGEOFF]
	bl	_mtx_unlock_spin
LBB0_6:
	mov	x0, x19
	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_7:
Lloh26:
	adrp	x9, _clkintr_pending@GOTPAGE
Lloh27:
	ldr	x9, [x9, _clkintr_pending@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cbnz	x9, LBB0_2
; %bb.8:
	cmp	w20, #20
	b.lt	LBB0_11
; %bb.9:
Lloh29:
	adrp	x9, _PSL_I@GOTPAGE
Lloh30:
	ldr	x9, [x9, _PSL_I@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	tst	w9, w19
	b.ne	LBB0_5
; %bb.10:
	lsr	w8, w8, #1
	cmp	w20, w8
	b.hs	LBB0_5
LBB0_11:
Lloh32:
	adrp	x8, _i8254_intsrc@GOTPAGE
Lloh33:
	ldr	x8, [x8, _i8254_intsrc@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_i8254_pending
	cbz	x0, LBB0_5
; %bb.12:
	ldr	w8, [x23]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_i8254_max_count,4,2            ; @i8254_max_count
	.comm	_clock_lock,4,2                 ; @clock_lock
	.comm	_TIMER_MODE,4,2                 ; @TIMER_MODE
	.comm	_TIMER_SEL0,4,2                 ; @TIMER_SEL0
	.comm	_TIMER_LATCH,4,2                ; @TIMER_LATCH
	.comm	_TIMER_CNTR0,4,2                ; @TIMER_CNTR0
	.comm	_i8254_lastcount,4,2            ; @i8254_lastcount
	.comm	_i8254_ticked,4,2               ; @i8254_ticked
	.comm	_clkintr_pending,8,3            ; @clkintr_pending
	.comm	_PSL_I,4,2                      ; @PSL_I
	.comm	_i8254_intsrc,4,2               ; @i8254_intsrc
	.comm	_i8254_offset,8,3               ; @i8254_offset
	.no_dead_strip	_i8254_get_timecount
.subsections_via_symbols
