protected function reuseTempVariable($type, $location, CompilationContext $compilationContext = null)
    {
        $compilationContext = $compilationContext ?: $this->compilationContext;
        $branchId = $compilationContext->branchManager->getCurrentBranchId();

        if (isset($this->branchTempVariables[$branchId][$location][$type])) {
            foreach ($this->branchTempVariables[$branchId][$location][$type] as $variable) {
                if (!$variable->isDoublePointer()) {
                    if ($variable->isIdle()) {
                        $variable->setIdle(false);

                        return $variable;
                    }
                }
            }
        }

        return null;
    }