// File: 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:
subq $0xc8, %rsp
movl %edi, 0xc4(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movq %r8, 0xa0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x80(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, 0x6c(%rsp)
testl %eax, %eax
je 0x11fff
jmp 0x11fdf
movl 0x6c(%rsp), %eax
subl $0x1, %eax
je 0x12042
jmp 0x11fea
movl 0x6c(%rsp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x1223c
jmp 0x126f9
movq 0x90(%rsp), %rax
movl (%rax), %ecx
movq 0x98(%rsp), %rax
movl %ecx, (%rax)
movq 0x88(%rsp), %rax
movl (%rax), %ecx
movq 0x98(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x80(%rsp), %rax
movl (%rax), %ecx
movq 0x98(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0x126fb
movq 0x90(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
jne 0x1207e
movq 0x88(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
jne 0x1207e
movq 0x80(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
je 0x12083
jmp 0x126fb
movq 0x98(%rsp), %rax
movl $0x0, (%rax)
movq 0x98(%rsp), %rax
movl 0x4(%rax), %edi
xorl %esi, %esi
movl $0x10, %edx
callq 0x13220
movl %eax, %ecx
movq 0x98(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x90(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x120ea
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x10, %edx
callq 0x13280
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x12129
movq 0x90(%rsp), %rax
movl (%rax), %edi
callq 0x132b0
cmpl $0x0, %eax
je 0x12100
jmp 0x12127
movq 0x90(%rsp), %rax
movl (%rax), %edi
movl $0xc, %esi
movl $0x1c, %edx
callq 0x13280
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x12129
movq 0x88(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x1216f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x10, %edx
callq 0x13280
movl %eax, %edi
movl $0x10, %esi
movl $0x20, %edx
callq 0x132d0
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x121bf
movq 0x88(%rsp), %rax
movl (%rax), %edi
callq 0x132b0
cmpl $0x0, %eax
je 0x12185
jmp 0x121bd
movq 0x88(%rsp), %rax
movl (%rax), %edi
movl $0xc, %esi
movl $0x1c, %edx
callq 0x13280
movl %eax, %edi
movl $0x10, %esi
movl $0x20, %edx
callq 0x132d0
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x121bf
movq 0x80(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x121f6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x10, %edx
callq 0x13280
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
jmp 0x12237
movq 0x80(%rsp), %rax
movl (%rax), %edi
callq 0x132b0
cmpl $0x0, %eax
je 0x1220c
jmp 0x12235
movq 0x80(%rsp), %rax
movl (%rax), %edi
movl $0xc, %esi
movl $0x1c, %edx
callq 0x13280
movl %eax, %ecx
movq 0x98(%rsp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
jmp 0x12237
jmp 0x126fb
movq 0x90(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
jne 0x12278
movq 0x88(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
jne 0x12278
movq 0x80(%rsp), %rax
movl (%rax), %edi
callq 0x13200
cmpl $0x0, %eax
je 0x1229d
movl $0x0, 0x70(%rsp)
movl $0x0, 0x74(%rsp)
movl $0x0, 0x78(%rsp)
movl $0x0, 0x7c(%rsp)
jmp 0x12553
movq 0x90(%rsp), %rax
movl (%rax), %eax
movq 0x88(%rsp), %rcx
cmpl (%rcx), %eax
jbe 0x122f1
movq 0x90(%rsp), %rax
movl (%rax), %eax
movq 0x80(%rsp), %rcx
cmpl (%rcx), %eax
jbe 0x122d9
movq 0x90(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x68(%rsp)
jmp 0x122e7
movq 0x80(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x68(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x1232d
movq 0x88(%rsp), %rax
movl (%rax), %eax
movq 0x80(%rsp), %rcx
cmpl (%rcx), %eax
jbe 0x12317
movq 0x88(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x60(%rsp)
jmp 0x12325
movq 0x80(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x60(%rsp)
movl 0x60(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl 0x7c(%rsp), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x1234e
movl $0x7f, %eax
movl %eax, 0x5c(%rsp)
jmp 0x12386
movl 0x7c(%rsp), %edi
callq 0x132b0
cmpl $0x0, %eax
je 0x12367
movl $0x60, %eax
movl %eax, 0x58(%rsp)
jmp 0x1237e
movl 0x7c(%rsp), %edi
movl $0x17, %esi
movl $0x1f, %edx
callq 0x13280
movl %eax, 0x58(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0x7c(%rsp)
movq 0x90(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x123ad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x54(%rsp)
jmp 0x1241d
movq 0x90(%rsp), %rax
movl (%rax), %edi
xorl %esi, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, 0x48(%rsp)
movl $0x1, %edi
movl $0x17, %esi
movl $0x18, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x48(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x50(%rsp)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
movq 0x90(%rsp), %rax
movl (%rax), %edi
movl $0x17, %esi
movl $0x1f, %edx
callq 0x13280
movl 0x4c(%rsp), %ecx
movl %eax, %edx
movl 0x50(%rsp), %eax
subl %edx, %ecx
shrl %cl, %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x78(%rsp)
movq 0x88(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x12444
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x44(%rsp)
jmp 0x124b4
movq 0x88(%rsp), %rax
movl (%rax), %edi
xorl %esi, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, 0x38(%rsp)
movl $0x1, %edi
movl $0x17, %esi
movl $0x18, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x38(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x40(%rsp)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq 0x88(%rsp), %rax
movl (%rax), %edi
movl $0x17, %esi
movl $0x1f, %edx
callq 0x13280
movl 0x3c(%rsp), %ecx
movl %eax, %edx
movl 0x40(%rsp), %eax
subl %edx, %ecx
shrl %cl, %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0x80(%rsp), %rax
movl (%rax), %edi
callq 0x13260
cmpl $0x0, %eax
je 0x124db
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x34(%rsp)
jmp 0x1254b
movq 0x80(%rsp), %rax
movl (%rax), %edi
xorl %esi, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, 0x28(%rsp)
movl $0x1, %edi
movl $0x17, %esi
movl $0x18, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x28(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x30(%rsp)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x80(%rsp), %rax
movl (%rax), %edi
movl $0x17, %esi
movl $0x1f, %edx
callq 0x13280
movl 0x2c(%rsp), %ecx
movl %eax, %edx
movl 0x30(%rsp), %eax
subl %edx, %ecx
shrl %cl, %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x70(%rsp)
cmpl $0x2, 0xc4(%rsp)
jne 0x1261f
movl 0x78(%rsp), %edi
movl $0xe, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
xorl %esi, %esi
movl $0x9, %edx
callq 0x132d0
orl $0x0, %eax
movl %eax, 0x1c(%rsp)
movl 0x74(%rsp), %edi
movl $0xe, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
movl $0x9, %esi
movl $0x12, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x1c(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x20(%rsp)
movl 0x70(%rsp), %edi
movl $0xe, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
movl $0x12, %esi
movl $0x1b, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x20(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x24(%rsp)
movl 0x7c(%rsp), %edi
xorl %esi, %esi
movl $0x5, %edx
callq 0x13280
movl %eax, %edi
movl $0x1b, %esi
movl $0x20, %edx
callq 0x132d0
movl 0x24(%rsp), %ecx
orl %eax, %ecx
movq 0x98(%rsp), %rax
movl %ecx, (%rax)
jmp 0x126f7
movq 0x98(%rsp), %rax
movl (%rax), %edi
xorl %esi, %esi
movl $0x18, %edx
callq 0x13220
movl %eax, 0xc(%rsp)
movl 0x78(%rsp), %edi
movl $0x11, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
xorl %esi, %esi
movl $0x6, %edx
callq 0x132d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x74(%rsp), %edi
movl $0x11, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
movl $0x6, %esi
movl $0xc, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x10(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x70(%rsp), %edi
movl $0x11, %esi
movl $0x17, %edx
callq 0x13280
movl %eax, %edi
movl $0xc, %esi
movl $0x12, %edx
callq 0x132d0
movl %eax, %ecx
movl 0x14(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x18(%rsp)
movl 0x7c(%rsp), %edi
xorl %esi, %esi
movl $0x5, %edx
callq 0x13280
movl %eax, %edi
movl $0x12, %esi
movl $0x17, %edx
callq 0x132d0
movl 0x18(%rsp), %ecx
orl %eax, %ecx
movq 0x98(%rsp), %rax
movl %ecx, (%rax)
jmp 0x126fb
jmp 0x126fb
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)