Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[=[
	Disconnects a connection, any `:Fire` calls from now on will not
	invoke this connection's handler.

	```lua
	local connection = ScriptSignal:Connect(function() end)

	connection.Connected -> true
	connection:Disconnect()
	connection.Connected -> false
	```

	@ignore
]=]


function ScriptConnection:Disconnect()
    if self.Connected ~= true then
        return
    end

    self.Connected = false

    local _node: ScriptConnectionNode = self._node
    local _prev = _node._prev
    local _next = _node._next

    if _next ~= nil then
        _next._prev = _prev
    end

    if _prev ~= nil then
        _prev._next = _next
    else
        -- _node == _signal._head

        _node._signal._head = _next
    end

    _node._connection = nil
    self._node = nil
end
ScriptConnection.Destroy = ScriptConnection.Disconnect

return ScriptSignal
--[[
	Updates spring.position, moving it closer to target, depending on deltaTime.
]]


function Spring:update(deltaTime)
	local differenceVector = self.position - self.target
	if self.zeta > 1 + EPSILON then
		-- Over damped
		local zetaA = -self.omega * self.zeta
		local zetaB = self.omega * (self.zeta * self.zeta - 1) ^ 0.5
		local zeta0, zeta1 = zetaA - zetaB, zetaA + zetaB
		local expt0, expt1 = math.exp(zeta0 * deltaTime), math.exp(zeta1 * deltaTime)
		local c1 = (self.velocity - differenceVector * zeta1) / (-2 * zetaB)
		local c2 = differenceVector - c1
		self.position = self.target + c1 * expt0 + c2 * expt1
		self.velocity = c1 * zeta1 * expt0 + c2 * zeta1 * expt1
	elseif self.zeta > 1 - EPSILON then
		-- Critically damped
		local expt = math.exp(-self.omega * deltaTime)
		local c1 = self.velocity + self.omega * differenceVector
		local c2 = (c1 * deltaTime + differenceVector) * expt
		self.position = self.target + c2
		self.velocity = (c1 * expt) - (c2 * self.omega)
	else
		-- Under damped
		local omegaZeta = self.omega * self.zeta
		local alpha = self.omega * (1 - self.zeta * self.zeta) ^ 0.5
		local exp = math.exp(-deltaTime * omegaZeta)
		local cos = math.cos(deltaTime * alpha)
		local sin = math.sin(deltaTime * alpha)
		local c2 = (self.velocity + differenceVector * omegaZeta) / alpha

		self.position = self.target + exp * (differenceVector * cos + c2 * sin)
		self.velocity =
			-exp * ((differenceVector * omegaZeta - c2 * alpha) * cos + (differenceVector * alpha + c2 * omegaZeta) * sin)
	end
end

return Spring
--		runAnimTrack:AdjustSpeed(runSpeed)


		currentAnimTrack:AdjustSpeed(runSpeed)
	end	
end

function setAnimationSpeed(speed)
	if currentAnim == "walk" then
			setRunSpeed(speed)
	else
		if speed ~= currentAnimSpeed then
			currentAnimSpeed = speed
			currentAnimTrack:AdjustSpeed(currentAnimSpeed)
		end
	end
end

function keyFrameReachedFunc(frameName)
	if (frameName == "End") then
		if currentAnim == "walk" then
			if userNoUpdateOnLoop == true then
--[=[
	Use to test that the given GuiObject or Rect is below the other GuiObject or Rect.

	The last argument is optional. If nil, the matcher will pass only if the difference **top** edge of the given GuiObject or Rect and the **bottom** edge of the other GuiObject or Rect is zero or positive.


	```lua
	expect(a).toBeBelow(b) -- Jest
	expect(a).to.be.below(b) -- TestEZ
	```

	![Example of below(a, b)](/below(a,%20b).png)

	```lua
	expect(a).toBeBelow(b, 5) -- Jest
	expect(a).to.be.below(b, 5) -- TestEZ
	```

	![Example of below(a, b, 5)](/below(a,%20b,%205).png)

	```lua
	expect(a).toBeBelow(b, NumberRange.new(0, 5)) -- Jest
	expect(a).to.be.below(b, NumberRange.new(0, 5)) -- TestEZ
	```

	![Example of below(a, b, NumberRange.new(0, 5))](/below(a,%20b,%20NumberRange.new(0,%205)).png)
	@tag outside
	@within CollisionMatchers2D
]=]


