Skip to content

Instantly share code, notes, and snippets.

View angerman's full-sized avatar
🇸🇬

Moritz Angermann angerman

🇸🇬
View GitHub Profile
@angerman
angerman / hetzner-dedicated-wipe-and-install-nixos.sh
Created December 8, 2019 02:49 — forked from nh2/hetzner-dedicated-wipe-and-install-nixos.sh
Example script to install NixOS on a Hetzner dedicated server via the Hetzner rescue mode
#!/usr/bin/env bash
# Installs NixOS on a Hetzner server, wiping the server.
#
# This is for a specific server configuration; adjust where needed.
#
# Prerequisites:
# * Update the script to adjust SSH pubkeys, hostname, NixOS version etc.
#
# Usage:
{ pkgs ? import <nixpkgs> {}
}:
let
overrideWith = override: default:
let
try = builtins.tryEval (builtins.findFile builtins.nixPath override);
in if try.success then
builtins.trace "using search host <${override}>" try.value
else
default;
{-# LINE 1 "libraries/base/GHC/Event/Poll.hsc" #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE GeneralizedNewtypeDeriving
, NoImplicitPrelude
, BangPatterns
#-}
module GHC.Event.Poll
(
new
; ModuleID = '<stdin>'
source_filename = "Main.ll"
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "arm-unknown-linux-gnueabihf"
@.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@Main_f_closure = local_unnamed_addr global { i32 } { i32 ptrtoint (void (i32*, i32*, i32*, i32, i32, i32, i32, i32)* @Main_f_info to i32) }
@Main_zdtrModule4_bytes = global { [5 x i8] } { [5 x i8] c"main\00" }
@Main_zdtrModule3_closure = global { i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_TrNameS_con_info to i32), i32 ptrtoint ({ [5 x i8] }* @Main_zdtrModule4_bytes to i32) }
; ModuleID = '<stdin>'
source_filename = "Main.ll"
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "arm-unknown-linux-gnueabihf"
@Main_f_closure = local_unnamed_addr global { i32 } { i32 ptrtoint (void (i32*, i32*, i32*, i32, i32, i32, i32, i32)* @Main_f_info to i32) }
@Main_zdtrModule4_bytes = global { [5 x i8] } { [5 x i8] c"main\00" }
@Main_zdtrModule3_closure = global { i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_TrNameS_con_info to i32), i32 ptrtoint ({ [5 x i8] }* @Main_zdtrModule4_bytes to i32) }
@Main_zdtrModule2_bytes = global { [5 x i8] } { [5 x i8] c"Main\00" }
@Main_zdtrModule1_closure = global { i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_TrNameS_con_info to i32), i32 ptrtoint ({ [5 x i8] }* @Main_zdtrModule2_bytes to i32) }
; ModuleID = '<stdin>'
source_filename = "Main.ll"
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "arm-unknown-linux-gnueabihf"
@r2Pd_bytes = private global { [5 x i8] } { [5 x i8] c"main\00" }
@r2Ps_closure = private global { i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_TrNameS_con_info to i32), i32 ptrtoint ({ [5 x i8] }* @r2Pd_bytes to i32) }
@r2Pt_bytes = private global { [5 x i8] } { [5 x i8] c"Main\00" }
@r2Pu_closure = private global { i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_TrNameS_con_info to i32), i32 ptrtoint ({ [5 x i8] }* @r2Pt_bytes to i32) }
@Main_zdtrModule_closure = local_unnamed_addr global { i32, i32, i32, i32 } { i32 ptrtoint (i32* @ghczmprim_GHCziTypes_Module_con_info to i32), i32 add (i32 ptrtoint ({ i32, i32 }* @r2Ps_closure to i32), i32 1), i32 add (i32 ptrtoint ({ i32, i32 }* @r2Pu_closure to i32), i32 1), i32 3 }
==================== Tidy Core ====================
2017-11-28 12:35:17.812664 UTC
Result size of Tidy Core
= {terms: 121, types: 172, coercions: 9, joins: 0/0}
-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
f [InlPrag=NOINLINE] :: forall a. a -> a
[GblId,
==================== Tidy Core ====================
2017-11-28 12:34:31.425861 UTC
Result size of Tidy Core
= {terms: 51, types: 32, coercions: 0, joins: 0/0}
-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
f_rqh :: forall a. a -> a
[GblId, Arity=1, Caf=NoCafRefs]
{-# LANGUAGE MagicHash, BangPatterns #-}
module Main where
import GHC.Exts
{-# NOINLINE f #-}
f :: (Int# -> Float# -> Double# -> Float# -> Double# -> String) -> String
f g = g 3# 4.0# 5.0## 6.0# 6.9## ++ " World!"
{-# NOINLINE p #-}
@angerman
angerman / helloBranch
Created July 28, 2016 14:13
Haskellish disassembly of an LLVM module.
Module
Version 1
Triple
Datalayout
Globals
0 : @.str :: [16 x i8]*
1 : @.str.1 :: [13 x i8]*
2 : @str :: [12 x i8]*
3 : \main :: ((i32, i8**) -> i32)*
4 : \printf :: ((i8*, ...) -> i32)*