	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apng_write_header
_apng_write_header:                     ## @apng_write_header
	.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	%rdi, %rbx
	cmpl	$1, (%rdi)
	jne	LBB0_3
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movq	(%r12), %rax
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	8(%r12), %rax
	movq	_AV_CODEC_ID_APNG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movq	16(%rbx), %r13
	movq	16(%r13), %rdx
	movq	24(%r13), %rcx
	movq	_USHRT_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	cmpq	%r8, %rdx
	jg	LBB0_6
## %bb.5:
	cmpq	%r8, %rcx
	jle	LBB0_7
LBB0_6:
	leaq	16(%r13), %r14
	leaq	24(%r13), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_av_reduce
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rcx
	cvtsi2sd	%rcx, %xmm0
	movq	(%r15), %r8
	cvtsi2sd	%r8, %xmm1
	divsd	%xmm1, %xmm0
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movb	$1, %al
	callq	_av_log
LBB0_7:
	movl	4(%rbx), %edi
	movq	_PNGSIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_avio_wb64
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.8:
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_av_mallocz
	movl	%eax, (%r13)
	testl	%eax, %eax
	je	LBB0_9
## %bb.11:
	movq	16(%r12), %rdx
	movq	%rdx, 8(%r13)
	movl	24(%r12), %esi
	movl	%eax, %edi
	callq	_memcpy
LBB0_12:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_APNG,8,3           ## @AV_CODEC_ID_APNG
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"APNG muxer supports only a single video APNG stream.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_USHRT_MAX,8,3                  ## @USHRT_MAX
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"Last frame delay is too precise. Reducing to %d/%d (%f).\n"

	.comm	_PNGSIG,4,2                     ## @PNGSIG
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_apng_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apng_write_header
_apng_write_header:                     ; @apng_write_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x22, [x8]
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.2:
	ldr	x8, [x22, #8]
Lloh3:
	adrp	x9, _AV_CODEC_ID_APNG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_APNG@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.3:
	ldr	x23, [x19, #16]
	mov	x20, x23
	ldr	x2, [x20, #16]!
Lloh6:
	adrp	x8, _USHRT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _USHRT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	x4, [x8]
	mov	x21, x20
	ldr	x3, [x21, #8]!
	cmp	x2, x4
	ccmp	x3, x4, #0, le
	b.le	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x21
	bl	_av_reduce
Lloh9:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	x8, [x20]
	ldr	x9, [x21]
	scvtf	d0, x8
	scvtf	d1, x9
	fdiv	d0, d0, d1
	str	d0, [sp, #16]
	stp	x8, x9, [sp]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_5:
	ldr	w0, [x19, #4]
Lloh14:
	adrp	x8, _PNGSIG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PNGSIG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_avio_wb64
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_8
; %bb.6:
Lloh17:
	adrp	x9, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_av_mallocz
	str	w0, [x23]
	cbz	w0, LBB0_11
; %bb.7:
	ldr	x2, [x22, #16]
	str	x2, [x23, #8]
	ldr	w1, [x22, #24]
	bl	_memcpy
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
Lloh20:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x2, l_.str@PAGE
Lloh24:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_AVERROR
LBB0_11:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_APNG,8,3           ; @AV_CODEC_ID_APNG
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"APNG muxer supports only a single video APNG stream.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_USHRT_MAX,8,3                  ; @USHRT_MAX
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"Last frame delay is too precise. Reducing to %d/%d (%f).\n"

	.comm	_PNGSIG,4,2                     ; @PNGSIG
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_apng_write_header
.subsections_via_symbols
