	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_write_eac3_tag
_mov_write_eac3_tag:                    ## @mov_write_eac3_tag
	.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	(%rdx), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movl	(%r14), %eax
	movl	%eax, %ecx
	shll	$5, %ecx
	leal	(%rcx,%rax,2), %r13d
	addl	$41, %r13d
	sarl	$3, %r13d
	addl	$2, %r13d
	movl	%r13d, %edi
	callq	_av_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %r12
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	%r13d, %edx
	callq	_init_put_bits
	movl	4(%r14), %edx
	movq	%r12, %rdi
	movl	$13, %esi
	callq	_put_bits
	movl	(%r14), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_put_bits
	cmpl	$0, (%r14)
	js	LBB0_11
## %bb.6:
	movq	$-1, %r13
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %r12
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	24(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$9, %esi
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	callq	_put_bits
	movslq	(%r14), %rax
	incq	%r13
	addq	$28, %rbx
	cmpq	%rax, %r13
	jge	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_put_bits
	movq	8(%r14), %rax
	movl	4(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$5, %esi
	callq	_put_bits
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	8(%r14), %rax
	movl	8(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_put_bits
	movq	8(%r14), %rax
	movl	12(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_put_bits
	movq	8(%r14), %rax
	movl	16(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_put_bits
	movq	%r12, %rdi
	movl	$5, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	8(%r14), %rax
	movl	20(%rax,%rbx), %edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_put_bits
	movq	8(%r14), %rax
	cmpl	$0, 20(%rax,%rbx)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_11:
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_flush_put_bits
	movq	%rbx, %rdi
	callq	_put_bits_count
	movl	%eax, %ebx
	sarl	$3, %ebx
	leal	8(%rbx), %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_avio_wb32
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_avio_write
	movq	%r15, %rdi
	callq	_av_free
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot write moov atom before EAC3 packets parsed.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"dec3"

	.no_dead_strip	_mov_write_eac3_tag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mov_write_eac3_tag
_mov_write_eac3_tag:                    ; @mov_write_eac3_tag
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x22, [x2]
	cbz	x22, LBB0_9
; %bb.1:
	mov	x19, x1
	ldr	w8, [x22]
	mov	w9, #34
	mul	w8, w8, w9
	add	w8, w8, #41
	asr	w8, w8, #3
	add	w21, w8, #2
	mov	x0, x21
	bl	_av_malloc
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
	add	x0, sp, #12
	mov	x1, x20
	mov	x2, x21
	bl	_init_put_bits
	ldr	w2, [x22, #4]
	add	x0, sp, #12
	mov	w1, #13
	bl	_put_bits
	ldr	w2, [x22]
	add	x0, sp, #12
	mov	w1, #3
	bl	_put_bits
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_8
; %bb.3:
	mov	x21, #0
	mov	x23, #-1
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w2, [x8, #24]
	add	x0, sp, #12
	mov	w1, #9
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_put_bits
	ldrsw	x8, [x22]
	add	x23, x23, #1
	add	x21, x21, #28
	cmp	x23, x8
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	ldr	w2, [x8, x21]
	add	x0, sp, #12
	mov	w1, #2
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #4]
	add	x0, sp, #12
	mov	w1, #5
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #8]
	add	x0, sp, #12
	mov	w1, #3
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #12]
	add	x0, sp, #12
	mov	w1, #3
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #16]
	add	x0, sp, #12
	mov	w1, #1
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #5
	mov	w2, #0
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #20]
	add	x0, sp, #12
	mov	w1, #4
	bl	_put_bits
	ldr	x8, [x22, #8]
	add	x8, x8, x21
	ldr	w9, [x8, #20]
	cbnz	w9, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	b	LBB0_5
LBB0_8:
	add	x0, sp, #12
	bl	_flush_put_bits
	add	x0, sp, #12
	bl	_put_bits_count
	asr	w21, w0, #3
	add	w1, w21, #8
	mov	x0, x19
	bl	_avio_wb32
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ffio_wfourcc
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_avio_write
	mov	x0, x20
	bl	_av_free
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_9:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot write moov atom before EAC3 packets parsed.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"dec3"

	.no_dead_strip	_mov_write_eac3_tag
.subsections_via_symbols
