	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_bgr                     ## -- Begin function png_do_bgr
	.p2align	4, 0x90
_png_do_bgr:                            ## @png_do_bgr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_png_debug
	movl	(%r14), %ecx
	movq	_PNG_COLOR_MASK_COLOR@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_31
## %bb.1:
	movq	8(%r14), %rax
	movl	16(%r14), %edx
	cmpl	$16, %edx
	je	LBB0_19
## %bb.2:
	cmpl	$8, %edx
	jne	LBB0_31
## %bb.3:
	movq	_PNG_COLOR_TYPE_RGB@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_11
## %bb.4:
	testq	%rax, %rax
	jle	LBB0_31
## %bb.5:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_8
## %bb.6:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	movl	8(%rbx), %esi
	movl	%esi, (%rbx)
	movl	%edx, 8(%rbx)
	movl	12(%rbx), %edx
	movl	20(%rbx), %esi
	movl	%esi, 12(%rbx)
	movl	%edx, 20(%rbx)
	movl	24(%rbx), %edx
	movl	32(%rbx), %esi
	movl	%esi, 24(%rbx)
	movl	%edx, 32(%rbx)
	movl	36(%rbx), %edx
	movl	44(%rbx), %esi
	movl	%esi, 36(%rbx)
	movl	%edx, 44(%rbx)
	addq	$48, %rbx
	addq	$-4, %rax
	jne	LBB0_7
LBB0_8:
	testq	%rcx, %rcx
	je	LBB0_31
## %bb.9:
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rcx), %edx
	movl	8(%rbx,%rcx), %esi
	movl	%esi, (%rbx,%rcx)
	movl	%edx, 8(%rbx,%rcx)
	addq	$12, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_10
	jmp	LBB0_31
LBB0_19:
	movq	_PNG_COLOR_TYPE_RGB@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_24
## %bb.20:
	testq	%rax, %rax
	jle	LBB0_31
## %bb.21:
	cmpq	$1, %rax
	je	LBB0_29
## %bb.22:
	movq	%rax, %rcx
	andq	$-2, %rcx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	movq	16(%rbx), %rsi
	movq	%rsi, (%rbx)
	movq	%rdx, 16(%rbx)
	movq	24(%rbx), %rdx
	movq	40(%rbx), %rsi
	movq	%rsi, 24(%rbx)
	movq	%rdx, 40(%rbx)
	addq	$48, %rbx
	addq	$-2, %rcx
	jne	LBB0_23
	jmp	LBB0_29
LBB0_11:
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_31
## %bb.12:
	testq	%rax, %rax
	jle	LBB0_31
## %bb.13:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_16
## %bb.14:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	movl	8(%rbx), %esi
	movl	%esi, (%rbx)
	movl	%edx, 8(%rbx)
	movl	16(%rbx), %edx
	movl	24(%rbx), %esi
	movl	%esi, 16(%rbx)
	movl	%edx, 24(%rbx)
	movl	32(%rbx), %edx
	movl	40(%rbx), %esi
	movl	%esi, 32(%rbx)
	movl	%edx, 40(%rbx)
	movl	48(%rbx), %edx
	movl	56(%rbx), %esi
	movl	%esi, 48(%rbx)
	movl	%edx, 56(%rbx)
	addq	$64, %rbx
	addq	$-4, %rax
	jne	LBB0_15
LBB0_16:
	testq	%rcx, %rcx
	je	LBB0_31
