function KeenFIN
{
	read unsigned32 max-count	

	buffer: []
	running-total: 0

	loop while (file.remaining-bytes > 0)
	{
		buffer-pos: 0

		read unsigned8 b	

		if ((b & 0x80) != 0)
		{
			byte-count: (b & 0x7F) + 1

			loop (byte-count)
			{
				read unsigned8 c				
				buffer[buffer-pos] = c
				buffer-pos = buffer-pos + 1
			}
		}
		else
		{
			byte-count: b + 3
			read unsigned8 c
			
			loop (byte-count)
			{
				buffer[buffer-pos] = c
				buffer-pos = buffer-pos + 1
			}
		}

		i: 0
		loop (buffer-pos)
		{
			if ((running-total % 8192) < 8000)
			{
				write unsigned8 buffer[i]
			}

			running-total = running-total + 1
			i = i + 1
		}		
	}
	
}