	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spdif_write_packet
_spdif_write_packet:                    ## @spdif_write_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	movq	(%rsi), %rax
	movq	%rax, (%r13)
	movl	8(%rsi), %edi
	movl	%edi, 8(%r13)
	movl	$2, %esi
	callq	_FFALIGN
	shll	$3, %eax
	movl	%eax, 12(%r13)
	movq	$1, 16(%r13)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	*24(%r13)
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	32(%r13), %r15d
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.4:
	movl	16(%r13), %eax
	movq	_BURST_HEADER_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%eax, %ecx
	addl	8(%r13), %ecx
	subl	%ecx, %r15d
	andl	$-2, %r15d
	js	LBB0_5
## %bb.6:
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	(%r14), %esi
	movq	_SYNCWORD1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_spdif_put_16
	movl	(%r14), %esi
	movq	_SYNCWORD2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_spdif_put_16
	movl	(%r14), %esi
	movl	36(%r13), %edx
	movq	%r13, %rdi
	callq	_spdif_put_16
	movl	(%r14), %esi
	movl	12(%r13), %edx
	movq	%r13, %rdi
	callq	_spdif_put_16
LBB0_8:
	movq	_SPDIF_FLAG_BIGENDIAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	40(%r13), %eax
	movq	%r13, %r12
	cmpl	%eax, 20(%r13)
	jne	LBB0_13
## %bb.9:
	leaq	48(%r13), %r12
	leaq	56(%r13), %rsi
	movslq	8(%r13), %rdx
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_av_fast_malloc
	movq	48(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.12:
	movq	(%r13), %rsi
	movl	8(%r13), %edx
	sarl	%edx
	callq	_ff_spdif_bswap_buf16
LBB0_13:
	movl	(%r14), %edi
	movq	(%r12), %rsi
	movl	8(%r13), %edx
	andl	$-2, %edx
	callq	_avio_write
	movslq	8(%r13), %rax
	testb	$1, %al
	je	LBB0_15
## %bb.14:
	movl	(%r14), %esi
	movq	(%r13), %rcx
	movl	-4(%rcx,%rax,4), %edx
	shll	$8, %edx
	movq	%r13, %rdi
	callq	_spdif_put_16
LBB0_15:
	movl	(%r14), %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_ffio_fill
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	36(%r13), %ecx
	movl	8(%r13), %r8d
	movl	32(%r13), %r9d
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_16
LBB0_1:
	movl	%eax, %r12d
	jmp	LBB0_16
LBB0_3:
	xorl	%r12d, %r12d
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BURST_HEADER_SIZE,4,2          ## @BURST_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bitrate is too high\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SYNCWORD1,4,2                  ## @SYNCWORD1
	.comm	_SYNCWORD2,4,2                  ## @SYNCWORD2
	.comm	_SPDIF_FLAG_BIGENDIAN,4,2       ## @SPDIF_FLAG_BIGENDIAN
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"type=%x len=%i pkt_offset=%i\n"

	.no_dead_strip	_spdif_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function spdif_write_packet
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_spdif_write_packet:                    ; @spdif_write_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	x8, [x1]
	str	x8, [x20]
	ldr	w0, [x1, #8]
	str	w0, [x20, #8]
	mov	w1, #2
	bl	_FFALIGN
	lsl	w8, w0, #3
	str	w8, [x20, #12]
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20, #16]
	ldr	x8, [x20, #24]
	mov	x0, x19
	mov	x1, x21
	blr	x8
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	w9, [x20, #32]
	cbz	w9, LBB0_11
; %bb.2:
Lloh2:
	adrp	x10, _BURST_HEADER_SIZE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _BURST_HEADER_SIZE@GOTPAGEOFF]
	ldr	w8, [x20, #16]
Lloh4:
	ldr	w10, [x10]
	ldr	w11, [x20, #8]
	madd	w10, w10, w8, w11
	sub	w9, w9, w10
	ands	w21, w9, #0xfffffffe
	b.lt	LBB0_13
; %bb.3:
	cbz	w8, LBB0_5
; %bb.4:
	ldr	w1, [x19]
Lloh5:
	adrp	x8, _SYNCWORD1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SYNCWORD1@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_spdif_put_16
	ldr	w1, [x19]
Lloh8:
	adrp	x8, _SYNCWORD2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SYNCWORD2@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_spdif_put_16
	ldr	w1, [x19]
	ldr	w2, [x20, #36]
	mov	x0, x20
	bl	_spdif_put_16
	ldr	w1, [x19]
	ldr	w2, [x20, #12]
	mov	x0, x20
	bl	_spdif_put_16
LBB0_5:
	ldr	w8, [x20, #20]
	ldr	w9, [x20, #40]
Lloh11:
	adrp	x10, _SPDIF_FLAG_BIGENDIAN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SPDIF_FLAG_BIGENDIAN@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	and	w9, w10, w9
	mov	x22, x20
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	add	x22, x20, #48
	add	x1, x20, #56
	ldrsw	x8, [x20, #8]
Lloh14:
	adrp	x9, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x2, x9, x8
	mov	x0, x22
	bl	_av_fast_malloc
	ldr	x0, [x20, #48]
	cbz	x0, LBB0_14
; %bb.7:
	ldr	x1, [x20]
	ldr	w8, [x20, #8]
	asr	w2, w8, #1
	bl	_ff_spdif_bswap_buf16
LBB0_8:
	ldr	w0, [x19]
	ldr	x1, [x22]
	ldr	w8, [x20, #8]
	and	w2, w8, #0xfffffffe
	bl	_avio_write
	ldr	w8, [x20, #8]
	tbz	w8, #0, LBB0_10
; %bb.9:
	ldr	w1, [x19]
	ldr	x9, [x20]
	sub	w8, w8, #1
	ldr	w8, [x9, w8, sxtw #2]
	lsl	w2, w8, #8
	mov	x0, x20
	bl	_spdif_put_16
LBB0_10:
	ldr	w0, [x19]
	mov	w1, #0
	mov	x2, x21
	bl	_ffio_fill
Lloh17:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w8, [x20, #8]
	ldp	w10, w9, [x20, #32]
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_11:
	mov	w0, #0
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
	add	sp, sp, #80
	ret
LBB0_13:
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str@PAGE
Lloh26:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	b	_AVERROR
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_BURST_HEADER_SIZE,4,2          ; @BURST_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bitrate is too high\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SYNCWORD1,4,2                  ; @SYNCWORD1
	.comm	_SYNCWORD2,4,2                  ; @SYNCWORD2
	.comm	_SPDIF_FLAG_BIGENDIAN,4,2       ; @SPDIF_FLAG_BIGENDIAN
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"type=%x len=%i pkt_offset=%i\n"

	.no_dead_strip	_spdif_write_packet
.subsections_via_symbols
