	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_colorspace_set_rgb_coefficients ## -- Begin function png_colorspace_set_rgb_coefficients
	.p2align	4, 0x90
_png_colorspace_set_rgb_coefficients:   ## @png_colorspace_set_rgb_coefficients
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	jne	LBB0_30
## %bb.1:
	movq	%rdi, %rbx
	movq	_PNG_COLORSPACE_HAVE_ENDPOINTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%rdi)
	je	LBB0_30
## %bb.2:
	movq	32(%rbx), %rsi
	movq	%rsi, -48(%rbp)
	movq	40(%rbx), %r12
	movq	%r12, -40(%rbp)
	movq	48(%rbx), %r14
	movq	%r14, -56(%rbp)
	leaq	(%r12,%rsi), %r15
	addq	%r14, %r15
	jle	LBB0_28
## %bb.3:
	testq	%rsi, %rsi
	js	LBB0_28
## %bb.4:
	leaq	-48(%rbp), %rdi
	movl	$32768, %edx                    ## imm = 0x8000
	movq	%r15, %rcx
	callq	_png_muldiv
	testq	%rax, %rax
	je	LBB0_28
## %bb.5:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_28
## %bb.6:
	cmpq	$32768, %rax                    ## imm = 0x8000
	jg	LBB0_28
## %bb.7:
	testq	%r12, %r12
	js	LBB0_28
## %bb.8:
	leaq	-40(%rbp), %rdi
	movq	%r12, %rsi
	movl	$32768, %edx                    ## imm = 0x8000
	movq	%r15, %rcx
	callq	_png_muldiv
	testq	%rax, %rax
	je	LBB0_28
## %bb.9:
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_28
## %bb.10:
	cmpq	$32768, %rax                    ## imm = 0x8000
	jg	LBB0_28
## %bb.11:
	testq	%r14, %r14
	js	LBB0_28
## %bb.12:
	leaq	-56(%rbp), %rdi
	movq	%r14, %rsi
	movl	$32768, %edx                    ## imm = 0x8000
	movq	%r15, %rcx
	callq	_png_muldiv
	testq	%rax, %rax
	je	LBB0_28
