// File: FreeSlave[P]vhlt/hlrad/compress.cpp
// Function: compress_compatability_test()
void compress_compatability_test ()
{
	unsigned char *v = (unsigned char *)malloc (16u);
	memset (v, 0, 16u);
	if (sizeof(char) !=1 || sizeof(unsigned int) != 4 || sizeof(float) != 4)
		fail ();
	*(float *)(v+1) = 0.123f;
	if (*(unsigned int *)v != 4226247936u || *(unsigned int *)(v+1) != 1039918957u)
		fail ();
	*(float *)(v+1) = -58;
	if (*(unsigned int *)v != 1744830464u || *(unsigned int *)(v+1) != 3261595648u)
		fail ();
	float f[5] = {0.123f, 1.f, 0.f, 0.123f, 0.f};
	memset (v, ~0, 16u);
	vector_compress (VECTOR24, v, &f[0], &f[1], &f[2]);
	float_compress (FLOAT16, v+6, &f[3]);
	float_compress (FLOAT16, v+4, &f[4]);
	if (((unsigned int *)v)[0] != 4286318595u || ((unsigned int *)v)[1] != 3753771008u)
		fail ();
	float_decompress (FLOAT16, v+6, &f[3]);
	float_decompress (FLOAT16, v+4, &f[4]);
	vector_decompress (VECTOR24, v, &f[0], &f[1], &f[2]);
	float ans[5] = {0.109375f,1.015625f,0.015625f,0.123001f,0.000000f};
	int i;
	for (i=0; i<5; ++i)
		if (f[i]-ans[i] > 0.00001f || f[i]-ans[i] < -0.00001f)
			fail ();
	free (v);
}

// Assembly:
subq $0x58, %rsp
movl $0x10, %edi
callq 0x4430
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x41b0
movq 0x50(%rsp), %rax
movss 0x5b95b(%rip), %xmm0    # 0x6d6ac
movss %xmm0, 0x1(%rax)
movq 0x50(%rsp), %rax
cmpl $0xfbe76d00, (%rax)     # imm = 0xFBE76D00
jne 0x11d71
movq 0x50(%rsp), %rax
cmpl $0x3dfbe76d, 0x1(%rax)  # imm = 0x3DFBE76D
je 0x11d76
callq 0x11d00
movq 0x50(%rsp), %rax
movss 0x5b92d(%rip), %xmm0    # 0x6d6b0
movss %xmm0, 0x1(%rax)
movq 0x50(%rsp), %rax
cmpl $0x68000000, (%rax)     # imm = 0x68000000
jne 0x11da3
movq 0x50(%rsp), %rax
cmpl $0xc2680000, 0x1(%rax)  # imm = 0xC2680000
je 0x11da8
callq 0x11d00
movq 0x5b961(%rip), %rax     # 0x6d710
movq %rax, 0x30(%rsp)
movq 0x5b95d(%rip), %rax     # 0x6d718
movq %rax, 0x38(%rsp)
movl 0x5b95a(%rip), %eax     # 0x6d720
movl %eax, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movl $0xff, %esi
movl $0x10, %edx
callq 0x41b0
movq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x30(%rsp), %rcx
addq $0x4, %rcx
leaq 0x30(%rsp), %r8
addq $0x8, %r8
movl $0x3, %edi
callq 0x11f60
movq 0x50(%rsp), %rsi
addq $0x6, %rsi
leaq 0x30(%rsp), %rdx
addq $0xc, %rdx
movl $0x1, %edi
callq 0x12710
movq 0x50(%rsp), %rsi
addq $0x4, %rsi
leaq 0x30(%rsp), %rdx
addq $0x10, %rdx
movl $0x1, %edi
callq 0x12710
movq 0x50(%rsp), %rax
cmpl $0xff7c0803, (%rax)     # imm = 0xFF7C0803
jne 0x11e57
movq 0x50(%rsp), %rax
cmpl $0xdfbe0000, 0x4(%rax)  # imm = 0xDFBE0000
je 0x11e5c
callq 0x11d00
movq 0x50(%rsp), %rsi
addq $0x6, %rsi
leaq 0x30(%rsp), %rdx
addq $0xc, %rdx
movl $0x1, %edi
callq 0x128b0
movq 0x50(%rsp), %rsi
addq $0x4, %rsi
leaq 0x30(%rsp), %rdx
addq $0x10, %rdx
movl $0x1, %edi
callq 0x128b0
movq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x30(%rsp), %rcx
addq $0x4, %rcx
leaq 0x30(%rsp), %r8
addq $0x8, %r8
movl $0x3, %edi
callq 0x12a40
movq 0x5b86f(%rip), %rax     # 0x6d730
movq %rax, 0x10(%rsp)
movq 0x5b86b(%rip), %rax     # 0x6d738
movq %rax, 0x18(%rsp)
movl 0x5b868(%rip), %eax     # 0x6d740
movl %eax, 0x20(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x5, 0xc(%rsp)
jge 0x11f45
movslq 0xc(%rsp), %rax
movss 0x30(%rsp,%rax,4), %xmm0
movslq 0xc(%rsp), %rax
subss 0x10(%rsp,%rax,4), %xmm0
movss 0x5b7ab(%rip), %xmm1    # 0x6d6b4
ucomiss %xmm1, %xmm0
ja 0x11f31
movslq 0xc(%rsp), %rax
movss 0x30(%rsp,%rax,4), %xmm1
movslq 0xc(%rsp), %rax
subss 0x10(%rsp,%rax,4), %xmm1
movss 0x5b78c(%rip), %xmm0    # 0x6d6b8
ucomiss %xmm1, %xmm0
jbe 0x11f36
callq 0x11d00
jmp 0x11f38
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x11ee4
movq 0x50(%rsp), %rdi
callq 0x43a0
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
nop