	.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_18
## %bb.1:
	cmpl	$8, 16(%r14)
	jne	LBB0_18
## %bb.2:
	movq	8(%r14), %rax
	movq	_PNG_COLOR_TYPE_RGB@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.3:
	testq	%rax, %rax
	jle	LBB0_18
## %bb.4:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_7
## %bb.5:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_6:                                 ## =>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_6
LBB0_7:
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.8:
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>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_9
	jmp	LBB0_18
LBB0_10:
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_18
## %bb.11:
	testq	%rax, %rax
	jle	LBB0_18
## %bb.12:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_15
## %bb.13:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_14:                                ## =>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_14
LBB0_15:
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.16:
	shlq	$4, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_17:                                ## =>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_17
LBB0_18:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_bgr"

	.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_19
; %bb.1:
	ldr	w8, [x20, #16]
	cmp	w8, #8
	b.ne	LBB0_19
; %bb.2:
	ldr	x8, [x20, #8]
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_6
; %bb.3:
	cmp	x8, #1
	b.lt	LBB0_19
; %bb.4:
	b.ne	LBB0_9
; %bb.5:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_12
LBB0_6:
Lloh8:
	adrp	x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w9, w10
	ccmp	x8, #1, #8, eq
	b.lt	LBB0_19
; %bb.7:
	cmp	x8, #2
	b.hs	LBB0_14
; %bb.8:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_17
LBB0_9:
	and	x10, x8, #0xfffffffffffffffe
	mov	w9, #12
	madd	x9, x10, x9, x19
	add	x11, x19, #12
	mov	x12, x10
LBB0_10:                                ; =>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_10
; %bb.11:
	cmp	x8, x10
	b.eq	LBB0_19
LBB0_12:
	sub	x8, x8, x10
LBB0_13:                                ; =>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_13
	b	LBB0_19
LBB0_14:
	and	x10, x8, #0xfffffffffffffffe
	add	x9, x19, x10, lsl #4
	add	x11, x19, #16
	mov	x12, x10
LBB0_15:                                ; =>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_15
; %bb.16:
	cmp	x8, x10
	b.eq	LBB0_19
LBB0_17:
	sub	x8, x8, x10
LBB0_18:                                ; =>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_18
LBB0_19:
	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
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_bgr"

	.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
