	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spdif_header_dts4
_spdif_header_dts4:                     ## @spdif_header_dts4
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	testl	%edx, %edx
	je	LBB0_1
## %bb.4:
	movl	%ecx, %r14d
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.6:
	movl	%r8d, %r13d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	(%rbx), %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	shll	$5, %r13d
	movl	(%r12), %eax
	imull	%r13d, %eax
	cltd
	idivl	%r14d
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_spdif_dts4_subtype
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movslq	%r15d, %rcx
	shlq	$2, %rcx
	movl	%ecx, 4(%r12)
	movq	_IEC61937_DTSHD@GOTPCREL(%rip), %rdx
	shll	$8, %eax
	orl	(%rdx), %eax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movslq	%r15d, %rdx
	movl	%eax, 8(%r12)
	addq	$12, %rdx
	movq	_BURST_HEADER_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rax, %rcx
	movl	12(%r12), %eax
	cmpq	%rcx, %rdx
	jbe	LBB0_13
## %bb.9:
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_11:
	movl	16(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_21
## %bb.12:
	imull	%r14d, %eax
	cltd
	idivl	%r13d
	movl	%eax, 12(%r12)
LBB0_13:
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	cmpl	$0, 16(%r12)
	js	LBB0_16
LBB0_15:
	decl	%eax
	movl	%eax, 12(%r12)
LBB0_16:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r15d
LBB0_17:
	leal	12(%r15), %eax
	movl	%eax, 20(%r12)
	leal	20(%r15), %edi
	movl	$16, %esi
	callq	_FFALIGN
	addq	$-8, %rax
	movq	%rax, 48(%r12)
	leaq	24(%r12), %rdi
	leaq	40(%r12), %rsi
	movl	20(%r12), %edx
	callq	_av_fast_malloc
	movq	24(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.19:
	movq	%rdi, 32(%r12)
	leaq	_spdif_header_dts4.dtshd_start_code(%rip), %rsi
	movl	$10, %edx
	callq	_memcpy
	movq	24(%r12), %rdi
	addq	$10, %rdi
	movl	%r15d, %esi
	callq	_AV_WB16
	movq	24(%r12), %rdi
	addq	$12, %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rsi
	movl	%r15d, %edx
	callq	_memcpy
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_2
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %ecx
	movl	%r14d, (%rsp)
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %r8d
	movl	%r13d, %r9d
	xorl	%eax, %eax
	callq	_av_log
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_18:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_21:
	movl	$1, 12(%r12)
	movl	$1, %eax
	cmpl	$0, 16(%r12)
	jns	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
_spdif_header_dts4.dtshd_start_code:    ## @spdif_header_dts4.dtshd_start_code
	.ascii	"\001\000\000\000\000\000\000\000\376\376"

	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HD mode not supported for this format\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Unknown DTS sample rate for HD\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.2:                               ## @.str.2
	.asciz	"Specified HD rate of %d Hz would require an impossible repetition period of %d for the current DTS stream (blocks = %d, sample rate = %d)\n"

	.comm	_IEC61937_DTSHD,4,2             ## @IEC61937_DTSHD
	.comm	_BURST_HEADER_SIZE,4,2          ## @BURST_HEADER_SIZE
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.3:                               ## @.str.3
	.asciz	"DTS-HD bitrate too high, temporarily sending core only\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_spdif_header_dts4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spdif_header_dts4
_spdif_header_dts4:                     ; @spdif_header_dts4
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x0
	cbz	w2, LBB0_10
; %bb.1:
	mov	x22, x3
	cbz	w3, LBB0_11
; %bb.2:
	mov	x19, x2
	mov	x20, x1
	ldr	x24, [x21]
	ldr	w25, [x1]
	ldr	w8, [x24]
	lsl	w26, w4, #5
	mul	w8, w8, w26
	sdiv	w23, w8, w22
	mov	x0, x23
	bl	_spdif_dts4_subtype
	tbnz	w0, #31, LBB0_12
; %bb.3:
	sxtw	x8, w25
Lloh0:
	adrp	x9, _IEC61937_DTSHD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IEC61937_DTSHD@GOTPAGEOFF]
	sbfiz	x10, x23, #2, #32
Lloh2:
	ldr	w9, [x9]
	orr	w9, w9, w0, lsl #8
	stp	w10, w9, [x24, #4]
	add	x9, x8, #12
Lloh3:
	adrp	x8, _BURST_HEADER_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BURST_HEADER_SIZE@GOTPAGEOFF]
Lloh5:
	ldrsw	x11, [x8]
	ldr	w8, [x24, #12]
	sub	x10, x10, x11
	cmp	x9, x10
	b.ls	LBB0_8
; %bb.4:
	cbnz	w8, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str.3@PAGE
Lloh10:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_av_log
LBB0_6:
	ldr	w8, [x24, #16]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.7:
	mul	w8, w8, w22
	sdiv	w8, w8, w26
	str	w8, [x24, #12]
LBB0_8:
	cbz	w8, LBB0_15
; %bb.9:
	ldr	w9, [x24, #16]
	tbz	w9, #31, LBB0_17
	b	LBB0_18
LBB0_10:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_av_log
Lloh21:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	b	LBB0_20
LBB0_12:
Lloh24:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	ldr	w8, [x24]
	stp	x26, x22, [sp, #16]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	stp	x8, x23, [sp]
Lloh27:
	adrp	x2, l_.str.2@PAGE
Lloh28:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_13:
	mov	x0, x21
	bl	_av_log
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_AVERROR
LBB0_15:
	mov	x19, x25
	b	LBB0_18
LBB0_16:
	mov	w8, #1
	str	w8, [x24, #12]
	ldr	w9, [x24, #16]
	tbnz	w9, #31, LBB0_18
LBB0_17:
	sub	w8, w8, #1
	str	w8, [x24, #12]
LBB0_18:
	add	w8, w19, #12
	str	w8, [x24, #20]
	add	w0, w19, #20
	mov	w1, #16
	bl	_FFALIGN
	sub	x8, x0, #8
	str	x8, [x24, #48]
	add	x0, x24, #24
	add	x1, x24, #40
	ldr	w2, [x24, #20]
	bl	_av_fast_malloc
	ldr	x0, [x24, #24]
	cbz	x0, LBB0_21
; %bb.19:
	str	x0, [x24, #32]
Lloh31:
	adrp	x1, _spdif_header_dts4.dtshd_start_code@PAGE
Lloh32:
	add	x1, x1, _spdif_header_dts4.dtshd_start_code@PAGEOFF
	mov	w2, #10
	bl	_memcpy
	ldr	x8, [x24, #24]
	add	x0, x8, #10
	mov	x1, x19
	bl	_AV_WB16
	ldr	x8, [x24, #24]
	add	x0, x8, #12
	ldr	x1, [x20, #8]
	mov	x2, x19
	bl	_memcpy
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_spdif_header_dts4.dtshd_start_code:    ; @spdif_header_dts4.dtshd_start_code
	.ascii	"\001\000\000\000\000\000\000\000\376\376"

	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HD mode not supported for this format\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Unknown DTS sample rate for HD\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.2:                               ; @.str.2
	.asciz	"Specified HD rate of %d Hz would require an impossible repetition period of %d for the current DTS stream (blocks = %d, sample rate = %d)\n"

	.comm	_IEC61937_DTSHD,4,2             ; @IEC61937_DTSHD
	.comm	_BURST_HEADER_SIZE,4,2          ; @BURST_HEADER_SIZE
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.3:                               ; @.str.3
	.asciz	"DTS-HD bitrate too high, temporarily sending core only\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_spdif_header_dts4
.subsections_via_symbols
