static int BinarySearch(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                Spine.Animation arg0 = (Spine.Animation)ToLua.CheckObject <Spine.Animation>(L, 2);
                int             o    = obj.BinarySearch(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                Spine.Animation arg0 = (Spine.Animation)ToLua.CheckObject <Spine.Animation>(L, 2);
                System.Collections.Generic.IComparer <Spine.Animation> arg1 = (System.Collections.Generic.IComparer <Spine.Animation>)ToLua.CheckObject <System.Collections.Generic.IComparer <Spine.Animation> >(L, 3);
                int o = obj.BinarySearch(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 5)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                int             arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                int             arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                Spine.Animation arg2 = (Spine.Animation)ToLua.CheckObject <Spine.Animation>(L, 4);
                System.Collections.Generic.IComparer <Spine.Animation> arg3 = (System.Collections.Generic.IComparer <Spine.Animation>)ToLua.CheckObject <System.Collections.Generic.IComparer <Spine.Animation> >(L, 5);
                int o = obj.BinarySearch(arg0, arg1, arg2, arg3);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Spine.ExposedList<Spine.Animation>.BinarySearch"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }