	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcsp_timer_update
_pcsp_timer_update:                     ## @pcsp_timer_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %edi
	movl	$97, %esi
	callq	_outb
	movl	$0, (%rbx)
	movq	16(%rbx), %rax
	jmp	LBB0_14
LBB0_2:
	movq	40(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	8(%rbx), %ecx
	movl	12(%rbx), %edx
	addl	%edx, %ecx
	decl	%ecx
	movslq	%ecx, %rcx
	movzbl	(%rax,%rcx), %eax
	leal	-128(%rax), %ecx
	cmpq	$0, 32(%rbx)
	movzbl	%cl, %ecx
	cmovel	%eax, %ecx
	movzbl	%cl, %r14d
	xorl	%eax, %eax
	callq	_CUR_DIV
	movzbl	%al, %eax
	imull	%r14d, %eax
	movl	%eax, %r14d
	shrl	$8, %r14d
	cmpl	$256, %eax                      ## imm = 0x100
	jb	LBB0_10
## %bb.5:
	cmpq	$0, 24(%rbx)
	je	LBB0_10
## %bb.6:
	movq	_i8253_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_nforce_wa@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	4(%rbx), %edi
	je	LBB0_7
## %bb.8:
	xorl	$2, %edi
	movl	$97, %esi
	callq	_outb
	movl	$1, (%rbx)
	jmp	LBB0_9
LBB0_3:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_7:
	movzbl	%dil, %edi
	movl	$97, %esi
	callq	_outb_p
	movzbl	%r14b, %edi
	movl	$66, %esi
	callq	_outb_p
	movl	4(%rbx), %edi
	xorl	$1, %edi
	movl	$97, %esi
	callq	_outb
LBB0_9:
	movq	_i8253_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
LBB0_10:
	xorl	%eax, %eax
	callq	_PCSP_PERIOD_NS
	movq	%rax, 16(%rbx)
	cmpl	$0, (%rbx)
	je	LBB0_11
## %bb.12:
	movzbl	%r14b, %edi
	callq	_PCSP_CALC_NS
	movq	16(%rbx), %rcx
	jmp	LBB0_13
LBB0_11:
	movq	%rax, %rcx
LBB0_13:
	subq	%rax, %rcx
	movq	%rcx, 16(%rbx)
LBB0_14:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i8253_lock,4,2                 ## @i8253_lock
	.comm	_nforce_wa,4,2                  ## @nforce_wa
	.no_dead_strip	_pcsp_timer_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcsp_timer_update
_pcsp_timer_update:                     ; @pcsp_timer_update
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
	mov	w1, #97
	bl	_outb
	str	wzr, [x19]
	ldr	x0, [x19, #16]
	b	LBB0_14
LBB0_2:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldp	w9, w10, [x19, #8]
	add	w9, w9, w10
	sub	w9, w9, #1
	ldrb	w8, [x8, w9, sxtw]
	ldr	x9, [x19, #32]
	eor	w10, w8, #0x80
	cmp	x9, #0
	csel	w8, w8, w10, eq
	and	w20, w8, #0xff
	bl	_CUR_DIV
	mul	w21, w20, w0
	cmp	w21, #256
	b.lo	LBB0_10
; %bb.4:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_10
; %bb.5:
Lloh0:
	adrp	x0, _i8253_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _i8253_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x8, _nforce_wa@GOTPAGE
Lloh3:
	ldr	x8, [x8, _nforce_wa@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	ldr	w8, [x19, #4]
	cbz	w9, LBB0_8
; %bb.6:
	eor	w0, w8, #0x2
	mov	w1, #97
	bl	_outb
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_9
LBB0_7:
	mov	x0, #0
	b	LBB0_14
LBB0_8:
	lsr	w20, w21, #8
	and	w0, w8, #0xff
	mov	w1, #97
	bl	_outb_p
	mov	x0, x20
	mov	w1, #66
	bl	_outb_p
	ldr	w8, [x19, #4]
	eor	w0, w8, #0x1
	mov	w1, #97
	bl	_outb
LBB0_9:
Lloh5:
	adrp	x0, _i8253_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _i8253_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
LBB0_10:
	bl	_PCSP_PERIOD_NS
	str	x0, [x19, #16]
	ldr	w9, [x19]
	cbz	w9, LBB0_12
; %bb.11:
	lsr	w0, w21, #8
	bl	_PCSP_CALC_NS
	ldr	x8, [x19, #16]
	b	LBB0_13
LBB0_12:
	mov	x8, x0
LBB0_13:
	sub	x8, x8, x0
	str	x8, [x19, #16]
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_i8253_lock,4,2                 ; @i8253_lock
	.comm	_nforce_wa,4,2                  ; @nforce_wa
	.no_dead_strip	_pcsp_timer_update
.subsections_via_symbols
