	.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	$336, %rsp                      ## imm = 0x150
	.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
	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
	leaq	-368(%rbp), %rdx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_png_check_keyword
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	testq	%r14, %r14
	jne	LBB0_2
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	callq	_png_error
	testq	%r14, %r14
	je	LBB0_6
LBB0_2:
	cmpb	$0, (%r14)
	je	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	callq	_strlen
	movq	%rax, %r12
	jmp	LBB0_7
LBB0_6:
	xorl	%r12d, %r12d
LBB0_7:
	movq	_PNG_UINT_31_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	incq	%rbx
	subq	%rbx, %rax
	cmpq	%rax, %r12
	jle	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edi
	callq	_png_error
LBB0_9:
	movq	_png_tEXt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	(%rbx,%r12), %rdx
	movl	%r15d, %edi
	callq	_png_write_chunk_header
	leaq	-368(%rbp), %rsi
	movl	%r15d, %edi
	movq	%rbx, %rdx
	callq	_png_write_chunk_data
	testq	%r12, %r12
	je	LBB0_11
## %bb.10:
	movl	%r15d, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_png_write_chunk_data
LBB0_11:
	movl	%r15d, %edi
	callq	_png_write_chunk_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	addq	$336, %rsp                      ## imm = 0x150
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_tEXt"

L_.str.1:                               ## @.str.1
	.asciz	"tEXt: invalid keyword"

	.comm	_PNG_UINT_31_MAX,8,3            ## @PNG_UINT_31_MAX
L_.str.2:                               ## @.str.2
	.asciz	"tEXt: text too long"

	.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, #400
	.cfi_def_cfa_offset 400
	stp	x28, x27, [sp, #336]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #352]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #368]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #384]            ; 16-byte Folded Spill
	add	x29, sp, #384
	.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	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
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_png_check_keyword
	mov	x22, x0
	cbz	x0, LBB0_2
; %bb.1:
	cbnz	x20, LBB0_3
	b	LBB0_5
LBB0_2:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
	cbz	x20, LBB0_5
LBB0_3:
	ldrb	w8, [x20]
	cbz	w8, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_strlen
	mov	x21, x0
	b	LBB0_6
LBB0_5:
	mov	x21, #0
LBB0_6:
Lloh7:
	adrp	x8, _PNG_UINT_31_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PNG_UINT_31_MAX@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	add	x22, x22, #1
	sub	x8, x8, x22
	cmp	x21, x8
	b.le	LBB0_8
; %bb.7:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_8:
Lloh12:
	adrp	x8, _png_tEXt@GOTPAGE
Lloh13:
	ldr	x8, [x8, _png_tEXt@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, x22, x21
	mov	x0, x19
	bl	_png_write_chunk_header
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x22
	bl	_png_write_chunk_data
	cbz	x21, LBB0_10
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_png_write_chunk_data
LBB0_10:
	mov	x0, x19
	bl	_png_write_chunk_end
	ldur	x8, [x29, #-56]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #384]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #368]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #352]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #336]            ; 16-byte Folded Reload
	add	sp, sp, #400
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_tEXt"

l_.str.1:                               ; @.str.1
	.asciz	"tEXt: invalid keyword"

	.comm	_PNG_UINT_31_MAX,8,3            ; @PNG_UINT_31_MAX
l_.str.2:                               ; @.str.2
	.asciz	"tEXt: text too long"

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