	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function conv_rgba4444_rgb565
LCPI0_0:
	.long	61440                           ## 0xf000
	.long	61440                           ## 0xf000
	.long	61440                           ## 0xf000
	.long	61440                           ## 0xf000
LCPI0_1:
	.long	1920                            ## 0x780
	.long	1920                            ## 0x780
	.long	1920                            ## 0x780
	.long	1920                            ## 0x780
LCPI0_2:
	.long	30                              ## 0x1e
	.long	30                              ## 0x1e
	.long	30                              ## 0x1e
	.long	30                              ## 0x1e
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_conv_rgba4444_rgb565
	.p2align	4, 0x90
_conv_rgba4444_rgb565:                  ## @conv_rgba4444_rgb565
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.1:
	sarl	%r8d
	movslq	%r8d, %rcx
	sarl	%r9d
	movslq	%r9d, %r9
	movl	%edx, %r14d
	shlq	$2, %rcx
	shlq	$2, %r9
	movl	%r14d, %eax
	andl	$-8, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rax
	negq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%r14,4), %r12
	andq	$-32, %r12
	xorl	%r15d, %r15d
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [61440,61440,61440,61440]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [1920,1920,1920,1920]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [30,30,30,30]
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %r11                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	addq	%rcx, %r13
	addq	%r9, %r11
	cmpl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	je	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
	testl	%edx, %edx
	jle	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$8, %edx
	jb	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r9, %rax
	imulq	%r15, %rax
	addq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	movq	%rcx, %r8
	imulq	%r15, %r8
	addq	-56(%rbp), %r8                  ## 8-byte Folded Reload
	subq	%rax, %r8
	movl	$0, %r10d
	cmpq	$32, %r8
	jb	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%r11,%rax), %xmm3
	movdqu	16(%r11,%rax), %xmm4
	movdqa	%xmm3, %xmm5
	pand	%xmm8, %xmm5
	movdqa	%xmm4, %xmm6
	pand	%xmm8, %xmm6
	movdqa	%xmm3, %xmm7
	psrld	$1, %xmm7
	movdqa	%xmm4, %xmm0
	psrld	$1, %xmm0
	pand	%xmm1, %xmm7
	por	%xmm5, %xmm7
	pand	%xmm1, %xmm0
	por	%xmm6, %xmm0
	psrld	$3, %xmm3
	psrld	$3, %xmm4
	pand	%xmm2, %xmm3
	por	%xmm7, %xmm3
	pand	%xmm2, %xmm4
	por	%xmm0, %xmm4
	movdqu	%xmm3, (%r13,%rax)
	movdqu	%xmm4, 16(%r13,%rax)
	addq	$32, %rax
	cmpq	%rax, %r12
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %r10
	cmpq	%r14, %rax
	je	LBB0_13
	jmp	LBB0_9
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r10d, %r10d
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r10, %rax
	testb	$1, %r14b
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r11,%r10,4), %eax
	movl	%eax, %edi
	andl	$61440, %edi                    ## imm = 0xF000
	movl	%eax, %esi
	shrl	%esi
	andl	$1920, %esi                     ## imm = 0x780
	orl	%edi, %esi
	shrl	$3, %eax
	andl	$30, %eax
	orl	%esi, %eax
	movl	%eax, (%r13,%r10,4)
	movq	%r10, %rax
	orq	$1, %rax
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	notq	%r10
	cmpq	-80(%rbp), %r10                 ## 8-byte Folded Reload
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r11,%rax,4), %esi
	movl	%esi, %edi
	andl	$61440, %edi                    ## imm = 0xF000
	movl	%esi, %ebx
	shrl	%ebx
	andl	$1920, %ebx                     ## imm = 0x780
	orl	%edi, %ebx
	shrl	$3, %esi
	andl	$30, %esi
	orl	%ebx, %esi
	movl	%esi, (%r13,%rax,4)
	movl	4(%r11,%rax,4), %esi
	movl	%esi, %edi
	andl	$61440, %edi                    ## imm = 0xF000
	movl	%esi, %ebx
	shrl	%ebx
	andl	$1920, %ebx                     ## imm = 0x780
	orl	%edi, %ebx
	shrl	$3, %esi
	andl	$30, %esi
	orl	%ebx, %esi
	movl	%esi, 4(%r13,%rax,4)
	addq	$2, %rax
	cmpq	%rax, %r14
	jne	LBB0_12
	jmp	LBB0_13
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_conv_rgba4444_rgb565           ; -- Begin function conv_rgba4444_rgb565
	.p2align	2
_conv_rgba4444_rgb565:                  ; @conv_rgba4444_rgb565
	.cfi_startproc
; %bb.0:
	cmp	w3, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x8, #0
	asr	w10, w4, #1
	asr	w11, w5, #1
	mov	w9, w2
	sbfiz	x10, x10, #2, #32
	sbfiz	x11, x11, #2, #32
	and	x12, x9, #0xfffffff0
	lsl	x13, x9, #2
	and	x13, x13, #0x3ffffffc0
	movi.4s	v0, #240, lsl #8
	mov	w14, #1920
	dup.4s	v1, w14
	movi.4s	v2, #30
	mov	x14, x1
	mov	x15, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	add	x15, x15, x10
	add	x14, x14, x11
	cmp	w8, w3
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	cmp	w2, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x16, #0
	cmp	w2, #16
	b.lo	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x17, x11, x8, x1
	madd	x4, x10, x8, x0
	sub	x17, x4, x17
	cmp	x17, #64
	b.lo	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x16, #0
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x17, x14, x16
	ldp	q3, q4, [x17]
	and.16b	v5, v3, v0
	ldp	q6, q7, [x17, #32]
	and.16b	v16, v4, v0
	and.16b	v17, v6, v0
	and.16b	v18, v7, v0
	ushr.4s	v19, v3, #1
	ushr.4s	v20, v4, #1
	ushr.4s	v21, v6, #1
	ushr.4s	v22, v7, #1
	and.16b	v19, v19, v1
	and.16b	v20, v20, v1
	and.16b	v21, v21, v1
	and.16b	v22, v22, v1
	orr.16b	v5, v19, v5
	orr.16b	v16, v20, v16
	orr.16b	v17, v21, v17
	orr.16b	v18, v22, v18
	ushr.4s	v3, v3, #3
	ushr.4s	v4, v4, #3
	ushr.4s	v6, v6, #3
	ushr.4s	v7, v7, #3
	and.16b	v3, v3, v2
	and.16b	v4, v4, v2
	and.16b	v6, v6, v2
	and.16b	v7, v7, v2
	orr.16b	v3, v5, v3
	orr.16b	v4, v16, v4
	orr.16b	v5, v17, v6
	orr.16b	v6, v18, v7
	add	x17, x15, x16
	stp	q3, q4, [x17]
	stp	q5, q6, [x17, #32]
	add	x16, x16, #64
	cmp	x13, x16
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x16, x12
	cmp	x12, x9
	b.eq	LBB0_2
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x17, x16, #2
	ldr	w4, [x14, x17]
	and	w5, w4, #0xf000
	lsr	w6, w4, #1
	and	w6, w6, #0x780
	orr	w5, w6, w5
	lsr	w4, w4, #3
	and	w4, w4, #0x1e
	orr	w4, w5, w4
	str	w4, [x15, x17]
	add	x16, x16, #1
	cmp	x9, x16
	b.ne	LBB0_9
	b	LBB0_2
LBB0_10:
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