## %bb.17:
	shlq	$4, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rax), %edx
	movl	8(%rbx,%rax), %esi
	movl	%esi, (%rbx,%rax)
	movl	%edx, 8(%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	LBB0_18
	jmp	LBB0_31
LBB0_24:
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_31
## %bb.25:
	testq	%rax, %rax
	jle	LBB0_31
## %bb.26:
	cmpq	$1, %rax
	je	LBB0_29
## %bb.27:
	movq	%rax, %rcx
	andq	$-2, %rcx
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	movq	16(%rbx), %rsi
	movq	%rsi, (%rbx)
	movq	%rdx, 16(%rbx)
	movq	32(%rbx), %rdx
	movq	48(%rbx), %rsi
	movq	%rsi, 32(%rbx)
	movq	%rdx, 48(%rbx)
	addq	$64, %rbx
	addq	$-2, %rcx
	jne	LBB0_28
LBB0_29:
	testb	$1, %al
	je	LBB0_31
## %bb.30:
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movq	%rcx, (%rbx)
	movq	%rax, 16(%rbx)
LBB0_31:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_bgr\n"

	.comm	_PNG_COLOR_MASK_COLOR,4,2       ## @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_TYPE_RGB,4,2         ## @PNG_COLOR_TYPE_RGB
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,4,2   ## @PNG_COLOR_TYPE_RGB_ALPHA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_bgr                     ; -- Begin function png_do_bgr
	.p2align	2
_png_do_bgr:                            ; @png_do_bgr
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_png_debug
	ldr	w9, [x20]
Lloh2:
	adrp	x8, _PNG_COLOR_MASK_COLOR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PNG_COLOR_MASK_COLOR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_27
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	w10, [x20, #16]
	cmp	w10, #16
	b.eq	LBB0_7
; %bb.2:
	cmp	w10, #8
	b.ne	LBB0_27
; %bb.3:
Lloh5:
	adrp	x10, _PNG_COLOR_TYPE_RGB@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_11
; %bb.4:
	cmp	x8, #1
	b.lt	LBB0_27
; %bb.5:
	b.ne	LBB0_17
; %bb.6:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_20
LBB0_7:
Lloh8:
	adrp	x10, _PNG_COLOR_TYPE_RGB@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_14
; %bb.8:
	cmp	x8, #1
	b.lt	LBB0_27
; %bb.9:
	add	x9, x19, #16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x9]
	ldur	d1, [x9, #-16]
	stur	d0, [x9, #-16]
	str	d1, [x9], #24
	subs	x8, x8, #1
	b.ne	LBB0_10
	b	LBB0_27
LBB0_11:
Lloh11:
	adrp	x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w9, w10
	ccmp	x8, #1, #8, eq
	b.lt	LBB0_27
; %bb.12:
	cmp	x8, #2
	b.hs	LBB0_22
; %bb.13:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_25
LBB0_14:
Lloh14:
	adrp	x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	cmp	w9, w10
	ccmp	x8, #1, #8, eq
	b.lt	LBB0_27
; %bb.15:
	add	x9, x19, #16
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x9]
	ldur	d1, [x9, #-16]
	stur	d0, [x9, #-16]
	str	d1, [x9], #32
	subs	x8, x8, #1
	b.ne	LBB0_16
	b	LBB0_27
LBB0_17:
	and	x10, x8, #0xfffffffffffffffe
	mov	w9, #12
	madd	x9, x10, x9, x19
	add	x11, x19, #12
	mov	x12, x10
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldur	w13, [x11, #-12]
	ldp	w15, w14, [x11, #-4]
	ldr	w16, [x11, #8]
	stur	w15, [x11, #-12]
	stp	w13, w16, [x11, #-4]
	str	w14, [x11, #8]
	add	x11, x11, #24
	subs	x12, x12, #2
	b.ne	LBB0_18
; %bb.19:
	cmp	x8, x10
	b.eq	LBB0_27
LBB0_20:
	sub	x8, x8, x10
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	ldr	w11, [x9, #8]
	str	w11, [x9]
	str	w10, [x9, #8]
	add	x9, x9, #12
	subs	x8, x8, #1
	b.ne	LBB0_21
	b	LBB0_27
LBB0_22:
	and	x10, x8, #0xfffffffffffffffe
	add	x9, x19, x10, lsl #4
	add	x11, x19, #16
	mov	x12, x10
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldur	w13, [x11, #-16]
	ldr	w14, [x11]
	ldur	w15, [x11, #-8]
	ldr	w16, [x11, #8]
	stur	w15, [x11, #-16]
	str	w16, [x11]
	stur	w13, [x11, #-8]
	str	w14, [x11, #8]
	add	x11, x11, #32
	subs	x12, x12, #2
	b.ne	LBB0_23
; %bb.24:
	cmp	x8, x10
	b.eq	LBB0_27
LBB0_25:
	sub	x8, x8, x10
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	ldr	w11, [x9, #8]
	str	w11, [x9]
	str	w10, [x9, #8]
	add	x9, x9, #16
	subs	x8, x8, #1
	b.ne	LBB0_26
LBB0_27:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_bgr\n"

	.comm	_PNG_COLOR_MASK_COLOR,4,2       ; @PNG_COLOR_MASK_COLOR
	.comm	_PNG_COLOR_TYPE_RGB,4,2         ; @PNG_COLOR_TYPE_RGB
	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,4,2   ; @PNG_COLOR_TYPE_RGB_ALPHA
.subsections_via_symbols
