	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_png
_write_png:                             ## @write_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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_display_clean_write
	leaq	48(%rbx), %r12
	movq	%r12, %rdi
	callq	_buffer_start_write
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rbx)
	movl	%r14d, 8(%rbx)
	movq	_PNG_LIBPNG_VER_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_display_error@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_display_warning@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rsi
	callq	_png_create_write_struct
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_APP_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_display_log
	movq	16(%rbx), %rax
LBB0_2:
	movq	_write_function@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%r13d, %r13d
	movq	%rax, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	callq	_png_set_write_fn
	movq	_PNG_TRANSFORM_STRIP_FILLER@GOTPCREL(%rip), %rcx
	movq	_PNG_TRANSFORM_STRIP_FILLER_BEFORE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_PNG_TRANSFORM_PACKING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	testl	%r14d, %ecx
	je	LBB0_4
## %bb.3:
	andl	%r14d, %eax
	movq	_PNG_COLOR_MASK_ALPHA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	$1, %eax
	sbbl	%r13d, %r13d
	notl	%ecx
	orl	%ecx, %r13d
	andl	12(%rbx), %r13d
	movq	16(%rbx), %rdi
	movl	44(%rbx), %edx
	movl	40(%rbx), %ecx
	movl	36(%rbx), %r8d
	movl	32(%rbx), %r10d
	movl	28(%rbx), %r11d
	movl	24(%rbx), %eax
	subq	$8, %rsp
	movl	%r15d, %esi
	movl	%r13d, %r9d
	pushq	%rax
	pushq	%r11
	pushq	%r10
	callq	_png_set_IHDR
	addq	$32, %rsp
LBB0_4:
	movq	16(%rbx), %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_png_write_png
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_display_clean_write            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write"

	.comm	_PNG_LIBPNG_VER_STRING,4,2      ## @PNG_LIBPNG_VER_STRING
	.comm	_display_error,4,2              ## @display_error
	.comm	_display_warning,4,2            ## @display_warning
	.comm	_APP_ERROR,4,2                  ## @APP_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"failed to create write png_struct"

	.comm	_write_function,4,2             ## @write_function
	.comm	_PNG_TRANSFORM_PACKING,4,2      ## @PNG_TRANSFORM_PACKING
	.comm	_PNG_TRANSFORM_STRIP_FILLER,4,2 ## @PNG_TRANSFORM_STRIP_FILLER
	.comm	_PNG_TRANSFORM_STRIP_FILLER_BEFORE,4,2 ## @PNG_TRANSFORM_STRIP_FILLER_BEFORE
	.comm	_PNG_COLOR_MASK_ALPHA,4,2       ## @PNG_COLOR_MASK_ALPHA
	.no_dead_strip	_write_png
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_png
_write_png:                             ; @write_png
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_display_clean_write
	add	x22, x19, #48
	mov	x0, x22
	bl	_buffer_start_write
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
	str	w20, [x19, #8]
Lloh2:
	adrp	x8, _PNG_LIBPNG_VER_STRING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PNG_LIBPNG_VER_STRING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _display_error@GOTPAGE
Lloh6:
	ldr	x8, [x8, _display_error@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _display_warning@GOTPAGE
Lloh9:
	ldr	x8, [x8, _display_warning@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x1, x19
	bl	_png_create_write_struct
	str	x0, [x19, #16]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _APP_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _APP_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_display_log
	ldr	x0, [x19, #16]
LBB0_2:
Lloh16:
	adrp	x8, _write_function@GOTPAGE
Lloh17:
	ldr	x8, [x8, _write_function@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x1, x22
	mov	x3, #0
	bl	_png_set_write_fn
Lloh19:
	adrp	x8, _PNG_TRANSFORM_PACKING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PNG_TRANSFORM_PACKING@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x8]
Lloh22:
	adrp	x8, _PNG_TRANSFORM_STRIP_FILLER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PNG_TRANSFORM_STRIP_FILLER@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x10, _PNG_TRANSFORM_STRIP_FILLER_BEFORE@GOTPAGE
Lloh26:
	ldr	x10, [x10, _PNG_TRANSFORM_STRIP_FILLER_BEFORE@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	orr	w8, w10, w8
	orr	w9, w8, w9
	tst	w9, w20
	b.eq	LBB0_4
; %bb.3:
	ldr	w9, [x19, #12]
Lloh28:
	adrp	x10, _PNG_COLOR_MASK_ALPHA@GOTPAGE
Lloh29:
	ldr	x10, [x10, _PNG_COLOR_MASK_ALPHA@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	tst	w8, w20
	mov	w8, #-1
	csinv	w8, w8, w10, eq
	and	w5, w8, w9
	ldr	x0, [x19, #16]
	ldp	w3, w2, [x19, #40]
	ldp	w6, w4, [x19, #32]
	ldp	w8, w7, [x19, #24]
	str	w8, [sp]
	mov	x1, x21
	bl	_png_set_IHDR
LBB0_4:
	ldr	x0, [x19, #16]
	mov	x1, x21
	mov	x2, x20
	mov	x3, #0
	bl	_png_write_png
	mov	x0, x19
	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
	add	sp, sp, #64
	b	_display_clean_write
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write"

	.comm	_PNG_LIBPNG_VER_STRING,4,2      ; @PNG_LIBPNG_VER_STRING
	.comm	_display_error,4,2              ; @display_error
	.comm	_display_warning,4,2            ; @display_warning
	.comm	_APP_ERROR,4,2                  ; @APP_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"failed to create write png_struct"

	.comm	_write_function,4,2             ; @write_function
	.comm	_PNG_TRANSFORM_PACKING,4,2      ; @PNG_TRANSFORM_PACKING
	.comm	_PNG_TRANSFORM_STRIP_FILLER,4,2 ; @PNG_TRANSFORM_STRIP_FILLER
	.comm	_PNG_TRANSFORM_STRIP_FILLER_BEFORE,4,2 ; @PNG_TRANSFORM_STRIP_FILLER_BEFORE
	.comm	_PNG_COLOR_MASK_ALPHA,4,2       ; @PNG_COLOR_MASK_ALPHA
	.no_dead_strip	_write_png
.subsections_via_symbols
