Skip to content

Instantly share code, notes, and snippets.

@eccstartup
Created September 3, 2013 06:50
Show Gist options
  • Save eccstartup/6420444 to your computer and use it in GitHub Desktop.
Save eccstartup/6420444 to your computer and use it in GitHub Desktop.
gcc -o hello1 hello.c
```
hello.c:5:28: error: jhc_rts_header.h: No such file or directory
hello.c:21: error: expected specifier-qualifier-list before ‘sptr_t’
hello.c:24: error: expected ‘)’ before ‘gc’
hello.c:26: error: expected ‘)’ before ‘gc’
hello.c:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fPrelude_IO_getChar’
hello.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fPrelude_IO_getLine’
hello.c:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fPrelude_IO_putStr’
hello.c:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fR$__fPrelude_IO_getLine’
hello.c:31: error: expected ‘)’ before ‘gc’
hello.c:34: error: unknown field ‘a1’ specified in initializer
hello.c:34: error: ‘sptr_t’ undeclared here (not in a function)
hello.c:34: warning: excess elements in struct initializer
hello.c:34: warning: (near initialization for ‘_c1’)
hello.c:34: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:37: error: unknown field ‘a1’ specified in initializer
hello.c:37: warning: excess elements in struct initializer
hello.c:37: warning: (near initialization for ‘_c2’)
hello.c:37: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:40: error: unknown field ‘a1’ specified in initializer
hello.c:40: warning: excess elements in struct initializer
hello.c:40: warning: (near initialization for ‘_c3’)
hello.c:40: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:43: error: unknown field ‘a1’ specified in initializer
hello.c:43: warning: excess elements in struct initializer
hello.c:43: warning: (near initialization for ‘_c4’)
hello.c:43: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:46: error: unknown field ‘a1’ specified in initializer
hello.c:46: warning: excess elements in struct initializer
hello.c:46: warning: (near initialization for ‘_c5’)
hello.c:46: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:49: error: unknown field ‘a1’ specified in initializer
hello.c:49: warning: excess elements in struct initializer
hello.c:49: warning: (near initialization for ‘_c6’)
hello.c:49: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:52: error: unknown field ‘a1’ specified in initializer
hello.c:52: warning: excess elements in struct initializer
hello.c:52: warning: (near initialization for ‘_c7’)
hello.c:52: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:55: error: unknown field ‘a1’ specified in initializer
hello.c:55: warning: excess elements in struct initializer
hello.c:55: warning: (near initialization for ‘_c8’)
hello.c:55: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:58: error: unknown field ‘a1’ specified in initializer
hello.c:58: warning: excess elements in struct initializer
hello.c:58: warning: (near initialization for ‘_c9’)
hello.c:58: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:61: error: unknown field ‘a1’ specified in initializer
hello.c:61: warning: excess elements in struct initializer
hello.c:61: warning: (near initialization for ‘_c13’)
hello.c:61: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:64: error: unknown field ‘a1’ specified in initializer
hello.c:64: warning: excess elements in struct initializer
hello.c:64: warning: (near initialization for ‘_c14’)
hello.c:64: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:67: error: unknown field ‘a1’ specified in initializer
hello.c:67: warning: excess elements in struct initializer
hello.c:67: warning: (near initialization for ‘_c15’)
hello.c:67: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:70: error: unknown field ‘a1’ specified in initializer
hello.c:70: warning: excess elements in struct initializer
hello.c:70: warning: (near initialization for ‘_c16’)
hello.c:70: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:73: error: unknown field ‘a1’ specified in initializer
hello.c:73: warning: excess elements in struct initializer
hello.c:73: warning: (near initialization for ‘_c17’)
hello.c:73: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:76: error: unknown field ‘a1’ specified in initializer
hello.c:76: warning: excess elements in struct initializer
hello.c:76: warning: (near initialization for ‘_c18’)
hello.c:76: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:79: error: unknown field ‘a1’ specified in initializer
hello.c:79: warning: excess elements in struct initializer
hello.c:79: warning: (near initialization for ‘_c19’)
hello.c:79: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:82: error: unknown field ‘a1’ specified in initializer
hello.c:82: warning: excess elements in struct initializer
hello.c:82: warning: (near initialization for ‘_c20’)
hello.c:82: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:85: error: unknown field ‘a1’ specified in initializer
hello.c:85: warning: excess elements in struct initializer
hello.c:85: warning: (near initialization for ‘_c21’)
hello.c:85: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:88: error: unknown field ‘a1’ specified in initializer
hello.c:88: warning: excess elements in struct initializer
hello.c:88: warning: (near initialization for ‘_c22’)
hello.c:88: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:91: error: unknown field ‘a1’ specified in initializer
hello.c:91: warning: excess elements in struct initializer
hello.c:91: warning: (near initialization for ‘_c23’)
hello.c:91: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:94: error: unknown field ‘a1’ specified in initializer
hello.c:94: warning: excess elements in struct initializer
hello.c:94: warning: (near initialization for ‘_c28’)
hello.c:94: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:97: error: unknown field ‘a1’ specified in initializer
hello.c:97: warning: excess elements in struct initializer
hello.c:97: warning: (near initialization for ‘_c29’)
hello.c:97: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:100: error: unknown field ‘a1’ specified in initializer
hello.c:100: warning: excess elements in struct initializer
hello.c:100: warning: (near initialization for ‘_c30’)
hello.c:100: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:103: error: unknown field ‘a1’ specified in initializer
hello.c:103: warning: excess elements in struct initializer
hello.c:103: warning: (near initialization for ‘_c31’)
hello.c:103: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:106: error: unknown field ‘a1’ specified in initializer
hello.c:106: warning: excess elements in struct initializer
hello.c:106: warning: (near initialization for ‘_c32’)
hello.c:106: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:109: error: unknown field ‘a1’ specified in initializer
hello.c:109: warning: excess elements in struct initializer
hello.c:109: warning: (near initialization for ‘_c33’)
hello.c:109: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:112: error: unknown field ‘a1’ specified in initializer
hello.c:112: warning: excess elements in struct initializer
hello.c:112: warning: (near initialization for ‘_c10’)
hello.c:112: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:115: error: unknown field ‘a1’ specified in initializer
hello.c:115: warning: excess elements in struct initializer
hello.c:115: warning: (near initialization for ‘_c11’)
hello.c:115: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:118: error: unknown field ‘a1’ specified in initializer
hello.c:118: warning: excess elements in struct initializer
hello.c:118: warning: (near initialization for ‘_c12’)
hello.c:118: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:121: error: unknown field ‘a1’ specified in initializer
hello.c:121: warning: excess elements in struct initializer
hello.c:121: warning: (near initialization for ‘_c24’)
hello.c:121: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:124: error: unknown field ‘a1’ specified in initializer
hello.c:124: warning: excess elements in struct initializer
hello.c:124: warning: (near initialization for ‘_c25’)
hello.c:124: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:127: error: unknown field ‘a1’ specified in initializer
hello.c:127: warning: excess elements in struct initializer
hello.c:127: warning: (near initialization for ‘_c26’)
hello.c:127: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:130: error: unknown field ‘a1’ specified in initializer
hello.c:130: warning: excess elements in struct initializer
hello.c:130: warning: (near initialization for ‘_c27’)
hello.c:130: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:133: error: unknown field ‘a1’ specified in initializer
hello.c:133: warning: excess elements in struct initializer
hello.c:133: warning: (near initialization for ‘_c34’)
hello.c:133: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:136: error: unknown field ‘a1’ specified in initializer
hello.c:136: warning: excess elements in struct initializer
hello.c:136: warning: (near initialization for ‘_c35’)
hello.c:136: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:139: error: unknown field ‘a1’ specified in initializer
hello.c:139: warning: excess elements in struct initializer
hello.c:139: warning: (near initialization for ‘_c36’)
hello.c:139: error: expected ‘}’ before ‘RAW_SET_UF’
hello.c:151: error: expected ‘)’ before ‘gc’
hello.c: In function ‘_amain’:
hello.c:160: error: ‘arena_t’ undeclared (first use in this function)
hello.c:160: error: (Each undeclared identifier is reported only once
hello.c:160: error: for each function it appears in.)
hello.c:160: error: expected ‘;’ before ‘arena’
hello.c:161: error: ‘gc_t’ undeclared (first use in this function)
hello.c:161: error: expected ‘;’ before ‘gc’
hello.c:162: error: ‘gc’ undeclared (first use in this function)
hello.c:163: error: ‘arena’ undeclared (first use in this function)
hello.c: At top level:
hello.c:171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b__main’
hello.c:176: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘A_STD’
hello.c:213: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘A_STD’
hello.c:219: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘A_STD’
hello.c:248: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘A_STD’
hello.c:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ftheMain’
```
hello.c
```
char jhc_c_compile[] = "gcc /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/profile.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/rts_support.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/gc_none.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/jhc_rts.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/lib/lib_cbits.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/gc_jgc.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/stableptr.c /var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/rts/conc.c -I/var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736/cbits -I/var/folders/3r/5c02fv4j15l0khx6qllnx4dc0000gn/T/jhc_6736 hello.c -o hello.c '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wextra -Wall -Wno-unused-parameter -fno-strict-aliasing -DNDEBUG -O3 '-D_JHC_GC=_JHC_GC_JGC' '-D_JHC_CONC=_JHC_CONC_NONE'";
char jhc_command[] = "ajhc hello.hs -C -o hello.c";
char jhc_version[] = "ajhc 0.8.0.8 (a1265f031e6b75f9346ec23ca7caec0b5ced82bc)";
#include "jhc_rts_header.h"
struct s_caches_pub {
struct s_cache *cCJhc_Prim_Prim_$x3a;
};
#include <stdio.h>
#include <wchar.h>
enum {
CJhc_Prim_Prim_$BE = 1,
CJhc_Prim_Prim_$LR = 0,
CJhc_Prim_Prim_$x3a = 0,
CJhc_Type_Basic_Char = 0
};
struct sCJhc_Prim_Prim_$x3a A_ALIGNED;
struct sCJhc_Prim_Prim_$x3a {
sptr_t a1;
sptr_t a2;
};
void jhc_hs_init(gc_t gc,arena_t arena) ;
void _amain(void) ;
static void b__main(gc_t gc,arena_t arena) A_STD;
static wptr_t fPrelude_IO_getChar(gc_t gc,arena_t arena) A_STD A_MALLOC;
static wptr_t fPrelude_IO_getLine(gc_t gc,arena_t arena) A_STD A_MALLOC;
static wptr_t fPrelude_IO_putStr(gc_t gc,arena_t arena,wptr_t v355605535) A_STD A_MALLOC;
static wptr_t fR$__fPrelude_IO_getLine(gc_t gc,arena_t arena) A_STD A_MALLOC;
static void ftheMain(gc_t gc,arena_t arena) A_STD;
/* CAFS */
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 46),Left &("CJhc.Prim.Prim.[]")],1) */
static const struct sCJhc_Prim_Prim_$x3a _c1 = {.a1 = (sptr_t)RAW_SET_UF('.'), .a2 = (sptr_t)SET_RAW_TAG(CJhc_Prim_Prim_$BE)};
#define c1 (TO_SPTR_C(P_WHNF, (sptr_t)&_c1))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 101),Right 1],2) */
static const struct sCJhc_Prim_Prim_$x3a _c2 = {.a1 = (sptr_t)RAW_SET_UF('e'), .a2 = c1};
#define c2 (TO_SPTR_C(P_WHNF, (sptr_t)&_c2))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 108),Right 2],3) */
static const struct sCJhc_Prim_Prim_$x3a _c3 = {.a1 = (sptr_t)RAW_SET_UF('l'), .a2 = c2};
#define c3 (TO_SPTR_C(P_WHNF, (sptr_t)&_c3))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 105),Right 3],4) */
static const struct sCJhc_Prim_Prim_$x3a _c4 = {.a1 = (sptr_t)RAW_SET_UF('i'), .a2 = c3};
#define c4 (TO_SPTR_C(P_WHNF, (sptr_t)&_c4))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 102),Right 4],5) */
static const struct sCJhc_Prim_Prim_$x3a _c5 = {.a1 = (sptr_t)RAW_SET_UF('f'), .a2 = c4};
#define c5 (TO_SPTR_C(P_WHNF, (sptr_t)&_c5))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 32),Right 5],6) */
static const struct sCJhc_Prim_Prim_$x3a _c6 = {.a1 = (sptr_t)RAW_SET_UF(' '), .a2 = c5};
#define c6 (TO_SPTR_C(P_WHNF, (sptr_t)&_c6))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 102),Right 6],7) */
static const struct sCJhc_Prim_Prim_$x3a _c7 = {.a1 = (sptr_t)RAW_SET_UF('f'), .a2 = c6};
#define c7 (TO_SPTR_C(P_WHNF, (sptr_t)&_c7))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 111),Right 7],8) */
static const struct sCJhc_Prim_Prim_$x3a _c8 = {.a1 = (sptr_t)RAW_SET_UF('o'), .a2 = c7};
#define c8 (TO_SPTR_C(P_WHNF, (sptr_t)&_c8))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 32),Right 8],9) */
static const struct sCJhc_Prim_Prim_$x3a _c9 = {.a1 = (sptr_t)RAW_SET_UF(' '), .a2 = c8};
#define c9 (TO_SPTR_C(P_WHNF, (sptr_t)&_c9))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 58),Left &("CJhc.Prim.Prim.[]")],13) */
static const struct sCJhc_Prim_Prim_$x3a _c13 = {.a1 = (sptr_t)RAW_SET_UF(':'), .a2 = (sptr_t)SET_RAW_TAG(CJhc_Prim_Prim_$BE)};
#define c13 (TO_SPTR_C(P_WHNF, (sptr_t)&_c13))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 103),Right 13],14) */
static const struct sCJhc_Prim_Prim_$x3a _c14 = {.a1 = (sptr_t)RAW_SET_UF('g'), .a2 = c13};
#define c14 (TO_SPTR_C(P_WHNF, (sptr_t)&_c14))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 110),Right 14],15) */
static const struct sCJhc_Prim_Prim_$x3a _c15 = {.a1 = (sptr_t)RAW_SET_UF('n'), .a2 = c14};
#define c15 (TO_SPTR_C(P_WHNF, (sptr_t)&_c15))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 105),Right 15],16) */
static const struct sCJhc_Prim_Prim_$x3a _c16 = {.a1 = (sptr_t)RAW_SET_UF('i'), .a2 = c15};
#define c16 (TO_SPTR_C(P_WHNF, (sptr_t)&_c16))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 104),Right 16],17) */
static const struct sCJhc_Prim_Prim_$x3a _c17 = {.a1 = (sptr_t)RAW_SET_UF('h'), .a2 = c16};
#define c17 (TO_SPTR_C(P_WHNF, (sptr_t)&_c17))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 116),Right 17],18) */
static const struct sCJhc_Prim_Prim_$x3a _c18 = {.a1 = (sptr_t)RAW_SET_UF('t'), .a2 = c17};
#define c18 (TO_SPTR_C(P_WHNF, (sptr_t)&_c18))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 101),Right 18],19) */
static const struct sCJhc_Prim_Prim_$x3a _c19 = {.a1 = (sptr_t)RAW_SET_UF('e'), .a2 = c18};
#define c19 (TO_SPTR_C(P_WHNF, (sptr_t)&_c19))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 109),Right 19],20) */
static const struct sCJhc_Prim_Prim_$x3a _c20 = {.a1 = (sptr_t)RAW_SET_UF('m'), .a2 = c19};
#define c20 (TO_SPTR_C(P_WHNF, (sptr_t)&_c20))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 111),Right 20],21) */
static const struct sCJhc_Prim_Prim_$x3a _c21 = {.a1 = (sptr_t)RAW_SET_UF('o'), .a2 = c20};
#define c21 (TO_SPTR_C(P_WHNF, (sptr_t)&_c21))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 115),Right 21],22) */
static const struct sCJhc_Prim_Prim_$x3a _c22 = {.a1 = (sptr_t)RAW_SET_UF('s'), .a2 = c21};
#define c22 (TO_SPTR_C(P_WHNF, (sptr_t)&_c22))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 32),Right 22],23) */
static const struct sCJhc_Prim_Prim_$x3a _c23 = {.a1 = (sptr_t)RAW_SET_UF(' '), .a2 = c22};
#define c23 (TO_SPTR_C(P_WHNF, (sptr_t)&_c23))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 100),Right 13],28) */
static const struct sCJhc_Prim_Prim_$x3a _c28 = {.a1 = (sptr_t)RAW_SET_UF('d'), .a2 = c13};
#define c28 (TO_SPTR_C(P_WHNF, (sptr_t)&_c28))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 101),Right 28],29) */
static const struct sCJhc_Prim_Prim_$x3a _c29 = {.a1 = (sptr_t)RAW_SET_UF('e'), .a2 = c28};
#define c29 (TO_SPTR_C(P_WHNF, (sptr_t)&_c29))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 112),Right 29],30) */
static const struct sCJhc_Prim_Prim_$x3a _c30 = {.a1 = (sptr_t)RAW_SET_UF('p'), .a2 = c29};
#define c30 (TO_SPTR_C(P_WHNF, (sptr_t)&_c30))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 121),Right 30],31) */
static const struct sCJhc_Prim_Prim_$x3a _c31 = {.a1 = (sptr_t)RAW_SET_UF('y'), .a2 = c30};
#define c31 (TO_SPTR_C(P_WHNF, (sptr_t)&_c31))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 116),Right 31],32) */
static const struct sCJhc_Prim_Prim_$x3a _c32 = {.a1 = (sptr_t)RAW_SET_UF('t'), .a2 = c31};
#define c32 (TO_SPTR_C(P_WHNF, (sptr_t)&_c32))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 32),Right 32],33) */
static const struct sCJhc_Prim_Prim_$x3a _c33 = {.a1 = (sptr_t)RAW_SET_UF(' '), .a2 = c32};
#define c33 (TO_SPTR_C(P_WHNF, (sptr_t)&_c33))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 100),Right 9],10) */
static const struct sCJhc_Prim_Prim_$x3a _c10 = {.a1 = (sptr_t)RAW_SET_UF('d'), .a2 = c9};
#define c10 (TO_SPTR_C(P_WHNF, (sptr_t)&_c10))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 110),Right 10],11) */
static const struct sCJhc_Prim_Prim_$x3a _c11 = {.a1 = (sptr_t)RAW_SET_UF('n'), .a2 = c10};
#define c11 (TO_SPTR_C(P_WHNF, (sptr_t)&_c11))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 69),Right 11],12) */
static const struct sCJhc_Prim_Prim_$x3a _c12 = {.a1 = (sptr_t)RAW_SET_UF('E'), .a2 = c11};
#define c12 (TO_SPTR_C(P_WHNF, (sptr_t)&_c12))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 101),Right 23],24) */
static const struct sCJhc_Prim_Prim_$x3a _c24 = {.a1 = (sptr_t)RAW_SET_UF('e'), .a2 = c23};
#define c24 (TO_SPTR_C(P_WHNF, (sptr_t)&_c24))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 112),Right 24],25) */
static const struct sCJhc_Prim_Prim_$x3a _c25 = {.a1 = (sptr_t)RAW_SET_UF('p'), .a2 = c24};
#define c25 (TO_SPTR_C(P_WHNF, (sptr_t)&_c25))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 121),Right 25],26) */
static const struct sCJhc_Prim_Prim_$x3a _c26 = {.a1 = (sptr_t)RAW_SET_UF('y'), .a2 = c25};
#define c26 (TO_SPTR_C(P_WHNF, (sptr_t)&_c26))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 84),Right 26],27) */
static const struct sCJhc_Prim_Prim_$x3a _c27 = {.a1 = (sptr_t)RAW_SET_UF('T'), .a2 = c26};
#define c27 (TO_SPTR_C(P_WHNF, (sptr_t)&_c27))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 117),Right 33],34) */
static const struct sCJhc_Prim_Prim_$x3a _c34 = {.a1 = (sptr_t)RAW_SET_UF('u'), .a2 = c33};
#define c34 (TO_SPTR_C(P_WHNF, (sptr_t)&_c34))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 111),Right 34],35) */
static const struct sCJhc_Prim_Prim_$x3a _c35 = {.a1 = (sptr_t)RAW_SET_UF('o'), .a2 = c34};
#define c35 (TO_SPTR_C(P_WHNF, (sptr_t)&_c35))
/* (HcNode CJhc.Prim.Prim.: [Left &("CJhc.Type.Basic.Char" 89),Right 35],36) */
static const struct sCJhc_Prim_Prim_$x3a _c36 = {.a1 = (sptr_t)RAW_SET_UF('Y'), .a2 = c35};
#define c36 (TO_SPTR_C(P_WHNF, (sptr_t)&_c36))
const void * const nh_stuff[] = {
&_c1, &_c2, &_c3, &_c4, &_c5, &_c6, &_c7, &_c8, &_c9, &_c10, &_c11,
&_c12, &_c13, &_c14, &_c15, &_c16, &_c17, &_c18, &_c19, &_c20,
&_c21, &_c22, &_c23, &_c24, &_c25, &_c26, &_c27, &_c28, &_c29,
&_c30, &_c31, &_c32, &_c33, &_c34, &_c35, &_c36, NULL
};
void
jhc_hs_init(gc_t gc,arena_t arena)
{
alloc_public_caches(arena,sizeof(struct s_caches_pub));
find_cache(&public_caches(arena)->cCJhc_Prim_Prim_$x3a,arena,TO_BLOCKS(sizeof(struct sCJhc_Prim_Prim_$x3a)),2);
}
void
_amain(void)
{
arena_t arena;
gc_t gc;
gc = NULL;
arena = NULL;
jhc_alloc_init(&gc,&arena);
jhc_hs_init(gc,arena);
b__main(gc,arena);
jhc_alloc_fini(gc,arena);
}
static void A_STD
b__main(gc_t gc,arena_t arena)
{
return ftheMain(gc,arena);
}
static wptr_t A_STD A_MALLOC
fPrelude_IO_getChar(gc_t gc,arena_t arena)
{
uint32_t v53;
uint32_t v192253156 = ((uint32_t)jhc_utf8_getchar());
if (-1 == v192253156) {
sptr_t v10527816;
v10527816 = c12;
fR$__fJhc_IO_putErrLn__4:;
{ wptr_t v100006 = eval(gc,arena,v10527816);
if (SET_RAW_TAG(CJhc_Prim_Prim_$BE) == v100006) {
jhc_utf8_putchar((int)10);
SET_RAW_TAG(CJhc_Prim_Prim_$LR);
} else {
sptr_t v48;
sptr_t v50;
/* ("CJhc.Prim.Prim.:" ni48 ni50) */
v48 = ((struct sCJhc_Prim_Prim_$x3a*)v100006)->a1;
v50 = ((struct sCJhc_Prim_Prim_$x3a*)v100006)->a2;
{ uint32_t v40405742;
gc_frame0(gc,1,v50);
wptr_t v100008 = eval(gc,arena,v48);
v40405742 = ((uint32_t)RAW_GET_UF(v100008));
uint32_t v68216826 = v40405742;
jhc_utf8_putchar((int)v68216826);
v10527816 = v50;
goto fR$__fJhc_IO_putErrLn__4;
}
}
}
jhc_exit(255);
} else {
v53 = v192253156;
}
return RAW_SET_UF(v53);
}
static wptr_t A_STD A_MALLOC
fPrelude_IO_getLine(gc_t gc,arena_t arena)
{
return fR$__fPrelude_IO_getLine(gc,arena);
}
static wptr_t A_STD A_MALLOC
fPrelude_IO_putStr(gc_t gc,arena_t arena,wptr_t v355605535)
{
sptr_t v10;
sptr_t v355605552 = demote(v355605535);
v10 = v355605552;
fJhc_Monad_72__go__5:;
{ wptr_t v100000 = eval(gc,arena,v10);
if (SET_RAW_TAG(CJhc_Prim_Prim_$BE) == v100000) {
return SET_RAW_TAG(CJhc_Prim_Prim_$LR);
} else {
sptr_t v32;
sptr_t v36;
/* ("CJhc.Prim.Prim.:" ni32 ni36) */
v32 = ((struct sCJhc_Prim_Prim_$x3a*)v100000)->a1;
v36 = ((struct sCJhc_Prim_Prim_$x3a*)v100000)->a2;
{ uint32_t v216085086;
gc_frame0(gc,1,v36);
wptr_t v100002 = eval(gc,arena,v32);
v216085086 = ((uint32_t)RAW_GET_UF(v100002));
uint32_t v124940230 = v216085086;
jhc_utf8_putchar((int)v124940230);
v10 = v36;
goto fJhc_Monad_72__go__5;
}
}
}
}
static wptr_t A_STD A_MALLOC
fR$__fPrelude_IO_getLine(gc_t gc,arena_t arena)
{
wptr_t v31;
uint32_t v120703926;
v31 = fPrelude_IO_getChar(gc,arena);
sptr_t v99618412 = demote(v31);
v120703926 = ((uint32_t)RAW_GET_UF(v31));
if (10 == v120703926) {
return SET_RAW_TAG(CJhc_Prim_Prim_$BE);
} else {
{ wptr_t v71;
gc_frame0(gc,1,v99618412);
v71 = fR$__fPrelude_IO_getLine(gc,arena);
sptr_t v164622890 = demote(v71);
{ gc_frame0(gc,1,v164622890);
wptr_t x2 = s_alloc(gc,arena,public_caches(arena)->cCJhc_Prim_Prim_$x3a);
((struct sCJhc_Prim_Prim_$x3a*)x2)->a1 = v99618412;
((struct sCJhc_Prim_Prim_$x3a*)x2)->a2 = v164622890;
return x2;
}
}
}
}
static void A_STD
ftheMain(gc_t gc,arena_t arena)
{
fR$__fMain_main__6:;
{ wptr_t v6;
fPrelude_IO_putStr(gc,arena,PROMOTE(c27));
jhc_utf8_putchar((int)10);
v6 = fPrelude_IO_getLine(gc,arena);
{ gc_frame0(gc,1,v6);
fPrelude_IO_putStr(gc,arena,PROMOTE(c36));
fPrelude_IO_putStr(gc,arena,v6);
jhc_utf8_putchar((int)10);
goto fR$__fMain_main__6;
}
}
return;
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment