// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/compress.h
// Function: vector_compress(vector_type, void*, float const*, float const*, float const*)
inline void vector_compress
	(vector_type t, void *s, const float *f1, const float *f2, const float *f3)
{
	unsigned int *m = (unsigned int *)s;
	const unsigned int *p1 = (const unsigned int *)f1;
	const unsigned int *p2 = (const unsigned int *)f2;
	const unsigned int *p3 = (const unsigned int *)f3;
	unsigned int max, i1, i2, i3;
	switch (t)
	{
	case VECTOR96:
		m[0] = *p1;
		m[1] = *p2;
		m[2] = *p3;
		break;
	case VECTOR48:
		if (float_iswrong (*p1) || float_iswrong (*p2) || float_iswrong (*p3))
			break;
		m[0] = 0, m[1] = bitclr (m[1], 0, 16);
		if (float_istoobig (*p1))
			m[0] |= bitget (~0u, 0, 16);
		else if (float_istoosmall (*p1))
			;
		else
			m[0] |= bitget (*p1, 12, 28);
		if (float_istoobig (*p2))
			m[0] |= bitput (bitget (~0u, 0, 16), 16, 32);
		else if (float_istoosmall (*p2))
			;
		else
			m[0] |= bitput (bitget (*p2, 12, 28), 16, 32);
		if (float_istoobig (*p3))
			m[1] |= bitget (~0u, 0, 16);
		else if (float_istoosmall (*p3))
			;
		else
			m[1] |= bitget (*p3, 12, 28);
		break;
	case VECTOR32:
	case VECTOR24:
		if (float_iswrong (*p1) || float_iswrong (*p2) || float_iswrong (*p3))
		{
			max = i1 = i2 = i3 = 0;
		}
		else
		{
			max = *p1>*p2? (*p1>*p3? *p1: *p3): (*p2>*p3? *p2: *p3);
			max = float_istoobig (max)? 0x7F : float_istoosmall (max)? 0x60 : bitget (max, 23, 31);
			i1 = float_istoobig (*p1)? ~0u : (bitget (*p1, 0, 23) | bitput (1, 23, 24)) >> (1 + max - bitget (*p1, 23, 31));
			i2 = float_istoobig (*p2)? ~0u : (bitget (*p2, 0, 23) | bitput (1, 23, 24)) >> (1 + max - bitget (*p2, 23, 31));
			i3 = float_istoobig (*p3)? ~0u : (bitget (*p3, 0, 23) | bitput (1, 23, 24)) >> (1 + max - bitget (*p3, 23, 31));
		}
		if (t == VECTOR32)
			m[0] = 0
				| bitput (bitget (i1, 14, 23), 0, 9)
				| bitput (bitget (i2, 14, 23), 9, 18)
				| bitput (bitget (i3, 14, 23), 18, 27)
				| bitput (bitget (max, 0, 5), 27, 32)
				;
		else
			m[0] = bitclr (m[0], 0, 24)
				| bitput (bitget (i1, 17, 23), 0, 6)
				| bitput (bitget (i2, 17, 23), 6, 12)
				| bitput (bitget (i3, 17, 23), 12, 18)
				| bitput (bitget (max, 0, 5), 18, 23)
				;
		break;
	default:
		;
	}
}

// Assembly:
leal -0x2(%rdi), %eax
cmpl $0x2, %eax
jb 0xc29f
cmpl $0x1, %edi
je 0xc3d0
testl %edi, %edi
jne 0xc4a6
movl (%rdx), %eax
movl %eax, (%rsi)
movl (%rcx), %eax
movl %eax, 0x4(%rsi)
movl (%r8), %eax
movl %eax, 0x8(%rsi)
retq
pushq %rbx
movl (%rdx), %ebx
xorl %eax, %eax
cmpl $0x7f7fffff, %ebx       # imm = 0x7F7FFFFF
ja 0xc38f
movl (%rcx), %r11d
cmpl $0x7f7fffff, %r11d      # imm = 0x7F7FFFFF
ja 0xc38f
movl (%r8), %r10d
movl $0x0, %r8d
movl $0x0, %r9d
movl $0x0, %edx
cmpl $0x7f7fffff, %r10d      # imm = 0x7F7FFFFF
ja 0xc397
cmpl %r11d, %ebx
movl %r11d, %eax
cmoval %ebx, %eax
cmpl %r10d, %eax
cmovbel %r10d, %eax
movl %eax, %ecx
shrl $0x17, %ecx
cmpl $0x30800000, %eax       # imm = 0x30800000
movl $0x60, %edx
cmovael %ecx, %edx
cmpl $0x40000000, %eax       # imm = 0x40000000
movl $0x7f, %eax
cmovbl %edx, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %r8d
cmpl $0x3fffffff, %ebx       # imm = 0x3FFFFFFF
ja 0xc33d
movl %ebx, %r8d
andl $0x7fffff, %r8d         # imm = 0x7FFFFF
orl $0x800000, %r8d         # imm = 0x800000
shrl $0x17, %ebx
movl %eax, %ecx
subl %ebx, %ecx
incb %cl
shrl %cl, %r8d
movl %edx, %r9d
cmpl $0x3fffffff, %r11d      # imm = 0x3FFFFFFF
ja 0xc368
movl %r11d, %r9d
andl $0x7fffff, %r9d         # imm = 0x7FFFFF
orl $0x800000, %r9d         # imm = 0x800000
shrl $0x17, %r11d
movl %eax, %ecx
subl %r11d, %ecx
incb %cl
shrl %cl, %r9d
cmpl $0x3fffffff, %r10d      # imm = 0x3FFFFFFF
ja 0xc397
movl %r10d, %edx
andl $0x7fffff, %edx         # imm = 0x7FFFFF
orl $0x800000, %edx         # imm = 0x800000
shrl $0x17, %r10d
movl %eax, %ecx
subl %r10d, %ecx
incb %cl
shrl %cl, %edx
jmp 0xc397
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %edx, %edx
cmpl $0x2, %edi
popq %rbx
jne 0xc473
shrl $0xe, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
shrl $0x5, %r9d
andl $0x3fe00, %r9d          # imm = 0x3FE00
shll $0x4, %edx
andl $0x7fc0000, %edx        # imm = 0x7FC0000
shll $0x1b, %eax
orl %r8d, %eax
orl %r9d, %eax
orl %edx, %eax
jmp 0xc4a4
cmpl $0x7f7fffff, (%rdx)     # imm = 0x7F7FFFFF
ja 0xc4a6
cmpl $0x7f7fffff, (%rcx)     # imm = 0x7F7FFFFF
ja 0xc4a6
cmpl $0x7f7fffff, (%r8)      # imm = 0x7F7FFFFF
ja 0xc4a6
andl $0x0, (%rsi)
movl 0x4(%rsi), %edi
movl %edi, %eax
andl $0xffff0000, %eax       # imm = 0xFFFF0000
movl %eax, 0x4(%rsi)
movl (%rdx), %r9d
movl $0xffff, %edx           # imm = 0xFFFF
cmpl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
ja 0xc429
xorl %edx, %edx
cmpl $0x30800000, %r9d       # imm = 0x30800000
jb 0xc42b
shrl $0xc, %r9d
movzwl %r9w, %edx
movl %edx, (%rsi)
movl (%rcx), %ecx
movl $0xffff0000, %r9d       # imm = 0xFFFF0000
cmpl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
ja 0xc44f
cmpl $0x30800000, %ecx       # imm = 0x30800000
jb 0xc454
shll $0x4, %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
movl %ecx, %r9d
orl %r9d, %edx
movl %edx, (%rsi)
movl (%r8), %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
jae 0xc4a7
cmpl $0x30800000, %ecx       # imm = 0x30800000
jb 0xc4a6
shrl $0xc, %ecx
movzwl %cx, %ecx
orl %eax, %ecx
movl %ecx, 0x4(%rsi)
retq
movzbl 0x3(%rsi), %ecx
shll $0x18, %ecx
shrl $0x11, %r8d
shll $0x12, %eax
orl %r8d, %eax
shrl $0xb, %r9d
andl $0xfc0, %r9d            # imm = 0xFC0
shrl $0x5, %edx
andl $0x3f000, %edx          # imm = 0x3F000
andl $0x7c003f, %eax         # imm = 0x7C003F
orl %r9d, %eax
orl %edx, %eax
orl %ecx, %eax
movl %eax, (%rsi)
retq
orl $0xffff, %edi           # imm = 0xFFFF
movl %edi, 0x4(%rsi)
retq