	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function speaker_ioport_read
_speaker_ioport_read:                   ## @speaker_ioport_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %rbx
	callq	_speaker_to_pit
	movq	%rax, %r13
	movq	_KVM_SPEAKER_BASE_ADDRESS@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_1
## %bb.2:
	movq	(%r13), %r12
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	callq	_ktime_to_ns
	movq	%rax, %rbx
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r13, %r15
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %r14d
	addl	%r14d, %r14d
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_pit_get_gate
	movl	%eax, %r13d
	orl	%r14d, %r13d
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_pit_get_out
	shll	$5, %eax
	shrl	$10, %ebx
	andl	$16, %ebx
	orl	%r13d, %ebx
	orl	%eax, %ebx
	movl	%ebx, -48(%rbp)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	$4, %eax
	movl	$4, %edx
	cmovbl	%eax, %edx
	leaq	-48(%rbp), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_memcpy
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVM_SPEAKER_BASE_ADDRESS,8,3   ## @KVM_SPEAKER_BASE_ADDRESS
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_speaker_ioport_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function speaker_ioport_read
_speaker_ioport_read:                   ; @speaker_ioport_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x3
	mov	x20, x2
	mov	x22, x1
	bl	_speaker_to_pit
Lloh0:
	adrp	x8, _KVM_SPEAKER_BASE_ADDRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KVM_SPEAKER_BASE_ADDRESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	x22, [x0]
	bl	_ktime_get
	bl	_ktime_to_ns
	mov	x23, x0
	add	x24, x21, #12
	mov	x0, x24
	bl	_mutex_lock
	ldr	w21, [x21, #8]
	mov	x0, x22
	mov	w1, #2
	bl	_pit_get_gate
	orr	w21, w0, w21, lsl #1
	mov	x0, x22
	mov	w1, #2
	bl	_pit_get_out
	ubfx	x8, x23, #10, #22
	and	w8, w8, #0x10
	orr	w8, w21, w8
	orr	w8, w8, w0, lsl #5
	str	w8, [sp, #12]
	mov	w8, #4
	cmp	w20, #4
	csel	w2, w20, w8, lo
	add	x1, sp, #12
	mov	x0, x19
	bl	_memcpy
	mov	x0, x24
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_KVM_SPEAKER_BASE_ADDRESS,8,3   ; @KVM_SPEAKER_BASE_ADDRESS
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_speaker_ioport_read
.subsections_via_symbols