local function below(a: GuiObject | Rect, b: GuiObject | Rect, distance: number | NumberRange)
	local aRect = toRect(a)
	local bRect = toRect(b)

	local distanceFromSide = aRect.Min - bRect.Max
	if distance then
		if typeof(distance) == "number" then
			distance = NumberRange.new(distance)
		end

		return returnValue(
			distance.Min <= distanceFromSide.Y and distance.Max >= distanceFromSide.Y,
			"Was within range",
			"Was not within range ( " .. tostring(distance) .. ")"
		)
	else
		return returnValue(distanceFromSide.Y >= 0, "Was below the element", "Was above the element")
	end
end

return below
--// Event Connections


placeEvent.OnServerEvent:connect(function(plr,newPos,what)

 local char =	plr.Character

	if ACS_Storage.Server:FindFirstChild(plr.Name.."_Rappel") == nil then
			local new = Instance.new('Part')
			new.Parent = workspace
			new.Anchored = true
			new.CanCollide = false
			new.Size = Vector3.new(0.2,0.2,0.2)
			new.BrickColor = BrickColor.new('Black')
			new.Material = Enum.Material.Metal
			new.Position = newPos + Vector3.new(0,new.Size.Y/2,0)
			new.Name = plr.Name.."_Rappel"
			
			local newW = Instance.new('WeldConstraint')
			newW.Parent = new
			newW.Part0 = new
			newW.Part1 = what
			new.Anchored = false
			
			local newAtt0 = Instance.new('Attachment')
			newAtt0.Parent = char.Torso
			newAtt0.Position = Vector3.new(0,-.75,0)

			local newAtt1 = Instance.new('Attachment')
			newAtt1.Parent = new
			
			local newRope = Instance.new('RopeConstraint')
			newRope.Attachment0 = newAtt0
			newRope.Attachment1 = newAtt1
			newRope.Parent = char.Torso
			newRope.Length = 20
			newRope.Restitution = 0.3
			newRope.Visible = true
			newRope.Thickness = 0.1
			newRope.Color = BrickColor.new("Black")

		placeEvent:FireClient(plr,new)
	end
end)

ropeEvent.OnServerEvent:connect(function(plr,dir)
	if workspace:FindFirstChild(plr.Name.."_Rappel") ~= nil then
		if dir == 'Up' then
			plr.Character.Torso.RopeConstraint.Length = plr.Character.Torso.RopeConstraint.Length + 0.2
		elseif dir == 'Down' then
			plr.Character.Torso.RopeConstraint.Length = plr.Character.Torso.RopeConstraint.Length - 0.2
		end	
	end
end)

cutEvent.OnServerEvent:connect(function(plr)
	if workspace:FindFirstChild(plr.Name.."_Rappel") ~= nil then
		workspace:FindFirstChild(plr.Name.."_Rappel"):Destroy()

		plr.Character.Torso.Attachment:Destroy()
		plr.Character.Torso.RopeConstraint:Destroy()
	end
end)
--Weld stuff here




car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)

MakeWeld(misc.Hood.Hinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Hood.Parts,misc.Hood.Hinge)


car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
	end
end)

MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(misc.Wheel.Parts,misc.Wheel.W)

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)
-- Dependencies


local ShrinkingBarrier = require(ServerScriptService.Core.ShrinkingBarrier)
local DeliveryVehicle = require(ServerStorage.Libraries.DeliveryVehicle)
local Conf = require(ReplicatedFirst.Configurations.MainConfiguration)
local ServerTime = require(ServerStorage.Libraries.ServerTime)
local PlayerMatchInfo = require(ReplicatedStorage.Libraries.PlayerMatchInfo)
--[[ Use the following script to program your on/off switch to do stuff. This can mean opening and closing a door, turning on and off lights, anything!
Just put what you want the button to do while on/off below.]]



