| 1 | char lhc_c_compile[] = "gcc '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wshadow -Wextra -Wall -Wno-unused-parameter -o IntEnum IntEnum_code.c -fomit-frame-pointer -O3"; |
|---|
| 2 | char lhc_command[] = "lhc --keep-tmp-files -dgrin -dcore-mangled -oIntEnum IntEnum.hs"; |
|---|
| 3 | char lhc_version[] = "lhc 0.6.20081216 (zhu) compiled by ghc-6.8 on a i386 running linux"; |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | #ifndef _LHC_HSFFI_H |
|---|
| 8 | #define _LHC_HSFFI_H |
|---|
| 9 | |
|---|
| 10 | #include <inttypes.h> |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | typedef int32_t HsInt; |
|---|
| 14 | typedef int8_t HsInt8; |
|---|
| 15 | typedef int16_t HsInt16; |
|---|
| 16 | typedef int32_t HsInt32; |
|---|
| 17 | typedef int64_t HsInt64; |
|---|
| 18 | |
|---|
| 19 | typedef uint32_t HsWord; |
|---|
| 20 | typedef uint8_t HsWord8; |
|---|
| 21 | typedef uint16_t HsWord16; |
|---|
| 22 | typedef uint32_t HsWord32; |
|---|
| 23 | typedef uint64_t HsWord64; |
|---|
| 24 | |
|---|
| 25 | typedef uint32_t HsChar; |
|---|
| 26 | typedef int HsBool; |
|---|
| 27 | |
|---|
| 28 | typedef double HsDouble; |
|---|
| 29 | typedef float HsFloat; |
|---|
| 30 | |
|---|
| 31 | typedef void *HsPtr; |
|---|
| 32 | typedef void (*HsFunPtr)(void); |
|---|
| 33 | typedef void *HsStablePtr; |
|---|
| 34 | |
|---|
| 35 | #define HS_BOOL_FALSE 0 |
|---|
| 36 | #define HS_BOOL_TRUE 1 |
|---|
| 37 | |
|---|
| 38 | void hs_init (int *argc, char **argv[]); |
|---|
| 39 | void hs_exit (void); |
|---|
| 40 | void hs_set_argv(int argc, char *argv[]); |
|---|
| 41 | void hs_perform_gc(void); |
|---|
| 42 | void hs_free_stable_ptr(HsStablePtr sp); |
|---|
| 43 | void hs_free_fun_ptr(HsFunPtr fp); |
|---|
| 44 | |
|---|
| 45 | #endif |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | #include <stdlib.h> |
|---|
| 50 | #include <stdio.h> |
|---|
| 51 | #include <string.h> |
|---|
| 52 | #include <unistd.h> |
|---|
| 53 | #include <wchar.h> |
|---|
| 54 | #include <limits.h> |
|---|
| 55 | #include <locale.h> |
|---|
| 56 | #include <math.h> |
|---|
| 57 | #include <assert.h> |
|---|
| 58 | #include <float.h> |
|---|
| 59 | #include <sys/times.h> |
|---|
| 60 | #include <setjmp.h> |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | #define _LHC_GC_NONE 0 |
|---|
| 66 | #define _LHC_GC_BOEHM 1 |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | #ifndef _LHC_GC |
|---|
| 70 | #define _LHC_GC _LHC_GC_NONE |
|---|
| 71 | #endif |
|---|
| 72 | |
|---|
| 73 | #ifndef _LHC_PROFILE |
|---|
| 74 | #define _LHC_PROFILE 0 |
|---|
| 75 | #endif |
|---|
| 76 | |
|---|
| 77 | #ifndef _LHC_DEBUG |
|---|
| 78 | #ifdef NDEBUG |
|---|
| 79 | #define _LHC_DEBUG 0 |
|---|
| 80 | #else |
|---|
| 81 | #define _LHC_DEBUG 1 |
|---|
| 82 | #endif |
|---|
| 83 | #endif |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | #ifdef __GNUC__ |
|---|
| 89 | #define A_ALIGNED __attribute__ ((aligned)) |
|---|
| 90 | #define A_CONST __attribute__ ((const)) |
|---|
| 91 | #define A_MALLOC __attribute__ ((malloc)) |
|---|
| 92 | #define A_MAYALIAS __attribute__ ((__may_alias__)) |
|---|
| 93 | #define A_NORETURN __attribute__ ((noreturn)) |
|---|
| 94 | #define A_PURE __attribute__ ((pure)) |
|---|
| 95 | #define A_UNUSED __attribute__ ((unused)) |
|---|
| 96 | #ifdef __i386__ |
|---|
| 97 | #define A_REGPARM __attribute__ ((fastcall)) |
|---|
| 98 | #else |
|---|
| 99 | #define A_REGPARM |
|---|
| 100 | #endif |
|---|
| 101 | #define A_STD A_REGPARM |
|---|
| 102 | |
|---|
| 103 | #else |
|---|
| 104 | #define A_ALIGNED |
|---|
| 105 | #define A_CONST |
|---|
| 106 | #define A_MALLOC |
|---|
| 107 | #define A_MAYALIAS |
|---|
| 108 | #define A_NORETURN |
|---|
| 109 | #define A_PURE |
|---|
| 110 | #define A_UNUSED |
|---|
| 111 | #define A_STD |
|---|
| 112 | #endif |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | #define A_HOT |
|---|
| 116 | #define A_COLD |
|---|
| 117 | #define A_FALIGNED |
|---|
| 118 | |
|---|
| 119 | #define STR(s) #s |
|---|
| 120 | #define XSTR(s) STR(s) |
|---|
| 121 | #define ALIGN(a,n) ((n) - 1 + ((a) - ((n) - 1) % (a))) |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | #define lhc_malloc_whnf lhc_malloc |
|---|
| 129 | #define lhc_malloc_suspension lhc_malloc |
|---|
| 130 | #define lhc_malloc_atomic lhc_malloc |
|---|
| 131 | #define lhc_malloc_atomic_whnf lhc_malloc_atomic |
|---|
| 132 | #define lhc_malloc_sanity(p,t) (1) |
|---|
| 133 | |
|---|
| 134 | extern void _start,_end; |
|---|
| 135 | |
|---|
| 136 | #if _LHC_PROFILE |
|---|
| 137 | |
|---|
| 138 | #define BUCKETS 7 |
|---|
| 139 | |
|---|
| 140 | static unsigned alloced[BUCKETS]; |
|---|
| 141 | static unsigned alloced_atomic[BUCKETS]; |
|---|
| 142 | |
|---|
| 143 | static void |
|---|
| 144 | alloc_count(int n,int atomic) |
|---|
| 145 | { |
|---|
| 146 | n = n ? ((n - 1)/sizeof(void *)) + 1 : 0; |
|---|
| 147 | n = n > BUCKETS - 1 ? BUCKETS - 1 : n; |
|---|
| 148 | (atomic ? alloced_atomic : alloced)[n]++; |
|---|
| 149 | } |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | static void |
|---|
| 153 | print_alloc_size_stats(void) { |
|---|
| 154 | char fmt[] = "%10s %10s %10s %10s %10s\n"; |
|---|
| 155 | char fmt2[] = "%10u %10u %10u %10u %10u\n"; |
|---|
| 156 | fprintf(stderr,fmt,"Size","Normal","Atomic","Total","Accum"); |
|---|
| 157 | fprintf(stderr,fmt,"----","------","------","-----","-----"); |
|---|
| 158 | unsigned accum = 0; |
|---|
| 159 | for(int i = 0; i < BUCKETS; i++) { |
|---|
| 160 | accum += alloced[i] + alloced_atomic[i]; |
|---|
| 161 | fprintf(stderr,fmt2,i,alloced[i],alloced_atomic[i],alloced_atomic[i] + alloced[i], accum); |
|---|
| 162 | } |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | #else |
|---|
| 167 | |
|---|
| 168 | #define alloc_count(x,y) |
|---|
| 169 | #define print_alloc_size_stats() |
|---|
| 170 | |
|---|
| 171 | #endif |
|---|
| 172 | |
|---|
| 173 | #if _LHC_GC == _LHC_GC_BOEHM |
|---|
| 174 | |
|---|
| 175 | #include <gc/gc.h> |
|---|
| 176 | |
|---|
| 177 | #define lhc_malloc GC_malloc |
|---|
| 178 | #undef lhc_malloc_atomic |
|---|
| 179 | #define lhc_malloc_atomic GC_malloc_atomic |
|---|
| 180 | #define lhc_free GC_free |
|---|
| 181 | |
|---|
| 182 | static inline void lhc_malloc_init(void) { GC_INIT(); } |
|---|
| 183 | static inline void lhc_alloc_print_stats(void) { GC_dump(); } |
|---|
| 184 | |
|---|
| 185 | #elif _LHC_GC == _LHC_GC_NONE |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | #define LHC_MEM_CHUNK_SIZE (1 << 20) |
|---|
| 189 | |
|---|
| 190 | static char initial_chunk[LHC_MEM_CHUNK_SIZE]; |
|---|
| 191 | |
|---|
| 192 | static void *lhc_current_chunk = initial_chunk; |
|---|
| 193 | static unsigned mem_chunks,mem_offset; |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | static inline void |
|---|
| 197 | lhc_malloc_init(void) { return; } |
|---|
| 198 | |
|---|
| 199 | static void |
|---|
| 200 | lhc_alloc_print_stats(void) { |
|---|
| 201 | fprintf(stderr, "Memory Allocated: %u bytes\n", (LHC_MEM_CHUNK_SIZE*(mem_chunks)) + mem_offset); |
|---|
| 202 | print_alloc_size_stats(); |
|---|
| 203 | } |
|---|
| 204 | |
|---|
| 205 | static void |
|---|
| 206 | lhc_malloc_grow(void) { |
|---|
| 207 | void *c = malloc(LHC_MEM_CHUNK_SIZE); |
|---|
| 208 | if(!c) { |
|---|
| 209 | fputs("Out of memory!\n",stderr); |
|---|
| 210 | abort(); |
|---|
| 211 | } |
|---|
| 212 | mem_chunks++; |
|---|
| 213 | lhc_current_chunk = c; |
|---|
| 214 | mem_offset = 0; |
|---|
| 215 | } |
|---|
| 216 | |
|---|
| 217 | static inline void * A_MALLOC |
|---|
| 218 | lhc_malloc_basic(size_t n) { |
|---|
| 219 | n = ALIGN(sizeof(void *),n); |
|---|
| 220 | if (n > (LHC_MEM_CHUNK_SIZE - mem_offset)) |
|---|
| 221 | lhc_malloc_grow(); |
|---|
| 222 | void *ret = lhc_current_chunk + mem_offset; |
|---|
| 223 | mem_offset += n; |
|---|
| 224 | return ret; |
|---|
| 225 | } |
|---|
| 226 | |
|---|
| 227 | |
|---|
| 228 | #if _LHC_DEBUG |
|---|
| 229 | |
|---|
| 230 | #define lhc_malloc(n) lhc_malloc_debug(n,__LINE__,0) |
|---|
| 231 | #undef lhc_malloc_atomic |
|---|
| 232 | #define lhc_malloc_atomic(n) lhc_malloc_debug(n,__LINE__,1) |
|---|
| 233 | |
|---|
| 234 | static void * A_MALLOC |
|---|
| 235 | lhc_malloc_debug(size_t n,int line,int atomic) { |
|---|
| 236 | alloc_count(n,atomic); |
|---|
| 237 | void *ret = lhc_malloc_basic(n + sizeof(uintptr_t)); |
|---|
| 238 | *((uintptr_t *)ret) = line; |
|---|
| 239 | return ret + sizeof(uintptr_t); |
|---|
| 240 | } |
|---|
| 241 | |
|---|
| 242 | #else |
|---|
| 243 | |
|---|
| 244 | static inline void * A_MALLOC |
|---|
| 245 | lhc_malloc(size_t n) { |
|---|
| 246 | alloc_count(n,0); |
|---|
| 247 | return lhc_malloc_basic(n); |
|---|
| 248 | } |
|---|
| 249 | |
|---|
| 250 | #undef lhc_malloc_atomic |
|---|
| 251 | static inline void * A_MALLOC |
|---|
| 252 | lhc_malloc_atomic(size_t n) { |
|---|
| 253 | alloc_count(n,1); |
|---|
| 254 | return lhc_malloc_basic(n); |
|---|
| 255 | } |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | #endif |
|---|
| 259 | |
|---|
| 260 | #endif |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | |
|---|
| 264 | |
|---|
| 265 | |
|---|
| 266 | static void _amain(void); |
|---|
| 267 | static void lhc_arch_assert(void); |
|---|
| 268 | static int lhc_argc; |
|---|
| 269 | static char **lhc_argv; |
|---|
| 270 | static char *lhc_progname; |
|---|
| 271 | static jmp_buf lhc_uncaught; |
|---|
| 272 | |
|---|
| 273 | static HsInt lhc_stdrnd[2] A_UNUSED = { 1 , 1 }; |
|---|
| 274 | |
|---|
| 275 | #if _LHC_PROFILE |
|---|
| 276 | |
|---|
| 277 | static uintmax_t lhc_prof_function_calls; |
|---|
| 278 | static uintmax_t lhc_prof_case_statements; |
|---|
| 279 | static uintmax_t lhc_prof_updates; |
|---|
| 280 | |
|---|
| 281 | #define lhc_update_inc() lhc_prof_updates++ |
|---|
| 282 | #define lhc_function_inc() lhc_prof_function_calls++ |
|---|
| 283 | #define lhc_case_inc() lhc_prof_case_statements++ |
|---|
| 284 | |
|---|
| 285 | #else |
|---|
| 286 | |
|---|
| 287 | #define lhc_update_inc() do { } while(0) |
|---|
| 288 | #define lhc_function_inc() do { } while(0) |
|---|
| 289 | #define lhc_case_inc() do { } while(0) |
|---|
| 290 | |
|---|
| 291 | #endif |
|---|
| 292 | |
|---|
| 293 | static void A_COLD |
|---|
| 294 | lhc_print_profile(void) { |
|---|
| 295 | struct tms tm; |
|---|
| 296 | times(&tm); |
|---|
| 297 | if(!(_LHC_PROFILE || getenv("LHC_RTS_PROFILE"))) return; |
|---|
| 298 | |
|---|
| 299 | fprintf(stderr, "\n-----------------\n"); |
|---|
| 300 | fprintf(stderr, "Profiling: %s\n", lhc_progname); |
|---|
| 301 | fprintf(stderr, "Command: %s\n", lhc_command); |
|---|
| 302 | fprintf(stderr, "Complie: %s\n", lhc_c_compile); |
|---|
| 303 | fprintf(stderr, "Version: %s\n\n", lhc_version); |
|---|
| 304 | lhc_alloc_print_stats(); |
|---|
| 305 | float cpt = (float)sysconf(_SC_CLK_TCK); |
|---|
| 306 | fprintf(stderr, "User Time: %.2fs\n", (float)tm.tms_utime/cpt); |
|---|
| 307 | fprintf(stderr, "System Time: %.2fs\n", (float)tm.tms_stime/cpt); |
|---|
| 308 | fprintf(stderr, "Total Time: %.2fs\n", (float)(tm.tms_stime + tm.tms_utime)/cpt); |
|---|
| 309 | |
|---|
| 310 | #if _LHC_PROFILE |
|---|
| 311 | fprintf(stderr, "\nFunction Calls: %llu\n", (unsigned long long)lhc_prof_function_calls); |
|---|
| 312 | fprintf(stderr, "Case Statements: %llu\n", (unsigned long long)lhc_prof_case_statements); |
|---|
| 313 | fprintf(stderr, "Updates: %llu\n", (unsigned long long)lhc_prof_updates); |
|---|
| 314 | #endif |
|---|
| 315 | fprintf(stderr, "-----------------\n"); |
|---|
| 316 | } |
|---|
| 317 | |
|---|
| 318 | |
|---|
| 319 | static void A_NORETURN A_UNUSED A_COLD |
|---|
| 320 | lhc_exit(int n) { |
|---|
| 321 | lhc_print_profile(); |
|---|
| 322 | exit(n); |
|---|
| 323 | } |
|---|
| 324 | |
|---|
| 325 | static void A_NORETURN A_UNUSED A_COLD |
|---|
| 326 | lhc_error(char *s) { |
|---|
| 327 | fputs(s,stderr); |
|---|
| 328 | fputs("\n",stderr); |
|---|
| 329 | lhc_print_profile(); |
|---|
| 330 | exit(255); |
|---|
| 331 | } |
|---|
| 332 | |
|---|
| 333 | static void A_NORETURN A_UNUSED A_COLD |
|---|
| 334 | lhc_case_fell_off(int n) { |
|---|
| 335 | fflush(stdout); |
|---|
| 336 | fprintf(stderr, "\n%s:%i: case fell off\n", __FILE__, n); |
|---|
| 337 | abort(); |
|---|
| 338 | } |
|---|
| 339 | |
|---|
| 340 | #define lhc_setjmp(jb) sigsetjmp(*(jmp_buf *)jb,0) |
|---|
| 341 | #define lhc_longjmp(jb) siglongjmp(*(jmp_buf *)jb,1) |
|---|
| 342 | |
|---|
| 343 | struct lhc_continuation { |
|---|
| 344 | void *argument; |
|---|
| 345 | jmp_buf jump_buf; |
|---|
| 346 | }; |
|---|
| 347 | |
|---|
| 348 | #define prim_umaxbound(t) ((t)~((t)0)) |
|---|
| 349 | #define prim_maxbound(t) ((t)(~((t)1 << (sizeof(t)*8 - 1)))) |
|---|
| 350 | #define prim_minbound(t) ((t)(((t)1 << (sizeof(t)*8 - 1)))) |
|---|
| 351 | |
|---|
| 352 | |
|---|
| 353 | inline static int A_UNUSED |
|---|
| 354 | lhc_utf8_getchar(void) |
|---|
| 355 | { |
|---|
| 356 | return getchar_unlocked(); |
|---|
| 357 | } |
|---|
| 358 | |
|---|
| 359 | inline static int A_UNUSED |
|---|
| 360 | lhc_utf8_getc(FILE *f) |
|---|
| 361 | { |
|---|
| 362 | return getc_unlocked(f); |
|---|
| 363 | } |
|---|
| 364 | |
|---|
| 365 | inline static int A_UNUSED |
|---|
| 366 | lhc_utf8_putchar(int ch) |
|---|
| 367 | { |
|---|
| 368 | return putchar_unlocked(ch); |
|---|
| 369 | } |
|---|
| 370 | |
|---|
| 371 | inline static int A_UNUSED |
|---|
| 372 | lhc_utf8_putc(int ch, FILE *f) |
|---|
| 373 | { |
|---|
| 374 | return putc_unlocked(ch,f); |
|---|
| 375 | } |
|---|
| 376 | |
|---|
| 377 | |
|---|
| 378 | int A_COLD |
|---|
| 379 | main(int argc, char *argv[]) |
|---|
| 380 | { |
|---|
| 381 | |
|---|
| 382 | |
|---|
| 383 | |
|---|
| 384 | |
|---|
| 385 | assert(sizeof(HsPtr) == sizeof(HsFunPtr)); |
|---|
| 386 | assert(sizeof(HsPtr) == sizeof(intptr_t)); |
|---|
| 387 | assert(sizeof(HsPtr) == sizeof(uintptr_t)); |
|---|
| 388 | assert(CHAR_BIT == 8); |
|---|
| 389 | assert(EOF == -1); |
|---|
| 390 | |
|---|
| 391 | lhc_arch_assert(); |
|---|
| 392 | lhc_malloc_init(); |
|---|
| 393 | lhc_argc = argc - 1; |
|---|
| 394 | lhc_argv = argv + 1; |
|---|
| 395 | lhc_progname = argv[0]; |
|---|
| 396 | setlocale(LC_ALL,""); |
|---|
| 397 | if (sigsetjmp(lhc_uncaught,0)) |
|---|
| 398 | lhc_error("Uncaught Exception"); |
|---|
| 399 | else |
|---|
| 400 | _amain(); |
|---|
| 401 | lhc_print_profile(); |
|---|
| 402 | return 0; |
|---|
| 403 | } |
|---|
| 404 | |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | |
|---|
| 408 | |
|---|
| 409 | #define ISLAZY(x) (((uintptr_t)(x)) & 0x1) |
|---|
| 410 | #define DETAG(x) ((uintptr_t)(x) & ~0x3) |
|---|
| 411 | #define GETTAG(x) ((uintptr_t)(x) & 0x3) |
|---|
| 412 | |
|---|
| 413 | #define GETHEAD(x) (NODEP(x)->head) |
|---|
| 414 | #define NODEP(x) ((node_t *)(x)) |
|---|
| 415 | #define DNODEP(x) ((dnode_t *)(x)) |
|---|
| 416 | #define EVALTAG(fn) (assert(((uintptr_t)(fn) & 0x3) == 0),(sptr_t)((uintptr_t)(fn) | P_LAZY)) |
|---|
| 417 | #define EVALTAGC(fn) ((sptr_t)((void *)(fn) + P_LAZY)) |
|---|
| 418 | #define EVALFUNC(fn) ((fptr_t)((uintptr_t)(fn) | P_FUNC)) |
|---|
| 419 | #define VALUE(n) ((wptr_t)(((intptr_t)(n) << 2) | P_VALUE)) |
|---|
| 420 | #define GETVALUE(n) ((intptr_t)(n) >> 2) |
|---|
| 421 | #define ISVALUE(n) (assert(!ISLAZY(n)), ((uintptr_t)(n) & 0x2)) |
|---|
| 422 | #define PROMOTE(n) ((wptr_t)(n)) |
|---|
| 423 | #define DEMOTE(n) ((sptr_t)(n)) |
|---|
| 424 | #define GETWHAT(x) (GETTAG(x) == P_VALUE ? ((uintptr_t)(x) >> 16) : DNODEP(x)->what) |
|---|
| 425 | |
|---|
| 426 | #define SETWHAT(x,v) (DNODEP(x)->what = (v)) |
|---|
| 427 | #define RAWWHAT(w) (wptr_t)(((uintptr_t)w << 16) | P_VALUE) |
|---|
| 428 | |
|---|
| 429 | |
|---|
| 430 | #define P_WHNF 0x0 |
|---|
| 431 | #define P_LAZY 0x1 |
|---|
| 432 | #define P_VALUE 0x2 |
|---|
| 433 | #define P_FUNC 0x3 |
|---|
| 434 | |
|---|
| 435 | #define BLACK_HOLE ((fptr_t)0xDEADBEEF) |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | |
|---|
| 439 | |
|---|
| 440 | |
|---|
| 441 | |
|---|
| 442 | |
|---|
| 443 | |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | |
|---|
| 450 | |
|---|
| 451 | |
|---|
| 452 | |
|---|
| 453 | |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | |
|---|
| 459 | |
|---|
| 460 | |
|---|
| 461 | |
|---|
| 462 | |
|---|
| 463 | |
|---|
| 464 | |
|---|
| 465 | |
|---|
| 466 | |
|---|
| 467 | |
|---|
| 468 | |
|---|
| 469 | |
|---|
| 470 | |
|---|
| 471 | |
|---|
| 472 | |
|---|
| 473 | |
|---|
| 474 | |
|---|
| 475 | |
|---|
| 476 | |
|---|
| 477 | |
|---|
| 478 | |
|---|
| 479 | |
|---|
| 480 | |
|---|
| 481 | |
|---|
| 482 | |
|---|
| 483 | |
|---|
| 484 | |
|---|
| 485 | |
|---|
| 486 | |
|---|
| 487 | |
|---|
| 488 | |
|---|
| 489 | |
|---|
| 490 | |
|---|
| 491 | |
|---|
| 492 | |
|---|
| 493 | |
|---|
| 494 | |
|---|
| 495 | |
|---|
| 496 | |
|---|
| 497 | |
|---|
| 498 | |
|---|
| 499 | |
|---|
| 500 | |
|---|
| 501 | |
|---|
| 502 | |
|---|
| 503 | |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | |
|---|
| 509 | |
|---|
| 510 | |
|---|
| 511 | |
|---|
| 512 | |
|---|
| 513 | |
|---|
| 514 | |
|---|
| 515 | |
|---|
| 516 | |
|---|
| 517 | |
|---|
| 518 | |
|---|
| 519 | |
|---|
| 520 | |
|---|
| 521 | |
|---|
| 522 | |
|---|
| 523 | |
|---|
| 524 | |
|---|
| 525 | |
|---|
| 526 | |
|---|
| 527 | typedef struct node * sptr_t; |
|---|
| 528 | typedef struct dnode * wptr_t; |
|---|
| 529 | typedef void * fptr_t; |
|---|
| 530 | typedef uintptr_t what_t; |
|---|
| 531 | |
|---|
| 532 | |
|---|
| 533 | typedef struct node { |
|---|
| 534 | fptr_t head; |
|---|
| 535 | sptr_t rest[]; |
|---|
| 536 | } A_MAYALIAS node_t; |
|---|
| 537 | |
|---|
| 538 | typedef struct dnode { |
|---|
| 539 | what_t what; |
|---|
| 540 | sptr_t rest[]; |
|---|
| 541 | } A_MAYALIAS dnode_t; |
|---|
| 542 | |
|---|
| 543 | #if _LHC_DEBUG |
|---|
| 544 | |
|---|
| 545 | |
|---|
| 546 | uintptr_t _dummy1; |
|---|
| 547 | node_t *_dummy2; |
|---|
| 548 | dnode_t *_dummy3; |
|---|
| 549 | sptr_t *_dummy4; |
|---|
| 550 | fptr_t *_dummy5; |
|---|
| 551 | wptr_t *_dummy6; |
|---|
| 552 | |
|---|
| 553 | |
|---|
| 554 | static int A_UNUSED |
|---|
| 555 | lhc_valid_whnf(wptr_t s) |
|---|
| 556 | { |
|---|
| 557 | return ((GETTAG(s) == P_VALUE) || ((GETTAG(s) == P_WHNF) && lhc_malloc_sanity(s,P_WHNF))); |
|---|
| 558 | } |
|---|
| 559 | |
|---|
| 560 | static int A_UNUSED |
|---|
| 561 | lhc_valid_lazy(sptr_t s) |
|---|
| 562 | { |
|---|
| 563 | if(lhc_valid_whnf((wptr_t)s)) |
|---|
| 564 | return 1; |
|---|
| 565 | assert(GETTAG(s) == P_LAZY); |
|---|
| 566 | node_t *ds = (sptr_t)DETAG(s); |
|---|
| 567 | assert(lhc_malloc_sanity(ds,P_LAZY)); |
|---|
| 568 | if(ISLAZY(ds->head)) { |
|---|
| 569 | if(ds->head == BLACK_HOLE) return 1; |
|---|
| 570 | assert(GETTAG(ds->head) == P_FUNC); |
|---|
| 571 | fptr_t dhead = (fptr_t)DETAG(ds->head); |
|---|
| 572 | assert(dhead >= &_start && dhead < &_end); |
|---|
| 573 | return 1; |
|---|
| 574 | } else |
|---|
| 575 | return lhc_valid_whnf((wptr_t)ds->head); |
|---|
| 576 | } |
|---|
| 577 | |
|---|
| 578 | |
|---|
| 579 | #else |
|---|
| 580 | |
|---|
| 581 | #define lhc_valid_whnf(x) 1 |
|---|
| 582 | #define lhc_valid_lazy(x) 1 |
|---|
| 583 | |
|---|
| 584 | #endif |
|---|
| 585 | |
|---|
| 586 | |
|---|
| 587 | typedef wptr_t (*eval_fn)(node_t *node) A_STD; |
|---|
| 588 | |
|---|
| 589 | |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | static inline wptr_t A_STD A_UNUSED A_HOT |
|---|
| 593 | promote(sptr_t s) |
|---|
| 594 | { |
|---|
| 595 | assert(!ISLAZY(s)); |
|---|
| 596 | assert(lhc_valid_whnf((wptr_t)s)); |
|---|
| 597 | return (wptr_t)s; |
|---|
| 598 | } |
|---|
| 599 | |
|---|
| 600 | static inline sptr_t A_STD A_UNUSED A_HOT |
|---|
| 601 | demote(wptr_t s) |
|---|
| 602 | { |
|---|
| 603 | assert(!ISLAZY(s)); |
|---|
| 604 | assert(lhc_valid_whnf(s)); |
|---|
| 605 | return (sptr_t)s; |
|---|
| 606 | } |
|---|
| 607 | |
|---|
| 608 | |
|---|
| 609 | static inline wptr_t A_STD A_UNUSED A_HOT |
|---|
| 610 | follow(sptr_t s) |
|---|
| 611 | { |
|---|
| 612 | assert(lhc_valid_lazy(s)); |
|---|
| 613 | if(ISLAZY(s)) { |
|---|
| 614 | sptr_t h = (sptr_t)(GETHEAD(DETAG(s))); |
|---|
| 615 | assert(!ISLAZY(h)); |
|---|
| 616 | return (wptr_t)h; |
|---|
| 617 | } |
|---|
| 618 | return (wptr_t)s; |
|---|
| 619 | } |
|---|
| 620 | |
|---|
| 621 | static inline wptr_t A_STD A_UNUSED A_HOT |
|---|
| 622 | eval(sptr_t s) |
|---|
| 623 | { |
|---|
| 624 | assert(lhc_valid_lazy(s)); |
|---|
| 625 | if(ISLAZY(s)) { |
|---|
| 626 | assert(GETTAG(s) == P_LAZY); |
|---|
| 627 | void *ds = (void *)DETAG(s); |
|---|
| 628 | sptr_t h = (sptr_t)(GETHEAD(ds)); |
|---|
| 629 | assert(h != BLACK_HOLE); |
|---|
| 630 | if(ISLAZY(h)) { |
|---|
| 631 | eval_fn fn = (eval_fn)DETAG(h); |
|---|
| 632 | #if _LHC_DEBUG |
|---|
| 633 | GETHEAD(ds) = BLACK_HOLE; |
|---|
| 634 | #endif |
|---|
| 635 | wptr_t r = (*fn)(NODEP(ds)); |
|---|
| 636 | #if _LHC_DEBUG |
|---|
| 637 | assert(GETHEAD(ds) != BLACK_HOLE); |
|---|
| 638 | #endif |
|---|
| 639 | return r; |
|---|
| 640 | } |
|---|
| 641 | return (wptr_t)h; |
|---|
| 642 | } |
|---|
| 643 | assert(lhc_valid_whnf((wptr_t)s)); |
|---|
| 644 | return (wptr_t)s; |
|---|
| 645 | } |
|---|
| 646 | |
|---|
| 647 | |
|---|
| 648 | static inline void A_STD A_UNUSED A_HOT |
|---|
| 649 | update(sptr_t thunk, wptr_t new) |
|---|
| 650 | { |
|---|
| 651 | lhc_update_inc(); |
|---|
| 652 | assert(GETHEAD(thunk) == BLACK_HOLE); |
|---|
| 653 | assert(!ISLAZY(new)); |
|---|
| 654 | GETHEAD(thunk) = (fptr_t)new; |
|---|
| 655 | } |
|---|
| 656 | |
|---|
| 657 | |
|---|
| 658 | |
|---|
| 659 | |
|---|
| 660 | static void |
|---|
| 661 | lhc_arch_assert(void) |
|---|
| 662 | { |
|---|
| 663 | assert(sizeof(uint32_t) == 4); |
|---|
| 664 | assert(sizeof(HsChar) == 4); |
|---|
| 665 | assert(sizeof(int) == 4); |
|---|
| 666 | assert(sizeof(intmax_t) == 8); |
|---|
| 667 | assert(sizeof(int8_t) == 1); |
|---|
| 668 | assert(sizeof(int16_t) == 2); |
|---|
| 669 | assert(sizeof(int32_t) == 4); |
|---|
| 670 | assert(sizeof(int64_t) == 8); |
|---|
| 671 | assert(sizeof(intmax_t) == 8); |
|---|
| 672 | assert(sizeof(intptr_t) == 4); |
|---|
| 673 | assert(sizeof(unsigned int) == 4); |
|---|
| 674 | assert(sizeof(uint8_t) == 1); |
|---|
| 675 | assert(sizeof(uint16_t) == 2); |
|---|
| 676 | assert(sizeof(uint32_t) == 4); |
|---|
| 677 | assert(sizeof(uint64_t) == 8); |
|---|
| 678 | assert(sizeof(uintmax_t) == 8); |
|---|
| 679 | assert(sizeof(uintptr_t) == 4); |
|---|
| 680 | assert(sizeof(float) == 4); |
|---|
| 681 | assert(sizeof(double) == 8); |
|---|
| 682 | assert(sizeof(HsPtr) == 4); |
|---|
| 683 | assert(sizeof(HsFunPtr) == 4); |
|---|
| 684 | assert(sizeof(char) == 1); |
|---|
| 685 | assert(sizeof(short) == 2); |
|---|
| 686 | assert(sizeof(int) == 4); |
|---|
| 687 | assert(sizeof(unsigned int) == 4); |
|---|
| 688 | assert(sizeof(size_t) == 4); |
|---|
| 689 | assert(sizeof(wchar_t) == 4); |
|---|
| 690 | assert(sizeof(wint_t) == 4); |
|---|
| 691 | } |
|---|
| 692 | #include <stdio.h> |
|---|
| 693 | |
|---|
| 694 | enum { |
|---|
| 695 | CLhc__Basics___L_R = 0, |
|---|
| 696 | CLhc__Prim__Char = 0, |
|---|
| 697 | CLhc__Prim___x3a = 0, |
|---|
| 698 | CLhc__Prim___x5b_x5d = 1, |
|---|
| 699 | P1_uLhc__Show__showsPrec_d4 = 0, |
|---|
| 700 | P1_uLhc__Show__showsPrec_d5 = 1, |
|---|
| 701 | TLhc__Prim__Int = 2, |
|---|
| 702 | TLhc__Prim___x5b_x5d = 3 |
|---|
| 703 | }; |
|---|
| 704 | struct sBap_u1_uLhc__Show__showsPrec_u100016 A_ALIGNED; |
|---|
| 705 | struct sBap_u1_uLhc__Show__showsPrec_u100028 A_ALIGNED; |
|---|
| 706 | struct sCLhc__Prim___x3a A_ALIGNED; |
|---|
| 707 | struct sFLhc__Show__shows A_ALIGNED; |
|---|
| 708 | struct sFLhc__Show__showsPrec_d2 A_ALIGNED; |
|---|
| 709 | struct sFLhc__Show__showsPrec_d3 A_ALIGNED; |
|---|
| 710 | struct sFW_a__fLhc__Inst__Show__showWord A_ALIGNED; |
|---|
| 711 | struct sFtheMain_d2 A_ALIGNED; |
|---|
| 712 | struct sFtheMain_d3 A_ALIGNED; |
|---|
| 713 | struct sFtheMain_d4 A_ALIGNED; |
|---|
| 714 | struct sFtheMain_d5 A_ALIGNED; |
|---|
| 715 | struct sP1_uLhc__Show__showsPrec_d4 A_ALIGNED; |
|---|
| 716 | struct sP1_uLhc__Show__showsPrec_d5 A_ALIGNED; |
|---|
| 717 | struct sTLhc__Prim___x5b_x5d A_ALIGNED; |
|---|
| 718 | |
|---|
| 719 | struct sBap_u1_uLhc__Show__showsPrec_u100016 { |
|---|
| 720 | |
|---|
| 721 | fptr_t head; |
|---|
| 722 | sptr_t a1; |
|---|
| 723 | sptr_t a2; |
|---|
| 724 | }; |
|---|
| 725 | |
|---|
| 726 | struct sBap_u1_uLhc__Show__showsPrec_u100028 { |
|---|
| 727 | |
|---|
| 728 | fptr_t head; |
|---|
| 729 | sptr_t a1; |
|---|
| 730 | sptr_t a2; |
|---|
| 731 | }; |
|---|
| 732 | |
|---|
| 733 | struct sCLhc__Prim___x3a { |
|---|
| 734 | what_t what; |
|---|
| 735 | sptr_t a1; |
|---|
| 736 | sptr_t a2; |
|---|
| 737 | }; |
|---|
| 738 | |
|---|
| 739 | struct sFLhc__Show__shows { |
|---|
| 740 | |
|---|
| 741 | fptr_t head; |
|---|
| 742 | sptr_t a1; |
|---|
| 743 | sptr_t a2; |
|---|
| 744 | }; |
|---|
| 745 | |
|---|
| 746 | struct sFLhc__Show__showsPrec_d2 { |
|---|
| 747 | |
|---|
| 748 | fptr_t head; |
|---|
| 749 | sptr_t a1; |
|---|
| 750 | sptr_t a2; |
|---|
| 751 | }; |
|---|
| 752 | |
|---|
| 753 | struct sFLhc__Show__showsPrec_d3 { |
|---|
| 754 | |
|---|
| 755 | fptr_t head; |
|---|
| 756 | sptr_t a1; |
|---|
| 757 | sptr_t a2; |
|---|
| 758 | }; |
|---|
| 759 | |
|---|
| 760 | struct sFW_a__fLhc__Inst__Show__showWord { |
|---|
| 761 | |
|---|
| 762 | fptr_t head; |
|---|
| 763 | sptr_t a2; |
|---|
| 764 | uint32_t a1; |
|---|
| 765 | }; |
|---|
| 766 | |
|---|
| 767 | struct sFtheMain_d2 { |
|---|
| 768 | |
|---|
| 769 | fptr_t head; |
|---|
| 770 | sptr_t a2; |
|---|
| 771 | uint32_t a1; |
|---|
| 772 | }; |
|---|
| 773 | |
|---|
| 774 | struct sFtheMain_d3 { |
|---|
| 775 | |
|---|
| 776 | fptr_t head; |
|---|
| 777 | uint32_t a1; |
|---|
| 778 | }; |
|---|
| 779 | |
|---|
| 780 | struct sFtheMain_d4 { |
|---|
| 781 | |
|---|
| 782 | fptr_t head; |
|---|
| 783 | }; |
|---|
| 784 | |
|---|
| 785 | struct sFtheMain_d5 { |
|---|
| 786 | |
|---|
| 787 | fptr_t head; |
|---|
| 788 | }; |
|---|
| 789 | |
|---|
| 790 | struct sP1_uLhc__Show__showsPrec_d4 { |
|---|
| 791 | what_t what; |
|---|
| 792 | uint32_t a1; |
|---|
| 793 | }; |
|---|
| 794 | |
|---|
| 795 | struct sP1_uLhc__Show__showsPrec_d5 { |
|---|
| 796 | what_t what; |
|---|
| 797 | uint32_t a1; |
|---|
| 798 | }; |
|---|
| 799 | |
|---|
| 800 | struct sTLhc__Prim___x5b_x5d { |
|---|
| 801 | what_t what; |
|---|
| 802 | wptr_t a1; |
|---|
| 803 | }; |
|---|
| 804 | |
|---|
| 805 | |
|---|
| 806 | |
|---|
| 807 | static node_t _g957878805; |
|---|
| 808 | #define g957878805 (EVALTAGC(&_g957878805)) |
|---|
| 809 | |
|---|
| 810 | |
|---|
| 811 | static node_t _g966922773; |
|---|
| 812 | #define g966922773 (EVALTAGC(&_g966922773)) |
|---|
| 813 | |
|---|
| 814 | |
|---|
| 815 | static const struct sTLhc__Prim___x5b_x5d _c1 = {.what = TLhc__Prim___x5b_x5d, .a1 = RAWWHAT(TLhc__Prim__Int)}; |
|---|
| 816 | #define c1 ((sptr_t)&_c1) |
|---|
| 817 | |
|---|
| 818 | static const struct sCLhc__Prim___x3a _c2 = {.what = CLhc__Prim___x3a, .a1 = (sptr_t)VALUE(']'), .a2 = (sptr_t)RAWWHAT(CLhc__Prim___x5b_x5d)}; |
|---|
| 819 | #define c2 ((sptr_t)&_c2) |
|---|
| 820 | |
|---|
| 821 | static const struct sCLhc__Prim___x3a _c3 = {.what = CLhc__Prim___x3a, .a1 = (sptr_t)VALUE('['), .a2 = c2}; |
|---|
| 822 | #define c3 ((sptr_t)&_c3) |
|---|
| 823 | void _amain(void) ; |
|---|
| 824 | static void b_umain(void) A_STD; |
|---|
| 825 | static wptr_t bap_u1_uLhc__Show__showsPrec_u100016(sptr_t v86,sptr_t v88) A_STD A_MALLOC; |
|---|
| 826 | static wptr_t bap_u1_uLhc__Show__showsPrec_u100028(sptr_t v87,sptr_t v89) A_STD A_MALLOC; |
|---|
| 827 | static wptr_t bapply_u12329(wptr_t v1,sptr_t v2) A_STD A_MALLOC; |
|---|
| 828 | static wptr_t fLhc__Show__shows(sptr_t v1559062240,sptr_t v1902233550) A_STD A_MALLOC; |
|---|
| 829 | static wptr_t fLhc__Show__showsPrec(wptr_t v1876430363,sptr_t v114079652,sptr_t v1989490482,sptr_t v1378948956) A_STD A_MALLOC; |
|---|
| 830 | static wptr_t fLhc__Show__showsPrec_d2(sptr_t v508,sptr_t v510) A_STD A_MALLOC; |
|---|
| 831 | static wptr_t fLhc__Show__showsPrec_d3(sptr_t v528,sptr_t v530) A_STD A_MALLOC; |
|---|
| 832 | static wptr_t fLhc__Show__showsPrec_d4(uint32_t v622,sptr_t v554) A_STD A_MALLOC; |
|---|
| 833 | static wptr_t fLhc__Show__showsPrec_d5(uint32_t v641,sptr_t v590) A_STD A_MALLOC; |
|---|
| 834 | static wptr_t fW_a__fLhc__Inst__Show__showWord(uint32_t v1368789043,sptr_t v1372065837) A_STD A_MALLOC; |
|---|
| 835 | static wptr_t fW_a__fR_a__fLhc__Inst__Show__showWord(uint32_t v1499950522,sptr_t v280340684) A_STD A_MALLOC; |
|---|
| 836 | static void ftheMain(void) A_STD; |
|---|
| 837 | static wptr_t ftheMain_d2(uint32_t v674,sptr_t v676) A_STD A_MALLOC; |
|---|
| 838 | static wptr_t ftheMain_d3(uint32_t v420) A_STD A_MALLOC; |
|---|
| 839 | static wptr_t ftheMain_d4(void) A_STD A_MALLOC; |
|---|
| 840 | static wptr_t ftheMain_d5(void) A_STD A_MALLOC; |
|---|
| 841 | static sptr_t ftheMain_d6(sptr_t v710) A_STD A_MALLOC; |
|---|
| 842 | static wptr_t lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100016(struct sBap_u1_uLhc__Show__showsPrec_u100016* arg) A_STD A_FALIGNED; |
|---|
| 843 | static wptr_t lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100028(struct sBap_u1_uLhc__Show__showsPrec_u100028* arg) A_STD A_FALIGNED; |
|---|
| 844 | static wptr_t lhc_ueval_ufLhc__Show__shows(struct sFLhc__Show__shows* arg) A_STD A_FALIGNED; |
|---|
| 845 | static wptr_t lhc_ueval_ufLhc__Show__showsPrec_d2(struct sFLhc__Show__showsPrec_d2* arg) A_STD A_FALIGNED; |
|---|
| 846 | static wptr_t lhc_ueval_ufLhc__Show__showsPrec_d3(struct sFLhc__Show__showsPrec_d3* arg) A_STD A_FALIGNED; |
|---|
| 847 | static wptr_t lhc_ueval_ufW_a__fLhc__Inst__Show__showWord(struct sFW_a__fLhc__Inst__Show__showWord* arg) A_STD A_FALIGNED; |
|---|
| 848 | static wptr_t lhc_ueval_uftheMain_d2(struct sFtheMain_d2* arg) A_STD A_FALIGNED; |
|---|
| 849 | static wptr_t lhc_ueval_uftheMain_d3(struct sFtheMain_d3* arg) A_STD A_FALIGNED; |
|---|
| 850 | static wptr_t lhc_ueval_uftheMain_d4(struct sFtheMain_d4* arg) A_STD A_FALIGNED; |
|---|
| 851 | static wptr_t lhc_ueval_uftheMain_d5(struct sFtheMain_d5* arg) A_STD A_FALIGNED; |
|---|
| 852 | |
|---|
| 853 | void |
|---|
| 854 | _amain(void) |
|---|
| 855 | { |
|---|
| 856 | |
|---|
| 857 | return (void)b_umain(); |
|---|
| 858 | } |
|---|
| 859 | |
|---|
| 860 | static void A_STD |
|---|
| 861 | b_umain(void) |
|---|
| 862 | { |
|---|
| 863 | |
|---|
| 864 | lhc_function_inc(); |
|---|
| 865 | lhc_update_inc(); |
|---|
| 866 | ((struct sFtheMain_d4*)DETAG(g957878805))->head = EVALFUNC(&lhc_ueval_uftheMain_d4); |
|---|
| 867 | lhc_update_inc(); |
|---|
| 868 | ((struct sFtheMain_d5*)DETAG(g966922773))->head = EVALFUNC(&lhc_ueval_uftheMain_d5); |
|---|
| 869 | return ftheMain(); |
|---|
| 870 | } |
|---|
| 871 | |
|---|
| 872 | static wptr_t A_STD A_MALLOC |
|---|
| 873 | bap_u1_uLhc__Show__showsPrec_u100016(sptr_t v86,sptr_t v88) |
|---|
| 874 | { |
|---|
| 875 | |
|---|
| 876 | lhc_function_inc(); |
|---|
| 877 | wptr_t v100018 = promote(v86); |
|---|
| 878 | return bapply_u12329(v100018,v88); |
|---|
| 879 | } |
|---|
| 880 | |
|---|
| 881 | static wptr_t A_STD A_MALLOC |
|---|
| 882 | bap_u1_uLhc__Show__showsPrec_u100028(sptr_t v87,sptr_t v89) |
|---|
| 883 | { |
|---|
| 884 | |
|---|
| 885 | lhc_function_inc(); |
|---|
| 886 | wptr_t v100030 = promote(v87); |
|---|
| 887 | return bapply_u12329(v100030,v89); |
|---|
| 888 | } |
|---|
| 889 | |
|---|
| 890 | static wptr_t A_STD A_MALLOC |
|---|
| 891 | bapply_u12329(wptr_t v1,sptr_t v2) |
|---|
| 892 | { |
|---|
| 893 | |
|---|
| 894 | lhc_function_inc(); |
|---|
| 895 | lhc_case_inc(); |
|---|
| 896 | if (P1_uLhc__Show__showsPrec_d5 == GETWHAT(v1)) { |
|---|
| 897 | uint32_t v3; |
|---|
| 898 | v3 = ((struct sP1_uLhc__Show__showsPrec_d5*)v1)->a1; |
|---|
| 899 | return fLhc__Show__showsPrec_d5(v3,v2); |
|---|
| 900 | } else { |
|---|
| 901 | uint32_t v7; |
|---|
| 902 | |
|---|
| 903 | assert(P1_uLhc__Show__showsPrec_d4 == GETWHAT(v1)); |
|---|
| 904 | v7 = ((struct sP1_uLhc__Show__showsPrec_d4*)v1)->a1; |
|---|
| 905 | return fLhc__Show__showsPrec_d4(v7,v2); |
|---|
| 906 | } |
|---|
| 907 | } |
|---|
| 908 | |
|---|
| 909 | static wptr_t A_STD A_MALLOC |
|---|
| 910 | fLhc__Show__shows(sptr_t v1559062240,sptr_t v1902233550) |
|---|
| 911 | { |
|---|
| 912 | |
|---|
| 913 | lhc_function_inc(); |
|---|
| 914 | return fLhc__Show__showsPrec(RAWWHAT(TLhc__Prim__Int),(sptr_t)VALUE(0),v1559062240,v1902233550); |
|---|
| 915 | } |
|---|
| 916 | |
|---|
| 917 | static wptr_t A_STD A_MALLOC |
|---|
| 918 | fLhc__Show__showsPrec(wptr_t v1876430363,sptr_t v114079652,sptr_t v1989490482,sptr_t v1378948956) |
|---|
| 919 | { |
|---|
| 920 | |
|---|
| 921 | lhc_function_inc(); |
|---|
| 922 | lhc_case_inc(); |
|---|
| 923 | if (RAWWHAT(TLhc__Prim__Int) == v1876430363) { |
|---|
| 924 | wptr_t v100008; |
|---|
| 925 | uint32_t v671; |
|---|
| 926 | |
|---|
| 927 | v100008 = eval(v1989490482); |
|---|
| 928 | v671 = ((uint32_t)GETVALUE(v100008)); |
|---|
| 929 | uint16_t v100010 = (v671 == prim_minbound(uint32_t)); |
|---|
| 930 | lhc_case_inc(); |
|---|
| 931 | if (0 == v100010) { |
|---|
| 932 | |
|---|
| 933 | uint16_t v100022 = (((int32_t)0) > ((int32_t)v671)); |
|---|
| 934 | lhc_case_inc(); |
|---|
| 935 | if (0 == v100022) { |
|---|
| 936 | |
|---|
| 937 | return fW_a__fLhc__Inst__Show__showWord(v671,v1378948956); |
|---|
| 938 | } else { |
|---|
| 939 | uint32_t v586; |
|---|
| 940 | |
|---|
| 941 | assert(1 == v100022); |
|---|
| 942 | wptr_t v100024 = promote(v114079652); |
|---|
| 943 | v586 = ((uint32_t)GETVALUE(v100024)); |
|---|
| 944 | sptr_t x6 = lhc_malloc_atomic(sizeof(struct sP1_uLhc__Show__showsPrec_d5)); |
|---|
| 945 | SETWHAT((struct sP1_uLhc__Show__showsPrec_d5*)x6,P1_uLhc__Show__showsPrec_d5); |
|---|
| 946 | ((struct sP1_uLhc__Show__showsPrec_d5*)x6)->a1 = v671; |
|---|
| 947 | sptr_t v588 = x6; |
|---|
| 948 | uint16_t v100026 = (((int32_t)6) < ((int32_t)v586)); |
|---|
| 949 | lhc_case_inc(); |
|---|
| 950 | if (0 == v100026) { |
|---|
| 951 | |
|---|
| 952 | return fLhc__Show__showsPrec_d5(v671,v1378948956); |
|---|
| 953 | } else { |
|---|
| 954 | |
|---|
| 955 | |
|---|
| 956 | assert(1 == v100026); |
|---|
| 957 | sptr_t x7 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 958 | SETWHAT((struct sCLhc__Prim___x3a*)x7,CLhc__Prim___x3a); |
|---|
| 959 | ((struct sCLhc__Prim___x3a*)x7)->a1 = ((sptr_t)VALUE(')')); |
|---|
| 960 | ((struct sCLhc__Prim___x3a*)x7)->a2 = v1378948956; |
|---|
| 961 | sptr_t v598 = x7; |
|---|
| 962 | sptr_t x8 = lhc_malloc(sizeof(struct sBap_u1_uLhc__Show__showsPrec_u100028)); |
|---|
| 963 | ((struct sBap_u1_uLhc__Show__showsPrec_u100028*)x8)->head = EVALFUNC(&lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100028); |
|---|
| 964 | ((struct sBap_u1_uLhc__Show__showsPrec_u100028*)x8)->a1 = v588; |
|---|
| 965 | ((struct sBap_u1_uLhc__Show__showsPrec_u100028*)x8)->a2 = v598; |
|---|
| 966 | sptr_t v600 = EVALTAG(x8); |
|---|
| 967 | wptr_t x9 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 968 | SETWHAT((struct sCLhc__Prim___x3a*)x9,CLhc__Prim___x3a); |
|---|
| 969 | ((struct sCLhc__Prim___x3a*)x9)->a1 = ((sptr_t)VALUE('(')); |
|---|
| 970 | ((struct sCLhc__Prim___x3a*)x9)->a2 = v600; |
|---|
| 971 | return x9; |
|---|
| 972 | } |
|---|
| 973 | } |
|---|
| 974 | } else { |
|---|
| 975 | uint32_t v550; |
|---|
| 976 | |
|---|
| 977 | assert(1 == v100010); |
|---|
| 978 | wptr_t v100012 = promote(v114079652); |
|---|
| 979 | v550 = ((uint32_t)GETVALUE(v100012)); |
|---|
| 980 | sptr_t x10 = lhc_malloc_atomic(sizeof(struct sP1_uLhc__Show__showsPrec_d4)); |
|---|
| 981 | SETWHAT((struct sP1_uLhc__Show__showsPrec_d4*)x10,P1_uLhc__Show__showsPrec_d4); |
|---|
| 982 | ((struct sP1_uLhc__Show__showsPrec_d4*)x10)->a1 = v671; |
|---|
| 983 | sptr_t v552 = x10; |
|---|
| 984 | uint16_t v100014 = (((int32_t)6) < ((int32_t)v550)); |
|---|
| 985 | lhc_case_inc(); |
|---|
| 986 | if (0 == v100014) { |
|---|
| 987 | |
|---|
| 988 | return fLhc__Show__showsPrec_d4(v671,v1378948956); |
|---|
| 989 | } else { |
|---|
| 990 | |
|---|
| 991 | |
|---|
| 992 | assert(1 == v100014); |
|---|
| 993 | sptr_t x11 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 994 | SETWHAT((struct sCLhc__Prim___x3a*)x11,CLhc__Prim___x3a); |
|---|
| 995 | ((struct sCLhc__Prim___x3a*)x11)->a1 = ((sptr_t)VALUE(')')); |
|---|
| 996 | ((struct sCLhc__Prim___x3a*)x11)->a2 = v1378948956; |
|---|
| 997 | sptr_t v578 = x11; |
|---|
| 998 | sptr_t x12 = lhc_malloc(sizeof(struct sBap_u1_uLhc__Show__showsPrec_u100016)); |
|---|
| 999 | ((struct sBap_u1_uLhc__Show__showsPrec_u100016*)x12)->head = EVALFUNC(&lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100016); |
|---|
| 1000 | ((struct sBap_u1_uLhc__Show__showsPrec_u100016*)x12)->a1 = v552; |
|---|
| 1001 | ((struct sBap_u1_uLhc__Show__showsPrec_u100016*)x12)->a2 = v578; |
|---|
| 1002 | sptr_t v580 = EVALTAG(x12); |
|---|
| 1003 | wptr_t x13 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1004 | SETWHAT((struct sCLhc__Prim___x3a*)x13,CLhc__Prim___x3a); |
|---|
| 1005 | ((struct sCLhc__Prim___x3a*)x13)->a1 = ((sptr_t)VALUE('(')); |
|---|
| 1006 | ((struct sCLhc__Prim___x3a*)x13)->a2 = v580; |
|---|
| 1007 | return x13; |
|---|
| 1008 | } |
|---|
| 1009 | } |
|---|
| 1010 | } else { |
|---|
| 1011 | wptr_t v100006; |
|---|
| 1012 | |
|---|
| 1013 | assert(TLhc__Prim___x5b_x5d == GETWHAT(v1876430363)); |
|---|
| 1014 | |
|---|
| 1015 | v100006 = eval(v1989490482); |
|---|
| 1016 | lhc_case_inc(); |
|---|
| 1017 | if (RAWWHAT(CLhc__Prim___x5b_x5d) == v100006) { |
|---|
| 1018 | |
|---|
| 1019 | return fLhc__Show__showsPrec_d3(c3,v1378948956); |
|---|
| 1020 | } else { |
|---|
| 1021 | sptr_t v498; |
|---|
| 1022 | sptr_t v500; |
|---|
| 1023 | |
|---|
| 1024 | assert(CLhc__Prim___x3a == GETWHAT(v100006)); |
|---|
| 1025 | v498 = ((struct sCLhc__Prim___x3a*)v100006)->a1; |
|---|
| 1026 | v500 = ((struct sCLhc__Prim___x3a*)v100006)->a2; |
|---|
| 1027 | sptr_t x14 = lhc_malloc(sizeof(struct sFLhc__Show__showsPrec_d2)); |
|---|
| 1028 | ((struct sFLhc__Show__showsPrec_d2*)x14)->head = EVALFUNC(&lhc_ueval_ufLhc__Show__showsPrec_d2); |
|---|
| 1029 | ((struct sFLhc__Show__showsPrec_d2*)x14)->a1 = v500; |
|---|
| 1030 | ((struct sFLhc__Show__showsPrec_d2*)x14)->a2 = v1378948956; |
|---|
| 1031 | sptr_t v502 = EVALTAG(x14); |
|---|
| 1032 | sptr_t x15 = lhc_malloc(sizeof(struct sFLhc__Show__shows)); |
|---|
| 1033 | ((struct sFLhc__Show__shows*)x15)->head = EVALFUNC(&lhc_ueval_ufLhc__Show__shows); |
|---|
| 1034 | ((struct sFLhc__Show__shows*)x15)->a1 = v498; |
|---|
| 1035 | ((struct sFLhc__Show__shows*)x15)->a2 = v502; |
|---|
| 1036 | sptr_t v504 = EVALTAG(x15); |
|---|
| 1037 | wptr_t x16 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1038 | SETWHAT((struct sCLhc__Prim___x3a*)x16,CLhc__Prim___x3a); |
|---|
| 1039 | ((struct sCLhc__Prim___x3a*)x16)->a1 = ((sptr_t)VALUE('[')); |
|---|
| 1040 | ((struct sCLhc__Prim___x3a*)x16)->a2 = v504; |
|---|
| 1041 | return x16; |
|---|
| 1042 | } |
|---|
| 1043 | } |
|---|
| 1044 | } |
|---|
| 1045 | |
|---|
| 1046 | static wptr_t A_STD A_MALLOC |
|---|
| 1047 | fLhc__Show__showsPrec_d2(sptr_t v508,sptr_t v510) |
|---|
| 1048 | { |
|---|
| 1049 | wptr_t v100034; |
|---|
| 1050 | lhc_function_inc(); |
|---|
| 1051 | |
|---|
| 1052 | v100034 = eval(v508); |
|---|
| 1053 | lhc_case_inc(); |
|---|
| 1054 | if (RAWWHAT(CLhc__Prim___x5b_x5d) == v100034) { |
|---|
| 1055 | |
|---|
| 1056 | wptr_t x23 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1057 | SETWHAT((struct sCLhc__Prim___x3a*)x23,CLhc__Prim___x3a); |
|---|
| 1058 | ((struct sCLhc__Prim___x3a*)x23)->a1 = ((sptr_t)VALUE(']')); |
|---|
| 1059 | ((struct sCLhc__Prim___x3a*)x23)->a2 = v510; |
|---|
| 1060 | return x23; |
|---|
| 1061 | } else { |
|---|
| 1062 | sptr_t v514; |
|---|
| 1063 | sptr_t v516; |
|---|
| 1064 | |
|---|
| 1065 | assert(CLhc__Prim___x3a == GETWHAT(v100034)); |
|---|
| 1066 | v514 = ((struct sCLhc__Prim___x3a*)v100034)->a1; |
|---|
| 1067 | v516 = ((struct sCLhc__Prim___x3a*)v100034)->a2; |
|---|
| 1068 | sptr_t x24 = lhc_malloc(sizeof(struct sFLhc__Show__showsPrec_d2)); |
|---|
| 1069 | ((struct sFLhc__Show__showsPrec_d2*)x24)->head = EVALFUNC(&lhc_ueval_ufLhc__Show__showsPrec_d2); |
|---|
| 1070 | ((struct sFLhc__Show__showsPrec_d2*)x24)->a1 = v516; |
|---|
| 1071 | ((struct sFLhc__Show__showsPrec_d2*)x24)->a2 = v510; |
|---|
| 1072 | sptr_t v518 = EVALTAG(x24); |
|---|
| 1073 | sptr_t x25 = lhc_malloc(sizeof(struct sFLhc__Show__shows)); |
|---|
| 1074 | ((struct sFLhc__Show__shows*)x25)->head = EVALFUNC(&lhc_ueval_ufLhc__Show__shows); |
|---|
| 1075 | ((struct sFLhc__Show__shows*)x25)->a1 = v514; |
|---|
| 1076 | ((struct sFLhc__Show__shows*)x25)->a2 = v518; |
|---|
| 1077 | sptr_t v520 = EVALTAG(x25); |
|---|
| 1078 | wptr_t x26 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1079 | SETWHAT((struct sCLhc__Prim___x3a*)x26,CLhc__Prim___x3a); |
|---|
| 1080 | ((struct sCLhc__Prim___x3a*)x26)->a1 = ((sptr_t)VALUE(',')); |
|---|
| 1081 | ((struct sCLhc__Prim___x3a*)x26)->a2 = v520; |
|---|
| 1082 | return x26; |
|---|
| 1083 | } |
|---|
| 1084 | } |
|---|
| 1085 | |
|---|
| 1086 | static wptr_t A_STD A_MALLOC |
|---|
| 1087 | fLhc__Show__showsPrec_d3(sptr_t v528,sptr_t v530) |
|---|
| 1088 | { |
|---|
| 1089 | wptr_t v100036; |
|---|
| 1090 | lhc_function_inc(); |
|---|
| 1091 | |
|---|
| 1092 | v100036 = eval(v528); |
|---|
| 1093 | lhc_case_inc(); |
|---|
| 1094 | if (RAWWHAT(CLhc__Prim___x5b_x5d) == v100036) { |
|---|
| 1095 | |
|---|
| 1096 | return eval(v530); |
|---|
| 1097 | } else { |
|---|
| 1098 | sptr_t v534; |
|---|
| 1099 | sptr_t v536; |
|---|
| 1100 | |
|---|
| 1101 | assert(CLhc__Prim___x3a == GETWHAT(v100036)); |
|---|
| 1102 | v534 = ((struct sCLhc__Prim___x3a*)v100036)->a1; |
|---|
| 1103 | v536 = ((struct sCLhc__Prim___x3a*)v100036)->a2; |
|---|
| 1104 | sptr_t x19 = lhc_malloc(sizeof(struct sFLhc__Show__showsPrec_d3)); |
|---|
| 1105 | ((struct sFLhc__Show__showsPrec_d3*)x19)->head = EVALFUNC(&lhc_ueval_ufLhc__Show__showsPrec_d3); |
|---|
| 1106 | ((struct sFLhc__Show__showsPrec_d3*)x19)->a1 = v536; |
|---|
| 1107 | ((struct sFLhc__Show__showsPrec_d3*)x19)->a2 = v530; |
|---|
| 1108 | sptr_t v538 = EVALTAG(x19); |
|---|
| 1109 | wptr_t x20 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1110 | SETWHAT((struct sCLhc__Prim___x3a*)x20,CLhc__Prim___x3a); |
|---|
| 1111 | ((struct sCLhc__Prim___x3a*)x20)->a1 = v534; |
|---|
| 1112 | ((struct sCLhc__Prim___x3a*)x20)->a2 = v538; |
|---|
| 1113 | return x20; |
|---|
| 1114 | } |
|---|
| 1115 | } |
|---|
| 1116 | |
|---|
| 1117 | static wptr_t A_STD A_MALLOC |
|---|
| 1118 | fLhc__Show__showsPrec_d4(uint32_t v622,sptr_t v554) |
|---|
| 1119 | { |
|---|
| 1120 | |
|---|
| 1121 | lhc_function_inc(); |
|---|
| 1122 | sptr_t x21 = lhc_malloc(sizeof(struct sFW_a__fLhc__Inst__Show__showWord)); |
|---|
| 1123 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x21)->head = EVALFUNC(&lhc_ueval_ufW_a__fLhc__Inst__Show__showWord); |
|---|
| 1124 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x21)->a1 = v622; |
|---|
| 1125 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x21)->a2 = v554; |
|---|
| 1126 | sptr_t v556 = EVALTAG(x21); |
|---|
| 1127 | wptr_t x22 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1128 | SETWHAT((struct sCLhc__Prim___x3a*)x22,CLhc__Prim___x3a); |
|---|
| 1129 | ((struct sCLhc__Prim___x3a*)x22)->a1 = ((sptr_t)VALUE('-')); |
|---|
| 1130 | ((struct sCLhc__Prim___x3a*)x22)->a2 = v556; |
|---|
| 1131 | return x22; |
|---|
| 1132 | } |
|---|
| 1133 | |
|---|
| 1134 | static wptr_t A_STD A_MALLOC |
|---|
| 1135 | fLhc__Show__showsPrec_d5(uint32_t v641,sptr_t v590) |
|---|
| 1136 | { |
|---|
| 1137 | |
|---|
| 1138 | lhc_function_inc(); |
|---|
| 1139 | uint32_t v592 = (-((int32_t)v641)); |
|---|
| 1140 | sptr_t x17 = lhc_malloc(sizeof(struct sFW_a__fLhc__Inst__Show__showWord)); |
|---|
| 1141 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x17)->head = EVALFUNC(&lhc_ueval_ufW_a__fLhc__Inst__Show__showWord); |
|---|
| 1142 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x17)->a1 = v592; |
|---|
| 1143 | ((struct sFW_a__fLhc__Inst__Show__showWord*)x17)->a2 = v590; |
|---|
| 1144 | sptr_t v594 = EVALTAG(x17); |
|---|
| 1145 | wptr_t x18 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1146 | SETWHAT((struct sCLhc__Prim___x3a*)x18,CLhc__Prim___x3a); |
|---|
| 1147 | ((struct sCLhc__Prim___x3a*)x18)->a1 = ((sptr_t)VALUE('-')); |
|---|
| 1148 | ((struct sCLhc__Prim___x3a*)x18)->a2 = v594; |
|---|
| 1149 | return x18; |
|---|
| 1150 | } |
|---|
| 1151 | |
|---|
| 1152 | static wptr_t A_STD A_MALLOC |
|---|
| 1153 | fW_a__fLhc__Inst__Show__showWord(uint32_t v1368789043,sptr_t v1372065837) |
|---|
| 1154 | { |
|---|
| 1155 | |
|---|
| 1156 | lhc_function_inc(); |
|---|
| 1157 | return fW_a__fR_a__fLhc__Inst__Show__showWord(v1368789043,v1372065837); |
|---|
| 1158 | } |
|---|
| 1159 | |
|---|
| 1160 | static wptr_t A_STD A_MALLOC |
|---|
| 1161 | fW_a__fR_a__fLhc__Inst__Show__showWord(uint32_t v1499950522,sptr_t v280340684) |
|---|
| 1162 | { |
|---|
| 1163 | |
|---|
| 1164 | lhc_function_inc(); |
|---|
| 1165 | uint32_t v752 = (v1499950522 / 10); |
|---|
| 1166 | uint32_t v762 = (v1499950522 % 10); |
|---|
| 1167 | uint32_t v1241062752 = (48 + v762); |
|---|
| 1168 | sptr_t v2192046 = ((sptr_t)VALUE(v1241062752)); |
|---|
| 1169 | lhc_case_inc(); |
|---|
| 1170 | if (0 == v752) { |
|---|
| 1171 | |
|---|
| 1172 | wptr_t x27 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1173 | SETWHAT((struct sCLhc__Prim___x3a*)x27,CLhc__Prim___x3a); |
|---|
| 1174 | ((struct sCLhc__Prim___x3a*)x27)->a1 = v2192046; |
|---|
| 1175 | ((struct sCLhc__Prim___x3a*)x27)->a2 = v280340684; |
|---|
| 1176 | return x27; |
|---|
| 1177 | } else { |
|---|
| 1178 | |
|---|
| 1179 | sptr_t x28 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1180 | SETWHAT((struct sCLhc__Prim___x3a*)x28,CLhc__Prim___x3a); |
|---|
| 1181 | ((struct sCLhc__Prim___x3a*)x28)->a1 = v2192046; |
|---|
| 1182 | ((struct sCLhc__Prim___x3a*)x28)->a2 = v280340684; |
|---|
| 1183 | sptr_t v1379012655 = x28; |
|---|
| 1184 | return fW_a__fR_a__fLhc__Inst__Show__showWord(v752,v1379012655); |
|---|
| 1185 | } |
|---|
| 1186 | } |
|---|
| 1187 | |
|---|
| 1188 | static void A_STD |
|---|
| 1189 | ftheMain(void) |
|---|
| 1190 | { |
|---|
| 1191 | wptr_t v100038; |
|---|
| 1192 | lhc_function_inc(); |
|---|
| 1193 | |
|---|
| 1194 | v100038 = fLhc__Show__showsPrec(PROMOTE(c1),(sptr_t)VALUE(0),g966922773,(sptr_t)RAWWHAT(CLhc__Prim___x5b_x5d)); |
|---|
| 1195 | sptr_t v442 = demote(v100038); |
|---|
| 1196 | ftheMain_d6(v442); |
|---|
| 1197 | return (void)lhc_utf8_putchar((int)10); |
|---|
| 1198 | } |
|---|
| 1199 | |
|---|
| 1200 | static wptr_t A_STD A_MALLOC |
|---|
| 1201 | ftheMain_d2(uint32_t v674,sptr_t v676) |
|---|
| 1202 | { |
|---|
| 1203 | |
|---|
| 1204 | lhc_function_inc(); |
|---|
| 1205 | uint16_t v100042 = (((int32_t)0) >= ((int32_t)v674)); |
|---|
| 1206 | lhc_case_inc(); |
|---|
| 1207 | if (0 == v100042) { |
|---|
| 1208 | wptr_t v100044; |
|---|
| 1209 | |
|---|
| 1210 | v100044 = eval(v676); |
|---|
| 1211 | lhc_case_inc(); |
|---|
| 1212 | if (RAWWHAT(CLhc__Prim___x5b_x5d) == v100044) { |
|---|
| 1213 | |
|---|
| 1214 | return v100044; |
|---|
| 1215 | } else { |
|---|
| 1216 | sptr_t v682; |
|---|
| 1217 | sptr_t v684; |
|---|
| 1218 | |
|---|
| 1219 | assert(CLhc__Prim___x3a == GETWHAT(v100044)); |
|---|
| 1220 | v682 = ((struct sCLhc__Prim___x3a*)v100044)->a1; |
|---|
| 1221 | v684 = ((struct sCLhc__Prim___x3a*)v100044)->a2; |
|---|
| 1222 | uint32_t v686 = (v674 - 1); |
|---|
| 1223 | sptr_t x2 = lhc_malloc(sizeof(struct sFtheMain_d2)); |
|---|
| 1224 | ((struct sFtheMain_d2*)x2)->head = EVALFUNC(&lhc_ueval_uftheMain_d2); |
|---|
| 1225 | ((struct sFtheMain_d2*)x2)->a1 = v686; |
|---|
| 1226 | ((struct sFtheMain_d2*)x2)->a2 = v684; |
|---|
| 1227 | sptr_t v688 = EVALTAG(x2); |
|---|
| 1228 | wptr_t x3 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1229 | SETWHAT((struct sCLhc__Prim___x3a*)x3,CLhc__Prim___x3a); |
|---|
| 1230 | ((struct sCLhc__Prim___x3a*)x3)->a1 = v682; |
|---|
| 1231 | ((struct sCLhc__Prim___x3a*)x3)->a2 = v688; |
|---|
| 1232 | return x3; |
|---|
| 1233 | } |
|---|
| 1234 | } else { |
|---|
| 1235 | |
|---|
| 1236 | |
|---|
| 1237 | assert(1 == v100042); |
|---|
| 1238 | return RAWWHAT(CLhc__Prim___x5b_x5d); |
|---|
| 1239 | } |
|---|
| 1240 | } |
|---|
| 1241 | |
|---|
| 1242 | static wptr_t A_STD A_MALLOC |
|---|
| 1243 | ftheMain_d3(uint32_t v420) |
|---|
| 1244 | { |
|---|
| 1245 | |
|---|
| 1246 | lhc_function_inc(); |
|---|
| 1247 | sptr_t v422 = ((sptr_t)VALUE(v420)); |
|---|
| 1248 | uint16_t v100046 = (((int32_t)v420) <= ((int32_t)prim_maxbound(uint32_t))); |
|---|
| 1249 | lhc_case_inc(); |
|---|
| 1250 | if (0 == v100046) { |
|---|
| 1251 | |
|---|
| 1252 | return RAWWHAT(CLhc__Prim___x5b_x5d); |
|---|
| 1253 | } else { |
|---|
| 1254 | |
|---|
| 1255 | |
|---|
| 1256 | assert(1 == v100046); |
|---|
| 1257 | uint32_t v428 = (v420 + (33554431 - 16777215)); |
|---|
| 1258 | sptr_t x4 = lhc_malloc(sizeof(struct sFtheMain_d3)); |
|---|
| 1259 | ((struct sFtheMain_d3*)x4)->head = EVALFUNC(&lhc_ueval_uftheMain_d3); |
|---|
| 1260 | ((struct sFtheMain_d3*)x4)->a1 = v428; |
|---|
| 1261 | sptr_t v430 = EVALTAG(x4); |
|---|
| 1262 | wptr_t x5 = lhc_malloc(sizeof(struct sCLhc__Prim___x3a)); |
|---|
| 1263 | SETWHAT((struct sCLhc__Prim___x3a*)x5,CLhc__Prim___x3a); |
|---|
| 1264 | ((struct sCLhc__Prim___x3a*)x5)->a1 = v422; |
|---|
| 1265 | ((struct sCLhc__Prim___x3a*)x5)->a2 = v430; |
|---|
| 1266 | return x5; |
|---|
| 1267 | } |
|---|
| 1268 | } |
|---|
| 1269 | |
|---|
| 1270 | static wptr_t A_STD A_MALLOC |
|---|
| 1271 | ftheMain_d4(void) |
|---|
| 1272 | { |
|---|
| 1273 | |
|---|
| 1274 | lhc_function_inc(); |
|---|
| 1275 | return ftheMain_d3(16777215); |
|---|
| 1276 | } |
|---|
| 1277 | |
|---|
| 1278 | static wptr_t A_STD A_MALLOC |
|---|
| 1279 | ftheMain_d5(void) |
|---|
| 1280 | { |
|---|
| 1281 | |
|---|
| 1282 | lhc_function_inc(); |
|---|
| 1283 | return ftheMain_d2(257,g957878805); |
|---|
| 1284 | } |
|---|
| 1285 | |
|---|
| 1286 | static sptr_t A_STD A_MALLOC |
|---|
| 1287 | ftheMain_d6(sptr_t v710) |
|---|
| 1288 | { |
|---|
| 1289 | wptr_t v100048; |
|---|
| 1290 | lhc_function_inc(); |
|---|
| 1291 | |
|---|
| 1292 | v100048 = eval(v710); |
|---|
| 1293 | lhc_case_inc(); |
|---|
| 1294 | if (RAWWHAT(CLhc__Prim___x5b_x5d) == v100048) { |
|---|
| 1295 | |
|---|
| 1296 | return (sptr_t)RAWWHAT(CLhc__Basics___L_R); |
|---|
| 1297 | } else { |
|---|
| 1298 | wptr_t v100050; |
|---|
| 1299 | sptr_t v714; |
|---|
| 1300 | sptr_t v716; |
|---|
| 1301 | uint32_t v304; |
|---|
| 1302 | |
|---|
| 1303 | assert(CLhc__Prim___x3a == GETWHAT(v100048)); |
|---|
| 1304 | v714 = ((struct sCLhc__Prim___x3a*)v100048)->a1; |
|---|
| 1305 | v716 = ((struct sCLhc__Prim___x3a*)v100048)->a2; |
|---|
| 1306 | |
|---|
| 1307 | v100050 = eval(v714); |
|---|
| 1308 | v304 = ((uint32_t)GETVALUE(v100050)); |
|---|
| 1309 | (void)lhc_utf8_putchar((int)v304); |
|---|
| 1310 | return ftheMain_d6(v716); |
|---|
| 1311 | } |
|---|
| 1312 | } |
|---|
| 1313 | |
|---|
| 1314 | static wptr_t A_STD A_FALIGNED |
|---|
| 1315 | lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100016(struct sBap_u1_uLhc__Show__showsPrec_u100016* arg) |
|---|
| 1316 | { |
|---|
| 1317 | wptr_t r; |
|---|
| 1318 | r = bap_u1_uLhc__Show__showsPrec_u100016(arg->a1,arg->a2); |
|---|
| 1319 | update((sptr_t)arg,r); |
|---|
| 1320 | return r; |
|---|
| 1321 | } |
|---|
| 1322 | |
|---|
| 1323 | static wptr_t A_STD A_FALIGNED |
|---|
| 1324 | lhc_ueval_ubap_u1_uLhc__Show__showsPrec_u100028(struct sBap_u1_uLhc__Show__showsPrec_u100028* arg) |
|---|
| 1325 | { |
|---|
| 1326 | wptr_t r; |
|---|
| 1327 | r = bap_u1_uLhc__Show__showsPrec_u100028(arg->a1,arg->a2); |
|---|
| 1328 | update((sptr_t)arg,r); |
|---|
| 1329 | return r; |
|---|
| 1330 | } |
|---|
| 1331 | |
|---|
| 1332 | static wptr_t A_STD A_FALIGNED |
|---|
| 1333 | lhc_ueval_ufLhc__Show__shows(struct sFLhc__Show__shows* arg) |
|---|
| 1334 | { |
|---|
| 1335 | wptr_t r; |
|---|
| 1336 | r = fLhc__Show__shows(arg->a1,arg->a2); |
|---|
| 1337 | update((sptr_t)arg,r); |
|---|
| 1338 | return r; |
|---|
| 1339 | } |
|---|
| 1340 | |
|---|
| 1341 | static wptr_t A_STD A_FALIGNED |
|---|
| 1342 | lhc_ueval_ufLhc__Show__showsPrec_d2(struct sFLhc__Show__showsPrec_d2* arg) |
|---|
| 1343 | { |
|---|
| 1344 | wptr_t r; |
|---|
| 1345 | r = fLhc__Show__showsPrec_d2(arg->a1,arg->a2); |
|---|
| 1346 | update((sptr_t)arg,r); |
|---|
| 1347 | return r; |
|---|
| 1348 | } |
|---|
| 1349 | |
|---|
| 1350 | static wptr_t A_STD A_FALIGNED |
|---|
| 1351 | lhc_ueval_ufLhc__Show__showsPrec_d3(struct sFLhc__Show__showsPrec_d3* arg) |
|---|
| 1352 | { |
|---|
| 1353 | wptr_t r; |
|---|
| 1354 | r = fLhc__Show__showsPrec_d3(arg->a1,arg->a2); |
|---|
| 1355 | update((sptr_t)arg,r); |
|---|
| 1356 | return r; |
|---|
| 1357 | } |
|---|
| 1358 | |
|---|
| 1359 | static wptr_t A_STD A_FALIGNED |
|---|
| 1360 | lhc_ueval_ufW_a__fLhc__Inst__Show__showWord(struct sFW_a__fLhc__Inst__Show__showWord* arg) |
|---|
| 1361 | { |
|---|
| 1362 | wptr_t r; |
|---|
| 1363 | r = fW_a__fLhc__Inst__Show__showWord(arg->a1,arg->a2); |
|---|
| 1364 | update((sptr_t)arg,r); |
|---|
| 1365 | return r; |
|---|
| 1366 | } |
|---|
| 1367 | |
|---|
| 1368 | static wptr_t A_STD A_FALIGNED |
|---|
| 1369 | lhc_ueval_uftheMain_d2(struct sFtheMain_d2* arg) |
|---|
| 1370 | { |
|---|
| 1371 | wptr_t r; |
|---|
| 1372 | r = ftheMain_d2(arg->a1,arg->a2); |
|---|
| 1373 | update((sptr_t)arg,r); |
|---|
| 1374 | return r; |
|---|
| 1375 | } |
|---|
| 1376 | |
|---|
| 1377 | static wptr_t A_STD A_FALIGNED |
|---|
| 1378 | lhc_ueval_uftheMain_d3(struct sFtheMain_d3* arg) |
|---|
| 1379 | { |
|---|
| 1380 | wptr_t r; |
|---|
| 1381 | r = ftheMain_d3(arg->a1); |
|---|
| 1382 | update((sptr_t)arg,r); |
|---|
| 1383 | return r; |
|---|
| 1384 | } |
|---|
| 1385 | |
|---|
| 1386 | static wptr_t A_STD A_FALIGNED |
|---|
| 1387 | lhc_ueval_uftheMain_d4(struct sFtheMain_d4* arg) |
|---|
| 1388 | { |
|---|
| 1389 | wptr_t r; |
|---|
| 1390 | r = ftheMain_d4(); |
|---|
| 1391 | update((sptr_t)arg,r); |
|---|
| 1392 | return r; |
|---|
| 1393 | } |
|---|
| 1394 | |
|---|
| 1395 | static wptr_t A_STD A_FALIGNED |
|---|
| 1396 | lhc_ueval_uftheMain_d5(struct sFtheMain_d5* arg) |
|---|
| 1397 | { |
|---|
| 1398 | wptr_t r; |
|---|
| 1399 | r = ftheMain_d5(); |
|---|
| 1400 | update((sptr_t)arg,r); |
|---|
| 1401 | return r; |
|---|
| 1402 | } |
|---|