	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readpng_get_bgcolor            ## -- Begin function readpng_get_bgcolor
	.p2align	4, 0x90
_readpng_get_bgcolor:                   ## @readpng_get_bgcolor
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_png_ptr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_png_jmpbuf
	movl	%eax, %edi
	callq	_setjmp
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_png_ptr@GOTPCREL(%rip), %rdi
	movq	_info_ptr@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	movl	%eax, %edx
	callq	_png_destroy_read_struct
	movl	$2, %eax
	jmp	LBB0_17
LBB0_2:
	movl	(%rbx), %edi
	movq	_info_ptr@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_PNG_INFO_bKGD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_png_get_valid
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %edi
	movl	(%r13), %esi
	leaq	-48(%rbp), %rdx
	callq	_png_get_bKGD
	movq	_bit_depth@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$16, %eax
	jne	LBB0_6
## %bb.5:
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	sarl	$8, %ecx
	movl	%ecx, (%r12)
	movl	4(%rax), %ecx
	sarl	$8, %ecx
	movl	%ecx, (%r15)
	movl	8(%rax), %eax
	sarl	$8, %eax
	jmp	LBB0_15
LBB0_3:
	movl	$1, %eax
	jmp	LBB0_17
LBB0_6:
	movq	_color_type@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_PNG_COLOR_TYPE_GRAY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_14
## %bb.7:
	cmpl	$7, %eax
	jg	LBB0_14
## %bb.8:
	cmpl	$2, %eax
	je	LBB0_12
## %bb.9:
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.10:
	movq	-48(%rbp), %rax
	movl	12(%rax), %eax
	testl	%eax, %eax
	movl	$255, %ecx
	cmovel	%eax, %ecx
	jmp	LBB0_11
LBB0_14:
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r12)
	movl	4(%rax), %ecx
	movl	%ecx, (%r15)
	movl	8(%rax), %eax
LBB0_15:
	movl	%eax, (%r14)
LBB0_16:
	xorl	%eax, %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	-48(%rbp), %rax
	imull	$85, 12(%rax), %eax
	movl	%eax, (%r14)
	movl	%eax, (%r15)
	movl	%eax, (%r12)
	jmp	LBB0_16
LBB0_13:
	movq	-48(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, %ecx
	shll	$4, %ecx
	addl	%eax, %ecx
LBB0_11:
	movl	%ecx, (%r14)
	movl	%ecx, (%r15)
	movl	%ecx, (%r12)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_png_ptr,4,2                    ## @png_ptr
	.comm	_info_ptr,4,2                   ## @info_ptr
	.comm	_PNG_INFO_bKGD,4,2              ## @PNG_INFO_bKGD
	.comm	_bit_depth,4,2                  ## @bit_depth
	.comm	_color_type,8,3                 ## @color_type
	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ## @PNG_COLOR_TYPE_GRAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readpng_get_bgcolor            ; -- Begin function readpng_get_bgcolor
	.p2align	2
_readpng_get_bgcolor:                   ; @readpng_get_bgcolor
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x22, _png_ptr@GOTPAGE
Lloh1:
	ldr	x22, [x22, _png_ptr@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_png_jmpbuf
	bl	_setjmp
	cbz	x0, LBB0_2
; %bb.1:
	mov	x2, #0
Lloh2:
	adrp	x0, _png_ptr@GOTPAGE
Lloh3:
	ldr	x0, [x0, _png_ptr@GOTPAGEOFF]
Lloh4:
	adrp	x1, _info_ptr@GOTPAGE
Lloh5:
	ldr	x1, [x1, _info_ptr@GOTPAGEOFF]
	bl	_png_destroy_read_struct
	mov	w0, #2
	b	LBB0_9
LBB0_2:
	ldr	w0, [x22]
Lloh6:
	adrp	x23, _info_ptr@GOTPAGE
Lloh7:
	ldr	x23, [x23, _info_ptr@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _PNG_INFO_bKGD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PNG_INFO_bKGD@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_png_get_valid
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w0, [x22]
	ldr	w1, [x23]
	add	x2, sp, #8
	bl	_png_get_bKGD
Lloh11:
	adrp	x8, _bit_depth@GOTPAGE
Lloh12:
	ldr	x8, [x8, _bit_depth@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, #16
	b.ne	LBB0_6
; %bb.4:
	mov	w0, #0
	ldr	x8, [sp, #8]
	ldr	w9, [x8]
	asr	w9, w9, #8
	str	w9, [x21]
	ldr	w9, [x8, #4]
	asr	w9, w9, #8
	str	w9, [x20]
	ldr	w8, [x8, #8]
	asr	w8, w8, #8
	b	LBB0_8
LBB0_5:
	mov	w0, #1
	b	LBB0_9
LBB0_6:
Lloh14:
	adrp	x9, _color_type@GOTPAGE
Lloh15:
	ldr	x9, [x9, _color_type@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
Lloh17:
	adrp	x10, _PNG_COLOR_TYPE_GRAY@GOTPAGE
Lloh18:
	ldr	x10, [x10, _PNG_COLOR_TYPE_GRAY@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x9, x10
	ccmp	w8, #7, #0, eq
	b.le	LBB0_10
; %bb.7:
	mov	w0, #0
	ldr	x8, [sp, #8]
	ldr	w9, [x8]
	str	w9, [x21]
	ldr	w9, [x8, #4]
	str	w9, [x20]
	ldr	w8, [x8, #8]
LBB0_8:
	str	w8, [x19]
LBB0_9:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	cmp	w8, #2
	b.eq	LBB0_13
; %bb.11:
	cmp	w8, #1
	b.ne	LBB0_14
; %bb.12:
	mov	w8, #0
	ldr	x9, [sp, #8]
	ldr	w9, [x9, #12]
	mov	w10, #255
	cmp	w9, #0
	csel	w9, w8, w10, eq
	str	w9, [x19]
	str	w9, [x20]
	str	w9, [x21]
	mov	x0, x8
	b	LBB0_9
LBB0_13:
	mov	w0, #0
	ldr	x8, [sp, #8]
	ldr	w8, [x8, #12]
	mov	w9, #85
	mul	w8, w8, w9
	b	LBB0_15
LBB0_14:
	mov	w0, #0
	ldr	x8, [sp, #8]
	ldr	w8, [x8, #12]
	add	w8, w8, w8, lsl #4
LBB0_15:
	str	w8, [x19]
	str	w8, [x20]
	str	w8, [x21]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_png_ptr,4,2                    ; @png_ptr
	.comm	_info_ptr,4,2                   ; @info_ptr
	.comm	_PNG_INFO_bKGD,4,2              ; @PNG_INFO_bKGD
	.comm	_bit_depth,4,2                  ; @bit_depth
	.comm	_color_type,8,3                 ; @color_type
	.comm	_PNG_COLOR_TYPE_GRAY,8,3        ; @PNG_COLOR_TYPE_GRAY
.subsections_via_symbols
