	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_pCAL                 ## -- Begin function png_write_pCAL
	.p2align	4, 0x90
_png_write_pCAL:                        ## @png_write_pCAL
	.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	$776, %rsp                      ## imm = 0x308
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, %ebx
	movl	%ecx, -776(%rbp)                ## 4-byte Spill
	movl	%edx, -772(%rbp)                ## 4-byte Spill
	movl	%esi, %r14d
	movl	%edi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%r9d, %edx
	callq	_png_debug1
	movq	_PNG_EQUATION_LAST@GOTPCREL(%rip), %rax
	movl	%ebx, -780(%rbp)                ## 4-byte Spill
	cmpl	%ebx, (%rax)
	jg	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edi
	callq	_png_error
LBB0_2:
	movq	16(%rbp), %rbx
	leaq	-768(%rbp), %rdx
	movl	%r12d, %edi
	movl	%r14d, %esi
	callq	_png_check_keyword
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edi
	callq	_png_error
LBB0_4:
	leaq	1(%r15), %rdx
	leaq	L_.str.3(%rip), %rsi
	movl	$3, %edi
	movq	%rdx, -800(%rbp)                ## 8-byte Spill
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_png_debug1
	movq	%rbx, %rdi
	callq	_strlen
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	setne	%bl
	addq	%rax, %rbx
	leaq	L_.str.4(%rip), %rsi
	movl	$3, %edi
	movl	%ebx, %edx
	callq	_png_debug1
	leal	(,%r13,8), %esi
	movl	%r12d, -784(%rbp)               ## 4-byte Spill
	movl	%r12d, %edi
	callq	_png_malloc
	movq	%rax, %r12
	movq	%rbx, -808(%rbp)                ## 8-byte Spill
	addq	%rbx, %r15
	addq	$11, %r15
	movslq	%r13d, %rax
	movq	%rax, -792(%rbp)                ## 8-byte Spill
	movl	%r13d, %ebx
	testl	%r13d, %r13d
	movq	%r13, -816(%rbp)                ## 8-byte Spill
	jle	LBB0_7
## %bb.5:
	decl	%r13d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbp), %rax
	movq	(%rax,%r14,8), %rdi
	callq	_strlen
	xorl	%ecx, %ecx
	cmpq	%r14, %r13
	setne	%cl
	addq	%rax, %rcx
	movq	%rcx, (%r12,%r14,8)
	movl	$3, %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edx
	callq	_png_debug2
	addq	(%r12,%r14,8), %r15
	incq	%r14
	cmpq	%r14, %rbx
	jne	LBB0_6
