text:
// ReSharper disable InvalidXmlDocComment
// ReSharper disable InconsistentNaming
// ReSharper disable CheckNamespace
// ReSharper disable MemberCanBePrivate.Global

using System;
using System.Runtime.InteropServices;

// Source file C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Engine\Classes\GameFramework\GameModeBase.h:46

namespace UnrealEngine
{
	[ManageType("ManageGameModeBase")]
	public partial class ManageGameModeBase : AGameModeBase, IManageWrapper
	{
		public ManageGameModeBase(IntPtr adress)
			: base(adress)
		{
		}

		#region DLLInmport
		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_InitGameState(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostSeamlessTravel(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ResetLevel(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ReturnToMainMenuHost(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_StartPlay(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_StartToLeaveMap(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_BeginPlay(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ClearCrossLevelReferences(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_Destroyed(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ForceNetRelevant(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ForceNetUpdate(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_GatherCurrentMovement(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_InvalidateLightingCacheDetailed(IntPtr self, bool bTranslationOnly);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_K2_DestroyActor(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_LifeSpanExpired(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_MarkComponentsAsPendingKill(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_NotifyActorBeginCursorOver(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_NotifyActorEndCursorOver(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnRep_AttachmentReplication(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnRep_Instigator(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnRep_Owner(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnRep_ReplicatedMovement(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnRep_ReplicateMovement(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnReplicationPausedChanged(IntPtr self, bool bIsReplicationPaused);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OutsideWorldBounds(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostActorCreated(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostInitializeComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostNetInit(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostNetReceiveLocationAndRotation(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostNetReceivePhysicState(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostNetReceiveRole(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostRegisterAllComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostUnregisterAllComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PreInitializeComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PreRegisterAllComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PrestreamTextures(IntPtr self, float seconds, bool bEnableStreaming, int cinematicTextureGroups);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_RegisterActorTickFunctions(IntPtr self, bool bRegister);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_RegisterAllComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ReregisterAllComponents(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_RerunConstructionScripts(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_Reset(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_RewindForReplay(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_SetActorHiddenInGame(IntPtr self, bool bNewHidden);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_SetLifeSpan(IntPtr self, float inLifespan);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_SetReplicateMovement(IntPtr self, bool bInReplicateMovement);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_TearOff(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_TeleportSucceeded(IntPtr self, bool bIsATest);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_Tick(IntPtr self, float deltaSeconds);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_TornOff(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_UnregisterAllComponents(IntPtr self, bool bForReregister);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_BeginDestroy(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_FinishDestroy(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_MarkAsEditorOnlySubobject(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostCDOContruct(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostEditImport(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostInitProperties(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostLoad(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostNetReceive(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostRepNotifies(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PostSaveRoot(IntPtr self, bool bCleanupIsRequired);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PreDestroyFromReplication(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_PreNetReceive(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_ShutdownAfterError(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_CreateCluster(IntPtr self);

		[DllImport(NativeManager.UnrealDotNetDll, CallingConvention = CallingConvention.Cdecl)]
		private static extern void E__Supper__AGameModeBase_OnClusterMarkedAsPendingKill(IntPtr self);

		#endregion

		#region Methods

		/// <summary>
		/// Initialize the GameState actor with default settings
		/// <para>called during PreInitializeComponents() of the GameMode after a GameState has been spawned </para>
		/// as well as during Reset()
		/// </summary>
		public override void InitGameState()
			=> E__Supper__AGameModeBase_InitGameState(this);

		/// <summary>
		/// Called after a seamless level transition has been completed on the *new* GameMode.
		/// <para>Used to reinitialize players already in the game as they won't have *Login() called on them </para>
		/// </summary>
		public override void PostSeamlessTravel()
			=> E__Supper__AGameModeBase_PostSeamlessTravel(this);

		/// <summary>
		/// Overridable function called when resetting level. This is used to reset the game state while staying in the same map
		/// <para>Default implementation calls Reset() on all actors except GameMode and Controllers </para>
		/// </summary>
		public override void ResetLevel()
			=> E__Supper__AGameModeBase_ResetLevel(this);

		/// <summary>
		/// Return to main menu, and disconnect any players
		/// </summary>
		public override void ReturnToMainMenuHost()
			=> E__Supper__AGameModeBase_ReturnToMainMenuHost(this);

		/// <summary>
		/// Transitions to calls BeginPlay on actors.
		/// </summary>
		public override void StartPlay()
			=> E__Supper__AGameModeBase_StartPlay(this);

		/// <summary>
		/// Start the transition out of the current map. Called at start of seamless travel, or right before map change for hard travel.
		/// </summary>
		public override void StartToLeaveMap()
			=> E__Supper__AGameModeBase_StartToLeaveMap(this);

		/// <summary>
		/// Overridable native event for when play begins for this actor.
		/// </summary>
		protected override void BeginPlay()
			=> E__Supper__AGameModeBase_BeginPlay(this);

		/// <summary>
		/// Do anything needed to clear out cross level references; Called from ULevel::PreSave
		/// </summary>
		public override void ClearCrossLevelReferences()
			=> E__Supper__AGameModeBase_ClearCrossLevelReferences(this);

		/// <summary>
		/// Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending
		/// </summary>
		public override void Destroyed()
			=> E__Supper__AGameModeBase_Destroyed(this);

		/// <summary>
		/// Forces this actor to be net relevant if it is not already by default
		/// </summary>
		public override void ForceNetRelevant()
			=> E__Supper__AGameModeBase_ForceNetRelevant(this);

		/// <summary>
		/// Force actor to be updated to clients/demo net drivers
		/// </summary>
		public override void ForceNetUpdate()
			=> E__Supper__AGameModeBase_ForceNetUpdate(this);

		/// <summary>
		/// Fills ReplicatedMovement property
		/// </summary>
		public override void GatherCurrentMovement()
			=> E__Supper__AGameModeBase_GatherCurrentMovement(this);

		/// <summary>
		/// Invalidates anything produced by the last lighting build.
		/// </summary>
		public override void InvalidateLightingCacheDetailed(bool bTranslationOnly)
			=> E__Supper__AGameModeBase_InvalidateLightingCacheDetailed(this, bTranslationOnly);

		/// <summary>
		/// Destroy the actor
		/// </summary>
		public override void DestroyActor()
			=> E__Supper__AGameModeBase_K2_DestroyActor(this);

		/// <summary>
		/// Called when the lifespan of an actor expires (if he has one).
		/// </summary>
		public override void LifeSpanExpired()
			=> E__Supper__AGameModeBase_LifeSpanExpired(this);

		/// <summary>
		/// Called to mark all components as pending kill when the actor is being destroyed
		/// </summary>
		public override void MarkComponentsAsPendingKill()
			=> E__Supper__AGameModeBase_MarkComponentsAsPendingKill(this);

		/// <summary>
		/// Event when this actor has the mouse moved over it with the clickable interface.
		/// </summary>
		public override void NotifyActorBeginCursorOver()
			=> E__Supper__AGameModeBase_NotifyActorBeginCursorOver(this);

		/// <summary>
		/// Event when this actor has the mouse moved off of it with the clickable interface.
		/// </summary>
		public override void NotifyActorEndCursorOver()
			=> E__Supper__AGameModeBase_NotifyActorEndCursorOver(this);

		public override void OnRep_AttachmentReplication()
			=> E__Supper__AGameModeBase_OnRep_AttachmentReplication(this);

		public override void OnRep_Instigator()
			=> E__Supper__AGameModeBase_OnRep_Instigator(this);

		protected override void OnRep_Owner()
			=> E__Supper__AGameModeBase_OnRep_Owner(this);

		public override void OnRep_ReplicatedMovement()
			=> E__Supper__AGameModeBase_OnRep_ReplicatedMovement(this);

		public override void OnRep_ReplicateMovement()
			=> E__Supper__AGameModeBase_OnRep_ReplicateMovement(this);

		/// <summary>
		/// Called on the client when the replication paused value is changed
		/// </summary>
		public override void OnReplicationPausedChanged(bool bIsReplicationPaused)
			=> E__Supper__AGameModeBase_OnReplicationPausedChanged(this, bIsReplicationPaused);

		/// <summary>
		/// Called when the Actor is outside the hard limit on world bounds
		/// </summary>
		public override void OutsideWorldBounds()
			=> E__Supper__AGameModeBase_OutsideWorldBounds(this);

		/// <summary>
		/// Called when an actor is done spawning into the world (from UWorld::SpawnActor), both in the editor and during gameplay
		/// <para>For actors with a root component, the location and rotation will have already been set. </para>
		/// This is called before calling construction scripts, but after native components have been created
		/// </summary>
		public override void PostActorCreated()
			=> E__Supper__AGameModeBase_PostActorCreated(this);

		/// <summary>
		/// Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay
		/// </summary>
		public override void PostInitializeComponents()
			=> E__Supper__AGameModeBase_PostInitializeComponents(this);

		/// <summary>
		/// Always called immediately after spawning and reading in replicated properties
		/// </summary>
		public override void PostNetInit()
			=> E__Supper__AGameModeBase_PostNetInit(this);

		/// <summary>
		/// Update location and rotation from ReplicatedMovement. Not called for simulated physics!
		/// </summary>
		public override void PostNetReceiveLocationAndRotation()
			=> E__Supper__AGameModeBase_PostNetReceiveLocationAndRotation(this);

		/// <summary>
		/// Update and smooth simulated physic state, replaces PostNetReceiveLocation() and PostNetReceiveVelocity()
		/// </summary>
		public override void PostNetReceivePhysicState()
			=> E__Supper__AGameModeBase_PostNetReceivePhysicState(this);

		/// <summary>
		/// Always called immediately after a new Role is received from the remote.
		/// </summary>
		public override void PostNetReceiveRole()
			=> E__Supper__AGameModeBase_PostNetReceiveRole(this);

		/// <summary>
		/// Called after all the components in the Components array are registered, called both in editor and during gameplay
		/// </summary>
		public override void PostRegisterAllComponents()
			=> E__Supper__AGameModeBase_PostRegisterAllComponents(this);

		/// <summary>
		/// Called after all currently registered components are cleared
		/// </summary>
		public override void PostUnregisterAllComponents()
			=> E__Supper__AGameModeBase_PostUnregisterAllComponents(this);

		/// <summary>
		/// Called right before components are initialized, only called during gameplay
		/// </summary>
		public override void PreInitializeComponents()
			=> E__Supper__AGameModeBase_PreInitializeComponents(this);

		/// <summary>
		/// Called before all the components in the Components array are registered, called both in editor and during gameplay
		/// </summary>
		public override void PreRegisterAllComponents()
			=> E__Supper__AGameModeBase_PreRegisterAllComponents(this);

		/// <summary>
		/// Calls PrestreamTextures() for all the actor's meshcomponents.
		/// </summary>
		/// <param name="seconds">Number of seconds to force all mip-levels to be resident</param>
		/// <param name="bEnableStreaming">Whether to start (true) or stop (false) streaming</param>
		/// <param name="cinematicTextureGroups">Bitfield indicating which texture groups that use extra high-resolution mips</param>
		public override void PrestreamTextures(float seconds, bool bEnableStreaming, int cinematicTextureGroups)
			=> E__Supper__AGameModeBase_PrestreamTextures(this, seconds, bEnableStreaming, cinematicTextureGroups);

		/// <summary>
		/// Virtual call chain to register all tick functions for the actor class hierarchy
		/// </summary>
		/// <param name="bRegister">true to register, false, to unregister</param>
		protected override void RegisterActorTickFunctions(bool bRegister)
			=> E__Supper__AGameModeBase_RegisterActorTickFunctions(this, bRegister);

		/// <summary>
		/// Ensure that all the components in the Components array are registered
		/// </summary>
		public override void RegisterAllComponents()
			=> E__Supper__AGameModeBase_RegisterAllComponents(this);

		/// <summary>
		/// Will reregister all components on this actor. Does a lot of work - should only really be used in editor, generally use UpdateComponentTransforms or MarkComponentsRenderStateDirty.
		/// </summary>
		public override void ReregisterAllComponents()
			=> E__Supper__AGameModeBase_ReregisterAllComponents(this);

		/// <summary>
		/// Rerun construction scripts, destroying all autogenerated components; will attempt to preserve the root component location.
		/// </summary>
		public override void RerunConstructionScripts()
			=> E__Supper__AGameModeBase_RerunConstructionScripts(this);

		/// <summary>
		/// Reset actor to initial state - used when restarting level without reloading.
		/// </summary>
		public override void Reset()
			=> E__Supper__AGameModeBase_Reset(this);

		/// <summary>
		/// Called on the actor before checkpoint data is applied during a replay.
		/// <para>Only called if bReplayRewindable is set. </para>
		/// </summary>
		public override void RewindForReplay()
			=> E__Supper__AGameModeBase_RewindForReplay(this);

		/// <summary>
		/// Sets the actor to be hidden in the game
		/// </summary>
		/// <param name="bNewHidden">Whether or not to hide the actor and all its components</param>
		public override void SetActorHiddenInGame(bool bNewHidden)
			=> E__Supper__AGameModeBase_SetActorHiddenInGame(this, bNewHidden);

		/// <summary>
		/// Set the lifespan of this actor. When it expires the object will be destroyed. If requested lifespan is 0, the timer is cleared and the actor will not be destroyed.
		/// </summary>
		public override void SetLifeSpan(float inLifespan)
			=> E__Supper__AGameModeBase_SetLifeSpan(this, inLifespan);

		/// <summary>
		/// Set whether this actor's movement replicates to network clients.
		/// </summary>
		/// <param name="bInReplicateMovement">Whether this Actor's movement replicates to clients.</param>
		public override void SetReplicateMovement(bool bInReplicateMovement)
			=> E__Supper__AGameModeBase_SetReplicateMovement(this, bInReplicateMovement);

		/// <summary>
		/// Networking - Server - TearOff this actor to stop replication to clients. Will set bTearOff to true.
		/// </summary>
		public override void TearOff()
			=> E__Supper__AGameModeBase_TearOff(this);

		/// <summary>
		/// Called from TeleportTo() when teleport succeeds
		/// </summary>
		public override void TeleportSucceeded(bool bIsATest)
			=> E__Supper__AGameModeBase_TeleportSucceeded(this, bIsATest);

		/// <summary>
		/// Function called every frame on this Actor. Override this function to implement custom logic to be executed every frame.
		/// <para>Note that Tick is disabled by default, and you will need to check PrimaryActorTick.bCanEverTick is set to true to enable it. </para>
		/// </summary>
		/// <param name="deltaSeconds">Game time elapsed during last frame modified by the time dilation</param>
		public override void Tick(float deltaSeconds)
			=> E__Supper__AGameModeBase_Tick(this, deltaSeconds);

		/// <summary>
		/// Networking - called on client when actor is torn off (bTearOff==true), meaning it's no longer replicated to clients.
		/// <para>@see bTearOff </para>
		/// </summary>
		public override void TornOff()
			=> E__Supper__AGameModeBase_TornOff(this);

		/// <summary>
		/// Unregister all currently registered components
		/// </summary>
		/// <param name="bForReregister">If true, RegisterAllComponents will be called immediately after this so some slow operations can be avoided</param>
		public override void UnregisterAllComponents(bool bForReregister)
			=> E__Supper__AGameModeBase_UnregisterAllComponents(this, bForReregister);

		/// <summary>
		/// Called before destroying the object.  This is called immediately upon deciding to destroy the object, to allow the object to begin an
		/// <para>asynchronous cleanup process. </para>
		/// </summary>
		public override void BeginDestroy()
			=> E__Supper__AGameModeBase_BeginDestroy(this);

		/// <summary>
		/// Called to finish destroying the object.  After UObject::FinishDestroy is called, the object's memory should no longer be accessed.
		/// <para>@warning Because properties are destroyed here, Super::FinishDestroy() should always be called at the end of your child class's FinishDestroy() method, rather than at the beginning. </para>
		/// </summary>
		public override void FinishDestroy()
			=> E__Supper__AGameModeBase_FinishDestroy(this);

		/// <summary>
		/// Called during subobject creation to mark this component as editor only, which causes it to get stripped in packaged builds
		/// </summary>
		public override void MarkAsEditorOnlySubobject()
			=> E__Supper__AGameModeBase_MarkAsEditorOnlySubobject(this);

		/// <summary>
		/// Called after the C++ constructor has run on the CDO for a class. This is an obscure routine used to deal with the recursion
		/// <para>in the construction of the default materials </para>
		/// </summary>
		public override void PostCDOContruct()
			=> E__Supper__AGameModeBase_PostCDOContruct(this);

		/// <summary>
		/// Called after importing property values for this object (paste, duplicate or .t3d import)
		/// <para>Allow the object to perform any cleanup for properties which shouldn't be duplicated or </para>
		/// are unsupported by the script serialization
		/// </summary>
		public override void PostEditImport()
			=> E__Supper__AGameModeBase_PostEditImport(this);

		/// <summary>
		/// Called after the C++ constructor and after the properties have been initialized, including those loaded from config.
		/// <para>This is called before any serialization or other setup has happened. </para>
		/// </summary>
		public override void PostInitProperties()
			=> E__Supper__AGameModeBase_PostInitProperties(this);

		/// <summary>
		/// Do any object-specific cleanup required immediately after loading an object.
		/// <para>This is not called for newly-created objects, and by default will always execute on the game thread. </para>
		/// </summary>
		public override void PostLoad()
			=> E__Supper__AGameModeBase_PostLoad(this);

		/// <summary>
		/// Called right after receiving a bunch
		/// </summary>
		public override void PostNetReceive()
			=> E__Supper__AGameModeBase_PostNetReceive(this);

		/// <summary>
		/// Called right after calling all OnRep notifies (called even when there are no notifies)
		/// </summary>
		public override void PostRepNotifies()
			=> E__Supper__AGameModeBase_PostRepNotifies(this);

		/// <summary>
		/// Called from within SavePackage on the passed in base/root object.
		/// <para>This function is called after the package has been saved and can perform cleanup. </para>
		/// </summary>
		/// <param name="bCleanupIsRequired">Whether PreSaveRoot dirtied state that needs to be cleaned up</param>
		public override void PostSaveRoot(bool bCleanupIsRequired)
			=> E__Supper__AGameModeBase_PostSaveRoot(this, bCleanupIsRequired);

		/// <summary>
		/// Called right before being marked for destruction due to network replication
		/// </summary>
		public override void PreDestroyFromReplication()
			=> E__Supper__AGameModeBase_PreDestroyFromReplication(this);

		/// <summary>
		/// Called right before receiving a bunch
		/// </summary>
		public override void PreNetReceive()
			=> E__Supper__AGameModeBase_PreNetReceive(this);

		/// <summary>
		/// After a critical error, perform any mission-critical cleanup, such as restoring the video mode orreleasing hardware resources.
		/// </summary>
		public override void ShutdownAfterError()
			=> E__Supper__AGameModeBase_ShutdownAfterError(this);

		/// <summary>
		/// Called after PostLoad to create UObject cluster
		/// </summary>
		public override void CreateCluster()
			=> E__Supper__AGameModeBase_CreateCluster(this);

		/// <summary>
		/// Called during Garbage Collection to perform additional cleanup when the cluster is about to be destroyed due to PendingKill flag being set on it.
		/// </summary>
		public override void OnClusterMarkedAsPendingKill()
			=> E__Supper__AGameModeBase_OnClusterMarkedAsPendingKill(this);

		#endregion

		public static implicit operator IntPtr(ManageGameModeBase self)
		{
			return self?.NativePointer ?? IntPtr.Zero;
		}

		public static implicit operator ManageGameModeBase(ObjectPointerDescription PtrDesc)
		{
			return NativeManager.GetWrapper<ManageGameModeBase>(PtrDesc);
		}
}
}


text:
var glob = require("glob");
var files = glob.sync("./tasks/*.js");
var schedule = require('node-schedule');

var start = function start()
{
    files.forEach((path)=>{
        var task = require('.' + path);
        if(task && task.task && task.cronSchedule && task.name)
        {
            if(typeof(task.cronSchedule.then) === "function") {
                task.cronSchedule.then(cronSchedule => {
                    console.log("\tSchedualing Task " + task.name + " [" + path + "] with cron schededule: " + cronSchedule);
                    schedule.scheduleJob(cronSchedule,task.task);
                    console.log("\tTask " + task.name + " is schedualed.");
                    if(task.runAtStartup)
                    {
                        console.log("\tTask " + task.name + " is set to run at startup.");
                        task.task();
                    }
                })
            }
            else {
                console.log("\tSchedualing Task " + task.name + " [" + path + "] with cron schededule: " +task.cronSchedule);
                schedule.scheduleJob(task.cronSchedule,task.task);
                console.log("\tTask " + task.name + " is schedualed.");
                if(task.runAtStartup)
                {
                    console.log("\tTask " + task.name + " is set to run at startup.");
                    task.task();
                }
            }
        }

    });

}
module.exports = {start};

redpajama_set_name: RedPajamaGithub


text:
package com.chillingvan.canvasgl.matrix;

import android.opengl.Matrix;

import java.util.Arrays;

/**
 * Created by Chilling on 2018/11/17.
 */
public abstract class BaseBitmapMatrix implements IBitmapMatrix {

    public static final int TRANSLATE_X = 0;
    public static final int TRANSLATE_Y = 1;
    public static final int SCALE_X = 2;
    public static final int SCALE_Y = 3;
    public static final int ROTATE_X = 4;
    public static final int ROTATE_Y = 5;
    public static final int ROTATE_Z = 6;
    public static final int MATRIX_SIZE = 16;
    public final static float NEAR = 1;
    public final static float FAR = 10; // The plane is at -10
    public final static float EYEZ = 5;
    public final static float Z_RATIO = (FAR + NEAR) / 2 / NEAR; // The scale ratio when the picture moved to the middle of the perspective projection.
    protected float[] transform = new float[7];
    protected float[] tempMultiplyMatrix4 = new float[MATRIX_SIZE];
    protected float[] mViewMatrix = new float[MATRIX_SIZE];
    protected float[] mProjectionMatrix = new float[MATRIX_SIZE];
    protected float[] mModelMatrix = new float[MATRIX_SIZE];
    protected float[] viewProjectionMatrix = new float[MATRIX_SIZE];
    protected float[] mvp = new float[MATRIX_SIZE];

    public void reset() {
        Matrix.setIdentityM(mViewMatrix, 0);
        Matrix.setIdentityM(mProjectionMatrix, 0);
        Matrix.setIdentityM(mModelMatrix, 0);
        Matrix.setIdentityM(viewProjectionMatrix, 0);
        Matrix.setIdentityM(mvp, 0);

        Matrix.setIdentityM(tempMultiplyMatrix4, 0);
        Arrays.fill(transform, 0);
        transform[SCALE_X] = 1;
        transform[SCALE_Y] = 1;
    }
}


text:
#ifndef GCC_EPIPHANY_H
#define GCC_EPIPHANY_H

#undef LINK_SPEC
#undef STARTFILE_SPEC
#undef ENDFILE_SPEC
#undef SIZE_TYPE
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE

/* Names to predefine in the preprocessor for this target machine.  */
#define TARGET_CPU_CPP_BUILTINS()		\
  do						\
    {						\
	builtin_define ("__epiphany__");	\
        builtin_define ("__little_endian__");	\
	builtin_define_with_int_value ("__EPIPHANY_STACK_OFFSET__", \
				       epiphany_stack_offset); \
	builtin_assert ("cpu=epiphany");	\
	builtin_assert ("machine=epiphany");	\
    } while (0)

/* Pick up the libgloss library. One day we may do this by linker script, but
   for now its static.
   libgloss might use errno/__errno, which might not have been needed when we
   saw libc the first time, so link with libc a second time.  */
#undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} -lepiphany %{!shared:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"

#define LINK_SPEC "%{v}"

#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s " \
  "%{mfp-mode=int:crtint.o%s} %{mfp-mode=truncate:crtrunc.o%s} " \
  "%{m1reg-r43:crtm1reg-r43.o%s} %{m1reg-r63:crtm1reg-r63.o%s} " \
  "crtbegin.o%s"

#define ENDFILE_SPEC "crtend.o%s crtn.o%s"

#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"

#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
   asm (SECTION_OP "\n\
	mov r0,%low(" USER_LABEL_PREFIX #FUNC")\n\
	movt r0,%high(" USER_LABEL_PREFIX #FUNC")\n\
	jalr r0\n\
	.text");

#if 0 /* We would like to use Posix for profiling, but the simulator
	 interface still lacks mkdir.  */
#define TARGET_POSIX_IO
#endif

/* Target machine storage layout.  */

/* Define this if most significant bit is lowest numbered
   in instructions that operate on numbered bit-fields.  */
#define BITS_BIG_ENDIAN 0

/* Define this if most significant byte of a word is the lowest numbered.  */
#define BYTES_BIG_ENDIAN 0

/* Define this if most significant word of a multiword number is the lowest
   numbered.  */
#define WORDS_BIG_ENDIAN 0

/* Width of a word, in units (bytes).  */
#define UNITS_PER_WORD 4

/* Define this macro if it is advisable to hold scalars in registers
   in a wider mode than that declared by the program.  In such cases,
   the value is constrained to be within the bounds of the declared
   type, but kept valid in the wider mode.  The signedness of the
   extension may differ from that of the type.  */
/* It is far faster to zero extend chars than to sign extend them */

#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE)	\
  if (GET_MODE_CLASS (MODE) == MODE_INT		\
      && GET_MODE_SIZE (MODE) < 4)      	\
    {						\
      if (MODE == QImode)			\
	UNSIGNEDP = 1;				\
      else if (MODE == HImode)			\
	UNSIGNEDP = 1;				\
      (MODE) = SImode;				\
    }

/* Allocation boundary (in *bits*) for storing arguments in argument list.  */
#define PARM_BOUNDARY 32

/* Boundary (in *bits*) on which stack pointer should be aligned.  */
#define STACK_BOUNDARY 64

/* ALIGN FRAMES on word boundaries */
#define EPIPHANY_STACK_ALIGN(LOC) (((LOC)+7) & ~7)

/* Allocation boundary (in *bits*) for the code of a function.  */
#define FUNCTION_BOUNDARY 32

/* Every structure's size must be a multiple of this.  */
#define STRUCTURE_SIZE_BOUNDARY 8

/* A bit-field declared as `int' forces `int' alignment for the struct.  */
#define PCC_BITFIELD_TYPE_MATTERS 1

/* No data type wants to be aligned rounder than this.  */
/* This is bigger than currently necessary for the EPIPHANY.  If 8 byte floats are
   ever added it's not clear whether they'll need such alignment or not.  For
   now we assume they will.  We can always relax it if necessary but the
   reverse isn't true.  */
#define BIGGEST_ALIGNMENT 64

/* The best alignment to use in cases where we have a choice.  */
#define FASTEST_ALIGNMENT 64

#define MALLOC_ABI_ALIGNMENT BIGGEST_ALIGNMENT

/* Make strings dword-aligned so strcpy from constants will be faster.  */
#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
  ((TREE_CODE (EXP) == STRING_CST	\
    && (ALIGN) < FASTEST_ALIGNMENT)	\
   ? FASTEST_ALIGNMENT : (ALIGN))

/* Make arrays of chars dword-aligned for the same reasons.
   Also, align arrays of SImode items.  */
#define DATA_ALIGNMENT(TYPE, ALIGN)		\
  (TREE_CODE (TYPE) == ARRAY_TYPE		\
   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\
   && (ALIGN) < FASTEST_ALIGNMENT		\
   ? FASTEST_ALIGNMENT				\
   : (TREE_CODE (TYPE) == ARRAY_TYPE		\
      && TYPE_MODE (TREE_TYPE (TYPE)) == SImode	\
      && (ALIGN) < FASTEST_ALIGNMENT)		\
   ? FASTEST_ALIGNMENT				\
   : (ALIGN))

/* Set this nonzero if move instructions will actually fail to work
   when given unaligned data.  */
/* On the EPIPHANY the lower address bits are masked to 0 as necessary.  The chip
   won't croak when given an unaligned address, but the insn will still fail
   to produce the correct result.  */
#define STRICT_ALIGNMENT 1

/* layout_type overrides our ADJUST_ALIGNMENT settings from epiphany-modes.def
   for vector modes, so we have to override it back.  */
#define ROUND_TYPE_ALIGN(TYPE, MANGLED_ALIGN, SPECIFIED_ALIGN) \
 (TREE_CODE (TYPE) == VECTOR_TYPE && !TYPE_USER_ALIGN (TYPE) \
  && SPECIFIED_ALIGN <= GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
  ? GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
  : ((TREE_CODE (TYPE) == RECORD_TYPE \
      || TREE_CODE (TYPE) == UNION_TYPE \
      || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
     && !TYPE_PACKED (TYPE)) \
  ? epiphany_special_round_type_align ((TYPE), (MANGLED_ALIGN), \
				       (SPECIFIED_ALIGN)) \
  : MAX ((MANGLED_ALIGN), (SPECIFIED_ALIGN)))

#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
  epiphany_adjust_field_align((FIELD), (COMPUTED))

/* Layout of source language data types.  */

#define SHORT_TYPE_SIZE		16
#define INT_TYPE_SIZE		32
#define LONG_TYPE_SIZE		32
#define LONG_LONG_TYPE_SIZE	64
#define FLOAT_TYPE_SIZE		32
#define DOUBLE_TYPE_SIZE	64
#define LONG_DOUBLE_TYPE_SIZE	64

/* Define this as 1 if `char' should by default be signed; else as 0.  */
#define DEFAULT_SIGNED_CHAR 0

#define SIZE_TYPE "long unsigned int"
#define PTRDIFF_TYPE "long int"
#define WCHAR_TYPE "unsigned int"
#define WCHAR_TYPE_SIZE BITS_PER_WORD

/* Standard register usage.  */

/* Number of actual hardware registers.
   The hardware registers are assigned numbers for the compiler
   from 0 to just below FIRST_PSEUDO_REGISTER.
   All registers that the compiler knows about must be given numbers,
   even those that are not normally considered general registers.  */

#define FIRST_PSEUDO_REGISTER 78

/* General purpose registers.  */
#define GPR_FIRST       0                       /* First gpr */

#define PIC_REGNO       (GPR_FIRST + 28)        /* PIC register.  */
#define GPR_LAST        (GPR_FIRST + 63)        /* Last gpr */
#define CORE_CONTROL_FIRST CONFIG_REGNUM
#define CORE_CONTROL_LAST IRET_REGNUM

#define GPR_P(R)	IN_RANGE (R, GPR_FIRST, GPR_LAST)
#define GPR_OR_AP_P(R)	(GPR_P (R) || (R) == ARG_POINTER_REGNUM)

#define GPR_OR_PSEUDO_P(R)	(GPR_P (R) || (R) >= FIRST_PSEUDO_REGISTER)
#define GPR_AP_OR_PSEUDO_P(R)	(GPR_OR_AP_P (R) || (R) >= FIRST_PSEUDO_REGISTER)

#define FIXED_REGISTERS							\
{	/* Integer Registers */						\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 000-007, gr0  - gr7  */	\
	0, 0, 0, 0, 0, 1, 0, 0,		/* 008-015, gr8  - gr15 */	\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 016-023, gr16 - gr23 */	\
	0, 0, 0, 0, 1, 1, 1, 1,		/* 024-031, gr24 - gr31 */	\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 032-039, gr32 - gr39 */	\
	1, 1, 1, 1, 0, 0, 0, 0,		/* 040-047, gr40 - gr47 */	\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 048-055, gr48 - gr55 */	\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 056-063, gr56 - gr63 */	\
	/* Other registers */						\
	1,				/* 64 AP   - fake arg ptr */	\
	1,				/* soft frame pointer */	\
        1,				/* CC_REGNUM  - integer conditions */\
	1,				/* CCFP_REGNUM  - fp conditions */\
	1, 1, 1, 1, 1, 1,               /* Core Control Registers.  */  \
	1, 1, 1,			/* FP_{NEAREST,...}_REGNUM */\
	1,				/* UNKNOWN_REGNUM - placeholder.  */\
}

/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
   general) by function calls as well as for fixed registers.  This macro
   therefore identifies the registers that are not available for general
   allocation of values that must live across function calls.

   If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
   saves it on function entry and restores it on function exit, if the register
   is used within the function.  */

#define CALL_USED_REGISTERS						\
{	/* Integer Registers */						\
	1, 1, 1, 1, 0, 0, 0, 0,	        /* 000-007, gr0  - gr7  */	\
	0, 0, 0, 0, 1, 1, 1, 0,		/* 008-015, gr8  - gr15 */	\
	1, 1, 1, 1, 1, 1, 1, 1,		/* 016-023, gr16 - gr23 */	\
	1, 1, 1, 1, 1, 1, 1, 1,		/* 024-031, gr24 - gr31 */	\
	0, 0, 0, 0, 0, 0, 0, 0,		/* 032-039, gr32 - gr38 */	\
	1, 1, 1, 1, 1, 1, 1, 1,		/* 040-047, gr40 - gr47 */	\
	1, 1, 1, 1, 1, 1, 1, 1,		/* 048-055, gr48 - gr55 */	\
	1, 1, 1, 1, 1, 1, 1, 1,		/* 056-063, gr56 - gr63 */	\
	1,				/* 64 AP   - fake arg ptr */	\
	1,				/* soft frame pointer */	\
	1,				/* 66 CC_REGNUM */   		\
	1,				/* 67 CCFP_REGNUM */   		\
	1, 1, 1, 1, 1, 1,               /* Core Control Registers.  */  \
	1, 1, 1,			/* FP_{NEAREST,...}_REGNUM */\
	1,				/* UNKNOWN_REGNUM - placeholder.  */\
}

#define REG_ALLOC_ORDER \
  { \
    0, 1, 2, 3, /* Caller-saved 'small' registers.  */ \
    12, /* Caller-saved unpaired register.  */ \
    /* Caller-saved registers.  */ \
    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, \
    44, 45, 46, 47, \
    48, 49, 50, 51, 52, 53, 54, 55, \
    56, 57, 58, 59, 60, 61, 62, 63, \
    4, 5, 6, 7, /* Calle-saved 'small' registers.  */ \
    15, /* Calle-saved unpaired register.  */ \
    8, 9, 10, 11, /* Calle-saved registers.  */ \
    32, 33, 34, 35, 36, 37, 38, 39, \
    14, 13, /* Link register, stack pointer.  */ \
    40, 41, 42, 43, /* Usually constant, but might be made callee-saved.  */ \
    /* Can't allocate, but must name these... */ \
    28, 29, 30, 31, \
    64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 \
  }

/* Return number of consecutive hard regs needed starting at reg REGNO
   to hold something of mode MODE.
   This is ordinarily the length in words of a value of mode MODE
   but can be less for certain modes in special long registers.  */
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)

/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
extern const unsigned int epiphany_hard_regno_mode_ok[];
extern unsigned int epiphany_mode_class[];
#define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE))

/* A C expression that is nonzero if it is desirable to choose
   register allocation so as to avoid move instructions between a
   value of mode MODE1 and a value of mode MODE2.

   If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
   MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
   MODE2)' must be zero.  */

#define MODES_TIEABLE_P(MODE1, MODE2) 1

/* Register classes and constants.  */

/* Define the classes of registers for register constraints in the
   machine description.  Also define ranges of constants.

   One of the classes must always be named ALL_REGS and include all hard regs.
   If there is more than one class, another class must be named NO_REGS
   and contain no registers.

   The name GENERAL_REGS must be the name of a class (or an alias for
   another name such as ALL_REGS).  This is the class of registers
   that is allowed by "g" or "r" in a register constraint.
   Also, registers outside this class are allocated only when
   instructions express preferences for them.

   The classes must be numbered in nondecreasing order; that is,
   a larger-numbered class must never be contained completely
   in a smaller-numbered class.

   For any two classes, it is very desirable that there be another
   class that represents their union.

   It is important that any condition codes have class NO_REGS.
   See `register_operand'.  */

enum reg_class {
  NO_REGS,
  LR_REGS,
  SHORT_INSN_REGS,
  SIBCALL_REGS,
  GENERAL_REGS,
  CORE_CONTROL_REGS,
  ALL_REGS,
  LIM_REG_CLASSES
};

#define N_REG_CLASSES ((int) LIM_REG_CLASSES)

/* Give names of register classes as strings for dump file.  */
#define REG_CLASS_NAMES \
{			\
  "NO_REGS",		\
  "LR_REGS",		\
  "SHORT_INSN_REGS",	\
  "SIBCALL_REGS",	\
  "GENERAL_REGS",	\
  "CORE_CONTROL_REGS",	\
  "ALL_REGS"		\
}

/* Define which registers fit in which classes.
   This is an initializer for a vector of HARD_REG_SET
   of length N_REG_CLASSES.  */

#define REG_CLASS_CONTENTS						\
{  /* r0-r31    r32-r63  ap/sfp/cc1/cc2/iret/status */			\
  { 0x00000000,0x00000000,0x0},  /* NO_REGS  */				\
  { 0x00004000,0x00000000,0x0},  /* LR_REGS  */				\
  { 0x000000ff,0x00000000,0x0},  /* SHORT_INSN_REGS */			\
  { 0xffff100f,0xffffff00,0x0},  /* SIBCALL_REGS */			\
  { 0xffffffff,0xffffffff,0x0003}, /* GENERAL_REGS */			\
  { 0x00000000,0x00000000,0x03f0}, /* CORE_CONTROL_REGS */		\
  { 0xffffffff,0xffffffff,0x3fff}, /* ALL_REGS */				\
}

/* The same information, inverted:
   Return the class number of the smallest class containing
   reg number REGNO.  This could be a conditional expression
   or could index an array.  */
extern enum reg_class epiphany_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) \
(epiphany_regno_reg_class[REGNO])

/* The class value for index registers, and the one for base regs.  */
#define BASE_REG_CLASS GENERAL_REGS
#define INDEX_REG_CLASS GENERAL_REGS

/* These assume that REGNO is a hard or pseudo reg number.
   They give nonzero only if REGNO is a hard reg of the suitable class
   or a pseudo reg currently allocated to a suitable hard reg.
   Since they use reg_renumber, they are safe only once reg_renumber
   has been allocated, which happens in local-alloc.c.  */
#define REGNO_OK_FOR_BASE_P(REGNO) \
((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
#define REGNO_OK_FOR_INDEX_P(REGNO) \
((REGNO) < FIRST_PSEUDO_REGISTER || (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)

/* Given an rtx X being reloaded into a reg required to be
   in class CLASS, return the class of reg to actually use.
   In general this is just CLASS; but on some machines
   in some cases it is preferable to use a more restrictive class.  */
#define PREFERRED_RELOAD_CLASS(X,CLASS) \
(CLASS)

/* Return the maximum number of consecutive registers
   needed to represent mode MODE in a register of class CLASS.  */
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)

/* The letters I, J, K, L, M, N, O, P in a register constraint string
   can be used to stand for particular ranges of immediate operands.
   This macro defines what the ranges are.
   C is the letter, and VALUE is a constant value.
   Return 1 if VALUE is in the range specified by C.  */

/* 'I' is used for 16 bit unsigned.
   'Cal' is used for long immediates (32 bits)
   'K' is used for any constant up to 5 bits.
   'L' is used for any 11 bit signed.
*/

#define IMM16(X)     (IN_RANGE ((X), 0, 0xFFFF))
#define SIMM16(X)    (IN_RANGE ((X), -65536, 65535))
#define SIMM11(X)    (IN_RANGE ((X), -1024, 1023))
#define IMM5(X)      (IN_RANGE ((X), 0, 0x1F))

typedef struct GTY (()) machine_function
{
  unsigned args_parsed : 1;
  unsigned pretend_args_odd : 1;
  unsigned lr_clobbered : 1;
  unsigned control_use_inserted : 1;
  unsigned sw_entities_processed : 6;
  long lr_slot_offset;
  rtx and_mask;
  rtx or_mask;
  unsigned unknown_mode_uses;
  unsigned unknown_mode_sets;
} machine_function_t;

#define MACHINE_FUNCTION(fun) (fun)->machine

#define INIT_EXPANDERS epiphany_init_expanders ()

/* Stack layout and stack pointer usage.  */

/* Define this macro if pushing a word onto the stack moves the stack
   pointer to a smaller address.  */
#define STACK_GROWS_DOWNWARD

/* Define this to nonzero if the nominal address of the stack frame
   is at the high-address end of the local variables;
   that is, each additional local variable allocated
   goes at a more negative offset in the frame.  */
#define FRAME_GROWS_DOWNWARD 1

/* Offset within stack frame to start allocating local variables at.
   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
   first local allocated.  Otherwise, it is the offset to the BEGINNING
   of the first local allocated.  */
#define STARTING_FRAME_OFFSET epiphany_stack_offset

/* Offset from the stack pointer register to the first location at which
   outgoing arguments are placed.  */
#define STACK_POINTER_OFFSET epiphany_stack_offset

/* Offset of first parameter from the argument pointer register value.  */
/* 4 bytes for each of previous fp, return address, and previous gp.
   4 byte reserved area for future considerations.  */
#define FIRST_PARM_OFFSET(FNDECL) \
  (epiphany_stack_offset \
   + (MACHINE_FUNCTION (DECL_STRUCT_FUNCTION (FNDECL))->pretend_args_odd \
      ? 4 : 0))

#define INCOMING_FRAME_SP_OFFSET epiphany_stack_offset

/* Register to use for pushing function arguments.  */
#define STACK_POINTER_REGNUM GPR_SP

/* Base register for access to local variables of the function.  */
#define HARD_FRAME_POINTER_REGNUM GPR_FP

/* Register in which static-chain is passed to a function.  This must
   not be a register used by the prologue.  */
#define STATIC_CHAIN_REGNUM GPR_IP

/* Define the offset between two registers, one to be eliminated, and the other
   its replacement, at the start of a routine.  */

#define ELIMINABLE_REGS						\
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},			\
 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},		\
 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},                   \
 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},		\
}

/* Define the offset between two registers, one to be eliminated, and the other
   its replacement, at the start of a routine.  */

#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
  ((OFFSET) = epiphany_initial_elimination_offset ((FROM), (TO)))

/* Function argument passing.  */

/* If defined, the maximum amount of space required for outgoing
   arguments will be computed and placed into the variable
   `current_function_outgoing_args_size'.  No space will be pushed
   onto the stack for each call; instead, the function prologue should
   increase the stack frame size by this amount.  */
#define ACCUMULATE_OUTGOING_ARGS 1

/* Define a data type for recording info about an argument list
   during the scan of that argument list.  This data type should
   hold all necessary information about the function itself
   and about the args processed so far, enough to enable macros
   such as FUNCTION_ARG to determine where the next arg should go.  */
#define CUMULATIVE_ARGS int

/* Initialize a variable CUM of type CUMULATIVE_ARGS
   for a call to a function whose data type is FNTYPE.
   For a library call, FNTYPE is 0.  */
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
((CUM) = 0)

/* The number of registers used for parameter passing.  Local to this file.  */
#define MAX_EPIPHANY_PARM_REGS 4

/* 1 if N is a possible register number for function argument passing.  */
#define FUNCTION_ARG_REGNO_P(N) \
((unsigned) (N) < MAX_EPIPHANY_PARM_REGS)

/* Return boolean indicating arg of type TYPE and mode MODE will be passed in
   a reg.  This includes arguments that have to be passed by reference as the
   pointer to them is passed in a reg if one is available (and that is what
   we're given).
   This macro is only used in this file.  */
/* We must use partial argument passing because of the chosen mode
   of varargs handling.  */
#define PASS_IN_REG_P(CUM, MODE, TYPE) \
  (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) < MAX_EPIPHANY_PARM_REGS)

/* Tell GCC to use TARGET_RETURN_IN_MEMORY.  */
#define DEFAULT_PCC_STRUCT_RETURN 0

/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
   the stack pointer does not matter.  The value is tested only in
   functions that have frame pointers.
   No definition is equivalent to always zero.  */
#define EXIT_IGNORE_STACK 1

#define EPILOGUE_USES(REGNO) epiphany_epilogue_uses (REGNO)

/* Output assembler code to FILE to increment profiler label # LABELNO
   for profiling a function entry.  */
#define FUNCTION_PROFILER(FILE, LABELNO)

/* Given an rtx for the frame pointer,
   return an rtx for the address of the frame.  */
#define FRAME_ADDR_RTX(frame) \
  ((frame) == hard_frame_pointer_rtx ? arg_pointer_rtx : NULL)

#define EPIPHANY_RETURN_REGNO \
  ((current_function_decl != NULL \
    && epiphany_is_interrupt_p (current_function_decl)) \
   ? IRET_REGNUM : GPR_LR)
/* This is not only for dwarf unwind info, but also for the benefit of
   df-scan.c to tell it that LR is live at the function start.  */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, EPIPHANY_RETURN_REGNO)

/* However, we haven't implemented the rest needed for dwarf2 unwind info.  */
#define DWARF2_UNWIND_INFO 0

#define RETURN_ADDR_RTX(count, frame) \
  (count ? NULL_RTX \
   : gen_rtx_UNSPEC (SImode, gen_rtvec (1, const0_rtx), UNSPEC_RETURN_ADDR))

#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (EPIPHANY_RETURN_REGNO)

/* Trampolines.
   An epiphany trampoline looks like this:
   mov r16,%low(fnaddr)
   movt r16,%high(fnaddr)
   mov ip,%low(cxt)
   movt ip,%high(cxt)
   jr r16  */

/* Length in units of the trampoline for entering a nested function.  */
#define TRAMPOLINE_SIZE 20

/* Addressing modes, and classification of registers for them.  */

/* Maximum number of registers that can appear in a valid memory address.  */
#define MAX_REGS_PER_ADDRESS 2

/* We have post_modify (load/store with update).  */
#define HAVE_POST_INCREMENT TARGET_POST_INC
#define HAVE_POST_DECREMENT TARGET_POST_INC
#define HAVE_POST_MODIFY_DISP TARGET_POST_MODIFY
#define HAVE_POST_MODIFY_REG TARGET_POST_MODIFY

/* Currently, the only users of the USE_*CREMENT macros are
   move_by_pieces / store_by_pieces_1 .  We don't want them to use
   POST_MODIFY modes, because we got ample addressing range for the
   reg+offset addressing mode; besides, there are short index+offset loads,
   but the only short post-modify load uses POST_MODIFY_REG.
   Moreover, using auto-increment in move_by_pieces from structure copying
   in the prologue causes confused debug output.
   If another pass starts using these macros where the use of these
   addressing modes would make more sense, we can try checking the
   current pass.  */
#define USE_LOAD_POST_INCREMENT(MODE) 0
#define USE_LOAD_POST_DECREMENT(MODE) 0
#define USE_STORE_POST_INCREMENT(MODE) 0
#define USE_STORE_POST_DECREMENT(MODE) 0

/* Recognize any constant value that is a valid address.  */
#define CONSTANT_ADDRESS_P(X) \
(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF	\
 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST)

#define RTX_OK_FOR_OFFSET_P(MODE, X) \
  RTX_OK_FOR_OFFSET_1 (GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
		       && epiphany_vect_align == 4 ? SImode : (MODE), X)
#define RTX_OK_FOR_OFFSET_1(MODE, X) \
  (GET_CODE (X) == CONST_INT \
   && !(INTVAL (X) & (GET_MODE_SIZE (MODE) - 1)) \
   && INTVAL (X) >= -2047 * (int) GET_MODE_SIZE (MODE) \
   && INTVAL (X) <=  2047 * (int) GET_MODE_SIZE (MODE))

/* Frame offsets cannot be evaluated till the frame pointer is eliminated.  */
#define RTX_FRAME_OFFSET_P(X) \
  ((X) == frame_pointer_rtx \
   || (GET_CODE (X) == PLUS && XEXP ((X), 0) == frame_pointer_rtx \
       && CONST_INT_P (XEXP ((X), 1))))

/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
   return the mode to be used for the comparison.  */
#define SELECT_CC_MODE(OP, X, Y) \
  epiphany_select_cc_mode (OP, X, Y)

/* Return nonzero if SELECT_CC_MODE will never return MODE for a
   floating point inequality comparison.  */

#define REVERSE_CONDITION(CODE, MODE) \
  ((MODE) == CC_FPmode || (MODE) == CC_FP_EQmode || (MODE) == CC_FP_GTEmode \
   || (MODE) == CC_FP_ORDmode || (MODE) == CC_FP_UNEQmode \
   ? reverse_condition_maybe_unordered (CODE) \
   : (MODE) == CCmode ? reverse_condition (CODE) \
   : UNKNOWN)

/* We can reverse all CCmodes with REVERSE_CONDITION.  */
#define REVERSIBLE_CC_MODE(MODE) \
  ((MODE) == CCmode || (MODE) == CC_FPmode || (MODE) == CC_FP_EQmode \
   || (MODE) == CC_FP_GTEmode || (MODE) == CC_FP_ORDmode \
   || (MODE) == CC_FP_UNEQmode)

/* Costs.  */

/* The cost of a branch insn.  */
/* ??? What's the right value here?  Branches are certainly more
   expensive than reg->reg moves.  */
#define BRANCH_COST(speed_p, predictable_p) \
  (speed_p ? epiphany_branch_cost : 1)

/* Nonzero if access to memory by bytes is slow and undesirable.
   For RISC chips, it means that access to memory by bytes is no
   better than access by words when possible, so grab a whole word
   and maybe make use of that.  */
#define SLOW_BYTE_ACCESS 1

/* Define this macro if it is as good or better to call a constant
   function address than to call an address kept in a register.  */
/* On the EPIPHANY, calling through registers is slow.  */
#define NO_FUNCTION_CSE

/* Section selection.  */
/* WARNING: These section names also appear in dwarf2out.c.  */

#define TEXT_SECTION_ASM_OP	"\t.section .text"
#define DATA_SECTION_ASM_OP	"\t.section .data"

#undef  READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP	"\t.section .rodata"

#define BSS_SECTION_ASM_OP	"\t.section .bss"

/* Define this macro if jump tables (for tablejump insns) should be
   output in the text section, along with the assembler instructions.
   Otherwise, the readonly data section is used.
   This macro is irrelevant if there is no separate readonly data section.  */
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)

/* PIC */

/* The register number of the register used to address a table of static
   data addresses in memory.  In some cases this register is defined by a
   processor's ``application binary interface'' (ABI).  When this macro
   is defined, RTL is generated for this register once, as with the stack
   pointer and frame pointer registers.  If this macro is not defined, it
   is up to the machine-dependent files to allocate such a register (if
   necessary).  */
#define PIC_OFFSET_TABLE_REGNUM  (flag_pic ? PIC_REGNO : INVALID_REGNUM)

/* Control the assembler format that we output.  */

/* A C string constant describing how to begin a comment in the target
   assembler language.  The compiler assumes that the comment will
   end at the end of the line.  */
#define ASM_COMMENT_START ";"

/* Output to assembler file text saying following lines
   may contain character constants, extra white space, comments, etc.  */
#define ASM_APP_ON ""

/* Output to assembler file text saying following lines
   no longer contain unusual constructs.  */
#define ASM_APP_OFF ""

/* Globalizing directive for a label.  */
#define GLOBAL_ASM_OP "\t.global\t"

/* How to refer to registers in assembler output.
   This sequence is indexed by compiler's hard-register-number (see above).  */

#define REGISTER_NAMES							\
{									\
  "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",	\
  "r8",  "r9",  "r10", "fp",  "ip",  "sp",  "lr",  "r15",	\
  "r16",  "r17","r18", "r19", "r20", "r21", "r22", "r23",	\
  "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",	\
  "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",	\
  "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",	\
  "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",	\
  "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",	\
  "ap",  "sfp", "cc1", "cc2",					\
  "config", "status", "lc", "ls", "le", "iret",			\
  "fp_near", "fp_trunc", "fp_anyfp", "unknown"			\
}

#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
  epiphany_final_prescan_insn (INSN, OPVEC, NOPERANDS)

#define LOCAL_LABEL_PREFIX  "."

/* A C expression which evaluates to true if CODE is a valid
   punctuation character for use in the `PRINT_OPERAND' macro.  */
extern char epiphany_punct_chars[256];
#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
  epiphany_punct_chars[(unsigned char) (CHAR)]

/* This is how to output an element of a case-vector that is absolute.  */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
do { \
  if (CASE_VECTOR_MODE == Pmode) \
    asm_fprintf ((FILE), "\t.word %LL%d\n", (VALUE)); \
  else \
    asm_fprintf ((FILE), "\t.short %LL%d\n", (VALUE)); \
} while (0)

/* This is how to output an element of a case-vector that is relative.  */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do {							\
  if (CASE_VECTOR_MODE == Pmode) \
    asm_fprintf ((FILE), "\t.word"); \
  else \
    asm_fprintf ((FILE), "\t.short"); \
  asm_fprintf ((FILE), " %LL%d-%LL%d\n", (VALUE), (REL)); \
} while (0)

/* This is how to output an assembler line
   that says to advance the location counter
   to a multiple of 2**LOG bytes.  */
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)

/* This is how to declare the size of a function.  */
#undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)			\
  do									\
    {									\
      const char *__name = (FNAME);					\
      tree attrs = DECL_ATTRIBUTES ((DECL));				\
									\
      if (!flag_inhibit_size_directive)					\
	{								\
	  if (lookup_attribute ("forwarder_section", attrs))			\
	    {								\
	      const char *prefix = "__forwarder_dst_";			\
	      char *dst_name						\
		= (char *) alloca (strlen (prefix) + strlen (__name) + 1); \
									\
	      strcpy (dst_name, prefix);				\
	      strcat (dst_name, __name);				\
	      __name = dst_name;					\
	    }								\
	  ASM_OUTPUT_MEASURED_SIZE ((FILE), __name);			\
	}								\
    }									\
  while (0)

/* Debugging information.  */

/* Generate DBX and DWARF debugging information.  */
#define DBX_DEBUGGING_INFO 1

#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

/* Turn off splitting of long stabs.  */
#define DBX_CONTIN_LENGTH 0

/* Miscellaneous.  */

/* Specify the machine mode that this machine uses
   for the index in the tablejump instruction.  */
#define CASE_VECTOR_MODE (TARGET_SMALL16 && optimize_size ? HImode : Pmode)

/* Define if operations between registers always perform the operation
   on the full register even if a narrower mode is specified.  */
#define WORD_REGISTER_OPERATIONS

/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
   will either zero-extend or sign-extend.  The value of this macro should
   be the code that says which one of the two operations is implicitly
   done, UNKNOWN if none.  */
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND

/* Max number of bytes we can move from memory to memory
   in one reasonably fast instruction.  */
#define MOVE_MAX 8

/* Define this to be nonzero if shift instructions ignore all but the low-order
   few bits.  */
#define SHIFT_COUNT_TRUNCATED 1

/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
   is done just by pretending it is already truncated.  */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1

/* Specify the machine mode that pointers have.
   After generation of rtl, the compiler makes no further distinction
   between pointers and any other objects of this machine mode.  */

#define Pmode SImode

/* A function address in a call instruction.  */
#define FUNCTION_MODE SImode

/* EPIPHANY function types.  */
enum epiphany_function_type
{
  EPIPHANY_FUNCTION_UNKNOWN, EPIPHANY_FUNCTION_NORMAL,
  EPIPHANY_FUNCTION_INTERRUPT
};

#define EPIPHANY_INTERRUPT_P(TYPE) ((TYPE) == EPIPHANY_FUNCTION_INTERRUPT)

/* Compute the type of a function from its DECL.  */

#define IMMEDIATE_PREFIX "#"

#define OPTIMIZE_MODE_SWITCHING(ENTITY) \
  (epiphany_optimize_mode_switching (ENTITY))

/* We have two fake entities for lazy code motion of the mask constants,
   one entity each for round-to-nearest / truncating
   with a different idea what FP_MODE_ROUND_UNKNOWN will be, and
   finally an entity that runs in a second mode switching pass to
   resolve FP_MODE_ROUND_UNKNOWN.  */
#define NUM_MODES_FOR_MODE_SWITCHING \
  { 2, 2, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE, FP_MODE_NONE }

#define MODE_NEEDED(ENTITY, INSN) epiphany_mode_needed((ENTITY), (INSN))

#define MODE_PRIORITY_TO_MODE(ENTITY, N) \
  (epiphany_mode_priority_to_mode ((ENTITY), (N)))

#define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \
  emit_set_fp_mode ((ENTITY), (MODE), (HARD_REGS_LIVE))

#define MODE_ENTRY(ENTITY) (epiphany_mode_entry_exit ((ENTITY), false))
#define MODE_EXIT(ENTITY) (epiphany_mode_entry_exit ((ENTITY), true))
#define MODE_AFTER(LAST_MODE, INSN) \
  (epiphany_mode_after (e, (LAST_MODE), (INSN)))

#define TARGET_INSERT_MODE_SWITCH_USE epiphany_insert_mode_switch_use

/* Mode switching entities.  */
enum
{
  EPIPHANY_MSW_ENTITY_AND,
  EPIPHANY_MSW_ENTITY_OR,
  EPIPHANY_MSW_ENTITY_NEAREST,
  EPIPHANY_MSW_ENTITY_TRUNC,
  EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN,
  EPIPHANY_MSW_ENTITY_ROUND_KNOWN,
  EPIPHANY_MSW_ENTITY_FPU_OMNIBUS
};

extern int epiphany_normal_fp_rounding;
extern struct rtl_opt_pass pass_mode_switch_use;
extern struct rtl_opt_pass pass_resolve_sw_modes;

/* This will need to be adjusted when FP_CONTRACT_ON is properly
   implemented.  */
#define TARGET_FUSED_MADD (flag_fp_contract_mode == FP_CONTRACT_FAST)

#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
  epiphany_start_function ((FILE), (NAME), (DECL))

#endif /* !GCC_EPIPHANY_H */


text:
using System;
using System.Net;

using SineSignal.Ottoman.Exceptions;
using SineSignal.Ottoman.Http;
using SineSignal.Ottoman.Serialization;

namespace SineSignal.Ottoman.Commands
{
	internal class GetDatabaseCommand : ICouchCommand
	{
		public string Route { get; private set; }
		public string Operation { get; private set; }
		public object Message { get; private set; }
		public HttpStatusCode SuccessStatusCode { get; private set; }

		private string DatabaseName { get; set; }

		public GetDatabaseCommand(string databaseName)
		{
			DatabaseName = databaseName;

			Route = DatabaseName;
			Operation = HttpMethod.Get;
			Message = null;
			SuccessStatusCode = HttpStatusCode.OK;
		}

		public void HandleError(string serverAddress, CommandErrorResult errorResult, UnexpectedHttpResponseException innerException)
		{
			throw new CannotGetDatabaseException(DatabaseName, errorResult, innerException);
		}
	}

	internal class GetDatabaseResult
	{
		[JsonMember("db_name")]
		public string DatabaseName { get; set; }

		[JsonMember("doc_count")]
		public int DocumentCount { get; set; }

		[JsonMember("doc_del_count")]
		public int DeletedDocumentCount { get; set; }

		[JsonMember("update_seq")]
		public int CurrentUpdateCount { get; set; }

		[JsonMember("purge_seq")]
		public int CurrentPurgeCount { get; set; }

		[JsonMember("compact_running")]
		public bool CompactRunning { get; set; }

		[JsonMember("disk_size")]
		public int DiskSize { get; set; }

		[JsonMember("instance_start_time")]
		public string InstanceStartTime { get; set; }

		[JsonMember("disk_format_version")]
		public int DiskFormatVersion { get; set; }

		[JsonMember("committed_update_seq")]
		public int CommittedUpdateSequence { get; set; }
	}
}


text:
require 'active_model'

class CsvUniqnessValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors[attribute] << 'already exists' if record.class.where(attribute => value).count > 1
  end
end


text:
package distsqlrun

import (
	"io"
	"sync"
	"time"

	"golang.org/x/net/context"

	"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
	"github.com/cockroachdb/cockroach/pkg/util/log"
)

const outboxBufRows = 16
const outboxFlushPeriod = 100 * time.Microsecond

// preferredEncoding is the encoding used for EncDatums that don't already have
// an encoding available.
const preferredEncoding = sqlbase.DatumEncoding_ASCENDING_KEY

// outbox implements an outgoing mailbox as a RowReceiver that receives rows and
// sends them to a gRPC stream. Its core logic runs in a goroutine. We send rows
// when we accumulate outboxBufRows or every outboxFlushPeriod (whichever comes
// first).
type outbox struct {
	// RowChannel implements the RowReceiver interface.
	RowChannel

	flowCtx *FlowCtx
	addr    string
	// The rows received from the RowChannel will be forwarded on this stream once
	// it is established.
	stream DistSQL_FlowStreamClient

	// syncFlowStream is set if we are outputting to a sync flow stream; in
	// that case addr and stream will not be set.
	syncFlowStream DistSQL_RunSyncFlowServer

	encoder StreamEncoder
	// numRows is the number of rows that have been accumulated in the encoder.
	numRows int

	err error
	wg  *sync.WaitGroup
}

var _ RowReceiver = &outbox{}

func newOutbox(flowCtx *FlowCtx, addr string, flowID FlowID, streamID StreamID) *outbox {
	m := &outbox{flowCtx: flowCtx, addr: addr}
	m.encoder.setHeaderFields(flowID, streamID)
	return m
}

// newOutboxSyncFlowStream sets up an outbox for the special "sync flow"
// stream. The flow context should be provided via setFlowCtx when it is
// available.
func newOutboxSyncFlowStream(stream DistSQL_RunSyncFlowServer) *outbox {
	return &outbox{syncFlowStream: stream}
}

func (m *outbox) setFlowCtx(flowCtx *FlowCtx) {
	m.flowCtx = flowCtx
}

// addRow encodes a row into rowBuf. If enough rows were accumulated, flush() is
// called.
//
// If an error is returned, the outbox's stream might or might not be usable; if
// it's not usable, it will have been set to nil. The error might be a
// communication error, in which case the other side of the stream should get it
// too, or it might be an encoding error, in which case we've forwarded it on
// the stream.
func (m *outbox) addRow(ctx context.Context, row sqlbase.EncDatumRow, meta ProducerMetadata) error {
	mustFlush := false
	var encodingErr error
	if !meta.Empty() {
		m.encoder.AddMetadata(meta)
		// If we hit an error, let's forward it ASAP. The consumer will probably
		// close.
		mustFlush = meta.Err != nil
	} else {
		encodingErr = m.encoder.AddRow(row)
		if encodingErr != nil {
			m.encoder.AddMetadata(ProducerMetadata{Err: encodingErr})
			mustFlush = true
		}
	}
	m.numRows++
	var flushErr error
	if m.numRows >= outboxBufRows || mustFlush {
		flushErr = m.flush(ctx)
	}
	if encodingErr != nil {
		return encodingErr
	}
	return flushErr
}

// flush sends the rows accumulated so far in a ProducerMessage. Any error
// returned indicates that sending a message on the outbox's stream failed, and
// thus the stream can't be used any more. The stream is also set to nil if
// an error is returned.
func (m *outbox) flush(ctx context.Context) error {
	if m.numRows == 0 && m.encoder.headerSent {
		return nil
	}
	msg := m.encoder.FormMessage(ctx)

	if log.V(3) {
		log.Infof(ctx, "flushing outbox")
	}
	var sendErr error
	if m.stream != nil {
		sendErr = m.stream.Send(msg)
	} else {
		sendErr = m.syncFlowStream.Send(msg)
	}
	if sendErr != nil {
		// Make sure the stream is not used any more.
		m.stream = nil
		m.syncFlowStream = nil
		if log.V(1) {
			log.Errorf(ctx, "outbox flush error: %s", sendErr)
		}
	} else if log.V(3) {
		log.Infof(ctx, "outbox flushed")
	}
	if sendErr != nil {
		return sendErr
	}

	m.numRows = 0
	return nil
}

// mainLoop reads from m.RowChannel and writes to the output stream through
// addRow()/flush() until the producer doesn't have any more data to send or an
// error happened.
//
// If the consumer asks the producer to drain, mainLoop() will relay this
// information and, again, wait until the producer doesn't have any more data to
// send (the producer is supposed to only send trailing metadata once it
// receives this signal).
//
// If an error is returned, it's either a communication error from the outbox's
// stream, or otherwise the error has already been forwarded on the stream.
// Depending on the specific error, the stream might or might not need to be
// closed. In case it doesn't, m.stream (and also m.syncFlowStream) have been
// set to nil.
func (m *outbox) mainLoop(ctx context.Context) error {
	if m.syncFlowStream == nil {
		conn, err := m.flowCtx.rpcCtx.GRPCDial(m.addr)
		if err != nil {
			return err
		}
		client := NewDistSQLClient(conn)
		if log.V(2) {
			log.Infof(ctx, "outbox: calling FlowStream")
		}
		m.stream, err = client.FlowStream(context.TODO())
		if err != nil {
			if log.V(1) {
				log.Infof(ctx, "FlowStream error: %s", err)
			}
			return err
		}
		if log.V(2) {
			log.Infof(ctx, "outbox: FlowStream returned")
		}
	}

	// TODO(andrei): It's unfortunate that we're spawning a goroutine for every
	// outgoing stream, but I'm not sure what to do instead. The streams don't
	// have a non-blocking API. We could start this goroutine only after a
	// timeout, but that timeout would affect queries that use flows with
	// LimitHint's (so, queries where the consumer is expected to quickly ask the
	// producer to drain). Perhaps what we want is a way to tell when all the rows
	// corresponding to the first KV batch have been sent and only start the
	// goroutine if more batches are needed to satisfy the query.
	drainCh := m.waitForDrainSignalFromConsumer()

	flushTicker := time.NewTicker(outboxFlushPeriod)
	defer flushTicker.Stop()

	draining := false
	defer func() {
		m.RowChannel.ConsumerClosed()
	}()

	if m.stream != nil {
		// Send a first message that will contain the header (i.e. the StreamID), so
		// that the stream is properly initialized on the consumer. The consumer has
		// a timeout in which inbound streams must be established.
		if err := m.flush(ctx); err != nil {
			return err
		}
	}

	for {
		select {
		case msg, ok := <-m.RowChannel.C:
			if !ok {
				// No more data.
				return m.flush(ctx)
			}
			if !draining || !msg.Meta.Empty() {
				// If we're draining, we ignore all the rows and just send metadata.
				err := m.addRow(ctx, msg.Row, msg.Meta)
				if err != nil {
					return err
				}
			}
		case <-flushTicker.C:
			err := m.flush(ctx)
			if err != nil {
				return err
			}
		case drainSignal := <-drainCh:
			if drainSignal.err != nil {
				// The consumer either doesn't care any more (it returned from the
				// FlowStream RPC with an error if the outbox established the stream or
				// it cancelled the client context if the consumer established the
				// stream through a RunSyncFlow RPC), or there was a communication error
				// and the stream is dead. In any case, the stream has been closed and
				// the consumer will not consume more rows from this outbox. Make sure
				// the stream is not used any more.
				m.stream = nil
				m.syncFlowStream = nil
				return drainSignal.err
			}
			drainCh = nil
			if drainSignal.drainRequested {
				// Enter draining mode.
				draining = true
				m.RowChannel.ConsumerDone()
			} else {
				// No draining required. We're done; no need to consume any more.
				// m.RowChannel.ConsumerClosed() is called in a defer above.
				return nil
			}
		}
	}
}

// drainSignal is a signal received from the consumer telling the producer that
// it doesn't need any more rows and optionally asking the producer to drain.
type drainSignal struct {
	// drainRequested, if set, means that the consumer is interested in the
	// trailing metadata that the producer might have. If not set, the producer
	// should close immediately (the consumer is probably gone by now).
	drainRequested bool
	// err, if set, is either the error that the consumer returned when closing
	// the FlowStream RPC or a communication error.
	err error
}

// waitForDrainSignalFromConsumer returns a channel that will be pinged once the
// consumer has closed its send-side of the stream, or has sent a drain signal.
func (m *outbox) waitForDrainSignalFromConsumer() <-chan drainSignal {
	ch := make(chan drainSignal, 1)

	go func(
		stream DistSQL_FlowStreamClient,
		syncFlowStream DistSQL_RunSyncFlowServer,
	) {
		var signal *ConsumerSignal
		var err error
		if stream != nil {
			signal, err = stream.Recv()
		} else {
			signal, err = syncFlowStream.Recv()
		}
		if err == io.EOF {
			ch <- drainSignal{drainRequested: false, err: nil}
			return
		}
		if err != nil {
			ch <- drainSignal{drainRequested: false, err: err}
			return
		}
		ch <- drainSignal{drainRequested: signal.DrainRequest != nil, err: nil}
	}(m.stream, m.syncFlowStream)
	return ch
}

func (m *outbox) run(ctx context.Context) {
	err := m.mainLoop(ctx)
	if m.stream != nil {
		closeErr := m.stream.CloseSend()
		if err == nil {
			err = closeErr
		}
	}
	m.err = err
	if m.wg != nil {
		m.wg.Done()
	}
}

func (m *outbox) start(ctx context.Context, wg *sync.WaitGroup) {
	m.wg = wg
	m.RowChannel.Init(nil)
	go m.run(ctx)
}


text:
// $Id: condor_userlog_job_counter.C,v 1.3 2007-11-07 23:21:24 nleroy Exp $
//
// given a userlog, returns the number of queued (e.g., submitted but
// not yet terminated or aborted) jobs found from 0 to 254, or 255 to
// indicate an error (e.g., a userlog reading/parsing error, no events
// found, a job count <0 or >254, improper usage, etc.)

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include "read_user_log.h"

int main( int argc, char** argv )
{
	if( argc != 2 ) {
		fprintf( stderr, "usage: %s file\n", argv[0] );
		return 255;
	}

	bool done = false;
	bool seenJob = false;
	int numJobs = 0;
	ReadUserLog ru( argv[1] );
    ULogEvent* e = NULL;

	while( !done ) {

        ULogEventOutcome outcome = ru.readEvent( e );
		const char *eventName = NULL;

        switch (outcome) {

        case ULOG_NO_EVENT:
        case ULOG_RD_ERROR:
        case ULOG_UNK_ERROR:

			printf( "Log outcome: %s\n", ULogEventOutcomeNames[outcome] );
			done = true;
			break;

        case ULOG_OK:

            eventName = ULogEventNumberNames[e->eventNumber];

			switch( e->eventNumber ) {

			case ULOG_SUBMIT:
				seenJob = true;
				printf( "Log event: %s\n", eventName );
				numJobs++;
				printf( "Queued Jobs: %d\n", numJobs );
				break;

			case ULOG_JOB_TERMINATED:
			case ULOG_JOB_ABORTED:
				printf( "Log event: %s\n", eventName );
				numJobs--;
				printf( "Queued Jobs: %d\n", numJobs );
				break;

			default:
				break;
			}

			break;

		default:

			return 255;
        }
	}
	return (seenJob && numJobs >= 0 && numJobs < 255) ? numJobs : 255;
}


text:
package regex;

import java.util.ArrayList;
import java.util.Map;

public interface NFA extends FSAutomaton {
    //region Data formatting
    NFA tablify();
    Map<FSANode, Map<RegExPrimitive, ArrayList<FSANode>>> getTransitionTable();
    //endregion

    //region NFA modification
    void merge(NFA nfa, int i);
    NFA kleeneWrap();
    DFA generateDFA();
    //endregion

    void addStringToTerminal(String s);

    //region Printing
    /**
     * Prints the transition state table to the console.
     */
    default void printTable() {
        Map<FSANode, Map<RegExPrimitive, ArrayList<FSANode>>> table = getTransitionTable();
        System.out.println("/************************NFA STATE TABLE************************/");
        for (FSANode k : table.keySet()) {
            System.out.println("Source state: " + k);
            if (k.getIndex() == this.getHead().getIndex()) {
                System.out.println("\tHEAD");
            } else if (k.getIndex() == this.getTerminals().iterator().next().getIndex()){
                System.out.println("\tTERMINAL");
            }
            for (RegExPrimitive cond : table.get(k).keySet()) {
                System.out.println("\tCondition: " + cond.generateString() + ", Target states: " + table.get(k).get(cond));
                for (FSANode node : table.get(k).get(cond)) {
                    System.out.println("\t\t" + node + " Lookarounds: " +  node.countLookArounds());
                }
            }
        }
        System.out.println("/**********************NFA STATE TABLE END**********************/");
    }
    //endregion
}


text:
package ['etcd', 'haproxy', 'golang'] do
  action :install
end

cookbook_file '/etc/etcd/etcd.conf' do
  source 'etcd.conf'
  owner 'root'
  group 'root'
  mode '0644'
  action :create
end

service 'etcd' do
  action [:enable, :start]
end

template '/etc/haproxy/haproxy.cfg' do
  source 'haproxy.cfg.rb'
  owner 'root'
  group 'root'
  mode '0644'
  action :create
end

script 'etcd_configuration' do
  interpreter 'bash'
  code <<-EOF
    docker run -d -p 5000:5000 --restart always registry:2
    etcdctl mkdir /kubecluster/network
    etcdctl mk /kubecluster/network/config "{\"Network\": \"172.30.0.0/16\", \"SubnetLen\": 24, \"Backend\": { \"Type\": \"vxlan\"}}"
    etcdctl set /kubecluster/network/config "{\"Network\": \"172.30.0.0/16\", \"SubnetLen\": 24, \"Backend\": { \"Type\": \"vxlan\"}}"
    touch /usr/local/etcd.ok
    EOF
  action :run
  not_if { ::File.exist?('/usr/local/etcd.ok') }
end

service 'haproxy' do
  action [:enable, :restart]
end


text:
package com.kishan.repository;

import com.mysema.query.jpa.impl.JPADeleteClause;
import com.mysema.query.jpa.impl.JPAQuery;
import com.mysema.query.types.EntityPath;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public abstract class AbstractRepository {

    @PersistenceContext
    protected EntityManager entityManager;

    public JPAQuery from(EntityPath<?>... paths) {
        return new JPAQuery(entityManager).from(paths);
    }

    public JPADeleteClause delete(EntityPath<?> path) {
        return new JPADeleteClause(entityManager, path);
    }
}