	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Q40PlayNextFrame
_Q40PlayNextFrame:                      ## @Q40PlayNextFrame
	.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
	movq	_write_sq@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	8(%rcx), %rax
	movq	(%rdx,%rax,8), %rdx
	xorl	%esi, %esi
	cmpl	%edi, 16(%rcx)
	sete	%sil
	movl	28(%rcx,%rsi,4), %esi
	movq	_q40_pp@GOTPCREL(%rip), %rdi
	movq	%rdx, (%rdi)
	movq	_q40_sc@GOTPCREL(%rip), %rdx
	movl	%esi, (%rdx)
	incq	%rax
	movslq	20(%rcx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_3:
	movq	%rdx, 8(%rcx)
	incl	24(%rcx)
	movq	_dmasound@GOTPCREL(%rip), %r13
	movl	8(%r13), %r15d
	movq	_SAMPLE_ENABLE_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	xorl	%edi, %edi
	callq	_master_outb
	movq	_Q40_IRQ_SAMPLE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_Q40Interrupt@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_free_irq
	cmpq	$0, (%r13)
	movl	(%rbx), %edi
	jne	LBB0_4
## %bb.5:
	movq	_Q40MonoInterrupt@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_Q40StereoInterrupt@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	movl	(%r12), %r8d
	leaq	L_.str(%rip), %rcx
	xorl	%edx, %edx
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	xorl	%eax, %eax
	callq	_printk_ratelimit
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
LBB0_9:
	xorl	%edi, %edi
	cmpl	$10000, %r15d                   ## imm = 0x2710
	setne	%dil
	movq	_SAMPLE_RATE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_master_outb
	movq	_SAMPLE_CLEAR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edi
	callq	_master_outb
	movl	(%r14), %esi
	movl	$1, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_master_outb                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_write_sq,40,3                  ## @write_sq
	.comm	_q40_pp,8,3                     ## @q40_pp
	.comm	_q40_sc,4,2                     ## @q40_sc
	.comm	_dmasound,16,3                  ## @dmasound
	.comm	_SAMPLE_ENABLE_REG,4,2          ## @SAMPLE_ENABLE_REG
	.comm	_Q40_IRQ_SAMPLE,4,2             ## @Q40_IRQ_SAMPLE
	.comm	_Q40Interrupt,4,2               ## @Q40Interrupt
	.comm	_Q40StereoInterrupt,4,2         ## @Q40StereoInterrupt
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Q40 sound"

	.comm	_Q40MonoInterrupt,4,2           ## @Q40MonoInterrupt
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't register sound interrupt\n"

	.comm	_SAMPLE_RATE_REG,4,2            ## @SAMPLE_RATE_REG
	.comm	_SAMPLE_CLEAR_REG,4,2           ## @SAMPLE_CLEAR_REG
	.no_dead_strip	_Q40PlayNextFrame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Q40PlayNextFrame
_Q40PlayNextFrame:                      ; @Q40PlayNextFrame
	.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
Lloh0:
	adrp	x8, _write_sq@GOTPAGE
Lloh1:
	ldr	x8, [x8, _write_sq@GOTPAGEOFF]
	ldp	x9, x10, [x8]
	ldr	x9, [x9, x10, lsl #3]
	add	x11, x8, #32
	ldp	w12, w13, [x8, #16]
                                        ; kill: def $w13 killed $w13 def $x13
	sxtw	x13, w13
	cmp	w12, w0
	add	x12, x8, #28
	csel	x11, x11, x12, eq
Lloh2:
	adrp	x12, _q40_pp@GOTPAGE
Lloh3:
	ldr	x12, [x12, _q40_pp@GOTPAGEOFF]
	ldr	w11, [x11]
Lloh4:
	str	x9, [x12]
Lloh5:
	adrp	x9, _q40_sc@GOTPAGE
Lloh6:
	ldr	x9, [x9, _q40_sc@GOTPAGEOFF]
Lloh7:
	str	w11, [x9]
	add	x9, x10, #1
	udiv	x10, x9, x13
	msub	x9, x10, x13, x9
	str	x9, [x8, #8]
	ldr	w9, [x8, #24]
	add	w9, w9, #1
	str	w9, [x8, #24]
Lloh8:
	adrp	x21, _dmasound@GOTPAGE
Lloh9:
	ldr	x21, [x21, _dmasound@GOTPAGEOFF]
	ldr	w20, [x21, #8]
Lloh10:
	adrp	x19, _SAMPLE_ENABLE_REG@GOTPAGE
Lloh11:
	ldr	x19, [x19, _SAMPLE_ENABLE_REG@GOTPAGEOFF]
	ldr	w1, [x19]
	mov	w0, #0
	bl	_master_outb
Lloh12:
	adrp	x22, _Q40_IRQ_SAMPLE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _Q40_IRQ_SAMPLE@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh14:
	adrp	x23, _Q40Interrupt@GOTPAGE
Lloh15:
	ldr	x23, [x23, _Q40Interrupt@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_free_irq
	ldr	x8, [x21]
	ldr	w0, [x22]
Lloh16:
	adrp	x9, _Q40MonoInterrupt@GOTPAGE
Lloh17:
	ldr	x9, [x9, _Q40MonoInterrupt@GOTPAGEOFF]
Lloh18:
	adrp	x10, _Q40StereoInterrupt@GOTPAGE
Lloh19:
	ldr	x10, [x10, _Q40StereoInterrupt@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w1, [x8]
	ldr	w4, [x23]
Lloh20:
	adrp	x3, l_.str@PAGE
Lloh21:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #0
	bl	_request_irq
	cbz	w0, LBB0_3
; %bb.1:
	bl	_printk_ratelimit
	cbz	x0, LBB0_3
; %bb.2:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
LBB0_3:
	mov	w8, #10000
	cmp	w20, w8
	cset	w0, ne
Lloh24:
	adrp	x8, _SAMPLE_RATE_REG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SAMPLE_RATE_REG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	bl	_master_outb
Lloh27:
	adrp	x8, _SAMPLE_CLEAR_REG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SAMPLE_CLEAR_REG@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	w0, #1
	bl	_master_outb
	ldr	w1, [x19]
	mov	w0, #1
	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
	b	_master_outb
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_write_sq,40,3                  ; @write_sq
	.comm	_q40_pp,8,3                     ; @q40_pp
	.comm	_q40_sc,4,2                     ; @q40_sc
	.comm	_dmasound,16,3                  ; @dmasound
	.comm	_SAMPLE_ENABLE_REG,4,2          ; @SAMPLE_ENABLE_REG
	.comm	_Q40_IRQ_SAMPLE,4,2             ; @Q40_IRQ_SAMPLE
	.comm	_Q40Interrupt,4,2               ; @Q40Interrupt
	.comm	_Q40StereoInterrupt,4,2         ; @Q40StereoInterrupt
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Q40 sound"

	.comm	_Q40MonoInterrupt,4,2           ; @Q40MonoInterrupt
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't register sound interrupt\n"

	.comm	_SAMPLE_RATE_REG,4,2            ; @SAMPLE_RATE_REG
	.comm	_SAMPLE_CLEAR_REG,4,2           ; @SAMPLE_CLEAR_REG
	.no_dead_strip	_Q40PlayNextFrame
.subsections_via_symbols
