	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pack_DAPF_to_DAPQ
_pack_DAPF_to_DAPQ:                     ## @pack_DAPF_to_DAPQ
	.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
	movl	%edi, %r14d
	movq	_dev@GOTPCREL(%rip), %r15
	movq	_JQS_wTail@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_readw
	movl	%eax, %ebx
	movq	_JQS_wHead@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_readw
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	testl	%r14d, %r14d
	jne	LBB0_2
## %bb.1:
	xorl	%r12d, %r12d
	cmpl	%eax, %ebx
	je	LBB0_8
LBB0_2:
	xorl	%r12d, %r12d
	movq	_DAQDS__size@GOTPCREL(%rip), %r13
	movq	_dev@GOTPCREL(%rip), %rcx
	leaq	16(%rcx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	20(%rcx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_PCTODSP_OFFSET
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %r15
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	_DAP_BUFF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	imull	%r14d, %eax
	movslq	%eax, %rsi
	movq	_dev@GOTPCREL(%rip), %rax
	addq	8(%rax), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_msnd_fifo_read_io
	movl	%eax, %ebx
	movq	%r13, %rdi
	movq	%r15, %r13
	callq	_spin_unlock_irqrestore
	testl	%ebx, %ebx
	jne	LBB0_7
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_DAP_BUFF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	imull	%r14d, %eax
	movslq	%eax, %rsi
	movq	_dev@GOTPCREL(%rip), %rax
	addq	8(%rax), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_msnd_fifo_read_io
	movl	%eax, %ebx
	testl	%ebx, %ebx
	je	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	(%r13), %rax
	movslq	%r14d, %rsi
	imulq	%rax, %rsi
	movq	_dev@GOTPCREL(%rip), %r15
	addq	8(%r15), %rsi
	movq	_DAPQ_DATA_BUFF@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	_DAQDS_wSize@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_writew
	incl	%r12d
	movl	%r14d, %eax
	incl	%eax
	cltq
	imulq	$1431655766, %rax, %rax         ## imm = 0x55555556
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	leal	(%rax,%rax,2), %eax
	negl	%eax
	addl	%eax, %r14d
	incl	%r14d
	movl	(%r13), %edi
	callq	_PCTODSP_OFFSET
	movl	%eax, %ebx
	imull	%r14d, %ebx
	movq	_JQS_wTail@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%ebx, %edi
	callq	_writew
	movq	_HDEX_PLAY_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_msnd_send_dsp_cmd
	movq	_JQS_wHead@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_readw
	cmpl	%eax, %ebx
	jne	LBB0_3
LBB0_8:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dev,24,3                       ## @dev
	.comm	_JQS_wTail,8,3                  ## @JQS_wTail
	.comm	_JQS_wHead,8,3                  ## @JQS_wHead
	.comm	_DAQDS__size,4,2                ## @DAQDS__size
	.comm	_DAP_BUFF_SIZE,4,2              ## @DAP_BUFF_SIZE
	.comm	_DAPQ_DATA_BUFF,8,3             ## @DAPQ_DATA_BUFF
	.comm	_DAQDS_wSize,8,3                ## @DAQDS_wSize
	.comm	_HDEX_PLAY_START,4,2            ## @HDEX_PLAY_START
	.no_dead_strip	_pack_DAPF_to_DAPQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pack_DAPF_to_DAPQ
_pack_DAPF_to_DAPQ:                     ; @pack_DAPF_to_DAPQ
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x20, _dev@GOTPAGE
Lloh1:
	ldr	x20, [x20, _dev@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _JQS_wTail@GOTPAGE
Lloh3:
	ldr	x9, [x9, _JQS_wTail@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	mov	x22, x0
	ldr	x8, [x20]
Lloh5:
	adrp	x25, _JQS_wHead@GOTPAGE
Lloh6:
	ldr	x25, [x25, _JQS_wHead@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readw
	cbnz	w19, LBB0_3
; %bb.1:
	cmp	w22, w0
	b.ne	LBB0_3
; %bb.2:
	mov	w21, #0
	b	LBB0_8
LBB0_3:
	mov	w21, #0
Lloh7:
	adrp	x26, _DAQDS__size@GOTPAGE
Lloh8:
	ldr	x26, [x26, _DAQDS__size@GOTPAGEOFF]
Lloh9:
	adrp	x27, _DAP_BUFF_SIZE@GOTPAGE
Lloh10:
	ldr	x27, [x27, _DAP_BUFF_SIZE@GOTPAGEOFF]
Lloh11:
	adrp	x24, _HDEX_PLAY_START@GOTPAGE
Lloh12:
	ldr	x24, [x24, _HDEX_PLAY_START@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	bl	_PCTODSP_OFFSET
	sdiv	w28, w22, w0
	cbz	w19, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x20, #20
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
	ldr	w2, [x27]
	mul	w9, w2, w28
	add	x1, x8, w9, sxtw
	add	x0, x20, #16
	bl	_msnd_fifo_read_io
	mov	x22, x0
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	cbnz	w22, LBB0_7
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	ldr	w2, [x27]
	mul	w9, w2, w28
	add	x1, x8, w9, sxtw
	add	x0, x20, #16
	bl	_msnd_fifo_read_io
	mov	x22, x0
	cbz	w22, LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrsw	x8, [x26]
	sxtw	x9, w28
	ldr	x10, [x20, #8]
	madd	x8, x8, x9, x10
Lloh13:
	adrp	x9, _DAPQ_DATA_BUFF@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DAPQ_DATA_BUFF@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
Lloh16:
	adrp	x10, _DAQDS_wSize@GOTPAGE
Lloh17:
	ldr	x10, [x10, _DAQDS_wSize@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	add	x8, x8, x9
	add	x1, x8, x10
	mov	x0, x22
	bl	_writew
	add	w21, w21, #1
	add	w8, w28, #1
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	lsr	x9, x9, #32
	add	w9, w9, w10
	add	w9, w9, w9, lsl #1
	sub	w22, w8, w9
	ldr	w0, [x26]
	bl	_PCTODSP_OFFSET
	mul	w22, w0, w22
	ldr	x8, [x20]
Lloh19:
	adrp	x9, _JQS_wTail@GOTPAGE
Lloh20:
	ldr	x9, [x9, _JQS_wTail@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	bl	_writew
	ldr	w1, [x24]
	mov	x0, x20
	bl	_msnd_send_dsp_cmd
	ldr	x8, [x20]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readw
	cmp	w22, w0
	b.ne	LBB0_4
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_dev,24,3                       ; @dev
	.comm	_JQS_wTail,8,3                  ; @JQS_wTail
	.comm	_JQS_wHead,8,3                  ; @JQS_wHead
	.comm	_DAQDS__size,4,2                ; @DAQDS__size
	.comm	_DAP_BUFF_SIZE,4,2              ; @DAP_BUFF_SIZE
	.comm	_DAPQ_DATA_BUFF,8,3             ; @DAPQ_DATA_BUFF
	.comm	_DAQDS_wSize,8,3                ; @DAQDS_wSize
	.comm	_HDEX_PLAY_START,4,2            ; @HDEX_PLAY_START
	.no_dead_strip	_pack_DAPF_to_DAPQ
.subsections_via_symbols
