	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_spdif_read_packet           ## -- Begin function ff_spdif_read_packet
	.p2align	4, 0x90
_ff_spdif_read_packet:                  ## @ff_spdif_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, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r12
	xorl	%ebx, %ebx
	movq	_SYNCWORD1@GOTPCREL(%rip), %r14
	movq	_SYNCWORD2@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_AV_BSWAP16C
	movl	%eax, %r13d
	shll	$16, %r13d
	movl	(%r15), %edi
	callq	_AV_BSWAP16C
	orl	%r13d, %eax
	cmpl	%eax, %ebx
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	shll	$8, %ebx
	movq	%r12, %rdi
	callq	_avio_r8
	orl	%eax, %ebx
	movq	%r12, %rdi
	callq	_avio_feof
	testq	%rax, %rax
	je	LBB0_1
LBB0_3:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_20
LBB0_4:
	movq	%r12, %rdi
	callq	_avio_rl16
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_avio_rl16
	movl	%eax, %r13d
	testb	$15, %r13b
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_avpriv_request_sample
LBB0_6:
	movl	%r13d, %edi
	movl	$16, %esi
	callq	_FFALIGN
	sarl	$3, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_av_new_packet
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_7
LBB0_20:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r12, %rdi
	callq	_avio_tell
	movq	_BURST_HEADER_SIZE@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	8(%rbx), %rsi
	movl	4(%rbx), %edx
	movq	%r12, %rdi
	callq	_avio_read
	movl	4(%rbx), %edx
	cmpl	%edx, %eax
	jge	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_av_packet_unref
	jmp	LBB0_3
LBB0_9:
	movq	8(%rbx), %rdi
	sarl	%edx
	movq	%rdi, %rsi
	callq	_ff_spdif_bswap_buf16
	movq	8(%rbx), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_spdif_get_offset_and_codec
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_av_packet_unref
	jmp	LBB0_20
LBB0_11:
	movl	-48(%rbp), %esi
	movl	4(%rbx), %eax
	movq	_BURST_HEADER_SIZE@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	subl	%eax, %esi
	movq	%r12, %rdi
	callq	_avio_skip
	cmpl	$0, 16(%r15)
	je	LBB0_12
## %bb.14:
	movl	-44(%rbp), %eax
	movq	8(%r15), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_17
## %bb.15:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_avpriv_report_missing_feature
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_20
LBB0_12:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	(%rax), %rax
	movl	%ecx, 4(%rax)
	movl	-44(%rbp), %ecx
	movl	%ecx, (%rax)
LBB0_17:
	xorl	%r13d, %r13d
	cmpl	$0, (%r15)
	jne	LBB0_20
## %bb.18:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	shll	$5, %eax
	movl	%eax, (%r15)
	jmp	LBB0_20
LBB0_13:
	movq	%rbx, %rdi
	callq	_av_packet_unref
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_SYNCWORD1,4,2                  ## @SYNCWORD1
	.comm	_SYNCWORD2,4,2                  ## @SYNCWORD2
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Packet not ending at a 16-bit boundary"

	.comm	_BURST_HEADER_SIZE,4,2          ## @BURST_HEADER_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
L_.str.1:                               ## @.str.1
	.asciz	"Codec change in IEC 61937"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_spdif_read_packet           ; -- Begin function ff_spdif_read_packet
	.p2align	2
_ff_spdif_read_packet:                  ; @ff_spdif_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w23, #0
	ldr	x21, [x0, #24]
Lloh0:
	adrp	x24, _SYNCWORD1@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SYNCWORD1@GOTPAGEOFF]
Lloh2:
	adrp	x25, _SYNCWORD2@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SYNCWORD2@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	bl	_AV_BSWAP16C
	mov	x22, x0
	ldr	w0, [x25]
	bl	_AV_BSWAP16C
	orr	w8, w0, w22, lsl #16
	mov	x0, x21
	cmp	w23, w8
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_avio_r8
	orr	w23, w0, w23, lsl #8
	mov	x0, x21
	bl	_avio_feof
	cbz	x0, LBB0_1
LBB0_3:
Lloh4:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh6:
	ldr	w23, [x8]
	b	LBB0_7
LBB0_4:
	bl	_avio_rl16
	mov	x22, x0
	mov	x0, x21
	bl	_avio_rl16
	mov	x23, x0
	tst	w0, #0xf
	b.eq	LBB0_6
; %bb.5:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_avpriv_request_sample
LBB0_6:
	mov	x0, x23
	mov	w1, #16
	bl	_FFALIGN
	asr	w1, w0, #3
	mov	x0, x20
	bl	_av_new_packet
	mov	x23, x0
	cbz	w0, LBB0_8
LBB0_7:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_8:
	mov	x0, x21
	bl	_avio_tell
Lloh9:
	adrp	x24, _BURST_HEADER_SIZE@GOTPAGE
Lloh10:
	ldr	x24, [x24, _BURST_HEADER_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	sub	w8, w0, w8
	str	w8, [x20]
	ldr	x1, [x20, #8]
	ldr	w2, [x20, #4]
	mov	x0, x21
	bl	_avio_read
	ldr	w8, [x20, #4]
	cmp	w0, w8
	b.ge	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_av_packet_unref
	b	LBB0_3
LBB0_10:
	ldr	x0, [x20, #8]
	asr	w2, w8, #1
	mov	x1, x0
	bl	_ff_spdif_bswap_buf16
	ldr	x2, [x20, #8]
	add	x3, sp, #8
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_spdif_get_offset_and_codec
	cbz	w0, LBB0_12
; %bb.11:
	mov	x23, x0
	mov	x0, x20
	bl	_av_packet_unref
	b	LBB0_7
LBB0_12:
	ldr	w8, [sp, #8]
	ldr	w9, [x20, #4]
	ldr	w10, [x24]
	add	w9, w9, w10
	sub	w1, w8, w9
	mov	x0, x21
	bl	_avio_skip
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_15
; %bb.13:
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #8]
	ldr	x9, [x9]
	ldr	x9, [x9]
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_17
; %bb.14:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_avpriv_report_missing_feature
Lloh13:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
Lloh15:
	ldr	w23, [x8]
	b	LBB0_7
LBB0_15:
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_21
; %bb.16:
Lloh16:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	x9, [x0]
	ldr	w10, [sp, #12]
	stp	w10, w8, [x9]
LBB0_17:
	ldr	w8, [x19]
	cbz	w8, LBB0_19
LBB0_18:
	mov	w23, #0
	b	LBB0_7
LBB0_19:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w8, [x8, #4]
	cbz	w8, LBB0_18
; %bb.20:
	mov	w23, #0
	lsl	w8, w8, #5
	str	w8, [x19]
	b	LBB0_7
LBB0_21:
	mov	x0, x20
	bl	_av_packet_unref
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SYNCWORD1,4,2                  ; @SYNCWORD1
	.comm	_SYNCWORD2,4,2                  ; @SYNCWORD2
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Packet not ending at a 16-bit boundary"

	.comm	_BURST_HEADER_SIZE,4,2          ; @BURST_HEADER_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
l_.str.1:                               ; @.str.1
	.asciz	"Codec change in IEC 61937"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
.subsections_via_symbols
