	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_write_swap_alpha        ## -- Begin function png_do_write_swap_alpha
	.p2align	4, 0x90
_png_do_write_swap_alpha:               ## @png_do_write_swap_alpha
	.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
	movq	(%r14), %rax
	movq	_PNG_COLOR_TYPE_RGB_ALPHA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.1:
	cmpl	$8, 8(%r14)
	movq	16(%r14), %rax
	jne	LBB0_9
## %bb.2:
	testq	%rax, %rax
	jle	LBB0_33
## %bb.3:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_6
## %bb.4:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx), %xmm0
	movdqu	16(%rbx), %xmm1
	movdqu	32(%rbx), %xmm2
	movdqu	48(%rbx), %xmm3
	pshufd	$57, %xmm0, %xmm0               ## xmm0 = xmm0[1,2,3,0]
	movdqu	%xmm0, (%rbx)
	pshufd	$57, %xmm1, %xmm0               ## xmm0 = xmm1[1,2,3,0]
	movdqu	%xmm0, 16(%rbx)
	pshufd	$57, %xmm2, %xmm0               ## xmm0 = xmm2[1,2,3,0]
	movdqu	%xmm0, 32(%rbx)
	pshufd	$57, %xmm3, %xmm0               ## xmm0 = xmm3[1,2,3,0]
	movdqu	%xmm0, 48(%rbx)
	addq	$64, %rbx
	addq	$-4, %rax
	jne	LBB0_5
LBB0_6:
	testq	%rcx, %rcx
	je	LBB0_33
## %bb.7:
	shlq	$4, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rax), %xmm0
	pshufd	$57, %xmm0, %xmm0               ## xmm0 = xmm0[1,2,3,0]
	movdqu	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	LBB0_8
	jmp	LBB0_33
LBB0_16:
	movq	_PNG_COLOR_TYPE_GRAY_ALPHA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_33
## %bb.17:
	cmpl	$8, 8(%r14)
	movq	16(%r14), %rax
	jne	LBB0_26
## %bb.18:
	testq	%rax, %rax
	jle	LBB0_33
## %bb.19:
	cmpq	$4, %rax
	jae	LBB0_21
## %bb.20:
	xorl	%edx, %edx
	movq	%rbx, %rcx
	jmp	LBB0_24
LBB0_9:
	testq	%rax, %rax
	jle	LBB0_33
## %bb.10:
	cmpq	$1, %rax
	jne	LBB0_12
## %bb.11:
	movq	%rbx, %rdx
	jmp	LBB0_14
LBB0_26:
	testq	%rax, %rax
	jle	LBB0_33
## %bb.27:
	leaq	-1(%rax), %rdx
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jb	LBB0_30
## %bb.28:
	andq	$-4, %rax
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx), %xmm0
	movdqu	16(%rbx), %xmm1
	movdqu	32(%rbx), %xmm2
	movdqu	48(%rbx), %xmm3
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm0, (%rbx)
	pshufd	$78, %xmm1, %xmm0               ## xmm0 = xmm1[2,3,0,1]
	movdqu	%xmm0, 16(%rbx)
	pshufd	$78, %xmm2, %xmm0               ## xmm0 = xmm2[2,3,0,1]
	movdqu	%xmm0, 32(%rbx)
	pshufd	$78, %xmm3, %xmm0               ## xmm0 = xmm3[2,3,0,1]
	movdqu	%xmm0, 48(%rbx)
	addq	$64, %rbx
	addq	$-4, %rax
	jne	LBB0_29
LBB0_30:
	testq	%rcx, %rcx
	je	LBB0_33
## %bb.31:
	shlq	$4, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rax), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	LBB0_32
	jmp	LBB0_33
LBB0_12:
	movq	%rax, %rcx
	andq	$-2, %rcx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movsd	(%rbx), %xmm0                   ## xmm0 = mem[0],zero
	movups	8(%rbx), %xmm1
	movdqu	40(%rbx), %xmm2
	movups	%xmm1, (%rbx)
	movsd	24(%rbx), %xmm1                 ## xmm1 = mem[0],zero
	movlhps	%xmm0, %xmm1                    ## xmm1 = xmm1[0],xmm0[0]
	movups	%xmm1, 16(%rbx)
	leaq	64(%rbx), %rdx
	movq	32(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	movdqu	%xmm2, 32(%rbx)
	movq	56(%rbx), %xmm1                 ## xmm1 = mem[0],zero
	punpcklqdq	%xmm0, %xmm1            ## xmm1 = xmm1[0],xmm0[0]
	movdqu	%xmm1, 48(%rbx)
	movq	%rdx, %rbx
	addq	$-2, %rcx
	jne	LBB0_13
LBB0_14:
	testb	$1, %al
	je	LBB0_33
## %bb.15:
	movups	8(%rdx), %xmm0
	movq	(%rdx), %xmm1                   ## xmm1 = mem[0],zero
	movups	%xmm0, (%rdx)
	movq	24(%rdx), %xmm0                 ## xmm0 = mem[0],zero
	punpcklqdq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0]
	movdqu	%xmm0, 16(%rdx)
	jmp	LBB0_33
LBB0_21:
	movq	%rax, %rdx
	andq	$-4, %rdx
	leaq	(%rbx,%rdx,8), %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rsi,8), %xmm0
	movdqu	16(%rbx,%rsi,8), %xmm1
	pshufd	$177, %xmm0, %xmm0              ## xmm0 = xmm0[1,0,3,2]
	movdqu	%xmm0, (%rbx,%rsi,8)
	pshufd	$177, %xmm1, %xmm0              ## xmm0 = xmm1[1,0,3,2]
	movdqu	%xmm0, 16(%rbx,%rsi,8)
	addq	$4, %rsi
	cmpq	%rsi, %rdx
	jne	LBB0_22
