#!/usr/bin/env python
import struct
import sys

def main():
    if len(sys.argv) < 2:
        sys.exit("Usage: {} FILE".format(sys.argv[0]))

    filename = sys.argv[1]
    b = open(filename, 'rb').read()
    if len(b) % 4 != 0:
        sys.exit("length of {} is not a multiple of 4".format(filename))
    for i in range(0, len(b), 4):
        v, = struct.unpack('<I', b[i:i+4])
        v >>= 2
        print('@{:04x}:'.format(i))
        print('{:03x}'.format((v >> 0) & 0x1ff))
        print('{:03x}'.format((v >> 9) & 0x1ff))
        print('{:03x}'.format((v >> 18) & 0x1ff))
        print('{:03x}'.format((v >> 27) & 0x1ff))

if __name__ == '__main__':
    main()