Room = script.Parent

function on() --Type below what you want the button to do while it is on.
Room.L1.SpotLight.Enabled = true
Room.L2.SpotLight.Enabled = true
Room.L3.SpotLight.Enabled = true
Room.L4.SpotLight.Enabled = true
end

function off() --Type below what you want the button to do while it is off.
Room.L1.SpotLight.Enabled = false
Room.L2.SpotLight.Enabled = false
Room.L3.SpotLight.Enabled = false
Room.L4.SpotLight.Enabled = false
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 150		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 100		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--					end


				end
				local distanceFactor = distance / explosion.BlastRadius -- get the distance as a value between 0 and 1
				distanceFactor = math.abs( 1 - distanceFactor )-- flip the amount, so that lower == closer == more damage
				-- humanoid:TakeDamage(maxDamage * distanceFactor) -- TakeDamage to respect ForceFields
				--print(maxDamage,distanceFactor)
				--print("<", ownerMe, "> AOE Damage = ", maxDamage * distanceFactor," to <",humanoid.Parent.Name,">")
				Damage:Take(human, humanoid, maxDamage * distanceFactor) -- from, to, damage
			end
		end
	end)
 
	explosion.Parent = game.Workspace
end


function blow(hit)
	--!!!!!! проверяем на то, что не повреждается
	-- if string.lower(hit.Name)=="cannon" or string.lower(hit.Name)=="sphera" then return end
--[=[
	@function Emphasise
	@within ColourUtils

	:::tip

	Emphasise is also available under the `Emphasize` alias.

	:::

	@param colour Color3 -- The colour to emphasise.
	@param coefficient number -- The amount to emphasise by [0-1].
	@param threshold? number -- The threshold for light/dark [0-1] (defaults to 0.5).
	@return Color3 -- The emphasised colour.
]=]


return function(colour: Color3, coefficient: number, threshold: number?): Color3
	threshold = type(threshold) == "number" and threshold or 0.5
	return GetLuminance(colour) > threshold and Darken(colour, coefficient) or Lighten(colour, coefficient)
end
--This script handles the expanding and retracting of the piston, the
--arm, sounds, and stuck bricks. The piston head uses a BodyPosition
--and a BodyGyro to orient itself. The piston arm is an anchored brick
--inside the body of the piston which has a CylinderMesh in it, whose
--Scale/Offset properties change based on how far the head is away from
--the piston.
--===============--
--// Techyfied \\--
-- This script was automatically created by Bubble Chat Customizer Plugin --
-- This script customized bubble chat depending on the settings you have created on the plugin --
--===============--




local settings = {
	BubbleDuration = script.Info.BubbleDuration.Value,
	MaxBubbles = script.Info.MaxBubbles.Value,
	BackgroundColor3 = script.Info.BackgroundColor3.Value,
	TextColor3 = script.Info.TextColor3.Value,
	TextSize = script.Info.TextSize.Value,
	Font = Enum.Font[script.Info.Font.Value],
	Transparency = script.Info.Transparency.Value,
	CornerRadius = UDim.new(0, script.Info.CornerRadius.Value),
	TailVisible = script.Info.TailVisible.Value,
	Padding = script.Info.Padding.Value,
	MaxWidth = script.Info.MaxWidth.Value,
	VerticalStudsOffset = script.Info.VerticalStudsOffset.Value,
	BubblesSpacing = script.Info.BubblesSpacing.Value,
	MinimizeDistance = script.Info.MinimizeDistance.Value,
	MaxDistance = script.Info.MaxDistance.Value,
}

pcall(function()
	game:GetService("Chat"):SetBubbleChatSettings(settings)
end)
-- Dependencies


local Util = require(ReplicatedStorage.Libraries.Util)

local localPlayer = Players.LocalPlayer
local playerGui = localPlayer.PlayerGui
local _playerIsBot = Util.isPlayerBot(localPlayer)
local Roact = require(ReplicatedStorage.Packages.Roact)

