	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dss_sp_read_packet
_dss_sp_read_packet:                    ## @dss_sp_read_packet
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	24(%rdi), %r12
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	8(%rdi), %edi
	callq	_avio_tell
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dss_skip_audio_header
	movl	(%r12), %eax
LBB0_2:
	movq	_DSS_FRAME_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	-2(%rdx), %ebx
	xorl	%r13d, %r13d
	cmpq	$0, 24(%r12)
	setne	-41(%rbp)                       ## 1-byte Folded Spill
	cmovel	%edx, %ebx
	subl	%ebx, %eax
	movl	%eax, (%r12)
	movl	(%rcx), %esi
	leal	-1(%rsi), %eax
	movl	%eax, 4(%r12)
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r14, %rcx
	movb	-41(%rbp), %al                  ## 1-byte Reload
	movb	%al, %r13b
	movl	$264, (%r14)                    ## imm = 0x108
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 24(%r14)
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	$0, 16(%r14)
	movslq	4(%r12), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	imulq	(%rcx), %rax
	shlq	$12, %rax
	movabsq	$9049929779124963879, %rcx      ## imm = 0x7D97CF2F7EF90A27
	imulq	%rcx
	leaq	(%r13,%r13,2), %r13
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$16, %rdx
	addq	%rax, %rdx
	movq	%rdx, (%r15)
	movl	(%r12), %r14d
	xorl	%eax, %eax
	testl	%r14d, %r14d
	jns	LBB0_7
## %bb.5:
	addl	%ebx, %r14d
	movl	8(%r15), %edi
	movq	16(%r12), %rsi
	addq	%r13, %rsi
	movl	%r14d, %edx
	callq	_avio_read
	movl	%r14d, %ecx
	movl	%eax, %r14d
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	cmpl	%ecx, %eax
	jl	LBB0_10
## %bb.6:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_dss_skip_audio_header
	movl	-64(%rbp), %eax                 ## 4-byte Reload
LBB0_7:
	movl	8(%r15), %edi
	cltq
	addq	%rax, %r13
	addq	16(%r12), %r13
	subl	%eax, %ebx
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_avio_read
	movl	%eax, %r14d
	cmpl	%ebx, %eax
	jl	LBB0_10
## %bb.8:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %esi
	movq	16(%r12), %rdx
	movq	%r12, %rdi
	callq	_dss_sp_byte_swap
	cmpq	$0, 8(%r12)
	js	LBB0_9
## %bb.13:
	movl	4(%rbx), %r14d
	jmp	LBB0_12
LBB0_3:
	movl	%eax, %r14d
	jmp	LBB0_12
LBB0_9:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
LBB0_10:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_packet_unref
	testl	%r14d, %r14d
	js	LBB0_12
## %bb.11:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSS_FRAME_SIZE,4,2             ## @DSS_FRAME_SIZE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_dss_sp_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dss_sp_read_packet
_dss_sp_read_packet:                    ; @dss_sp_read_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x21, x0
	ldp	x8, x20, [x0, #16]
	ldr	x23, [x8]
	ldr	w0, [x0, #8]
	bl	_avio_tell
	mov	x22, x0
	ldr	w8, [x20]
	cbnz	w8, LBB0_2
; %bb.1:
	mov	x0, x21
	mov	x1, x19
	bl	_dss_skip_audio_header
	ldr	w8, [x20]
LBB0_2:
Lloh0:
	adrp	x9, _DSS_FRAME_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DSS_FRAME_SIZE@GOTPAGEOFF]
	ldr	x10, [x20, #24]
	ldr	w11, [x9]
	sub	w12, w11, #2
	mov	w13, #3
	cmp	x10, #0
	csel	x25, xzr, x13, eq
	csel	w24, w11, w12, eq
	sub	w8, w8, w24
	str	w8, [x20]
	ldr	w1, [x9]
	sub	w8, w1, #1
	str	w8, [x20, #4]
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_12
; %bb.3:
	mov	w8, #264
	str	w8, [x19]
	str	w22, [x19, #24]
	str	xzr, [x19, #16]
	ldr	x8, [x23]
	ldr	x9, [x8]
	ldp	w8, w10, [x20]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	mul	x9, x10, x9
	lsl	x9, x9, #12
	mov	x10, #2599
	movk	x10, #32505, lsl #16
	movk	x10, #53039, lsl #32
	movk	x10, #32151, lsl #48
	smulh	x9, x9, x10
	asr	x10, x9, #16
	add	x9, x10, x9, lsr #63
	str	x9, [x21]
	tbnz	w8, #31, LBB0_5
; %bb.4:
	mov	w22, #0
	b	LBB0_7
LBB0_5:
	add	w22, w8, w24
	ldr	w0, [x21, #8]
	ldr	x8, [x20, #16]
	add	x1, x8, x25
	mov	x2, x22
	bl	_avio_read
	mov	x23, x0
	cmp	w0, w22
	b.lt	LBB0_11
; %bb.6:
	mov	x0, x21
	mov	x1, x19
	bl	_dss_skip_audio_header
LBB0_7:
	ldr	w0, [x21, #8]
	ldr	x8, [x20, #16]
	add	x9, x25, w22, sxtw
	add	x1, x9, x8
	sub	w21, w24, w22
	mov	x2, x21
	bl	_avio_read
	mov	x23, x0
	cmp	w0, w21
	b.lt	LBB0_11
; %bb.8:
	ldr	w1, [x19, #8]
	ldr	x2, [x20, #16]
	mov	x0, x20
	bl	_dss_sp_byte_swap
	ldr	x8, [x20, #8]
	tbnz	x8, #63, LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
	b	LBB0_12
LBB0_10:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
LBB0_11:
	mov	x0, x19
	bl	_av_packet_unref
Lloh5:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w23, #0
	csel	w0, w23, w8, lt
LBB0_12:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DSS_FRAME_SIZE,4,2             ; @DSS_FRAME_SIZE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_dss_sp_read_packet
.subsections_via_symbols
