Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@angerman
Created August 18, 2016 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angerman/d87db1657aac4e06a0886801aaf44329 to your computer and use it in GitHub Desktop.
Save angerman/d87db1657aac4e06a0886801aaf44329 to your computer and use it in GitHub Desktop.
; ModuleID = '<stdin>'
@ghczmprim_GHCziTypes_Module_static_info = external constant i64
@ghczmprim_GHCziCString_unpackCStringzh_closure = external constant i64
@base_SystemziIO_putStrLn_closure = external constant i64
@base_GHCziTopHandler_runMainIO_closure = external constant i64
@ghczmprim_GHCziTypes_TrNameS_static_info = external constant i64
@stg_bh_upd_frame_info = external constant i64
@Main_main_closure = constant { i64, i64, i64, i64 } { i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @Main_main_info to i64), i64 0, i64 0, i64 0 }
@Main_zdtrModule_closure = constant { i64, i64, i64, i64 } { i64 ptrtoint (i64* @ghczmprim_GHCziTypes_Module_static_info to i64), i64 add (i64 ptrtoint ({ i64, i64 }* @rBM_closure to i64), i64 1), i64 add (i64 ptrtoint ({ i64, i64 }* @rC0_closure to i64), i64 1), i64 3 }
@SLC_srt = constant { i64, i64, i64, i64, i64 } { i64 ptrtoint (i64* @ghczmprim_GHCziCString_unpackCStringzh_closure to i64), i64 ptrtoint (i64* @base_SystemziIO_putStrLn_closure to i64), i64 ptrtoint ({ i64, i64, i64, i64 }* @sLr_closure to i64), i64 ptrtoint (i64* @base_GHCziTopHandler_runMainIO_closure to i64), i64 ptrtoint ({ i64, i64, i64, i64 }* @Main_main_closure to i64) }
@ZCMain_main_closure = constant { i64, i64, i64, i64 } { i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @ZCMain_main_info to i64), i64 0, i64 0, i64 0 }
@__stginit_Main = constant {} zeroinitializer
@cLY_str = constant { [5 x i8] } { [5 x i8] c"main\00" }
@cLy_str = constant { [12 x i8] } { [12 x i8] c"Hello World\00" }
@cM0_str = constant { [5 x i8] } { [5 x i8] c"Main\00" }
@rBM_closure = constant { i64, i64 } { i64 ptrtoint (i64* @ghczmprim_GHCziTypes_TrNameS_static_info to i64), i64 ptrtoint ({ [5 x i8] }* @cLY_str to i64) }
@rC0_closure = constant { i64, i64 } { i64 ptrtoint (i64* @ghczmprim_GHCziTypes_TrNameS_static_info to i64), i64 ptrtoint ({ [5 x i8] }* @cM0_str to i64) }
@sLr_closure = constant { i64, i64, i64, i64 } { i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @sLr_info to i64), i64 0, i64 0, i64 0 }
declare ghccc void @stg_ap_p_fast(i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)
declare ghccc void @stg_ap_n_fast(i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)
declare i8* @newCAF(i8*, i8*)
define ghccc void @sLr_info(i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double) prefix { i64, i64, i64 } { i64 sub (i64 ptrtoint ({ i64, i64, i64, i64, i64 }* @SLC_srt to i64), i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @sLr_info to i64)), i64 0, i64 4294967318 } {
%23 = alloca i64*
store i64* %0, i64** %23
%24 = alloca i64*
store i64* %1, i64** %24
%25 = alloca i64*
store i64* %2, i64** %25
%26 = alloca i64
store i64 %3, i64* %26
%27 = alloca i64
store i64 %4, i64* %27
%28 = alloca i64
store i64 %5, i64* %28
%29 = alloca i64
store i64 %6, i64* %29
%30 = alloca i64
store i64 %7, i64* %30
%31 = alloca i64
store i64 %8, i64* %31
%32 = alloca i64
store i64 %9, i64* %32
%33 = alloca float
store float %10, float* %33
%34 = alloca double
store double %11, double* %34
%35 = alloca float
store float %12, float* %35
%36 = alloca double
store double %13, double* %36
%37 = alloca float
store float %14, float* %37
%38 = alloca double
store double %15, double* %38
%39 = alloca float
store float %16, float* %39
%40 = alloca double
store double %17, double* %40
%41 = alloca float
store float %18, float* %41
%42 = alloca double
store double %19, double* %42
%43 = alloca float
store float %20, float* %43
%44 = alloca double
store double %21, double* %44
%45 = alloca i64
%46 = alloca i64
%47 = load i64, i64* %26
store i64 %47, i64* %46
%48 = load i64*, i64** %24
%49 = getelementptr inbounds i64, i64* %48, i32 1
%50 = ptrtoint i64* %49 to i64
%51 = sub i64 %50, 24
%52 = load i64, i64* %32
%53 = icmp ult i64 %51, %52
br i1 %53, label %88, label %54
; <label>:54 ; preds = %22
%55 = load i64*, i64** %23
%56 = load i64, i64* %46
%57 = bitcast i64* %55 to i8*
%58 = inttoptr i64 %56 to i8*
%59 = call i8* @newCAF(i8* %57, i8* %58)
%60 = ptrtoint i8* %59 to i64
store i64 %60, i64* %45
%61 = load i64, i64* %45
%62 = icmp eq i64 %61, 0
br i1 %62, label %80, label %63
; <label>:63 ; preds = %54
%64 = ptrtoint i64* @stg_bh_upd_frame_info to i64
%65 = load i64*, i64** %24
%66 = getelementptr inbounds i64, i64* %65, i32 -2
store i64 %64, i64* %66
%67 = load i64, i64* %45
%68 = load i64*, i64** %24
%69 = getelementptr inbounds i64, i64* %68, i32 -1
store i64 %67, i64* %69
%70 = ptrtoint { [12 x i8] }* @cLy_str to i64
store i64 %70, i64* %27
%71 = ptrtoint i64* @ghczmprim_GHCziCString_unpackCStringzh_closure to i64
store i64 %71, i64* %26
%72 = load i64*, i64** %24
%73 = getelementptr inbounds i64, i64* %72, i32 -2
store i64* %73, i64** %24
%74 = load i64*, i64** %23
%75 = load i64*, i64** %24
%76 = load i64*, i64** %25
%77 = load i64, i64* %26
%78 = load i64, i64* %27
%79 = load i64, i64* %32
tail call ghccc void @stg_ap_n_fast(i64* %74, i64* %75, i64* %76, i64 %77, i64 %78, i64 undef, i64 undef, i64 undef, i64 undef, i64 %79)
ret void
; <label>:80 ; preds = %54
%81 = load i64, i64* %46
%82 = inttoptr i64 %81 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%83 = load i64*, i64** %23
%84 = load i64*, i64** %24
%85 = load i64*, i64** %25
%86 = load i64, i64* %26
%87 = load i64, i64* %32
tail call ghccc void %82(i64* %83, i64* %84, i64* %85, i64 %86, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %87)
ret void
; <label>:88 ; preds = %22
%89 = load i64, i64* %46
store i64 %89, i64* %26
%90 = getelementptr inbounds i64*, i64** %23, i32 -2
%91 = bitcast i64** %90 to i64*
%92 = load i64, i64* %91
%93 = inttoptr i64 %92 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%94 = load i64*, i64** %23
%95 = load i64*, i64** %24
%96 = load i64*, i64** %25
%97 = load i64, i64* %26
%98 = load i64, i64* %32
tail call ghccc void %93(i64* %94, i64* %95, i64* %96, i64 %97, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %98)
ret void
}
define ghccc void @Main_main_info(i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double) prefix { i64, i64, i64 } { i64 add (i64 sub (i64 ptrtoint ({ i64, i64, i64, i64, i64 }* @SLC_srt to i64), i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @Main_main_info to i64)), i64 8), i64 0, i64 12884901910 } {
%23 = alloca i64*
store i64* %0, i64** %23
%24 = alloca i64*
store i64* %1, i64** %24
%25 = alloca i64*
store i64* %2, i64** %25
%26 = alloca i64
store i64 %3, i64* %26
%27 = alloca i64
store i64 %4, i64* %27
%28 = alloca i64
store i64 %5, i64* %28
%29 = alloca i64
store i64 %6, i64* %29
%30 = alloca i64
store i64 %7, i64* %30
%31 = alloca i64
store i64 %8, i64* %31
%32 = alloca i64
store i64 %9, i64* %32
%33 = alloca float
store float %10, float* %33
%34 = alloca double
store double %11, double* %34
%35 = alloca float
store float %12, float* %35
%36 = alloca double
store double %13, double* %36
%37 = alloca float
store float %14, float* %37
%38 = alloca double
store double %15, double* %38
%39 = alloca float
store float %16, float* %39
%40 = alloca double
store double %17, double* %40
%41 = alloca float
store float %18, float* %41
%42 = alloca double
store double %19, double* %42
%43 = alloca float
store float %20, float* %43
%44 = alloca double
store double %21, double* %44
%45 = alloca i64
%46 = alloca i64
%47 = load i64, i64* %26
store i64 %47, i64* %46
%48 = load i64*, i64** %24
%49 = getelementptr inbounds i64, i64* %48, i32 1
%50 = ptrtoint i64* %49 to i64
%51 = sub i64 %50, 24
%52 = load i64, i64* %32
%53 = icmp ult i64 %51, %52
br i1 %53, label %88, label %54
; <label>:54 ; preds = %22
%55 = load i64*, i64** %23
%56 = load i64, i64* %46
%57 = bitcast i64* %55 to i8*
%58 = inttoptr i64 %56 to i8*
%59 = call i8* @newCAF(i8* %57, i8* %58)
%60 = ptrtoint i8* %59 to i64
store i64 %60, i64* %45
%61 = load i64, i64* %45
%62 = icmp eq i64 %61, 0
br i1 %62, label %80, label %63
; <label>:63 ; preds = %54
%64 = ptrtoint i64* @stg_bh_upd_frame_info to i64
%65 = load i64*, i64** %24
%66 = getelementptr inbounds i64, i64* %65, i32 -2
store i64 %64, i64* %66
%67 = load i64, i64* %45
%68 = load i64*, i64** %24
%69 = getelementptr inbounds i64, i64* %68, i32 -1
store i64 %67, i64* %69
%70 = ptrtoint { i64, i64, i64, i64 }* @sLr_closure to i64
store i64 %70, i64* %27
%71 = ptrtoint i64* @base_SystemziIO_putStrLn_closure to i64
store i64 %71, i64* %26
%72 = load i64*, i64** %24
%73 = getelementptr inbounds i64, i64* %72, i32 -2
store i64* %73, i64** %24
%74 = load i64*, i64** %23
%75 = load i64*, i64** %24
%76 = load i64*, i64** %25
%77 = load i64, i64* %26
%78 = load i64, i64* %27
%79 = load i64, i64* %32
tail call ghccc void @stg_ap_p_fast(i64* %74, i64* %75, i64* %76, i64 %77, i64 %78, i64 undef, i64 undef, i64 undef, i64 undef, i64 %79)
ret void
; <label>:80 ; preds = %54
%81 = load i64, i64* %46
%82 = inttoptr i64 %81 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%83 = load i64*, i64** %23
%84 = load i64*, i64** %24
%85 = load i64*, i64** %25
%86 = load i64, i64* %26
%87 = load i64, i64* %32
tail call ghccc void %82(i64* %83, i64* %84, i64* %85, i64 %86, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %87)
ret void
; <label>:88 ; preds = %22
%89 = load i64, i64* %46
store i64 %89, i64* %26
%90 = getelementptr inbounds i64*, i64** %23, i32 -2
%91 = bitcast i64** %90 to i64*
%92 = load i64, i64* %91
%93 = inttoptr i64 %92 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%94 = load i64*, i64** %23
%95 = load i64*, i64** %24
%96 = load i64*, i64** %25
%97 = load i64, i64* %26
%98 = load i64, i64* %32
tail call ghccc void %93(i64* %94, i64* %95, i64* %96, i64 %97, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %98)
ret void
}
define ghccc void @ZCMain_main_info(i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double) prefix { i64, i64, i64 } { i64 add (i64 sub (i64 ptrtoint ({ i64, i64, i64, i64, i64 }* @SLC_srt to i64), i64 ptrtoint (void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64, float, double, float, double, float, double, float, double, float, double, float, double)* @ZCMain_main_info to i64)), i64 24), i64 0, i64 12884901910 } {
%23 = alloca i64*
store i64* %0, i64** %23
%24 = alloca i64*
store i64* %1, i64** %24
%25 = alloca i64*
store i64* %2, i64** %25
%26 = alloca i64
store i64 %3, i64* %26
%27 = alloca i64
store i64 %4, i64* %27
%28 = alloca i64
store i64 %5, i64* %28
%29 = alloca i64
store i64 %6, i64* %29
%30 = alloca i64
store i64 %7, i64* %30
%31 = alloca i64
store i64 %8, i64* %31
%32 = alloca i64
store i64 %9, i64* %32
%33 = alloca float
store float %10, float* %33
%34 = alloca double
store double %11, double* %34
%35 = alloca float
store float %12, float* %35
%36 = alloca double
store double %13, double* %36
%37 = alloca float
store float %14, float* %37
%38 = alloca double
store double %15, double* %38
%39 = alloca float
store float %16, float* %39
%40 = alloca double
store double %17, double* %40
%41 = alloca float
store float %18, float* %41
%42 = alloca double
store double %19, double* %42
%43 = alloca float
store float %20, float* %43
%44 = alloca double
store double %21, double* %44
%45 = alloca i64
%46 = alloca i64
%47 = load i64, i64* %26
store i64 %47, i64* %45
%48 = load i64*, i64** %24
%49 = getelementptr inbounds i64, i64* %48, i32 1
%50 = ptrtoint i64* %49 to i64
%51 = sub i64 %50, 24
%52 = load i64, i64* %32
%53 = icmp ult i64 %51, %52
br i1 %53, label %88, label %54
; <label>:54 ; preds = %22
%55 = load i64*, i64** %23
%56 = load i64, i64* %45
%57 = bitcast i64* %55 to i8*
%58 = inttoptr i64 %56 to i8*
%59 = call i8* @newCAF(i8* %57, i8* %58)
%60 = ptrtoint i8* %59 to i64
store i64 %60, i64* %46
%61 = load i64, i64* %46
%62 = icmp eq i64 %61, 0
br i1 %62, label %80, label %63
; <label>:63 ; preds = %54
%64 = ptrtoint i64* @stg_bh_upd_frame_info to i64
%65 = load i64*, i64** %24
%66 = getelementptr inbounds i64, i64* %65, i32 -2
store i64 %64, i64* %66
%67 = load i64, i64* %46
%68 = load i64*, i64** %24
%69 = getelementptr inbounds i64, i64* %68, i32 -1
store i64 %67, i64* %69
%70 = ptrtoint { i64, i64, i64, i64 }* @Main_main_closure to i64
store i64 %70, i64* %27
%71 = ptrtoint i64* @base_GHCziTopHandler_runMainIO_closure to i64
store i64 %71, i64* %26
%72 = load i64*, i64** %24
%73 = getelementptr inbounds i64, i64* %72, i32 -2
store i64* %73, i64** %24
%74 = load i64*, i64** %23
%75 = load i64*, i64** %24
%76 = load i64*, i64** %25
%77 = load i64, i64* %26
%78 = load i64, i64* %27
%79 = load i64, i64* %32
tail call ghccc void @stg_ap_p_fast(i64* %74, i64* %75, i64* %76, i64 %77, i64 %78, i64 undef, i64 undef, i64 undef, i64 undef, i64 %79)
ret void
; <label>:80 ; preds = %54
%81 = load i64, i64* %45
%82 = inttoptr i64 %81 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%83 = load i64*, i64** %23
%84 = load i64*, i64** %24
%85 = load i64*, i64** %25
%86 = load i64, i64* %26
%87 = load i64, i64* %32
tail call ghccc void %82(i64* %83, i64* %84, i64* %85, i64 %86, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %87)
ret void
; <label>:88 ; preds = %22
%89 = load i64, i64* %45
store i64 %89, i64* %26
%90 = getelementptr inbounds i64*, i64** %23, i32 -2
%91 = bitcast i64** %90 to i64*
%92 = load i64, i64* %91
%93 = inttoptr i64 %92 to void (i64*, i64*, i64*, i64, i64, i64, i64, i64, i64, i64)*
%94 = load i64*, i64** %23
%95 = load i64*, i64** %24
%96 = load i64*, i64** %25
%97 = load i64, i64* %26
%98 = load i64, i64* %32
tail call ghccc void %93(i64* %94, i64* %95, i64* %96, i64 %97, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 %98)
ret void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment