	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_display_clean_write
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_display_start_write
	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, 32(%rbx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_LIBPNG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_display_log
	movq	32(%rbx), %rax
LBB0_2:
	movq	_write_function@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_png_set_write_fn
	movq	%rbx, %rdi
	callq	_text_restore
	movq	48(%rbx), %rax
	movq	%rax, 56(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rbx)
	movq	_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_search_compression
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_set_compression
LBB0_5:
	movq	%rbx, %rdi
	callq	_set_ICC_profile_compression
	movq	%rbx, %rdi
	callq	_set_text_compression
	leaq	L_.str.1(%rip), %rsi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_get_option
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	32(%rbx), %rdi
	movl	-36(%rbp), %esi
	callq	_png_set_IDAT_size
LBB0_7:
	movl	$0, 4(%rbx)
	movq	_PNGCP_TIME_WRITE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_start_timer
	movq	32(%rbx), %rdi
	movl	24(%rbx), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_png_write_png
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_end_timer
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.8:
	movq	$0, 16(%rbx)
	callq	_fclose
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_APP_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testq	%r14, %r14
	leaq	L_.str.3(%rip), %r12
	cmovneq	%r14, %r12
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r12, %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_display_log
LBB0_10:
	movq	%rbx, %rdi
	callq	_display_clean_write
	leaq	L_.str.4(%rip), %rax
	movq	%rax, 8(%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_LIBPNG_ERROR,4,2               ## @LIBPNG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create write png_struct"

	.comm	_write_function,4,2             ## @write_function
	.comm	_SEARCH,4,2                     ## @SEARCH
L_.str.1:                               ## @.str.1
	.asciz	"IDAT-size"

	.comm	_PNGCP_TIME_WRITE,4,2           ## @PNGCP_TIME_WRITE
	.comm	_APP_ERROR,4,2                  ## @APP_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"%s: write failed (%s)"

L_.str.3:                               ## @.str.3
	.asciz	"stdout"

	.comm	_errno,4,2                      ## @errno
L_.str.4:                               ## @.str.4
	.asciz	"none"

	.comm	_IGNORE_INDEX,4,2               ## @IGNORE_INDEX
	.comm	_PNG_FILTER_TYPE_BASE,4,2       ## @PNG_FILTER_TYPE_BASE
	.comm	_PNG_HANDLE_CHUNK_ALWAYS,4,2    ## @PNG_HANDLE_CHUNK_ALWAYS
	.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, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x19, x0
	bl	_display_clean_write
	mov	x0, x19
	mov	x1, x20
	bl	_display_start_write
Lloh0:
	adrp	x8, _PNG_LIBPNG_VER_STRING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_LIBPNG_VER_STRING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _display_error@GOTPAGE
Lloh4:
	ldr	x8, [x8, _display_error@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _display_warning@GOTPAGE
Lloh7:
	ldr	x8, [x8, _display_warning@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x1, x19
	bl	_png_create_write_struct
	str	x0, [x19, #32]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _LIBPNG_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LIBPNG_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_display_log
	ldr	x0, [x19, #32]
LBB0_2:
Lloh14:
	adrp	x8, _write_function@GOTPAGE
Lloh15:
	ldr	x8, [x8, _write_function@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x1, x19
	mov	x3, #0
	bl	_png_set_write_fn
	mov	x0, x19
	bl	_text_restore
	ldr	x8, [x19, #48]
	stp	xzr, x8, [x19, #48]
	str	xzr, [x19, #40]
	ldr	w8, [x19]
Lloh17:
	adrp	x9, _SEARCH@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SEARCH@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	mov	x0, x19
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	bl	_search_compression
	b	LBB0_5
LBB0_4:
	bl	_set_compression
LBB0_5:
	mov	x0, x19
	bl	_set_ICC_profile_compression
	mov	x0, x19
	bl	_set_text_compression
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #28
	mov	x0, x19
	bl	_get_option
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x0, [x19, #32]
	ldr	w1, [sp, #28]
	bl	_png_set_IDAT_size
LBB0_7:
	str	wzr, [x19, #4]
Lloh22:
	adrp	x21, _PNGCP_TIME_WRITE@GOTPAGE
Lloh23:
	ldr	x21, [x21, _PNGCP_TIME_WRITE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_start_timer
	ldr	x0, [x19, #32]
	ldr	w1, [x19, #24]
	mov	w2, #0
	mov	x3, #0
	bl	_png_write_png
	ldr	w1, [x21]
	mov	x0, x19
	bl	_end_timer
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.8:
	str	xzr, [x19, #16]
	bl	_fclose
	cbz	x0, LBB0_10
; %bb.9:
Lloh24:
	adrp	x8, _APP_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _APP_ERROR@GOTPAGEOFF]
Lloh26:
	adrp	x9, l_.str.3@PAGE
Lloh27:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh28:
	ldr	w21, [x8]
	cmp	x20, #0
	csel	x20, x9, x20, eq
Lloh29:
	adrp	x8, _errno@GOTPAGE
Lloh30:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp]
Lloh32:
	adrp	x2, l_.str.2@PAGE
Lloh33:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_display_log
LBB0_10:
	mov	x0, x19
	bl	_display_clean_write
Lloh34:
	adrp	x8, l_.str.4@PAGE
Lloh35:
	add	x8, x8, l_.str.4@PAGEOFF
	str	x8, [x19, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.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	_LIBPNG_ERROR,4,2               ; @LIBPNG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create write png_struct"

	.comm	_write_function,4,2             ; @write_function
	.comm	_SEARCH,4,2                     ; @SEARCH
l_.str.1:                               ; @.str.1
	.asciz	"IDAT-size"

	.comm	_PNGCP_TIME_WRITE,4,2           ; @PNGCP_TIME_WRITE
	.comm	_APP_ERROR,4,2                  ; @APP_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"%s: write failed (%s)"

l_.str.3:                               ; @.str.3
	.asciz	"stdout"

	.comm	_errno,4,2                      ; @errno
l_.str.4:                               ; @.str.4
	.asciz	"none"

	.comm	_IGNORE_INDEX,4,2               ; @IGNORE_INDEX
	.comm	_PNG_FILTER_TYPE_BASE,4,2       ; @PNG_FILTER_TYPE_BASE
	.comm	_PNG_HANDLE_CHUNK_ALWAYS,4,2    ; @PNG_HANDLE_CHUNK_ALWAYS
	.no_dead_strip	_write_png
.subsections_via_symbols