## %bb.23:
	cmpq	%rdx, %rax
	je	LBB0_33
LBB0_24:
	subq	%rdx, %rax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	rolq	$32, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_25
LBB0_33:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in png_do_write_swap_alpha\n"

	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ## @PNG_COLOR_TYPE_RGB_ALPHA
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ## @PNG_COLOR_TYPE_GRAY_ALPHA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_png_do_write_swap_alpha        ; -- Begin function png_do_write_swap_alpha
	.p2align	2
_png_do_write_swap_alpha:               ; @png_do_write_swap_alpha
	.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	x8, [x20]
Lloh2:
	adrp	x9, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PNG_COLOR_TYPE_RGB_ALPHA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	ldr	w9, [x20, #8]
	ldr	x8, [x20, #16]
	cmp	w9, #8
	b.ne	LBB0_10
; %bb.2:
	cmp	x8, #1
	b.lt	LBB0_30
; %bb.3:
	cmp	x8, #8
	b.hs	LBB0_15
; %bb.4:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_18
LBB0_5:
Lloh5:
	adrp	x9, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PNG_COLOR_TYPE_GRAY_ALPHA@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_30
; %bb.6:
	ldr	w9, [x20, #8]
	ldr	x8, [x20, #16]
	cmp	w9, #8
	b.ne	LBB0_12
; %bb.7:
	cmp	x8, #1
	b.lt	LBB0_30
; %bb.8:
	cmp	x8, #8
	b.hs	LBB0_20
; %bb.9:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_23
LBB0_10:
	cmp	x8, #1
	b.lt	LBB0_30
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x19]
	ldr	d1, [x19, #24]
	mov.d	v1[1], v0[0]
	ldur	q0, [x19, #8]
	stp	q0, q1, [x19], #32
	subs	x8, x8, #1
	b.ne	LBB0_11
	b	LBB0_30
LBB0_12:
	cmp	x8, #1
	b.lt	LBB0_30
; %bb.13:
	cmp	x8, #8
	b.hs	LBB0_25
; %bb.14:
	mov	x10, #0
	mov	x9, x19
	b	LBB0_28
LBB0_15:
	and	x10, x8, #0xfffffffffffffff8
	add	x9, x19, x10, lsl #4
	add	x11, x19, #64
	mov	x12, x10
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #64
	ld4.4s	{ v0, v1, v2, v3 }, [x13]
	mov.16b	v4, v1
	mov.16b	v5, v2
	ld4.4s	{ v16, v17, v18, v19 }, [x11]
	mov.16b	v6, v3
	mov.16b	v7, v0
	mov.16b	v0, v17
	mov.16b	v1, v18
	mov.16b	v2, v19
	mov.16b	v3, v16
	st4.4s	{ v4, v5, v6, v7 }, [x13]
	st4.4s	{ v0, v1, v2, v3 }, [x11]
	add	x11, x11, #128
	subs	x12, x12, #8
	b.ne	LBB0_16
; %bb.17:
	cmp	x8, x10
	b.eq	LBB0_30
LBB0_18:
	sub	x8, x8, x10
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	q0, [x9]
	ext.16b	v0, v0, v0, #4
	str	q0, [x9], #16
	subs	x8, x8, #1
	b.ne	LBB0_19
	b	LBB0_30
LBB0_20:
	and	x10, x8, #0xfffffffffffffff8
	add	x9, x19, x10, lsl #3
	add	x11, x19, #32
	mov	x12, x10
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #32
	ld2.4s	{ v0, v1 }, [x13]
	ld2.4s	{ v3, v4 }, [x11]
	mov.16b	v2, v0
	mov.16b	v5, v3
	st2.4s	{ v1, v2 }, [x13]
	st2.4s	{ v4, v5 }, [x11]
	add	x11, x11, #64
	subs	x12, x12, #8
	b.ne	LBB0_21
; %bb.22:
	cmp	x8, x10
	b.eq	LBB0_30
LBB0_23:
	sub	x8, x8, x10
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x9]
	rev64.2s	v0, v0
	str	d0, [x9], #8
	subs	x8, x8, #1
	b.ne	LBB0_24
	b	LBB0_30
LBB0_25:
	and	x10, x8, #0xfffffffffffffff8
	add	x9, x19, x10, lsl #4
	add	x11, x19, #64
	mov	x12, x10
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #64
	ld4.4s	{ v0, v1, v2, v3 }, [x13]
	mov.16b	v4, v2
	mov.16b	v5, v3
	ld4.4s	{ v16, v17, v18, v19 }, [x11]
	mov.16b	v6, v0
	mov.16b	v7, v1
	mov.16b	v0, v18
	mov.16b	v1, v19
	mov.16b	v2, v16
	mov.16b	v3, v17
	st4.4s	{ v4, v5, v6, v7 }, [x13]
	st4.4s	{ v0, v1, v2, v3 }, [x11]
	add	x11, x11, #128
	subs	x12, x12, #8
	b.ne	LBB0_26
; %bb.27:
	cmp	x8, x10
	b.eq	LBB0_30
LBB0_28:
	sub	x8, x8, x10
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	q0, [x9]
	ext.16b	v0, v0, v0, #8
	str	q0, [x9], #16
	subs	x8, x8, #1
	b.ne	LBB0_29
LBB0_30:
	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
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in png_do_write_swap_alpha\n"

	.comm	_PNG_COLOR_TYPE_RGB_ALPHA,8,3   ; @PNG_COLOR_TYPE_RGB_ALPHA
	.comm	_PNG_COLOR_TYPE_GRAY_ALPHA,8,3  ; @PNG_COLOR_TYPE_GRAY_ALPHA
.subsections_via_symbols
