	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_png
_encode_png:                            ## @encode_png
	.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	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	leaq	32(%r14), %rdi
	movl	(%r14), %esi
	imull	(%rbx), %esi
	addl	$7, %esi
	sarl	$3, %esi
	callq	_deflateBound
	movl	%eax, %ecx
	movq	_AV_INPUT_BUFFER_MIN_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %r8
	movslq	4(%rbx), %rdi
	movq	_IOBUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	(%rcx,%rsi), %eax
	decl	%eax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %eax
	leal	(%rcx,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	%rdi, %rdx
	addq	%r8, %rdx
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jae	LBB0_2
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movq	16(%r12), %rdi
	movq	%rdi, 16(%r14)
	movq	%rdi, 8(%r14)
	movq	8(%r12), %rax
	addq	%rdi, %rax
	movq	%rax, 24(%r14)
	movq	_PNGSIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_AV_WB64
	addq	$8, 16(%r14)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_encode_headers
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_encode_frame
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	leaq	16(%r14), %rbx
	movl	$73, %edi
	movl	$69, %esi
	movl	$78, %edx
	movl	$68, %ecx
	callq	_MKTAG
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_png_write_chunk
	movq	16(%r14), %rax
	subq	8(%r14), %rax
	movq	%rax, 8(%r12)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ## @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_IOBUF_SIZE,4,2                 ## @IOBUF_SIZE
	.comm	_INT_MAX,8,3                    ## @INT_MAX
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PNGSIG,4,2                     ## @PNGSIG
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_encode_png
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_png
_encode_png:                            ; @encode_png
	.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	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x24, [x0, #8]
	ldr	w8, [x0]
	mov	x0, x24
	ldr	w9, [x0], #32
	orr	w10, wzr, #0x7
	madd	w8, w9, w8, w10
	asr	w1, w8, #3
	bl	_deflateBound
Lloh0:
	adrp	x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	ldrsw	x9, [x22, #4]
Lloh3:
	adrp	x10, _IOBUF_SIZE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _IOBUF_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	add	w11, w0, w10
	sub	w11, w11, #1
	sdiv	w10, w11, w10
	mov	w11, #12
	madd	w10, w10, w11, w0
	sxtw	x10, w10
	madd	x2, x10, x9, x8
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x2
	b.hs	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	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	_AVERROR
LBB0_2:
	mov	x0, x22
	mov	x1, x20
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x23, x24
	ldp	x8, x0, [x20, #8]
	str	x0, [x23, #16]!
	stur	x0, [x23, #-8]
	add	x8, x8, x0
	str	x8, [x23, #8]
Lloh12:
	adrp	x8, _PNGSIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PNGSIG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_AV_WB64
	ldr	x8, [x23]
	add	x8, x8, #8
	str	x8, [x23]
	mov	x0, x22
	mov	x1, x21
	bl	_encode_headers
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	x0, x22
	mov	x1, x21
	bl	_encode_frame
	tbnz	w0, #31, LBB0_6
; %bb.5:
	mov	w0, #73
	mov	w1, #69
	mov	w2, #78
	mov	w3, #68
	bl	_MKTAG
	mov	x1, x0
	mov	x0, x23
	mov	x2, #0
	mov	w3, #0
	bl	_png_write_chunk
	mov	w0, #0
	ldp	x9, x8, [x24, #8]
	sub	x8, x8, x9
	str	x8, [x20, #8]
Lloh15:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	w8, #1
	str	w8, [x19]
LBB0_6:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,4,2   ; @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_IOBUF_SIZE,4,2                 ; @IOBUF_SIZE
	.comm	_INT_MAX,8,3                    ; @INT_MAX
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PNGSIG,4,2                     ; @PNGSIG
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_encode_png
.subsections_via_symbols