LBB0_7:
	leaq	L_.str.6(%rip), %rsi
	movl	$3, %edi
	movl	%r15d, %edx
	callq	_png_debug1
	movq	_png_pCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-784(%rbp), %r13d               ## 4-byte Reload
	movl	%r13d, %edi
	movq	%r15, %rdx
	callq	_png_write_chunk_header
	leaq	-768(%rbp), %rsi
	movl	%r13d, %edi
	movq	-800(%rbp), %rdx                ## 8-byte Reload
	callq	_png_write_chunk_data
	leaq	-128(%rbp), %r14
	movq	%r14, %rdi
	movl	-772(%rbp), %esi                ## 4-byte Reload
	callq	_png_save_int_32
	leaq	-96(%rbp), %rdi
	movl	-776(%rbp), %esi                ## 4-byte Reload
	callq	_png_save_int_32
	movslq	-780(%rbp), %rax                ## 4-byte Folded Reload
	movq	%rax, -64(%rbp)
	movq	-792(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -56(%rbp)
	movl	$10, %edx
	movl	%r13d, %edi
	movq	%r14, %rsi
	callq	_png_write_chunk_data
	movl	%r13d, %edi
	movq	16(%rbp), %rsi
	movq	-808(%rbp), %rdx                ## 8-byte Reload
	callq	_png_write_chunk_data
	cmpl	$0, -816(%rbp)                  ## 4-byte Folded Reload
	movq	24(%rbp), %r14
	jle	LBB0_10
## %bb.8:
	movq	%rbx, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rsi
	movq	(%r12,%rbx,8), %rdx
	movl	%r13d, %edi
	callq	_png_write_chunk_data
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_9
LBB0_10:
	movl	%r13d, %edi
	movq	%r12, %rsi
	callq	_png_free
	movl	%r13d, %edi
	callq	_png_write_chunk_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$776, %rsp                      ## imm = 0x308
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_pCAL (%d parameters)"

	.comm	_PNG_EQUATION_LAST,4,2          ## @PNG_EQUATION_LAST
L_.str.1:                               ## @.str.1
	.asciz	"Unrecognized equation type for pCAL chunk"

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

L_.str.3:                               ## @.str.3
	.asciz	"pCAL purpose length = %d"

L_.str.4:                               ## @.str.4
	.asciz	"pCAL units length = %d"

L_.str.5:                               ## @.str.5
	.asciz	"pCAL parameter %d length = %lu"

L_.str.6:                               ## @.str.6
	.asciz	"pCAL total length = %d"

	.comm	_png_pCAL,4,2                   ## @png_pCAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_pCAL                 ; -- Begin function png_write_pCAL
	.p2align	2
_png_write_pCAL:                        ; @png_write_pCAL
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #784
	mov	x20, x7
	mov	x23, x6
	mov	x21, x5
	mov	x24, x4
	stp	w2, w3, [sp, #24]               ; 8-byte Folded Spill
	mov	x22, 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
	mov	x2, x5
	bl	_png_debug1
Lloh5:
	adrp	x8, _PNG_EQUATION_LAST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_EQUATION_LAST@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	x24, [sp, #32]                  ; 8-byte Folded Spill
	cmp	w8, w24
	b.gt	LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_2:
	add	x2, sp, #48
	mov	x0, x19
	mov	x1, x22
	bl	_png_check_keyword
	mov	x24, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_4:
	add	x2, x24, #1
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #3
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_png_debug1
	str	x23, [sp, #40]                  ; 8-byte Folded Spill
	mov	x0, x23
	bl	_strlen
	cmp	w21, #0
	cinc	x22, x0, ne
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #3
	mov	x2, x22
	bl	_png_debug1
	str	x22, [sp, #16]                  ; 8-byte Folded Spill
	add	x8, x24, x22
	add	x24, x8, #11
	sxtw	x8, w21
	str	x8, [sp]                        ; 8-byte Folded Spill
	lsl	w1, w21, #3
	mov	x0, x19
	bl	_png_malloc
	mov	x26, x0
	mov	w23, w21
	subs	w28, w21, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x25, #0
Lloh16:
	adrp	x22, l_.str.5@PAGE
Lloh17:
	add	x22, x22, l_.str.5@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x27, x25, #3
	ldr	x0, [x20, x27]
	bl	_strlen
	cmp	x28, x25
	cinc	x3, x0, ne
	str	x3, [x26, x27]
	mov	w0, #3
	mov	x1, x22
	mov	x2, x25
	bl	_png_debug2
	ldr	x8, [x26, x27]
	add	x24, x8, x24
	add	x25, x25, #1
	cmp	x23, x25
	b.ne	LBB0_6
LBB0_7:
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #3
	mov	x2, x24
	bl	_png_debug1
Lloh20:
	adrp	x8, _png_pCAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _png_pCAL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	bl	_png_write_chunk_header
	add	x1, sp, #48
	mov	x0, x19
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	bl	_png_write_chunk_data
	sub	x22, x29, #176
	sub	x0, x29, #176
	ldr	w1, [sp, #24]                   ; 4-byte Folded Reload
	bl	_png_save_int_32
	add	x0, x22, #32
	ldr	w1, [sp, #28]                   ; 4-byte Folded Reload
	bl	_png_save_int_32
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	sxtw	x9, w8
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	stp	x9, x8, [x29, #-112]
	sub	x1, x29, #176
	mov	x0, x19
	mov	w2, #10
	bl	_png_write_chunk_data
	mov	x0, x19
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x2, [sp, #16]                   ; 8-byte Folded Reload
	bl	_png_write_chunk_data
	cmp	w21, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x21, x26
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x20], #8
	ldr	x2, [x21], #8
	mov	x0, x19
	bl	_png_write_chunk_data
	subs	x23, x23, #1
	b.ne	LBB0_9
LBB0_10:
	mov	x0, x19
	mov	x1, x26
	bl	_png_free
	mov	x0, x19
	bl	_png_write_chunk_end
	ldur	x8, [x29, #-96]
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_12
; %bb.11:
	add	sp, sp, #784
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_pCAL (%d parameters)"

	.comm	_PNG_EQUATION_LAST,4,2          ; @PNG_EQUATION_LAST
l_.str.1:                               ; @.str.1
	.asciz	"Unrecognized equation type for pCAL chunk"

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

l_.str.3:                               ; @.str.3
	.asciz	"pCAL purpose length = %d"

l_.str.4:                               ; @.str.4
	.asciz	"pCAL units length = %d"

l_.str.5:                               ; @.str.5
	.asciz	"pCAL parameter %d length = %lu"

l_.str.6:                               ; @.str.6
	.asciz	"pCAL total length = %d"

	.comm	_png_pCAL,4,2                   ; @png_pCAL
.subsections_via_symbols
