	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function argb32_to_rgb5a3
LCPI0_0:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x3fb1111111111111              ## double 0.066666666666666666
LCPI0_2:
	.quad	0x3fc2492492492492              ## double 0.14285714285714285
LCPI0_3:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_argb32_to_rgb5a3:                      ## @argb32_to_rgb5a3
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	movl	%edi, %eax
	shrl	$16, %eax
	movzbl	%al, %eax
	movzbl	%bh, %ecx
	movzbl	%bl, %esi
	movl	%edi, %edx
	shrl	$29, %edx
	cmpl	$-16777217, %edi                ## imm = 0xFEFFFFFF
	ja	LBB0_5
## %bb.1:
	cmpl	$536870912, %ebx                ## imm = 0x20000000
	jae	LBB0_3
## %bb.2:
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_4
LBB0_3:
	shrl	$28, %ebx
	cvtsi2ss	%ebx, %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	LCPI0_1(%rip), %xmm0
	cvtsi2ss	%edx, %xmm1
	cvtss2sd	%xmm1, %xmm1
	mulsd	LCPI0_2(%rip), %xmm1
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
LBB0_4:
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	mulss	%xmm0, %xmm1
	cvtss2sd	%xmm1, %xmm1
	movsd	LCPI0_3(%rip), %xmm2            ## xmm2 = mem[0],zero
	addsd	%xmm2, %xmm1
	cvttsd2si	%xmm1, %rax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ecx, %xmm1
	mulss	%xmm0, %xmm1
	cvtss2sd	%xmm1, %xmm1
	addsd	%xmm2, %xmm1
	cvttsd2si	%xmm1, %rcx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%esi, %xmm1
	mulss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	cvttsd2si	%xmm0, %rdi
	cmpl	$255, %eax
	movl	$255, %esi
	cmovael	%esi, %eax
	cmpl	$255, %ecx
	cmovael	%esi, %ecx
	cmpl	$255, %edi
	cmovbl	%edi, %esi
LBB0_5:
	andl	$240, %ecx
	shrl	$4, %esi
	shll	$12, %edx
	shll	$4, %eax
	andl	$3840, %eax                     ## imm = 0xF00
	orl	%edx, %eax
	orl	%ecx, %eax
	orl	%esi, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_argb32_to_rgb5a3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function argb32_to_rgb5a3
_argb32_to_rgb5a3:                      ; @argb32_to_rgb5a3
	.cfi_startproc
; %bb.0:
	lsr	w8, w0, #8
	fmov	s0, w0
	mov.s	v0[1], w8
	ubfx	w9, w0, #16, #8
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	lsr	w8, w0, #29
	lsr	w10, w0, #24
	cmp	w10, #254
	b.hi	LBB0_4
; %bb.1:
	fmov	s1, #1.00000000
	cbz	w8, LBB0_3
; %bb.2:
	lsr	w10, w0, #28
	ucvtf	s1, w10
	fcvt	d1, s1
	mov	x10, #1229782938247303441
	movk	x10, #16305, lsl #48
	fmov	d2, x10
	fmul	d1, d1, d2
	ucvtf	s2, w8
	fcvt	d2, s2
	mov	x10, #9362
	movk	x10, #37449, lsl #16
	movk	x10, #18724, lsl #32
	movk	x10, #16322, lsl #48
	fmov	d3, x10
	fmul	d2, d2, d3
	fdiv	d1, d1, d2
	fcvt	s1, d1
LBB0_3:
	ucvtf	s2, w9
	fmul	s2, s1, s2
	fcvt	d2, s2
	fmov	d3, #0.50000000
	fadd	d2, d2, d3
	fcvtzu	w9, d2
	ucvtf.2s	v0, v0
	fmul.2s	v0, v0, v1[0]
	fcvtl	v0.2d, v0.2s
	fmov.2d	v1, #0.50000000
	fadd.2d	v0, v0, v1
	fcvtzu.2d	v0, v0
	xtn.2s	v0, v0
	mov	w10, #255
	cmp	w9, #255
	csel	w9, w9, w10, lo
	movi	d1, #0x0000ff000000ff
	umin.2s	v0, v0, v1
LBB0_4:
	mov.s	w10, v0[1]
	and	w10, w10, #0xf0
	fmov	w11, s0
	lsl	w9, w9, #4
	and	w9, w9, #0xf00
	bfi	w9, w8, #12, #3
	orr	w8, w9, w10
	orr	w0, w8, w11, lsr #4
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_argb32_to_rgb5a3
.subsections_via_symbols