local RECS = require(ReplicatedStorage.Libraries.RECS)
local Steppers = require(ReplicatedStorage.Steppers)
local App = require(ReplicatedStorage.RoactComponents.App)
--[ Events ]--


Detector.MouseEnter:Connect(function()
	N:TweenPosition(UDim2.new(-0.775, 0, 0, 0), "Out", "Quad", .25)
end)
Detector.MouseLeave:Connect(function()
	N:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", .25)
end)
Detector.MouseMoved:Connect(function()
	if N.Position == UDim2.new(0,0,0,0) then
		N:TweenPosition(UDim2.new(-0.775, 0, 0, 0), "Out", "Quad", .25)
	else
		N:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", .25)
	end
end)
while true do
	spawn(UpdateHealth)
	wait()
end
--				{ id = "slash.xml", weight = 10 } 


			},
	toollunge = {
				{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 } 
			},
}

math.randomseed(tick())

function configureAnimationSet(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	-- check for config values
	local config = script:FindFirstChild(name)
	if (config ~= nil) then
-- called to check for dead connections and run their cleanup tasks


local function runCleanupTasks()
	if numTasks == 0 then
		return
	end

	-- we want to clean as much stuff up as possible, but we don't want to hang
	-- the client, so we forcibly terminate after a short while
	local startTime = os.clock()
	local endTime = startTime + 1/1000

	-- run at most `numTask` times
	for _=1, numTasks do
		local taskData = tasks[currentIndex]

		if taskData.connection.Connected then
			-- instance is still alive, so move on to the next task
			currentIndex += 1
		else
			-- instance destroyed, so run cleanup and remove the task
			taskData.cleaned = true
			-- print("cleaning up", taskData.debugName)
			cleanup(taskData.task)

			table.remove(tasks, currentIndex)
			numTasks -= 1
		end

		-- wrap around if we passed the end of the task list
		if currentIndex > numTasks then
			currentIndex = 1
		end

		-- if this took too long, exit early to avoid hanging
		if os.clock() > endTime then
			break
		end
	end
end

RunService.Heartbeat:Connect(runCleanupTasks)

local function cleanupOnDestroy(instance: Instance, task: cleanup.Task): (() -> ())
	-- set up connection so we can check if the instance is alive
	-- we don't care about the event we're connecting to, just that we can see
	-- when it's disconnected by the garbage collector
	local connection = instance:GetPropertyChangedSignal("ClassName"):Connect(noOp)

	-- store data about the task for later
	local taskData = {
		debugName = instance.Name,
		connection = connection,
		task = task,
		cleaned = false
	}

	-- remove instance reference so we don't accidentally inhibit gc
	instance = nil

	-- add task to list
	numTasks += 1
	tasks[numTasks] = taskData

	-- return disconnect function to stop listening for destroy
	return function()
		if taskData.cleaned then
			return
		end

		taskData.cleaned = true
		connection:Disconnect()

		local index = table.find(tasks, taskData)
		if index ~= nil then
			table.remove(tasks, index)
			numTasks -= 1
		end
	end
end

return cleanupOnDestroy
--	print(animName .. " " .. idx .. " [" .. origRoll .. "]")


	
	local anim = animTable[animName][idx].anim

	-- switch animation		
	if (anim ~= currentAnimInstance) then
		
		if (currentAnimTrack ~= nil) then
			currentAnimTrack:Stop(transitionTime)
			currentAnimTrack:Destroy()
		end

		currentAnimSpeed = 1.0
	
		-- load it to the humanoid; get AnimationTrack
		currentAnimTrack = humanoid:LoadAnimation(anim)
		 
		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName
		currentAnimInstance = anim

		-- set up keyframe name triggers
		if (currentAnimKeyframeHandler ~= nil) then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:Connect(keyFrameReachedFunc)
		
	end

end
-- When the weapon is deactivated


function weaponTemplate:OnDeactivate()
	
end

function weaponTemplate:OnStartFiring()
	if not self.spoolTimer:IsRunning() and not self.isFiring and self.isClient then
		self.isFiring = true
	end
	
	if not self.spoolTimer:IsRunning() and not self.isFiring and not self.isClient then
		
		self.gun.Barrel.Begin.TimePosition = 0
		self.gun.Barrel.Begin:Play()
		
		spawn(function() 
			for i = 1, 20 do
				self.gun.Barrel.HingeConstraint.AngularVelocity = i
				wait(0.043)
			end
		end)
			
		self.spoolTimer:Start()
	end
end

function weaponTemplate:OnStopFiring()
	
	-- Is Client
	if self.spoolTimer:IsRunning() and self.isFiring and self.isClient then
		self.isFiring = false
	end
	
	-- Is Server
	if self.spoolTimer:IsRunning() and self.isFiring and not self.isClient then
		self.gun.Barrel.End.TimePosition = 0
		self.gun.Barrel.End:Play()
		
		self.gun.Barrel.HingeConstraint.AngularVelocity = 0
		

		self.spoolTimer:Stop()
		self.rewardTimer:Stop()
		self.isFiring = false
		self.gun.Barrel.Loop:Stop()
		
		
		for i = 20, 0, -1 do
			self.gun.Barrel.HingeConstraint.AngularVelocity = i
			wait(0.043)
		end
	end
end

function weaponTemplate:OnFire()
	if self.isFiring then
		
		-- Is Client
		if self.isClient and self.gun.Barrel.Loop.IsPlaying then
			local newProjectile = self.projectileModel:Clone()
			local randomPoint = weaponTemplate.getUnitSpherePoint()
			local newBullet = bullet.new(newProjectile, self.ownerPlayer, 50, self.gun.firePart.Position, self.gun.firePart.CFrame.LookVector + randomPoint * self.coneSpread, 500, "Physics", false)
			newBullet.Name = newProjectile.Name
			replicateProjectile_Re:FireServer(newBullet)
		end
		
		-- Is Server
		if not self.gun.Barrel.Loop.IsPlaying and not self.isClient then
			self.gun.Barrel.Loop:Play()
			self.gun.Barrel.HingeConstraint.AngularVelocity = 50
			
		elseif not self.isClient then
			-- Ensure they don't run multiple timers
			if not self.rewardTimer:IsRunning() and self.rewardTimer.runningTicks == 0 then
				self.rewardTimer:Start()
			end
		end
	end
end
--[[
game:service("RunService").RenderStepped:connect(function()
	midcf = CFrame.new() 
	if down == true then	
		aim = Tool.Aim.Value 
	lv = (Tool.Handle.CFrame * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))).lookVector 
	lookat = mouser.Hit.p
	start = Tool.Handle.Position + Vector3.new(0,0.2,0) 
	p1.CFrame = CFrame.new(start + lv, lookat) 
	midcf = p1.CFrame
	p1.CFrame = midcf * CFrame.Angles(math.rad(aim),math.rad(0),math.rad(0))
	p2.CFrame = midcf * CFrame.Angles(math.rad(0),math.rad(aim),math.rad(0))
	p3.CFrame = midcf * CFrame.Angles(math.rad(0),math.rad(-aim),math.rad(0))
	p4.CFrame = midcf * CFrame.Angles(math.rad(-aim),math.rad(0),math.rad(0))
	end
end)]]




Tool.Equipped:connect(onEquippedLocal)
---- Public Functions
-- Set


function StringLabel:SetText(text)
	waitForUpdate(self)
	
	self._textLabel.Text = text
end

function StringLabel:SetSize(size)
	waitForUpdate(self)
	
	self._textLabel.Size = size
end

function StringLabel:SetPosition(position)
	waitForUpdate(self)
	
	self._textLabel.Position = position
end

function StringLabel:SetFont(font)
	waitForUpdate(self)
	
	for _, label in pairs(self._characterLabels) do
		label.Font = font
	end
end

function StringLabel:SetTextColor(color)
	waitForUpdate(self)
	
	for _, label in pairs(self._characterLabels) do
		label.TextColor3 = color
	end
end

function StringLabel:SetTextTransparency(transparency)
	waitForUpdate(self)
	
	for _, label in pairs(self._characterLabels) do
		label.TextTransparency = transparency
	end
end

function StringLabel:SetRotation(rotation)
	waitForUpdate(self)
	
	for _, label in pairs(self._characterLabels) do
		label.Rotation = rotation
	end
end

function StringLabel:SetCharacterFont(index, font)
	waitForUpdate(self)
	
	local label = self._characterLabels[index]
	if label then
		label.Font = font
	end
end

function StringLabel:SetCharacterTextColor(index, color)
	waitForUpdate(self)
	
	local label = self._characterLabels[index]
	if label then
		label.TextColor3 = color
	end
