	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
_convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key: ## @convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	testl	%r9d, %r9d
	je	LBB0_6
## %bb.1:
	movq	24(%rbp), %r12
	movl	%r9d, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%ecx, %ecx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	-64(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	-88(%rbp), %rcx                 ## 8-byte Folded Reload
	je	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rbx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r15,4), %r13d
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_color_in_range
	movl	%r13d, %ecx
	shrl	%ecx
	andl	$32736, %ecx                    ## imm = 0x7FE0
	andl	$31, %r13d
	leal	(%rcx,%r13), %edx
	testl	%eax, %eax
	leal	32768(%r13,%rcx), %eax
	cmovnel	%edx, %eax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	LBB0_4
	jmp	LBB0_5
LBB0_6:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
_convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key: ; @convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	stp	w3, w4, [sp, #24]               ; 8-byte Folded Spill
	stp	x0, x2, [sp, #8]                ; 16-byte Folded Spill
	cbz	w5, LBB0_6
; %bb.1:
	mov	x19, x7
	mov	x23, x1
	mov	w26, #0
	mov	w27, #0
	mov	x28, #0
	mov	w22, w5
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	mov	w8, w8
	str	x8, [sp]                        ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x28, x28, #1
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	add	w27, w27, w8
	add	w26, w26, w23
	cmp	x28, x22
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x24, x8, w27, uxtw #2
	ldp	x21, x8, [sp]                   ; 16-byte Folded Reload
	add	x20, x8, w26, uxtw #2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w25, [x20], #4
	mov	x0, x19
	mov	x1, x25
	bl	_color_in_range
	lsr	w8, w25, #1
	and	w8, w8, #0x7fe0
	bfxil	w8, w25, #0, #5
	orr	w9, w8, #0x8000
	cmp	w0, #0
	csel	w8, w9, w8, eq
	str	w8, [x24], #4
	subs	x21, x21, #1
	b.ne	LBB0_5
	b	LBB0_2
LBB0_6:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key
.subsections_via_symbols
