	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_bKGD                 ## -- Begin function png_write_bKGD
	.p2align	4, 0x90
_png_write_bKGD:                        ## @png_write_bKGD
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movq	_PNG_COLOR_TYPE_PALETTE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	(%r15), %rax
	cmpq	(%r14), %rax
	jle	LBB0_5
## %bb.2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_18
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_6:
	movq	_PNG_COLOR_MASK_COLOR@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_11
## %bb.7:
	movl	8(%r15), %esi
	leaq	-64(%rbp), %rdi
	callq	_png_save_uint_16
	leaq	-56(%rbp), %rdi
	movl	12(%r15), %esi
	callq	_png_save_uint_16
	leaq	-48(%rbp), %rdi
	movl	16(%r15), %esi
	callq	_png_save_uint_16
	cmpl	$8, 12(%r14)
	jne	LBB0_10
## %bb.8:
	movl	-56(%rbp), %eax
	orl	-64(%rbp), %eax
	orl	-48(%rbp), %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_png_warning
	jmp	LBB0_16
LBB0_5:
	movl	%eax, -64(%rbp)
	movq	_png_bKGD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	jmp	LBB0_15
LBB0_10:
	movq	_png_bKGD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	movl	$6, %ecx
	jmp	LBB0_15
LBB0_11:
	movl	20(%r15), %esi
	movb	12(%r14), %cl
	movl	$1, %eax
	shll	%cl, %eax
	cmpl	%eax, %esi
	jge	LBB0_12
## %bb.14:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_png_save_uint_16
	movq	_png_bKGD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
LBB0_15:
	callq	_png_write_chunk
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_18
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
LBB0_4:
	movq	%r14, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_png_warning                    ## TAILCALL
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_write_bKGD\n"

	.comm	_PNG_COLOR_TYPE_PALETTE,4,2     ## @PNG_COLOR_TYPE_PALETTE
L_.str.1:                               ## @.str.1
	.asciz	"Invalid background palette index"

	.comm	_png_bKGD,4,2                   ## @png_bKGD
	.comm	_PNG_COLOR_MASK_COLOR,4,2       ## @PNG_COLOR_MASK_COLOR
L_.str.2:                               ## @.str.2
	.asciz	"Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"

L_.str.3:                               ## @.str.3
	.asciz	"Ignoring attempt to write bKGD chunk out-of-range for bit_depth"

	.comm	_PNG_FLAG_MNG_EMPTY_PLTE,4,2    ## @PNG_FLAG_MNG_EMPTY_PLTE
	.comm	_PNG_bKGD,4,2                   ## @PNG_bKGD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_write_bKGD                 ; -- Begin function png_write_bKGD
	.p2align	2
_png_write_bKGD:                        ; @png_write_bKGD
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
Lloh5:
	adrp	x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_COLOR_TYPE_PALETTE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x20]
	ldr	x9, [x19]
	cmp	x8, x9
	b.le	LBB0_8
; %bb.2:
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.3:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_4:
Lloh13:
	adrp	x8, _PNG_COLOR_MASK_COLOR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PNG_COLOR_MASK_COLOR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_10
; %bb.5:
	ldr	w1, [x20, #8]
	mov	x21, sp
	mov	x0, sp
	bl	_png_save_uint_16
	add	x0, x21, #8
	ldr	w1, [x20, #12]
	bl	_png_save_uint_16
	add	x0, x21, #16
	ldr	w1, [x20, #16]
	bl	_png_save_uint_16
	ldr	w8, [x19, #12]
	cmp	w8, #8
	b.ne	LBB0_9
; %bb.6:
	ldr	w8, [sp]
	ldr	w9, [sp, #8]
	orr	w8, w9, w8
	ldr	w9, [sp, #16]
	orr	w8, w8, w9
	cbz	w8, LBB0_9
; %bb.7:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_png_warning
	b	LBB0_13
LBB0_8:
	str	w8, [sp]
Lloh18:
	adrp	x8, _png_bKGD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _png_bKGD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #1
	b	LBB0_12
LBB0_9:
Lloh21:
	adrp	x8, _png_bKGD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _png_bKGD@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #6
	b	LBB0_12
LBB0_10:
	ldr	w1, [x20, #20]
	ldr	w8, [x19, #12]
	mov	w9, #1
	lsl	w8, w9, w8
	cmp	w1, w8
	b.ge	LBB0_15
; %bb.11:
	mov	x0, sp
	bl	_png_save_uint_16
Lloh24:
	adrp	x8, _png_bKGD@GOTPAGE
Lloh25:
	ldr	x8, [x8, _png_bKGD@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #2
LBB0_12:
	bl	_png_write_chunk
LBB0_13:
	ldr	x8, [sp, #24]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.14:
	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_15:
	ldr	x8, [sp, #24]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.16:
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_17:
	mov	x0, x19
	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
	b	_png_warning
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_write_bKGD\n"

	.comm	_PNG_COLOR_TYPE_PALETTE,4,2     ; @PNG_COLOR_TYPE_PALETTE
l_.str.1:                               ; @.str.1
	.asciz	"Invalid background palette index"

	.comm	_png_bKGD,4,2                   ; @png_bKGD
	.comm	_PNG_COLOR_MASK_COLOR,4,2       ; @PNG_COLOR_MASK_COLOR
l_.str.2:                               ; @.str.2
	.asciz	"Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"

l_.str.3:                               ; @.str.3
	.asciz	"Ignoring attempt to write bKGD chunk out-of-range for bit_depth"

	.comm	_PNG_FLAG_MNG_EMPTY_PLTE,4,2    ; @PNG_FLAG_MNG_EMPTY_PLTE
	.comm	_PNG_bKGD,4,2                   ; @PNG_bKGD
.subsections_via_symbols