end

function StringLabel:SetCharacterTextTransparency(index, transparency)
	waitForUpdate(self)
	
	local label = self._characterLabels[index]
	if label then
		label.TextTransparency = transparency
	end
end

function StringLabel:SetCharacterRotation(index, rotation)
	waitForUpdate(self)
	
	local label = self._characterLabels[index]
	if label then
		label.Rotation = rotation
	end
end
-- Compare items in two sequences to find a longest common subsequence.
-- Given lengths of sequences and input function to compare items at indexes,
-- return by output function the number of adjacent items and starting indexes
-- of each common subsequence.


return function(aLength: number, bLength: number, isCommon: IsCommon, foundSubsequence: FoundSubsequence): ()
	validateLength("aLength", aLength)
	validateLength("bLength", bLength)
	validateCallback("isCommon", isCommon)
	validateCallback("foundSubsequence", foundSubsequence)

	-- Count common items from the start in the forward direction.
	local nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon)

	if nCommonF ~= 0 then
		foundSubsequence(nCommonF, 0, 0)
	end

	-- Unless both sequences consist of common items only,
	-- find common items in the half-trimmed index intervals.
	if aLength ~= nCommonF or bLength ~= nCommonF then
		-- Invariant: intervals do not have common items at the start.
		-- The start of an index interval is closed like array slice method.
		local aStart = nCommonF
		local bStart = nCommonF

		-- Count common items from the end in the reverse direction.
		local nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon)

		-- Invariant: intervals do not have common items at the end.
		-- The end of an index interval is open like array slice method.
		local aEnd = aLength - nCommonR
		local bEnd = bLength - nCommonR

		-- Unless one sequence consists of common items only,
		-- therefore the other trimmed index interval consists of changes only,
		-- find common items in the trimmed index intervals.
		local nCommonFR = nCommonF + nCommonR
		if aLength ~= nCommonFR and bLength ~= nCommonFR then
			local nChange = 0 -- number of change items is not yet known
			local transposed = false -- call the original unwrapped functions
			local callbacks = { { foundSubsequence, isCommon } }

			-- Indexes in sequence a of last points in furthest reaching paths
			-- from outside the start at top left in the forward direction:
			local aIndexesF = { NOT_YET_SET }
			-- from the end at bottom right in the reverse direction:
			local aIndexesR = { NOT_YET_SET }

			-- Initialize one object as output of all calls to divide function.
			local division = {
				aCommonFollowing = NOT_YET_SET,
				aCommonPreceding = NOT_YET_SET,
				aEndPreceding = NOT_YET_SET,
				aStartFollowing = NOT_YET_SET,
				bCommonFollowing = NOT_YET_SET,
				bCommonPreceding = NOT_YET_SET,
				bEndPreceding = NOT_YET_SET,
				bStartFollowing = NOT_YET_SET,
				nChangeFollowing = NOT_YET_SET,
				nChangePreceding = NOT_YET_SET,
				nCommonFollowing = NOT_YET_SET,
				nCommonPreceding = NOT_YET_SET,
			}

			-- Find and return common subsequences in the trimmed index intervals.
			findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division)
		end

		if nCommonR ~= 0 then
			foundSubsequence(nCommonR, aEnd, bEnd)
		end
	end
end