	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_ape_write_tag               ## -- Begin function ff_ape_write_tag
	.p2align	4, 0x90
_ff_ape_write_tag:                      ## @ff_ape_write_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	%rdi, %r13
	movq	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	leaq	-48(%rbp), %rdi
	callq	_avio_open_dyn_buf
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movq	%r13, %rdi
	callq	_ff_standardize_creation_time
	movl	8(%r13), %edi
	movq	_AV_DICT_IGNORE_SUFFIX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_av_dict_get
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	%rax, %rbx
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	leaq	L_.str(%rip), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rdi
	callq	_strlen
	movl	%eax, %r12d
	movq	-48(%rbp), %rdi
	movl	%eax, %esi
	callq	_avio_wl32
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_avio_wl32
	movq	-48(%rbp), %rdi
	movl	8(%rbx), %esi
	callq	_avio_put_str
	movq	-48(%rbp), %rdi
	movq	(%rbx), %rsi
	movl	%r12d, %edx
	callq	_avio_write
	incl	%r15d
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r13), %edi
	movq	_AV_DICT_IGNORE_SUFFIX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_av_dict_get
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	callq	_string_is_ascii
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	leaq	L_.str.1(%rip), %rdx
	callq	_av_log
	jmp	LBB0_6
LBB0_7:
	testl	%r15d, %r15d
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_10
## %bb.8:
	movq	-48(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_avio_close_dyn_buf
	testl	%eax, %eax
	jle	LBB0_10
## %bb.9:
	movl	%eax, %r12d
	movq	_APE_TAG_FOOTER_BYTES@GOTPCREL(%rip), %rbx
	addl	(%rbx), %r12d
	movq	(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	$8, %edx
	callq	_avio_write
	movq	(%r13), %rdi
	movq	_APE_TAG_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movl	%r12d, %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movl	%r15d, %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movq	_APE_TAG_FLAG_CONTAINS_HEADER@GOTPCREL(%rip), %r14
	movq	_APE_TAG_FLAG_IS_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r14), %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_ffio_fill
	movq	(%r13), %rdi
	movq	-56(%rbp), %rsi
	movl	%r12d, %edx
	subl	(%rbx), %edx
	callq	_avio_write
	movq	(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	$8, %edx
	callq	_avio_write
	movq	(%r13), %rdi
	movq	_APE_TAG_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movl	%r12d, %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movl	%r15d, %esi
	callq	_avio_wl32
	movq	(%r13), %rdi
	movl	(%r14), %esi
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	callq	_avio_wl32
	movq	(%r13), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_ffio_fill
LBB0_10:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.11:
	cmpq	$0, -56(%rbp)
	jne	LBB0_13
## %bb.12:
	leaq	-56(%rbp), %rsi
	callq	_avio_close_dyn_buf
LBB0_13:
	leaq	-56(%rbp), %rdi
	callq	_av_freep
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_AV_DICT_IGNORE_SUFFIX,4,2      ## @AV_DICT_IGNORE_SUFFIX
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"Non ASCII keys are not allowed\n"

	.comm	_APE_TAG_FOOTER_BYTES,4,2       ## @APE_TAG_FOOTER_BYTES
L_.str.2:                               ## @.str.2
	.asciz	"APETAGEX"

	.comm	_APE_TAG_VERSION,4,2            ## @APE_TAG_VERSION
	.comm	_APE_TAG_FLAG_CONTAINS_HEADER,4,2 ## @APE_TAG_FLAG_CONTAINS_HEADER
	.comm	_APE_TAG_FLAG_IS_HEADER,4,2     ## @APE_TAG_FLAG_IS_HEADER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_ape_write_tag               ; -- Begin function ff_ape_write_tag
	.p2align	2
_ff_ape_write_tag:                      ; @ff_ape_write_tag
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	stp	xzr, xzr, [sp]
	add	x0, sp, #8
	bl	_avio_open_dyn_buf
	mov	x19, x0
	tbnz	w0, #31, LBB0_10
; %bb.1:
	mov	x0, x20
	bl	_ff_standardize_creation_time
	ldr	w0, [x20, #8]
Lloh0:
	adrp	x26, _AV_DICT_IGNORE_SUFFIX@GOTPAGE
Lloh1:
	ldr	x26, [x26, _AV_DICT_IGNORE_SUFFIX@GOTPAGEOFF]
	ldr	w3, [x26]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	bl	_av_dict_get
	cbz	x0, LBB0_10
; %bb.2:
	mov	x22, x0
	mov	w21, #0
Lloh4:
	adrp	x27, _AV_LOG_WARNING@GOTPAGE
Lloh5:
	ldr	x27, [x27, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh6:
	adrp	x23, l_.str.1@PAGE
Lloh7:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh8:
	adrp	x24, l_.str@PAGE
Lloh9:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x22]
	bl	_strlen
	mov	x25, x0
	ldr	x0, [sp, #8]
	mov	x1, x25
	bl	_avio_wl32
	ldr	x0, [sp, #8]
	mov	w1, #0
	bl	_avio_wl32
	ldr	x0, [sp, #8]
	ldr	w1, [x22, #8]
	bl	_avio_put_str
	ldr	x0, [sp, #8]
	ldr	x1, [x22]
	mov	x2, x25
	bl	_avio_write
	add	w21, w21, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20, #8]
	ldr	w3, [x26]
	mov	x1, x24
	mov	x2, x22
	bl	_av_dict_get
	mov	x22, x0
	cbz	x0, LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22, #8]
	bl	_string_is_ascii
	cbnz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x27]
	mov	x0, x20
	mov	x2, x23
	bl	_av_log
	b	LBB0_4
LBB0_7:
	cbz	w21, LBB0_10
; %bb.8:
	ldr	x0, [sp, #8]
	mov	x1, sp
	bl	_avio_close_dyn_buf
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.9:
Lloh10:
	adrp	x24, _APE_TAG_FOOTER_BYTES@GOTPAGE
Lloh11:
	ldr	x24, [x24, _APE_TAG_FOOTER_BYTES@GOTPAGEOFF]
	ldr	w8, [x24]
	add	w22, w8, w0
	ldr	x0, [x20]
Lloh12:
	adrp	x23, l_.str.2@PAGE
Lloh13:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	x1, x23
	mov	w2, #8
	bl	_avio_write
	ldr	x0, [x20]
Lloh14:
	adrp	x25, _APE_TAG_VERSION@GOTPAGE
Lloh15:
	ldr	x25, [x25, _APE_TAG_VERSION@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	x1, x22
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	x1, x21
	bl	_avio_wl32
Lloh16:
	adrp	x26, _APE_TAG_FLAG_CONTAINS_HEADER@GOTPAGE
Lloh17:
	ldr	x26, [x26, _APE_TAG_FLAG_CONTAINS_HEADER@GOTPAGEOFF]
	ldr	x0, [x20]
	ldr	w8, [x26]
Lloh18:
	adrp	x9, _APE_TAG_FLAG_IS_HEADER@GOTPAGE
Lloh19:
	ldr	x9, [x9, _APE_TAG_FLAG_IS_HEADER@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	w1, #0
	mov	w2, #8
	bl	_ffio_fill
	ldr	x0, [x20]
	ldr	x1, [sp]
	ldr	w8, [x24]
	sub	w2, w22, w8
	bl	_avio_write
	ldr	x0, [x20]
	mov	x1, x23
	mov	w2, #8
	bl	_avio_write
	ldr	x0, [x20]
	ldr	w1, [x25]
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	x1, x22
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	x1, x21
	bl	_avio_wl32
	ldr	x0, [x20]
	ldr	w1, [x26]
	bl	_avio_wl32
	ldr	x0, [x20]
	mov	w1, #0
	mov	w2, #8
	bl	_ffio_fill
LBB0_10:
	ldp	x8, x0, [sp]
	cmp	x0, #0
	ccmp	x8, #0, #0, ne
	b.ne	LBB0_12
; %bb.11:
	mov	x1, sp
	bl	_avio_close_dyn_buf
LBB0_12:
	mov	x0, sp
	bl	_av_freep
	mov	x0, x19
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_AV_DICT_IGNORE_SUFFIX,4,2      ; @AV_DICT_IGNORE_SUFFIX
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"Non ASCII keys are not allowed\n"

	.comm	_APE_TAG_FOOTER_BYTES,4,2       ; @APE_TAG_FOOTER_BYTES
l_.str.2:                               ; @.str.2
	.asciz	"APETAGEX"

	.comm	_APE_TAG_VERSION,4,2            ; @APE_TAG_VERSION
	.comm	_APE_TAG_FLAG_CONTAINS_HEADER,4,2 ; @APE_TAG_FLAG_CONTAINS_HEADER
	.comm	_APE_TAG_FLAG_IS_HEADER,4,2     ; @APE_TAG_FLAG_IS_HEADER
.subsections_via_symbols
