	.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_rgb565_0rgb1555
LCPI0_0:
	.long	32736                           ## 0x7fe0
	.long	32736                           ## 0x7fe0
	.long	32736                           ## 0x7fe0
	.long	32736                           ## 0x7fe0
LCPI0_1:
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_conv_rgb565_0rgb1555
	.p2align	4, 0x90
_conv_rgb565_0rgb1555:                  ## @conv_rgb565_0rgb1555
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	$32736, %edi                    ## imm = 0x7FE0
	callq	__mm_set1_epi16
	movl	%eax, %r13d
	movl	$31, %edi
	callq	__mm_set1_epi16
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_15
## %bb.1:
	leal	-7(%r14), %esi
	sarl	%r15d
	movslq	%r15d, %rcx
	sarl	%ebx
	movslq	%ebx, %rdx
	shlq	$2, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	shlq	$2, %rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	16(%rcx), %r9
	xorl	%r10d, %r10d
	movq	%rcx, %r11
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r10
	addq	-88(%rbp), %r15                 ## 8-byte Folded Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	addq	%rcx, %r11
	addq	%rcx, %r9
	cmpl	-44(%rbp), %r10d                ## 4-byte Folded Reload
	je	LBB0_15
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%r11, -104(%rbp)                ## 8-byte Spill
	movq	%r10, -120(%rbp)                ## 8-byte Spill
	movq	%r9, -128(%rbp)                 ## 8-byte Spill
	movl	$0, %r12d
	cmpl	$8, %r14d
	movl	%r13d, %ebx
	jl	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r12d, %r12d
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, -136(%rbp)                ## 8-byte Spill
	movq	%r15, %rdi
	callq	__mm_loadu_si128
	movl	%eax, %r13d
	movl	%eax, %edi
	movl	$1, %esi
	callq	__mm_slli_epi16
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	__mm_and_si128
	movl	%ebx, %r12d
	movl	%eax, %ebx
	movl	%r13d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	__mm_and_si128
	movl	%ebx, %edi
	movl	%r12d, %ebx
	movq	-136(%rbp), %r12                ## 8-byte Reload
	movl	%eax, %esi
	callq	__mm_or_si128
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	__mm_storeu_si128
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	addq	$32, %r14
	addq	$32, %r15
	addl	$8, %r12d
	cmpl	%r12d, %esi
	jg	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-112(%rbp), %r14                ## 8-byte Reload
	cmpl	%r14d, %r12d
	movl	%ebx, %r13d
	movq	-128(%rbp), %r9                 ## 8-byte Reload
	movq	-120(%rbp), %r10                ## 8-byte Reload
	movdqa	LCPI0_0(%rip), %xmm4            ## xmm4 = [32736,32736,32736,32736]
	movdqa	LCPI0_1(%rip), %xmm5            ## xmm5 = [31,31,31,31]
	movq	-104(%rbp), %r11                ## 8-byte Reload
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	jge	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %ecx
	notl	%r12d
	addl	%r14d, %r12d
	cmpl	$7, %r12d
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rbx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	imulq	%r10, %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	imulq	%r10, %rdx
	addq	-64(%rbp), %rdi                 ## 8-byte Folded Reload
	addq	-72(%rbp), %rdx                 ## 8-byte Folded Reload
	leaq	(%rdi,%rcx,4), %rdi
	leaq	(%rdx,%rcx,4), %rdx
	subq	%rdx, %rdi
	cmpq	$32, %rdi
	jae	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rbx
	jmp	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movq	%r12, %r8
	andq	$-8, %r8
	leaq	(%r8,%rcx), %rbx
	shlq	$2, %rcx
	leaq	(%r15,%rcx), %rdx
	addq	%r9, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	-16(%rcx,%rdi,4), %xmm0
	movdqu	(%rcx,%rdi,4), %xmm1
	movdqa	%xmm0, %xmm2
	psrld	$1, %xmm2
	movdqa	%xmm1, %xmm3
	psrld	$1, %xmm3
	pand	%xmm4, %xmm2
	pand	%xmm4, %xmm3
	pand	%xmm5, %xmm0
	por	%xmm2, %xmm0
	pand	%xmm5, %xmm1
	por	%xmm3, %xmm1
	movdqu	%xmm0, (%rdx,%rdi,4)
	movdqu	%xmm1, 16(%rdx,%rdi,4)
	addq	$8, %rdi
	cmpq	%rdi, %r8
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r8, %r12
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r11,%rbx,4), %ecx
	movl	%ecx, %edx
	shrl	%edx
	andl	$32736, %edx                    ## imm = 0x7FE0
	andl	$31, %ecx
	orl	%edx, %ecx
	movl	%ecx, (%r15,%rbx,4)
	incq	%rbx
	cmpl	%r14d, %ebx
	jl	LBB0_13
	jmp	LBB0_14
LBB0_15:
	addq	$104, %rsp
	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_rgb565_0rgb1555           ; -- Begin function conv_rgb565_0rgb1555
	.p2align	2
_conv_rgb565_0rgb1555:                  ; @conv_rgb565_0rgb1555
	.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
	mov	w14, #32736
	dup.4s	v0, w14
	movi.4s	v1, #31
	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	q2, q3, [x17]
	ldp	q4, q5, [x17, #32]
	ushr.4s	v6, v2, #1
	ushr.4s	v7, v3, #1
	ushr.4s	v16, v4, #1
	ushr.4s	v17, v5, #1
	and.16b	v6, v6, v0
	and.16b	v7, v7, v0
	and.16b	v16, v16, v0
	and.16b	v17, v17, v0
	and.16b	v2, v2, v1
	and.16b	v3, v3, v1
	and.16b	v4, v4, v1
	and.16b	v5, v5, v1
	orr.16b	v2, v6, v2
	orr.16b	v3, v7, v3
	orr.16b	v4, v16, v4
	orr.16b	v5, v17, v5
	add	x17, x15, x16
	stp	q2, q3, [x17]
	stp	q4, q5, [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]
	lsr	w5, w4, #1
	and	w5, w5, #0x7fe0
	bfxil	w5, w4, #0, #5
	str	w5, [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
