	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcspkr_input_event
_pcspkr_input_event:                    ## @pcspkr_input_event
	.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	%ecx, %r14d
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	_pcsp_chip@GOTPCREL(%rip), %rbx
	leaq	4(%rbx), %rdi
	callq	_atomic_read
	xorl	%r13d, %r13d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.1:
	cmpl	$0, (%rbx)
	je	LBB0_9
## %bb.2:
	movl	$-1, %r13d
	cmpl	$130, %r12d
	jne	LBB0_9
## %bb.3:
	cmpl	$128, %r15d
	je	LBB0_6
## %bb.4:
	cmpl	$129, %r15d
	jne	LBB0_9
## %bb.5:
	testl	%r14d, %r14d
	movl	$1000, %eax                     ## imm = 0x3E8
	cmovel	%r14d, %eax
	movl	%eax, %r14d
LBB0_6:
	leal	-21(%r14), %eax
	xorl	%r13d, %r13d
	movl	$0, %edi
	cmpl	$32745, %eax                    ## imm = 0x7FE9
	ja	LBB0_8
## %bb.7:
	movq	_PIT_TICK_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r14d
	movl	%eax, %edi
LBB0_8:
	callq	_pcspkr_do_sound
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pcsp_chip,8,2                  ## @pcsp_chip
	.comm	_PIT_TICK_RATE,4,2              ## @PIT_TICK_RATE
	.no_dead_strip	_pcspkr_input_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcspkr_input_event
_pcspkr_input_event:                    ; @pcspkr_input_event
	.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, x3
	mov	x20, x2
	mov	x21, x1
Lloh0:
	adrp	x22, _pcsp_chip@GOTPAGE
Lloh1:
	ldr	x22, [x22, _pcsp_chip@GOTPAGEOFF]
	add	x0, x22, #4
	bl	_atomic_read
	ldr	w8, [x22]
	cmp	x0, #0
	ccmp	w8, #0, #4, eq
	b.eq	LBB0_10
; %bb.1:
	cmp	w21, #130
	b.ne	LBB0_7
; %bb.2:
	cmp	w20, #128
	b.eq	LBB0_5
; %bb.3:
	cmp	w20, #129
	b.ne	LBB0_7
; %bb.4:
	mov	w8, #1000
	cmp	w19, #0
	csel	w19, wzr, w8, eq
LBB0_5:
	sub	w8, w19, #21
	mov	w9, #32745
	cmp	w8, w9
	b.hi	LBB0_8
; %bb.6:
Lloh2:
	adrp	x8, _PIT_TICK_RATE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PIT_TICK_RATE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sdiv	w0, w8, w19
	b	LBB0_9
LBB0_7:
	mov	w0, #-1
	b	LBB0_11
LBB0_8:
	mov	w0, #0
LBB0_9:
	bl	_pcspkr_do_sound
LBB0_10:
	mov	w0, #0
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_pcsp_chip,8,2                  ; @pcsp_chip
	.comm	_PIT_TICK_RATE,4,2              ; @PIT_TICK_RATE
	.no_dead_strip	_pcspkr_input_event
.subsections_via_symbols
