	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_zTXt                 ## -- Begin function png_write_zTXt
	.p2align	4, 0x90
_png_write_zTXt:                        ## @png_write_zTXt
	.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	$352, %rsp                      ## imm = 0x160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movq	_PNG_TEXT_COMPRESSION_NONE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.1:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_14
## %bb.2:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	addq	$352, %rsp                      ## imm = 0x160
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_png_write_tEXt                 ## TAILCALL
LBB0_3:
	movq	_PNG_TEXT_COMPRESSION_zTXt@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_png_error
LBB0_5:
	leaq	-368(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_png_check_keyword
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_png_error
LBB0_7:
	movq	_PNG_COMPRESSION_TYPE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -364(%rbp,%rbx,4)
	addq	$2, %rbx
	testq	%r14, %r14
	je	LBB0_8
## %bb.9:
	movq	%r14, %rdi
	callq	_strlen
	movl	%eax, %edx
	jmp	LBB0_10
LBB0_8:
	xorl	%edx, %edx
LBB0_10:
	leaq	-376(%rbp), %r12
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_png_text_compress_init
	movq	_png_zTXt@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	_png_text_compress
	movq	_Z_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.11:
	movq	(%r15), %rsi
	movq	%r15, %rdi
	callq	_png_error
LBB0_12:
	movl	(%r14), %esi
	movq	-376(%rbp), %rdx
	addq	%rbx, %rdx
	movq	%r15, %rdi
	callq	_png_write_chunk_header
	leaq	-368(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_png_write_chunk_data
	leaq	-376(%rbp), %rsi
	movq	%r15, %rdi
	callq	_png_write_compressed_data_out
	movq	%r15, %rdi
	callq	_png_write_chunk_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	addq	$352, %rsp                      ## imm = 0x160
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_zTXt"

	.comm	_PNG_TEXT_COMPRESSION_NONE,4,2  ## @PNG_TEXT_COMPRESSION_NONE
	.comm	_PNG_TEXT_COMPRESSION_zTXt,4,2  ## @PNG_TEXT_COMPRESSION_zTXt
L_.str.1:                               ## @.str.1
	.asciz	"zTXt: invalid compression type"

L_.str.2:                               ## @.str.2
	.asciz	"zTXt: invalid keyword"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ## @PNG_COMPRESSION_TYPE_BASE
	.comm	_png_zTXt,4,2                   ## @png_zTXt
	.comm	_Z_OK,8,3                       ## @Z_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_zTXt                 ; -- Begin function png_write_zTXt
	.p2align	2
_png_write_zTXt:                        ; @png_write_zTXt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #416
	.cfi_def_cfa_offset 416
	stp	x28, x27, [sp, #352]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #368]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #384]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #400]            ; 16-byte Folded Spill
	add	x29, sp, #400
	.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 w27, -56
	.cfi_offset w28, -64
	mov	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
Lloh5:
	adrp	x8, _PNG_TEXT_COMPRESSION_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_TEXT_COMPRESSION_NONE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_3
; %bb.1:
	ldur	x8, [x29, #-56]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.2:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	ldp	x29, x30, [sp, #400]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #384]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #368]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #352]            ; 16-byte Folded Reload
	add	sp, sp, #416
	b	_png_write_tEXt
LBB0_3:
Lloh11:
	adrp	x8, _PNG_TEXT_COMPRESSION_zTXt@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PNG_TEXT_COMPRESSION_zTXt@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w22
	b.eq	LBB0_5
; %bb.4:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_5:
	add	x22, sp, #20
	add	x2, sp, #20
	mov	x0, x19
	mov	x1, x21
	bl	_png_check_keyword
	mov	x21, x0
	cbnz	x0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_7:
Lloh18:
	adrp	x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	x9, x22, x21, lsl #2
	str	w8, [x9, #4]
	add	x21, x21, #2
	cbz	x20, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_strlen
	mov	x2, x0
	b	LBB0_10
LBB0_9:
	mov	w2, #0
LBB0_10:
	add	x0, sp, #8
	mov	x1, x20
	bl	_png_text_compress_init
Lloh21:
	adrp	x20, _png_zTXt@GOTPAGE
Lloh22:
	ldr	x20, [x20, _png_zTXt@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x21
	bl	_png_text_compress
Lloh23:
	adrp	x8, _Z_OK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _Z_OK@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_12
; %bb.11:
	ldr	x1, [x19]
	mov	x0, x19
	bl	_png_error
LBB0_12:
	ldr	w1, [x20]
	ldr	x8, [sp, #8]
	add	x2, x8, x21
	mov	x0, x19
	bl	_png_write_chunk_header
	add	x1, sp, #20
	mov	x0, x19
	mov	x2, x21
	bl	_png_write_chunk_data
	add	x1, sp, #8
	mov	x0, x19
	bl	_png_write_compressed_data_out
	mov	x0, x19
	bl	_png_write_chunk_end
	ldur	x8, [x29, #-56]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #400]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #384]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #368]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #352]            ; 16-byte Folded Reload
	add	sp, sp, #416
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_zTXt"

	.comm	_PNG_TEXT_COMPRESSION_NONE,4,2  ; @PNG_TEXT_COMPRESSION_NONE
	.comm	_PNG_TEXT_COMPRESSION_zTXt,4,2  ; @PNG_TEXT_COMPRESSION_zTXt
l_.str.1:                               ; @.str.1
	.asciz	"zTXt: invalid compression type"

l_.str.2:                               ; @.str.2
	.asciz	"zTXt: invalid keyword"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ; @PNG_COMPRESSION_TYPE_BASE
	.comm	_png_zTXt,4,2                   ; @png_zTXt
	.comm	_Z_OK,8,3                       ; @Z_OK
.subsections_via_symbols
