	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_handle_hIST                ## -- Begin function png_handle_hIST
	.p2align	4, 0x90
_png_handle_hIST:                       ## @png_handle_hIST
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PNG_MAX_PALETTE_LENGTH@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movl	(%r13), %eax
	movq	_PNG_HAVE_IHDR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.11:
	movq	_PNG_HAVE_IDAT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_png_error
LBB0_2:
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	cmpl	8(%r13), %eax
	jne	LBB0_20
## %bb.3:
	cmpl	(%r15), %eax
	ja	LBB0_20
## %bb.4:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	incl	%r14d
	cmpl	$3, %r14d
	jb	LBB0_7
## %bb.5:
	cmpl	$2, %eax
	movl	$1, %r14d
	cmovael	%eax, %r14d
	xorl	%r15d, %r15d
	leaq	-56(%rbp), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_png_crc_read
	movq	%rbx, %rdi
	callq	_png_get_uint_16
	movl	%eax, (%r12,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	LBB0_6
LBB0_7:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_png_crc_finish
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_png_set_hIST
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_PNG_HAVE_PLTE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.17:
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.18:
	movq	_PNG_INFO_hIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.19:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_13
LBB0_20:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_13
LBB0_16:
	leaq	L_.str.3(%rip), %rsi
LBB0_13:
	movq	%r13, %rdi
	callq	_png_warning
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.14:
	movq	%r13, %rdi
	movl	%r14d, %esi
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_png_crc_finish                 ## TAILCALL
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_MAX_PALETTE_LENGTH,4,2     ## @PNG_MAX_PALETTE_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_handle_hIST\n"

	.comm	_PNG_HAVE_IHDR,4,2              ## @PNG_HAVE_IHDR
L_.str.1:                               ## @.str.1
	.asciz	"Missing IHDR before hIST"

	.comm	_PNG_HAVE_IDAT,4,2              ## @PNG_HAVE_IDAT
L_.str.2:                               ## @.str.2
	.asciz	"Invalid hIST after IDAT"

	.comm	_PNG_HAVE_PLTE,4,2              ## @PNG_HAVE_PLTE
L_.str.3:                               ## @.str.3
	.asciz	"Missing PLTE before hIST"

	.comm	_PNG_INFO_hIST,4,2              ## @PNG_INFO_hIST
L_.str.4:                               ## @.str.4
	.asciz	"Duplicate hIST chunk"

L_.str.5:                               ## @.str.5
	.asciz	"Incorrect hIST chunk length"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_handle_hIST                ; -- Begin function png_handle_hIST
	.p2align	2
_png_handle_hIST:                       ; @png_handle_hIST
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	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	x23, _PNG_MAX_PALETTE_LENGTH@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PNG_MAX_PALETTE_LENGTH@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w8, [x19]
Lloh9:
	adrp	x9, _PNG_HAVE_IHDR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PNG_HAVE_IHDR@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh12:
	adrp	x9, _PNG_HAVE_IDAT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PNG_HAVE_IDAT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.2:
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_3:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_4:
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w8, w8, #1
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.5:
	ldr	w9, [x23]
	cmp	w8, w9
	b.hi	LBB0_17
; %bb.6:
	add	w9, w20, #1
	cmp	w9, #3
	b.lo	LBB0_9
; %bb.7:
	cmp	w8, #1
	csinc	w20, w8, wzr, hi
	mov	x23, x22
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	x1, x29, #64
	mov	x0, x19
	mov	w2, #2
	bl	_png_crc_read
	sub	x0, x29, #64
	bl	_png_get_uint_16
	str	w0, [x23], #4
	subs	x20, x20, #1
	b.ne	LBB0_8
LBB0_9:
	mov	x0, x19
	mov	w1, #0
	bl	_png_crc_finish
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_png_set_hIST
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.12:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh22:
	adrp	x9, _PNG_HAVE_PLTE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PNG_HAVE_PLTE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.14:
	cbz	x21, LBB0_4
; %bb.15:
	ldr	w8, [x21]
Lloh25:
	adrp	x9, _PNG_INFO_hIST@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PNG_INFO_hIST@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.16:
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_17:
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_19:
	mov	x0, x19
	bl	_png_warning
	ldur	x8, [x29, #-56]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	mov	x0, x19
	mov	x1, x20
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_png_crc_finish
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_MAX_PALETTE_LENGTH,4,2     ; @PNG_MAX_PALETTE_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_handle_hIST\n"

	.comm	_PNG_HAVE_IHDR,4,2              ; @PNG_HAVE_IHDR
l_.str.1:                               ; @.str.1
	.asciz	"Missing IHDR before hIST"

	.comm	_PNG_HAVE_IDAT,4,2              ; @PNG_HAVE_IDAT
l_.str.2:                               ; @.str.2
	.asciz	"Invalid hIST after IDAT"

	.comm	_PNG_HAVE_PLTE,4,2              ; @PNG_HAVE_PLTE
l_.str.3:                               ; @.str.3
	.asciz	"Missing PLTE before hIST"

	.comm	_PNG_INFO_hIST,4,2              ; @PNG_INFO_hIST
l_.str.4:                               ; @.str.4
	.asciz	"Duplicate hIST chunk"

l_.str.5:                               ; @.str.5
	.asciz	"Incorrect hIST chunk length"

.subsections_via_symbols
