	.file	"extr_rgui.c_argb32_to_rgb5a3.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	argb32_to_rgb5a3, @function
argb32_to_rgb5a3:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	ebx, edi
	mov	ecx, edi
	movzx	eax, dil
	sar	ecx, 16
	mov	esi, ebx
	movzx	edx, bh
	shr	edi, 29
	shr	esi, 24
	movzx	ecx, cl
	cmp	esi, 255
	je	.L2
	movss	xmm1, DWORD PTR .LC0[rip]
	test	edi, edi
	jne	.L11
.L3:
	pxor	xmm0, xmm0
	movsd	xmm2, QWORD PTR .LC3[rip]
	cvtsi2ss	xmm0, ecx
	mulss	xmm0, xmm1
	cvtss2sd	xmm0, xmm0
	addsd	xmm0, xmm2
	cvttsd2si	rcx, xmm0
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, edx
	cmp	ecx, 255
	mulss	xmm0, xmm1
	cvtss2sd	xmm0, xmm0
	addsd	xmm0, xmm2
	cvttsd2si	rdx, xmm0
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, eax
	mov	eax, 255
	cmova	ecx, eax
	cmp	edx, 255
	mulss	xmm0, xmm1
	cmova	edx, eax
	cvtss2sd	xmm0, xmm0
	addsd	xmm0, xmm2
	cvttsd2si	rsi, xmm0
	cmp	esi, 255
	cmovbe	eax, esi
.L2:
	and	edx, -16
	shr	eax, 4
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	sal	edi, 12
	or	eax, edx
	shr	ecx, 4
	or	eax, edi
	sal	ecx, 8
	or	eax, ecx
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	shr	ebx, 28
	pxor	xmm0, xmm0
	pxor	xmm1, xmm1
	cvtsi2sd	xmm0, ebx
	mulsd	xmm0, QWORD PTR .LC1[rip]
	cvtsi2sd	xmm1, edi
	mulsd	xmm1, QWORD PTR .LC2[rip]
	divsd	xmm0, xmm1
	pxor	xmm1, xmm1
	cvtsd2ss	xmm1, xmm0
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	argb32_to_rgb5a3, .-argb32_to_rgb5a3
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1065353216
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	286331153
	.long	1068568849
	.align 8
.LC2:
	.long	2454267026
	.long	1069697316
	.align 8
.LC3:
	.long	0
	.long	1071644672
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rgui.c_argb32_to_rgb5a3.c"
	.text
	.global	__aeabi_ui2f
	.global	__aeabi_f2d
	.global	__aeabi_dmul
	.global	__aeabi_ddiv
	.global	__aeabi_d2f
	.global	__aeabi_fmul
	.global	__aeabi_dadd
	.global	__aeabi_d2uiz
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	argb32_to_rgb5a3, %function
argb32_to_rgb5a3:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	lsr	r3, r0, #24
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r3, #255
	asr	r5, r0, #16
	asr	r4, r0, #8
	and	r5, r5, #255
	and	r4, r4, #255
	and	r7, r0, #255
	lsr	r6, r0, #29
	beq	.L2
	cmp	r6, #0
	moveq	r8, #1065353216
	bne	.L10
.L3:
	mov	r0, r5
	bl	__aeabi_ui2f
	mov	r1, r8
	bl	__aeabi_fmul
	bl	__aeabi_f2d
	mov	r2, #0
	ldr	r3, .L11
	bl	__aeabi_dadd
	bl	__aeabi_d2uiz
	mov	r5, r0
	mov	r0, r4
	bl	__aeabi_ui2f
	mov	r1, r8
	bl	__aeabi_fmul
	bl	__aeabi_f2d
	mov	r2, #0
	ldr	r3, .L11
	bl	__aeabi_dadd
	bl	__aeabi_d2uiz
	mov	r4, r0
	mov	r0, r7
	bl	__aeabi_ui2f
	mov	r1, r8
	bl	__aeabi_fmul
	bl	__aeabi_f2d
	mov	r2, #0
	ldr	r3, .L11
	bl	__aeabi_dadd
	bl	__aeabi_d2uiz
	cmp	r5, #255
	movcs	r5, #255
	cmp	r4, #255
	movcs	r4, #255
	cmp	r0, #255
	movcc	r7, r0
	movcs	r7, #255
.L2:
	bic	r4, r4, #15
	orr	r4, r4, r7, lsr #4
	orr	r4, r4, r6, lsl #12
	lsr	r0, r5, #4
	orr	r0, r4, r0, lsl #8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L10:
	lsr	r0, r0, #28
	bl	__aeabi_ui2f
	bl	__aeabi_f2d
	ldr	r2, .L11+4
	ldr	r3, .L11+8
	bl	__aeabi_dmul
	mov	r8, r0
	mov	r0, r6
	mov	r9, r1
	bl	__aeabi_ui2f
	bl	__aeabi_f2d
	ldr	r2, .L11+12
	ldr	r3, .L11+16
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r8
	mov	r1, r9
	bl	__aeabi_ddiv
	bl	__aeabi_d2f
	mov	r8, r0
	b	.L3
.L12:
	.align	2
.L11:
	.word	1071644672
	.word	286331153
	.word	1068568849
	.word	-1840700270
	.word	1069697316
	.size	argb32_to_rgb5a3, .-argb32_to_rgb5a3
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
