	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function darken_work_cb_rgb565
LCPI0_0:
	.long	14823                           ## 0x39e7
	.long	14823                           ## 0x39e7
	.long	14823                           ## 0x39e7
	.long	14823                           ## 0x39e7
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_darken_work_cb_rgb565:                 ## @darken_work_cb_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
	movl	4(%rsi), %r15d
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.1:
	movl	(%rsi), %r13d
	movq	16(%rsi), %rdx
	movq	24(%rsi), %rdi
	movl	%r13d, %r8d
	andl	$-8, %r8d
	leaq	-8(%r8), %r9
	movq	%r9, %r10
	shrq	$3, %r10
	incq	%r10
	movq	%r10, %rax
	andq	$-2, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r13d, %r14d
	andl	$3, %r14d
	xorl	%r12d, %r12d
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [14823,14823,14823,14823]
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%r12d
	movl	8(%rsi), %eax
	movl	12(%rsi), %ecx
	sarl	%eax
	cltq
	leaq	(%rdi,%rax,4), %rdi
	sarl	%ecx
	movslq	%ecx, %rax
	leaq	(%rdx,%rax,4), %rdx
	cmpl	%r15d, %r12d
	je	LBB0_19
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##     Child Loop BB0_15 Depth 2
                                        ##     Child Loop BB0_17 Depth 2
	testq	%r13, %r13
	je	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$8, %r13d
	jb	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movl	$0, %eax
	cmpq	$32, %rcx
	jb	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%r9, %r9
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rdi,%rax,4), %xmm1
	movdqu	16(%rdi,%rax,4), %xmm2
	psrld	$2, %xmm1
	psrld	$2, %xmm2
	pand	%xmm0, %xmm1
	pand	%xmm0, %xmm2
	movdqu	%xmm1, (%rdx,%rax,4)
	movdqu	%xmm2, 16(%rdx,%rax,4)
	movdqu	32(%rdi,%rax,4), %xmm1
	movdqu	48(%rdi,%rax,4), %xmm2
	psrld	$2, %xmm1
	psrld	$2, %xmm2
	pand	%xmm0, %xmm1
	pand	%xmm0, %xmm2
	movdqu	%xmm1, 32(%rdx,%rax,4)
	movdqu	%xmm2, 48(%rdx,%rax,4)
	addq	$16, %rax
	addq	$-2, %rbx
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, %r10b
	je	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movdqu	(%rdi,%rax,4), %xmm1
	movdqu	16(%rdi,%rax,4), %xmm2
	psrld	$2, %xmm1
	psrld	$2, %xmm2
	pand	%xmm0, %xmm1
	pand	%xmm0, %xmm2
	movdqu	%xmm1, (%rdx,%rax,4)
	movdqu	%xmm2, 16(%rdx,%rax,4)
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r8, %rax
	cmpq	%r13, %r8
	je	LBB0_18
	jmp	LBB0_13
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	notq	%rbx
	addq	%r13, %rbx
	testq	%r14, %r14
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rcx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%rax,4), %r11d
	shrl	$2, %r11d
	andl	$14823, %r11d                   ## imm = 0x39E7
	movl	%r11d, (%rdx,%rax,4)
	incq	%rax
	decq	%rcx
	jne	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$3, %rbx
	jb	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%rax,4), %ecx
	shrl	$2, %ecx
	andl	$14823, %ecx                    ## imm = 0x39E7
	movl	%ecx, (%rdx,%rax,4)
	movl	4(%rdi,%rax,4), %ecx
	shrl	$2, %ecx
	andl	$14823, %ecx                    ## imm = 0x39E7
	movl	%ecx, 4(%rdx,%rax,4)
	movl	8(%rdi,%rax,4), %ecx
	shrl	$2, %ecx
	andl	$14823, %ecx                    ## imm = 0x39E7
	movl	%ecx, 8(%rdx,%rax,4)
	movl	12(%rdi,%rax,4), %ecx
	shrl	$2, %ecx
	andl	$14823, %ecx                    ## imm = 0x39E7
	movl	%ecx, 12(%rdx,%rax,4)
	addq	$4, %rax
	cmpq	%rax, %r13
	jne	LBB0_17
	jmp	LBB0_18
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	testb	$1, %r10b
	jne	LBB0_11
	jmp	LBB0_12
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_darken_work_cb_rgb565
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function darken_work_cb_rgb565
_darken_work_cb_rgb565:                 ; @darken_work_cb_rgb565
	.cfi_startproc
; %bb.0:
	ldr	w8, [x1, #4]
	cbz	w8, LBB0_11
; %bb.1:
	mov	w9, #0
	ldr	w10, [x1]
	ldp	x11, x12, [x1, #16]
	and	x13, x10, #0xfffffff0
	mov	w14, #14823
	dup.4s	v0, w14
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w9, #1
	ldp	w15, w16, [x1, #8]
	asr	w15, w15, #1
	add	x12, x12, w15, sxtw #2
	asr	w15, w16, #1
	add	x11, x11, w15, sxtw #2
	cmp	w9, w8
	b.eq	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	cbz	w10, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x17, #0
	cmp	w10, #16
	b.lo	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	x15, x11, x12
	cmp	x15, #64
	b.lo	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x15, x11, #32
	add	x16, x12, #32
	mov	x17, x13
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q1, q2, [x16, #-32]
	ldp	q3, q4, [x16], #64
	ushr.4s	v1, v1, #2
	ushr.4s	v2, v2, #2
	ushr.4s	v3, v3, #2
	ushr.4s	v4, v4, #2
	and.16b	v1, v1, v0
	and.16b	v2, v2, v0
	and.16b	v3, v3, v0
	and.16b	v4, v4, v0
	stp	q1, q2, [x15, #-32]
	stp	q3, q4, [x15], #64
	subs	x17, x17, #16
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x17, x13
	cmp	x13, x10
	b.eq	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsl	x16, x17, #2
	add	x15, x12, x16
	add	x16, x11, x16
	sub	x17, x10, x17
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x15], #4
	and	w0, w14, w0, lsr #2
	str	w0, [x16], #4
	subs	x17, x17, #1
	b.ne	LBB0_10
	b	LBB0_2
LBB0_11:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_darken_work_cb_rgb565
.subsections_via_symbols
