Skip to content

Instantly share code, notes, and snippets.

@Bulat-Ziganshin
Created June 16, 2018 03:04
Show Gist options
  • Save Bulat-Ziganshin/4c6034958b6de33400acc3d541ce626a to your computer and use it in GitHub Desktop.
Save Bulat-Ziganshin/4c6034958b6de33400acc3d541ce626a to your computer and use it in GitHub Desktop.
Example of C code produced by GHC 6
/* GHC_PACKAGES base rts
*/
#include "Stg.h"
#include "HsBase.h"
START_MOD_INIT(__stginit_Main,__stginit_Main_)
EF_(__stginit_SystemziEnvironment_);
EF_(__stginit_SystemziIOziUnsafe_);
EF_(__stginit_DataziChar_);
EF_(__stginit_Prelude_);
REGISTER_IMPORT(__stginit_SystemziEnvironment_);
REGISTER_IMPORT(__stginit_SystemziIOziUnsafe_);
REGISTER_IMPORT(__stginit_DataziChar_);
REGISTER_IMPORT(__stginit_Prelude_);
END_MOD_INIT()
EF_(__stginit_Main);
FN_(__stginit_ZCMain) {
FB_
JMP_(__stginit_Main);
FE_
}
EC_(GHCziBase_chr_closure);
SRT(Main_encodeInt_srt)
&GHCziBase_chr_closure};
SET_STATIC_HDR(Main_encodeInt_closure,Main_encodeInt_info,0,,EI_)
, {(L_)0}
};
static StgWord s44s_info[] = {
(W_)(0x0),(W_)(0x24)
};
EI_(GHCziBase_Izh_con_info);
IF_(s44s_ret) {
FB_
HP_CHK_UNBX_R1(2,);
SET_HDR_(Hp-1,(P_)&GHCziBase_Izh_con_info,0,0);
*Hp=(W_)(R1.i);
R1.p=Hp-1;
Sp=Sp+1;
JMP_(ENTRY_CODE((P_)&stg_upd_frame_info));
FE_
}
static StgWord s45R_info[] = {
(W_)(0x0),(W_)(0x24)
};
EF_(GHCziBase_divIntzh_entry);
IF_(s45R_ret) {
FB_
Sp[-1]=(W_)(65536);
Sp[-2]=(W_)(R1.p[1]);
*Sp=(W_)((P_)&s44s_info);
Sp=Sp-2;
JMP_(GHCziBase_divIntzh_entry);
FE_
}
static StgWord s44u_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s44u_info);
IF_(s44u_entry) {
FB_
STK_CHK_NP(5,);
UPD_BH_UPDATABLE((P_)&s44u_info);
PUSH_UPD_FRAME(R1.p,0);
R1.p=(P_)(R1.p[1]);
Sp[-3]=(W_)((P_)&s45R_info);
Sp=Sp-3;
JMP_((ENTRY_CODE((D_)(*R1.p))));
FE_
}
static StgWord s44l_info[] = {
(W_)(0x0),(W_)(0x24)
};
EI_(GHCziBase_Izh_con_info);
IF_(s44l_ret) {
FB_
HP_CHK_UNBX_R1(2,);
SET_HDR_(Hp-1,(P_)&GHCziBase_Izh_con_info,0,0);
*Hp=(W_)(R1.i);
R1.p=Hp-1;
Sp=Sp+1;
JMP_(ENTRY_CODE((P_)&stg_upd_frame_info));
FE_
}
static StgWord s44j_info[] = {
(W_)(0x0),(W_)(0x24)
};
EF_(GHCziBase_modIntzh_entry);
IF_(s44j_ret) {
FB_
Sp[-1]=(W_)(256);
Sp[-2]=(W_)(R1.i);
*Sp=(W_)((P_)&s44l_info);
Sp=Sp-2;
JMP_(GHCziBase_modIntzh_entry);
FE_
}
static StgWord s45S_info[] = {
(W_)(0x0),(W_)(0x24)
};
EF_(GHCziBase_divIntzh_entry);
IF_(s45S_ret) {
FB_
Sp[-1]=(W_)(256);
Sp[-2]=(W_)(R1.p[1]);
*Sp=(W_)((P_)&s44j_info);
Sp=Sp-2;
JMP_(GHCziBase_divIntzh_entry);
FE_
}
static StgWord s44n_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s44n_info);
IF_(s44n_entry) {
FB_
STK_CHK_NP(5,);
UPD_BH_UPDATABLE((P_)&s44n_info);
PUSH_UPD_FRAME(R1.p,0);
R1.p=(P_)(R1.p[1]);
Sp[-3]=(W_)((P_)&s45S_info);
Sp=Sp-3;
JMP_((ENTRY_CODE((D_)(*R1.p))));
FE_
}
static StgWord s44c_info[] = {
(W_)(0x0),(W_)(0x24)
};
EI_(GHCziBase_Izh_con_info);
IF_(s44c_ret) {
FB_
HP_CHK_UNBX_R1(2,);
SET_HDR_(Hp-1,(P_)&GHCziBase_Izh_con_info,0,0);
*Hp=(W_)(R1.i);
R1.p=Hp-1;
Sp=Sp+1;
JMP_(ENTRY_CODE((P_)&stg_upd_frame_info));
FE_
}
static StgWord s45T_info[] = {
(W_)(0x0),(W_)(0x24)
};
EF_(GHCziBase_modIntzh_entry);
IF_(s45T_ret) {
FB_
Sp[-1]=(W_)(256);
Sp[-2]=(W_)(R1.p[1]);
*Sp=(W_)((P_)&s44c_info);
Sp=Sp-2;
JMP_(GHCziBase_modIntzh_entry);
FE_
}
static StgWord s44e_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s44e_info);
IF_(s44e_entry) {
FB_
STK_CHK_NP(5,);
UPD_BH_UPDATABLE((P_)&s44e_info);
PUSH_UPD_FRAME(R1.p,0);
R1.p=(P_)(R1.p[1]);
Sp[-3]=(W_)((P_)&s45T_info);
Sp=Sp-3;
JMP_((ENTRY_CODE((D_)(*R1.p))));
FE_
}
StgWord Main_encodeInt_info[] = {
(W_)(((W_ *)(Main_encodeInt_srt))+(I_)(0)),(W_)(0x10004),(W_)(0x0),(W_)(0x10011)
};
EC_(Main_encodeInt_closure);
II_(s44u_info);
EI_(GHCziBase_ZC_con_info);
EC_(GHCziBase_ZMZN_closure);
II_(s44n_info);
II_(s44e_info);
EC_(GHCziBase_chr_closure);
EF_(GHCziBase_map_entry);
FN_(Main_encodeInt_entry) {
FB_
HP_STK_CHK_FUN(1,18,R1.p=(P_)&Main_encodeInt_closure;);
SET_HDR_(Hp-17,(P_)&s44u_info,0,0);
Hp[-16]=(W_)(*Sp);
SET_HDR_(Hp-14,(P_)&GHCziBase_ZC_con_info,0,0);
Hp[-13]=(W_)(Hp-17);
Hp[-12]=(W_)((P_)&GHCziBase_ZMZN_closure);
SET_HDR_(Hp-11,(P_)&s44n_info,0,0);
Hp[-10]=(W_)(*Sp);
SET_HDR_(Hp-8,(P_)&GHCziBase_ZC_con_info,0,0);
Hp[-7]=(W_)(Hp-11);
Hp[-6]=(W_)(Hp-14);
SET_HDR_(Hp-5,(P_)&s44e_info,0,0);
Hp[-4]=(W_)(*Sp);
SET_HDR_(Hp-2,(P_)&GHCziBase_ZC_con_info,0,0);
Hp[-1]=(W_)(Hp-5);
*Hp=(W_)(Hp-8);
*Sp=(W_)(Hp-2);
Sp[-1]=(W_)((P_)&GHCziBase_chr_closure);
Sp=Sp-1;
JMP_(GHCziBase_map_entry);
FE_
}
EC_(GHCziBase_chr_closure);
EC_(SystemziIO_readFile_closure);
SRT(Main_encodeFile_srt)
&GHCziBase_chr_closure,&SystemziIO_readFile_closure};
SET_STATIC_HDR(Main_encodeFile_closure,Main_encodeFile_info,0,,EI_)
, {(L_)0}
};
static StgWord s44K_info[] = {
(W_)(((W_ *)(Main_encodeFile_srt))+(I_)(1)),(W_)(0x10001),(W_)(0x10013)
};
II_(s44K_info);
EC_(SystemziIO_readFile_closure);
IF_(s44K_entry) {
FB_
STK_CHK_NP(4,);
UPD_BH_UPDATABLE((P_)&s44K_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-3]=(W_)(R1.p[1]);
R1.p=(P_)&SystemziIO_readFile_closure;
Sp=Sp-4;
JMP_(stg_ap_p_ret);
FE_
}
static StgWord s44M_info[] = {
(W_)(((W_ *)(Main_encodeFile_srt))+(I_)(1)),(W_)(0x10001),(W_)(0x10013)
};
II_(s44M_info);
II_(s44K_info);
EF_(GHCziIOBase_unsafePerformIO_entry);
IF_(s44M_entry) {
FB_
HP_STK_CHK_NP(3,3,);
UPD_BH_UPDATABLE((P_)&s44M_info);
PUSH_UPD_FRAME(R1.p,0);
SET_HDR_(Hp-2,(P_)&s44K_info,0,0);
Hp[-1]=(W_)(R1.p[1]);
Sp[-3]=(W_)(Hp-2);
Sp=Sp-3;
JMP_(GHCziIOBase_unsafePerformIO_entry);
FE_
}
static StgWord s44O_info[] = {
(W_)(0x0),(W_)(0x24)
};
EI_(GHCziBase_Izh_con_info);
IF_(s44O_ret) {
FB_
HP_CHK_UNBX_R1(2,);
SET_HDR_(Hp-1,(P_)&GHCziBase_Izh_con_info,0,0);
*Hp=(W_)(R1.i);
R1.p=Hp-1;
Sp=Sp+1;
JMP_(ENTRY_CODE((P_)&stg_upd_frame_info));
FE_
}
static StgWord s44Q_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s44Q_info);
EF_(GHCziList_zdwlen_entry);
IF_(s44Q_entry) {
FB_
STK_CHK_NP(5,);
UPD_BH_UPDATABLE((P_)&s44Q_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-4]=(W_)(0);
Sp[-5]=(W_)(R1.p[1]);
Sp[-3]=(W_)((P_)&s44O_info);
Sp=Sp-5;
JMP_(GHCziList_zdwlen_entry);
FE_
}
EF_(GHCziBase_zpzp_entry);
IF_(s44S_dflt) {
FB_
*Sp=(W_)(R1.p);
JMP_(GHCziBase_zpzp_entry);
FE_
}
static StgWord s44S_vtbl[] = {
(W_)((P_)&s44S_dflt),(W_)((P_)&s44S_dflt),(W_)(0),(W_)(0x1),(W_)(0x25)
};
static StgWord s44U_info[] = {
(W_)(((W_ *)(Main_encodeFile_srt))+(I_)(0)),(W_)(0x10001),(W_)(0x30013)
};
II_(s44U_info);
II_(s44M_info);
II_(s44Q_info);
EF_(Main_encodeInt_entry);
IF_(s44U_entry) {
FB_
HP_STK_CHK_NP(5,6,);
UPD_BH_UPDATABLE((P_)&s44U_info);
PUSH_UPD_FRAME(R1.p,0);
SET_HDR_(Hp-5,(P_)&s44M_info,0,0);
Hp[-4]=(W_)(R1.p[1]);
SET_HDR_(Hp-2,(P_)&s44Q_info,0,0);
Hp[-1]=(W_)(Hp-5);
Sp[-5]=(W_)(Hp-2);
Sp[-3]=(W_)(Hp-5);
Sp[-4]=(W_)((P_)&s44S_vtbl);
Sp=Sp-5;
JMP_(Main_encodeInt_entry);
FE_
}
static StgWord s44W_info[] = {
(W_)(((W_ *)(Main_encodeFile_srt))+(I_)(0)),(W_)(0x10001),(W_)(0x30013)
};
II_(s44W_info);
II_(s44U_info);
EF_(GHCziBase_zpzp_entry);
IF_(s44W_entry) {
FB_
HP_STK_CHK_NP(4,3,);
UPD_BH_UPDATABLE((P_)&s44W_info);
PUSH_UPD_FRAME(R1.p,0);
SET_HDR_(Hp-2,(P_)&s44U_info,0,0);
Hp[-1]=(W_)(R1.p[1]);
Sp[-3]=(W_)(Hp-2);
Sp[-4]=(W_)(R1.p[1]);
Sp=Sp-4;
JMP_(GHCziBase_zpzp_entry);
FE_
}
static StgWord s44F_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s44F_info);
EF_(GHCziList_length_entry);
IF_(s44F_entry) {
FB_
STK_CHK_NP(3,);
UPD_BH_UPDATABLE((P_)&s44F_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-3]=(W_)(R1.p[1]);
Sp=Sp-3;
JMP_(GHCziList_length_entry);
FE_
}
EF_(GHCziBase_zpzp_entry);
IF_(s44H_dflt) {
FB_
*Sp=(W_)(R1.p);
JMP_(GHCziBase_zpzp_entry);
FE_
}
static StgWord s44H_vtbl[] = {
(W_)((P_)&s44H_dflt),(W_)((P_)&s44H_dflt),(W_)(0),(W_)(0x1),(W_)(0x25)
};
StgWord Main_encodeFile_info[] = {
(W_)(((W_ *)(Main_encodeFile_srt))+(I_)(0)),(W_)(0x10004),(W_)(0x0),(W_)(0x30011)
};
EC_(Main_encodeFile_closure);
II_(s44W_info);
II_(s44F_info);
EF_(Main_encodeInt_entry);
FN_(Main_encodeFile_entry) {
FB_
HP_STK_CHK_FUN(2,6,R1.p=(P_)&Main_encodeFile_closure;);
SET_HDR_(Hp-5,(P_)&s44W_info,0,0);
Hp[-4]=(W_)(*Sp);
SET_HDR_(Hp-2,(P_)&s44F_info,0,0);
Hp[-1]=(W_)(*Sp);
Sp[-2]=(W_)(Hp-2);
*Sp=(W_)(Hp-5);
Sp[-1]=(W_)((P_)&s44H_vtbl);
Sp=Sp-2;
JMP_(Main_encodeInt_entry);
FE_
}
EC_(GHCziBase_chr_closure);
SRT(Main_encodeStr_srt)
&GHCziBase_chr_closure};
SET_STATIC_HDR(Main_encodeStr_closure,Main_encodeStr_info,0,,EI_)
, {(L_)0}
};
static StgWord s451_info[] = {
(W_)(0x10001),(W_)(0x13)
};
II_(s451_info);
EF_(GHCziList_length_entry);
IF_(s451_entry) {
FB_
STK_CHK_NP(3,);
UPD_BH_UPDATABLE((P_)&s451_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-3]=(W_)(R1.p[1]);
Sp=Sp-3;
JMP_(GHCziList_length_entry);
FE_
}
EF_(GHCziBase_zpzp_entry);
IF_(s453_dflt) {
FB_
*Sp=(W_)(R1.p);
JMP_(GHCziBase_zpzp_entry);
FE_
}
static StgWord s453_vtbl[] = {
(W_)((P_)&s453_dflt),(W_)((P_)&s453_dflt),(W_)(0),(W_)(0x1),(W_)(0x25)
};
StgWord Main_encodeStr_info[] = {
(W_)(((W_ *)(Main_encodeStr_srt))+(I_)(0)),(W_)(0x10004),(W_)(0x0),(W_)(0x10011)
};
EC_(Main_encodeStr_closure);
II_(s451_info);
EF_(Main_encodeInt_entry);
FN_(Main_encodeStr_entry) {
FB_
HP_STK_CHK_FUN(2,3,R1.p=(P_)&Main_encodeStr_closure;);
SET_HDR_(Hp-2,(P_)&s451_info,0,0);
Hp[-1]=(W_)(*Sp);
Sp[-2]=(W_)(Hp-2);
Sp[-1]=(W_)((P_)&s453_vtbl);
Sp=Sp-2;
JMP_(Main_encodeInt_entry);
FE_
}
SET_STATIC_HDR(Main_s_closure,Main_s_info,0,,EI_)
, {(L_)0, (L_)0, (L_)0}
};
StgWord Main_s_info[] = {
(W_)(0x20000),(W_)(0x18)
};
EC_(GHCziBase_ZMZN_closure);
EF_(GHCziBase_unpackAppendCStringzh_entry);
FN_(Main_s_entry) {
FB_
HP_STK_CHK_NP(4,3,);
SET_HDR_(Hp-2,(P_)&stg_CAF_BLACKHOLE_info,0,0);
UPD_CAF(R1.p,Hp-2);
PUSH_UPD_FRAME(Hp-2,0);
Sp[-3]=(W_)((P_)&GHCziBase_ZMZN_closure);
Sp[-4]=(W_)("Pattern match failure in do expression at SmallestArchiver.hs:8");
Sp=Sp-4;
JMP_(GHCziBase_unpackAppendCStringzh_entry);
FE_
}
EC_(DataziMaybe_Nothing_closure);
EC_(GHCziIOBase_UserError_closure);
EC_(GHCziBase_ZMZN_closure);
EC_(Main_s_closure);
SET_STATIC_HDR(Main_lvl_closure,GHCziIOBase_IOError_static_info,0,,EI_)
, {(L_)(P_)&DataziMaybe_Nothing_closure, (L_)(P_)&GHCziIOBase_UserError_closure, (L_)(P_)&GHCziBase_ZMZN_closure, (L_)(P_)&Main_s_closure, (L_)(P_)&DataziMaybe_Nothing_closure, (L_)0}
};
EC_(Main_lvl_closure);
SET_STATIC_HDR(Main_lvl1_closure,GHCziIOBase_IOException_static_info,0,,EI_)
, {(L_)(P_)&Main_lvl_closure, (L_)0}
};
EC_(Main_encodeFile_closure);
EC_(Main_go_closure);
SRT(Main_go_srt)
&Main_encodeFile_closure,&Main_go_closure};
SET_STATIC_HDR(Main_go_closure,Main_go_info,0,,EI_)
, {(L_)0}
};
EC_(GHCziBase_ZMZN_closure);
IF_(s45U_1_alt) {
FB_
R1.p=(P_)&GHCziBase_ZMZN_closure;
Sp=Sp+1;
JMP_(RET_VEC((P_)(*Sp),0));
FE_
}
static StgWord s45i_info[] = {
(W_)(((W_ *)(Main_go_srt))+(I_)(1)),(W_)(0x10001),(W_)(0x10013)
};
II_(s45i_info);
EF_(Main_go_entry);
IF_(s45i_entry) {
FB_
STK_CHK_NP(3,);
UPD_BH_UPDATABLE((P_)&s45i_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-3]=(W_)(R1.p[1]);
Sp=Sp-3;
JMP_(Main_go_entry);
FE_
}
EF_(GHCziBase_zpzp_entry);
IF_(s45f_dflt) {
FB_
*Sp=(W_)(R1.p);
JMP_(GHCziBase_zpzp_entry);
FE_
}
static StgWord s45f_vtbl[] = {
(W_)((P_)&s45f_dflt),(W_)((P_)&s45f_dflt),(W_)(0),(W_)(0x1),(W_)(0x25)
};
II_(s45i_info);
EF_(Main_encodeFile_entry);
IF_(s45U_2_alt) {
FB_
HP_CHK_NP(3,);
SET_HDR_(Hp-2,(P_)&s45i_info,0,0);
Hp[-1]=(W_)(R1.p[2]);
Sp[-2]=(W_)(R1.p[1]);
*Sp=(W_)(Hp-2);
Sp[-1]=(W_)((P_)&s45f_vtbl);
Sp=Sp-2;
JMP_(Main_encodeFile_entry);
FE_
}
static StgWord s45U_vtbl[] = {
(W_)((P_)&s45U_2_alt),(W_)((P_)&s45U_1_alt),(W_)(((W_ *)(Main_go_srt))+(I_)(0)),(W_)(0x0),(W_)(0x30025)
};
StgWord Main_go_info[] = {
(W_)(((W_ *)(Main_go_srt))+(I_)(0)),(W_)(0x10004),(W_)(0x0),(W_)(0x30011)
};
EC_(Main_go_closure);
FN_(Main_go_entry) {
FB_
STK_CHK_FUN(2,R1.p=(P_)&Main_go_closure;);
R1.p=(P_)(*Sp);
*Sp=(W_)((P_)&s45U_vtbl);
JMP_((ENTRY_CODE((D_)(*R1.p))));
FE_
}
EC_(GHCziHandle_openFile_closure);
EC_(GHCziHandle_hClose_closure);
EC_(GHCziIO_hPutStr_closure);
EC_(Main_lvl1_closure);
EC_(Main_go_closure);
SRT(Main_main_srt)
&GHCziHandle_openFile_closure,&GHCziHandle_hClose_closure,&GHCziIO_hPutStr_closure,&Main_lvl1_closure,&Main_go_closure};
SET_STATIC_HDR(Main_main_closure,Main_main_info,0,,EI_)
, {(L_)0}
};
EF_(Main_main_entry);
FN_(Main_main_slow) {
FB_
Sp=Sp;
JMP_(Main_main_entry);
FE_
}
EC_(Main_lvl1_closure);
IF_(s45N_1_alt) {
FB_
R1.p=(P_)&Main_lvl1_closure;
Sp=Sp+1;
JMP_((P_)&raiseIOzh_fast);
FE_
}
static StgWord s45C_info[] = {
(W_)(((W_ *)(Main_main_srt))+(I_)(4)),(W_)(0x10001),(W_)(0x10013)
};
II_(s45C_info);
EF_(Main_go_entry);
IF_(s45C_entry) {
FB_
STK_CHK_NP(3,);
UPD_BH_UPDATABLE((P_)&s45C_info);
PUSH_UPD_FRAME(R1.p,0);
Sp[-3]=(W_)(R1.p[1]);
Sp=Sp-3;
JMP_(Main_go_entry);
FE_
}
static StgWord s45P_info[] = {
(W_)(((W_ *)(Main_main_srt))+(I_)(1)),(W_)(0x1),(W_)(0x10024)
};
EF_(GHCziHandle_hClose_entry);
IF_(s45P_ret) {
FB_
Sp=Sp+1;
JMP_(GHCziHandle_hClose_entry);
FE_
}
static StgWord s45O_info[] = {
(W_)(((W_ *)(Main_main_srt))+(I_)(1)),(W_)(0x1),(W_)(0xb0024)
};
II_(s45C_info);
EF_(GHCziIO_hPutStr_entry);
IF_(s45O_ret) {
FB_
HP_CHK_UNBX_TUPLE(3,1,);
SET_HDR_(Hp-2,(P_)&s45C_info,0,0);
Hp[-1]=(W_)(Sp[1]);
Sp[-1]=(W_)(Hp-2);
Sp[-2]=(W_)(R1.p);
Sp[1]=(W_)(R1.p);
*Sp=(W_)((P_)&s45P_info);
Sp=Sp-2;
JMP_(GHCziIO_hPutStr_entry);
FE_
}
EC_(GHCziIOBase_WriteMode_closure);
EF_(GHCziHandle_openFile_entry);
IF_(s45N_2_alt) {
FB_
Sp[-2]=(W_)((P_)&GHCziIOBase_WriteMode_closure);
Sp[-3]=(W_)(R1.p[1]);
*Sp=(W_)(R1.p[2]);
Sp[-1]=(W_)((P_)&s45O_info);
Sp=Sp-3;
JMP_(GHCziHandle_openFile_entry);
FE_
}
static StgWord s45N_vtbl[] = {
(W_)((P_)&s45N_2_alt),(W_)((P_)&s45N_1_alt),(W_)(((W_ *)(Main_main_srt))+(I_)(0)),(W_)(0x0),(W_)(0x1f0025)
};
static StgWord s45M_info[] = {
(W_)(((W_ *)(Main_main_srt))+(I_)(0)),(W_)(0x0),(W_)(0x1f0024)
};
IF_(s45M_ret) {
FB_
*Sp=(W_)((P_)&s45N_vtbl);
JMP_((ENTRY_CODE((D_)(*R1.p))));
FE_
}
EF_(Main_main_slow);
StgWord Main_main_info[] = {
(W_)(Main_main_slow),(W_)(0x0),(W_)(((W_ *)(Main_main_srt))+(I_)(0)),(W_)(0x10000),(W_)(0x0),(W_)(0x1f0011)
};
EC_(Main_main_closure);
EF_(SystemziEnvironment_getArgs_entry);
FN_(Main_main_entry) {
FB_
STK_CHK_FUN(4,R1.p=(P_)&Main_main_closure;
Sp=Sp;);
Sp[-1]=(W_)((P_)&s45M_info);
Sp=Sp-1;
JMP_(SystemziEnvironment_getArgs_entry);
FE_
}
EC_(Main_main_closure);
EC_(GHCziTopHandler_topHandler_closure);
SRT(ZCMain_main_srt)
&Main_main_closure,&GHCziTopHandler_topHandler_closure};
SET_STATIC_HDR(ZCMain_main_closure,ZCMain_main_info,0,,EI_)
, {(L_)0}
};
EF_(ZCMain_main_entry);
FN_(ZCMain_main_slow) {
FB_
Sp=Sp;
JMP_(ZCMain_main_entry);
FE_
}
EF_(ZCMain_main_slow);
StgWord ZCMain_main_info[] = {
(W_)(ZCMain_main_slow),(W_)(0x0),(W_)(((W_ *)(ZCMain_main_srt))+(I_)(0)),(W_)(0x10000),(W_)(0x0),(W_)(0x30011)
};
EC_(GHCziTopHandler_topHandler_closure);
EC_(Main_main_closure);
FN_(ZCMain_main_entry) {
FB_
R2.p=(P_)&GHCziTopHandler_topHandler_closure;
R1.p=(P_)&Main_main_closure;
JMP_((P_)&catchzh_fast);
FE_
}
import Data.Char
import System.Environment
import System.IO.Unsafe
encodeInt n = map chr [n `mod` 256, (n `div` 256) `mod` 256, n `div` 65536]
encodeStr x = encodeInt(length x) ++ x
encodeFile f = encodeStr(f) ++ encodeStr(unsafePerformIO (readFile f))
main = do (arc:files) <- getArgs; writeFile arc (concatMap encodeFile files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment