	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_write_esds_tag
_mov_write_esds_tag:                    ## @mov_write_esds_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	_avio_tell
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r15), %eax
	leal	5(%rax), %ebx
	testl	%eax, %eax
	cmovel	%eax, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_ffio_wfourcc
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	leal	27(%rbx), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_put_descr
	movl	20(%r15), %esi
	movq	%r12, %rdi
	callq	_avio_wb16
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	addl	$13, %ebx
	movq	%r12, %rdi
	movl	$4, %esi
	movl	%ebx, %edx
	callq	_put_descr
	movq	8(%r15), %rcx
	movq	(%rcx), %rsi
	movq	_AV_CODEC_ID_MP2@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_2
## %bb.1:
	movq	_AV_CODEC_ID_MP3@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_3
LBB0_2:
	movl	$107, %eax
	cmpl	$24000, 8(%rcx)                 ## imm = 0x5DC0
	jg	LBB0_4
LBB0_3:
	movq	_ff_mp4_obj_type@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ff_codec_get_tag
LBB0_4:
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_avio_w8
	movq	8(%r15), %rax
	movq	(%rax), %rcx
	movq	_AV_CODEC_ID_DVD_SUBTITLE@GOTPCREL(%rip), %rdx
	movl	$225, %esi
	cmpq	(%rdx), %rcx
	je	LBB0_6
## %bb.5:
	movq	16(%rax), %rax
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	leal	17(,%rdx,4), %esi
LBB0_6:
	movq	%r12, %rdi
	callq	_avio_w8
	movl	16(%r15), %edi
	movq	_AV_PKT_DATA_CPB_PROPERTIES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_av_stream_get_side_data
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r14), %eax
	leal	7(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$3, %ebx
LBB0_8:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_wb24
	movq	%r15, %rdi
	callq	_compute_avg_bitrate
	movl	%eax, %r13d
	testq	%r14, %r14
	je	LBB0_10
## %bb.9:
	movl	4(%r14), %esi
	movl	8(%r14), %edi
	movl	%r13d, %edx
	callq	_FFMAX3
	jmp	LBB0_11
LBB0_10:
	movq	8(%r15), %rax
	movl	24(%rax), %edi
	movl	%r13d, %esi
	callq	_FFMAX
LBB0_11:
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_avio_wb32
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_avio_wb32
	movl	(%r15), %edx
	testl	%edx, %edx
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	movl	$5, %esi
	callq	_put_descr
	movl	(%r15), %edx
	movl	4(%r15), %esi
	movq	%r12, %rdi
	callq	_avio_write
LBB0_13:
	movq	%r12, %rdi
	movl	$6, %esi
	movl	$1, %edx
	callq	_put_descr
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_avio_w8
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_update_size                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"esds"

	.comm	_AV_CODEC_ID_MP2,8,3            ## @AV_CODEC_ID_MP2
	.comm	_AV_CODEC_ID_MP3,8,3            ## @AV_CODEC_ID_MP3
	.comm	_ff_mp4_obj_type,4,2            ## @ff_mp4_obj_type
	.comm	_AV_CODEC_ID_DVD_SUBTITLE,8,3   ## @AV_CODEC_ID_DVD_SUBTITLE
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_PKT_DATA_CPB_PROPERTIES,4,2 ## @AV_PKT_DATA_CPB_PROPERTIES
	.no_dead_strip	_mov_write_esds_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_esds_tag
_mov_write_esds_tag:                    ; @mov_write_esds_tag
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_avio_tell
	mov	x20, x0
	ldr	w8, [x21]
	add	w9, w8, #5
	cmp	w8, #0
	csel	w22, wzr, w9, eq
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ffio_wfourcc
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	add	w2, w22, #27
	mov	x0, x19
	mov	w1, #3
	bl	_put_descr
	ldr	w1, [x21, #20]
	mov	x0, x19
	bl	_avio_wb16
	mov	x0, x19
	mov	w1, #0
	bl	_avio_w8
	add	w2, w22, #13
	mov	x0, x19
	mov	w1, #4
	bl	_put_descr
	ldr	x8, [x21, #8]
	ldr	x1, [x8]
Lloh2:
	adrp	x9, _AV_CODEC_ID_MP2@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AV_CODEC_ID_MP2@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _AV_CODEC_ID_MP3@GOTPAGE
Lloh6:
	ldr	x10, [x10, _AV_CODEC_ID_MP3@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x1, x9
	ccmp	x1, x10, #4, ne
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x8, #8]
	mov	w9, #24000
	cmp	w8, w9
	b.le	LBB0_3
; %bb.2:
	mov	w1, #107
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _ff_mp4_obj_type@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ff_mp4_obj_type@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_ff_codec_get_tag
	mov	x1, x0
LBB0_4:
	mov	x0, x19
	bl	_avio_w8
	ldr	x8, [x21, #8]
	ldr	x9, [x8]
Lloh11:
	adrp	x10, _AV_CODEC_ID_DVD_SUBTITLE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _AV_CODEC_ID_DVD_SUBTITLE@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.5:
	mov	w1, #225
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x9, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
	ldr	x8, [x8, #16]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #17
	mov	w9, #21
	csel	w1, w9, w8, eq
LBB0_7:
	mov	x0, x19
	bl	_avio_w8
	ldr	w0, [x21, #16]
Lloh17:
	adrp	x8, _AV_PKT_DATA_CPB_PROPERTIES@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_PKT_DATA_CPB_PROPERTIES@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_av_stream_get_side_data
	mov	x23, x0
	cbz	x0, LBB0_9
; %bb.8:
	ldr	w8, [x23]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #3
	b	LBB0_10
LBB0_9:
	mov	w1, #0
LBB0_10:
	mov	x0, x19
	bl	_avio_wb24
	mov	x0, x21
	bl	_compute_avg_bitrate
	mov	x22, x0
	cbz	x23, LBB0_12
; %bb.11:
	ldp	w1, w0, [x23, #4]
	mov	x2, x22
	bl	_FFMAX3
	b	LBB0_13
LBB0_12:
	ldr	x8, [x21, #8]
	ldr	w0, [x8, #24]
	mov	x1, x22
	bl	_FFMAX
LBB0_13:
	mov	x1, x0
	mov	x0, x19
	bl	_avio_wb32
	mov	x0, x19
	mov	x1, x22
	bl	_avio_wb32
	ldr	w2, [x21]
	cbz	w2, LBB0_15
; %bb.14:
	mov	x0, x19
	mov	w1, #5
	bl	_put_descr
	ldp	w2, w1, [x21]
	mov	x0, x19
	bl	_avio_write
LBB0_15:
	mov	x0, x19
	mov	w1, #6
	mov	w2, #1
	bl	_put_descr
	mov	x0, x19
	mov	w1, #2
	bl	_avio_w8
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_update_size
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"esds"

	.comm	_AV_CODEC_ID_MP2,8,3            ; @AV_CODEC_ID_MP2
	.comm	_AV_CODEC_ID_MP3,8,3            ; @AV_CODEC_ID_MP3
	.comm	_ff_mp4_obj_type,4,2            ; @ff_mp4_obj_type
	.comm	_AV_CODEC_ID_DVD_SUBTITLE,8,3   ; @AV_CODEC_ID_DVD_SUBTITLE
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_PKT_DATA_CPB_PROPERTIES,4,2 ; @AV_PKT_DATA_CPB_PROPERTIES
	.no_dead_strip	_mov_write_esds_tag
.subsections_via_symbols
