	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_iTXt                 ## -- Begin function png_write_iTXt
	.p2align	4, 0x90
_png_write_iTXt:                        ## @png_write_iTXt
	.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
	subq	$408, %rsp                      ## imm = 0x198
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, -416(%rbp)                 ## 8-byte Spill
	movq	%rcx, -400(%rbp)                ## 8-byte Spill
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	leaq	-384(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_png_check_keyword
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_png_error
LBB0_2:
	leal	-128(%r15), %eax
	cmpl	$3, %eax
	movq	%r14, -408(%rbp)                ## 8-byte Spill
	movq	%r12, -440(%rbp)                ## 8-byte Spill
	ja	LBB0_6
## %bb.3:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	movl	$1, -380(%rbp,%rbx,4)
	incq	%rbx
	movl	$0, -388(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_8
LBB0_4:
	movl	$0, -380(%rbp,%rbx,4)
	incq	%rbx
	movb	$1, %al
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_png_error
	testl	%r15d, %r15d
	sete	%al
LBB0_7:
	movl	%eax, -388(%rbp)                ## 4-byte Spill
LBB0_8:
	movq	-400(%rbp), %rdi                ## 8-byte Reload
	movq	_PNG_COMPRESSION_TYPE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -380(%rbp,%rbx,4)
	leaq	2(%rbx), %r12
	testq	%rdi, %rdi
	leaq	L_.str.3(%rip), %r14
	cmoveq	%r14, %rdi
	movq	%rdi, -400(%rbp)                ## 8-byte Spill
	callq	_strlen
	movq	%rax, %r15
	leaq	1(%rax), %r13
	movq	-416(%rbp), %rdi                ## 8-byte Reload
	testq	%rdi, %rdi
	cmoveq	%r14, %rdi
	movq	%rdi, -416(%rbp)                ## 8-byte Spill
	callq	_strlen
	movq	-408(%rbp), %rcx                ## 8-byte Reload
	testq	%rcx, %rcx
	cmoveq	%r14, %rcx
	movq	%rcx, %r14
	movq	_PNG_UINT_31_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, %rdx
	movq	%r12, -408(%rbp)                ## 8-byte Spill
	subq	%r12, %rdx
	movq	%r13, %r12
	cmpq	%rdx, %r13
	leaq	3(%r15,%rbx), %rdx
	cmovaq	%rcx, %rdx
	leaq	1(%rax), %rdi
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	movq	%rdi, -448(%rbp)                ## 8-byte Spill
	cmpq	%rsi, %rdi
	leaq	1(%rdx,%rax), %r13
	cmovaq	%rcx, %r13
	movq	%r14, %rdi
	callq	_strlen
	leaq	-432(%rbp), %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_png_text_compress_init
	movl	-388(%rbp), %r15d               ## 4-byte Reload
	testb	%r15b, %r15b
	je	LBB0_9
## %bb.11:
	movq	-432(%rbp), %rax
	movq	_PNG_UINT_31_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	subq	%r13, %rcx
	cmpq	%rcx, %rax
	movq	-440(%rbp), %rbx                ## 8-byte Reload
	jbe	LBB0_13
## %bb.12:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_png_error
	movq	-432(%rbp), %rax
LBB0_13:
	movq	%rax, -424(%rbp)
	jmp	LBB0_14
LBB0_9:
	movq	_png_iTXt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-432(%rbp), %rdx
	movq	-440(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rcx
	callq	_png_text_compress
	movq	_Z_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.10:
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_png_error
LBB0_14:
	movq	_png_iTXt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	-424(%rbp), %r13
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_png_write_chunk_header
	leaq	-384(%rbp), %rsi
	movq	%rbx, %rdi
	movq	-408(%rbp), %rdx                ## 8-byte Reload
	callq	_png_write_chunk_data
	movq	%rbx, %rdi
	movq	-400(%rbp), %rsi                ## 8-byte Reload
	movq	%r12, %rdx
	callq	_png_write_chunk_data
	movq	%rbx, %rdi
	movq	-416(%rbp), %rsi                ## 8-byte Reload
	movq	-448(%rbp), %rdx                ## 8-byte Reload
	callq	_png_write_chunk_data
	testb	%r15b, %r15b
	je	LBB0_15
## %bb.16:
	movq	-424(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_png_write_chunk_data
	jmp	LBB0_17
LBB0_15:
	leaq	-432(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_png_write_compressed_data_out
LBB0_17:
	movq	%rbx, %rdi
	callq	_png_write_chunk_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	addq	$408, %rsp                      ## imm = 0x198
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_4
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_iTXt"

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

L_.str.2:                               ## @.str.2
	.asciz	"iTXt: invalid compression"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ## @PNG_COMPRESSION_TYPE_BASE
L_.str.3:                               ## @.str.3
	.space	1

	.comm	_PNG_UINT_31_MAX,8,3            ## @PNG_UINT_31_MAX
	.comm	_png_iTXt,4,2                   ## @png_iTXt
	.comm	_Z_OK,8,3                       ## @Z_OK
L_.str.4:                               ## @.str.4
	.asciz	"iTXt: uncompressed text too long"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_iTXt                 ; -- Begin function png_write_iTXt
	.p2align	2
_png_write_iTXt:                        ; @png_write_iTXt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #464
	.cfi_def_cfa_offset 464
	stp	x28, x27, [sp, #368]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #384]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #400]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #416]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #432]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #448]            ; 16-byte Folded Spill
	add	x29, sp, #448
	.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 w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x5
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x24, 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, #-96]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x21
	bl	_png_check_keyword
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_2:
	sub	w8, w24, #128
	cmp	w8, #3
	b.hi	LBB0_6
; %bb.3:
Lloh7:
	adrp	x9, lJTI0_0@PAGE
Lloh8:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_4
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_4:
	mov	w27, #0
	add	x21, x21, #1
	add	x8, sp, #24
	mov	w9, #1
	str	w9, [x8, x21, lsl #2]
	b	LBB0_7
LBB0_5:
	add	x21, x21, #1
	add	x8, sp, #24
	str	wzr, [x8, x21, lsl #2]
	mov	w27, #1
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_error
	cmp	w24, #0
	cset	w27, eq
LBB0_7:
Lloh11:
	adrp	x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	x9, sp, #24
	add	x9, x9, x21, lsl #2
	str	w8, [x9, #4]
	add	x21, x21, #2
Lloh14:
	adrp	x26, l_.str.3@PAGE
Lloh15:
	add	x26, x26, l_.str.3@PAGEOFF
	cmp	x20, #0
	csel	x20, x26, x20, eq
	mov	x0, x20
	bl	_strlen
	add	x24, x0, #1
	cmp	x23, #0
	csel	x23, x26, x23, eq
	mov	x0, x23
	bl	_strlen
	add	x25, x0, #1
	cmp	x22, #0
	csel	x22, x26, x22, eq
Lloh16:
	adrp	x28, _PNG_UINT_31_MAX@GOTPAGE
Lloh17:
	ldr	x28, [x28, _PNG_UINT_31_MAX@GOTPAGEOFF]
	ldr	x8, [x28]
	add	x9, x24, x21
	sub	x10, x8, x21
	cmp	x24, x10
	csel	x9, x8, x9, hi
	add	x10, x9, x25
	sub	x9, x8, x9
	cmp	x25, x9
	csel	x26, x8, x10, hi
	mov	x0, x22
	bl	_strlen
	mov	x2, x0
	add	x0, sp, #8
	mov	x1, x22
	bl	_png_text_compress_init
Lloh18:
	adrp	x8, _png_iTXt@GOTPAGE
Lloh19:
	ldr	x8, [x8, _png_iTXt@GOTPAGEOFF]
	str	w27, [sp, #4]                   ; 4-byte Folded Spill
	tbz	w27, #0, LBB0_11
; %bb.8:
	mov	x27, x8
	ldr	x8, [sp, #8]
	ldr	x9, [x28]
	sub	x9, x9, x26
	cmp	x8, x9
	b.ls	LBB0_10
; %bb.9:
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_png_error
	ldr	x8, [sp, #8]
LBB0_10:
	str	x8, [sp, #16]
	b	LBB0_13
LBB0_11:
	mov	x27, x8
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x26
	bl	_png_text_compress
Lloh22:
	adrp	x8, _Z_OK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _Z_OK@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_13
; %bb.12:
	ldr	x1, [x19]
	mov	x0, x19
	bl	_png_error
LBB0_13:
	ldr	w1, [x27]
	ldr	x8, [sp, #16]
	add	x2, x8, x26
	mov	x0, x19
	bl	_png_write_chunk_header
	add	x1, sp, #24
	mov	x0, x19
	mov	x2, x21
	bl	_png_write_chunk_data
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_png_write_chunk_data
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	bl	_png_write_chunk_data
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	tbz	w8, #0, LBB0_15
; %bb.14:
	ldr	x2, [sp, #16]
	mov	x0, x19
	mov	x1, x22
	bl	_png_write_chunk_data
	b	LBB0_16
LBB0_15:
	add	x1, sp, #8
	mov	x0, x19
	bl	_png_write_compressed_data_out
LBB0_16:
	mov	x0, x19
	bl	_png_write_chunk_end
	ldur	x8, [x29, #-96]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	ldp	x29, x30, [sp, #448]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #432]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #416]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #400]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #384]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #368]            ; 16-byte Folded Reload
	add	sp, sp, #464
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_5-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_5-LBB0_4)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_iTXt"

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

l_.str.2:                               ; @.str.2
	.asciz	"iTXt: invalid compression"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ; @PNG_COMPRESSION_TYPE_BASE
l_.str.3:                               ; @.str.3
	.space	1

	.comm	_PNG_UINT_31_MAX,8,3            ; @PNG_UINT_31_MAX
	.comm	_png_iTXt,4,2                   ; @png_iTXt
	.comm	_Z_OK,8,3                       ; @Z_OK
l_.str.4:                               ; @.str.4
	.asciz	"iTXt: uncompressed text too long"

.subsections_via_symbols
