;; this version "smartly" jumps through the file based on the chunk sizes
(bind-func iffchunk_find_smart
  (lambda (fileptr:i8* id le:i1)
    (while (not (iffchunk_check_ID (cast fileptr IffChunkHeader*) id))
      (set! fileptr
            (pref-ptr fileptr
                      (+ IFF_CHUNK_HEADER_SIZE
                         (convert
                          (iffchunk_size (cast fileptr IffChunkHeader*) le)
                          i64)))))
    fileptr))