	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_iCCP                 ## -- Begin function png_write_iCCP
	.p2align	4, 0x90
_png_write_iCCP:                        ## @png_write_iCCP
	.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	$360, %rsp                      ## imm = 0x168
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	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
	testq	%r14, %r14
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_2:
	movq	%r14, %rdi
	callq	_png_get_uint_32
	movl	%eax, %r15d
	cmpl	$131, %eax
	jg	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_4:
	cmpl	$4, 32(%r14)
	jl	LBB0_7
## %bb.5:
	movl	%r15d, %eax
	andl	$3, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_7:
	movq	%r14, %rdi
	callq	_png_get_uint_32
	cmpl	%eax, %r15d
	je	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_9:
	leaq	-384(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_png_check_keyword
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_11:
	movq	_PNG_COMPRESSION_TYPE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movslq	%ebx, %rcx
	movl	%eax, -380(%rbp,%rcx,4)
	addl	$2, %ebx
	leaq	-392(%rbp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_png_text_compress_init
	movq	_png_iCCP@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	callq	_png_text_compress
	movq	_Z_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.12:
	movq	(%r13), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_13:
	movl	(%r14), %esi
	movslq	%ebx, %rdx
	addq	-392(%rbp), %rdx
	movq	%r13, %rdi
	callq	_png_write_chunk_header
	leaq	-384(%rbp), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_png_write_chunk_data
	leaq	-392(%rbp), %rsi
	movq	%r13, %rdi
	callq	_png_write_compressed_data_out
	movq	%r13, %rdi
	callq	_png_write_chunk_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	addq	$360, %rsp                      ## imm = 0x168
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_iCCP"

L_.str.1:                               ## @.str.1
	.asciz	"No profile for iCCP chunk"

L_.str.2:                               ## @.str.2
	.asciz	"ICC profile too short"

L_.str.3:                               ## @.str.3
	.asciz	"ICC profile length invalid (not a multiple of 4)"

L_.str.4:                               ## @.str.4
	.asciz	"Profile length does not match profile"

L_.str.5:                               ## @.str.5
	.asciz	"iCCP: invalid keyword"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ## @PNG_COMPRESSION_TYPE_BASE
	.comm	_png_iCCP,4,2                   ## @png_iCCP
	.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_iCCP                 ; -- Begin function png_write_iCCP
	.p2align	2
_png_write_iCCP:                        ; @png_write_iCCP
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #416
	.cfi_def_cfa_offset 416
	stp	x24, x23, [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 w23, -56
	.cfi_offset w24, -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
	cbnz	x20, 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:
	mov	x0, x20
	bl	_png_get_uint_32
	mov	x22, x0
	cmp	w0, #131
	b.gt	LBB0_4
; %bb.3:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_4:
	ldr	w8, [x20, #32]
	and	w9, w22, #0x3
	cmp	w8, #4
	ccmp	w9, #0, #4, ge
	b.eq	LBB0_6
; %bb.5:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_6:
	mov	x0, x20
	bl	_png_get_uint_32
	cmp	w22, w0
	b.eq	LBB0_8
; %bb.7:
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_8:
	add	x23, sp, #20
	add	x2, sp, #20
	mov	x0, x19
	mov	x1, x21
	bl	_png_check_keyword
	mov	x21, x0
	cbnz	w0, LBB0_10
; %bb.9:
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_10:
Lloh15:
	adrp	x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PNG_COMPRESSION_TYPE_BASE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	add	x9, x23, w21, sxtw #2
	str	w8, [x9, #4]
	add	w21, w21, #2
	add	x0, sp, #8
	mov	x1, x20
	mov	x2, x22
	bl	_png_text_compress_init
Lloh18:
	adrp	x20, _png_iCCP@GOTPAGE
Lloh19:
	ldr	x20, [x20, _png_iCCP@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x21
	bl	_png_text_compress
Lloh20:
	adrp	x8, _Z_OK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _Z_OK@GOTPAGEOFF]
Lloh22:
	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, w21, sxtw
	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]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	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	x24, x23, [sp, #352]            ; 16-byte Folded Reload
	add	sp, sp, #416
	ret
LBB0_14:
	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 AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_iCCP"

l_.str.1:                               ; @.str.1
	.asciz	"No profile for iCCP chunk"

l_.str.2:                               ; @.str.2
	.asciz	"ICC profile too short"

l_.str.3:                               ; @.str.3
	.asciz	"ICC profile length invalid (not a multiple of 4)"

l_.str.4:                               ; @.str.4
	.asciz	"Profile length does not match profile"

l_.str.5:                               ; @.str.5
	.asciz	"iCCP: invalid keyword"

	.comm	_PNG_COMPRESSION_TYPE_BASE,4,2  ; @PNG_COMPRESSION_TYPE_BASE
	.comm	_png_iCCP,4,2                   ; @png_iCCP
	.comm	_Z_OK,8,3                       ; @Z_OK
.subsections_via_symbols
