	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_tEXt                 ## -- Begin function png_write_tEXt
	.p2align	4, 0x90
_png_write_tEXt:                        ## @png_write_tEXt
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movl	%edi, %r15d
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	leaq	-40(%rbp), %rdx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_png_check_keyword
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %rbx
	testq	%r14, %r14
	je	LBB0_7
## %bb.3:
	cmpb	$0, (%r14)
	je	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_png_strlen
	movq	%rax, %r12
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	callq	_png_warning
	jmp	LBB0_11
LBB0_7:
	xorl	%r12d, %r12d
LBB0_8:
	movq	_png_tEXt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	(%rbx,%r12), %rdx
	incq	%rdx
	incq	%rbx
	movl	%r15d, %edi
	callq	_png_write_chunk_start
	movl	-40(%rbp), %esi
	movl	%r15d, %edi
	movq	%rbx, %rdx
	callq	_png_write_chunk_data
	testq	%r12, %r12
	je	LBB0_10
## %bb.9:
	movl	%r15d, %edi
	movl	%r14d, %esi
	movq	%r12, %rdx
	callq	_png_write_chunk_data
LBB0_10:
	movl	%r15d, %edi
	callq	_png_write_chunk_end
	movq	-40(%rbp), %rsi
	movl	%r15d, %edi
	callq	_png_free
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_tEXt\n"

L_.str.1:                               ## @.str.1
	.asciz	"Empty keyword in tEXt chunk"

	.comm	_png_tEXt,4,2                   ## @png_tEXt
	.comm	_PNG_tEXt,4,2                   ## @PNG_tEXt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_tEXt                 ; -- Begin function png_write_tEXt
	.p2align	2
_png_write_tEXt:                        ; @png_write_tEXt
	.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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	cbz	x21, LBB0_5
; %bb.1:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_png_check_keyword
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	cbz	x20, LBB0_6
; %bb.3:
	ldrb	w8, [x20]
	cbz	w8, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_png_strlen
	mov	x21, x0
	b	LBB0_7
LBB0_5:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_warning
	b	LBB0_10
LBB0_6:
	mov	x21, #0
LBB0_7:
Lloh4:
	adrp	x8, _png_tEXt@GOTPAGE
Lloh5:
	ldr	x8, [x8, _png_tEXt@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x22, x22, #1
	add	x2, x22, x21
	mov	x0, x19
	bl	_png_write_chunk_start
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	x2, x22
	bl	_png_write_chunk_data
	cbz	x21, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_png_write_chunk_data
LBB0_9:
	mov	x0, x19
	bl	_png_write_chunk_end
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_png_free
LBB0_10:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_tEXt\n"

l_.str.1:                               ; @.str.1
	.asciz	"Empty keyword in tEXt chunk"

	.comm	_png_tEXt,4,2                   ; @png_tEXt
	.comm	_PNG_tEXt,4,2                   ; @PNG_tEXt
.subsections_via_symbols
