%#codegen
%#internal
function idx = findFirstFiIdx(T, varargin)
    coder.inline('always');
    eml_prefer_const(T);
    eml_prefer_const(varargin);
    
    for ii=coder.unroll(1:numel(varargin))
        val = varargin{ii};
        if isfi(val)
            idx = ii;
            return;
        end
    end
    idx = -1;
end