## %bb.13:
	movq	-56(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_28
## %bb.14:
	cmpq	$32768, %rax                    ## imm = 0x8000
	jg	LBB0_28
## %bb.15:
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rcx
	leaq	(%rdx,%rax), %rdi
	addq	%rcx, %rdi
	cmpq	$32769, %rdi                    ## imm = 0x8001
	jg	LBB0_28
## %bb.16:
	movq	$-1, %rsi
	je	LBB0_18
## %bb.17:
	movl	$1, %esi
	cmpq	$32767, %rdi                    ## imm = 0x7FFF
	jg	LBB0_25
LBB0_18:
	cmpq	%rdx, %rcx
	jl	LBB0_21
## %bb.19:
	cmpq	%rax, %rcx
	jl	LBB0_21
## %bb.20:
	addq	%rsi, %rcx
	movq	%rcx, -40(%rbp)
	jmp	LBB0_25
LBB0_28:
	leaq	L_.str.1(%rip), %rsi
LBB0_29:
	movq	%rbx, %rdi
	callq	_png_error
LBB0_30:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	cmpq	%rcx, %rdx
	jl	LBB0_24
## %bb.22:
	cmpq	%rax, %rdx
	jl	LBB0_24
## %bb.23:
	addq	%rsi, %rdx
	movq	%rdx, -48(%rbp)
	jmp	LBB0_25
LBB0_24:
	addq	%rsi, %rax
	movq	%rax, -56(%rbp)
LBB0_25:
	addq	%rcx, %rax
	addq	%rdx, %rax
	cmpq	$32768, %rax                    ## imm = 0x8000
	jne	LBB0_26
## %bb.27:
	movq	%rdx, 16(%rbx)
	movq	%rcx, 8(%rbx)
	jmp	LBB0_30
LBB0_26:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_COLORSPACE_HAVE_ENDPOINTS,4,2 ## @PNG_COLORSPACE_HAVE_ENDPOINTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"internal error handling cHRM coefficients"

L_.str.1:                               ## @.str.1
	.asciz	"internal error handling cHRM->XYZ"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_colorspace_set_rgb_coefficients ; -- Begin function png_colorspace_set_rgb_coefficients
	.p2align	2
_png_colorspace_set_rgb_coefficients:   ; @png_colorspace_set_rgb_coefficients
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0]
	cbnz	x8, LBB0_20
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #24]
Lloh0:
	adrp	x9, _PNG_COLORSPACE_HAVE_ENDPOINTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PNG_COLORSPACE_HAVE_ENDPOINTS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.2:
	ldp	x1, x22, [x19, #32]
	stp	x22, x1, [sp, #16]
	ldr	x20, [x19, #48]
	str	x20, [sp, #8]
	add	x8, x22, x1
	add	x21, x8, x20
	cmp	x21, #1
	b.lt	LBB0_18
; %bb.3:
	tbnz	x1, #63, LBB0_18
; %bb.4:
	add	x0, sp, #24
	mov	w2, #32768
	mov	x3, x21
	bl	_png_muldiv
	cbz	x0, LBB0_18
; %bb.5:
	ldr	x8, [sp, #24]
	tbnz	x8, #63, LBB0_18
; %bb.6:
	cmp	x8, #8, lsl #12                 ; =32768
	b.gt	LBB0_18
; %bb.7:
	tbnz	x22, #63, LBB0_18
; %bb.8:
	add	x0, sp, #16
	mov	x1, x22
	mov	w2, #32768
	mov	x3, x21
	bl	_png_muldiv
	cbz	x0, LBB0_18
; %bb.9:
	ldr	x8, [sp, #16]
	tbnz	x8, #63, LBB0_18
; %bb.10:
	cmp	x8, #8, lsl #12                 ; =32768
	b.gt	LBB0_18
; %bb.11:
	tbnz	x20, #63, LBB0_18
; %bb.12:
	add	x0, sp, #8
	mov	x1, x20
	mov	w2, #32768
	mov	x3, x21
	bl	_png_muldiv
	cbz	x0, LBB0_18
; %bb.13:
	ldr	x8, [sp, #8]
	tbnz	x8, #63, LBB0_18
; %bb.14:
	cmp	x8, #8, lsl #12                 ; =32768
	b.gt	LBB0_18
; %bb.15:
	ldp	x9, x10, [sp, #16]
	add	x11, x10, x8
	add	x11, x11, x9
	mov	w12, #32769
	cmp	x11, x12
	b.gt	LBB0_18
; %bb.16:
	mov	w12, #32769
	cmp	x11, x12
	b.ne	LBB0_21
; %bb.17:
	mov	x11, #-1
	b	LBB0_23
LBB0_18:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_19:
	mov	x0, x19
	bl	_png_error
LBB0_20:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_21:
	cmp	x11, #8, lsl #12                ; =32768
	b.ge	LBB0_30
; %bb.22:
	mov	w11, #1
LBB0_23:
	cmp	x9, x10
	b.lt	LBB0_26
; %bb.24:
	cmp	x9, x8
	b.lt	LBB0_26
; %bb.25:
	add	x9, x11, x9
	str	x9, [sp, #16]
	b	LBB0_30
LBB0_26:
	cmp	x10, x9
	b.lt	LBB0_29
; %bb.27:
	cmp	x10, x8
	b.lt	LBB0_29
; %bb.28:
	add	x10, x11, x10
	str	x10, [sp, #24]
	b	LBB0_30
LBB0_29:
	add	x8, x11, x8
	str	x8, [sp, #8]
LBB0_30:
	add	x11, x9, x10
	add	x8, x11, x8
	cmp	x8, #8, lsl #12                 ; =32768
	b.ne	LBB0_32
; %bb.31:
	stp	x9, x10, [x19, #8]
	b	LBB0_20
LBB0_32:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_COLORSPACE_HAVE_ENDPOINTS,4,2 ; @PNG_COLORSPACE_HAVE_ENDPOINTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"internal error handling cHRM coefficients"

l_.str.1:                               ; @.str.1
	.asciz	"internal error handling cHRM->XYZ"

.subsections_via_symbols
