#include #include #include #include #include #include #include #include #include #include #include #include #include #include int _global_argc; const char** _global_argv; static size_t from_dash_integral0 ( int64_t x67 ) { return ( (size_t ) ( x67 ) ); } struct env1 { ; size_t starting_dash_size1947; ; ; ; ; ; ; ; ; ; size_t growth_dash_factor1948; ; }; enum Unit_4 { Unit_4_Unit, }; enum CAllocator_6 { CAllocator_6_CAllocator, }; struct Slice_7 { uint8_t * f_ptr; size_t f_count; }; struct List_5 { enum CAllocator_6 f_al; struct Slice_7 f_elements; size_t f_count; }; struct envunion3 { enum Unit_4 (*fun) ( struct env1* , struct List_5 * ); struct env1 env; }; struct env2 { ; struct env1 envinst1; ; ; ; ; }; struct envunion9 { enum Unit_4 (*fun) ( struct env2* , struct List_5 * , uint8_t ); struct env2 env; }; struct env8 { ; ; struct env2 envinst2; ; ; ; }; struct envunion11 { enum Unit_4 (*fun) ( struct env8* , struct List_5 * , struct Slice_7 ); struct env8 env; }; struct env10 { ; ; struct env8 envinst8; }; struct StrBuilder_14 { struct List_5 f_chars; }; struct envunion13 { enum Unit_4 (*fun) ( struct env10* , struct StrBuilder_14 * , struct Slice_7 ); struct env10 env; }; struct env12 { struct env10 envinst10; ; ; ; }; struct Char_17 { uint8_t * f_ptr; size_t f_num_dash_bytes; }; struct envunion16 { enum Unit_4 (*fun) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ); struct env12 env; }; struct env15 { ; ; ; ; ; ; struct env12 envinst12; }; struct env18 { ; ; ; ; ; ; struct env12 envinst12; }; struct env19 { ; ; ; ; ; ; struct env12 envinst12; }; struct StrView_25 { struct Slice_7 f_contents; }; struct StrConcat_24 { const char* field0; struct StrView_25 field1; }; static struct StrConcat_24 StrConcat_24_StrConcat ( const char* field0 , struct StrView_25 field1 ) { return ( struct StrConcat_24 ) { .field0 = field0 , .field1 = field1 }; }; struct StrCase_23 { enum { StrCase_23_StrCase1_t, StrCase_23_StrCase2_t, } tag; union { struct { const char* field0; } StrCase_23_StrCase1_s; struct { struct StrConcat_24 field0; } StrCase_23_StrCase2_s; } stuff; }; static struct StrCase_23 StrCase_23_StrCase1 ( const char* field0 ) { return ( struct StrCase_23 ) { .tag = StrCase_23_StrCase1_t, .stuff = { .StrCase_23_StrCase1_s = { .field0 = field0 } } }; }; static struct StrCase_23 StrCase_23_StrCase2 ( struct StrConcat_24 field0 ) { return ( struct StrCase_23 ) { .tag = StrCase_23_StrCase2_t, .stuff = { .StrCase_23_StrCase2_s = { .field0 = field0 } } }; }; struct StrConcat_22 { struct StrCase_23 field0; struct StrView_25 field1; }; static struct StrConcat_22 StrConcat_22_StrConcat ( struct StrCase_23 field0 , struct StrView_25 field1 ) { return ( struct StrConcat_22 ) { .field0 = field0 , .field1 = field1 }; }; struct envunion21 { enum Unit_4 (*fun) ( struct env15* , struct StrBuilder_14 * , struct StrConcat_22 ); struct env15 env; }; struct envunion26 { enum Unit_4 (*fun) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ); struct env12 env; }; struct env20 { ; ; ; ; ; ; ; ; ; ; struct env15 envinst15; struct env12 envinst12; }; struct StrConcat_29 { struct StrConcat_22 field0; struct StrView_25 field1; }; static struct StrConcat_29 StrConcat_29_StrConcat ( struct StrConcat_22 field0 , struct StrView_25 field1 ) { return ( struct StrConcat_29 ) { .field0 = field0 , .field1 = field1 }; }; struct envunion28 { enum Unit_4 (*fun) ( struct env18* , struct StrBuilder_14 * , struct StrConcat_29 ); struct env18 env; }; struct env27 { ; ; ; ; ; ; ; ; ; ; struct env18 envinst18; struct env12 envinst12; }; struct envunion31 { enum Unit_4 (*fun) ( struct env19* , struct StrBuilder_14 * , struct StrBuilder_14 ); struct env19 env; }; struct env30 { ; ; ; ; ; ; ; ; ; ; struct env19 envinst19; struct env12 envinst12; }; struct envunion33 { struct StrView_25 (*fun) ( struct env20* , struct StrConcat_22 , enum CAllocator_6 ); struct env20 env; }; struct env32 { ; struct env20 envinst20; ; ; ; ; ; }; struct envunion35 { struct StrView_25 (*fun) ( struct env27* , struct StrConcat_29 , enum CAllocator_6 ); struct env27 env; }; struct env34 { ; struct env27 envinst27; ; ; ; ; ; }; struct envunion37 { struct StrView_25 (*fun) ( struct env30* , struct StrBuilder_14 , enum CAllocator_6 ); struct env30 env; }; struct env36 { ; ; struct env30 envinst30; ; ; ; ; }; struct envunion39 { const char* (*fun) ( struct env36* , struct StrBuilder_14 , enum CAllocator_6 ); struct env36 env; }; struct env38 { ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; struct env36 envinst36; ; ; ; }; struct envunion41 { enum Unit_4 (*fun) ( struct env38* , struct StrBuilder_14 , enum CAllocator_6 ); struct env38 env; }; struct envunion42 { enum Unit_4 (*fun) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ); struct env12 env; }; struct env40 { ; ; struct env38 envinst38; ; ; ; ; ; struct env12 envinst12; ; ; ; ; ; ; ; }; static uint32_t cast43 ( int32_t x346 ) { return ( (uint32_t ) ( x346 ) ); } static void * cast_dash_ptr47 ( void * * p349 ) { return ( (void * ) ( p349 ) ); } static int32_t from_dash_integral48 ( int64_t x49 ) { return ( (int32_t ) ( x49 ) ); } static size_t size_dash_of49 ( void * x340 ) { return ( sizeof( ( x340 ) ) ); } static void * zeroed45 ( ) { void * temp46; void * x549 = ( temp46 ); ( ( memset ) ( ( ( cast_dash_ptr47 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of49 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static void * null_dash_c_dash_ptr44 ( ) { return ( ( zeroed45 ) ( ) ); } struct env51 { ; ; ; bool * should_dash_resize3140; ; ; ; ; ; ; ; ; ; ; }; struct env52 { ; bool * should_dash_resize3140; ; ; }; enum ColorPalette_56 { ColorPalette_56_Palette8, ColorPalette_56_Palette16, ColorPalette_56_Palette256, ColorPalette_56_PaletteRGB, }; struct Array_58 { uint8_t _arr [32]; }; struct Termios_57 { uint32_t f_c_dash_iflag; uint32_t f_c_dash_oflag; uint32_t f_c_dash_cflag; uint32_t f_c_dash_lflag; uint8_t f_c_dash_line; struct Array_58 f_c_dash_cc; uint32_t f_c_dash_ispeed; uint32_t f_c_dash_ospeed; }; struct Tui_55 { uint32_t f_width; uint32_t f_height; uint32_t f_target_dash_fps; uint32_t f_actual_dash_fps; enum ColorPalette_56 f_palette; struct timespec f_last_dash_sync; struct timespec f_fps_dash_ts; uint32_t f_fps_dash_count; struct Termios_57 f_orig_dash_termios; bool f_should_dash_redraw; }; struct envunion54 { bool (*fun) ( struct env52* , struct Tui_55 * ); struct env52 env; }; struct env53 { ; struct env52 envinst52; }; struct envunion60 { bool (*fun) ( struct env52* , struct Tui_55 * ); struct env52 env; }; struct env59 { ; ; ; ; ; struct env52 envinst52; }; struct envunion62 { const char* (*fun) ( struct env32* , struct StrConcat_22 , enum CAllocator_6 ); struct env32 env; }; struct env61 { ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; struct env32 envinst32; ; ; }; struct envunion64 { const char* (*fun) ( struct env34* , struct StrConcat_29 , enum CAllocator_6 ); struct env34 env; }; struct envunion65 { enum Unit_4 (*fun) ( struct env40* , struct StrConcat_22 , enum CAllocator_6 ); struct env40 env; }; struct env63 { ; ; ; ; ; ; ; struct env34 envinst34; struct env40 envinst40; ; ; }; struct Slice_66 { const char* * f_ptr; size_t f_count; }; static int64_t op_dash_mul69 ( int64_t l189 , int64_t r191 ) { return ( ( l189 ) * ( r191 ) ); } static const char* * offset_dash_ptr68 ( const char* * x333 , int64_t count335 ) { const char* temp70; return ( (const char* * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp70 ) ) ) ) ) ) ) ) ); } static int64_t from_dash_integral71 ( int64_t x46 ) { return ( x46 ); } static size_t op_dash_sub72 ( size_t l270 , size_t r272 ) { return ( ( l270 ) - ( r272 ) ); } static struct Slice_66 get67 ( ) { return ( (struct Slice_66) { .f_ptr = ( ( offset_dash_ptr68 ) ( ( _global_argv ) , ( from_dash_integral71 ( 1 ) ) ) ) , .f_count = ( op_dash_sub72 ( ( _global_argc ) , ( from_dash_integral0 ( 1 ) ) ) ) } ); } struct ListSpread_74 { enum { ListSpread_74_NoSpread_t, ListSpread_74_UnassignedSpread_t, ListSpread_74_AssignedSpread_t, } tag; union { struct { struct Slice_66 * field0; } ListSpread_74_AssignedSpread_s; } stuff; }; static struct ListSpread_74 ListSpread_74_AssignedSpread ( struct Slice_66 * field0 ) { return ( struct ListSpread_74 ) { .tag = ListSpread_74_AssignedSpread_t, .stuff = { .ListSpread_74_AssignedSpread_s = { .field0 = field0 } } }; }; enum Ordering_76 { Ordering_76_LT, Ordering_76_EQ, Ordering_76_GT, }; static size_t builtin_size_tcmp (size_t l, size_t r) { return (l < r) ? 0 : (l == r) ? 1 : 2; } static enum Ordering_76 cmp75 ( size_t l174 , size_t r176 ) { return ( builtin_size_tcmp( ( l174 ) , ( r176 ) ) ); } static size_t op_dash_add77 ( size_t l265 , size_t r267 ) { return ( ( l265 ) + ( r267 ) ); } static int64_t size_dash_i6479 ( size_t x573 ) { return ( (int64_t ) ( x573 ) ); } static size_t min80 ( size_t l1176 , size_t r1178 ) { if ( ( cmp75 ( ( l1176 ) , ( r1178 ) ) == 0 ) ) { return ( l1176 ); } else { return ( r1178 ); } } static struct Slice_66 subslice78 ( struct Slice_66 slice1692 , size_t from1694 , size_t to1696 ) { const char* * begin_dash_ptr1697 = ( ( offset_dash_ptr68 ) ( ( ( slice1692 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( from1694 ) ) ) ) ); if ( ( ( cmp75 ( ( from1694 ) , ( to1696 ) ) != 0 ) || ( cmp75 ( ( from1694 ) , ( ( slice1692 ) .f_count ) ) != 0 ) ) ) { return ( (struct Slice_66) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ); } size_t count1698 = ( op_dash_sub72 ( ( ( min80 ) ( ( to1696 ) , ( ( slice1692 ) .f_count ) ) ) , ( from1694 ) ) ); return ( (struct Slice_66) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( count1698 ) } ); } static bool eq81 ( size_t l121 , size_t r123 ) { return ( ( l121 ) == ( r123 ) ); } static bool deconstruct73 ( struct Slice_66 self1788 , const char* * * lp1790 , size_t lc1792 , struct ListSpread_74 spread1794 , const char* * * rp1796 , size_t rc1798 ) { if ( ( cmp75 ( ( lc1792 ) , ( from_dash_integral0 ( 0 ) ) ) == 2 ) ) { if ( ( cmp75 ( ( lc1792 ) , ( ( self1788 ) .f_count ) ) == 2 ) ) { return ( false ); } (* lp1790 ) = ( ( self1788 ) .f_ptr ); } if ( ( cmp75 ( ( rc1798 ) , ( from_dash_integral0 ( 0 ) ) ) == 2 ) ) { if ( ( cmp75 ( ( op_dash_add77 ( ( rc1798 ) , ( lc1792 ) ) ) , ( ( self1788 ) .f_count ) ) == 2 ) ) { return ( false ); } struct Slice_66 cut1799 = ( ( subslice78 ) ( ( self1788 ) , ( op_dash_sub72 ( ( ( self1788 ) .f_count ) , ( rc1798 ) ) ) , ( ( self1788 ) .f_count ) ) ); (* rp1796 ) = ( ( cut1799 ) .f_ptr ); } struct ListSpread_74 dref1800 = ( spread1794 ); if ( dref1800.tag == ListSpread_74_NoSpread_t ) { return ( eq81 ( ( op_dash_add77 ( ( lc1792 ) , ( rc1798 ) ) ) , ( ( self1788 ) .f_count ) ) ); } else { if ( dref1800.tag == ListSpread_74_UnassignedSpread_t ) { return ( true ); } else { if ( dref1800.tag == ListSpread_74_AssignedSpread_t ) { (* dref1800 .stuff .ListSpread_74_AssignedSpread_s .field0 ) = ( ( subslice78 ) ( ( self1788 ) , ( lc1792 ) , ( op_dash_sub72 ( ( ( self1788 ) .f_count ) , ( rc1798 ) ) ) ) ); return ( true ); } } } } static size_t i64_dash_size83 ( int64_t x597 ) { return ( (size_t ) ( x597 ) ); } struct Maybe_85 { enum { Maybe_85_None_t, Maybe_85_Just_t, } tag; union { struct { int64_t field0; } Maybe_85_Just_s; } stuff; }; static struct Maybe_85 Maybe_85_Just ( int64_t field0 ) { return ( struct Maybe_85 ) { .tag = Maybe_85_Just_t, .stuff = { .Maybe_85_Just_s = { .field0 = field0 } } }; }; struct StrConcat_89 { struct StrView_25 field0; struct StrView_25 field1; }; static struct StrConcat_89 StrConcat_89_StrConcat ( struct StrView_25 field0 , struct StrView_25 field1 ) { return ( struct StrConcat_89 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_88 { struct StrConcat_89 field0; struct Char_17 field1; }; static struct StrConcat_88 StrConcat_88_StrConcat ( struct StrConcat_89 field0 , struct Char_17 field1 ) { return ( struct StrConcat_88 ) { .field0 = field0 , .field1 = field1 }; }; static const char* from_dash_string92 ( uint8_t * ptr77 , size_t dref78 ) { return ( ( (const char* ) ( ptr77 ) ) ); } static int32_t size_dash_i3293 ( size_t x603 ) { return ( (int32_t ) ( x603 ) ); } static enum Unit_4 print_dash_str91 ( struct StrView_25 self1294 ) { ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%.*s" ) , ( 4 ) ) ) , ( ( size_dash_i3293 ) ( ( ( ( self1294 ) .f_contents ) .f_count ) ) ) , ( ( ( self1294 ) .f_contents ) .f_ptr ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str90 ( struct StrConcat_89 self1418 ) { struct StrConcat_89 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str91 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } struct CharDestructured_96 { enum { CharDestructured_96_Ref_t, CharDestructured_96_Scalar_t, } tag; union { struct { struct Char_17 field0; } CharDestructured_96_Ref_s; struct { uint32_t field0; } CharDestructured_96_Scalar_s; } stuff; }; static struct CharDestructured_96 CharDestructured_96_Ref ( struct Char_17 field0 ) { return ( struct CharDestructured_96 ) { .tag = CharDestructured_96_Ref_t, .stuff = { .CharDestructured_96_Ref_s = { .field0 = field0 } } }; }; static struct CharDestructured_96 CharDestructured_96_Scalar ( uint32_t field0 ) { return ( struct CharDestructured_96 ) { .tag = CharDestructured_96_Scalar_t, .stuff = { .CharDestructured_96_Scalar_s = { .field0 = field0 } } }; }; static bool eq98 ( uint8_t l111 , uint8_t r113 ) { return ( ( l111 ) == ( r113 ) ); } static uint8_t size_dash_u8100 ( size_t x612 ) { return ( (uint8_t ) ( x612 ) ); } static size_t op_dash_div101 ( size_t l280 , size_t r282 ) { return ( ( l280 ) / ( r282 ) ); } static uint8_t get_dash_ms_dash_byte_dash_of_dash_pointer99 ( uint8_t * ptr648 ) { return ( ( size_dash_u8100 ) ( ( op_dash_div101 ( ( ( (size_t ) ( ptr648 ) ) ) , ( from_dash_integral0 ( 72057594037927936 ) ) ) ) ) ); } static uint8_t from_dash_integral102 ( int64_t x61 ) { return ( (uint8_t ) ( x61 ) ); } static uint32_t size_dash_u32103 ( size_t x606 ) { return ( (uint32_t ) ( x606 ) ); } static size_t cast104 ( uint8_t * x346 ) { return ( (size_t ) ( x346 ) ); } static struct CharDestructured_96 destructure97 ( struct Char_17 c685 ) { if ( ( eq98 ( ( ( get_dash_ms_dash_byte_dash_of_dash_pointer99 ) ( ( ( c685 ) .f_ptr ) ) ) , ( from_dash_integral102 ( 103 ) ) ) ) ) { return ( ( CharDestructured_96_Scalar ) ( ( ( size_dash_u32103 ) ( ( ( ( cast104 ) ( ( ( c685 ) .f_ptr ) ) ) ) ) ) ) ); } else { return ( ( CharDestructured_96_Ref ) ( ( c685 ) ) ); } } static uint32_t builtin_uint32_tcmp (uint32_t l, uint32_t r) { return (l < r) ? 0 : (l == r) ? 1 : 2; } static enum Ordering_76 cmp105 ( uint32_t l159 , uint32_t r161 ) { return ( builtin_uint32_tcmp( ( l159 ) , ( r161 ) ) ); } static uint32_t from_dash_integral106 ( int64_t x52 ) { return ( (uint32_t ) ( x52 ) ); } static uint8_t cast109 ( uint32_t x346 ) { return ( (uint8_t ) ( x346 ) ); } static uint8_t u32_dash_u8108 ( uint32_t x627 ) { return ( ( cast109 ) ( ( x627 ) ) ); } static enum Unit_4 printf_dash_char95 ( struct Char_17 c718 ) { struct CharDestructured_96 dref719 = ( ( destructure97 ) ( ( c718 ) ) ); if ( dref719.tag == CharDestructured_96_Ref_t ) { ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%.*s" ) , ( 4 ) ) ) , ( ( size_dash_i3293 ) ( ( ( dref719 .stuff .CharDestructured_96_Ref_s .field0 ) .f_num_dash_bytes ) ) ) , ( ( dref719 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) ); } else { if ( dref719.tag == CharDestructured_96_Scalar_t ) { if ( ( cmp105 ( ( dref719 .stuff .CharDestructured_96_Scalar_s .field0 ) , ( from_dash_integral106 ( 127 ) ) ) == 2 ) ) { const char* temp107 = ( ( from_dash_string92 ) ( ( "(TODO) scalar too large BRUH" ) , ( 28 ) ) ); printf("%s\n", temp107); exit ( 1 ); ( Unit_4_Unit ); } ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%c" ) , ( 2 ) ) ) , ( ( u32_dash_u8108 ) ( ( dref719 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ) ) ); } } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str94 ( struct Char_17 self1319 ) { ( ( printf_dash_char95 ) ( ( self1319 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str87 ( struct StrConcat_88 self1418 ) { struct StrConcat_88 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str90 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static struct StrView_25 from_dash_string110 ( uint8_t * ptr81 , size_t count83 ) { return ( (struct StrView_25) { .f_contents = ( (struct Slice_7) { .f_ptr = ( ptr81 ) , .f_count = ( count83 ) } ) } ); } static uint8_t * cast112 ( uint8_t * x346 ) { return ( (uint8_t * ) ( x346 ) ); } static uint8_t builtin_uint8_tcmp (uint8_t l, uint8_t r) { return (l < r) ? 0 : (l == r) ? 1 : 2; } static enum Ordering_76 cmp115 ( uint8_t l164 , uint8_t r166 ) { return ( builtin_uint8_tcmp( ( l164 ) , ( r166 ) ) ); } static uint8_t op_dash_add116 ( uint8_t l245 , uint8_t r247 ) { return ( ( l245 ) + ( r247 ) ); } static size_t next_dash_char114 ( uint8_t * p658 ) { uint8_t pb659 = ( * ( p658 ) ); if ( ( cmp115 ( ( pb659 ) , ( from_dash_integral102 ( 128 ) ) ) == 0 ) ) { return ( from_dash_integral0 ( 1 ) ); } else { if ( ( cmp115 ( ( pb659 ) , ( op_dash_add116 ( ( op_dash_add116 ( ( op_dash_add116 ( ( from_dash_integral102 ( 128 ) ) , ( from_dash_integral102 ( 64 ) ) ) ) , ( from_dash_integral102 ( 32 ) ) ) ) , ( from_dash_integral102 ( 16 ) ) ) ) ) != 0 ) ) { return ( from_dash_integral0 ( 4 ) ); } else { if ( ( cmp115 ( ( pb659 ) , ( op_dash_add116 ( ( op_dash_add116 ( ( from_dash_integral102 ( 128 ) ) , ( from_dash_integral102 ( 64 ) ) ) ) , ( from_dash_integral102 ( 32 ) ) ) ) ) != 0 ) ) { return ( from_dash_integral0 ( 3 ) ); } else { if ( ( cmp115 ( ( pb659 ) , ( op_dash_add116 ( ( from_dash_integral102 ( 128 ) ) , ( from_dash_integral102 ( 64 ) ) ) ) ) != 0 ) ) { return ( from_dash_integral0 ( 2 ) ); } else { const char* temp117 = ( ( from_dash_string92 ) ( ( "(TODO) invalid byte (handle this better...)" ) , ( 43 ) ) ); printf("%s\n", temp117); exit ( 1 ); ( Unit_4_Unit ); } } } } } static struct Char_17 scan_dash_from_dash_mem113 ( uint8_t * p670 ) { size_t clen671 = ( ( next_dash_char114 ) ( ( p670 ) ) ); if ( ( cmp75 ( ( clen671 ) , ( from_dash_integral0 ( 4 ) ) ) == 2 ) ) { const char* temp118 = ( ( from_dash_string92 ) ( ( "UTF8 STRING TOO LONG (is this correct utf8 string?)" ) , ( 51 ) ) ); printf("%s\n", temp118); exit ( 1 ); ( Unit_4_Unit ); } return ( (struct Char_17) { .f_ptr = ( p670 ) , .f_num_dash_bytes = ( clen671 ) } ); } static struct Char_17 from_dash_charlike111 ( uint8_t * ptr674 , size_t num_dash_bytes676 ) { uint8_t * ptr677 = ( ( ( cast112 ) ( ( ptr674 ) ) ) ); return ( ( scan_dash_from_dash_mem113 ) ( ( ptr677 ) ) ); } static enum Unit_4 panic86 ( struct StrView_25 errmsg1622 ) { ( ( print_dash_str87 ) ( ( ( StrConcat_88_StrConcat ) ( ( ( StrConcat_89_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1622 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static int64_t undefined119 ( ) { int64_t temp120; return ( temp120 ); } static int64_t or_dash_fail84 ( struct Maybe_85 x1635 , struct StrView_25 errmsg1637 ) { struct Maybe_85 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_85_None_t ) { ( ( panic86 ) ( ( errmsg1637 ) ) ); return ( ( undefined119 ) ( ) ); } else { if ( dref1638.tag == Maybe_85_Just_t ) { return ( dref1638 .stuff .Maybe_85_Just_s .field0 ); } } } struct ConstStrIter_122 { const char* f_ogstr; size_t f_i; }; static struct ConstStrIter_122 into_dash_iter124 ( const char* self1301 ) { return ( (struct ConstStrIter_122) { .f_ogstr = ( self1301 ) , .f_i = ( from_dash_integral0 ( 0 ) ) } ); } static struct ConstStrIter_122 chars123 ( const char* self1316 ) { return ( ( into_dash_iter124 ) ( ( self1316 ) ) ); } struct Maybe_125 { enum { Maybe_125_None_t, Maybe_125_Just_t, } tag; union { struct { struct Char_17 field0; } Maybe_125_Just_s; } stuff; }; static struct Maybe_125 Maybe_125_Just ( struct Char_17 field0 ) { return ( struct Maybe_125 ) { .tag = Maybe_125_Just_t, .stuff = { .Maybe_125_Just_s = { .field0 = field0 } } }; }; static uint8_t * cast128 ( const char* x346 ) { return ( (uint8_t * ) ( x346 ) ); } static uint8_t * offset_dash_ptr129 ( uint8_t * x333 , int64_t count335 ) { uint8_t temp130; return ( (uint8_t * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp130 ) ) ) ) ) ) ) ) ); } static uint8_t cast131 ( int32_t x346 ) { return ( (uint8_t ) ( x346 ) ); } static struct Maybe_125 next127 ( struct ConstStrIter_122 * self1307 ) { uint8_t * char_dash_ptr1308 = ( ( ( cast128 ) ( ( ( * ( self1307 ) ) .f_ogstr ) ) ) ); uint8_t * optr1309 = ( ( offset_dash_ptr129 ) ( ( char_dash_ptr1308 ) , ( ( size_dash_i6479 ) ( ( ( * ( self1307 ) ) .f_i ) ) ) ) ); if ( ( eq98 ( ( * ( optr1309 ) ) , ( ( cast131 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } struct Char_17 char1310 = ( ( scan_dash_from_dash_mem113 ) ( ( optr1309 ) ) ); (* self1307 ) .f_i = ( op_dash_add77 ( ( ( * ( self1307 ) ) .f_i ) , ( ( char1310 ) .f_num_dash_bytes ) ) ); return ( ( Maybe_125_Just ) ( ( char1310 ) ) ); } static struct ConstStrIter_122 into_dash_iter133 ( struct ConstStrIter_122 self1304 ) { return ( self1304 ); } static struct Maybe_125 head126 ( struct ConstStrIter_122 it1082 ) { struct ConstStrIter_122 temp132 = ( ( into_dash_iter133 ) ( ( it1082 ) ) ); return ( ( next127 ) ( ( &temp132 ) ) ); } static struct Maybe_85 reduce134 ( struct ConstStrIter_122 iterable1033 , struct Maybe_85 base1035 , struct Maybe_85 (* fun1037 )( struct Char_17 , struct Maybe_85 ) ) { struct Maybe_85 x1038 = ( base1035 ); struct ConstStrIter_122 it1039 = ( ( into_dash_iter133 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_125 dref1040 = ( ( next127 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_125_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_125_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_125_Just_s .field0 ) , ( x1038 ) ) ); } } } struct Maybe_85 temp135; return ( temp135 ); } struct Maybe_137 { enum { Maybe_137_None_t, Maybe_137_Just_t, } tag; union { struct { int32_t field0; } Maybe_137_Just_s; } stuff; }; static struct Maybe_137 Maybe_137_Just ( int32_t field0 ) { return ( struct Maybe_137 ) { .tag = Maybe_137_Just_t, .stuff = { .Maybe_137_Just_s = { .field0 = field0 } } }; }; static uint8_t char_dash_u8140 ( struct Char_17 c691 ) { struct CharDestructured_96 dref692 = ( ( destructure97 ) ( ( c691 ) ) ); if ( dref692.tag == CharDestructured_96_Ref_t ) { return ( * ( ( dref692 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ); } else { if ( dref692.tag == CharDestructured_96_Scalar_t ) { return ( ( u32_dash_u8108 ) ( ( dref692 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ); } } } static bool is_dash_digit139 ( struct Char_17 c2251 ) { return ( ( cmp115 ( ( ( char_dash_u8140 ) ( ( c2251 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "0" ) , ( 1 ) ) ) ) ) ) != 0 ) && ( cmp115 ( ( ( char_dash_u8140 ) ( ( c2251 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "9" ) , ( 1 ) ) ) ) ) ) != 2 ) ); } static void * cast_dash_ptr146 ( int32_t * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of147 ( int32_t x340 ) { return ( sizeof( ( x340 ) ) ); } static int32_t zeroed144 ( ) { int32_t temp145; int32_t x549 = ( temp145 ); ( ( memset ) ( ( ( cast_dash_ptr146 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of147 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static uint8_t * cast148 ( int32_t * x346 ) { return ( (uint8_t * ) ( x346 ) ); } static int32_t cast_dash_on_dash_zeroed142 ( uint8_t x552 ) { int32_t temp143 = ( ( zeroed144 ) ( ) ); int32_t * y553 = ( &temp143 ); uint8_t * yp554 = ( ( cast148 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static int32_t u8_dash_i32141 ( uint8_t x639 ) { return ( ( cast_dash_on_dash_zeroed142 ) ( ( x639 ) ) ); } static uint8_t op_dash_sub149 ( uint8_t l250 , uint8_t r252 ) { return ( ( l250 ) - ( r252 ) ); } static struct Maybe_137 parse_dash_digit138 ( struct Char_17 c2254 ) { if ( ( ( is_dash_digit139 ) ( ( c2254 ) ) ) ) { return ( ( Maybe_137_Just ) ( ( ( u8_dash_i32141 ) ( ( op_dash_sub149 ( ( ( char_dash_u8140 ) ( ( c2254 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "0" ) , ( 1 ) ) ) ) ) ) ) ) ) ) ); } else { return ( (struct Maybe_137) { .tag = Maybe_137_None_t } ); } } static int64_t op_dash_add150 ( int64_t l179 , int64_t r181 ) { return ( ( l179 ) + ( r181 ) ); } static int64_t i32_dash_i64151 ( int32_t x582 ) { return ( (int64_t ) ( x582 ) ); } static struct Maybe_85 sequence_dash_maybe136 ( struct Char_17 e2260 , struct Maybe_85 b2262 ) { struct Maybe_85 dref2263 = ( b2262 ); if ( dref2263.tag == Maybe_85_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2263.tag == Maybe_85_Just_t ) { struct Maybe_137 dref2265 = ( ( parse_dash_digit138 ) ( ( e2260 ) ) ); if ( dref2265.tag == Maybe_137_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2265.tag == Maybe_137_Just_t ) { return ( ( Maybe_85_Just ) ( ( op_dash_add150 ( ( op_dash_mul69 ( ( dref2263 .stuff .Maybe_85_Just_s .field0 ) , ( from_dash_integral71 ( 10 ) ) ) ) , ( ( i32_dash_i64151 ) ( ( dref2265 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ) ) ); } } } } } static struct Maybe_85 parse_dash_int121 ( const char* s2257 ) { struct ConstStrIter_122 cs2267 = ( ( chars123 ) ( ( s2257 ) ) ); struct Maybe_125 dref2268 = ( ( head126 ) ( ( cs2267 ) ) ); if ( dref2268.tag == Maybe_125_Just_t ) { return ( ( reduce134 ) ( ( cs2267 ) , ( ( Maybe_85_Just ) ( ( from_dash_integral71 ( 0 ) ) ) ) , ( sequence_dash_maybe136 ) ) ); } else { if ( dref2268.tag == Maybe_125_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } } } static int32_t i64_dash_i32152 ( int64_t x591 ) { return ( (int32_t ) ( x591 ) ); } static enum CAllocator_6 idc154 ( ) { return ( CAllocator_6_CAllocator ); } struct Stats_155 { uint32_t f_total_dash_wins; }; struct envunion157 { struct Stats_155 (*fun) ( struct env61* , enum CAllocator_6 ); struct env61 env; }; struct Maybe_161 { enum { Maybe_161_None_t, Maybe_161_Just_t, } tag; union { struct { const char* field0; } Maybe_161_Just_s; } stuff; }; static struct Maybe_161 Maybe_161_Just ( const char* field0 ) { return ( struct Maybe_161 ) { .tag = Maybe_161_Just_t, .stuff = { .Maybe_161_Just_s = { .field0 = field0 } } }; }; static bool ptr_dash_eq164 ( enum Unit_4 * l565 , enum Unit_4 * r567 ) { return ( ( l565 ) == ( r567 ) ); } static enum Unit_4 * cast165 ( const char* x346 ) { return ( (enum Unit_4 * ) ( x346 ) ); } static void * cast_dash_ptr169 ( enum Unit_4 * * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of170 ( enum Unit_4 * x340 ) { return ( sizeof( ( x340 ) ) ); } static enum Unit_4 * zeroed167 ( ) { enum Unit_4 * temp168; enum Unit_4 * x549 = ( temp168 ); ( ( memset ) ( ( ( cast_dash_ptr169 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of170 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static enum Unit_4 * null_dash_ptr166 ( ) { return ( ( zeroed167 ) ( ) ); } static struct Maybe_161 from_dash_nullable_dash_c_dash_str163 ( const char* s570 ) { if ( ( ( ptr_dash_eq164 ) ( ( ( cast165 ) ( ( s570 ) ) ) , ( ( ( null_dash_ptr166 ) ( ) ) ) ) ) ) { return ( (struct Maybe_161) { .tag = Maybe_161_None_t } ); } else { return ( ( Maybe_161_Just ) ( ( s570 ) ) ); } } static struct Maybe_161 get162 ( const char* s2387 ) { return ( ( from_dash_nullable_dash_c_dash_str163 ) ( ( ( getenv ) ( ( s2387 ) ) ) ) ); } static const char* or_dash_else171 ( struct Maybe_161 self1642 , const char* alt1644 ) { struct Maybe_161 dref1645 = ( self1642 ); if ( dref1645.tag == Maybe_161_None_t ) { return ( alt1644 ); } else { if ( dref1645.tag == Maybe_161_Just_t ) { return ( dref1645 .stuff .Maybe_161_Just_s .field0 ); } } } static const char* from_dash_charlike172 ( uint8_t * ptr73 , size_t dref74 ) { return ( ( (const char* ) ( ptr73 ) ) ); } static struct StrCase_23 xdg_dash_home160 ( const char* name3452 , struct StrView_25 loc3454 ) { return ( { struct Maybe_161 dref3455 = ( ( get162 ) ( ( name3452 ) ) ) ; dref3455.tag == Maybe_161_Just_t ? ( ( StrCase_23_StrCase1 ) ( ( dref3455 .stuff .Maybe_161_Just_s .field0 ) ) ) : ( ( StrCase_23_StrCase2 ) ( ( ( StrConcat_24_StrConcat ) ( ( ( or_dash_else171 ) ( ( ( get162 ) ( ( ( from_dash_string92 ) ( ( "HOME" ) , ( 4 ) ) ) ) ) , ( ( from_dash_charlike172 ) ( ( "~" ) , ( 1 ) ) ) ) ) , ( loc3454 ) ) ) ) ) ; } ); } static struct StrCase_23 data_dash_home159 ( ) { return ( ( xdg_dash_home160 ) ( ( ( from_dash_string92 ) ( ( "XDG_DATA_HOME" ) , ( 13 ) ) ) , ( ( from_dash_string110 ) ( ( "/.local/share" ) , ( 13 ) ) ) ) ); } struct Maybe_173 { enum { Maybe_173_None_t, Maybe_173_Just_t, } tag; union { struct { struct StrView_25 field0; } Maybe_173_Just_s; } stuff; }; static struct Maybe_173 Maybe_173_Just ( struct StrView_25 field0 ) { return ( struct Maybe_173 ) { .tag = Maybe_173_Just_t, .stuff = { .Maybe_173_Just_s = { .field0 = field0 } } }; }; struct env175 { enum CAllocator_6 al3449; ; }; struct envunion176 { enum Unit_4 (*fun) ( struct env175* , const char* ); struct env175 env; }; struct env177 { enum CAllocator_6 al3449; ; }; struct envunion178 { struct Maybe_173 (*fun) ( struct env177* , const char* ); struct env177 env; }; static struct Maybe_173 with174 ( const char* res1224 , struct envunion176 free_dash_fun1226 , struct envunion178 fun1228 ) { struct envunion178 temp179 = ( fun1228 ); struct Maybe_173 ret1229 = ( temp179.fun ( &temp179.env , ( res1224 ) ) ); struct envunion176 temp180 = ( free_dash_fun1226 ); ( temp180.fun ( &temp180.env , ( res1224 ) ) ); return ( ret1229 ); } static const char* cast183 ( uint8_t * x346 ) { return ( (const char* ) ( x346 ) ); } static void * cast_dash_ptr193 ( uint8_t * * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of194 ( uint8_t * x340 ) { return ( sizeof( ( x340 ) ) ); } static uint8_t * zeroed191 ( ) { uint8_t * temp192; uint8_t * x549 = ( temp192 ); ( ( memset ) ( ( ( cast_dash_ptr193 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of194 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static uint8_t * null_dash_ptr190 ( ) { return ( ( zeroed191 ) ( ) ); } static struct Slice_7 empty189 ( ) { return ( (struct Slice_7) { .f_ptr = ( ( null_dash_ptr190 ) ( ) ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ); } static struct List_5 mk188 ( enum CAllocator_6 al1942 ) { struct Slice_7 elements1943 = ( ( empty189 ) ( ) ); return ( (struct List_5) { .f_al = ( al1942 ) , .f_elements = ( elements1943 ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ); } static struct StrBuilder_14 mk187 ( enum CAllocator_6 al2558 ) { return ( (struct StrBuilder_14) { .f_chars = ( ( mk188 ) ( ( al2558 ) ) ) } ); } struct StrViewIter_201 { struct StrView_25 f_ds; size_t f_i; }; struct StrConcatIter_200 { struct ConstStrIter_122 f_left; struct StrViewIter_201 f_right; }; struct StrCaseIter_199 { enum { StrCaseIter_199_StrCaseIter1_t, StrCaseIter_199_StrCaseIter2_t, } tag; union { struct { struct ConstStrIter_122 field0; } StrCaseIter_199_StrCaseIter1_s; struct { struct StrConcatIter_200 field0; } StrCaseIter_199_StrCaseIter2_s; } stuff; }; static struct StrCaseIter_199 StrCaseIter_199_StrCaseIter1 ( struct ConstStrIter_122 field0 ) { return ( struct StrCaseIter_199 ) { .tag = StrCaseIter_199_StrCaseIter1_t, .stuff = { .StrCaseIter_199_StrCaseIter1_s = { .field0 = field0 } } }; }; static struct StrCaseIter_199 StrCaseIter_199_StrCaseIter2 ( struct StrConcatIter_200 field0 ) { return ( struct StrCaseIter_199 ) { .tag = StrCaseIter_199_StrCaseIter2_t, .stuff = { .StrCaseIter_199_StrCaseIter2_s = { .field0 = field0 } } }; }; struct StrConcatIter_198 { struct StrCaseIter_199 f_left; struct StrViewIter_201 f_right; }; struct env202 { struct StrBuilder_14 * builder2540; struct env12 envinst12; }; struct envunion203 { enum Unit_4 (*fun) ( struct env202* , struct Char_17 ); struct env202 env; }; static struct StrConcatIter_198 into_dash_iter205 ( struct StrConcatIter_198 self1406 ) { return ( self1406 ); } static struct Maybe_125 next209 ( struct StrViewIter_201 * self1289 ) { if ( ( cmp75 ( ( ( * ( self1289 ) ) .f_i ) , ( ( ( ( * ( self1289 ) ) .f_ds ) .f_contents ) .f_count ) ) != 0 ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } uint8_t * char_dash_ptr1290 = ( ( ( offset_dash_ptr129 ) ( ( ( cast112 ) ( ( ( ( ( * ( self1289 ) ) .f_ds ) .f_contents ) .f_ptr ) ) ) , ( ( size_dash_i6479 ) ( ( ( * ( self1289 ) ) .f_i ) ) ) ) ) ); struct Char_17 char1291 = ( ( scan_dash_from_dash_mem113 ) ( ( char_dash_ptr1290 ) ) ); (* self1289 ) .f_i = ( op_dash_add77 ( ( ( * ( self1289 ) ) .f_i ) , ( ( char1291 ) .f_num_dash_bytes ) ) ); return ( ( Maybe_125_Just ) ( ( char1291 ) ) ); } static struct Maybe_125 next208 ( struct StrConcatIter_200 * self1409 ) { struct Maybe_125 dref1410 = ( ( next127 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next207 ( struct StrCaseIter_199 * self1431 ) { struct StrCaseIter_199 * dref1432 = ( self1431 ); if ( (* dref1432 ).tag == StrCaseIter_199_StrCaseIter1_t ) { return ( ( next127 ) ( ( & ( (* dref1432 ) .stuff .StrCaseIter_199_StrCaseIter1_s .field0 ) ) ) ); } else { if ( (* dref1432 ).tag == StrCaseIter_199_StrCaseIter2_t ) { return ( ( next208 ) ( ( & ( (* dref1432 ) .stuff .StrCaseIter_199_StrCaseIter2_s .field0 ) ) ) ); } } } static struct Maybe_125 next206 ( struct StrConcatIter_198 * self1409 ) { struct Maybe_125 dref1410 = ( ( next207 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each197 ( struct StrConcatIter_198 iterable1014 , struct envunion203 fun1016 ) { struct StrConcatIter_198 temp204 = ( ( into_dash_iter205 ) ( ( iterable1014 ) ) ); struct StrConcatIter_198 * it1017 = ( &temp204 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next206 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { struct envunion203 temp210 = ( fun1016 ); ( temp210.fun ( &temp210.env , ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrViewIter_201 into_dash_iter218 ( struct StrView_25 self1283 ) { return ( (struct StrViewIter_201) { .f_ds = ( self1283 ) , .f_i = ( from_dash_integral0 ( 0 ) ) } ); } static struct StrViewIter_201 chars217 ( struct StrView_25 self1297 ) { return ( ( into_dash_iter218 ) ( ( self1297 ) ) ); } static struct StrConcatIter_200 into_dash_iter216 ( struct StrConcat_24 dref1413 ) { return ( (struct StrConcatIter_200) { .f_left = ( ( chars123 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars217 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_200 chars215 ( struct StrConcat_24 self1424 ) { return ( ( into_dash_iter216 ) ( ( self1424 ) ) ); } static struct StrCaseIter_199 into_dash_iter214 ( struct StrCase_23 self1437 ) { struct StrCase_23 dref1438 = ( self1437 ); if ( dref1438.tag == StrCase_23_StrCase1_t ) { return ( ( StrCaseIter_199_StrCaseIter1 ) ( ( ( chars123 ) ( ( dref1438 .stuff .StrCase_23_StrCase1_s .field0 ) ) ) ) ); } else { if ( dref1438.tag == StrCase_23_StrCase2_t ) { return ( ( StrCaseIter_199_StrCaseIter2 ) ( ( ( chars215 ) ( ( dref1438 .stuff .StrCase_23_StrCase2_s .field0 ) ) ) ) ); } } } static struct StrCaseIter_199 chars213 ( struct StrCase_23 self1449 ) { return ( ( into_dash_iter214 ) ( ( self1449 ) ) ); } static struct StrConcatIter_198 into_dash_iter212 ( struct StrConcat_22 dref1413 ) { return ( (struct StrConcatIter_198) { .f_left = ( ( chars213 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars217 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_198 chars211 ( struct StrConcat_22 self1424 ) { return ( ( into_dash_iter212 ) ( ( self1424 ) ) ); } struct env227 { struct List_5 * list2001; struct env2 envinst2; }; struct envunion228 { enum Unit_4 (*fun) ( struct env227* , uint8_t ); struct env227 env; }; struct SliceIter_229 { struct Slice_7 f_slice; size_t f_current_dash_offset; }; static struct SliceIter_229 into_dash_iter231 ( struct Slice_7 self1732 ) { return ( (struct SliceIter_229) { .f_slice = ( self1732 ) , .f_current_dash_offset = ( from_dash_integral0 ( 0 ) ) } ); } struct Maybe_232 { enum { Maybe_232_None_t, Maybe_232_Just_t, } tag; union { struct { uint8_t field0; } Maybe_232_Just_s; } stuff; }; static struct Maybe_232 Maybe_232_Just ( uint8_t field0 ) { return ( struct Maybe_232 ) { .tag = Maybe_232_Just_t, .stuff = { .Maybe_232_Just_s = { .field0 = field0 } } }; }; static struct Maybe_232 next233 ( struct SliceIter_229 * self1738 ) { size_t off1739 = ( ( * ( self1738 ) ) .f_current_dash_offset ); if ( ( cmp75 ( ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ) , ( ( ( * ( self1738 ) ) .f_slice ) .f_count ) ) == 2 ) ) { return ( (struct Maybe_232) { .tag = Maybe_232_None_t } ); } uint8_t elem1740 = ( * ( ( offset_dash_ptr129 ) ( ( ( ( * ( self1738 ) ) .f_slice ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( off1739 ) ) ) ) ) ); (* self1738 ) .f_current_dash_offset = ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_232_Just ) ( ( elem1740 ) ) ); } static enum Unit_4 for_dash_each226 ( struct Slice_7 iterable1014 , struct envunion228 fun1016 ) { struct SliceIter_229 temp230 = ( ( into_dash_iter231 ) ( ( iterable1014 ) ) ); struct SliceIter_229 * it1017 = ( &temp230 ); while ( ( true ) ) { struct Maybe_232 dref1018 = ( ( next233 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_232_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_232_Just_t ) { struct envunion228 temp234 = ( fun1016 ); ( temp234.fun ( &temp234.env , ( dref1018 .stuff .Maybe_232_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } struct TypeSize_242 { size_t f_size; }; static struct TypeSize_242 get_dash_typesize241 ( ) { uint8_t temp243; return ( (struct TypeSize_242) { .f_size = ( sizeof( ( ( temp243 ) ) ) ) } ); } static uint8_t * cast_dash_ptr244 ( void * p349 ) { return ( (uint8_t * ) ( p349 ) ); } static size_t op_dash_mul245 ( size_t l275 , size_t r277 ) { return ( ( l275 ) * ( r277 ) ); } static struct Slice_7 allocate240 ( enum CAllocator_6 dref1857 , size_t count1859 ) { if (!( dref1857 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } size_t size1860 = ( ( ( ( get_dash_typesize241 ) ( ) ) ) .f_size ); uint8_t * ptr1861 = ( ( cast_dash_ptr244 ) ( ( ( malloc ) ( ( op_dash_mul245 ( ( size1860 ) , ( count1859 ) ) ) ) ) ) ); return ( (struct Slice_7) { .f_ptr = ( ptr1861 ) , .f_count = ( count1859 ) } ); } struct env246 { struct Slice_7 new_dash_slice1953; ; ; }; struct Tuple2_248 { uint8_t field0; int32_t field1; }; static struct Tuple2_248 Tuple2_248_Tuple2 ( uint8_t field0 , int32_t field1 ) { return ( struct Tuple2_248 ) { .field0 = field0 , .field1 = field1 }; }; struct envunion247 { enum Unit_4 (*fun) ( struct env246* , struct Tuple2_248 ); struct env246 env; }; struct StrConcat_256 { struct StrView_25 field0; size_t field1; }; static struct StrConcat_256 StrConcat_256_StrConcat ( struct StrView_25 field0 , size_t field1 ) { return ( struct StrConcat_256 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_255 { struct StrConcat_256 field0; struct StrView_25 field1; }; static struct StrConcat_255 StrConcat_255_StrConcat ( struct StrConcat_256 field0 , struct StrView_25 field1 ) { return ( struct StrConcat_255 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_254 { struct StrConcat_255 field0; size_t field1; }; static struct StrConcat_254 StrConcat_254_StrConcat ( struct StrConcat_255 field0 , size_t field1 ) { return ( struct StrConcat_254 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_253 { struct StrConcat_254 field0; struct Char_17 field1; }; static struct StrConcat_253 StrConcat_253_StrConcat ( struct StrConcat_254 field0 , struct Char_17 field1 ) { return ( struct StrConcat_253 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_259 { struct StrView_25 field0; struct StrConcat_253 field1; }; static struct StrConcat_259 StrConcat_259_StrConcat ( struct StrView_25 field0 , struct StrConcat_253 field1 ) { return ( struct StrConcat_259 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_258 { struct StrConcat_259 field0; struct Char_17 field1; }; static struct StrConcat_258 StrConcat_258_StrConcat ( struct StrConcat_259 field0 , struct Char_17 field1 ) { return ( struct StrConcat_258 ) { .field0 = field0 , .field1 = field1 }; }; static enum Unit_4 print_dash_str265 ( size_t self1379 ) { ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%lu" ) , ( 3 ) ) ) , ( self1379 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str264 ( struct StrConcat_256 self1418 ) { struct StrConcat_256 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str265 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str263 ( struct StrConcat_255 self1418 ) { struct StrConcat_255 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str264 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str91 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str262 ( struct StrConcat_254 self1418 ) { struct StrConcat_254 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str263 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str265 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str261 ( struct StrConcat_253 self1418 ) { struct StrConcat_253 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str262 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str260 ( struct StrConcat_259 self1418 ) { struct StrConcat_259 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str261 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str257 ( struct StrConcat_258 self1418 ) { struct StrConcat_258 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str260 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 panic252 ( struct StrConcat_253 errmsg1622 ) { ( ( print_dash_str257 ) ( ( ( StrConcat_258_StrConcat ) ( ( ( StrConcat_259_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1622 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static uint8_t * get_dash_ptr251 ( struct Slice_7 slice1667 , size_t i1669 ) { if ( ( ( cmp75 ( ( i1669 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1669 ) , ( ( slice1667 ) .f_count ) ) != 0 ) ) ) { ( ( panic252 ) ( ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1669 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1667 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } uint8_t * elem_dash_ptr1670 = ( ( offset_dash_ptr129 ) ( ( ( slice1667 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1669 ) ) ) ) ); return ( elem_dash_ptr1670 ); } static enum Unit_4 set250 ( struct Slice_7 slice1684 , size_t i1686 , uint8_t x1688 ) { uint8_t * ep1689 = ( ( get_dash_ptr251 ) ( ( slice1684 ) , ( i1686 ) ) ); (* ep1689 ) = ( x1688 ); return ( Unit_4_Unit ); } static size_t i32_dash_size266 ( int32_t x585 ) { return ( (size_t ) ( (int64_t ) ( x585 ) ) ); } static enum Unit_4 lam249 ( struct env246* env , struct Tuple2_248 dref1954 ) { return ( ( set250 ) ( ( env->new_dash_slice1953 ) , ( ( i32_dash_size266 ) ( ( dref1954 .field1 ) ) ) , ( dref1954 .field0 ) ) ); } struct FromIter_269 { int32_t f_from; }; struct Zip_268 { struct SliceIter_229 f_left_dash_it; struct FromIter_269 f_right_dash_it; }; static struct Zip_268 into_dash_iter271 ( struct Zip_268 self864 ) { return ( self864 ); } struct Maybe_272 { enum { Maybe_272_None_t, Maybe_272_Just_t, } tag; union { struct { struct Tuple2_248 field0; } Maybe_272_Just_s; } stuff; }; static struct Maybe_272 Maybe_272_Just ( struct Tuple2_248 field0 ) { return ( struct Maybe_272 ) { .tag = Maybe_272_Just_t, .stuff = { .Maybe_272_Just_s = { .field0 = field0 } } }; }; static int32_t op_dash_add275 ( int32_t l202 , int32_t r204 ) { return ( ( l202 ) + ( r204 ) ); } static struct Maybe_137 next274 ( struct FromIter_269 * dref858 ) { int32_t v860 = ( ( (* dref858 ) ) .f_from ); (* dref858 ) .f_from = ( op_dash_add275 ( ( ( (* dref858 ) ) .f_from ) , ( from_dash_integral48 ( 1 ) ) ) ); return ( ( Maybe_137_Just ) ( ( v860 ) ) ); } static struct Maybe_272 next273 ( struct Zip_268 * self867 ) { struct Zip_268 copy868 = ( * ( self867 ) ); while ( ( true ) ) { struct Maybe_232 dref869 = ( ( next233 ) ( ( & ( ( copy868 ) .f_left_dash_it ) ) ) ); if ( dref869.tag == Maybe_232_None_t ) { return ( (struct Maybe_272) { .tag = Maybe_272_None_t } ); } else { if ( dref869.tag == Maybe_232_Just_t ) { struct Maybe_137 dref871 = ( ( next274 ) ( ( & ( ( copy868 ) .f_right_dash_it ) ) ) ); if ( dref871.tag == Maybe_137_None_t ) { return ( (struct Maybe_272) { .tag = Maybe_272_None_t } ); } else { if ( dref871.tag == Maybe_137_Just_t ) { ( ( next233 ) ( ( & ( ( * ( self867 ) ) .f_left_dash_it ) ) ) ); ( ( next274 ) ( ( & ( ( * ( self867 ) ) .f_right_dash_it ) ) ) ); return ( ( Maybe_272_Just ) ( ( ( Tuple2_248_Tuple2 ) ( ( dref869 .stuff .Maybe_232_Just_s .field0 ) , ( dref871 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ); } } } } } } static enum Unit_4 for_dash_each267 ( struct Zip_268 iterable1014 , struct envunion247 fun1016 ) { struct Zip_268 temp270 = ( ( into_dash_iter271 ) ( ( iterable1014 ) ) ); struct Zip_268 * it1017 = ( &temp270 ); while ( ( true ) ) { struct Maybe_272 dref1018 = ( ( next273 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_272_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_272_Just_t ) { struct envunion247 temp276 = ( fun1016 ); ( temp276.fun ( &temp276.env , ( dref1018 .stuff .Maybe_272_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct FromIter_269 into_dash_iter278 ( struct FromIter_269 it856 ) { return ( it856 ); } static struct Zip_268 zip277 ( struct Slice_7 left875 , struct FromIter_269 right877 ) { struct SliceIter_229 left_dash_it878 = ( ( into_dash_iter231 ) ( ( left875 ) ) ); struct FromIter_269 right_dash_it879 = ( ( into_dash_iter278 ) ( ( right877 ) ) ); return ( (struct Zip_268) { .f_left_dash_it = ( left_dash_it878 ) , .f_right_dash_it = ( right_dash_it879 ) } ); } static struct FromIter_269 from279 ( int32_t f853 ) { return ( (struct FromIter_269) { .f_from = ( f853 ) } ); } static void * cast_dash_ptr281 ( uint8_t * p349 ) { return ( (void * ) ( p349 ) ); } static enum Unit_4 free280 ( enum CAllocator_6 dref1863 , struct Slice_7 slice1865 ) { if (!( dref1863 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } ( ( free ) ( ( ( cast_dash_ptr281 ) ( ( ( slice1865 ) .f_ptr ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 grow_dash_if_dash_full239 ( struct env1* env , struct List_5 * list1952 ) { if ( ( eq81 ( ( ( * ( list1952 ) ) .f_count ) , ( from_dash_integral0 ( 0 ) ) ) ) ) { (* list1952 ) .f_elements = ( ( allocate240 ) ( ( ( * ( list1952 ) ) .f_al ) , ( env->starting_dash_size1947 ) ) ); } else { if ( ( eq81 ( ( ( * ( list1952 ) ) .f_count ) , ( ( ( * ( list1952 ) ) .f_elements ) .f_count ) ) ) ) { struct Slice_7 new_dash_slice1953 = ( ( allocate240 ) ( ( ( * ( list1952 ) ) .f_al ) , ( op_dash_mul245 ( ( ( * ( list1952 ) ) .f_count ) , ( env->growth_dash_factor1948 ) ) ) ) ); struct env246 envinst246 = { .new_dash_slice1953 = new_dash_slice1953 , }; struct envunion247 fun1957 = ( (struct envunion247){ .fun = ( enum Unit_4 (*) ( struct env246* , struct Tuple2_248 ) )lam249 , .env = envinst246 } ); ( ( for_dash_each267 ) ( ( ( zip277 ) ( ( ( * ( list1952 ) ) .f_elements ) , ( ( from279 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) , ( fun1957 ) ) ); ( ( free280 ) ( ( ( * ( list1952 ) ) .f_al ) , ( ( * ( list1952 ) ) .f_elements ) ) ); (* list1952 ) .f_elements = ( new_dash_slice1953 ); } } return ( Unit_4_Unit ); } static enum Unit_4 add237 ( struct env2* env , struct List_5 * list1960 , uint8_t elem1962 ) { struct envunion3 temp238 = ( (struct envunion3){ .fun = ( enum Unit_4 (*) ( struct env1* , struct List_5 * ) )grow_dash_if_dash_full239 , .env = env->envinst1 } ); ( temp238.fun ( &temp238.env , ( list1960 ) ) ); ( ( set250 ) ( ( ( * ( list1960 ) ) .f_elements ) , ( ( * ( list1960 ) ) .f_count ) , ( elem1962 ) ) ); (* list1960 ) .f_count = ( op_dash_add77 ( ( ( * ( list1960 ) ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 lam235 ( struct env227* env , uint8_t x2005 ) { struct envunion9 temp236 = ( (struct envunion9){ .fun = ( enum Unit_4 (*) ( struct env2* , struct List_5 * , uint8_t ) )add237 , .env = env->envinst2 } ); return ( temp236.fun ( &temp236.env , ( env->list2001 ) , ( x2005 ) ) ); } static enum Unit_4 add_dash_all225 ( struct env8* env , struct List_5 * list2001 , struct Slice_7 it2003 ) { struct env227 envinst227 = { .list2001 = list2001 , .envinst2 = env->envinst2 , }; ( ( for_dash_each226 ) ( ( it2003 ) , ( (struct envunion228){ .fun = ( enum Unit_4 (*) ( struct env227* , uint8_t ) )lam235 , .env = envinst227 } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 write_dash_slice223 ( struct env10* env , struct StrBuilder_14 * builder2530 , struct Slice_7 s2532 ) { struct envunion11 temp224 = ( (struct envunion11){ .fun = ( enum Unit_4 (*) ( struct env8* , struct List_5 * , struct Slice_7 ) )add_dash_all225 , .env = env->envinst8 } ); ( temp224.fun ( &temp224.env , ( & ( ( * ( builder2530 ) ) .f_chars ) ) , ( s2532 ) ) ); return ( Unit_4_Unit ); } static struct Slice_7 from_dash_char282 ( struct Char_17 c1845 , uint8_t * buf1847 ) { struct CharDestructured_96 dref1848 = ( ( destructure97 ) ( ( c1845 ) ) ); if ( dref1848.tag == CharDestructured_96_Ref_t ) { return ( (struct Slice_7) { .f_ptr = ( ( dref1848 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) , .f_count = ( ( dref1848 .stuff .CharDestructured_96_Ref_s .field0 ) .f_num_dash_bytes ) } ); } else { if ( dref1848.tag == CharDestructured_96_Scalar_t ) { if ( ( cmp105 ( ( dref1848 .stuff .CharDestructured_96_Scalar_s .field0 ) , ( from_dash_integral106 ( 127 ) ) ) == 2 ) ) { const char* temp283 = ( ( from_dash_string92 ) ( ( "(Slice.from-char) non-ascii characters not yet supported" ) , ( 56 ) ) ); printf("%s\n", temp283); exit ( 1 ); ( Unit_4_Unit ); } (* buf1847 ) = ( ( u32_dash_u8108 ) ( ( dref1848 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ); return ( (struct Slice_7) { .f_ptr = ( buf1847 ) , .f_count = ( from_dash_integral0 ( 1 ) ) } ); } } } static enum Unit_4 write_dash_char221 ( struct env12* env , struct StrBuilder_14 * builder2535 , struct Char_17 c2537 ) { struct envunion13 temp222 = ( (struct envunion13){ .fun = ( enum Unit_4 (*) ( struct env10* , struct StrBuilder_14 * , struct Slice_7 ) )write_dash_slice223 , .env = env->envinst10 } ); uint8_t temp285; uint8_t temp284 = ( temp285 ); ( temp222.fun ( &temp222.env , ( builder2535 ) , ( ( from_dash_char282 ) ( ( c2537 ) , ( &temp284 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 lam219 ( struct env202* env , struct Char_17 c2544 ) { struct envunion16 temp220 = ( (struct envunion16){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); return ( temp220.fun ( &temp220.env , ( env->builder2540 ) , ( c2544 ) ) ); } static enum Unit_4 write196 ( struct env15* env , struct StrBuilder_14 * builder2540 , struct StrConcat_22 s2542 ) { struct env202 envinst202 = { .builder2540 = builder2540 , .envinst12 = env->envinst12 , }; ( ( for_dash_each197 ) ( ( ( chars211 ) ( ( s2542 ) ) ) , ( (struct envunion203){ .fun = ( enum Unit_4 (*) ( struct env202* , struct Char_17 ) )lam219 , .env = envinst202 } ) ) ); return ( Unit_4_Unit ); } static struct Char_17 nullchar287 ( ) { return ( ( from_dash_charlike111 ) ( ( "\x00" ) , ( 1 ) ) ); } static struct Slice_7 cast289 ( struct Slice_7 x346 ) { return ( (struct Slice_7 ) ( x346 ) ); } static struct Slice_7 subslice290 ( struct Slice_7 slice1692 , size_t from1694 , size_t to1696 ) { uint8_t * begin_dash_ptr1697 = ( ( offset_dash_ptr129 ) ( ( ( slice1692 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( from1694 ) ) ) ) ); if ( ( ( cmp75 ( ( from1694 ) , ( to1696 ) ) != 0 ) || ( cmp75 ( ( from1694 ) , ( ( slice1692 ) .f_count ) ) != 0 ) ) ) { return ( (struct Slice_7) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ); } size_t count1698 = ( op_dash_sub72 ( ( ( min80 ) ( ( to1696 ) , ( ( slice1692 ) .f_count ) ) ) , ( from1694 ) ) ); return ( (struct Slice_7) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( count1698 ) } ); } static struct StrView_25 as_dash_str288 ( struct StrBuilder_14 * builder2564 ) { return ( (struct StrView_25) { .f_contents = ( ( cast289 ) ( ( ( subslice290 ) ( ( ( ( * ( builder2564 ) ) .f_chars ) .f_elements ) , ( from_dash_integral0 ( 0 ) ) , ( ( ( * ( builder2564 ) ) .f_chars ) .f_count ) ) ) ) ) } ); } static struct StrView_25 mk_dash_dyn_dash_str185 ( struct env20* env , struct StrConcat_22 s2584 , enum CAllocator_6 al2586 ) { struct StrBuilder_14 temp186 = ( ( mk187 ) ( ( al2586 ) ) ); struct StrBuilder_14 * sb2587 = ( &temp186 ); struct envunion21 temp195 = ( (struct envunion21){ .fun = ( enum Unit_4 (*) ( struct env15* , struct StrBuilder_14 * , struct StrConcat_22 ) )write196 , .env = env->envinst15 } ); ( temp195.fun ( &temp195.env , ( sb2587 ) , ( s2584 ) ) ); struct envunion26 temp286 = ( (struct envunion26){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); ( temp286.fun ( &temp286.env , ( sb2587 ) , ( ( nullchar287 ) ( ) ) ) ); struct StrView_25 dynstr2588 = ( ( as_dash_str288 ) ( ( sb2587 ) ) ); return ( (struct StrView_25) { .f_contents = ( (struct Slice_7) { .f_ptr = ( ( ( dynstr2588 ) .f_contents ) .f_ptr ) , .f_count = ( op_dash_sub72 ( ( ( ( dynstr2588 ) .f_contents ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) } ) } ); } static const char* mk_dash_const_dash_str182 ( struct env32* env , struct StrConcat_22 s2591 , enum CAllocator_6 al2593 ) { struct envunion33 temp184 = ( (struct envunion33){ .fun = ( struct StrView_25 (*) ( struct env20* , struct StrConcat_22 , enum CAllocator_6 ) )mk_dash_dyn_dash_str185 , .env = env->envinst20 } ); return ( ( ( cast183 ) ( ( ( ( temp184.fun ( &temp184.env , ( s2591 ) , ( al2593 ) ) ) .f_contents ) .f_ptr ) ) ) ); } struct Slice_294 { enum Unit_4 * f_ptr; size_t f_count; }; static void * cast_dash_ptr295 ( enum Unit_4 * p349 ) { return ( (void * ) ( p349 ) ); } static enum Unit_4 free293 ( enum CAllocator_6 dref1863 , struct Slice_294 slice1865 ) { if (!( dref1863 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } ( ( free ) ( ( ( cast_dash_ptr295 ) ( ( ( slice1865 ) .f_ptr ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 free_dash_const_dash_str292 ( const char* s2596 , enum CAllocator_6 al2598 ) { ( ( free293 ) ( ( al2598 ) , ( (struct Slice_294) { .f_ptr = ( (enum Unit_4 * ) ( s2596 ) ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 lam291 ( struct env175* env , const char* filename3464 ) { return ( ( free_dash_const_dash_str292 ) ( ( filename3464 ) , ( env->al3449 ) ) ); } static void * cast_dash_ptr302 ( FILE * * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of303 ( FILE * x340 ) { return ( sizeof( ( x340 ) ) ); } static FILE * zeroed300 ( ) { FILE * temp301; FILE * x549 = ( temp301 ); ( ( memset ) ( ( ( cast_dash_ptr302 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of303 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static FILE * null_dash_ptr299 ( ) { return ( ( zeroed300 ) ( ) ); } static bool is_dash_ptr_dash_null298 ( FILE * p559 ) { return ( ( p559 ) == ( ( null_dash_ptr299 ) ( ) ) ); } static int32_t seek_dash_end304 ( ) { return ( from_dash_integral48 ( 2 ) ); } static int32_t seek_dash_set305 ( ) { return ( from_dash_integral48 ( 0 ) ); } static struct Maybe_173 try_dash_read_dash_contents297 ( const char* filename2704 , enum CAllocator_6 al2706 ) { FILE * file2707 = ( ( fopen ) ( ( filename2704 ) , ( ( from_dash_charlike172 ) ( ( "r" ) , ( 1 ) ) ) ) ); if ( ( ( is_dash_ptr_dash_null298 ) ( ( file2707 ) ) ) ) { return ( (struct Maybe_173) { .tag = Maybe_173_None_t } ); } ( ( fseek ) ( ( file2707 ) , ( from_dash_integral48 ( 0 ) ) , ( ( seek_dash_end304 ) ( ) ) ) ); int32_t file_dash_size2708 = ( ( ftell ) ( ( file2707 ) ) ); ( ( fseek ) ( ( file2707 ) , ( from_dash_integral48 ( 0 ) ) , ( ( seek_dash_set305 ) ( ) ) ) ); struct Slice_7 file_dash_buf2709 = ( ( ( allocate240 ) ( ( al2706 ) , ( op_dash_add77 ( ( ( i32_dash_size266 ) ( ( file_dash_size2708 ) ) ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) ); ( ( fread ) ( ( ( file_dash_buf2709 ) .f_ptr ) , ( from_dash_integral48 ( 1 ) ) , ( file_dash_size2708 ) , ( file2707 ) ) ); ( ( set250 ) ( ( file_dash_buf2709 ) , ( ( i32_dash_size266 ) ( ( file_dash_size2708 ) ) ) , ( ( char_dash_u8140 ) ( ( ( nullchar287 ) ( ) ) ) ) ) ); ( ( fclose ) ( ( file2707 ) ) ); struct StrView_25 str2710 = ( (struct StrView_25) { .f_contents = ( file_dash_buf2709 ) } ); return ( ( Maybe_173_Just ) ( ( str2710 ) ) ); } static struct Maybe_173 lam296 ( struct env177* env , const char* filename3466 ) { return ( ( try_dash_read_dash_contents297 ) ( ( filename3466 ) , ( env->al3449 ) ) ); } struct LineIter_306 { struct StrView_25 f_og; size_t f_last; }; static struct LineIter_306 into_dash_iter308 ( struct LineIter_306 self2225 ) { return ( self2225 ); } static struct LineIter_306 lines309 ( struct StrView_25 s2222 ) { return ( (struct LineIter_306) { .f_og = ( s2222 ) , .f_last = ( from_dash_integral0 ( 0 ) ) } ); } static uint32_t i64_dash_u32310 ( int64_t x594 ) { return ( (uint32_t ) ( x594 ) ); } static int64_t or_dash_else311 ( struct Maybe_85 self1642 , int64_t alt1644 ) { struct Maybe_85 dref1645 = ( self1642 ); if ( dref1645.tag == Maybe_85_None_t ) { return ( alt1644 ); } else { if ( dref1645.tag == Maybe_85_Just_t ) { return ( dref1645 .stuff .Maybe_85_Just_s .field0 ); } } } static struct Maybe_85 and_dash_maybe312 ( struct Maybe_173 m1201 , struct Maybe_85 (* fun1203 )( struct StrView_25 ) ) { struct Maybe_173 dref1204 = ( m1201 ); if ( dref1204.tag == Maybe_173_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref1204.tag == Maybe_173_Just_t ) { return ( ( fun1203 ) ( ( dref1204 .stuff .Maybe_173_Just_s .field0 ) ) ); } } } static uint8_t undefined317 ( ) { uint8_t temp318; return ( temp318 ); } static uint8_t or_dash_fail316 ( struct Maybe_232 x1635 , struct StrConcat_253 errmsg1637 ) { struct Maybe_232 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_232_None_t ) { ( ( panic252 ) ( ( errmsg1637 ) ) ); return ( ( undefined317 ) ( ) ); } else { if ( dref1638.tag == Maybe_232_Just_t ) { return ( dref1638 .stuff .Maybe_232_Just_s .field0 ); } } } static struct Maybe_232 try_dash_get319 ( struct Slice_7 slice1673 , size_t i1675 ) { if ( ( ( cmp75 ( ( i1675 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1675 ) , ( ( slice1673 ) .f_count ) ) != 0 ) ) ) { return ( (struct Maybe_232) { .tag = Maybe_232_None_t } ); } uint8_t * elem_dash_ptr1676 = ( ( offset_dash_ptr129 ) ( ( ( slice1673 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1675 ) ) ) ) ); return ( ( Maybe_232_Just ) ( ( * ( elem_dash_ptr1676 ) ) ) ); } static uint8_t get315 ( struct Slice_7 slice1679 , size_t i1681 ) { return ( ( or_dash_fail316 ) ( ( ( try_dash_get319 ) ( ( slice1679 ) , ( i1681 ) ) ) , ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1681 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1679 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } static uint8_t elem_dash_get314 ( struct Slice_7 self1777 , size_t idx1779 ) { return ( ( get315 ) ( ( self1777 ) , ( idx1779 ) ) ); } static struct Char_17 newline320 ( ) { return ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ); } static struct StrView_25 substr321 ( struct StrView_25 s1895 , size_t from1897 , size_t to1899 ) { return ( (struct StrView_25) { .f_contents = ( ( subslice290 ) ( ( ( s1895 ) .f_contents ) , ( from1897 ) , ( to1899 ) ) ) } ); } static struct Maybe_173 next313 ( struct LineIter_306 * self2228 ) { if ( ( ( cmp75 ( ( ( * ( self2228 ) ) .f_last ) , ( ( ( ( * ( self2228 ) ) .f_og ) .f_contents ) .f_count ) ) != 0 ) || ( eq98 ( ( elem_dash_get314 ( ( ( ( * ( self2228 ) ) .f_og ) .f_contents ) , ( ( * ( self2228 ) ) .f_last ) ) ) , ( ( char_dash_u8140 ) ( ( ( nullchar287 ) ( ) ) ) ) ) ) ) ) { return ( (struct Maybe_173) { .tag = Maybe_173_None_t } ); } size_t i2229 = ( ( * ( self2228 ) ) .f_last ); while ( ( ( cmp75 ( ( i2229 ) , ( ( ( ( * ( self2228 ) ) .f_og ) .f_contents ) .f_count ) ) == 0 ) && ( ! eq98 ( ( ( get315 ) ( ( ( ( * ( self2228 ) ) .f_og ) .f_contents ) , ( i2229 ) ) ) , ( ( char_dash_u8140 ) ( ( ( newline320 ) ( ) ) ) ) ) ) ) ) { i2229 = ( op_dash_add77 ( ( i2229 ) , ( from_dash_integral0 ( 1 ) ) ) ); } struct StrView_25 line2230 = ( ( substr321 ) ( ( ( * ( self2228 ) ) .f_og ) , ( ( * ( self2228 ) ) .f_last ) , ( i2229 ) ) ); if ( ( cmp75 ( ( i2229 ) , ( ( ( ( * ( self2228 ) ) .f_og ) .f_contents ) .f_count ) ) == 0 ) ) { i2229 = ( op_dash_add77 ( ( i2229 ) , ( from_dash_integral0 ( 1 ) ) ) ); } (* self2228 ) .f_last = ( i2229 ); return ( ( Maybe_173_Just ) ( ( line2230 ) ) ); } static struct StrViewIter_201 into_dash_iter325 ( struct StrViewIter_201 self1286 ) { return ( self1286 ); } static struct Maybe_125 head323 ( struct StrViewIter_201 it1082 ) { struct StrViewIter_201 temp324 = ( ( into_dash_iter325 ) ( ( it1082 ) ) ); return ( ( next209 ) ( ( &temp324 ) ) ); } static struct Maybe_85 reduce326 ( struct StrViewIter_201 iterable1033 , struct Maybe_85 base1035 , struct Maybe_85 (* fun1037 )( struct Char_17 , struct Maybe_85 ) ) { struct Maybe_85 x1038 = ( base1035 ); struct StrViewIter_201 it1039 = ( ( into_dash_iter325 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_125 dref1040 = ( ( next209 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_125_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_125_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_125_Just_s .field0 ) , ( x1038 ) ) ); } } } struct Maybe_85 temp327; return ( temp327 ); } static struct Maybe_85 sequence_dash_maybe328 ( struct Char_17 e2260 , struct Maybe_85 b2262 ) { struct Maybe_85 dref2263 = ( b2262 ); if ( dref2263.tag == Maybe_85_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2263.tag == Maybe_85_Just_t ) { struct Maybe_137 dref2265 = ( ( parse_dash_digit138 ) ( ( e2260 ) ) ); if ( dref2265.tag == Maybe_137_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2265.tag == Maybe_137_Just_t ) { return ( ( Maybe_85_Just ) ( ( op_dash_add150 ( ( op_dash_mul69 ( ( dref2263 .stuff .Maybe_85_Just_s .field0 ) , ( from_dash_integral71 ( 10 ) ) ) ) , ( ( i32_dash_i64151 ) ( ( dref2265 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ) ) ); } } } } } static struct Maybe_85 parse_dash_int322 ( struct StrView_25 s2257 ) { struct StrViewIter_201 cs2267 = ( ( chars217 ) ( ( s2257 ) ) ); struct Maybe_125 dref2268 = ( ( head323 ) ( ( cs2267 ) ) ); if ( dref2268.tag == Maybe_125_Just_t ) { return ( ( reduce326 ) ( ( cs2267 ) , ( ( Maybe_85_Just ) ( ( from_dash_integral71 ( 0 ) ) ) ) , ( sequence_dash_maybe328 ) ) ); } else { if ( dref2268.tag == Maybe_125_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } } } static struct Stats_155 load_dash_score158 ( struct env61* env , enum CAllocator_6 al3449 ) { struct StrCase_23 data_dash_dir3461 = ( ( data_dash_home159 ) ( ) ); struct StrConcat_22 stats_dash_file3462 = ( ( StrConcat_22_StrConcat ) ( ( data_dash_dir3461 ) , ( ( from_dash_string110 ) ( ( "/kc-minesweeper/stats" ) , ( 21 ) ) ) ) ); struct envunion62 temp181 = ( (struct envunion62){ .fun = ( const char* (*) ( struct env32* , struct StrConcat_22 , enum CAllocator_6 ) )mk_dash_const_dash_str182 , .env = env->envinst32 } ); struct env175 envinst175 = { .al3449 = al3449 , }; struct env177 envinst177 = { .al3449 = al3449 , }; struct Maybe_173 dref3467 = ( ( with174 ) ( ( temp181.fun ( &temp181.env , ( stats_dash_file3462 ) , ( al3449 ) ) ) , ( (struct envunion176){ .fun = ( enum Unit_4 (*) ( struct env175* , const char* ) )lam291 , .env = envinst175 } ) , ( (struct envunion178){ .fun = ( struct Maybe_173 (*) ( struct env177* , const char* ) )lam296 , .env = envinst177 } ) ) ); if ( dref3467.tag == Maybe_173_None_t ) { return ( (struct Stats_155) { .f_total_dash_wins = ( from_dash_integral106 ( 0 ) ) } ); } else { if ( dref3467.tag == Maybe_173_Just_t ) { struct LineIter_306 temp307 = ( ( into_dash_iter308 ) ( ( ( lines309 ) ( ( dref3467 .stuff .Maybe_173_Just_s .field0 ) ) ) ) ); struct LineIter_306 * it3469 = ( &temp307 ); uint32_t total_dash_wins3470 = ( ( i64_dash_u32310 ) ( ( ( or_dash_else311 ) ( ( ( and_dash_maybe312 ) ( ( ( next313 ) ( ( it3469 ) ) ) , ( parse_dash_int322 ) ) ) , ( from_dash_integral71 ( 0 ) ) ) ) ) ); return ( (struct Stats_155) { .f_total_dash_wins = ( total_dash_wins3470 ) } ); } } } enum GameState_329 { GameState_329_InProgress, GameState_329_Failed, GameState_329_Won, }; struct Tile_333 { bool f_hidden; bool f_is_dash_bomb; bool f_flagged; }; struct Slice_332 { struct Tile_333 * f_ptr; size_t f_count; }; struct Slice_331 { struct Slice_332 * f_ptr; size_t f_count; }; struct TileMap_330 { struct Slice_331 f_tiles; int32_t f_width; int32_t f_height; }; struct TypeSize_338 { size_t f_size; }; static struct TypeSize_338 get_dash_typesize337 ( ) { struct Slice_332 temp339; return ( (struct TypeSize_338) { .f_size = ( sizeof( ( ( temp339 ) ) ) ) } ); } static struct Slice_332 * cast_dash_ptr340 ( void * p349 ) { return ( (struct Slice_332 * ) ( p349 ) ); } static struct Slice_331 allocate336 ( enum CAllocator_6 dref1857 , size_t count1859 ) { if (!( dref1857 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } size_t size1860 = ( ( ( ( get_dash_typesize337 ) ( ) ) ) .f_size ); struct Slice_332 * ptr1861 = ( ( cast_dash_ptr340 ) ( ( ( malloc ) ( ( op_dash_mul245 ( ( size1860 ) , ( count1859 ) ) ) ) ) ) ); return ( (struct Slice_331) { .f_ptr = ( ptr1861 ) , .f_count = ( count1859 ) } ); } struct SliceAddressIter_342 { struct Slice_331 f_slice; size_t f_current_dash_offset; }; static struct SliceAddressIter_342 into_dash_iter343 ( struct SliceAddressIter_342 self1753 ) { return ( self1753 ); } static struct SliceAddressIter_342 addresses344 ( struct Slice_331 slice1750 ) { return ( (struct SliceAddressIter_342) { .f_slice = ( slice1750 ) , .f_current_dash_offset = ( from_dash_integral0 ( 0 ) ) } ); } struct Maybe_346 { enum { Maybe_346_None_t, Maybe_346_Just_t, } tag; union { struct { struct Slice_332 * field0; } Maybe_346_Just_s; } stuff; }; static struct Maybe_346 Maybe_346_Just ( struct Slice_332 * field0 ) { return ( struct Maybe_346 ) { .tag = Maybe_346_Just_t, .stuff = { .Maybe_346_Just_s = { .field0 = field0 } } }; }; static struct Slice_332 * offset_dash_ptr348 ( struct Slice_332 * x333 , int64_t count335 ) { struct Slice_332 temp349; return ( (struct Slice_332 * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp349 ) ) ) ) ) ) ) ) ); } static struct Maybe_346 next347 ( struct SliceAddressIter_342 * self1756 ) { size_t off1757 = ( ( * ( self1756 ) ) .f_current_dash_offset ); if ( ( cmp75 ( ( op_dash_add77 ( ( off1757 ) , ( from_dash_integral0 ( 1 ) ) ) ) , ( ( ( * ( self1756 ) ) .f_slice ) .f_count ) ) == 2 ) ) { return ( (struct Maybe_346) { .tag = Maybe_346_None_t } ); } struct Slice_332 * elem1758 = ( ( offset_dash_ptr348 ) ( ( ( ( * ( self1756 ) ) .f_slice ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( off1757 ) ) ) ) ); (* self1756 ) .f_current_dash_offset = ( op_dash_add77 ( ( off1757 ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_346_Just ) ( ( elem1758 ) ) ); } struct TypeSize_353 { size_t f_size; }; static struct TypeSize_353 get_dash_typesize352 ( ) { struct Tile_333 temp354; return ( (struct TypeSize_353) { .f_size = ( sizeof( ( ( temp354 ) ) ) ) } ); } static struct Tile_333 * cast_dash_ptr355 ( void * p349 ) { return ( (struct Tile_333 * ) ( p349 ) ); } static struct Slice_332 allocate351 ( enum CAllocator_6 dref1857 , size_t count1859 ) { if (!( dref1857 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } size_t size1860 = ( ( ( ( get_dash_typesize352 ) ( ) ) ) .f_size ); struct Tile_333 * ptr1861 = ( ( cast_dash_ptr355 ) ( ( ( malloc ) ( ( op_dash_mul245 ( ( size1860 ) , ( count1859 ) ) ) ) ) ) ); return ( (struct Slice_332) { .f_ptr = ( ptr1861 ) , .f_count = ( count1859 ) } ); } struct env357 { struct Tile_333 x1872; }; struct envunion358 { struct Tile_333 (*fun) ( struct env357* , struct Tile_333 ); struct env357 env; }; struct Range_360 { int32_t field0; int32_t field1; }; static struct Range_360 Range_360_Range ( int32_t field0 , int32_t field1 ) { return ( struct Range_360 ) { .field0 = field0 , .field1 = field1 }; }; struct env361 { struct Slice_332 s1815; struct envunion358 fun1817; ; ; ; }; struct envunion362 { enum Unit_4 (*fun) ( struct env361* , int32_t ); struct env361 env; }; struct RangeIter_363 { struct Range_360 field0; int32_t field1; }; static struct RangeIter_363 RangeIter_363_RangeIter ( struct Range_360 field0 , int32_t field1 ) { return ( struct RangeIter_363 ) { .field0 = field0 , .field1 = field1 }; }; static struct RangeIter_363 into_dash_iter365 ( struct Range_360 dref836 ) { return ( ( RangeIter_363_RangeIter ) ( ( ( Range_360_Range ) ( ( dref836 .field0 ) , ( dref836 .field1 ) ) ) , ( dref836 .field0 ) ) ); } static int32_t builtin_int32_tcmp (int32_t l, int32_t r) { return (l < r) ? 0 : (l == r) ? 1 : 2; } static enum Ordering_76 cmp367 ( int32_t l154 , int32_t r156 ) { return ( builtin_int32_tcmp( ( l154 ) , ( r156 ) ) ); } static struct Maybe_137 next366 ( struct RangeIter_363 * self844 ) { struct RangeIter_363 dref845 = ( * ( self844 ) ); if ( true ) { if ( ( cmp367 ( ( dref845 .field1 ) , ( dref845 .field0 .field1 ) ) == 2 ) ) { return ( (struct Maybe_137) { .tag = Maybe_137_None_t } ); } struct Maybe_137 x849 = ( ( Maybe_137_Just ) ( ( dref845 .field1 ) ) ); (* self844 ) = ( ( RangeIter_363_RangeIter ) ( ( ( Range_360_Range ) ( ( dref845 .field0 .field0 ) , ( dref845 .field0 .field1 ) ) ) , ( op_dash_add275 ( ( dref845 .field1 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); return ( x849 ); } } static enum Unit_4 for_dash_each359 ( struct Range_360 iterable1014 , struct envunion362 fun1016 ) { struct RangeIter_363 temp364 = ( ( into_dash_iter365 ) ( ( iterable1014 ) ) ); struct RangeIter_363 * it1017 = ( &temp364 ); while ( ( true ) ) { struct Maybe_137 dref1018 = ( ( next366 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_137_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_137_Just_t ) { struct envunion362 temp368 = ( fun1016 ); ( temp368.fun ( &temp368.env , ( dref1018 .stuff .Maybe_137_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct Range_360 to369 ( int32_t from827 , int32_t to829 ) { return ( ( Range_360_Range ) ( ( from827 ) , ( to829 ) ) ); } static struct Tile_333 * offset_dash_ptr373 ( struct Tile_333 * x333 , int64_t count335 ) { struct Tile_333 temp374; return ( (struct Tile_333 * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp374 ) ) ) ) ) ) ) ) ); } static struct Tile_333 * get_dash_ptr372 ( struct Slice_332 slice1667 , size_t i1669 ) { if ( ( ( cmp75 ( ( i1669 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1669 ) , ( ( slice1667 ) .f_count ) ) != 0 ) ) ) { ( ( panic252 ) ( ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1669 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1667 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } struct Tile_333 * elem_dash_ptr1670 = ( ( offset_dash_ptr373 ) ( ( ( slice1667 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1669 ) ) ) ) ); return ( elem_dash_ptr1670 ); } static enum Unit_4 set371 ( struct Slice_332 slice1684 , size_t i1686 , struct Tile_333 x1688 ) { struct Tile_333 * ep1689 = ( ( get_dash_ptr372 ) ( ( slice1684 ) , ( i1686 ) ) ); (* ep1689 ) = ( x1688 ); return ( Unit_4_Unit ); } struct Maybe_379 { enum { Maybe_379_None_t, Maybe_379_Just_t, } tag; union { struct { struct Tile_333 field0; } Maybe_379_Just_s; } stuff; }; static struct Maybe_379 Maybe_379_Just ( struct Tile_333 field0 ) { return ( struct Maybe_379 ) { .tag = Maybe_379_Just_t, .stuff = { .Maybe_379_Just_s = { .field0 = field0 } } }; }; static struct Tile_333 undefined380 ( ) { struct Tile_333 temp381; return ( temp381 ); } static struct Tile_333 or_dash_fail378 ( struct Maybe_379 x1635 , struct StrConcat_253 errmsg1637 ) { struct Maybe_379 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_379_None_t ) { ( ( panic252 ) ( ( errmsg1637 ) ) ); return ( ( undefined380 ) ( ) ); } else { if ( dref1638.tag == Maybe_379_Just_t ) { return ( dref1638 .stuff .Maybe_379_Just_s .field0 ); } } } static struct Maybe_379 try_dash_get382 ( struct Slice_332 slice1673 , size_t i1675 ) { if ( ( ( cmp75 ( ( i1675 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1675 ) , ( ( slice1673 ) .f_count ) ) != 0 ) ) ) { return ( (struct Maybe_379) { .tag = Maybe_379_None_t } ); } struct Tile_333 * elem_dash_ptr1676 = ( ( offset_dash_ptr373 ) ( ( ( slice1673 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1675 ) ) ) ) ); return ( ( Maybe_379_Just ) ( ( * ( elem_dash_ptr1676 ) ) ) ); } static struct Tile_333 get377 ( struct Slice_332 slice1679 , size_t i1681 ) { return ( ( or_dash_fail378 ) ( ( ( try_dash_get382 ) ( ( slice1679 ) , ( i1681 ) ) ) , ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1681 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1679 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } static struct Tile_333 elem_dash_get376 ( struct Slice_332 self1777 , size_t idx1779 ) { return ( ( get377 ) ( ( self1777 ) , ( idx1779 ) ) ); } static enum Unit_4 lam370 ( struct env361* env , int32_t i1819 ) { struct envunion358 temp375 = ( env->fun1817 ); return ( ( set371 ) ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) , ( temp375.fun ( &temp375.env , ( elem_dash_get376 ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) ) ) ) ) ) ); } static enum Unit_4 map356 ( struct Slice_332 s1815 , struct envunion358 fun1817 ) { struct env361 envinst361 = { .s1815 = s1815 , .fun1817 = fun1817 , }; ( ( for_dash_each359 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_i3293 ) ( ( op_dash_sub72 ( ( ( s1815 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) ) ) , ( (struct envunion362){ .fun = ( enum Unit_4 (*) ( struct env361* , int32_t ) )lam370 , .env = envinst361 } ) ) ); return ( Unit_4_Unit ); } static struct Tile_333 lam383 ( struct env357* env , struct Tile_333 dref1874 ) { return ( env->x1872 ); } static struct Slice_332 default350 ( enum CAllocator_6 al1868 , size_t count1870 , struct Tile_333 x1872 ) { struct Slice_332 s1873 = ( ( allocate351 ) ( ( al1868 ) , ( count1870 ) ) ); struct env357 envinst357 = { .x1872 = x1872 , }; ( ( map356 ) ( ( s1873 ) , ( (struct envunion358){ .fun = ( struct Tile_333 (*) ( struct env357* , struct Tile_333 ) )lam383 , .env = envinst357 } ) ) ); return ( s1873 ); } static struct TileMap_330 mk_dash_tiles335 ( size_t w2932 , size_t h2934 , enum CAllocator_6 al2936 ) { struct Slice_331 rows2937 = ( ( allocate336 ) ( ( al2936 ) , ( h2934 ) ) ); struct SliceAddressIter_342 temp341 = into_dash_iter343 ( ( ( addresses344 ) ( ( rows2937 ) ) ) ); while (true) { struct Maybe_346 __cond345 = next347 (&temp341); if ( __cond345 .tag == 0 ) { break; } struct Slice_332 * row2939 = __cond345 .stuff .Maybe_346_Just_s .field0; (* row2939 ) = ( ( default350 ) ( ( al2936 ) , ( w2932 ) , ( (struct Tile_333) { .f_hidden = ( true ) , .f_is_dash_bomb = ( false ) , .f_flagged = ( false ) } ) ) ); } return ( (struct TileMap_330) { .f_tiles = ( rows2937 ) , .f_width = ( ( size_dash_i3293 ) ( ( w2932 ) ) ) , .f_height = ( ( size_dash_i3293 ) ( ( h2934 ) ) ) } ); } static int32_t cast389 ( uint32_t x346 ) { return ( (int32_t ) ( x346 ) ); } static int32_t u32_dash_i32388 ( uint32_t x630 ) { return ( ( cast389 ) ( ( x630 ) ) ); } static uint32_t op_dash_div391 ( uint32_t l240 , uint32_t r242 ) { return ( ( l240 ) / ( r242 ) ); } static uint32_t op_dash_sub392 ( uint32_t l230 , uint32_t r232 ) { return ( ( l230 ) - ( r232 ) ); } static uint32_t op_dash_mul393 ( uint32_t l235 , uint32_t r237 ) { return ( ( l235 ) * ( r237 ) ); } static uint32_t op_dash_add394 ( uint32_t l225 , uint32_t r227 ) { return ( ( l225 ) + ( r227 ) ); } static uint32_t mod390 ( uint32_t l1169 , uint32_t d1171 ) { uint32_t r1172 = ( op_dash_div391 ( ( l1169 ) , ( d1171 ) ) ); uint32_t m1173 = ( op_dash_sub392 ( ( l1169 ) , ( op_dash_mul393 ( ( r1172 ) , ( d1171 ) ) ) ) ); if ( ( cmp105 ( ( m1173 ) , ( from_dash_integral106 ( 0 ) ) ) == 0 ) ) { return ( op_dash_add394 ( ( d1171 ) , ( m1173 ) ) ); } else { return ( m1173 ); } } static uint32_t next_dash_u32395 ( ) { return ( ( cast43 ) ( ( ( rand ) ( ) ) ) ); } struct Tuple2_397 { int32_t field0; int32_t field1; }; static struct Tuple2_397 Tuple2_397_Tuple2 ( int32_t field0 , int32_t field1 ) { return ( struct Tuple2_397 ) { .field0 = field0 , .field1 = field1 }; }; static int32_t fst398 ( struct Tuple2_397 dref1190 ) { return ( dref1190 .field0 ); } static int32_t snd399 ( struct Tuple2_397 dref1193 ) { return ( dref1193 .field1 ); } static struct Tile_333 or_dash_else400 ( struct Maybe_379 self1642 , struct Tile_333 alt1644 ) { struct Maybe_379 dref1645 = ( self1642 ); if ( dref1645.tag == Maybe_379_None_t ) { return ( alt1644 ); } else { if ( dref1645.tag == Maybe_379_Just_t ) { return ( dref1645 .stuff .Maybe_379_Just_s .field0 ); } } } struct Maybe_402 { enum { Maybe_402_None_t, Maybe_402_Just_t, } tag; union { struct { struct Slice_332 field0; } Maybe_402_Just_s; } stuff; }; static struct Maybe_402 Maybe_402_Just ( struct Slice_332 field0 ) { return ( struct Maybe_402 ) { .tag = Maybe_402_Just_t, .stuff = { .Maybe_402_Just_s = { .field0 = field0 } } }; }; struct env403 { size_t x2955; ; }; struct envunion404 { struct Maybe_379 (*fun) ( struct env403* , struct Slice_332 ); struct env403 env; }; static struct Maybe_379 and_dash_maybe401 ( struct Maybe_402 m1201 , struct envunion404 fun1203 ) { struct Maybe_402 dref1204 = ( m1201 ); if ( dref1204.tag == Maybe_402_None_t ) { return ( (struct Maybe_379) { .tag = Maybe_379_None_t } ); } else { if ( dref1204.tag == Maybe_402_Just_t ) { struct envunion404 temp405 = ( fun1203 ); return ( temp405.fun ( &temp405.env , ( dref1204 .stuff .Maybe_402_Just_s .field0 ) ) ); } } } static struct Maybe_402 try_dash_get406 ( struct Slice_331 slice1673 , size_t i1675 ) { if ( ( ( cmp75 ( ( i1675 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1675 ) , ( ( slice1673 ) .f_count ) ) != 0 ) ) ) { return ( (struct Maybe_402) { .tag = Maybe_402_None_t } ); } struct Slice_332 * elem_dash_ptr1676 = ( ( offset_dash_ptr348 ) ( ( ( slice1673 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1675 ) ) ) ) ); return ( ( Maybe_402_Just ) ( ( * ( elem_dash_ptr1676 ) ) ) ); } static struct Maybe_379 lam407 ( struct env403* env , struct Slice_332 s2958 ) { return ( ( try_dash_get382 ) ( ( s2958 ) , ( env->x2955 ) ) ); } static struct Tile_333 elem_dash_get396 ( struct TileMap_330 self2952 , struct Tuple2_397 idx2954 ) { size_t x2955 = ( ( i32_dash_size266 ) ( ( ( fst398 ) ( ( idx2954 ) ) ) ) ); size_t y2956 = ( ( i32_dash_size266 ) ( ( ( snd399 ) ( ( idx2954 ) ) ) ) ); struct env403 envinst403 = { .x2955 = x2955 , }; return ( ( or_dash_else400 ) ( ( ( and_dash_maybe401 ) ( ( ( try_dash_get406 ) ( ( ( self2952 ) .f_tiles ) , ( y2956 ) ) ) , ( (struct envunion404){ .fun = ( struct Maybe_379 (*) ( struct env403* , struct Slice_332 ) )lam407 , .env = envinst403 } ) ) ) , ( (struct Tile_333) { .f_is_dash_bomb = ( false ) , .f_hidden = ( false ) , .f_flagged = ( false ) } ) ) ); } static struct Slice_332 undefined412 ( ) { struct Slice_332 temp413; return ( temp413 ); } static struct Slice_332 or_dash_fail411 ( struct Maybe_402 x1635 , struct StrConcat_253 errmsg1637 ) { struct Maybe_402 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_402_None_t ) { ( ( panic252 ) ( ( errmsg1637 ) ) ); return ( ( undefined412 ) ( ) ); } else { if ( dref1638.tag == Maybe_402_Just_t ) { return ( dref1638 .stuff .Maybe_402_Just_s .field0 ); } } } static struct Slice_332 get410 ( struct Slice_331 slice1679 , size_t i1681 ) { return ( ( or_dash_fail411 ) ( ( ( try_dash_get406 ) ( ( slice1679 ) , ( i1681 ) ) ) , ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1681 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1679 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } static struct Slice_332 elem_dash_get409 ( struct Slice_331 self1777 , size_t idx1779 ) { return ( ( get410 ) ( ( self1777 ) , ( idx1779 ) ) ); } static enum Unit_4 map_dash_tile408 ( struct TileMap_330 tilemap2942 , int32_t x2944 , int32_t y2946 , struct Tile_333 (* fun2948 )( struct Tile_333 ) ) { struct Tile_333 * tp2949 = ( ( get_dash_ptr372 ) ( ( elem_dash_get409 ( ( ( tilemap2942 ) .f_tiles ) , ( ( i32_dash_size266 ) ( ( y2946 ) ) ) ) ) , ( ( i32_dash_size266 ) ( ( x2944 ) ) ) ) ); (* tp2949 ) = ( ( fun2948 ) ( ( * ( tp2949 ) ) ) ); return ( Unit_4_Unit ); } static struct Tile_333 lam414 ( struct Tile_333 dref2975 ) { return ( (struct Tile_333) { .f_hidden = ( true ) , .f_is_dash_bomb = ( true ) , .f_flagged = ( false ) } ); } static struct TileMap_330 generate_dash_map334 ( size_t w2961 , size_t h2963 , int32_t bombs2965 , enum CAllocator_6 al2967 ) { struct TileMap_330 tiles2968 = ( ( mk_dash_tiles335 ) ( ( w2961 ) , ( h2963 ) , ( al2967 ) ) ); struct RangeIter_363 temp384 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 1 ) ) , ( bombs2965 ) ) ) ); while (true) { struct Maybe_137 __cond385 = next366 (&temp384); if ( __cond385 .tag == 0 ) { break; } int32_t bomb2970 = __cond385 .stuff .Maybe_137_Just_s .field0; int32_t temp386; int32_t x2971 = ( temp386 ); int32_t temp387; int32_t y2972 = ( temp387 ); while ( ( true ) ) { x2971 = ( ( u32_dash_i32388 ) ( ( ( mod390 ) ( ( ( next_dash_u32395 ) ( ) ) , ( ( size_dash_u32103 ) ( ( w2961 ) ) ) ) ) ) ); y2972 = ( ( u32_dash_i32388 ) ( ( ( mod390 ) ( ( ( next_dash_u32395 ) ( ) ) , ( ( size_dash_u32103 ) ( ( h2963 ) ) ) ) ) ) ); if ( ( ! ( ( elem_dash_get396 ( ( tiles2968 ) , ( ( Tuple2_397_Tuple2 ) ( ( x2971 ) , ( y2972 ) ) ) ) ) .f_is_dash_bomb ) ) ) { break; } } ( ( map_dash_tile408 ) ( ( tiles2968 ) , ( x2971 ) , ( y2972 ) , ( lam414 ) ) ); } return ( tiles2968 ); } enum ControlScheme_416 { ControlScheme_416_MouseControls, ControlScheme_416_KeyControls, }; struct Controls_415 { int32_t f_cursor_dash_x; int32_t f_cursor_dash_y; enum ControlScheme_416 f_current_dash_control_dash_scheme; }; static int32_t op_dash_div417 ( int32_t l217 , int32_t r219 ) { return ( ( l217 ) / ( r219 ) ); } struct envunion420 { struct Tui_55 (*fun) ( struct env51* ); struct env51 env; }; static struct Termios_57 undefined424 ( ) { struct Termios_57 temp425; return ( temp425 ); } static int32_t stdin_dash_fileno426 ( ) { return ( from_dash_integral48 ( 0 ) ); } static struct termios * cast_dash_ptr427 ( struct Termios_57 * p349 ) { return ( (struct termios * ) ( p349 ) ); } static uint32_t u32_dash_and428 ( uint32_t l2609 , uint32_t r2611 ) { return ( ( l2609 ) & ( r2611 ) ); } static uint32_t u32_dash_neg429 ( uint32_t l2614 ) { return ( ~ ( l2614 ) ); } struct Array_431 { uint32_t _arr [4]; }; struct ArrayIter_433 { struct Array_431 f_backing; size_t f_cur; }; static struct ArrayIter_433 into_dash_iter434 ( struct Array_431 self2145 ) { return ( (struct ArrayIter_433) { .f_backing = ( self2145 ) , .f_cur = ( from_dash_integral0 ( 0 ) ) } ); } struct Maybe_435 { enum { Maybe_435_None_t, Maybe_435_Just_t, } tag; union { struct { uint32_t field0; } Maybe_435_Just_s; } stuff; }; static struct Maybe_435 Maybe_435_Just ( uint32_t field0 ) { return ( struct Maybe_435 ) { .tag = Maybe_435_Just_t, .stuff = { .Maybe_435_Just_s = { .field0 = field0 } } }; }; struct StrConcat_441 { struct StrConcat_255 field0; int32_t field1; }; static struct StrConcat_441 StrConcat_441_StrConcat ( struct StrConcat_255 field0 , int32_t field1 ) { return ( struct StrConcat_441 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_440 { struct StrConcat_441 field0; struct Char_17 field1; }; static struct StrConcat_440 StrConcat_440_StrConcat ( struct StrConcat_441 field0 , struct Char_17 field1 ) { return ( struct StrConcat_440 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_444 { struct StrView_25 field0; struct StrConcat_440 field1; }; static struct StrConcat_444 StrConcat_444_StrConcat ( struct StrView_25 field0 , struct StrConcat_440 field1 ) { return ( struct StrConcat_444 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_443 { struct StrConcat_444 field0; struct Char_17 field1; }; static struct StrConcat_443 StrConcat_443_StrConcat ( struct StrConcat_444 field0 , struct Char_17 field1 ) { return ( struct StrConcat_443 ) { .field0 = field0 , .field1 = field1 }; }; static enum Unit_4 print_dash_str448 ( int32_t self1355 ) { ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%d" ) , ( 2 ) ) ) , ( self1355 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str447 ( struct StrConcat_441 self1418 ) { struct StrConcat_441 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str263 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str448 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str446 ( struct StrConcat_440 self1418 ) { struct StrConcat_440 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str447 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str445 ( struct StrConcat_444 self1418 ) { struct StrConcat_444 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str446 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str442 ( struct StrConcat_443 self1418 ) { struct StrConcat_443 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str445 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 panic439 ( struct StrConcat_440 errmsg1622 ) { ( ( print_dash_str442 ) ( ( ( StrConcat_443_StrConcat ) ( ( ( StrConcat_444_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1622 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static uint32_t * cast_dash_ptr449 ( struct Array_431 * p349 ) { return ( (uint32_t * ) ( p349 ) ); } static uint32_t * offset_dash_ptr450 ( uint32_t * x333 , int64_t count335 ) { uint32_t temp451; return ( (uint32_t * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp451 ) ) ) ) ) ) ) ) ); } static uint32_t * get_dash_ptr438 ( struct Array_431 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 4 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 4 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } uint32_t * p2077 = ( ( ( cast_dash_ptr449 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr450 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static uint32_t get437 ( struct Array_431 * arr2080 , size_t i2083 ) { return ( * ( ( get_dash_ptr438 ) ( ( arr2080 ) , ( i2083 ) ) ) ); } static struct Maybe_435 next436 ( struct ArrayIter_433 * self2152 ) { if ( ( cmp75 ( ( ( * ( self2152 ) ) .f_cur ) , ( (size_t ) ( 4 ) ) ) != 0 ) ) { return ( (struct Maybe_435) { .tag = Maybe_435_None_t } ); } uint32_t e2154 = ( ( get437 ) ( ( & ( ( * ( self2152 ) ) .f_backing ) ) , ( ( * ( self2152 ) ) .f_cur ) ) ); (* self2152 ) .f_cur = ( op_dash_add77 ( ( ( * ( self2152 ) ) .f_cur ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_435_Just ) ( ( e2154 ) ) ); } static uint32_t reduce432 ( struct Array_431 iterable1033 , uint32_t base1035 , uint32_t (* fun1037 )( uint32_t , uint32_t ) ) { uint32_t x1038 = ( base1035 ); struct ArrayIter_433 it1039 = ( ( into_dash_iter434 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_435 dref1040 = ( ( next436 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_435_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_435_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_435_Just_s .field0 ) , ( x1038 ) ) ); } } } uint32_t temp452; return ( temp452 ); } static uint32_t u32_dash_or453 ( uint32_t l2601 , uint32_t r2603 ) { return ( ( l2601 ) | ( r2603 ) ); } static uint32_t u32_dash_ors430 ( struct Array_431 vals2606 ) { return ( ( reduce432 ) ( ( vals2606 ) , ( from_dash_integral106 ( 0 ) ) , ( u32_dash_or453 ) ) ); } static struct Array_431 from_dash_listlike454 ( struct Array_431 self325 ) { return ( self325 ); } static uint32_t echo455 ( ) { return ( from_dash_integral106 ( 8 ) ); } static uint32_t icanon456 ( ) { return ( from_dash_integral106 ( 2 ) ); } static uint32_t isig457 ( ) { return ( from_dash_integral106 ( 1 ) ); } static uint32_t iexten458 ( ) { return ( from_dash_integral106 ( 32768 ) ); } struct Array_460 { uint32_t _arr [5]; }; struct ArrayIter_462 { struct Array_460 f_backing; size_t f_cur; }; static struct ArrayIter_462 into_dash_iter463 ( struct Array_460 self2145 ) { return ( (struct ArrayIter_462) { .f_backing = ( self2145 ) , .f_cur = ( from_dash_integral0 ( 0 ) ) } ); } static uint32_t * cast_dash_ptr467 ( struct Array_460 * p349 ) { return ( (uint32_t * ) ( p349 ) ); } static uint32_t * get_dash_ptr466 ( struct Array_460 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 5 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 5 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } uint32_t * p2077 = ( ( ( cast_dash_ptr467 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr450 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static uint32_t get465 ( struct Array_460 * arr2080 , size_t i2083 ) { return ( * ( ( get_dash_ptr466 ) ( ( arr2080 ) , ( i2083 ) ) ) ); } static struct Maybe_435 next464 ( struct ArrayIter_462 * self2152 ) { if ( ( cmp75 ( ( ( * ( self2152 ) ) .f_cur ) , ( (size_t ) ( 5 ) ) ) != 0 ) ) { return ( (struct Maybe_435) { .tag = Maybe_435_None_t } ); } uint32_t e2154 = ( ( get465 ) ( ( & ( ( * ( self2152 ) ) .f_backing ) ) , ( ( * ( self2152 ) ) .f_cur ) ) ); (* self2152 ) .f_cur = ( op_dash_add77 ( ( ( * ( self2152 ) ) .f_cur ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_435_Just ) ( ( e2154 ) ) ); } static uint32_t reduce461 ( struct Array_460 iterable1033 , uint32_t base1035 , uint32_t (* fun1037 )( uint32_t , uint32_t ) ) { uint32_t x1038 = ( base1035 ); struct ArrayIter_462 it1039 = ( ( into_dash_iter463 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_435 dref1040 = ( ( next464 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_435_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_435_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_435_Just_s .field0 ) , ( x1038 ) ) ); } } } uint32_t temp468; return ( temp468 ); } static uint32_t u32_dash_ors459 ( struct Array_460 vals2606 ) { return ( ( reduce461 ) ( ( vals2606 ) , ( from_dash_integral106 ( 0 ) ) , ( u32_dash_or453 ) ) ); } static struct Array_460 from_dash_listlike469 ( struct Array_460 self325 ) { return ( self325 ); } static uint32_t brkint470 ( ) { return ( from_dash_integral106 ( 2 ) ); } static uint32_t icrnl471 ( ) { return ( from_dash_integral106 ( 256 ) ); } static uint32_t inpck472 ( ) { return ( from_dash_integral106 ( 16 ) ); } static uint32_t istrip473 ( ) { return ( from_dash_integral106 ( 32 ) ); } static uint32_t ixon474 ( ) { return ( from_dash_integral106 ( 1024 ) ); } struct Array_476 { uint32_t _arr [1]; }; struct ArrayIter_478 { struct Array_476 f_backing; size_t f_cur; }; static struct ArrayIter_478 into_dash_iter479 ( struct Array_476 self2145 ) { return ( (struct ArrayIter_478) { .f_backing = ( self2145 ) , .f_cur = ( from_dash_integral0 ( 0 ) ) } ); } static uint32_t * cast_dash_ptr483 ( struct Array_476 * p349 ) { return ( (uint32_t * ) ( p349 ) ); } static uint32_t * get_dash_ptr482 ( struct Array_476 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 1 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 1 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } uint32_t * p2077 = ( ( ( cast_dash_ptr483 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr450 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static uint32_t get481 ( struct Array_476 * arr2080 , size_t i2083 ) { return ( * ( ( get_dash_ptr482 ) ( ( arr2080 ) , ( i2083 ) ) ) ); } static struct Maybe_435 next480 ( struct ArrayIter_478 * self2152 ) { if ( ( cmp75 ( ( ( * ( self2152 ) ) .f_cur ) , ( (size_t ) ( 1 ) ) ) != 0 ) ) { return ( (struct Maybe_435) { .tag = Maybe_435_None_t } ); } uint32_t e2154 = ( ( get481 ) ( ( & ( ( * ( self2152 ) ) .f_backing ) ) , ( ( * ( self2152 ) ) .f_cur ) ) ); (* self2152 ) .f_cur = ( op_dash_add77 ( ( ( * ( self2152 ) ) .f_cur ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_435_Just ) ( ( e2154 ) ) ); } static uint32_t reduce477 ( struct Array_476 iterable1033 , uint32_t base1035 , uint32_t (* fun1037 )( uint32_t , uint32_t ) ) { uint32_t x1038 = ( base1035 ); struct ArrayIter_478 it1039 = ( ( into_dash_iter479 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_435 dref1040 = ( ( next480 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_435_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_435_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_435_Just_s .field0 ) , ( x1038 ) ) ); } } } uint32_t temp484; return ( temp484 ); } static uint32_t u32_dash_ors475 ( struct Array_476 vals2606 ) { return ( ( reduce477 ) ( ( vals2606 ) , ( from_dash_integral106 ( 0 ) ) , ( u32_dash_or453 ) ) ); } static struct Array_476 from_dash_listlike485 ( struct Array_476 self325 ) { return ( self325 ); } static uint32_t opost486 ( ) { return ( from_dash_integral106 ( 1 ) ); } static uint32_t cs8487 ( ) { return ( from_dash_integral106 ( 48 ) ); } static uint8_t * cast_dash_ptr490 ( struct Array_58 * p349 ) { return ( (uint8_t * ) ( p349 ) ); } static uint8_t * get_dash_ptr489 ( struct Array_58 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 32 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 32 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } uint8_t * p2077 = ( ( ( cast_dash_ptr490 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr129 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static enum Unit_4 set488 ( struct Array_58 * arr2086 , size_t i2089 , uint8_t e2091 ) { uint8_t * p2092 = ( ( get_dash_ptr489 ) ( ( arr2086 ) , ( i2089 ) ) ); (* p2092 ) = ( e2091 ); return ( Unit_4_Unit ); } static size_t vmin491 ( ) { return ( from_dash_integral0 ( 6 ) ); } static size_t vtime492 ( ) { return ( from_dash_integral0 ( 5 ) ); } static int32_t tcsa_dash_flush493 ( ) { return ( from_dash_integral48 ( 2 ) ); } static struct Termios_57 enable_dash_raw_dash_mode422 ( ) { struct Termios_57 temp423 = ( ( undefined424 ) ( ) ); struct Termios_57 * orig_dash_termios3126 = ( &temp423 ); ( ( tcgetattr ) ( ( ( stdin_dash_fileno426 ) ( ) ) , ( ( cast_dash_ptr427 ) ( ( orig_dash_termios3126 ) ) ) ) ); struct Termios_57 raw3127 = ( * ( orig_dash_termios3126 ) ); raw3127 .f_c_dash_lflag = ( ( u32_dash_and428 ) ( ( ( raw3127 ) .f_c_dash_lflag ) , ( ( u32_dash_neg429 ) ( ( ( u32_dash_ors430 ) ( ( ( from_dash_listlike454 ) ( ( (struct Array_431) { ._arr = { ( ( echo455 ) ( ) ) , ( ( icanon456 ) ( ) ) , ( ( isig457 ) ( ) ) , ( ( ( iexten458 ) ( ) ) ) } } ) ) ) ) ) ) ) ) ); raw3127 .f_c_dash_iflag = ( ( u32_dash_and428 ) ( ( ( raw3127 ) .f_c_dash_iflag ) , ( ( u32_dash_neg429 ) ( ( ( u32_dash_ors459 ) ( ( ( from_dash_listlike469 ) ( ( (struct Array_460) { ._arr = { ( ( brkint470 ) ( ) ) , ( ( icrnl471 ) ( ) ) , ( ( inpck472 ) ( ) ) , ( ( istrip473 ) ( ) ) , ( ( ( ixon474 ) ( ) ) ) } } ) ) ) ) ) ) ) ) ); raw3127 .f_c_dash_oflag = ( ( u32_dash_and428 ) ( ( ( raw3127 ) .f_c_dash_oflag ) , ( ( u32_dash_neg429 ) ( ( ( u32_dash_ors475 ) ( ( ( from_dash_listlike485 ) ( ( (struct Array_476) { ._arr = { ( ( ( opost486 ) ( ) ) ) } } ) ) ) ) ) ) ) ) ); raw3127 .f_c_dash_cflag = ( ( u32_dash_or453 ) ( ( ( raw3127 ) .f_c_dash_cflag ) , ( ( cs8487 ) ( ) ) ) ); ( ( set488 ) ( ( & ( ( raw3127 ) .f_c_dash_cc ) ) , ( ( vmin491 ) ( ) ) , ( from_dash_integral102 ( 0 ) ) ) ); ( ( set488 ) ( ( & ( ( raw3127 ) .f_c_dash_cc ) ) , ( ( vtime492 ) ( ) ) , ( from_dash_integral102 ( 0 ) ) ) ); ( ( tcsetattr ) ( ( ( stdin_dash_fileno426 ) ( ) ) , ( ( tcsa_dash_flush493 ) ( ) ) , ( ( cast_dash_ptr427 ) ( ( & ( raw3127 ) ) ) ) ) ); return ( * ( orig_dash_termios3126 ) ); } static enum Unit_4 for_dash_each496 ( struct StrViewIter_201 iterable1014 , enum Unit_4 (* fun1016 )( struct Char_17 ) ) { struct StrViewIter_201 temp497 = ( ( into_dash_iter325 ) ( ( iterable1014 ) ) ); struct StrViewIter_201 * it1017 = ( &temp497 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next209 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { ( ( fun1016 ) ( ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static enum Unit_4 print495 ( struct StrView_25 s2357 ) { ( ( for_dash_each496 ) ( ( ( chars217 ) ( ( s2357 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 hide_dash_cursor494 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[?25l" ) , ( 6 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 reset_dash_colors498 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[0m" ) , ( 4 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 clear_dash_screen499 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[2J" ) , ( 4 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 enable_dash_mouse500 ( ) { ( ( print_dash_str91 ) ( ( ( from_dash_string110 ) ( ( "\x1b[?1000h\x1b[?1006h" ) , ( 16 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 flush_dash_stdout501 ( ) { ( ( fflush ) ( ( ( null_dash_ptr299 ) ( ) ) ) ); return ( Unit_4_Unit ); } static bool eq504 ( int32_t l101 , int32_t r103 ) { return ( ( l101 ) == ( r103 ) ); } static bool eq503 ( const char* l1606 , const char* r1608 ) { return ( eq504 ( ( ( strcmp ) ( ( l1606 ) , ( r1608 ) ) ) , ( from_dash_integral48 ( 0 ) ) ) ); } static enum ColorPalette_56 query_dash_palette502 ( ) { struct Maybe_161 colorterm2388 = ( ( get162 ) ( ( ( from_dash_string92 ) ( ( "COLORTERM" ) , ( 9 ) ) ) ) ); struct Maybe_161 dref2389 = ( colorterm2388 ); if ( dref2389.tag == Maybe_161_Just_t ) { if ( ( ( eq503 ( ( dref2389 .stuff .Maybe_161_Just_s .field0 ) , ( ( from_dash_string92 ) ( ( "truecolor" ) , ( 9 ) ) ) ) ) || ( eq503 ( ( dref2389 .stuff .Maybe_161_Just_s .field0 ) , ( ( from_dash_string92 ) ( ( "24bit" ) , ( 5 ) ) ) ) ) ) ) { return ( ColorPalette_56_PaletteRGB ); } } else { if ( dref2389.tag == Maybe_161_None_t ) { } } struct Maybe_161 dref2391 = ( ( get162 ) ( ( ( from_dash_string92 ) ( ( "TERM" ) , ( 4 ) ) ) ) ); if ( dref2391.tag == Maybe_161_Just_t ) { if ( ( eq503 ( ( dref2391 .stuff .Maybe_161_Just_s .field0 ) , ( ( from_dash_string92 ) ( ( "linux" ) , ( 5 ) ) ) ) ) ) { return ( ColorPalette_56_Palette8 ); } } else { if ( dref2391.tag == Maybe_161_None_t ) { } } return ( ColorPalette_56_Palette16 ); } struct Tuple2_505 { uint32_t field0; uint32_t field1; }; static struct Tuple2_505 Tuple2_505_Tuple2 ( uint32_t field0 , uint32_t field1 ) { return ( struct Tuple2_505 ) { .field0 = field0 , .field1 = field1 }; }; struct Winsize_507 { uint16_t f_ws_dash_row; uint16_t f_ws_dash_col; uint16_t f_ws_dash_xpixel; uint16_t f_ws_dash_ypixel; }; static void * cast_dash_ptr511 ( struct Winsize_507 * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of512 ( struct Winsize_507 x340 ) { return ( sizeof( ( x340 ) ) ); } static struct Winsize_507 zeroed509 ( ) { struct Winsize_507 temp510; struct Winsize_507 x549 = ( temp510 ); ( ( memset ) ( ( ( cast_dash_ptr511 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of512 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static int32_t stdout_dash_fileno513 ( ) { return ( from_dash_integral48 ( 1 ) ); } static uint64_t from_dash_integral515 ( int64_t x64 ) { return ( (uint64_t ) ( x64 ) ); } static uint64_t tiocgwinsz514 ( ) { return ( from_dash_integral515 ( 21523 ) ); } static int32_t op_dash_neg516 ( int32_t x222 ) { return ( ( from_dash_integral48 ( 0 ) ) - ( x222 ) ); } static bool eq517 ( uint16_t l116 , uint16_t r118 ) { return ( ( l116 ) == ( r118 ) ); } static uint16_t from_dash_integral518 ( int64_t x55 ) { return ( (uint16_t ) ( x55 ) ); } static void * cast_dash_ptr524 ( uint32_t * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of525 ( uint32_t x340 ) { return ( sizeof( ( x340 ) ) ); } static uint32_t zeroed522 ( ) { uint32_t temp523; uint32_t x549 = ( temp523 ); ( ( memset ) ( ( ( cast_dash_ptr524 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of525 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static uint16_t * cast526 ( uint32_t * x346 ) { return ( (uint16_t * ) ( x346 ) ); } static uint32_t cast_dash_on_dash_zeroed520 ( uint16_t x552 ) { uint32_t temp521 = ( ( zeroed522 ) ( ) ); uint32_t * y553 = ( &temp521 ); uint16_t * yp554 = ( ( cast526 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static uint32_t u16_dash_u32519 ( uint16_t x615 ) { return ( ( cast_dash_on_dash_zeroed520 ) ( ( x615 ) ) ); } static struct Tuple2_505 get_dash_dimensions506 ( ) { struct Winsize_507 temp508 = ( ( ( zeroed509 ) ( ) ) ); struct Winsize_507 * ws2376 = ( &temp508 ); if ( ( ( eq504 ( ( ( ioctl ) ( ( ( stdout_dash_fileno513 ) ( ) ) , ( ( tiocgwinsz514 ) ( ) ) , ( ws2376 ) ) ) , ( op_dash_neg516 ( ( from_dash_integral48 ( 1 ) ) ) ) ) ) || ( eq517 ( ( ( * ( ws2376 ) ) .f_ws_dash_col ) , ( from_dash_integral518 ( 0 ) ) ) ) ) ) { return ( ( Tuple2_505_Tuple2 ) ( ( from_dash_integral106 ( 80 ) ) , ( from_dash_integral106 ( 24 ) ) ) ); } return ( ( Tuple2_505_Tuple2 ) ( ( ( u16_dash_u32519 ) ( ( ( * ( ws2376 ) ) .f_ws_dash_col ) ) ) , ( ( u16_dash_u32519 ) ( ( ( * ( ws2376 ) ) .f_ws_dash_row ) ) ) ) ); } static struct timespec undefined529 ( ) { struct timespec temp530; return ( temp530 ); } static int32_t clock_dash_monotonic531 ( ) { return ( from_dash_integral48 ( 1 ) ); } static struct timespec now527 ( ) { struct timespec temp528 = ( ( undefined529 ) ( ) ); struct timespec * t3088 = ( &temp528 ); ( ( clock_gettime ) ( ( ( clock_dash_monotonic531 ) ( ) ) , ( t3088 ) ) ); return ( * ( t3088 ) ); } struct env532 { bool * should_dash_resize3140; }; struct envunion533 { enum Unit_4 (*fun) ( struct env532* , int32_t ); struct env532 env; }; struct envunion533 _intr_sigarr[32]; static void _intr_sighandle ( int32_t __intr__sig534 ) { struct envunion533 temp535 = _intr_sigarr [ __intr__sig534 ]; temp535.fun ( &temp535.env , __intr__sig534 ); } static enum Unit_4 _intr_register_signal ( int32_t __intr__sig536 , struct envunion533 __intr__fun537 ) { _intr_sigarr [ __intr__sig536 ] = __intr__fun537; signal( __intr__sig536 , _intr_sighandle ); return Unit_4_Unit; } static enum Unit_4 lam538 ( struct env532* env , int32_t dref3147 ) { (* env->should_dash_resize3140 ) = ( true ); return ( Unit_4_Unit ); } static uint32_t fst539 ( struct Tuple2_505 dref1190 ) { return ( dref1190 .field0 ); } static uint32_t snd540 ( struct Tuple2_505 dref1193 ) { return ( dref1193 .field1 ); } static struct Tui_55 mk421 ( struct env51* env ) { struct Termios_57 og_dash_termios3142 = ( ( enable_dash_raw_dash_mode422 ) ( ) ); ( ( hide_dash_cursor494 ) ( ) ); ( ( reset_dash_colors498 ) ( ) ); ( ( clear_dash_screen499 ) ( ) ); ( ( enable_dash_mouse500 ) ( ) ); ( ( flush_dash_stdout501 ) ( ) ); enum ColorPalette_56 palette3143 = ( ( query_dash_palette502 ) ( ) ); struct Tuple2_505 dims3144 = ( ( get_dash_dimensions506 ) ( ) ); uint32_t fps3145 = ( from_dash_integral106 ( 60 ) ); struct timespec last_dash_sync3146 = ( ( now527 ) ( ) ); struct env532 envinst532 = { .should_dash_resize3140 = env->should_dash_resize3140 , }; ( _intr_register_signal ( ( from_dash_integral48 ( 28 ) ) , ( (struct envunion533){ .fun = ( enum Unit_4 (*) ( struct env532* , int32_t ) )lam538 , .env = envinst532 } ) ) ); return ( (struct Tui_55) { .f_width = ( ( fst539 ) ( ( dims3144 ) ) ) , .f_height = ( ( snd540 ) ( ( dims3144 ) ) ) , .f_target_dash_fps = ( fps3145 ) , .f_actual_dash_fps = ( from_dash_integral106 ( 0 ) ) , .f_last_dash_sync = ( last_dash_sync3146 ) , .f_fps_dash_ts = ( last_dash_sync3146 ) , .f_fps_dash_count = ( from_dash_integral106 ( 0 ) ) , .f_orig_dash_termios = ( og_dash_termios3142 ) , .f_palette = ( palette3143 ) , .f_should_dash_redraw = ( true ) } ); } enum Color8_545 { Color8_545_Black8, Color8_545_Red8, Color8_545_Green8, Color8_545_Yellow8, Color8_545_Blue8, Color8_545_Magenta8, Color8_545_Cyan8, Color8_545_White8, }; enum Color16_546 { Color16_546_Black16, Color16_546_Red16, Color16_546_Green16, Color16_546_Yellow16, Color16_546_Blue16, Color16_546_Magenta16, Color16_546_Cyan16, Color16_546_White16, Color16_546_BrightBlack16, Color16_546_BrightRed16, Color16_546_BrightGreen16, Color16_546_BrightYellow16, Color16_546_BrightBlue16, Color16_546_BrightMagenta16, Color16_546_BrightCyan16, Color16_546_BrightWhite16, }; struct RGB_547 { uint8_t f_r; uint8_t f_g; uint8_t f_b; }; struct Color_544 { enum { Color_544_ColorDefault_t, Color_544_Color8_t, Color_544_Color16_t, Color_544_Color256_t, Color_544_ColorRGB_t, } tag; union { struct { enum Color8_545 field0; } Color_544_Color8_s; struct { enum Color16_546 field0; } Color_544_Color16_s; struct { uint8_t field0; } Color_544_Color256_s; struct { struct RGB_547 field0; } Color_544_ColorRGB_s; } stuff; }; static struct Color_544 Color_544_Color8 ( enum Color8_545 field0 ) { return ( struct Color_544 ) { .tag = Color_544_Color8_t, .stuff = { .Color_544_Color8_s = { .field0 = field0 } } }; }; static struct Color_544 Color_544_Color16 ( enum Color16_546 field0 ) { return ( struct Color_544 ) { .tag = Color_544_Color16_t, .stuff = { .Color_544_Color16_s = { .field0 = field0 } } }; }; static struct Color_544 Color_544_Color256 ( uint8_t field0 ) { return ( struct Color_544 ) { .tag = Color_544_Color256_t, .stuff = { .Color_544_Color256_s = { .field0 = field0 } } }; }; static struct Color_544 Color_544_ColorRGB ( struct RGB_547 field0 ) { return ( struct Color_544 ) { .tag = Color_544_ColorRGB_t, .stuff = { .Color_544_ColorRGB_s = { .field0 = field0 } } }; }; struct Cell_543 { struct Char_17 f_c; struct Color_544 f_fg; struct Color_544 f_bg; }; struct Slice_542 { struct Cell_543 * f_ptr; size_t f_count; }; struct Screen_541 { enum CAllocator_6 f_al; struct Tui_55 * f_tui; struct Slice_542 f_current; struct Slice_542 f_previous; bool f_requires_dash_full_dash_redraw; struct Color_544 f_default_dash_fg; struct Color_544 f_default_dash_bg; }; struct TypeSize_552 { size_t f_size; }; static struct TypeSize_552 get_dash_typesize551 ( ) { struct Cell_543 temp553; return ( (struct TypeSize_552) { .f_size = ( sizeof( ( ( temp553 ) ) ) ) } ); } static struct Cell_543 * cast_dash_ptr554 ( void * p349 ) { return ( (struct Cell_543 * ) ( p349 ) ); } static struct Slice_542 allocate550 ( enum CAllocator_6 dref1857 , size_t count1859 ) { if (!( dref1857 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } size_t size1860 = ( ( ( ( get_dash_typesize551 ) ( ) ) ) .f_size ); struct Cell_543 * ptr1861 = ( ( cast_dash_ptr554 ) ( ( ( malloc ) ( ( op_dash_mul245 ( ( size1860 ) , ( count1859 ) ) ) ) ) ) ); return ( (struct Slice_542) { .f_ptr = ( ptr1861 ) , .f_count = ( count1859 ) } ); } static void * cast_dash_ptr560 ( size_t * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of561 ( size_t x340 ) { return ( sizeof( ( x340 ) ) ); } static size_t zeroed558 ( ) { size_t temp559; size_t x549 = ( temp559 ); ( ( memset ) ( ( ( cast_dash_ptr560 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of561 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static uint32_t * cast562 ( size_t * x346 ) { return ( (uint32_t * ) ( x346 ) ); } static size_t cast_dash_on_dash_zeroed556 ( uint32_t x552 ) { size_t temp557 = ( ( zeroed558 ) ( ) ); size_t * y553 = ( &temp557 ); uint32_t * yp554 = ( ( cast562 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static size_t u32_dash_size555 ( uint32_t x621 ) { return ( ( cast_dash_on_dash_zeroed556 ) ( ( x621 ) ) ); } struct env565 { struct Slice_542 s1815; struct Cell_543 (* fun1817 )( struct Cell_543 ); ; ; ; }; struct envunion566 { enum Unit_4 (*fun) ( struct env565* , int32_t ); struct env565 env; }; static enum Unit_4 for_dash_each564 ( struct Range_360 iterable1014 , struct envunion566 fun1016 ) { struct RangeIter_363 temp567 = ( ( into_dash_iter365 ) ( ( iterable1014 ) ) ); struct RangeIter_363 * it1017 = ( &temp567 ); while ( ( true ) ) { struct Maybe_137 dref1018 = ( ( next366 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_137_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_137_Just_t ) { struct envunion566 temp568 = ( fun1016 ); ( temp568.fun ( &temp568.env , ( dref1018 .stuff .Maybe_137_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct Cell_543 * offset_dash_ptr572 ( struct Cell_543 * x333 , int64_t count335 ) { struct Cell_543 temp573; return ( (struct Cell_543 * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp573 ) ) ) ) ) ) ) ) ); } static struct Cell_543 * get_dash_ptr571 ( struct Slice_542 slice1667 , size_t i1669 ) { if ( ( ( cmp75 ( ( i1669 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1669 ) , ( ( slice1667 ) .f_count ) ) != 0 ) ) ) { ( ( panic252 ) ( ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1669 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1667 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } struct Cell_543 * elem_dash_ptr1670 = ( ( offset_dash_ptr572 ) ( ( ( slice1667 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1669 ) ) ) ) ); return ( elem_dash_ptr1670 ); } static enum Unit_4 set570 ( struct Slice_542 slice1684 , size_t i1686 , struct Cell_543 x1688 ) { struct Cell_543 * ep1689 = ( ( get_dash_ptr571 ) ( ( slice1684 ) , ( i1686 ) ) ); (* ep1689 ) = ( x1688 ); return ( Unit_4_Unit ); } struct Maybe_577 { enum { Maybe_577_None_t, Maybe_577_Just_t, } tag; union { struct { struct Cell_543 field0; } Maybe_577_Just_s; } stuff; }; static struct Maybe_577 Maybe_577_Just ( struct Cell_543 field0 ) { return ( struct Maybe_577 ) { .tag = Maybe_577_Just_t, .stuff = { .Maybe_577_Just_s = { .field0 = field0 } } }; }; static struct Cell_543 undefined578 ( ) { struct Cell_543 temp579; return ( temp579 ); } static struct Cell_543 or_dash_fail576 ( struct Maybe_577 x1635 , struct StrConcat_253 errmsg1637 ) { struct Maybe_577 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_577_None_t ) { ( ( panic252 ) ( ( errmsg1637 ) ) ); return ( ( undefined578 ) ( ) ); } else { if ( dref1638.tag == Maybe_577_Just_t ) { return ( dref1638 .stuff .Maybe_577_Just_s .field0 ); } } } static struct Maybe_577 try_dash_get580 ( struct Slice_542 slice1673 , size_t i1675 ) { if ( ( ( cmp75 ( ( i1675 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1675 ) , ( ( slice1673 ) .f_count ) ) != 0 ) ) ) { return ( (struct Maybe_577) { .tag = Maybe_577_None_t } ); } struct Cell_543 * elem_dash_ptr1676 = ( ( offset_dash_ptr572 ) ( ( ( slice1673 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1675 ) ) ) ) ); return ( ( Maybe_577_Just ) ( ( * ( elem_dash_ptr1676 ) ) ) ); } static struct Cell_543 get575 ( struct Slice_542 slice1679 , size_t i1681 ) { return ( ( or_dash_fail576 ) ( ( ( try_dash_get580 ) ( ( slice1679 ) , ( i1681 ) ) ) , ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1681 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1679 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } static struct Cell_543 elem_dash_get574 ( struct Slice_542 self1777 , size_t idx1779 ) { return ( ( get575 ) ( ( self1777 ) , ( idx1779 ) ) ); } static enum Unit_4 lam569 ( struct env565* env , int32_t i1819 ) { return ( ( set570 ) ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) , ( ( env->fun1817 ) ( ( elem_dash_get574 ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) ) ) ) ) ) ); } static enum Unit_4 map563 ( struct Slice_542 s1815 , struct Cell_543 (* fun1817 )( struct Cell_543 ) ) { struct env565 envinst565 = { .s1815 = s1815 , .fun1817 = fun1817 , }; ( ( for_dash_each564 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_i3293 ) ( ( op_dash_sub72 ( ( ( s1815 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) ) ) , ( (struct envunion566){ .fun = ( enum Unit_4 (*) ( struct env565* , int32_t ) )lam569 , .env = envinst565 } ) ) ); return ( Unit_4_Unit ); } static struct Cell_543 lam581 ( struct Cell_543 dref3249 ) { return ( (struct Cell_543) { .f_c = ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , .f_fg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_bg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) } ); } struct env584 { struct Slice_542 s1815; struct Cell_543 (* fun1817 )( struct Cell_543 ); ; ; ; }; struct envunion585 { enum Unit_4 (*fun) ( struct env584* , int32_t ); struct env584 env; }; static enum Unit_4 for_dash_each583 ( struct Range_360 iterable1014 , struct envunion585 fun1016 ) { struct RangeIter_363 temp586 = ( ( into_dash_iter365 ) ( ( iterable1014 ) ) ); struct RangeIter_363 * it1017 = ( &temp586 ); while ( ( true ) ) { struct Maybe_137 dref1018 = ( ( next366 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_137_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_137_Just_t ) { struct envunion585 temp587 = ( fun1016 ); ( temp587.fun ( &temp587.env , ( dref1018 .stuff .Maybe_137_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static enum Unit_4 lam588 ( struct env584* env , int32_t i1819 ) { return ( ( set570 ) ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) , ( ( env->fun1817 ) ( ( elem_dash_get574 ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) ) ) ) ) ) ); } static enum Unit_4 map582 ( struct Slice_542 s1815 , struct Cell_543 (* fun1817 )( struct Cell_543 ) ) { struct env584 envinst584 = { .s1815 = s1815 , .fun1817 = fun1817 , }; ( ( for_dash_each583 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_i3293 ) ( ( op_dash_sub72 ( ( ( s1815 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) ) ) , ( (struct envunion585){ .fun = ( enum Unit_4 (*) ( struct env584* , int32_t ) )lam588 , .env = envinst584 } ) ) ); return ( Unit_4_Unit ); } static struct Cell_543 lam589 ( struct Cell_543 dref3251 ) { return ( (struct Cell_543) { .f_c = ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , .f_fg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_bg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) } ); } static struct Screen_541 mk_dash_screen549 ( struct Tui_55 * tui3245 , enum CAllocator_6 al3247 ) { struct Slice_542 cur3248 = ( ( allocate550 ) ( ( al3247 ) , ( ( u32_dash_size555 ) ( ( op_dash_mul393 ( ( ( * ( tui3245 ) ) .f_width ) , ( ( * ( tui3245 ) ) .f_height ) ) ) ) ) ) ); ( ( map563 ) ( ( cur3248 ) , ( lam581 ) ) ); struct Slice_542 prev3250 = ( ( allocate550 ) ( ( al3247 ) , ( ( u32_dash_size555 ) ( ( op_dash_mul393 ( ( ( * ( tui3245 ) ) .f_width ) , ( ( * ( tui3245 ) ) .f_height ) ) ) ) ) ) ); ( ( map582 ) ( ( prev3250 ) , ( lam589 ) ) ); return ( (struct Screen_541) { .f_current = ( cur3248 ) , .f_previous = ( prev3250 ) , .f_al = ( al3247 ) , .f_tui = ( tui3245 ) , .f_requires_dash_full_dash_redraw = ( true ) , .f_default_dash_fg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_default_dash_bg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) } ); } struct Key_596 { enum { Key_596_Escape_t, Key_596_Enter_t, Key_596_Tab_t, Key_596_Backspace_t, Key_596_Char_t, Key_596_Ctrl_t, Key_596_Up_t, Key_596_Down_t, Key_596_Left_t, Key_596_Right_t, Key_596_Home_t, Key_596_End_t, Key_596_PageUp_t, Key_596_PageDown_t, Key_596_Delete_t, Key_596_Insert_t, Key_596_F1_t, Key_596_F2_t, Key_596_F3_t, Key_596_F4_t, Key_596_F5_t, Key_596_F6_t, Key_596_F7_t, Key_596_F8_t, Key_596_F9_t, Key_596_F10_t, Key_596_F11_t, Key_596_F12_t, } tag; union { struct { char field0; } Key_596_Char_s; struct { char field0; } Key_596_Ctrl_s; } stuff; }; static struct Key_596 Key_596_Char ( char field0 ) { return ( struct Key_596 ) { .tag = Key_596_Char_t, .stuff = { .Key_596_Char_s = { .field0 = field0 } } }; }; static struct Key_596 Key_596_Ctrl ( char field0 ) { return ( struct Key_596 ) { .tag = Key_596_Ctrl_t, .stuff = { .Key_596_Ctrl_s = { .field0 = field0 } } }; }; enum MouseButton_598 { MouseButton_598_MouseLeft, MouseButton_598_MouseMiddle, MouseButton_598_MouseRight, MouseButton_598_ScrollUp, MouseButton_598_ScrollDown, }; struct MouseEvent_597 { enum MouseButton_598 f_button; int32_t f_x; int32_t f_y; bool f_pressed; }; struct InputEvent_595 { enum { InputEvent_595_Key_t, InputEvent_595_Mouse_t, } tag; union { struct { struct Key_596 field0; } InputEvent_595_Key_s; struct { struct MouseEvent_597 field0; } InputEvent_595_Mouse_s; } stuff; }; static struct InputEvent_595 InputEvent_595_Key ( struct Key_596 field0 ) { return ( struct InputEvent_595 ) { .tag = InputEvent_595_Key_t, .stuff = { .InputEvent_595_Key_s = { .field0 = field0 } } }; }; static struct InputEvent_595 InputEvent_595_Mouse ( struct MouseEvent_597 field0 ) { return ( struct InputEvent_595 ) { .tag = InputEvent_595_Mouse_t, .stuff = { .InputEvent_595_Mouse_s = { .field0 = field0 } } }; }; struct Maybe_594 { enum { Maybe_594_None_t, Maybe_594_Just_t, } tag; union { struct { struct InputEvent_595 field0; } Maybe_594_Just_s; } stuff; }; static struct Maybe_594 Maybe_594_Just ( struct InputEvent_595 field0 ) { return ( struct Maybe_594 ) { .tag = Maybe_594_Just_t, .stuff = { .Maybe_594_Just_s = { .field0 = field0 } } }; }; struct envunion593 { struct Maybe_594 (*fun) ( struct env53* , struct Tui_55 * ); struct env53 env; }; struct env592 { struct env53 envinst53; struct Tui_55 * tui3500; }; struct envunion599 { struct Maybe_594 (*fun) ( struct env592* ); struct env592 env; }; struct FunIter_591 { struct envunion599 f_fun; bool f_finished; }; static struct FunIter_591 into_dash_iter600 ( struct FunIter_591 self981 ) { return ( self981 ); } static struct FunIter_591 from_dash_function601 ( struct envunion599 fun989 ) { return ( (struct FunIter_591) { .f_fun = ( fun989 ) , .f_finished = ( false ) } ); } static bool update_dash_dimensions606 ( struct env52* env , struct Tui_55 * tui3212 ) { if ( ( ! ( * ( env->should_dash_resize3140 ) ) ) ) { return ( false ); } (* tui3212 ) .f_should_dash_redraw = ( true ); (* env->should_dash_resize3140 ) = ( false ); struct Tuple2_505 dim3213 = ( ( get_dash_dimensions506 ) ( ) ); uint32_t w3214 = ( ( fst539 ) ( ( dim3213 ) ) ); uint32_t h3215 = ( ( snd540 ) ( ( dim3213 ) ) ); (* tui3212 ) .f_width = ( w3214 ); (* tui3212 ) .f_height = ( h3215 ); return ( true ); } static char undefined609 ( ) { char temp610; return ( temp610 ); } struct Maybe_611 { enum { Maybe_611_None_t, Maybe_611_Just_t, } tag; union { struct { char field0; } Maybe_611_Just_s; } stuff; }; static struct Maybe_611 Maybe_611_Just ( char field0 ) { return ( struct Maybe_611 ) { .tag = Maybe_611_Just_t, .stuff = { .Maybe_611_Just_s = { .field0 = field0 } } }; }; struct Pollfd_613 { int32_t f_fd; uint16_t f_events; uint16_t f_revents; }; static struct pollfd * cast_dash_ptr614 ( struct Pollfd_613 * p349 ) { return ( (struct pollfd * ) ( p349 ) ); } static void * cast_dash_ptr617 ( char * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of618 ( char x340 ) { return ( sizeof( ( x340 ) ) ); } static char zeroed615 ( ) { char temp616; char x549 = ( temp616 ); ( ( memset ) ( ( ( cast_dash_ptr617 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of618 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static struct Maybe_611 read_dash_byte612 ( int32_t timeout_dash_ms3134 ) { struct Pollfd_613 pfd3135 = ( (struct Pollfd_613) { .f_fd = ( from_dash_integral48 ( 0 ) ) , .f_events = ( from_dash_integral518 ( 1 ) ) , .f_revents = ( from_dash_integral518 ( 0 ) ) } ); if ( ( cmp367 ( ( ( poll ) ( ( ( cast_dash_ptr614 ) ( ( & ( pfd3135 ) ) ) ) , ( from_dash_integral48 ( 1 ) ) , ( timeout_dash_ms3134 ) ) ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_611) { .tag = Maybe_611_None_t } ); } char c3136 = ( ( ( zeroed615 ) ( ) ) ); if ( ( cmp367 ( ( ( read ) ( ( ( stdin_dash_fileno426 ) ( ) ) , ( ( cast_dash_ptr617 ) ( ( & ( c3136 ) ) ) ) , ( from_dash_integral0 ( 1 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_611) { .tag = Maybe_611_None_t } ); } return ( ( Maybe_611_Just ) ( ( c3136 ) ) ); } static uint8_t ascii_dash_u8619 ( char c732 ) { return ( ( (uint8_t ) ( c732 ) ) ); } static char u8_dash_ascii620 ( uint8_t b735 ) { return ( ( (char ) ( b735 ) ) ); } static uint8_t * cast624 ( uint32_t * x346 ) { return ( (uint8_t * ) ( x346 ) ); } static uint32_t cast_dash_on_dash_zeroed622 ( uint8_t x552 ) { uint32_t temp623 = ( ( zeroed522 ) ( ) ); uint32_t * y553 = ( &temp623 ); uint8_t * yp554 = ( ( cast624 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static uint32_t u8_dash_u32621 ( uint8_t x642 ) { return ( ( cast_dash_on_dash_zeroed622 ) ( ( x642 ) ) ); } struct Map_627 { struct StrViewIter_201 field0; uint32_t (* field1 )( struct Char_17 ); }; static struct Map_627 Map_627_Map ( struct StrViewIter_201 field0 , uint32_t (* field1 )( struct Char_17 ) ) { return ( struct Map_627 ) { .field0 = field0 , .field1 = field1 }; }; static struct Map_627 into_dash_iter628 ( struct Map_627 self749 ) { return ( self749 ); } static struct Maybe_435 next629 ( struct Map_627 * dref751 ) { struct Maybe_125 dref754 = ( ( next209 ) ( ( & ( (* dref751 ) .field0 ) ) ) ); if ( dref754.tag == Maybe_125_None_t ) { return ( (struct Maybe_435) { .tag = Maybe_435_None_t } ); } else { if ( dref754.tag == Maybe_125_Just_t ) { return ( ( Maybe_435_Just ) ( ( ( (* dref751 ) .field1 ) ( ( dref754 .stuff .Maybe_125_Just_s .field0 ) ) ) ) ); } } } static uint32_t reduce626 ( struct Map_627 iterable1033 , uint32_t base1035 , uint32_t (* fun1037 )( uint32_t , uint32_t ) ) { uint32_t x1038 = ( base1035 ); struct Map_627 it1039 = ( ( into_dash_iter628 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_435 dref1040 = ( ( next629 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_435_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_435_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_435_Just_s .field0 ) , ( x1038 ) ) ); } } } uint32_t temp630; return ( temp630 ); } static struct Map_627 map631 ( struct StrView_25 iterable758 , uint32_t (* fun760 )( struct Char_17 ) ) { struct StrViewIter_201 it761 = ( ( into_dash_iter218 ) ( ( iterable758 ) ) ); return ( ( Map_627_Map ) ( ( it761 ) , ( fun760 ) ) ); } static void * cast_dash_ptr638 ( int64_t * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of639 ( int64_t x340 ) { return ( sizeof( ( x340 ) ) ); } static int64_t zeroed636 ( ) { int64_t temp637; int64_t x549 = ( temp637 ); ( ( memset ) ( ( ( cast_dash_ptr638 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of639 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static uint8_t * cast640 ( int64_t * x346 ) { return ( (uint8_t * ) ( x346 ) ); } static int64_t cast_dash_on_dash_zeroed634 ( uint8_t x552 ) { int64_t temp635 = ( ( zeroed636 ) ( ) ); int64_t * y553 = ( &temp635 ); uint8_t * yp554 = ( ( cast640 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static int64_t u8_dash_i64633 ( uint8_t x636 ) { return ( ( cast_dash_on_dash_zeroed634 ) ( ( x636 ) ) ); } struct StrConcat_643 { struct Char_17 field0; struct Char_17 field1; }; static struct StrConcat_643 StrConcat_643_StrConcat ( struct Char_17 field0 , struct Char_17 field1 ) { return ( struct StrConcat_643 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_642 { struct StrConcat_643 field0; struct StrView_25 field1; }; static struct StrConcat_642 StrConcat_642_StrConcat ( struct StrConcat_643 field0 , struct StrView_25 field1 ) { return ( struct StrConcat_642 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_647 { struct StrView_25 field0; struct StrConcat_642 field1; }; static struct StrConcat_647 StrConcat_647_StrConcat ( struct StrView_25 field0 , struct StrConcat_642 field1 ) { return ( struct StrConcat_647 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_646 { struct StrConcat_647 field0; struct Char_17 field1; }; static struct StrConcat_646 StrConcat_646_StrConcat ( struct StrConcat_647 field0 , struct Char_17 field1 ) { return ( struct StrConcat_646 ) { .field0 = field0 , .field1 = field1 }; }; static enum Unit_4 print_dash_str650 ( struct StrConcat_643 self1418 ) { struct StrConcat_643 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str94 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str649 ( struct StrConcat_642 self1418 ) { struct StrConcat_642 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str650 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str91 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str648 ( struct StrConcat_647 self1418 ) { struct StrConcat_647 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str649 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str645 ( struct StrConcat_646 self1418 ) { struct StrConcat_646 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str648 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 panic644 ( struct StrConcat_642 errmsg1622 ) { ( ( print_dash_str645 ) ( ( ( StrConcat_646_StrConcat ) ( ( ( StrConcat_647_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1622 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static uint8_t or_dash_fail641 ( struct Maybe_232 x1635 , struct StrConcat_642 errmsg1637 ) { struct Maybe_232 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_232_None_t ) { ( ( panic644 ) ( ( errmsg1637 ) ) ); return ( ( undefined317 ) ( ) ); } else { if ( dref1638.tag == Maybe_232_Just_t ) { return ( dref1638 .stuff .Maybe_232_Just_s .field0 ); } } } static enum Ordering_76 cmp652 ( struct Char_17 l712 , struct Char_17 r714 ) { if ( ( ( ! eq81 ( ( ( l712 ) .f_num_dash_bytes ) , ( from_dash_integral0 ( 1 ) ) ) ) || ( ! eq81 ( ( ( r714 ) .f_num_dash_bytes ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) { const char* temp653 = ( ( from_dash_string92 ) ( ( "(TODO) comparison of non-ascii characters not implemented" ) , ( 57 ) ) ); printf("%s\n", temp653); exit ( 1 ); ( Unit_4_Unit ); } return ( ( cmp115 ) ( ( ( char_dash_u8140 ) ( ( l712 ) ) ) , ( ( char_dash_u8140 ) ( ( r714 ) ) ) ) ); } static struct Maybe_232 hex_dash_digit651 ( struct Char_17 c2339 ) { if ( ( ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "0" ) , ( 1 ) ) ) ) != 0 ) && ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "9" ) , ( 1 ) ) ) ) != 2 ) ) ) { return ( ( Maybe_232_Just ) ( ( op_dash_sub149 ( ( ( char_dash_u8140 ) ( ( c2339 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "0" ) , ( 1 ) ) ) ) ) ) ) ) ); } if ( ( ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "a" ) , ( 1 ) ) ) ) != 0 ) && ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "f" ) , ( 1 ) ) ) ) != 2 ) ) ) { return ( ( Maybe_232_Just ) ( ( op_dash_add116 ( ( op_dash_sub149 ( ( ( char_dash_u8140 ) ( ( c2339 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "a" ) , ( 1 ) ) ) ) ) ) ) , ( from_dash_integral102 ( 10 ) ) ) ) ) ); } if ( ( ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "A" ) , ( 1 ) ) ) ) != 0 ) && ( cmp652 ( ( c2339 ) , ( ( from_dash_charlike111 ) ( ( "F" ) , ( 1 ) ) ) ) != 2 ) ) ) { return ( ( Maybe_232_Just ) ( ( op_dash_add116 ( ( op_dash_sub149 ( ( ( char_dash_u8140 ) ( ( c2339 ) ) ) , ( ( char_dash_u8140 ) ( ( ( from_dash_charlike111 ) ( ( "A" ) , ( 1 ) ) ) ) ) ) ) , ( from_dash_integral102 ( 10 ) ) ) ) ) ); } return ( (struct Maybe_232) { .tag = Maybe_232_None_t } ); } static uint32_t lam632 ( struct Char_17 c2344 ) { return ( ( from_dash_integral106 ) ( ( ( u8_dash_i64633 ) ( ( ( or_dash_fail641 ) ( ( ( hex_dash_digit651 ) ( ( c2344 ) ) ) , ( ( StrConcat_642_StrConcat ) ( ( ( StrConcat_643_StrConcat ) ( ( ( from_dash_charlike111 ) ( ( "\"" ) , ( 1 ) ) ) , ( c2344 ) ) ) , ( ( from_dash_string110 ) ( ( "\" is not a hex digit." ) , ( 21 ) ) ) ) ) ) ) ) ) ) ); } static uint32_t lam654 ( uint32_t elem2346 , uint32_t b2348 ) { return ( op_dash_add394 ( ( op_dash_mul393 ( ( b2348 ) , ( from_dash_integral106 ( 16 ) ) ) ) , ( elem2346 ) ) ); } static uint32_t from_dash_hex625 ( struct StrView_25 arr2342 ) { return ( ( reduce626 ) ( ( ( map631 ) ( ( arr2342 ) , ( lam632 ) ) ) , ( from_dash_integral106 ( 0 ) ) , ( lam654 ) ) ); } static bool eq656 ( char l363 , char r365 ) { return ( ( l363 ) == ( r365 ) ); } static char from_dash_charlike657 ( uint8_t * ptr358 , size_t num_dash_bytes360 ) { if ( ( ! eq81 ( ( num_dash_bytes360 ) , ( from_dash_integral0 ( 1 ) ) ) ) ) { const char* temp658 = ( ( from_dash_string92 ) ( ( "(Cnile.AsciiChar.from-charlike) character is not valid ascii" ) , ( 60 ) ) ); printf("%s\n", temp658); exit ( 1 ); ( Unit_4_Unit ); } return ( ( (char ) ( * ( ptr358 ) ) ) ); } struct Array_659 { char _arr [32]; }; static void * cast_dash_ptr663 ( struct Array_659 * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of664 ( struct Array_659 x340 ) { return ( sizeof( ( x340 ) ) ); } static struct Array_659 zeroed661 ( ) { struct Array_659 temp662; struct Array_659 x549 = ( temp662 ); ( ( memset ) ( ( ( cast_dash_ptr663 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of664 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static char * cast_dash_ptr668 ( struct Array_659 * p349 ) { return ( (char * ) ( p349 ) ); } static char * offset_dash_ptr669 ( char * x333 , int64_t count335 ) { char temp670; return ( (char * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp670 ) ) ) ) ) ) ) ) ); } static char * get_dash_ptr667 ( struct Array_659 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 32 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 32 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } char * p2077 = ( ( ( cast_dash_ptr668 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr669 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static enum Unit_4 set666 ( struct Array_659 * arr2086 , size_t i2089 , char e2091 ) { char * p2092 = ( ( get_dash_ptr667 ) ( ( arr2086 ) , ( i2089 ) ) ); (* p2092 ) = ( e2091 ); return ( Unit_4_Unit ); } struct Slice_672 { char * f_ptr; size_t f_count; }; static char or_dash_fail675 ( struct Maybe_611 x1635 , struct StrConcat_253 errmsg1637 ) { struct Maybe_611 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_611_None_t ) { ( ( panic252 ) ( ( errmsg1637 ) ) ); return ( ( undefined609 ) ( ) ); } else { if ( dref1638.tag == Maybe_611_Just_t ) { return ( dref1638 .stuff .Maybe_611_Just_s .field0 ); } } } static struct Maybe_611 try_dash_get676 ( struct Slice_672 slice1673 , size_t i1675 ) { if ( ( ( cmp75 ( ( i1675 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i1675 ) , ( ( slice1673 ) .f_count ) ) != 0 ) ) ) { return ( (struct Maybe_611) { .tag = Maybe_611_None_t } ); } char * elem_dash_ptr1676 = ( ( offset_dash_ptr669 ) ( ( ( slice1673 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( i1675 ) ) ) ) ); return ( ( Maybe_611_Just ) ( ( * ( elem_dash_ptr1676 ) ) ) ); } static char get674 ( struct Slice_672 slice1679 , size_t i1681 ) { return ( ( or_dash_fail675 ) ( ( ( try_dash_get676 ) ( ( slice1679 ) , ( i1681 ) ) ) , ( ( StrConcat_253_StrConcat ) ( ( ( StrConcat_254_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to slice at index " ) , ( 25 ) ) ) , ( i1681 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( ( slice1679 ) .f_count ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } static char elem_dash_get673 ( struct Slice_672 self1777 , size_t idx1779 ) { return ( ( get674 ) ( ( self1777 ) , ( idx1779 ) ) ); } struct Scanner_677 { struct StrViewIter_201 f_s; }; static struct Scanner_677 mk_dash_from_dash_str679 ( struct StrView_25 s3018 ) { return ( (struct Scanner_677) { .f_s = ( ( chars217 ) ( ( s3018 ) ) ) } ); } static uint8_t * cast_dash_ptr682 ( char * p349 ) { return ( (uint8_t * ) ( p349 ) ); } static struct Slice_7 cast_dash_slice681 ( struct Slice_672 s1842 ) { return ( (struct Slice_7) { .f_ptr = ( ( cast_dash_ptr682 ) ( ( ( s1842 ) .f_ptr ) ) ) , .f_count = ( ( s1842 ) .f_count ) } ); } static struct StrView_25 from_dash_ascii_dash_slice680 ( struct Slice_672 sl2040 ) { return ( (struct StrView_25) { .f_contents = ( ( cast_dash_slice681 ) ( ( sl2040 ) ) ) } ); } struct TakeWhile_684 { struct Scanner_677 f_it; bool (* f_pred )( struct Char_17 ); }; static struct Scanner_677 into_dash_iter687 ( struct Scanner_677 self3012 ) { return ( self3012 ); } static struct Scanner_677 into_dash_iter686 ( struct Scanner_677 * self738 ) { return ( ( into_dash_iter687 ) ( ( * ( self738 ) ) ) ); } static struct TakeWhile_684 take_dash_while685 ( struct Scanner_677 * it923 , bool (* pred925 )( struct Char_17 ) ) { return ( (struct TakeWhile_684) { .f_it = ( ( into_dash_iter686 ) ( ( it923 ) ) ) , .f_pred = ( pred925 ) } ); } static struct Maybe_125 next691 ( struct Scanner_677 * self3009 ) { return ( ( next209 ) ( ( & ( ( * ( self3009 ) ) .f_s ) ) ) ); } static struct Maybe_125 next690 ( struct TakeWhile_684 * self917 ) { struct Maybe_125 mx918 = ( ( next691 ) ( ( & ( ( * ( self917 ) ) .f_it ) ) ) ); struct Maybe_125 dref919 = ( mx918 ); if ( dref919.tag == Maybe_125_None_t ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } else { if ( dref919.tag == Maybe_125_Just_t ) { if ( ( ( ( * ( self917 ) ) .f_pred ) ( ( dref919 .stuff .Maybe_125_Just_s .field0 ) ) ) ) { return ( ( Maybe_125_Just ) ( ( dref919 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } } } } static struct TakeWhile_684 into_dash_iter693 ( struct TakeWhile_684 self914 ) { return ( self914 ); } static struct Maybe_125 head689 ( struct TakeWhile_684 it1082 ) { struct TakeWhile_684 temp692 = ( ( into_dash_iter693 ) ( ( it1082 ) ) ); return ( ( next690 ) ( ( &temp692 ) ) ); } static bool null688 ( struct TakeWhile_684 it1091 ) { struct Maybe_125 dref1092 = ( ( head689 ) ( ( it1091 ) ) ); if ( dref1092.tag == Maybe_125_None_t ) { return ( true ); } else { if ( true ) { return ( false ); } } } struct env696 { ; struct Scanner_677 * it1126; }; struct envunion697 { struct Maybe_125 (*fun) ( struct env696* , int32_t ); struct env696 env; }; static enum Unit_4 for_dash_each695 ( struct Range_360 iterable1014 , struct envunion697 fun1016 ) { struct RangeIter_363 temp698 = ( ( into_dash_iter365 ) ( ( iterable1014 ) ) ); struct RangeIter_363 * it1017 = ( &temp698 ); while ( ( true ) ) { struct Maybe_137 dref1018 = ( ( next366 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_137_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_137_Just_t ) { struct envunion697 temp699 = ( fun1016 ); ( temp699.fun ( &temp699.env , ( dref1018 .stuff .Maybe_137_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct Maybe_125 lam700 ( struct env696* env , int32_t dref1129 ) { return ( ( next691 ) ( ( env->it1126 ) ) ); } static enum Unit_4 drop_prime_694 ( struct Scanner_677 * it1126 , size_t n1128 ) { struct env696 envinst696 = { .it1126 = it1126 , }; ( ( for_dash_each695 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 1 ) ) , ( ( size_dash_i3293 ) ( ( n1128 ) ) ) ) ) , ( (struct envunion697){ .fun = ( struct Maybe_125 (*) ( struct env696* , int32_t ) )lam700 , .env = envinst696 } ) ) ); return ( Unit_4_Unit ); } static size_t reduce702 ( struct TakeWhile_684 iterable1033 , size_t base1035 , size_t (* fun1037 )( struct Char_17 , size_t ) ) { size_t x1038 = ( base1035 ); struct TakeWhile_684 it1039 = ( ( into_dash_iter693 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_125 dref1040 = ( ( next690 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_125_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_125_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_125_Just_s .field0 ) , ( x1038 ) ) ); } } } size_t temp703; return ( temp703 ); } static size_t lam704 ( struct Char_17 dref1045 , size_t x1047 ) { return ( op_dash_add77 ( ( x1047 ) , ( from_dash_integral0 ( 1 ) ) ) ); } static size_t count701 ( struct TakeWhile_684 it1044 ) { return ( ( reduce702 ) ( ( it1044 ) , ( from_dash_integral0 ( 0 ) ) , ( lam704 ) ) ); } static struct TakeWhile_684 chars706 ( struct TakeWhile_684 self1566 ) { return ( self1566 ); } static struct Maybe_85 reduce707 ( struct TakeWhile_684 iterable1033 , struct Maybe_85 base1035 , struct Maybe_85 (* fun1037 )( struct Char_17 , struct Maybe_85 ) ) { struct Maybe_85 x1038 = ( base1035 ); struct TakeWhile_684 it1039 = ( ( into_dash_iter693 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_125 dref1040 = ( ( next690 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_125_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_125_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_125_Just_s .field0 ) , ( x1038 ) ) ); } } } struct Maybe_85 temp708; return ( temp708 ); } static struct Maybe_85 sequence_dash_maybe709 ( struct Char_17 e2260 , struct Maybe_85 b2262 ) { struct Maybe_85 dref2263 = ( b2262 ); if ( dref2263.tag == Maybe_85_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2263.tag == Maybe_85_Just_t ) { struct Maybe_137 dref2265 = ( ( parse_dash_digit138 ) ( ( e2260 ) ) ); if ( dref2265.tag == Maybe_137_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } else { if ( dref2265.tag == Maybe_137_Just_t ) { return ( ( Maybe_85_Just ) ( ( op_dash_add150 ( ( op_dash_mul69 ( ( dref2263 .stuff .Maybe_85_Just_s .field0 ) , ( from_dash_integral71 ( 10 ) ) ) ) , ( ( i32_dash_i64151 ) ( ( dref2265 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ) ) ); } } } } } static struct Maybe_85 parse_dash_int705 ( struct TakeWhile_684 s2257 ) { struct TakeWhile_684 cs2267 = ( ( chars706 ) ( ( s2257 ) ) ); struct Maybe_125 dref2268 = ( ( head689 ) ( ( cs2267 ) ) ); if ( dref2268.tag == Maybe_125_Just_t ) { return ( ( reduce707 ) ( ( cs2267 ) , ( ( Maybe_85_Just ) ( ( from_dash_integral71 ( 0 ) ) ) ) , ( sequence_dash_maybe709 ) ) ); } else { if ( dref2268.tag == Maybe_125_None_t ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } } } static struct Maybe_85 scan_dash_int683 ( struct Scanner_677 * sc3021 ) { struct TakeWhile_684 digit_dash_chars3022 = ( ( take_dash_while685 ) ( ( sc3021 ) , ( is_dash_digit139 ) ) ); if ( ( ( null688 ) ( ( digit_dash_chars3022 ) ) ) ) { return ( (struct Maybe_85) { .tag = Maybe_85_None_t } ); } ( ( drop_prime_694 ) ( ( sc3021 ) , ( ( count701 ) ( ( digit_dash_chars3022 ) ) ) ) ); return ( ( parse_dash_int705 ) ( ( digit_dash_chars3022 ) ) ); } struct StrConcat_712 { struct StrView_25 field0; int64_t field1; }; static struct StrConcat_712 StrConcat_712_StrConcat ( struct StrView_25 field0 , int64_t field1 ) { return ( struct StrConcat_712 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_715 { struct StrView_25 field0; struct StrConcat_712 field1; }; static struct StrConcat_715 StrConcat_715_StrConcat ( struct StrView_25 field0 , struct StrConcat_712 field1 ) { return ( struct StrConcat_715 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_714 { struct StrConcat_715 field0; struct Char_17 field1; }; static struct StrConcat_714 StrConcat_714_StrConcat ( struct StrConcat_715 field0 , struct Char_17 field1 ) { return ( struct StrConcat_714 ) { .field0 = field0 , .field1 = field1 }; }; struct IntStrIter_720 { int64_t f_int; int32_t f_len; bool f_negative; }; struct StrConcatIter_719 { struct StrViewIter_201 f_left; struct IntStrIter_720 f_right; }; struct StrConcatIter_718 { struct StrViewIter_201 f_left; struct StrConcatIter_719 f_right; }; enum EmptyIter_722 { EmptyIter_722_EmptyIter, }; struct AppendIter_721 { enum EmptyIter_722 f_it; struct Char_17 f_elem; bool f_appended; }; struct StrConcatIter_717 { struct StrConcatIter_718 f_left; struct AppendIter_721 f_right; }; static struct StrConcatIter_717 into_dash_iter724 ( struct StrConcatIter_717 self1406 ) { return ( self1406 ); } struct env731 { ; int64_t base1150; }; struct envunion732 { int64_t (*fun) ( struct env731* , int32_t , int64_t ); struct env731 env; }; static int64_t reduce730 ( struct Range_360 iterable1033 , int64_t base1035 , struct envunion732 fun1037 ) { int64_t x1038 = ( base1035 ); struct RangeIter_363 it1039 = ( ( into_dash_iter365 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_137 dref1040 = ( ( next366 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_137_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_137_Just_t ) { struct envunion732 temp733 = ( fun1037 ); x1038 = ( temp733.fun ( &temp733.env , ( dref1040 .stuff .Maybe_137_Just_s .field0 ) , ( x1038 ) ) ); } } } int64_t temp734; return ( temp734 ); } static int32_t op_dash_sub735 ( int32_t l207 , int32_t r209 ) { return ( ( l207 ) - ( r209 ) ); } static int64_t lam736 ( struct env731* env , int32_t item1154 , int64_t x1156 ) { return ( op_dash_mul69 ( ( x1156 ) , ( env->base1150 ) ) ); } static int64_t pow729 ( int64_t base1150 , int32_t p1152 ) { struct env731 envinst731 = { .base1150 = base1150 , }; return ( ( reduce730 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( p1152 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) , ( from_dash_integral71 ( 1 ) ) , ( (struct envunion732){ .fun = ( int64_t (*) ( struct env731* , int32_t , int64_t ) )lam736 , .env = envinst731 } ) ) ); } static int64_t op_dash_div737 ( int64_t l194 , int64_t r196 ) { return ( ( l194 ) / ( r196 ) ); } static uint8_t cast738 ( int64_t x346 ) { return ( (uint8_t ) ( x346 ) ); } static int64_t op_dash_sub739 ( int64_t l184 , int64_t r186 ) { return ( ( l184 ) - ( r186 ) ); } static uint8_t * cast745 ( size_t * x346 ) { return ( (uint8_t * ) ( x346 ) ); } static size_t cast_dash_on_dash_zeroed743 ( uint8_t x552 ) { size_t temp744 = ( ( zeroed558 ) ( ) ); size_t * y553 = ( &temp744 ); uint8_t * yp554 = ( ( cast745 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static size_t u8_dash_size742 ( uint8_t x633 ) { return ( ( cast_dash_on_dash_zeroed743 ) ( ( x633 ) ) ); } static uint8_t * set_dash_ms_dash_byte_dash_of_dash_pointer741 ( uint8_t * ptr651 , uint8_t b653 ) { size_t s654 = ( ( (size_t ) ( ptr651 ) ) ); size_t exp655 = ( from_dash_integral0 ( 72057594037927936 ) ); return ( (uint8_t * ) ( op_dash_add77 ( ( op_dash_sub72 ( ( s654 ) , ( ( u8_dash_size742 ) ( ( ( get_dash_ms_dash_byte_dash_of_dash_pointer99 ) ( ( ptr651 ) ) ) ) ) ) ) , ( op_dash_mul245 ( ( exp655 ) , ( ( u8_dash_size742 ) ( ( b653 ) ) ) ) ) ) ) ); } static uint8_t * cast746 ( size_t x346 ) { return ( (uint8_t * ) ( x346 ) ); } static struct Char_17 from_dash_u8740 ( uint8_t b680 ) { uint8_t * ptr681 = ( ( set_dash_ms_dash_byte_dash_of_dash_pointer741 ) ( ( ( ( cast746 ) ( ( ( u8_dash_size742 ) ( ( b680 ) ) ) ) ) ) , ( from_dash_integral102 ( 103 ) ) ) ); return ( (struct Char_17) { .f_ptr = ( ptr681 ) , .f_num_dash_bytes = ( from_dash_integral0 ( 1 ) ) } ); } static struct Maybe_125 next728 ( struct IntStrIter_720 * self1337 ) { if ( ( ( * ( self1337 ) ) .f_negative ) ) { (* self1337 ) .f_negative = ( false ); return ( ( Maybe_125_Just ) ( ( ( from_dash_charlike111 ) ( ( "-" ) , ( 1 ) ) ) ) ); } if ( ( cmp367 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } int64_t trim_dash_down1338 = ( ( pow729 ) ( ( from_dash_integral71 ( 10 ) ) , ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); int64_t upper1339 = ( op_dash_div737 ( ( ( * ( self1337 ) ) .f_int ) , ( trim_dash_down1338 ) ) ); int64_t upper_dash_mask1340 = ( op_dash_mul69 ( ( op_dash_div737 ( ( upper1339 ) , ( from_dash_integral71 ( 10 ) ) ) ) , ( from_dash_integral71 ( 10 ) ) ) ); uint8_t digit1341 = ( ( ( cast738 ) ( ( op_dash_sub739 ( ( upper1339 ) , ( upper_dash_mask1340 ) ) ) ) ) ); (* self1337 ) .f_len = ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ); struct Char_17 digit_dash_char1342 = ( ( from_dash_u8740 ) ( ( op_dash_add116 ( ( digit1341 ) , ( from_dash_integral102 ( 48 ) ) ) ) ) ); return ( ( Maybe_125_Just ) ( ( digit_dash_char1342 ) ) ); } static struct Maybe_125 next727 ( struct StrConcatIter_719 * self1409 ) { struct Maybe_125 dref1410 = ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next728 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next726 ( struct StrConcatIter_718 * self1409 ) { struct Maybe_125 dref1410 = ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next727 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next748 ( enum EmptyIter_722 * dref745 ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } static struct Maybe_125 next747 ( struct AppendIter_721 * self975 ) { struct Maybe_125 dref976 = ( ( next748 ) ( ( & ( ( * ( self975 ) ) .f_it ) ) ) ); if ( dref976.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref976 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref976.tag == Maybe_125_None_t ) { if ( ( ! ( ( * ( self975 ) ) .f_appended ) ) ) { (* self975 ) .f_appended = ( true ); return ( ( Maybe_125_Just ) ( ( ( * ( self975 ) ) .f_elem ) ) ); } return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } } } static struct Maybe_125 next725 ( struct StrConcatIter_717 * self1409 ) { struct Maybe_125 dref1410 = ( ( next726 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each716 ( struct StrConcatIter_717 iterable1014 , enum Unit_4 (* fun1016 )( struct Char_17 ) ) { struct StrConcatIter_717 temp723 = ( ( into_dash_iter724 ) ( ( iterable1014 ) ) ); struct StrConcatIter_717 * it1017 = ( &temp723 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next725 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { ( ( fun1016 ) ( ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static int64_t builtin_int64_tcmp (int64_t l, int64_t r) { return (l < r) ? 0 : (l == r) ? 1 : 2; } static enum Ordering_76 cmp757 ( int64_t l149 , int64_t r151 ) { return ( builtin_int64_tcmp( ( l149 ) , ( r151 ) ) ); } static int64_t op_dash_neg758 ( int64_t l199 ) { return ( ( from_dash_integral71 ( 0 ) ) - ( l199 ) ); } static bool eq760 ( int64_t l96 , int64_t r98 ) { return ( ( l96 ) == ( r98 ) ); } static int32_t count_dash_digits759 ( int64_t self1345 ) { if ( ( eq760 ( ( self1345 ) , ( from_dash_integral71 ( 0 ) ) ) ) ) { return ( from_dash_integral48 ( 1 ) ); } int32_t digits1346 = ( from_dash_integral48 ( 0 ) ); while ( ( cmp757 ( ( self1345 ) , ( from_dash_integral71 ( 0 ) ) ) == 2 ) ) { self1345 = ( op_dash_div737 ( ( self1345 ) , ( from_dash_integral71 ( 10 ) ) ) ); digits1346 = ( op_dash_add275 ( ( digits1346 ) , ( from_dash_integral48 ( 1 ) ) ) ); } return ( digits1346 ); } static struct IntStrIter_720 int_dash_iter756 ( int64_t int1349 ) { if ( ( cmp757 ( ( int1349 ) , ( from_dash_integral71 ( 0 ) ) ) == 0 ) ) { return ( (struct IntStrIter_720) { .f_int = ( op_dash_neg758 ( ( int1349 ) ) ) , .f_len = ( ( count_dash_digits759 ) ( ( op_dash_neg758 ( ( int1349 ) ) ) ) ) , .f_negative = ( true ) } ); } else { return ( (struct IntStrIter_720) { .f_int = ( int1349 ) , .f_len = ( ( count_dash_digits759 ) ( ( int1349 ) ) ) , .f_negative = ( false ) } ); } } static struct IntStrIter_720 chars755 ( int64_t self1376 ) { return ( ( int_dash_iter756 ) ( ( self1376 ) ) ); } static struct StrConcatIter_719 into_dash_iter754 ( struct StrConcat_712 dref1413 ) { return ( (struct StrConcatIter_719) { .f_left = ( ( chars217 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars755 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_719 chars753 ( struct StrConcat_712 self1424 ) { return ( ( into_dash_iter754 ) ( ( self1424 ) ) ); } static struct StrConcatIter_718 into_dash_iter752 ( struct StrConcat_715 dref1413 ) { return ( (struct StrConcatIter_718) { .f_left = ( ( chars217 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars753 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_718 chars751 ( struct StrConcat_715 self1424 ) { return ( ( into_dash_iter752 ) ( ( self1424 ) ) ); } static enum EmptyIter_722 into_dash_iter765 ( enum EmptyIter_722 self743 ) { return ( self743 ); } static struct AppendIter_721 append764 ( enum EmptyIter_722 it959 , struct Char_17 e961 ) { return ( (struct AppendIter_721) { .f_it = ( ( into_dash_iter765 ) ( ( it959 ) ) ) , .f_elem = ( e961 ) , .f_appended = ( false ) } ); } static struct AppendIter_721 cons763 ( enum EmptyIter_722 it964 , struct Char_17 e966 ) { return ( ( append764 ) ( ( it964 ) , ( e966 ) ) ); } static enum EmptyIter_722 nil766 ( ) { return ( EmptyIter_722_EmptyIter ); } static struct AppendIter_721 single762 ( struct Char_17 e969 ) { return ( ( cons763 ) ( ( ( nil766 ) ( ) ) , ( e969 ) ) ); } static struct AppendIter_721 chars761 ( struct Char_17 self1322 ) { return ( ( single762 ) ( ( self1322 ) ) ); } static struct StrConcatIter_717 into_dash_iter750 ( struct StrConcat_714 dref1413 ) { return ( (struct StrConcatIter_717) { .f_left = ( ( chars751 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_717 chars749 ( struct StrConcat_714 self1424 ) { return ( ( into_dash_iter750 ) ( ( self1424 ) ) ); } static enum Unit_4 print713 ( struct StrConcat_714 s1611 ) { ( ( for_dash_each716 ) ( ( ( chars749 ) ( ( s1611 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static enum MouseButton_598 undefined767 ( ) { enum MouseButton_598 temp768; return ( temp768 ); } static enum MouseButton_598 panic_prime_711 ( struct StrConcat_712 errmsg1625 ) { ( ( print713 ) ( ( ( StrConcat_714_StrConcat ) ( ( ( StrConcat_715_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1625 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( ( undefined767 ) ( ) ); } static enum MouseButton_598 btn_dash_to_dash_mouse_dash_button710 ( int64_t btn3172 ) { return ( { int32_t dref3173 = ( ( i64_dash_i32152 ) ( ( btn3172 ) ) ) ; dref3173 == 0 ? ( MouseButton_598_MouseLeft ) : dref3173 == 1 ? ( MouseButton_598_MouseMiddle ) : dref3173 == 2 ? ( MouseButton_598_MouseRight ) : dref3173 == 64 ? ( MouseButton_598_ScrollUp ) : dref3173 == 65 ? ( MouseButton_598_ScrollDown ) : ( ( panic_prime_711 ) ( ( ( StrConcat_712_StrConcat ) ( ( ( from_dash_string110 ) ( ( "incorrect mouse button code: " ) , ( 29 ) ) ) , ( btn3172 ) ) ) ) ) ; } ); } static struct Scanner_677 mk770 ( struct StrView_25 s3015 ) { return ( (struct Scanner_677) { .f_s = ( ( into_dash_iter218 ) ( ( s3015 ) ) ) } ); } static struct Maybe_594 parse_dash_csi671 ( struct Slice_672 seq3179 ) { if ( ( eq81 ( ( ( seq3179 ) .f_count ) , ( from_dash_integral0 ( 0 ) ) ) ) ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } char last3180 = ( elem_dash_get673 ( ( seq3179 ) , ( op_dash_sub72 ( ( ( seq3179 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ); if ( ( ( eq656 ( ( elem_dash_get673 ( ( seq3179 ) , ( from_dash_integral0 ( 0 ) ) ) ) , ( ( from_dash_charlike657 ) ( ( "<" ) , ( 1 ) ) ) ) ) && ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "M" ) , ( 1 ) ) ) ) ) || ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "m" ) , ( 1 ) ) ) ) ) ) ) ) { struct Scanner_677 temp678 = ( ( mk_dash_from_dash_str679 ) ( ( ( substr321 ) ( ( ( from_dash_ascii_dash_slice680 ) ( ( seq3179 ) ) ) , ( from_dash_integral0 ( 1 ) ) , ( ( seq3179 ) .f_count ) ) ) ) ); struct Scanner_677 * sc3181 = ( &temp678 ); struct Maybe_85 dref3182 = ( ( scan_dash_int683 ) ( ( sc3181 ) ) ); if ( dref3182.tag == Maybe_85_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3182.tag == Maybe_85_Just_t ) { ( ( next691 ) ( ( sc3181 ) ) ); struct Maybe_85 dref3184 = ( ( scan_dash_int683 ) ( ( sc3181 ) ) ); if ( dref3184.tag == Maybe_85_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3184.tag == Maybe_85_Just_t ) { ( ( next691 ) ( ( sc3181 ) ) ); struct Maybe_85 dref3186 = ( ( scan_dash_int683 ) ( ( sc3181 ) ) ); if ( dref3186.tag == Maybe_85_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3186.tag == Maybe_85_Just_t ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Mouse ) ( ( (struct MouseEvent_597) { .f_button = ( ( btn_dash_to_dash_mouse_dash_button710 ) ( ( dref3182 .stuff .Maybe_85_Just_s .field0 ) ) ) , .f_x = ( op_dash_sub735 ( ( ( i64_dash_i32152 ) ( ( dref3184 .stuff .Maybe_85_Just_s .field0 ) ) ) , ( from_dash_integral48 ( 1 ) ) ) ) , .f_y = ( op_dash_sub735 ( ( ( i64_dash_i32152 ) ( ( dref3186 .stuff .Maybe_85_Just_s .field0 ) ) ) , ( from_dash_integral48 ( 1 ) ) ) ) , .f_pressed = ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "M" ) , ( 1 ) ) ) ) ) } ) ) ) ) ); } } } } } } } if ( ( eq81 ( ( ( seq3179 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) { if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "A" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Up_t } ) ) ) ) ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "B" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Down_t } ) ) ) ) ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "C" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Right_t } ) ) ) ) ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "D" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Left_t } ) ) ) ) ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "H" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Home_t } ) ) ) ) ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "F" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_End_t } ) ) ) ) ); } return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } if ( ( eq656 ( ( last3180 ) , ( ( from_dash_charlike657 ) ( ( "~" ) , ( 1 ) ) ) ) ) ) { struct Scanner_677 temp769 = ( ( mk770 ) ( ( ( from_dash_ascii_dash_slice680 ) ( ( seq3179 ) ) ) ) ); struct Scanner_677 * sc3188 = ( &temp769 ); struct Maybe_85 dref3189 = ( ( scan_dash_int683 ) ( ( sc3188 ) ) ); if ( dref3189.tag == Maybe_85_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3189.tag == Maybe_85_Just_t ) { return ( { int32_t dref3191 = ( ( i64_dash_i32152 ) ( ( dref3189 .stuff .Maybe_85_Just_s .field0 ) ) ) ; dref3191 == 1 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Home_t } ) ) ) ) ) : dref3191 == 2 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Insert_t } ) ) ) ) ) : dref3191 == 3 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Delete_t } ) ) ) ) ) : dref3191 == 4 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_End_t } ) ) ) ) ) : dref3191 == 5 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_PageUp_t } ) ) ) ) ) : dref3191 == 6 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_PageDown_t } ) ) ) ) ) : dref3191 == 15 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F5_t } ) ) ) ) ) : dref3191 == 17 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F6_t } ) ) ) ) ) : dref3191 == 18 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F7_t } ) ) ) ) ) : dref3191 == 19 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F8_t } ) ) ) ) ) : dref3191 == 20 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F9_t } ) ) ) ) ) : dref3191 == 21 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F10_t } ) ) ) ) ) : dref3191 == 23 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F11_t } ) ) ) ) ) : dref3191 == 24 ? ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_F12_t } ) ) ) ) ) : ( (struct Maybe_594) { .tag = Maybe_594_None_t } ) ; } ); } } } return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } static struct Slice_672 subslice771 ( struct Slice_672 slice1692 , size_t from1694 , size_t to1696 ) { char * begin_dash_ptr1697 = ( ( offset_dash_ptr669 ) ( ( ( slice1692 ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( from1694 ) ) ) ) ); if ( ( ( cmp75 ( ( from1694 ) , ( to1696 ) ) != 0 ) || ( cmp75 ( ( from1694 ) , ( ( slice1692 ) .f_count ) ) != 0 ) ) ) { return ( (struct Slice_672) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( from_dash_integral0 ( 0 ) ) } ); } size_t count1698 = ( op_dash_sub72 ( ( ( min80 ) ( ( to1696 ) , ( ( slice1692 ) .f_count ) ) ) , ( from1694 ) ) ); return ( (struct Slice_672) { .f_ptr = ( begin_dash_ptr1697 ) , .f_count = ( count1698 ) } ); } static char * cast773 ( struct Array_659 * x346 ) { return ( (char * ) ( x346 ) ); } static struct Slice_672 as_dash_slice772 ( struct Array_659 * arr2095 ) { return ( (struct Slice_672) { .f_ptr = ( ( cast773 ) ( ( arr2095 ) ) ) , .f_count = ( (size_t ) ( 32 ) ) } ); } struct Maybe_775 { enum { Maybe_775_None_t, Maybe_775_Just_t, } tag; union { struct { struct Key_596 field0; } Maybe_775_Just_s; } stuff; }; static struct Maybe_775 Maybe_775_Just ( struct Key_596 field0 ) { return ( struct Maybe_775 ) { .tag = Maybe_775_Just_t, .stuff = { .Maybe_775_Just_s = { .field0 = field0 } } }; }; static struct Maybe_775 parse_dash_ss3776 ( char c3176 ) { if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "A" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_Up_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "B" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_Down_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "C" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_Right_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "D" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_Left_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "H" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_Home_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "F" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_End_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "P" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_F1_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "Q" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_F2_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "R" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_F3_t } ) ) ); } if ( ( eq656 ( ( c3176 ) , ( ( from_dash_charlike657 ) ( ( "S" ) , ( 1 ) ) ) ) ) ) { return ( ( Maybe_775_Just ) ( ( (struct Key_596) { .tag = Key_596_F4_t } ) ) ); } return ( (struct Maybe_775) { .tag = Maybe_775_None_t } ); } static struct Maybe_594 read_dash_key607 ( ) { char temp608 = ( ( undefined609 ) ( ) ); char * ch3193 = ( &temp608 ); struct Maybe_611 dref3194 = ( ( read_dash_byte612 ) ( ( from_dash_integral48 ( 0 ) ) ) ); if ( dref3194.tag == Maybe_611_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3194.tag == Maybe_611_Just_t ) { (* ch3193 ) = ( dref3194 .stuff .Maybe_611_Just_s .field0 ); } } if ( ( eq98 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 13 ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Enter_t } ) ) ) ) ); } if ( ( eq98 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 127 ) ) ) ) ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Backspace_t } ) ) ) ) ); } if ( ( ( cmp115 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 27 ) ) ) == 0 ) && ( ! eq98 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 9 ) ) ) ) ) ) { char letter3196 = ( ( u8_dash_ascii620 ) ( ( ( u32_dash_u8108 ) ( ( ( u32_dash_or453 ) ( ( ( u8_dash_u32621 ) ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) ) ) , ( ( from_dash_hex625 ) ( ( ( from_dash_string110 ) ( ( "60" ) , ( 2 ) ) ) ) ) ) ) ) ) ) ); return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( ( Key_596_Ctrl ) ( ( letter3196 ) ) ) ) ) ) ); } if ( ( ! eq98 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 27 ) ) ) ) ) { if ( ( cmp115 ( ( ( ascii_dash_u8619 ) ( ( * ( ch3193 ) ) ) ) , ( from_dash_integral102 ( 127 ) ) ) == 2 ) ) { return ( ( read_dash_key607 ) ( ) ); } else { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( ( Key_596_Char ) ( ( * ( ch3193 ) ) ) ) ) ) ) ); } } char temp655 = ( ( undefined609 ) ( ) ); char * ch23197 = ( &temp655 ); struct Maybe_611 dref3198 = ( ( read_dash_byte612 ) ( ( from_dash_integral48 ( 50 ) ) ) ); if ( dref3198.tag == Maybe_611_None_t ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Escape_t } ) ) ) ) ); } else { if ( dref3198.tag == Maybe_611_Just_t ) { (* ch23197 ) = ( dref3198 .stuff .Maybe_611_Just_s .field0 ); } } if ( ( eq656 ( ( * ( ch23197 ) ) , ( ( from_dash_charlike657 ) ( ( "[" ) , ( 1 ) ) ) ) ) ) { struct Array_659 temp660 = ( ( ( zeroed661 ) ( ) ) ); struct Array_659 * seq3200 = ( &temp660 ); int32_t slen3201 = ( from_dash_integral48 ( 0 ) ); while ( ( cmp367 ( ( slen3201 ) , ( from_dash_integral48 ( 31 ) ) ) == 0 ) ) { char temp665 = ( ( undefined609 ) ( ) ); char * sc3202 = ( &temp665 ); struct Maybe_611 dref3203 = ( ( read_dash_byte612 ) ( ( from_dash_integral48 ( 50 ) ) ) ); if ( dref3203.tag == Maybe_611_None_t ) { break; } else { if ( dref3203.tag == Maybe_611_Just_t ) { (* sc3202 ) = ( dref3203 .stuff .Maybe_611_Just_s .field0 ); } } ( ( set666 ) ( ( seq3200 ) , ( ( i32_dash_size266 ) ( ( slen3201 ) ) ) , ( * ( sc3202 ) ) ) ); slen3201 = ( op_dash_add275 ( ( slen3201 ) , ( from_dash_integral48 ( 1 ) ) ) ); if ( ( ( cmp115 ( ( ( ascii_dash_u8619 ) ( ( * ( sc3202 ) ) ) ) , ( from_dash_integral102 ( 64 ) ) ) != 0 ) && ( cmp115 ( ( ( ascii_dash_u8619 ) ( ( * ( sc3202 ) ) ) ) , ( from_dash_integral102 ( 126 ) ) ) != 2 ) ) ) { break; } } return ( ( parse_dash_csi671 ) ( ( ( subslice771 ) ( ( ( as_dash_slice772 ) ( ( seq3200 ) ) ) , ( from_dash_integral0 ( 0 ) ) , ( ( i32_dash_size266 ) ( ( slen3201 ) ) ) ) ) ) ); } if ( ( eq656 ( ( * ( ch23197 ) ) , ( ( from_dash_charlike657 ) ( ( "O" ) , ( 1 ) ) ) ) ) ) { char temp774 = ( ( undefined609 ) ( ) ); char * sc3205 = ( &temp774 ); struct Maybe_611 dref3206 = ( ( read_dash_byte612 ) ( ( from_dash_integral48 ( 50 ) ) ) ); if ( dref3206.tag == Maybe_611_None_t ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Escape_t } ) ) ) ) ); } else { if ( dref3206.tag == Maybe_611_Just_t ) { (* sc3205 ) = ( dref3206 .stuff .Maybe_611_Just_s .field0 ); } } struct Maybe_775 dref3208 = ( ( parse_dash_ss3776 ) ( ( * ( sc3205 ) ) ) ); if ( dref3208.tag == Maybe_775_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3208.tag == Maybe_775_Just_t ) { return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( dref3208 .stuff .Maybe_775_Just_s .field0 ) ) ) ) ); } } } return ( ( Maybe_594_Just ) ( ( ( InputEvent_595_Key ) ( ( (struct Key_596) { .tag = Key_596_Escape_t } ) ) ) ) ); } static struct Maybe_594 read_dash_event604 ( struct env53* env , struct Tui_55 * tui3218 ) { struct envunion54 temp605 = ( (struct envunion54){ .fun = ( bool (*) ( struct env52* , struct Tui_55 * ) )update_dash_dimensions606 , .env = env->envinst52 } ); ( temp605.fun ( &temp605.env , ( tui3218 ) ) ); struct Maybe_594 dref3219 = ( ( read_dash_key607 ) ( ) ); if ( dref3219.tag == Maybe_594_None_t ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } else { if ( dref3219.tag == Maybe_594_Just_t ) { (* tui3218 ) .f_should_dash_redraw = ( true ); return ( ( Maybe_594_Just ) ( ( dref3219 .stuff .Maybe_594_Just_s .field0 ) ) ); } } } static struct Maybe_594 lam602 ( struct env592* env ) { struct envunion593 temp603 = ( (struct envunion593){ .fun = ( struct Maybe_594 (*) ( struct env53* , struct Tui_55 * ) )read_dash_event604 , .env = env->envinst53 } ); return ( temp603.fun ( &temp603.env , ( env->tui3500 ) ) ); } static struct Maybe_594 next778 ( struct FunIter_591 * self984 ) { if ( ( ( * ( self984 ) ) .f_finished ) ) { return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } struct envunion599 temp779 = ( ( * ( self984 ) ) .f_fun ); struct Maybe_594 dref985 = ( temp779.fun ( &temp779.env ) ); if ( dref985.tag == Maybe_594_Just_t ) { return ( ( Maybe_594_Just ) ( ( dref985 .stuff .Maybe_594_Just_s .field0 ) ) ); } else { if ( dref985.tag == Maybe_594_None_t ) { (* self984 ) .f_finished = ( true ); return ( (struct Maybe_594) { .tag = Maybe_594_None_t } ); } } } struct Tuple2_781 { enum GameState_329 field0; enum GameState_329 field1; }; static struct Tuple2_781 Tuple2_781_Tuple2 ( enum GameState_329 field0 , enum GameState_329 field1 ) { return ( struct Tuple2_781 ) { .field0 = field0 , .field1 = field1 }; }; static bool eq780 ( enum GameState_329 l2924 , enum GameState_329 r2926 ) { return ( { struct Tuple2_781 dref2927 = ( ( Tuple2_781_Tuple2 ) ( ( l2924 ) , ( r2926 ) ) ) ; dref2927 .field0 == GameState_329_InProgress && dref2927 .field1 == GameState_329_InProgress ? ( true ) : dref2927 .field0 == GameState_329_Failed && dref2927 .field1 == GameState_329_Failed ? ( true ) : dref2927 .field0 == GameState_329_Won && dref2927 .field1 == GameState_329_Won ? ( true ) : ( false ) ; } ); } struct Tuple2_783 { enum ControlScheme_416 field0; enum ControlScheme_416 field1; }; static struct Tuple2_783 Tuple2_783_Tuple2 ( enum ControlScheme_416 field0 , enum ControlScheme_416 field1 ) { return ( struct Tuple2_783 ) { .field0 = field0 , .field1 = field1 }; }; static bool eq782 ( enum ControlScheme_416 l2991 , enum ControlScheme_416 r2993 ) { return ( { struct Tuple2_783 dref2994 = ( ( Tuple2_783_Tuple2 ) ( ( l2991 ) , ( r2993 ) ) ) ; dref2994 .field0 == ControlScheme_416_KeyControls && dref2994 .field1 == ControlScheme_416_KeyControls ? ( true ) : dref2994 .field0 == ControlScheme_416_MouseControls && dref2994 .field1 == ControlScheme_416_MouseControls ? ( true ) : ( false ) ; } ); } static int32_t clamp784 ( int32_t x1273 , int32_t mn1275 , int32_t mx1277 ) { if ( ( cmp367 ( ( x1273 ) , ( mn1275 ) ) == 0 ) ) { return ( mn1275 ); } else { if ( ( cmp367 ( ( x1273 ) , ( mx1277 ) ) == 2 ) ) { return ( mx1277 ); } else { return ( x1273 ); } } } static enum Unit_4 map_dash_tile786 ( struct TileMap_330 tilemap2942 , int32_t x2944 , int32_t y2946 , struct Tile_333 (* fun2948 )( struct Tile_333 ) ) { struct Tile_333 * tp2949 = ( ( get_dash_ptr372 ) ( ( elem_dash_get409 ( ( ( tilemap2942 ) .f_tiles ) , ( ( i32_dash_size266 ) ( ( y2946 ) ) ) ) ) , ( ( i32_dash_size266 ) ( ( x2944 ) ) ) ) ); (* tp2949 ) = ( ( fun2948 ) ( ( * ( tp2949 ) ) ) ); return ( Unit_4_Unit ); } static struct Tile_333 lam787 ( struct Tile_333 tile3426 ) { struct Tile_333 temp788 = ( tile3426 ); temp788 . f_hidden = ( false ); return ( temp788 ); } static int32_t count_dash_neighbor_dash_bombs789 ( struct TileMap_330 tilemap2978 , int32_t x2980 , int32_t y2982 ) { int32_t neighbors2983 = ( from_dash_integral48 ( 0 ) ); struct RangeIter_363 temp790 = into_dash_iter365 ( ( ( to369 ) ( ( op_dash_sub735 ( ( y2982 ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( op_dash_add275 ( ( y2982 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond791 = next366 (&temp790); if ( __cond791 .tag == 0 ) { break; } int32_t yy2985 = __cond791 .stuff .Maybe_137_Just_s .field0; struct RangeIter_363 temp792 = into_dash_iter365 ( ( ( to369 ) ( ( op_dash_sub735 ( ( x2980 ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( op_dash_add275 ( ( x2980 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond793 = next366 (&temp792); if ( __cond793 .tag == 0 ) { break; } int32_t xx2987 = __cond793 .stuff .Maybe_137_Just_s .field0; if ( ( ( elem_dash_get396 ( ( tilemap2978 ) , ( ( Tuple2_397_Tuple2 ) ( ( xx2987 ) , ( yy2985 ) ) ) ) ) .f_is_dash_bomb ) ) { neighbors2983 = ( op_dash_add275 ( ( neighbors2983 ) , ( from_dash_integral48 ( 1 ) ) ) ); } } } return ( neighbors2983 ); } static bool uncover_dash_tile785 ( struct TileMap_330 tilemap3419 , int32_t x3421 , int32_t y3423 ) { if ( ( ( ( ( cmp367 ( ( x3421 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( x3421 ) , ( ( tilemap3419 ) .f_width ) ) != 0 ) ) || ( cmp367 ( ( y3423 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) || ( cmp367 ( ( y3423 ) , ( ( tilemap3419 ) .f_height ) ) != 0 ) ) ) { return ( false ); } struct Tile_333 tile3424 = ( elem_dash_get396 ( ( tilemap3419 ) , ( ( Tuple2_397_Tuple2 ) ( ( x3421 ) , ( y3423 ) ) ) ) ); if ( ( ! ( ( tile3424 ) .f_hidden ) ) ) { return ( false ); } ( ( map_dash_tile786 ) ( ( tilemap3419 ) , ( x3421 ) , ( y3423 ) , ( lam787 ) ) ); if ( ( ( tile3424 ) .f_is_dash_bomb ) ) { return ( true ); } else { int32_t nb3427 = ( ( count_dash_neighbor_dash_bombs789 ) ( ( tilemap3419 ) , ( x3421 ) , ( y3423 ) ) ); if ( ( eq504 ( ( nb3427 ) , ( from_dash_integral48 ( 0 ) ) ) ) ) { struct RangeIter_363 temp794 = into_dash_iter365 ( ( ( to369 ) ( ( op_dash_sub735 ( ( y3423 ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( op_dash_add275 ( ( y3423 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond795 = next366 (&temp794); if ( __cond795 .tag == 0 ) { break; } int32_t yy3429 = __cond795 .stuff .Maybe_137_Just_s .field0; struct RangeIter_363 temp796 = into_dash_iter365 ( ( ( to369 ) ( ( op_dash_sub735 ( ( x3421 ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( op_dash_add275 ( ( x3421 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond797 = next366 (&temp796); if ( __cond797 .tag == 0 ) { break; } int32_t xx3431 = __cond797 .stuff .Maybe_137_Just_s .field0; ( ( uncover_dash_tile785 ) ( ( tilemap3419 ) , ( xx3431 ) , ( yy3429 ) ) ); } } } return ( false ); } } struct SliceIter_801 { struct Slice_331 f_slice; size_t f_current_dash_offset; }; struct SliceIter_802 { struct Slice_332 f_slice; size_t f_current_dash_offset; }; struct FlattenIter_800 { struct SliceIter_801 f_super; struct SliceIter_802 f_inner; bool f_empty; }; struct env804 { bool (* fun1066 )( struct Tile_333 ); }; struct envunion805 { bool (*fun) ( struct env804* , struct Tile_333 , bool ); struct env804 env; }; static struct FlattenIter_800 into_dash_iter806 ( struct FlattenIter_800 self883 ) { return ( self883 ); } static struct Maybe_379 next808 ( struct SliceIter_802 * self1738 ) { size_t off1739 = ( ( * ( self1738 ) ) .f_current_dash_offset ); if ( ( cmp75 ( ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ) , ( ( ( * ( self1738 ) ) .f_slice ) .f_count ) ) == 2 ) ) { return ( (struct Maybe_379) { .tag = Maybe_379_None_t } ); } struct Tile_333 elem1740 = ( * ( ( offset_dash_ptr373 ) ( ( ( ( * ( self1738 ) ) .f_slice ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( off1739 ) ) ) ) ) ); (* self1738 ) .f_current_dash_offset = ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_379_Just ) ( ( elem1740 ) ) ); } static struct Maybe_402 next809 ( struct SliceIter_801 * self1738 ) { size_t off1739 = ( ( * ( self1738 ) ) .f_current_dash_offset ); if ( ( cmp75 ( ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ) , ( ( ( * ( self1738 ) ) .f_slice ) .f_count ) ) == 2 ) ) { return ( (struct Maybe_402) { .tag = Maybe_402_None_t } ); } struct Slice_332 elem1740 = ( * ( ( offset_dash_ptr348 ) ( ( ( ( * ( self1738 ) ) .f_slice ) .f_ptr ) , ( ( size_dash_i6479 ) ( ( off1739 ) ) ) ) ) ); (* self1738 ) .f_current_dash_offset = ( op_dash_add77 ( ( off1739 ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_402_Just ) ( ( elem1740 ) ) ); } static struct SliceIter_802 into_dash_iter810 ( struct Slice_332 self1732 ) { return ( (struct SliceIter_802) { .f_slice = ( self1732 ) , .f_current_dash_offset = ( from_dash_integral0 ( 0 ) ) } ); } static struct Maybe_379 next807 ( struct FlattenIter_800 * self886 ) { if ( ( ( * ( self886 ) ) .f_empty ) ) { return ( (struct Maybe_379) { .tag = Maybe_379_None_t } ); } while ( ( true ) ) { struct Maybe_379 dref887 = ( ( next808 ) ( ( & ( ( * ( self886 ) ) .f_inner ) ) ) ); if ( dref887.tag == Maybe_379_Just_t ) { return ( ( Maybe_379_Just ) ( ( dref887 .stuff .Maybe_379_Just_s .field0 ) ) ); } else { if ( dref887.tag == Maybe_379_None_t ) { struct Maybe_402 dref889 = ( ( next809 ) ( ( & ( ( * ( self886 ) ) .f_super ) ) ) ); if ( dref889.tag == Maybe_402_Just_t ) { (* self886 ) .f_inner = ( ( into_dash_iter810 ) ( ( dref889 .stuff .Maybe_402_Just_s .field0 ) ) ); } else { if ( dref889.tag == Maybe_402_None_t ) { return ( (struct Maybe_379) { .tag = Maybe_379_None_t } ); } } } } } } static bool reduce803 ( struct FlattenIter_800 iterable1033 , bool base1035 , struct envunion805 fun1037 ) { bool x1038 = ( base1035 ); struct FlattenIter_800 it1039 = ( ( into_dash_iter806 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_379 dref1040 = ( ( next807 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_379_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_379_Just_t ) { struct envunion805 temp811 = ( fun1037 ); x1038 = ( temp811.fun ( &temp811.env , ( dref1040 .stuff .Maybe_379_Just_s .field0 ) , ( x1038 ) ) ); } } } bool temp812; return ( temp812 ); } static bool lam813 ( struct env804* env , struct Tile_333 e1068 , bool x1070 ) { return ( ( ( env->fun1066 ) ( ( e1068 ) ) ) && ( x1070 ) ); } static bool all799 ( struct FlattenIter_800 it1064 , bool (* fun1066 )( struct Tile_333 ) ) { struct env804 envinst804 = { .fun1066 = fun1066 , }; return ( ( reduce803 ) ( ( it1064 ) , ( true ) , ( (struct envunion805){ .fun = ( bool (*) ( struct env804* , struct Tile_333 , bool ) )lam813 , .env = envinst804 } ) ) ); } static struct SliceIter_801 into_dash_iter815 ( struct Slice_331 self1732 ) { return ( (struct SliceIter_801) { .f_slice = ( self1732 ) , .f_current_dash_offset = ( from_dash_integral0 ( 0 ) ) } ); } static struct FlattenIter_800 flatten814 ( struct Slice_331 it893 ) { struct SliceIter_801 it894 = ( ( into_dash_iter815 ) ( ( it893 ) ) ); struct Maybe_402 dref895 = ( ( next809 ) ( ( & ( it894 ) ) ) ); if ( dref895.tag == Maybe_402_Just_t ) { return ( (struct FlattenIter_800) { .f_super = ( it894 ) , .f_inner = ( ( into_dash_iter810 ) ( ( dref895 .stuff .Maybe_402_Just_s .field0 ) ) ) , .f_empty = ( false ) } ); } else { if ( dref895.tag == Maybe_402_None_t ) { struct SliceIter_802 temp816; return ( (struct FlattenIter_800) { .f_super = ( it894 ) , .f_inner = ( temp816 ) , .f_empty = ( true ) } ); } } } static bool lam817 ( struct Tile_333 tile3416 ) { return ( ( ( ( tile3416 ) .f_is_dash_bomb ) && ( ( tile3416 ) .f_hidden ) ) || ( ( ! ( ( tile3416 ) .f_is_dash_bomb ) ) && ( ! ( ( tile3416 ) .f_hidden ) ) ) ); } static bool is_dash_game_dash_won798 ( struct TileMap_330 tilemap3414 ) { return ( ( all799 ) ( ( ( flatten814 ) ( ( ( tilemap3414 ) .f_tiles ) ) ) , ( lam817 ) ) ); } struct envunion819 { enum Unit_4 (*fun) ( struct env63* , struct Stats_155 , enum CAllocator_6 ); struct env63 env; }; struct env825 { ; struct StrBuilder_14 * sb2690; struct env38 envinst38; ; ; ; enum CAllocator_6 al2689; ; struct env12 envinst12; }; struct envunion826 { enum Unit_4 (*fun) ( struct env825* , struct Char_17 ); struct env825 env; }; static enum Unit_4 for_dash_each824 ( struct StrConcatIter_198 iterable1014 , struct envunion826 fun1016 ) { struct StrConcatIter_198 temp827 = ( ( into_dash_iter205 ) ( ( iterable1014 ) ) ); struct StrConcatIter_198 * it1017 = ( &temp827 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next206 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { struct envunion826 temp828 = ( fun1016 ); ( temp828.fun ( &temp828.env , ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } struct Tuple2_831 { struct CharDestructured_96 field0; struct CharDestructured_96 field1; }; static struct Tuple2_831 Tuple2_831_Tuple2 ( struct CharDestructured_96 field0 , struct CharDestructured_96 field1 ) { return ( struct Tuple2_831 ) { .field0 = field0 , .field1 = field1 }; }; static bool eq832 ( uint32_t l106 , uint32_t r108 ) { return ( ( l106 ) == ( r108 ) ); } static bool eq830 ( struct Char_17 l697 , struct Char_17 r699 ) { if ( ( ! eq81 ( ( ( l697 ) .f_num_dash_bytes ) , ( ( r699 ) .f_num_dash_bytes ) ) ) ) { return ( false ); } struct Tuple2_831 dref700 = ( ( Tuple2_831_Tuple2 ) ( ( ( destructure97 ) ( ( l697 ) ) ) , ( ( destructure97 ) ( ( r699 ) ) ) ) ); if ( dref700 .field0.tag == CharDestructured_96_Ref_t && dref700 .field1.tag == CharDestructured_96_Ref_t ) { size_t i703 = ( from_dash_integral0 ( 0 ) ); while ( ( cmp75 ( ( i703 ) , ( ( dref700 .field0 .stuff .CharDestructured_96_Ref_s .field0 ) .f_num_dash_bytes ) ) == 0 ) ) { if ( ( ! eq98 ( ( * ( (uint8_t * ) ( ( (void*) ( ( dref700 .field0 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) + ( (int64_t ) ( i703 ) ) ) ) ) , ( * ( (uint8_t * ) ( ( (void*) ( ( dref700 .field1 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) + ( (int64_t ) ( i703 ) ) ) ) ) ) ) ) { return ( false ); } i703 = ( op_dash_add77 ( ( i703 ) , ( from_dash_integral0 ( 1 ) ) ) ); } return ( true ); } else { if ( dref700 .field0.tag == CharDestructured_96_Scalar_t && dref700 .field1.tag == CharDestructured_96_Scalar_t ) { return ( eq832 ( ( dref700 .field0 .stuff .CharDestructured_96_Scalar_s .field0 ) , ( dref700 .field1 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ); } else { if ( dref700 .field0.tag == CharDestructured_96_Scalar_t && dref700 .field1.tag == CharDestructured_96_Ref_t ) { return ( eq98 ( ( ( u32_dash_u8108 ) ( ( dref700 .field0 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ) , ( * ( ( dref700 .field1 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) ) ); } else { if ( dref700 .field0.tag == CharDestructured_96_Ref_t && dref700 .field1.tag == CharDestructured_96_Scalar_t ) { return ( eq98 ( ( ( u32_dash_u8108 ) ( ( dref700 .field1 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ) , ( * ( ( dref700 .field0 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) ) ); } } } } } static size_t count833 ( struct StrBuilder_14 * sb2555 ) { return ( ( ( * ( sb2555 ) ) .f_chars ) .f_count ); } struct env844 { struct StrBuilder_14 * builder2540; struct env12 envinst12; }; struct envunion845 { enum Unit_4 (*fun) ( struct env844* , struct Char_17 ); struct env844 env; }; static enum Unit_4 for_dash_each843 ( struct StrViewIter_201 iterable1014 , struct envunion845 fun1016 ) { struct StrViewIter_201 temp846 = ( ( into_dash_iter325 ) ( ( iterable1014 ) ) ); struct StrViewIter_201 * it1017 = ( &temp846 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next209 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { struct envunion845 temp847 = ( fun1016 ); ( temp847.fun ( &temp847.env , ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrViewIter_201 chars848 ( struct StrBuilder_14 s2578 ) { return ( ( into_dash_iter218 ) ( ( ( as_dash_str288 ) ( ( & ( s2578 ) ) ) ) ) ); } static enum Unit_4 lam849 ( struct env844* env , struct Char_17 c2544 ) { struct envunion16 temp850 = ( (struct envunion16){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); return ( temp850.fun ( &temp850.env , ( env->builder2540 ) , ( c2544 ) ) ); } static enum Unit_4 write842 ( struct env19* env , struct StrBuilder_14 * builder2540 , struct StrBuilder_14 s2542 ) { struct env844 envinst844 = { .builder2540 = builder2540 , .envinst12 = env->envinst12 , }; ( ( for_dash_each843 ) ( ( ( chars848 ) ( ( s2542 ) ) ) , ( (struct envunion845){ .fun = ( enum Unit_4 (*) ( struct env844* , struct Char_17 ) )lam849 , .env = envinst844 } ) ) ); return ( Unit_4_Unit ); } static struct StrView_25 mk_dash_dyn_dash_str839 ( struct env30* env , struct StrBuilder_14 s2584 , enum CAllocator_6 al2586 ) { struct StrBuilder_14 temp840 = ( ( mk187 ) ( ( al2586 ) ) ); struct StrBuilder_14 * sb2587 = ( &temp840 ); struct envunion31 temp841 = ( (struct envunion31){ .fun = ( enum Unit_4 (*) ( struct env19* , struct StrBuilder_14 * , struct StrBuilder_14 ) )write842 , .env = env->envinst19 } ); ( temp841.fun ( &temp841.env , ( sb2587 ) , ( s2584 ) ) ); struct envunion26 temp851 = ( (struct envunion26){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); ( temp851.fun ( &temp851.env , ( sb2587 ) , ( ( nullchar287 ) ( ) ) ) ); struct StrView_25 dynstr2588 = ( ( as_dash_str288 ) ( ( sb2587 ) ) ); return ( (struct StrView_25) { .f_contents = ( (struct Slice_7) { .f_ptr = ( ( ( dynstr2588 ) .f_contents ) .f_ptr ) , .f_count = ( op_dash_sub72 ( ( ( ( dynstr2588 ) .f_contents ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) } ) } ); } static const char* mk_dash_const_dash_str837 ( struct env36* env , struct StrBuilder_14 s2591 , enum CAllocator_6 al2593 ) { struct envunion37 temp838 = ( (struct envunion37){ .fun = ( struct StrView_25 (*) ( struct env30* , struct StrBuilder_14 , enum CAllocator_6 ) )mk_dash_dyn_dash_str839 , .env = env->envinst30 } ); return ( ( ( cast183 ) ( ( ( ( temp838.fun ( &temp838.env , ( s2591 ) , ( al2593 ) ) ) .f_contents ) .f_ptr ) ) ) ); } struct Array_853 { int32_t _arr [3]; }; struct ArrayIter_855 { struct Array_853 f_backing; size_t f_cur; }; static struct ArrayIter_855 into_dash_iter856 ( struct Array_853 self2145 ) { return ( (struct ArrayIter_855) { .f_backing = ( self2145 ) , .f_cur = ( from_dash_integral0 ( 0 ) ) } ); } static int32_t * cast_dash_ptr860 ( struct Array_853 * p349 ) { return ( (int32_t * ) ( p349 ) ); } static int32_t * offset_dash_ptr861 ( int32_t * x333 , int64_t count335 ) { int32_t temp862; return ( (int32_t * ) ( ( (void*) ( x333 ) ) + ( op_dash_mul69 ( ( count335 ) , ( (int64_t ) ( sizeof( ( ( temp862 ) ) ) ) ) ) ) ) ); } static int32_t * get_dash_ptr859 ( struct Array_853 * arr2073 , size_t i2076 ) { if ( ( ( cmp75 ( ( i2076 ) , ( from_dash_integral0 ( 0 ) ) ) == 0 ) || ( cmp75 ( ( i2076 ) , ( (size_t ) ( 3 ) ) ) != 0 ) ) ) { ( ( panic439 ) ( ( ( StrConcat_440_StrConcat ) ( ( ( StrConcat_441_StrConcat ) ( ( ( StrConcat_255_StrConcat ) ( ( ( StrConcat_256_StrConcat ) ( ( ( from_dash_string110 ) ( ( "Access to array at index " ) , ( 25 ) ) ) , ( i2076 ) ) ) , ( ( from_dash_string110 ) ( ( ". (max: " ) , ( 8 ) ) ) ) ) , ( 3 ) ) ) , ( ( from_dash_charlike111 ) ( ( ")" ) , ( 1 ) ) ) ) ) ) ); } int32_t * p2077 = ( ( ( cast_dash_ptr860 ) ( ( arr2073 ) ) ) ); return ( ( offset_dash_ptr861 ) ( ( p2077 ) , ( (int64_t ) ( i2076 ) ) ) ); } static int32_t get858 ( struct Array_853 * arr2080 , size_t i2083 ) { return ( * ( ( get_dash_ptr859 ) ( ( arr2080 ) , ( i2083 ) ) ) ); } static struct Maybe_137 next857 ( struct ArrayIter_855 * self2152 ) { if ( ( cmp75 ( ( ( * ( self2152 ) ) .f_cur ) , ( (size_t ) ( 3 ) ) ) != 0 ) ) { return ( (struct Maybe_137) { .tag = Maybe_137_None_t } ); } int32_t e2154 = ( ( get858 ) ( ( & ( ( * ( self2152 ) ) .f_backing ) ) , ( ( * ( self2152 ) ) .f_cur ) ) ); (* self2152 ) .f_cur = ( op_dash_add77 ( ( ( * ( self2152 ) ) .f_cur ) , ( from_dash_integral0 ( 1 ) ) ) ); return ( ( Maybe_137_Just ) ( ( e2154 ) ) ); } static int32_t reduce854 ( struct Array_853 iterable1033 , int32_t base1035 , int32_t (* fun1037 )( int32_t , int32_t ) ) { int32_t x1038 = ( base1035 ); struct ArrayIter_855 it1039 = ( ( into_dash_iter856 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_137 dref1040 = ( ( next857 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_137_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_137_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_137_Just_s .field0 ) , ( x1038 ) ) ); } } } int32_t temp863; return ( temp863 ); } static int32_t op_dash_mul865 ( int32_t l212 , int32_t r214 ) { return ( ( l212 ) * ( r214 ) ); } static int32_t lam864 ( int32_t elem2334 , int32_t b2336 ) { return ( op_dash_add275 ( ( op_dash_mul865 ( ( b2336 ) , ( from_dash_integral48 ( 8 ) ) ) ) , ( elem2334 ) ) ); } static int32_t from_dash_octal852 ( struct Array_853 arr2332 ) { return ( ( reduce854 ) ( ( arr2332 ) , ( from_dash_integral48 ( 0 ) ) , ( lam864 ) ) ); } static struct Array_853 from_dash_listlike866 ( struct Array_853 self325 ) { return ( self325 ); } static bool errno_dash_EEXIST867 ( ) { return ( eq504 ( ( errno ) , ( from_dash_integral48 ( 17 ) ) ) ); } struct Stat_868 { uint64_t f_dev; uint64_t f_ino; uint64_t f_nlink; uint32_t f_mode; uint32_t f_uid; uint32_t f_gid; uint32_t f_pad0; uint64_t f_rdev; int64_t f_size; int64_t f_blksize; int64_t f_blocks; struct timespec f_atim; struct timespec f_mtim; struct timespec f_ctim; int64_t f_unused1; int64_t f_unused2; int64_t f_unused3; }; static struct Stat_868 undefined869 ( ) { struct Stat_868 temp870; return ( temp870 ); } static void* ptr_dash_castptr871 ( struct Stat_868 * ptr380 ) { return ( (void* ) ( ptr380 ) ); } static uint32_t s_dash_ifmt872 ( ) { return ( from_dash_integral106 ( 61440 ) ); } static uint32_t s_dash_ifdir873 ( ) { return ( from_dash_integral106 ( 16384 ) ); } static enum Unit_4 mkdir835 ( struct env38* env , struct StrBuilder_14 path2680 , enum CAllocator_6 al2682 ) { struct envunion39 temp836 = ( (struct envunion39){ .fun = ( const char* (*) ( struct env36* , struct StrBuilder_14 , enum CAllocator_6 ) )mk_dash_const_dash_str837 , .env = env->envinst36 } ); const char* path2683 = ( temp836.fun ( &temp836.env , ( path2680 ) , ( al2682 ) ) ); if ( ( ! eq504 ( ( ( mkdir ) ( ( path2683 ) , ( ( from_dash_octal852 ) ( ( ( from_dash_listlike866 ) ( ( (struct Array_853) { ._arr = { ( from_dash_integral48 ( 7 ) ) , ( from_dash_integral48 ( 7 ) ) , ( from_dash_integral48 ( 7 ) ) } } ) ) ) ) ) ) ) , ( from_dash_integral48 ( 0 ) ) ) ) ) { if ( ( ! ( ( errno_dash_EEXIST867 ) ( ) ) ) ) { ( ( panic86 ) ( ( ( from_dash_string110 ) ( ( "mkdir() failed" ) , ( 14 ) ) ) ) ); } struct Stat_868 stat2684 = ( ( undefined869 ) ( ) ); ( ( stat ) ( ( path2683 ) , ( ( ptr_dash_castptr871 ) ( ( & ( stat2684 ) ) ) ) ) ); if ( ( ! eq832 ( ( ( u32_dash_and428 ) ( ( ( stat2684 ) .f_mode ) , ( ( s_dash_ifmt872 ) ( ) ) ) ) , ( ( s_dash_ifdir873 ) ( ) ) ) ) ) { ( ( panic86 ) ( ( ( from_dash_string110 ) ( ( "mkdir() failed: path exists but is not a directory" ) , ( 50 ) ) ) ) ); } } ( ( free_dash_const_dash_str292 ) ( ( path2683 ) , ( al2682 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 lam829 ( struct env825* env , struct Char_17 c2692 ) { if ( ( eq830 ( ( c2692 ) , ( ( from_dash_charlike111 ) ( ( "/" ) , ( 1 ) ) ) ) ) ) { if ( ( cmp75 ( ( ( count833 ) ( ( env->sb2690 ) ) ) , ( from_dash_integral0 ( 0 ) ) ) == 2 ) ) { struct envunion41 temp834 = ( (struct envunion41){ .fun = ( enum Unit_4 (*) ( struct env38* , struct StrBuilder_14 , enum CAllocator_6 ) )mkdir835 , .env = env->envinst38 } ); ( temp834.fun ( &temp834.env , ( * ( env->sb2690 ) ) , ( env->al2689 ) ) ); } } struct envunion42 temp874 = ( (struct envunion42){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); ( temp874.fun ( &temp874.env , ( env->sb2690 ) , ( c2692 ) ) ); return ( Unit_4_Unit ); } struct envunion876 { enum Unit_4 (*fun) ( struct env38* , struct StrBuilder_14 , enum CAllocator_6 ); struct env38 env; }; static enum Unit_4 free878 ( struct List_5 * list1946 ) { ( ( free280 ) ( ( ( * ( list1946 ) ) .f_al ) , ( ( * ( list1946 ) ) .f_elements ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 free877 ( struct StrBuilder_14 * builder2570 ) { ( ( free878 ) ( ( & ( ( * ( builder2570 ) ) .f_chars ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 mkdir_dash_p822 ( struct env40* env , struct StrConcat_22 path2687 , enum CAllocator_6 al2689 ) { struct StrBuilder_14 temp823 = ( ( mk187 ) ( ( al2689 ) ) ); struct StrBuilder_14 * sb2690 = ( &temp823 ); struct env825 envinst825 = { .sb2690 = sb2690 , .envinst38 = env->envinst38 , .al2689 = al2689 , .envinst12 = env->envinst12 , }; ( ( for_dash_each824 ) ( ( ( chars211 ) ( ( path2687 ) ) ) , ( (struct envunion826){ .fun = ( enum Unit_4 (*) ( struct env825* , struct Char_17 ) )lam829 , .env = envinst825 } ) ) ); struct envunion876 temp875 = ( (struct envunion876){ .fun = ( enum Unit_4 (*) ( struct env38* , struct StrBuilder_14 , enum CAllocator_6 ) )mkdir835 , .env = env->envinst38 } ); ( temp875.fun ( &temp875.env , ( * ( sb2690 ) ) , ( al2689 ) ) ); ( ( free877 ) ( ( sb2690 ) ) ); return ( Unit_4_Unit ); } struct env880 { enum CAllocator_6 al3475; ; }; struct envunion881 { enum Unit_4 (*fun) ( struct env880* , const char* ); struct env880 env; }; struct env882 { ; struct Stats_155 stats3473; ; }; struct envunion883 { enum Unit_4 (*fun) ( struct env882* , const char* ); struct env882 env; }; static enum Unit_4 with879 ( const char* res1224 , struct envunion881 free_dash_fun1226 , struct envunion883 fun1228 ) { struct envunion883 temp884 = ( fun1228 ); enum Unit_4 ret1229 = ( temp884.fun ( &temp884.env , ( res1224 ) ) ); struct envunion881 temp885 = ( free_dash_fun1226 ); ( temp885.fun ( &temp885.env , ( res1224 ) ) ); return ( ret1229 ); } struct StrConcatIter_894 { struct StrConcatIter_198 f_left; struct StrViewIter_201 f_right; }; struct env895 { struct StrBuilder_14 * builder2540; struct env12 envinst12; }; struct envunion896 { enum Unit_4 (*fun) ( struct env895* , struct Char_17 ); struct env895 env; }; static struct StrConcatIter_894 into_dash_iter898 ( struct StrConcatIter_894 self1406 ) { return ( self1406 ); } static struct Maybe_125 next899 ( struct StrConcatIter_894 * self1409 ) { struct Maybe_125 dref1410 = ( ( next206 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each893 ( struct StrConcatIter_894 iterable1014 , struct envunion896 fun1016 ) { struct StrConcatIter_894 temp897 = ( ( into_dash_iter898 ) ( ( iterable1014 ) ) ); struct StrConcatIter_894 * it1017 = ( &temp897 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next899 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { struct envunion896 temp900 = ( fun1016 ); ( temp900.fun ( &temp900.env , ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrConcatIter_894 into_dash_iter902 ( struct StrConcat_29 dref1413 ) { return ( (struct StrConcatIter_894) { .f_left = ( ( chars211 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars217 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_894 chars901 ( struct StrConcat_29 self1424 ) { return ( ( into_dash_iter902 ) ( ( self1424 ) ) ); } static enum Unit_4 lam903 ( struct env895* env , struct Char_17 c2544 ) { struct envunion16 temp904 = ( (struct envunion16){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); return ( temp904.fun ( &temp904.env , ( env->builder2540 ) , ( c2544 ) ) ); } static enum Unit_4 write892 ( struct env18* env , struct StrBuilder_14 * builder2540 , struct StrConcat_29 s2542 ) { struct env895 envinst895 = { .builder2540 = builder2540 , .envinst12 = env->envinst12 , }; ( ( for_dash_each893 ) ( ( ( chars901 ) ( ( s2542 ) ) ) , ( (struct envunion896){ .fun = ( enum Unit_4 (*) ( struct env895* , struct Char_17 ) )lam903 , .env = envinst895 } ) ) ); return ( Unit_4_Unit ); } static struct StrView_25 mk_dash_dyn_dash_str889 ( struct env27* env , struct StrConcat_29 s2584 , enum CAllocator_6 al2586 ) { struct StrBuilder_14 temp890 = ( ( mk187 ) ( ( al2586 ) ) ); struct StrBuilder_14 * sb2587 = ( &temp890 ); struct envunion28 temp891 = ( (struct envunion28){ .fun = ( enum Unit_4 (*) ( struct env18* , struct StrBuilder_14 * , struct StrConcat_29 ) )write892 , .env = env->envinst18 } ); ( temp891.fun ( &temp891.env , ( sb2587 ) , ( s2584 ) ) ); struct envunion26 temp905 = ( (struct envunion26){ .fun = ( enum Unit_4 (*) ( struct env12* , struct StrBuilder_14 * , struct Char_17 ) )write_dash_char221 , .env = env->envinst12 } ); ( temp905.fun ( &temp905.env , ( sb2587 ) , ( ( nullchar287 ) ( ) ) ) ); struct StrView_25 dynstr2588 = ( ( as_dash_str288 ) ( ( sb2587 ) ) ); return ( (struct StrView_25) { .f_contents = ( (struct Slice_7) { .f_ptr = ( ( ( dynstr2588 ) .f_contents ) .f_ptr ) , .f_count = ( op_dash_sub72 ( ( ( ( dynstr2588 ) .f_contents ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) } ) } ); } static const char* mk_dash_const_dash_str887 ( struct env34* env , struct StrConcat_29 s2591 , enum CAllocator_6 al2593 ) { struct envunion35 temp888 = ( (struct envunion35){ .fun = ( struct StrView_25 (*) ( struct env27* , struct StrConcat_29 , enum CAllocator_6 ) )mk_dash_dyn_dash_str889 , .env = env->envinst27 } ); return ( ( ( cast183 ) ( ( ( ( temp888.fun ( &temp888.env , ( s2591 ) , ( al2593 ) ) ) .f_contents ) .f_ptr ) ) ) ); } static enum Unit_4 lam906 ( struct env880* env , const char* filename3480 ) { return ( ( free_dash_const_dash_str292 ) ( ( filename3480 ) , ( env->al3475 ) ) ); } struct StrConcat_909 { uint32_t field0; struct Char_17 field1; }; static struct StrConcat_909 StrConcat_909_StrConcat ( uint32_t field0 , struct Char_17 field1 ) { return ( struct StrConcat_909 ) { .field0 = field0 , .field1 = field1 }; }; struct IntStrIter_912 { uint32_t f_int; int32_t f_len; bool f_negative; }; struct StrConcatIter_911 { struct IntStrIter_912 f_left; struct AppendIter_721 f_right; }; static int32_t count_dash_digits917 ( uint32_t self1345 ) { if ( ( eq832 ( ( self1345 ) , ( from_dash_integral106 ( 0 ) ) ) ) ) { return ( from_dash_integral48 ( 1 ) ); } int32_t digits1346 = ( from_dash_integral48 ( 0 ) ); while ( ( cmp105 ( ( self1345 ) , ( from_dash_integral106 ( 0 ) ) ) == 2 ) ) { self1345 = ( op_dash_div391 ( ( self1345 ) , ( from_dash_integral106 ( 10 ) ) ) ); digits1346 = ( op_dash_add275 ( ( digits1346 ) , ( from_dash_integral48 ( 1 ) ) ) ); } return ( digits1346 ); } static struct IntStrIter_912 uint_dash_iter916 ( uint32_t int1352 ) { return ( (struct IntStrIter_912) { .f_int = ( int1352 ) , .f_len = ( ( count_dash_digits917 ) ( ( int1352 ) ) ) , .f_negative = ( false ) } ); } static struct IntStrIter_912 chars915 ( uint32_t self1364 ) { return ( ( uint_dash_iter916 ) ( ( self1364 ) ) ); } static struct StrConcatIter_911 into_dash_iter914 ( struct StrConcat_909 dref1413 ) { return ( (struct StrConcatIter_911) { .f_left = ( ( chars915 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_911 chars913 ( struct StrConcat_909 self1424 ) { return ( ( into_dash_iter914 ) ( ( self1424 ) ) ); } struct env922 { ; uint32_t base1150; }; struct envunion923 { uint32_t (*fun) ( struct env922* , int32_t , uint32_t ); struct env922 env; }; static uint32_t reduce921 ( struct Range_360 iterable1033 , uint32_t base1035 , struct envunion923 fun1037 ) { uint32_t x1038 = ( base1035 ); struct RangeIter_363 it1039 = ( ( into_dash_iter365 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_137 dref1040 = ( ( next366 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_137_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_137_Just_t ) { struct envunion923 temp924 = ( fun1037 ); x1038 = ( temp924.fun ( &temp924.env , ( dref1040 .stuff .Maybe_137_Just_s .field0 ) , ( x1038 ) ) ); } } } uint32_t temp925; return ( temp925 ); } static uint32_t lam926 ( struct env922* env , int32_t item1154 , uint32_t x1156 ) { return ( op_dash_mul393 ( ( x1156 ) , ( env->base1150 ) ) ); } static uint32_t pow920 ( uint32_t base1150 , int32_t p1152 ) { struct env922 envinst922 = { .base1150 = base1150 , }; return ( ( reduce921 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( p1152 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) , ( from_dash_integral106 ( 1 ) ) , ( (struct envunion923){ .fun = ( uint32_t (*) ( struct env922* , int32_t , uint32_t ) )lam926 , .env = envinst922 } ) ) ); } static struct Maybe_125 next919 ( struct IntStrIter_912 * self1337 ) { if ( ( ( * ( self1337 ) ) .f_negative ) ) { (* self1337 ) .f_negative = ( false ); return ( ( Maybe_125_Just ) ( ( ( from_dash_charlike111 ) ( ( "-" ) , ( 1 ) ) ) ) ); } if ( ( cmp367 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } uint32_t trim_dash_down1338 = ( ( pow920 ) ( ( from_dash_integral106 ( 10 ) ) , ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); uint32_t upper1339 = ( op_dash_div391 ( ( ( * ( self1337 ) ) .f_int ) , ( trim_dash_down1338 ) ) ); uint32_t upper_dash_mask1340 = ( op_dash_mul393 ( ( op_dash_div391 ( ( upper1339 ) , ( from_dash_integral106 ( 10 ) ) ) ) , ( from_dash_integral106 ( 10 ) ) ) ); uint8_t digit1341 = ( ( ( cast109 ) ( ( op_dash_sub392 ( ( upper1339 ) , ( upper_dash_mask1340 ) ) ) ) ) ); (* self1337 ) .f_len = ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ); struct Char_17 digit_dash_char1342 = ( ( from_dash_u8740 ) ( ( op_dash_add116 ( ( digit1341 ) , ( from_dash_integral102 ( 48 ) ) ) ) ) ); return ( ( Maybe_125_Just ) ( ( digit_dash_char1342 ) ) ); } static struct Maybe_125 next918 ( struct StrConcatIter_911 * self1409 ) { struct Maybe_125 dref1410 = ( ( next919 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static int32_t fprintf_dash_char927 ( FILE * file724 , struct Char_17 c726 ) { struct CharDestructured_96 dref727 = ( ( destructure97 ) ( ( c726 ) ) ); if ( dref727.tag == CharDestructured_96_Ref_t ) { return ( ( fprintf ) ( ( file724 ) , ( ( from_dash_string92 ) ( ( "%.*s" ) , ( 4 ) ) ) , ( ( size_dash_i3293 ) ( ( ( dref727 .stuff .CharDestructured_96_Ref_s .field0 ) .f_num_dash_bytes ) ) ) , ( ( dref727 .stuff .CharDestructured_96_Ref_s .field0 ) .f_ptr ) ) ); } else { if ( dref727.tag == CharDestructured_96_Scalar_t ) { if ( ( cmp105 ( ( dref727 .stuff .CharDestructured_96_Scalar_s .field0 ) , ( from_dash_integral106 ( 127 ) ) ) == 2 ) ) { const char* temp928 = ( ( from_dash_string92 ) ( ( "(TODO) scalar too large BRUH" ) , ( 28 ) ) ); printf("%s\n", temp928); exit ( 1 ); ( Unit_4_Unit ); } return ( ( fprintf ) ( ( file724 ) , ( ( from_dash_string92 ) ( ( "%c" ) , ( 2 ) ) ) , ( ( u32_dash_u8108 ) ( ( dref727 .stuff .CharDestructured_96_Scalar_s .field0 ) ) ) ) ); } } } static enum Unit_4 print930 ( struct StrView_25 s1611 ) { ( ( for_dash_each496 ) ( ( ( chars217 ) ( ( s1611 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static bool undefined931 ( ) { bool temp932; return ( temp932 ); } static bool unreachable929 ( ) { ( ( print930 ) ( ( ( from_dash_string110 ) ( ( "unreachable\n" ) , ( 12 ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( ( undefined931 ) ( ) ); } static bool try_dash_write_dash_contents910 ( const char* filename2718 , struct StrConcat_909 contents2720 ) { FILE * file2721 = ( ( fopen ) ( ( filename2718 ) , ( ( from_dash_charlike172 ) ( ( "w" ) , ( 1 ) ) ) ) ); if ( ( ( is_dash_ptr_dash_null298 ) ( ( file2721 ) ) ) ) { return ( false ); } struct StrConcatIter_911 it2722 = ( ( chars913 ) ( ( contents2720 ) ) ); while ( ( true ) ) { struct Maybe_125 dref2723 = ( ( next918 ) ( ( & ( it2722 ) ) ) ); if ( dref2723.tag == Maybe_125_None_t ) { ( ( fclose ) ( ( file2721 ) ) ); return ( true ); } else { if ( dref2723.tag == Maybe_125_Just_t ) { int32_t chars_dash_written2725 = ( ( fprintf_dash_char927 ) ( ( file2721 ) , ( dref2723 .stuff .Maybe_125_Just_s .field0 ) ) ); if ( ( cmp367 ( ( chars_dash_written2725 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) { return ( false ); } } } } return ( ( unreachable929 ) ( ) ); } struct StrConcat_934 { struct StrView_25 field0; const char* field1; }; static struct StrConcat_934 StrConcat_934_StrConcat ( struct StrView_25 field0 , const char* field1 ) { return ( struct StrConcat_934 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_937 { struct StrView_25 field0; struct StrConcat_934 field1; }; static struct StrConcat_937 StrConcat_937_StrConcat ( struct StrView_25 field0 , struct StrConcat_934 field1 ) { return ( struct StrConcat_937 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_936 { struct StrConcat_937 field0; struct Char_17 field1; }; static struct StrConcat_936 StrConcat_936_StrConcat ( struct StrConcat_937 field0 , struct Char_17 field1 ) { return ( struct StrConcat_936 ) { .field0 = field0 , .field1 = field1 }; }; static enum Unit_4 print_dash_str940 ( const char* self1313 ) { ( ( printf ) ( ( ( from_dash_string92 ) ( ( "%s" ) , ( 2 ) ) ) , ( self1313 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str939 ( struct StrConcat_934 self1418 ) { struct StrConcat_934 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str940 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str938 ( struct StrConcat_937 self1418 ) { struct StrConcat_937 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str91 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str939 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 print_dash_str935 ( struct StrConcat_936 self1418 ) { struct StrConcat_936 dref1419 = ( self1418 ); if ( true ) { ( ( print_dash_str938 ) ( ( dref1419 .field0 ) ) ); ( ( print_dash_str94 ) ( ( dref1419 .field1 ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 panic933 ( struct StrConcat_934 errmsg1622 ) { ( ( print_dash_str935 ) ( ( ( StrConcat_936_StrConcat ) ( ( ( StrConcat_937_StrConcat ) ( ( ( from_dash_string110 ) ( ( "PANIC: " ) , ( 7 ) ) ) , ( errmsg1622 ) ) ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); ( ( exit ) ( ( from_dash_integral48 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 write_dash_contents908 ( const char* filename2728 , struct StrConcat_909 contents2730 ) { if ( ( ! ( ( try_dash_write_dash_contents910 ) ( ( filename2728 ) , ( contents2730 ) ) ) ) ) { ( ( panic933 ) ( ( ( StrConcat_934_StrConcat ) ( ( ( from_dash_string110 ) ( ( "could not write to file " ) , ( 24 ) ) ) , ( filename2728 ) ) ) ) ); } return ( Unit_4_Unit ); } static enum Unit_4 lam907 ( struct env882* env , const char* filename3482 ) { return ( ( write_dash_contents908 ) ( ( filename3482 ) , ( ( StrConcat_909_StrConcat ) ( ( ( env->stats3473 ) .f_total_dash_wins ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ); } static enum Unit_4 save_dash_score820 ( struct env63* env , struct Stats_155 stats3473 , enum CAllocator_6 al3475 ) { struct StrCase_23 data_dash_dir3476 = ( ( data_dash_home159 ) ( ) ); struct StrConcat_22 minesweeper_dash_data_dash_dir3477 = ( ( StrConcat_22_StrConcat ) ( ( data_dash_dir3476 ) , ( ( from_dash_string110 ) ( ( "/kc-minesweeper" ) , ( 15 ) ) ) ) ); struct envunion65 temp821 = ( (struct envunion65){ .fun = ( enum Unit_4 (*) ( struct env40* , struct StrConcat_22 , enum CAllocator_6 ) )mkdir_dash_p822 , .env = env->envinst40 } ); ( temp821.fun ( &temp821.env , ( minesweeper_dash_data_dash_dir3477 ) , ( al3475 ) ) ); struct StrConcat_29 stats_dash_file3478 = ( ( StrConcat_29_StrConcat ) ( ( minesweeper_dash_data_dash_dir3477 ) , ( ( from_dash_string110 ) ( ( "/stats" ) , ( 6 ) ) ) ) ); struct envunion64 temp886 = ( (struct envunion64){ .fun = ( const char* (*) ( struct env34* , struct StrConcat_29 , enum CAllocator_6 ) )mk_dash_const_dash_str887 , .env = env->envinst34 } ); struct env880 envinst880 = { .al3475 = al3475 , }; struct env882 envinst882 = { .stats3473 = stats3473 , }; ( ( with879 ) ( ( temp886.fun ( &temp886.env , ( stats_dash_file3478 ) , ( al3475 ) ) ) , ( (struct envunion881){ .fun = ( enum Unit_4 (*) ( struct env880* , const char* ) )lam906 , .env = envinst880 } ) , ( (struct envunion883){ .fun = ( enum Unit_4 (*) ( struct env882* , const char* ) )lam907 , .env = envinst882 } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 map_dash_tile942 ( struct TileMap_330 tilemap2942 , int32_t x2944 , int32_t y2946 , struct Tile_333 (* fun2948 )( struct Tile_333 ) ) { struct Tile_333 * tp2949 = ( ( get_dash_ptr372 ) ( ( elem_dash_get409 ( ( ( tilemap2942 ) .f_tiles ) , ( ( i32_dash_size266 ) ( ( y2946 ) ) ) ) ) , ( ( i32_dash_size266 ) ( ( x2944 ) ) ) ) ); (* tp2949 ) = ( ( fun2948 ) ( ( * ( tp2949 ) ) ) ); return ( Unit_4_Unit ); } static struct Tile_333 lam943 ( struct Tile_333 tile3440 ) { struct Tile_333 temp944 = ( tile3440 ); temp944 . f_flagged = ( ! ( ( tile3440 ) .f_flagged ) ); return ( temp944 ); } static bool toggle_dash_flag941 ( struct TileMap_330 tilemap3434 , int32_t x3436 , int32_t y3438 ) { if ( ( ( ( ( cmp367 ( ( x3436 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( x3436 ) , ( ( tilemap3434 ) .f_width ) ) != 0 ) ) || ( cmp367 ( ( y3438 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) || ( cmp367 ( ( y3438 ) , ( ( tilemap3434 ) .f_height ) ) != 0 ) ) ) { return ( false ); } ( ( map_dash_tile942 ) ( ( tilemap3434 ) , ( x3436 ) , ( y3438 ) , ( lam943 ) ) ); } static struct Tuple2_397 get_dash_board_dash_off945 ( struct Tui_55 * tui3443 , struct TileMap_330 tilemap3445 ) { return ( ( Tuple2_397_Tuple2 ) ( ( op_dash_sub735 ( ( op_dash_div417 ( ( ( u32_dash_i32388 ) ( ( ( * ( tui3443 ) ) .f_width ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , ( op_dash_div417 ( ( ( tilemap3445 ) .f_width ) , ( from_dash_integral48 ( 2 ) ) ) ) ) ) , ( op_dash_sub735 ( ( op_dash_div417 ( ( ( u32_dash_i32388 ) ( ( ( * ( tui3443 ) ) .f_height ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , ( op_dash_div417 ( ( ( tilemap3445 ) .f_height ) , ( from_dash_integral48 ( 2 ) ) ) ) ) ) ) ); } static enum MouseButton_598 * cast949 ( uint32_t * x346 ) { return ( (enum MouseButton_598 * ) ( x346 ) ); } static uint32_t cast_dash_on_dash_zeroed947 ( enum MouseButton_598 x552 ) { uint32_t temp948 = ( ( zeroed522 ) ( ) ); uint32_t * y553 = ( &temp948 ); enum MouseButton_598 * yp554 = ( ( cast949 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static bool eq946 ( enum MouseButton_598 l3164 , enum MouseButton_598 r3166 ) { return ( eq832 ( ( ( cast_dash_on_dash_zeroed947 ) ( ( l3164 ) ) ) , ( ( ( cast_dash_on_dash_zeroed947 ) ( ( r3166 ) ) ) ) ) ); } struct envunion951 { enum Unit_4 (*fun) ( struct env63* , struct Stats_155 , enum CAllocator_6 ); struct env63 env; }; static int32_t min953 ( int32_t l1176 , int32_t r1178 ) { if ( ( cmp367 ( ( l1176 ) , ( r1178 ) ) == 0 ) ) { return ( l1176 ); } else { return ( r1178 ); } } static int32_t max954 ( int32_t l1241 , int32_t r1243 ) { if ( ( cmp367 ( ( l1241 ) , ( r1243 ) ) == 2 ) ) { return ( l1241 ); } else { return ( r1243 ); } } static bool between952 ( int32_t c1258 , int32_t l1260 , int32_t r1262 ) { int32_t from1263 = ( ( min953 ) ( ( l1260 ) , ( r1262 ) ) ); int32_t to1264 = ( ( max954 ) ( ( l1260 ) , ( r1262 ) ) ); return ( ( cmp367 ( ( from1263 ) , ( c1258 ) ) != 2 ) && ( cmp367 ( ( c1258 ) , ( to1264 ) ) != 2 ) ); } struct envunion956 { bool (*fun) ( struct env59* , struct Screen_541 * ); struct env59 env; }; static bool resize_dash_screen_dash_if_dash_needed957 ( struct env59* env , struct Screen_541 * screen3287 ) { struct Tui_55 * tui3288 = ( ( * ( screen3287 ) ) .f_tui ); struct envunion60 temp958 = ( (struct envunion60){ .fun = ( bool (*) ( struct env52* , struct Tui_55 * ) )update_dash_dimensions606 , .env = env->envinst52 } ); ( temp958.fun ( &temp958.env , ( tui3288 ) ) ); if ( ( ! ( ( * ( tui3288 ) ) .f_should_dash_redraw ) ) ) { return ( false ); } (* screen3287 ) .f_requires_dash_full_dash_redraw = ( true ); uint32_t w3289 = ( ( * ( ( * ( screen3287 ) ) .f_tui ) ) .f_width ); uint32_t h3290 = ( ( * ( ( * ( screen3287 ) ) .f_tui ) ) .f_height ); size_t nusz3291 = ( ( u32_dash_size555 ) ( ( op_dash_mul393 ( ( w3289 ) , ( h3290 ) ) ) ) ); if ( ( cmp75 ( ( nusz3291 ) , ( ( ( * ( screen3287 ) ) .f_current ) .f_count ) ) != 2 ) ) { return ( true ); } struct Screen_541 nuscreen3292 = ( ( mk_dash_screen549 ) ( ( tui3288 ) , ( ( * ( screen3287 ) ) .f_al ) ) ); (* screen3287 ) .f_current = ( ( nuscreen3292 ) .f_current ); (* screen3287 ) .f_previous = ( ( nuscreen3292 ) .f_previous ); return ( true ); } static bool should_dash_redraw959 ( struct Tui_55 * tui3223 ) { bool redraw3224 = ( ( * ( tui3223 ) ) .f_should_dash_redraw ); (* tui3223 ) .f_should_dash_redraw = ( false ); return ( redraw3224 ); } struct env963 { struct Slice_542 s1815; struct Cell_543 (* fun1817 )( struct Cell_543 ); ; ; ; }; struct envunion964 { enum Unit_4 (*fun) ( struct env963* , int32_t ); struct env963 env; }; static enum Unit_4 for_dash_each962 ( struct Range_360 iterable1014 , struct envunion964 fun1016 ) { struct RangeIter_363 temp965 = ( ( into_dash_iter365 ) ( ( iterable1014 ) ) ); struct RangeIter_363 * it1017 = ( &temp965 ); while ( ( true ) ) { struct Maybe_137 dref1018 = ( ( next366 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_137_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_137_Just_t ) { struct envunion964 temp966 = ( fun1016 ); ( temp966.fun ( &temp966.env , ( dref1018 .stuff .Maybe_137_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static enum Unit_4 lam967 ( struct env963* env , int32_t i1819 ) { return ( ( set570 ) ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) , ( ( env->fun1817 ) ( ( elem_dash_get574 ( ( env->s1815 ) , ( ( i32_dash_size266 ) ( ( i1819 ) ) ) ) ) ) ) ) ); } static enum Unit_4 map961 ( struct Slice_542 s1815 , struct Cell_543 (* fun1817 )( struct Cell_543 ) ) { struct env963 envinst963 = { .s1815 = s1815 , .fun1817 = fun1817 , }; ( ( for_dash_each962 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_i3293 ) ( ( op_dash_sub72 ( ( ( s1815 ) .f_count ) , ( from_dash_integral0 ( 1 ) ) ) ) ) ) ) ) , ( (struct envunion964){ .fun = ( enum Unit_4 (*) ( struct env963* , int32_t ) )lam967 , .env = envinst963 } ) ) ); return ( Unit_4_Unit ); } static struct Cell_543 lam968 ( struct Cell_543 dref3259 ) { return ( (struct Cell_543) { .f_c = ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , .f_fg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_bg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) } ); } static enum Unit_4 clear_dash_screen960 ( struct Screen_541 * screen3258 ) { ( ( map961 ) ( ( ( * ( screen3258 ) ) .f_current ) , ( lam968 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_screen_dash_colors969 ( struct Screen_541 * screen3305 , struct Color_544 fg3307 , struct Color_544 bg3309 ) { (* screen3305 ) .f_default_dash_fg = ( fg3307 ); (* screen3305 ) .f_default_dash_bg = ( bg3309 ); return ( Unit_4_Unit ); } struct Maybe_976 { enum { Maybe_976_None_t, Maybe_976_Just_t, } tag; union { struct { struct Cell_543 * field0; } Maybe_976_Just_s; } stuff; }; static struct Maybe_976 Maybe_976_Just ( struct Cell_543 * field0 ) { return ( struct Maybe_976 ) { .tag = Maybe_976_Just_t, .stuff = { .Maybe_976_Just_s = { .field0 = field0 } } }; }; static struct Cell_543 * undefined977 ( ) { struct Cell_543 * temp978; return ( temp978 ); } static struct Cell_543 * or_dash_fail975 ( struct Maybe_976 x1635 , struct StrView_25 errmsg1637 ) { struct Maybe_976 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_976_None_t ) { ( ( panic86 ) ( ( errmsg1637 ) ) ); return ( ( undefined977 ) ( ) ); } else { if ( dref1638.tag == Maybe_976_Just_t ) { return ( dref1638 .stuff .Maybe_976_Just_s .field0 ); } } } static struct Maybe_976 get_dash_cell_dash_ptr979 ( struct Screen_541 * screen3316 , int32_t x3318 , int32_t y3320 ) { int32_t w3321 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3316 ) ) .f_tui ) ) .f_width ) ) ); if ( ( ( cmp367 ( ( x3318 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( x3318 ) , ( w3321 ) ) != 0 ) ) ) { return ( (struct Maybe_976) { .tag = Maybe_976_None_t } ); } if ( ( ( cmp367 ( ( y3320 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( y3320 ) , ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3316 ) ) .f_tui ) ) .f_height ) ) ) ) != 0 ) ) ) { return ( (struct Maybe_976) { .tag = Maybe_976_None_t } ); } size_t i3322 = ( ( i32_dash_size266 ) ( ( op_dash_add275 ( ( op_dash_mul865 ( ( y3320 ) , ( w3321 ) ) ) , ( x3318 ) ) ) ) ); return ( ( Maybe_976_Just ) ( ( ( get_dash_ptr571 ) ( ( ( * ( screen3316 ) ) .f_current ) , ( i3322 ) ) ) ) ); } static enum Unit_4 fill_dash_default970 ( struct Screen_541 * screen3325 ) { struct RangeIter_363 temp971 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3325 ) ) .f_tui ) ) .f_height ) ) ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond972 = next366 (&temp971); if ( __cond972 .tag == 0 ) { break; } int32_t y3327 = __cond972 .stuff .Maybe_137_Just_s .field0; struct RangeIter_363 temp973 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3325 ) ) .f_tui ) ) .f_width ) ) ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond974 = next366 (&temp973); if ( __cond974 .tag == 0 ) { break; } int32_t x3329 = __cond974 .stuff .Maybe_137_Just_s .field0; struct Cell_543 * cell3330 = ( ( or_dash_fail975 ) ( ( ( get_dash_cell_dash_ptr979 ) ( ( screen3325 ) , ( x3329 ) , ( y3327 ) ) ) , ( ( from_dash_string110 ) ( ( "no cell??" ) , ( 9 ) ) ) ) ); (* cell3330 ) .f_bg = ( ( * ( screen3325 ) ) .f_default_dash_bg ); } } return ( Unit_4_Unit ); } struct StrConcat_981 { struct StrView_25 field0; uint32_t field1; }; static struct StrConcat_981 StrConcat_981_StrConcat ( struct StrView_25 field0 , uint32_t field1 ) { return ( struct StrConcat_981 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcatIter_984 { struct StrViewIter_201 f_left; struct IntStrIter_912 f_right; }; struct Zip_983 { struct StrConcatIter_984 f_left_dash_it; struct FromIter_269 f_right_dash_it; }; struct env985 { ; ; int32_t y3353; struct Screen_541 * screen3347; int32_t x3356; }; struct Tuple2_987 { struct Char_17 field0; int32_t field1; }; static struct Tuple2_987 Tuple2_987_Tuple2 ( struct Char_17 field0 , int32_t field1 ) { return ( struct Tuple2_987 ) { .field0 = field0 , .field1 = field1 }; }; struct envunion986 { enum Unit_4 (*fun) ( struct env985* , struct Tuple2_987 ); struct env985 env; }; static struct Zip_983 into_dash_iter989 ( struct Zip_983 self864 ) { return ( self864 ); } struct Maybe_990 { enum { Maybe_990_None_t, Maybe_990_Just_t, } tag; union { struct { struct Tuple2_987 field0; } Maybe_990_Just_s; } stuff; }; static struct Maybe_990 Maybe_990_Just ( struct Tuple2_987 field0 ) { return ( struct Maybe_990 ) { .tag = Maybe_990_Just_t, .stuff = { .Maybe_990_Just_s = { .field0 = field0 } } }; }; static struct Maybe_125 next992 ( struct StrConcatIter_984 * self1409 ) { struct Maybe_125 dref1410 = ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next919 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_990 next991 ( struct Zip_983 * self867 ) { struct Zip_983 copy868 = ( * ( self867 ) ); while ( ( true ) ) { struct Maybe_125 dref869 = ( ( next992 ) ( ( & ( ( copy868 ) .f_left_dash_it ) ) ) ); if ( dref869.tag == Maybe_125_None_t ) { return ( (struct Maybe_990) { .tag = Maybe_990_None_t } ); } else { if ( dref869.tag == Maybe_125_Just_t ) { struct Maybe_137 dref871 = ( ( next274 ) ( ( & ( ( copy868 ) .f_right_dash_it ) ) ) ); if ( dref871.tag == Maybe_137_None_t ) { return ( (struct Maybe_990) { .tag = Maybe_990_None_t } ); } else { if ( dref871.tag == Maybe_137_Just_t ) { ( ( next992 ) ( ( & ( ( * ( self867 ) ) .f_left_dash_it ) ) ) ); ( ( next274 ) ( ( & ( ( * ( self867 ) ) .f_right_dash_it ) ) ) ); return ( ( Maybe_990_Just ) ( ( ( Tuple2_987_Tuple2 ) ( ( dref869 .stuff .Maybe_125_Just_s .field0 ) , ( dref871 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ); } } } } } } static enum Unit_4 for_dash_each982 ( struct Zip_983 iterable1014 , struct envunion986 fun1016 ) { struct Zip_983 temp988 = ( ( into_dash_iter989 ) ( ( iterable1014 ) ) ); struct Zip_983 * it1017 = ( &temp988 ); while ( ( true ) ) { struct Maybe_990 dref1018 = ( ( next991 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_990_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_990_Just_t ) { struct envunion986 temp993 = ( fun1016 ); ( temp993.fun ( &temp993.env , ( dref1018 .stuff .Maybe_990_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrConcatIter_984 into_dash_iter995 ( struct StrConcatIter_984 self1406 ) { return ( self1406 ); } static struct Zip_983 zip994 ( struct StrConcatIter_984 left875 , struct FromIter_269 right877 ) { struct StrConcatIter_984 left_dash_it878 = ( ( into_dash_iter995 ) ( ( left875 ) ) ); struct FromIter_269 right_dash_it879 = ( ( into_dash_iter278 ) ( ( right877 ) ) ); return ( (struct Zip_983) { .f_left_dash_it = ( left_dash_it878 ) , .f_right_dash_it = ( right_dash_it879 ) } ); } static struct StrConcatIter_984 into_dash_iter997 ( struct StrConcat_981 dref1413 ) { return ( (struct StrConcatIter_984) { .f_left = ( ( chars217 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars915 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_984 chars996 ( struct StrConcat_981 self1424 ) { return ( ( into_dash_iter997 ) ( ( self1424 ) ) ); } static enum Unit_4 put_dash_char999 ( struct Screen_541 * screen3333 , struct Char_17 c3335 , int32_t x3337 , int32_t y3339 ) { int32_t w3340 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3333 ) ) .f_tui ) ) .f_width ) ) ); if ( ( ( ( ( cmp367 ( ( x3337 ) , ( w3340 ) ) != 0 ) || ( cmp367 ( ( y3339 ) , ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3333 ) ) .f_tui ) ) .f_height ) ) ) ) != 0 ) ) || ( cmp367 ( ( x3337 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) || ( cmp367 ( ( y3339 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) ) { return ( Unit_4_Unit ); } size_t i3341 = ( ( i32_dash_size266 ) ( ( op_dash_add275 ( ( op_dash_mul865 ( ( y3339 ) , ( w3340 ) ) ) , ( x3337 ) ) ) ) ); struct Color_544 fg3342 = ( ( * ( screen3333 ) ) .f_default_dash_fg ); struct Color_544 bg3343 = ( ( * ( screen3333 ) ) .f_default_dash_bg ); struct Char_17 c3344 = ( c3335 ); ( ( set570 ) ( ( ( * ( screen3333 ) ) .f_current ) , ( i3341 ) , ( (struct Cell_543) { .f_c = ( c3344 ) , .f_fg = ( fg3342 ) , .f_bg = ( bg3343 ) } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 lam998 ( struct env985* env , struct Tuple2_987 dref3358 ) { ( ( put_dash_char999 ) ( ( env->screen3347 ) , ( dref3358 .field0 ) , ( op_dash_add275 ( ( env->x3356 ) , ( dref3358 .field1 ) ) ) , ( env->y3353 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 draw_dash_str980 ( struct Screen_541 * screen3347 , struct StrConcat_981 s3349 , int32_t x3351 , int32_t y3353 ) { int32_t w3354 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3347 ) ) .f_tui ) ) .f_width ) ) ); if ( ( ( cmp367 ( ( y3353 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( y3353 ) , ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3347 ) ) .f_tui ) ) .f_height ) ) ) ) != 0 ) ) ) { return ( Unit_4_Unit ); } int32_t i3355 = ( op_dash_add275 ( ( op_dash_mul865 ( ( y3353 ) , ( w3354 ) ) ) , ( x3351 ) ) ); int32_t x3356 = ( ( min953 ) ( ( x3351 ) , ( w3354 ) ) ); size_t max_dash_len3357 = ( ( i32_dash_size266 ) ( ( op_dash_sub735 ( ( w3354 ) , ( x3356 ) ) ) ) ); struct env985 envinst985 = { .y3353 = y3353 , .screen3347 = screen3347 , .x3356 = x3356 , }; ( ( for_dash_each982 ) ( ( ( zip994 ) ( ( ( chars996 ) ( ( s3349 ) ) ) , ( ( from279 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) , ( (struct envunion986){ .fun = ( enum Unit_4 (*) ( struct env985* , struct Tuple2_987 ) )lam998 , .env = envinst985 } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_screen_dash_bg1001 ( struct Screen_541 * screen3300 , struct Color_544 c3302 ) { (* screen3300 ) .f_default_dash_bg = ( c3302 ); return ( Unit_4_Unit ); } struct Zip_1007 { struct SliceIter_801 f_left_dash_it; struct FromIter_269 f_right_dash_it; }; static struct Zip_1007 into_dash_iter1008 ( struct Zip_1007 self864 ) { return ( self864 ); } static struct Zip_1007 zip1009 ( struct Slice_331 left875 , struct FromIter_269 right877 ) { struct SliceIter_801 left_dash_it878 = ( ( into_dash_iter815 ) ( ( left875 ) ) ); struct FromIter_269 right_dash_it879 = ( ( into_dash_iter278 ) ( ( right877 ) ) ); return ( (struct Zip_1007) { .f_left_dash_it = ( left_dash_it878 ) , .f_right_dash_it = ( right_dash_it879 ) } ); } struct Tuple2_1012 { struct Slice_332 field0; int32_t field1; }; static struct Tuple2_1012 Tuple2_1012_Tuple2 ( struct Slice_332 field0 , int32_t field1 ) { return ( struct Tuple2_1012 ) { .field0 = field0 , .field1 = field1 }; }; struct Maybe_1011 { enum { Maybe_1011_None_t, Maybe_1011_Just_t, } tag; union { struct { struct Tuple2_1012 field0; } Maybe_1011_Just_s; } stuff; }; static struct Maybe_1011 Maybe_1011_Just ( struct Tuple2_1012 field0 ) { return ( struct Maybe_1011 ) { .tag = Maybe_1011_Just_t, .stuff = { .Maybe_1011_Just_s = { .field0 = field0 } } }; }; static struct Maybe_1011 next1013 ( struct Zip_1007 * self867 ) { struct Zip_1007 copy868 = ( * ( self867 ) ); while ( ( true ) ) { struct Maybe_402 dref869 = ( ( next809 ) ( ( & ( ( copy868 ) .f_left_dash_it ) ) ) ); if ( dref869.tag == Maybe_402_None_t ) { return ( (struct Maybe_1011) { .tag = Maybe_1011_None_t } ); } else { if ( dref869.tag == Maybe_402_Just_t ) { struct Maybe_137 dref871 = ( ( next274 ) ( ( & ( ( copy868 ) .f_right_dash_it ) ) ) ); if ( dref871.tag == Maybe_137_None_t ) { return ( (struct Maybe_1011) { .tag = Maybe_1011_None_t } ); } else { if ( dref871.tag == Maybe_137_Just_t ) { ( ( next809 ) ( ( & ( ( * ( self867 ) ) .f_left_dash_it ) ) ) ); ( ( next274 ) ( ( & ( ( * ( self867 ) ) .f_right_dash_it ) ) ) ); return ( ( Maybe_1011_Just ) ( ( ( Tuple2_1012_Tuple2 ) ( ( dref869 .stuff .Maybe_402_Just_s .field0 ) , ( dref871 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ); } } } } } } struct Zip_1015 { struct SliceIter_802 f_left_dash_it; struct FromIter_269 f_right_dash_it; }; static struct Zip_1015 into_dash_iter1016 ( struct Zip_1015 self864 ) { return ( self864 ); } static struct Zip_1015 zip1017 ( struct Slice_332 left875 , struct FromIter_269 right877 ) { struct SliceIter_802 left_dash_it878 = ( ( into_dash_iter810 ) ( ( left875 ) ) ); struct FromIter_269 right_dash_it879 = ( ( into_dash_iter278 ) ( ( right877 ) ) ); return ( (struct Zip_1015) { .f_left_dash_it = ( left_dash_it878 ) , .f_right_dash_it = ( right_dash_it879 ) } ); } struct Tuple2_1020 { struct Tile_333 field0; int32_t field1; }; static struct Tuple2_1020 Tuple2_1020_Tuple2 ( struct Tile_333 field0 , int32_t field1 ) { return ( struct Tuple2_1020 ) { .field0 = field0 , .field1 = field1 }; }; struct Maybe_1019 { enum { Maybe_1019_None_t, Maybe_1019_Just_t, } tag; union { struct { struct Tuple2_1020 field0; } Maybe_1019_Just_s; } stuff; }; static struct Maybe_1019 Maybe_1019_Just ( struct Tuple2_1020 field0 ) { return ( struct Maybe_1019 ) { .tag = Maybe_1019_Just_t, .stuff = { .Maybe_1019_Just_s = { .field0 = field0 } } }; }; static struct Maybe_1019 next1021 ( struct Zip_1015 * self867 ) { struct Zip_1015 copy868 = ( * ( self867 ) ); while ( ( true ) ) { struct Maybe_379 dref869 = ( ( next808 ) ( ( & ( ( copy868 ) .f_left_dash_it ) ) ) ); if ( dref869.tag == Maybe_379_None_t ) { return ( (struct Maybe_1019) { .tag = Maybe_1019_None_t } ); } else { if ( dref869.tag == Maybe_379_Just_t ) { struct Maybe_137 dref871 = ( ( next274 ) ( ( & ( ( copy868 ) .f_right_dash_it ) ) ) ); if ( dref871.tag == Maybe_137_None_t ) { return ( (struct Maybe_1019) { .tag = Maybe_1019_None_t } ); } else { if ( dref871.tag == Maybe_137_Just_t ) { ( ( next808 ) ( ( & ( ( * ( self867 ) ) .f_left_dash_it ) ) ) ); ( ( next274 ) ( ( & ( ( * ( self867 ) ) .f_right_dash_it ) ) ) ); return ( ( Maybe_1019_Just ) ( ( ( Tuple2_1020_Tuple2 ) ( ( dref869 .stuff .Maybe_379_Just_s .field0 ) , ( dref871 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ); } } } } } } struct env1022 { bool is_dash_cursor3403; struct Screen_541 * screen2998; ; }; static int32_t mod1023 ( int32_t l1169 , int32_t d1171 ) { int32_t r1172 = ( op_dash_div417 ( ( l1169 ) , ( d1171 ) ) ); int32_t m1173 = ( op_dash_sub735 ( ( l1169 ) , ( op_dash_mul865 ( ( r1172 ) , ( d1171 ) ) ) ) ); if ( ( cmp367 ( ( m1173 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) { return ( op_dash_add275 ( ( d1171 ) , ( m1173 ) ) ); } else { return ( m1173 ); } } struct envunion1025 { enum Unit_4 (*fun) ( struct env1022* , struct Color_544 ); struct env1022 env; }; static enum Unit_4 set_dash_bg1026 ( struct env1022* env , struct Color_544 bg3406 ) { ( ( set_dash_screen_dash_bg1001 ) ( ( env->screen2998 ) , ( ( env->is_dash_cursor3403 ) ? ( ( Color_544_Color8 ) ( ( Color8_545_Yellow8 ) ) ) : ( bg3406 ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_screen_dash_fg1027 ( struct Screen_541 * screen3295 , struct Color_544 c3297 ) { (* screen3295 ) .f_default_dash_fg = ( c3297 ); return ( Unit_4_Unit ); } struct envunion1029 { enum Unit_4 (*fun) ( struct env1022* , struct Color_544 ); struct env1022 env; }; static struct Char_17 undefined1031 ( ) { struct Char_17 temp1032; return ( temp1032 ); } static struct Char_17 or_dash_fail1030 ( struct Maybe_125 x1635 , struct StrView_25 errmsg1637 ) { struct Maybe_125 dref1638 = ( x1635 ); if ( dref1638.tag == Maybe_125_None_t ) { ( ( panic86 ) ( ( errmsg1637 ) ) ); return ( ( undefined1031 ) ( ) ); } else { if ( dref1638.tag == Maybe_125_Just_t ) { return ( dref1638 .stuff .Maybe_125_Just_s .field0 ); } } } struct IntStrIter_1034 { int32_t f_int; int32_t f_len; bool f_negative; }; struct env1038 { ; int32_t base1150; }; struct envunion1039 { int32_t (*fun) ( struct env1038* , int32_t , int32_t ); struct env1038 env; }; static int32_t reduce1037 ( struct Range_360 iterable1033 , int32_t base1035 , struct envunion1039 fun1037 ) { int32_t x1038 = ( base1035 ); struct RangeIter_363 it1039 = ( ( into_dash_iter365 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_137 dref1040 = ( ( next366 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_137_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_137_Just_t ) { struct envunion1039 temp1040 = ( fun1037 ); x1038 = ( temp1040.fun ( &temp1040.env , ( dref1040 .stuff .Maybe_137_Just_s .field0 ) , ( x1038 ) ) ); } } } int32_t temp1041; return ( temp1041 ); } static int32_t lam1042 ( struct env1038* env , int32_t item1154 , int32_t x1156 ) { return ( op_dash_mul865 ( ( x1156 ) , ( env->base1150 ) ) ); } static int32_t pow1036 ( int32_t base1150 , int32_t p1152 ) { struct env1038 envinst1038 = { .base1150 = base1150 , }; return ( ( reduce1037 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( p1152 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) , ( from_dash_integral48 ( 1 ) ) , ( (struct envunion1039){ .fun = ( int32_t (*) ( struct env1038* , int32_t , int32_t ) )lam1042 , .env = envinst1038 } ) ) ); } static struct Maybe_125 next1035 ( struct IntStrIter_1034 * self1337 ) { if ( ( ( * ( self1337 ) ) .f_negative ) ) { (* self1337 ) .f_negative = ( false ); return ( ( Maybe_125_Just ) ( ( ( from_dash_charlike111 ) ( ( "-" ) , ( 1 ) ) ) ) ); } if ( ( cmp367 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } int32_t trim_dash_down1338 = ( ( pow1036 ) ( ( from_dash_integral48 ( 10 ) ) , ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); int32_t upper1339 = ( op_dash_div417 ( ( ( * ( self1337 ) ) .f_int ) , ( trim_dash_down1338 ) ) ); int32_t upper_dash_mask1340 = ( op_dash_mul865 ( ( op_dash_div417 ( ( upper1339 ) , ( from_dash_integral48 ( 10 ) ) ) ) , ( from_dash_integral48 ( 10 ) ) ) ); uint8_t digit1341 = ( ( ( cast131 ) ( ( op_dash_sub735 ( ( upper1339 ) , ( upper_dash_mask1340 ) ) ) ) ) ); (* self1337 ) .f_len = ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ); struct Char_17 digit_dash_char1342 = ( ( from_dash_u8740 ) ( ( op_dash_add116 ( ( digit1341 ) , ( from_dash_integral102 ( 48 ) ) ) ) ) ); return ( ( Maybe_125_Just ) ( ( digit_dash_char1342 ) ) ); } static struct IntStrIter_1034 into_dash_iter1044 ( struct IntStrIter_1034 self1334 ) { return ( self1334 ); } static struct Maybe_125 head1033 ( struct IntStrIter_1034 it1082 ) { struct IntStrIter_1034 temp1043 = ( ( into_dash_iter1044 ) ( ( it1082 ) ) ); return ( ( next1035 ) ( ( &temp1043 ) ) ); } static int32_t count_dash_digits1047 ( int32_t self1345 ) { if ( ( eq504 ( ( self1345 ) , ( from_dash_integral48 ( 0 ) ) ) ) ) { return ( from_dash_integral48 ( 1 ) ); } int32_t digits1346 = ( from_dash_integral48 ( 0 ) ); while ( ( cmp367 ( ( self1345 ) , ( from_dash_integral48 ( 0 ) ) ) == 2 ) ) { self1345 = ( op_dash_div417 ( ( self1345 ) , ( from_dash_integral48 ( 10 ) ) ) ); digits1346 = ( op_dash_add275 ( ( digits1346 ) , ( from_dash_integral48 ( 1 ) ) ) ); } return ( digits1346 ); } static struct IntStrIter_1034 int_dash_iter1046 ( int32_t int1349 ) { if ( ( cmp367 ( ( int1349 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) ) { return ( (struct IntStrIter_1034) { .f_int = ( op_dash_neg516 ( ( int1349 ) ) ) , .f_len = ( ( count_dash_digits1047 ) ( ( op_dash_neg516 ( ( int1349 ) ) ) ) ) , .f_negative = ( true ) } ); } else { return ( (struct IntStrIter_1034) { .f_int = ( int1349 ) , .f_len = ( ( count_dash_digits1047 ) ( ( int1349 ) ) ) , .f_negative = ( false ) } ); } } static struct IntStrIter_1034 chars1045 ( int32_t self1358 ) { return ( ( int_dash_iter1046 ) ( ( self1358 ) ) ); } struct envunion1049 { enum Unit_4 (*fun) ( struct env1022* , struct Color_544 ); struct env1022 env; }; struct envunion1051 { enum Unit_4 (*fun) ( struct env1022* , struct Color_544 ); struct env1022 env; }; static enum Unit_4 render_dash_tiles1000 ( struct Screen_541 * screen2998 , struct TileMap_330 tilemap3385 , struct Tuple2_397 dref3386 , enum GameState_329 game_dash_state3390 , struct Controls_415 controls3392 ) { ( ( set_dash_screen_dash_bg1001 ) ( ( screen2998 ) , ( ( Color_544_Color8 ) ( ( Color8_545_Magenta8 ) ) ) ) ); struct RangeIter_363 temp1002 = into_dash_iter365 ( ( ( to369 ) ( ( op_dash_neg516 ( ( from_dash_integral48 ( 1 ) ) ) ) , ( ( tilemap3385 ) .f_width ) ) ) ); while (true) { struct Maybe_137 __cond1003 = next366 (&temp1002); if ( __cond1003 .tag == 0 ) { break; } int32_t x3394 = __cond1003 .stuff .Maybe_137_Just_s .field0; ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( op_dash_add275 ( ( x3394 ) , ( dref3386 .field0 ) ) ) , ( op_dash_sub735 ( ( dref3386 .field1 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( op_dash_add275 ( ( x3394 ) , ( dref3386 .field0 ) ) ) , ( op_dash_add275 ( ( dref3386 .field1 ) , ( ( tilemap3385 ) .f_height ) ) ) ) ); } struct RangeIter_363 temp1004 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3385 ) .f_height ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond1005 = next366 (&temp1004); if ( __cond1005 .tag == 0 ) { break; } int32_t y3396 = __cond1005 .stuff .Maybe_137_Just_s .field0; ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( op_dash_sub735 ( ( dref3386 .field0 ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( op_dash_add275 ( ( y3396 ) , ( dref3386 .field1 ) ) ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( op_dash_add275 ( ( dref3386 .field0 ) , ( ( tilemap3385 ) .f_width ) ) ) , ( op_dash_add275 ( ( y3396 ) , ( dref3386 .field1 ) ) ) ) ); } struct Zip_1007 temp1006 = into_dash_iter1008 ( ( ( zip1009 ) ( ( ( tilemap3385 ) .f_tiles ) , ( ( from279 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) ); while (true) { struct Maybe_1011 __cond1010 = next1013 (&temp1006); if ( __cond1010 .tag == 0 ) { break; } struct Tuple2_1012 dref3397 = __cond1010 .stuff .Maybe_1011_Just_s .field0; struct Zip_1015 temp1014 = into_dash_iter1016 ( ( ( zip1017 ) ( ( dref3397 .field0 ) , ( ( from279 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) ); while (true) { struct Maybe_1019 __cond1018 = next1021 (&temp1014); if ( __cond1018 .tag == 0 ) { break; } struct Tuple2_1020 dref3400 = __cond1018 .stuff .Maybe_1019_Just_s .field0; bool is_dash_cursor3403 = ( ( ( eq782 ( ( ( controls3392 ) .f_current_dash_control_dash_scheme ) , ( ControlScheme_416_KeyControls ) ) ) && ( eq504 ( ( dref3400 .field1 ) , ( ( controls3392 ) .f_cursor_dash_x ) ) ) ) && ( eq504 ( ( dref3397 .field1 ) , ( ( controls3392 ) .f_cursor_dash_y ) ) ) ); struct env1022 envinst1022 = { .is_dash_cursor3403 = is_dash_cursor3403 , .screen2998 = screen2998 , }; int32_t x3407 = ( op_dash_add275 ( ( dref3400 .field1 ) , ( dref3386 .field0 ) ) ); int32_t y3408 = ( op_dash_add275 ( ( dref3397 .field1 ) , ( dref3386 .field1 ) ) ); struct Color_544 bg3409 = ( ( eq504 ( ( ( mod1023 ) ( ( op_dash_add275 ( ( dref3400 .field1 ) , ( dref3397 .field1 ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) ) ) ? ( ( Color_544_Color8 ) ( ( Color8_545_White8 ) ) ) : ( ( Color_544_Color16 ) ( ( Color16_546_BrightWhite16 ) ) ) ); if ( ( ( dref3400 .field0 ) .f_hidden ) ) { struct envunion1025 temp1024 = ( (struct envunion1025){ .fun = ( enum Unit_4 (*) ( struct env1022* , struct Color_544 ) )set_dash_bg1026 , .env = envinst1022 } ); ( temp1024.fun ( &temp1024.env , ( bg3409 ) ) ); if ( ( ( dref3400 .field0 ) .f_flagged ) ) { ( ( set_dash_screen_dash_fg1027 ) ( ( screen2998 ) , ( ( Color_544_Color8 ) ( ( Color8_545_Red8 ) ) ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( "F" ) , ( 1 ) ) ) , ( x3407 ) , ( y3408 ) ) ); } else { ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( x3407 ) , ( y3408 ) ) ); } } else { ( ( set_dash_screen_dash_fg1027 ) ( ( screen2998 ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); struct envunion1029 temp1028 = ( (struct envunion1029){ .fun = ( enum Unit_4 (*) ( struct env1022* , struct Color_544 ) )set_dash_bg1026 , .env = envinst1022 } ); ( temp1028.fun ( &temp1028.env , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); int32_t num_dash_bombs3410 = ( ( count_dash_neighbor_dash_bombs789 ) ( ( tilemap3385 ) , ( dref3400 .field1 ) , ( dref3397 .field1 ) ) ); if ( ( eq504 ( ( num_dash_bombs3410 ) , ( from_dash_integral48 ( 0 ) ) ) ) ) { ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ) , ( x3407 ) , ( y3408 ) ) ); } else { struct Char_17 num_dash_bombs_dash_char3411 = ( ( or_dash_fail1030 ) ( ( ( head1033 ) ( ( ( chars1045 ) ( ( num_dash_bombs3410 ) ) ) ) ) , ( ( from_dash_string110 ) ( ( "impossible:)" ) , ( 12 ) ) ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( num_dash_bombs_dash_char3411 ) , ( x3407 ) , ( y3408 ) ) ); } } if ( ( ( eq780 ( ( game_dash_state3390 ) , ( GameState_329_Failed ) ) ) && ( ( dref3400 .field0 ) .f_is_dash_bomb ) ) ) { if ( ( ( dref3400 .field0 ) .f_hidden ) ) { ( ( set_dash_screen_dash_fg1027 ) ( ( screen2998 ) , ( ( Color_544_Color8 ) ( ( Color8_545_Red8 ) ) ) ) ); struct envunion1049 temp1048 = ( (struct envunion1049){ .fun = ( enum Unit_4 (*) ( struct env1022* , struct Color_544 ) )set_dash_bg1026 , .env = envinst1022 } ); ( temp1048.fun ( &temp1048.env , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( "o" ) , ( 1 ) ) ) , ( x3407 ) , ( y3408 ) ) ); } else { ( ( set_dash_screen_dash_fg1027 ) ( ( screen2998 ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); struct envunion1051 temp1050 = ( (struct envunion1051){ .fun = ( enum Unit_4 (*) ( struct env1022* , struct Color_544 ) )set_dash_bg1026 , .env = envinst1022 } ); ( temp1050.fun ( &temp1050.env , ( ( Color_544_Color8 ) ( ( Color8_545_Red8 ) ) ) ) ); ( ( put_dash_char999 ) ( ( screen2998 ) , ( ( from_dash_charlike111 ) ( ( "o" ) , ( 1 ) ) ) , ( x3407 ) , ( y3408 ) ) ); } } } } return ( Unit_4_Unit ); } static size_t reduce1054 ( struct StrViewIter_201 iterable1033 , size_t base1035 , size_t (* fun1037 )( struct Char_17 , size_t ) ) { size_t x1038 = ( base1035 ); struct StrViewIter_201 it1039 = ( ( into_dash_iter325 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_125 dref1040 = ( ( next209 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_125_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_125_Just_t ) { x1038 = ( ( fun1037 ) ( ( dref1040 .stuff .Maybe_125_Just_s .field0 ) , ( x1038 ) ) ); } } } size_t temp1055; return ( temp1055 ); } static size_t lam1056 ( struct Char_17 dref1045 , size_t x1047 ) { return ( op_dash_add77 ( ( x1047 ) , ( from_dash_integral0 ( 1 ) ) ) ); } static size_t count1053 ( struct StrViewIter_201 it1044 ) { return ( ( reduce1054 ) ( ( it1044 ) , ( from_dash_integral0 ( 0 ) ) , ( lam1056 ) ) ); } struct Zip_1059 { struct StrViewIter_201 f_left_dash_it; struct FromIter_269 f_right_dash_it; }; struct env1060 { ; ; int32_t y3353; struct Screen_541 * screen3347; int32_t x3356; }; struct envunion1061 { enum Unit_4 (*fun) ( struct env1060* , struct Tuple2_987 ); struct env1060 env; }; static struct Zip_1059 into_dash_iter1063 ( struct Zip_1059 self864 ) { return ( self864 ); } static struct Maybe_990 next1064 ( struct Zip_1059 * self867 ) { struct Zip_1059 copy868 = ( * ( self867 ) ); while ( ( true ) ) { struct Maybe_125 dref869 = ( ( next209 ) ( ( & ( ( copy868 ) .f_left_dash_it ) ) ) ); if ( dref869.tag == Maybe_125_None_t ) { return ( (struct Maybe_990) { .tag = Maybe_990_None_t } ); } else { if ( dref869.tag == Maybe_125_Just_t ) { struct Maybe_137 dref871 = ( ( next274 ) ( ( & ( ( copy868 ) .f_right_dash_it ) ) ) ); if ( dref871.tag == Maybe_137_None_t ) { return ( (struct Maybe_990) { .tag = Maybe_990_None_t } ); } else { if ( dref871.tag == Maybe_137_Just_t ) { ( ( next209 ) ( ( & ( ( * ( self867 ) ) .f_left_dash_it ) ) ) ); ( ( next274 ) ( ( & ( ( * ( self867 ) ) .f_right_dash_it ) ) ) ); return ( ( Maybe_990_Just ) ( ( ( Tuple2_987_Tuple2 ) ( ( dref869 .stuff .Maybe_125_Just_s .field0 ) , ( dref871 .stuff .Maybe_137_Just_s .field0 ) ) ) ) ); } } } } } } static enum Unit_4 for_dash_each1058 ( struct Zip_1059 iterable1014 , struct envunion1061 fun1016 ) { struct Zip_1059 temp1062 = ( ( into_dash_iter1063 ) ( ( iterable1014 ) ) ); struct Zip_1059 * it1017 = ( &temp1062 ); while ( ( true ) ) { struct Maybe_990 dref1018 = ( ( next1064 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_990_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_990_Just_t ) { struct envunion1061 temp1065 = ( fun1016 ); ( temp1065.fun ( &temp1065.env , ( dref1018 .stuff .Maybe_990_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct Zip_1059 zip1066 ( struct StrViewIter_201 left875 , struct FromIter_269 right877 ) { struct StrViewIter_201 left_dash_it878 = ( ( into_dash_iter325 ) ( ( left875 ) ) ); struct FromIter_269 right_dash_it879 = ( ( into_dash_iter278 ) ( ( right877 ) ) ); return ( (struct Zip_1059) { .f_left_dash_it = ( left_dash_it878 ) , .f_right_dash_it = ( right_dash_it879 ) } ); } static enum Unit_4 lam1067 ( struct env1060* env , struct Tuple2_987 dref3358 ) { ( ( put_dash_char999 ) ( ( env->screen3347 ) , ( dref3358 .field0 ) , ( op_dash_add275 ( ( env->x3356 ) , ( dref3358 .field1 ) ) ) , ( env->y3353 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 draw_dash_str1057 ( struct Screen_541 * screen3347 , struct StrView_25 s3349 , int32_t x3351 , int32_t y3353 ) { int32_t w3354 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3347 ) ) .f_tui ) ) .f_width ) ) ); if ( ( ( cmp367 ( ( y3353 ) , ( from_dash_integral48 ( 0 ) ) ) == 0 ) || ( cmp367 ( ( y3353 ) , ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3347 ) ) .f_tui ) ) .f_height ) ) ) ) != 0 ) ) ) { return ( Unit_4_Unit ); } int32_t i3355 = ( op_dash_add275 ( ( op_dash_mul865 ( ( y3353 ) , ( w3354 ) ) ) , ( x3351 ) ) ); int32_t x3356 = ( ( min953 ) ( ( x3351 ) , ( w3354 ) ) ); size_t max_dash_len3357 = ( ( i32_dash_size266 ) ( ( op_dash_sub735 ( ( w3354 ) , ( x3356 ) ) ) ) ); struct env1060 envinst1060 = { .y3353 = y3353 , .screen3347 = screen3347 , .x3356 = x3356 , }; ( ( for_dash_each1058 ) ( ( ( zip1066 ) ( ( ( chars217 ) ( ( s3349 ) ) ) , ( ( from279 ) ( ( from_dash_integral48 ( 0 ) ) ) ) ) ) , ( (struct envunion1061){ .fun = ( enum Unit_4 (*) ( struct env1060* , struct Tuple2_987 ) )lam1067 , .env = envinst1060 } ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 draw_dash_str_dash_center1052 ( struct Screen_541 * screen3375 , struct StrView_25 s3377 , int32_t x3379 , int32_t y3381 ) { int32_t slen3382 = ( ( size_dash_i3293 ) ( ( ( count1053 ) ( ( ( chars217 ) ( ( s3377 ) ) ) ) ) ) ); int32_t x3383 = ( op_dash_sub735 ( ( x3379 ) , ( op_dash_div417 ( ( slen3382 ) , ( from_dash_integral48 ( 2 ) ) ) ) ) ); ( ( draw_dash_str1057 ) ( ( screen3375 ) , ( s3377 ) , ( x3383 ) , ( y3381 ) ) ); return ( Unit_4_Unit ); } struct RenderState_1069 { uint32_t f_x; uint32_t f_y; struct Color_544 f_fg; struct Color_544 f_bg; uint32_t f_changes; }; struct StrConcat_1075 { struct StrConcat_981 field0; struct Char_17 field1; }; static struct StrConcat_1075 StrConcat_1075_StrConcat ( struct StrConcat_981 field0 , struct Char_17 field1 ) { return ( struct StrConcat_1075 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1074 { struct StrConcat_1075 field0; uint32_t field1; }; static struct StrConcat_1074 StrConcat_1074_StrConcat ( struct StrConcat_1075 field0 , uint32_t field1 ) { return ( struct StrConcat_1074 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1073 { struct StrConcat_1074 field0; struct Char_17 field1; }; static struct StrConcat_1073 StrConcat_1073_StrConcat ( struct StrConcat_1074 field0 , struct Char_17 field1 ) { return ( struct StrConcat_1073 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcatIter_1079 { struct StrConcatIter_984 f_left; struct AppendIter_721 f_right; }; struct StrConcatIter_1078 { struct StrConcatIter_1079 f_left; struct IntStrIter_912 f_right; }; struct StrConcatIter_1077 { struct StrConcatIter_1078 f_left; struct AppendIter_721 f_right; }; static struct StrConcatIter_1077 into_dash_iter1081 ( struct StrConcatIter_1077 self1406 ) { return ( self1406 ); } static struct Maybe_125 next1084 ( struct StrConcatIter_1079 * self1409 ) { struct Maybe_125 dref1410 = ( ( next992 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1083 ( struct StrConcatIter_1078 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1084 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next919 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1082 ( struct StrConcatIter_1077 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1083 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each1076 ( struct StrConcatIter_1077 iterable1014 , enum Unit_4 (* fun1016 )( struct Char_17 ) ) { struct StrConcatIter_1077 temp1080 = ( ( into_dash_iter1081 ) ( ( iterable1014 ) ) ); struct StrConcatIter_1077 * it1017 = ( &temp1080 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next1082 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { ( ( fun1016 ) ( ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrConcatIter_1079 into_dash_iter1090 ( struct StrConcat_1075 dref1413 ) { return ( (struct StrConcatIter_1079) { .f_left = ( ( chars996 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1079 chars1089 ( struct StrConcat_1075 self1424 ) { return ( ( into_dash_iter1090 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1078 into_dash_iter1088 ( struct StrConcat_1074 dref1413 ) { return ( (struct StrConcatIter_1078) { .f_left = ( ( chars1089 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars915 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1078 chars1087 ( struct StrConcat_1074 self1424 ) { return ( ( into_dash_iter1088 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1077 into_dash_iter1086 ( struct StrConcat_1073 dref1413 ) { return ( (struct StrConcatIter_1077) { .f_left = ( ( chars1087 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1077 chars1085 ( struct StrConcat_1073 self1424 ) { return ( ( into_dash_iter1086 ) ( ( self1424 ) ) ); } static enum Unit_4 print1072 ( struct StrConcat_1073 s2357 ) { ( ( for_dash_each1076 ) ( ( ( chars1085 ) ( ( s2357 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 move_dash_cursor_dash_to1071 ( uint32_t x2368 , uint32_t y2370 ) { uint32_t x2371 = ( op_dash_add394 ( ( x2368 ) , ( from_dash_integral106 ( 1 ) ) ) ); uint32_t y2372 = ( op_dash_add394 ( ( y2370 ) , ( from_dash_integral106 ( 1 ) ) ) ); ( ( print1072 ) ( ( ( StrConcat_1073_StrConcat ) ( ( ( StrConcat_1074_StrConcat ) ( ( ( StrConcat_1075_StrConcat ) ( ( ( StrConcat_981_StrConcat ) ( ( ( from_dash_string110 ) ( ( "\x1b[" ) , ( 2 ) ) ) , ( y2372 ) ) ) , ( ( from_dash_charlike111 ) ( ( ";" ) , ( 1 ) ) ) ) ) , ( x2371 ) ) ) , ( ( from_dash_charlike111 ) ( ( "H" ) , ( 1 ) ) ) ) ) ) ); return ( Unit_4_Unit ); } struct Tuple2_1098 { struct Color_544 field0; struct Color_544 field1; }; static struct Tuple2_1098 Tuple2_1098_Tuple2 ( struct Color_544 field0 , struct Color_544 field1 ) { return ( struct Tuple2_1098 ) { .field0 = field0 , .field1 = field1 }; }; static enum Color8_545 * cast1102 ( int32_t * x346 ) { return ( (enum Color8_545 * ) ( x346 ) ); } static int32_t cast_dash_on_dash_zeroed1100 ( enum Color8_545 x552 ) { int32_t temp1101 = ( ( zeroed144 ) ( ) ); int32_t * y553 = ( &temp1101 ); enum Color8_545 * yp554 = ( ( cast1102 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static bool eq1099 ( enum Color8_545 l2396 , enum Color8_545 r2398 ) { return ( eq504 ( ( ( ( cast_dash_on_dash_zeroed1100 ) ( ( l2396 ) ) ) ) , ( ( cast_dash_on_dash_zeroed1100 ) ( ( r2398 ) ) ) ) ); } static enum Color16_546 * cast1106 ( int32_t * x346 ) { return ( (enum Color16_546 * ) ( x346 ) ); } static int32_t cast_dash_on_dash_zeroed1104 ( enum Color16_546 x552 ) { int32_t temp1105 = ( ( zeroed144 ) ( ) ); int32_t * y553 = ( &temp1105 ); enum Color16_546 * yp554 = ( ( cast1106 ) ( ( y553 ) ) ); (* yp554 ) = ( x552 ); return ( * ( y553 ) ); } static bool eq1103 ( enum Color16_546 l2402 , enum Color16_546 r2404 ) { return ( eq504 ( ( ( ( cast_dash_on_dash_zeroed1104 ) ( ( l2402 ) ) ) ) , ( ( cast_dash_on_dash_zeroed1104 ) ( ( r2404 ) ) ) ) ); } static bool eq1107 ( struct RGB_547 l2432 , struct RGB_547 r2434 ) { return ( ( ( eq98 ( ( ( l2432 ) .f_r ) , ( ( r2434 ) .f_r ) ) ) && ( eq98 ( ( ( l2432 ) .f_g ) , ( ( r2434 ) .f_g ) ) ) ) && ( eq98 ( ( ( l2432 ) .f_b ) , ( ( r2434 ) .f_b ) ) ) ); } static bool eq1097 ( struct Color_544 l2455 , struct Color_544 r2457 ) { return ( { struct Tuple2_1098 dref2458 = ( ( Tuple2_1098_Tuple2 ) ( ( l2455 ) , ( r2457 ) ) ) ; dref2458 .field0.tag == Color_544_ColorDefault_t && dref2458 .field1.tag == Color_544_ColorDefault_t ? ( true ) : dref2458 .field0.tag == Color_544_Color8_t && dref2458 .field1.tag == Color_544_Color8_t ? ( eq1099 ( ( dref2458 .field0 .stuff .Color_544_Color8_s .field0 ) , ( dref2458 .field1 .stuff .Color_544_Color8_s .field0 ) ) ) : dref2458 .field0.tag == Color_544_Color16_t && dref2458 .field1.tag == Color_544_Color16_t ? ( eq1103 ( ( dref2458 .field0 .stuff .Color_544_Color16_s .field0 ) , ( dref2458 .field1 .stuff .Color_544_Color16_s .field0 ) ) ) : dref2458 .field0.tag == Color_544_Color256_t && dref2458 .field1.tag == Color_544_Color256_t ? ( eq98 ( ( dref2458 .field0 .stuff .Color_544_Color256_s .field0 ) , ( dref2458 .field1 .stuff .Color_544_Color256_s .field0 ) ) ) : dref2458 .field0.tag == Color_544_ColorRGB_t && dref2458 .field1.tag == Color_544_ColorRGB_t ? ( eq1107 ( ( dref2458 .field0 .stuff .Color_544_ColorRGB_s .field0 ) , ( dref2458 .field1 .stuff .Color_544_ColorRGB_s .field0 ) ) ) : ( false ) ; } ); } static bool eq1096 ( struct Cell_543 l3235 , struct Cell_543 r3237 ) { if ( ( ! eq830 ( ( ( l3235 ) .f_c ) , ( ( r3237 ) .f_c ) ) ) ) { return ( false ); } if ( ( ! eq1097 ( ( ( l3235 ) .f_fg ) , ( ( r3237 ) .f_fg ) ) ) ) { return ( false ); } if ( ( ! eq1097 ( ( ( l3235 ) .f_bg ) , ( ( r3237 ) .f_bg ) ) ) ) { return ( false ); } return ( true ); } static bool eq1095 ( struct Cell_543 * dref143 , struct Cell_543 * dref145 ) { return ( eq1096 ( ( (* dref143 ) ) , ( (* dref145 ) ) ) ); } static enum Unit_4 set_dash_default_dash_fg1110 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[39m" ) , ( 5 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_fg81111 ( enum Color8_545 color2407 ) { enum Color8_545 dref2408 = ( color2407 ); switch ( dref2408 ) { case Color8_545_Black8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[30m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Red8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[31m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Green8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[32m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Yellow8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[33m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Blue8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[34m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Magenta8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[35m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Cyan8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[36m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_White8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[37m" ) , ( 5 ) ) ) ) ); break; } } return ( Unit_4_Unit ); } static enum Unit_4 set_dash_fg161112 ( enum Color16_546 color2411 ) { enum Color16_546 dref2412 = ( color2411 ); switch ( dref2412 ) { case Color16_546_Black16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[30m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Red16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[31m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Green16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[32m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Yellow16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[33m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Blue16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[34m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Magenta16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[35m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Cyan16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[36m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_White16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[37m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightBlack16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[90m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightRed16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[91m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightGreen16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[92m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightYellow16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[93m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightBlue16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[94m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightMagenta16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[95m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightCyan16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[96m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightWhite16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[97m" ) , ( 5 ) ) ) ) ); break; } } return ( Unit_4_Unit ); } struct StrConcat_1116 { struct StrView_25 field0; uint8_t field1; }; static struct StrConcat_1116 StrConcat_1116_StrConcat ( struct StrView_25 field0 , uint8_t field1 ) { return ( struct StrConcat_1116 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1115 { struct StrConcat_1116 field0; struct Char_17 field1; }; static struct StrConcat_1115 StrConcat_1115_StrConcat ( struct StrConcat_1116 field0 , struct Char_17 field1 ) { return ( struct StrConcat_1115 ) { .field0 = field0 , .field1 = field1 }; }; struct IntStrIter_1120 { uint8_t f_int; int32_t f_len; bool f_negative; }; struct StrConcatIter_1119 { struct StrViewIter_201 f_left; struct IntStrIter_1120 f_right; }; struct StrConcatIter_1118 { struct StrConcatIter_1119 f_left; struct AppendIter_721 f_right; }; static struct StrConcatIter_1118 into_dash_iter1122 ( struct StrConcatIter_1118 self1406 ) { return ( self1406 ); } struct env1128 { uint8_t base1150; ; }; struct envunion1129 { uint8_t (*fun) ( struct env1128* , int32_t , uint8_t ); struct env1128 env; }; static uint8_t reduce1127 ( struct Range_360 iterable1033 , uint8_t base1035 , struct envunion1129 fun1037 ) { uint8_t x1038 = ( base1035 ); struct RangeIter_363 it1039 = ( ( into_dash_iter365 ) ( ( iterable1033 ) ) ); while ( ( true ) ) { struct Maybe_137 dref1040 = ( ( next366 ) ( ( & ( it1039 ) ) ) ); if ( dref1040.tag == Maybe_137_None_t ) { return ( x1038 ); } else { if ( dref1040.tag == Maybe_137_Just_t ) { struct envunion1129 temp1130 = ( fun1037 ); x1038 = ( temp1130.fun ( &temp1130.env , ( dref1040 .stuff .Maybe_137_Just_s .field0 ) , ( x1038 ) ) ); } } } uint8_t temp1131; return ( temp1131 ); } static uint8_t op_dash_mul1133 ( uint8_t l255 , uint8_t r257 ) { return ( ( l255 ) * ( r257 ) ); } static uint8_t lam1132 ( struct env1128* env , int32_t item1154 , uint8_t x1156 ) { return ( op_dash_mul1133 ( ( x1156 ) , ( env->base1150 ) ) ); } static uint8_t pow1126 ( uint8_t base1150 , int32_t p1152 ) { struct env1128 envinst1128 = { .base1150 = base1150 , }; return ( ( reduce1127 ) ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( p1152 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) , ( from_dash_integral102 ( 1 ) ) , ( (struct envunion1129){ .fun = ( uint8_t (*) ( struct env1128* , int32_t , uint8_t ) )lam1132 , .env = envinst1128 } ) ) ); } static uint8_t op_dash_div1134 ( uint8_t l260 , uint8_t r262 ) { return ( ( l260 ) / ( r262 ) ); } static uint8_t cast1135 ( uint8_t x346 ) { return ( (uint8_t ) ( x346 ) ); } static struct Maybe_125 next1125 ( struct IntStrIter_1120 * self1337 ) { if ( ( ( * ( self1337 ) ) .f_negative ) ) { (* self1337 ) .f_negative = ( false ); return ( ( Maybe_125_Just ) ( ( ( from_dash_charlike111 ) ( ( "-" ) , ( 1 ) ) ) ) ); } if ( ( cmp367 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 0 ) ) ) != 2 ) ) { return ( (struct Maybe_125) { .tag = Maybe_125_None_t } ); } uint8_t trim_dash_down1338 = ( ( pow1126 ) ( ( from_dash_integral102 ( 10 ) ) , ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); uint8_t upper1339 = ( op_dash_div1134 ( ( ( * ( self1337 ) ) .f_int ) , ( trim_dash_down1338 ) ) ); uint8_t upper_dash_mask1340 = ( op_dash_mul1133 ( ( op_dash_div1134 ( ( upper1339 ) , ( from_dash_integral102 ( 10 ) ) ) ) , ( from_dash_integral102 ( 10 ) ) ) ); uint8_t digit1341 = ( ( ( cast1135 ) ( ( op_dash_sub149 ( ( upper1339 ) , ( upper_dash_mask1340 ) ) ) ) ) ); (* self1337 ) .f_len = ( op_dash_sub735 ( ( ( * ( self1337 ) ) .f_len ) , ( from_dash_integral48 ( 1 ) ) ) ); struct Char_17 digit_dash_char1342 = ( ( from_dash_u8740 ) ( ( op_dash_add116 ( ( digit1341 ) , ( from_dash_integral102 ( 48 ) ) ) ) ) ); return ( ( Maybe_125_Just ) ( ( digit_dash_char1342 ) ) ); } static struct Maybe_125 next1124 ( struct StrConcatIter_1119 * self1409 ) { struct Maybe_125 dref1410 = ( ( next209 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next1125 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1123 ( struct StrConcatIter_1118 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1124 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each1117 ( struct StrConcatIter_1118 iterable1014 , enum Unit_4 (* fun1016 )( struct Char_17 ) ) { struct StrConcatIter_1118 temp1121 = ( ( into_dash_iter1122 ) ( ( iterable1014 ) ) ); struct StrConcatIter_1118 * it1017 = ( &temp1121 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next1123 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { ( ( fun1016 ) ( ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static int32_t count_dash_digits1142 ( uint8_t self1345 ) { if ( ( eq98 ( ( self1345 ) , ( from_dash_integral102 ( 0 ) ) ) ) ) { return ( from_dash_integral48 ( 1 ) ); } int32_t digits1346 = ( from_dash_integral48 ( 0 ) ); while ( ( cmp115 ( ( self1345 ) , ( from_dash_integral102 ( 0 ) ) ) == 2 ) ) { self1345 = ( op_dash_div1134 ( ( self1345 ) , ( from_dash_integral102 ( 10 ) ) ) ); digits1346 = ( op_dash_add275 ( ( digits1346 ) , ( from_dash_integral48 ( 1 ) ) ) ); } return ( digits1346 ); } static struct IntStrIter_1120 uint_dash_iter1141 ( uint8_t int1352 ) { return ( (struct IntStrIter_1120) { .f_int = ( int1352 ) , .f_len = ( ( count_dash_digits1142 ) ( ( int1352 ) ) ) , .f_negative = ( false ) } ); } static struct IntStrIter_1120 chars1140 ( uint8_t self1370 ) { return ( ( uint_dash_iter1141 ) ( ( self1370 ) ) ); } static struct StrConcatIter_1119 into_dash_iter1139 ( struct StrConcat_1116 dref1413 ) { return ( (struct StrConcatIter_1119) { .f_left = ( ( chars217 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars1140 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1119 chars1138 ( struct StrConcat_1116 self1424 ) { return ( ( into_dash_iter1139 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1118 into_dash_iter1137 ( struct StrConcat_1115 dref1413 ) { return ( (struct StrConcatIter_1118) { .f_left = ( ( chars1138 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1118 chars1136 ( struct StrConcat_1115 self1424 ) { return ( ( into_dash_iter1137 ) ( ( self1424 ) ) ); } static enum Unit_4 print1114 ( struct StrConcat_1115 s2357 ) { ( ( for_dash_each1117 ) ( ( ( chars1136 ) ( ( s2357 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_fg2561113 ( uint8_t color2425 ) { ( ( print1114 ) ( ( ( StrConcat_1115_StrConcat ) ( ( ( StrConcat_1116_StrConcat ) ( ( ( from_dash_string110 ) ( ( "\x1b[38;5;" ) , ( 7 ) ) ) , ( color2425 ) ) ) , ( ( from_dash_charlike111 ) ( ( "m" ) , ( 1 ) ) ) ) ) ) ); return ( Unit_4_Unit ); } struct StrConcat_1148 { struct StrConcat_1115 field0; uint8_t field1; }; static struct StrConcat_1148 StrConcat_1148_StrConcat ( struct StrConcat_1115 field0 , uint8_t field1 ) { return ( struct StrConcat_1148 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1147 { struct StrConcat_1148 field0; struct Char_17 field1; }; static struct StrConcat_1147 StrConcat_1147_StrConcat ( struct StrConcat_1148 field0 , struct Char_17 field1 ) { return ( struct StrConcat_1147 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1146 { struct StrConcat_1147 field0; uint8_t field1; }; static struct StrConcat_1146 StrConcat_1146_StrConcat ( struct StrConcat_1147 field0 , uint8_t field1 ) { return ( struct StrConcat_1146 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcat_1145 { struct StrConcat_1146 field0; struct Char_17 field1; }; static struct StrConcat_1145 StrConcat_1145_StrConcat ( struct StrConcat_1146 field0 , struct Char_17 field1 ) { return ( struct StrConcat_1145 ) { .field0 = field0 , .field1 = field1 }; }; struct StrConcatIter_1153 { struct StrConcatIter_1118 f_left; struct IntStrIter_1120 f_right; }; struct StrConcatIter_1152 { struct StrConcatIter_1153 f_left; struct AppendIter_721 f_right; }; struct StrConcatIter_1151 { struct StrConcatIter_1152 f_left; struct IntStrIter_1120 f_right; }; struct StrConcatIter_1150 { struct StrConcatIter_1151 f_left; struct AppendIter_721 f_right; }; static struct StrConcatIter_1150 into_dash_iter1155 ( struct StrConcatIter_1150 self1406 ) { return ( self1406 ); } static struct Maybe_125 next1159 ( struct StrConcatIter_1153 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1123 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next1125 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1158 ( struct StrConcatIter_1152 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1159 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1157 ( struct StrConcatIter_1151 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1158 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next1125 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static struct Maybe_125 next1156 ( struct StrConcatIter_1150 * self1409 ) { struct Maybe_125 dref1410 = ( ( next1157 ) ( ( & ( ( * ( self1409 ) ) .f_left ) ) ) ); if ( dref1410.tag == Maybe_125_Just_t ) { return ( ( Maybe_125_Just ) ( ( dref1410 .stuff .Maybe_125_Just_s .field0 ) ) ); } else { if ( dref1410.tag == Maybe_125_None_t ) { return ( ( next747 ) ( ( & ( ( * ( self1409 ) ) .f_right ) ) ) ); } } } static enum Unit_4 for_dash_each1149 ( struct StrConcatIter_1150 iterable1014 , enum Unit_4 (* fun1016 )( struct Char_17 ) ) { struct StrConcatIter_1150 temp1154 = ( ( into_dash_iter1155 ) ( ( iterable1014 ) ) ); struct StrConcatIter_1150 * it1017 = ( &temp1154 ); while ( ( true ) ) { struct Maybe_125 dref1018 = ( ( next1156 ) ( ( it1017 ) ) ); if ( dref1018.tag == Maybe_125_None_t ) { return ( Unit_4_Unit ); } else { if ( dref1018.tag == Maybe_125_Just_t ) { ( ( fun1016 ) ( ( dref1018 .stuff .Maybe_125_Just_s .field0 ) ) ); } } } return ( Unit_4_Unit ); } static struct StrConcatIter_1153 into_dash_iter1167 ( struct StrConcat_1148 dref1413 ) { return ( (struct StrConcatIter_1153) { .f_left = ( ( chars1136 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars1140 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1153 chars1166 ( struct StrConcat_1148 self1424 ) { return ( ( into_dash_iter1167 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1152 into_dash_iter1165 ( struct StrConcat_1147 dref1413 ) { return ( (struct StrConcatIter_1152) { .f_left = ( ( chars1166 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1152 chars1164 ( struct StrConcat_1147 self1424 ) { return ( ( into_dash_iter1165 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1151 into_dash_iter1163 ( struct StrConcat_1146 dref1413 ) { return ( (struct StrConcatIter_1151) { .f_left = ( ( chars1164 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars1140 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1151 chars1162 ( struct StrConcat_1146 self1424 ) { return ( ( into_dash_iter1163 ) ( ( self1424 ) ) ); } static struct StrConcatIter_1150 into_dash_iter1161 ( struct StrConcat_1145 dref1413 ) { return ( (struct StrConcatIter_1150) { .f_left = ( ( chars1162 ) ( ( dref1413 .field0 ) ) ) , .f_right = ( ( chars761 ) ( ( dref1413 .field1 ) ) ) } ); } static struct StrConcatIter_1150 chars1160 ( struct StrConcat_1145 self1424 ) { return ( ( into_dash_iter1161 ) ( ( self1424 ) ) ); } static enum Unit_4 print1144 ( struct StrConcat_1145 s2357 ) { ( ( for_dash_each1149 ) ( ( ( chars1160 ) ( ( s2357 ) ) ) , ( printf_dash_char95 ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_fg_dash_rgb1143 ( struct RGB_547 c2448 ) { ( ( print1144 ) ( ( ( StrConcat_1145_StrConcat ) ( ( ( StrConcat_1146_StrConcat ) ( ( ( StrConcat_1147_StrConcat ) ( ( ( StrConcat_1148_StrConcat ) ( ( ( StrConcat_1115_StrConcat ) ( ( ( StrConcat_1116_StrConcat ) ( ( ( from_dash_string110 ) ( ( "\x1b[38;2;" ) , ( 7 ) ) ) , ( ( c2448 ) .f_r ) ) ) , ( ( from_dash_charlike111 ) ( ( ";" ) , ( 1 ) ) ) ) ) , ( ( c2448 ) .f_g ) ) ) , ( ( from_dash_charlike111 ) ( ( ";" ) , ( 1 ) ) ) ) ) , ( ( c2448 ) .f_b ) ) ) , ( ( from_dash_charlike111 ) ( ( "m" ) , ( 1 ) ) ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_fg1109 ( struct Color_544 c2469 ) { struct Color_544 dref2470 = ( c2469 ); if ( dref2470.tag == Color_544_ColorDefault_t ) { ( ( set_dash_default_dash_fg1110 ) ( ) ); } else { if ( dref2470.tag == Color_544_Color8_t ) { ( ( set_dash_fg81111 ) ( ( dref2470 .stuff .Color_544_Color8_s .field0 ) ) ); } else { if ( dref2470.tag == Color_544_Color16_t ) { ( ( set_dash_fg161112 ) ( ( dref2470 .stuff .Color_544_Color16_s .field0 ) ) ); } else { if ( dref2470.tag == Color_544_Color256_t ) { ( ( set_dash_fg2561113 ) ( ( dref2470 .stuff .Color_544_Color256_s .field0 ) ) ); } else { if ( dref2470.tag == Color_544_ColorRGB_t ) { ( ( set_dash_fg_dash_rgb1143 ) ( ( dref2470 .stuff .Color_544_ColorRGB_s .field0 ) ) ); } } } } } return ( Unit_4_Unit ); } static enum Unit_4 set_dash_default_dash_bg1169 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[49m" ) , ( 5 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_bg81170 ( enum Color8_545 color2415 ) { enum Color8_545 dref2416 = ( color2415 ); switch ( dref2416 ) { case Color8_545_Black8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[40m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Red8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[41m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Green8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[42m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Yellow8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[43m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Blue8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[44m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Magenta8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[45m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_Cyan8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[46m" ) , ( 5 ) ) ) ) ); break; } case Color8_545_White8 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[47m" ) , ( 5 ) ) ) ) ); break; } } return ( Unit_4_Unit ); } static enum Unit_4 set_dash_bg161171 ( enum Color16_546 color2419 ) { enum Color16_546 dref2420 = ( color2419 ); switch ( dref2420 ) { case Color16_546_Black16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[40m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Red16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[41m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Green16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[42m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Yellow16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[43m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Blue16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[44m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Magenta16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[45m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_Cyan16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[46m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_White16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[47m" ) , ( 5 ) ) ) ) ); break; } case Color16_546_BrightBlack16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[100m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightRed16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[101m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightGreen16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[102m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightYellow16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[103m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightBlue16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[104m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightMagenta16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[105m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightCyan16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[106m" ) , ( 6 ) ) ) ) ); break; } case Color16_546_BrightWhite16 : { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[107m" ) , ( 6 ) ) ) ) ); break; } } return ( Unit_4_Unit ); } static enum Unit_4 set_dash_bg2561172 ( uint8_t color2428 ) { ( ( print1114 ) ( ( ( StrConcat_1115_StrConcat ) ( ( ( StrConcat_1116_StrConcat ) ( ( ( from_dash_string110 ) ( ( "\x1b[48;5;" ) , ( 7 ) ) ) , ( color2428 ) ) ) , ( ( from_dash_charlike111 ) ( ( "m" ) , ( 1 ) ) ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_bg_dash_rgb1173 ( struct RGB_547 c2451 ) { ( ( print1144 ) ( ( ( StrConcat_1145_StrConcat ) ( ( ( StrConcat_1146_StrConcat ) ( ( ( StrConcat_1147_StrConcat ) ( ( ( StrConcat_1148_StrConcat ) ( ( ( StrConcat_1115_StrConcat ) ( ( ( StrConcat_1116_StrConcat ) ( ( ( from_dash_string110 ) ( ( "\x1b[48;2;" ) , ( 7 ) ) ) , ( ( c2451 ) .f_r ) ) ) , ( ( from_dash_charlike111 ) ( ( ";" ) , ( 1 ) ) ) ) ) , ( ( c2451 ) .f_g ) ) ) , ( ( from_dash_charlike111 ) ( ( ";" ) , ( 1 ) ) ) ) ) , ( ( c2451 ) .f_b ) ) ) , ( ( from_dash_charlike111 ) ( ( "m" ) , ( 1 ) ) ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 set_dash_bg1168 ( struct Color_544 c2477 ) { struct Color_544 dref2478 = ( c2477 ); if ( dref2478.tag == Color_544_ColorDefault_t ) { ( ( set_dash_default_dash_bg1169 ) ( ) ); } else { if ( dref2478.tag == Color_544_Color8_t ) { ( ( set_dash_bg81170 ) ( ( dref2478 .stuff .Color_544_Color8_s .field0 ) ) ); } else { if ( dref2478.tag == Color_544_Color16_t ) { ( ( set_dash_bg161171 ) ( ( dref2478 .stuff .Color_544_Color16_s .field0 ) ) ); } else { if ( dref2478.tag == Color_544_Color256_t ) { ( ( set_dash_bg2561172 ) ( ( dref2478 .stuff .Color_544_Color256_s .field0 ) ) ); } else { if ( dref2478.tag == Color_544_ColorRGB_t ) { ( ( set_dash_bg_dash_rgb1173 ) ( ( dref2478 .stuff .Color_544_ColorRGB_s .field0 ) ) ); } } } } } return ( Unit_4_Unit ); } static enum Unit_4 emit_dash_cell1108 ( struct RenderState_1069 * rs3263 , struct Cell_543 * c3265 , uint32_t x3267 , uint32_t y3269 ) { if ( ( ( ! eq832 ( ( x3267 ) , ( ( * ( rs3263 ) ) .f_x ) ) ) || ( ! eq832 ( ( y3269 ) , ( ( * ( rs3263 ) ) .f_y ) ) ) ) ) { ( ( move_dash_cursor_dash_to1071 ) ( ( x3267 ) , ( y3269 ) ) ); (* rs3263 ) .f_x = ( x3267 ); (* rs3263 ) .f_y = ( y3269 ); } struct Char_17 char3270 = ( ( * ( c3265 ) ) .f_c ); struct Color_544 bg3271 = ( ( * ( c3265 ) ) .f_bg ); if ( ( ( ( eq830 ( ( char3270 ) , ( ( from_dash_charlike111 ) ( ( "\t" ) , ( 1 ) ) ) ) ) || ( eq830 ( ( char3270 ) , ( ( from_dash_charlike111 ) ( ( "\r" ) , ( 1 ) ) ) ) ) ) || ( eq830 ( ( char3270 ) , ( ( from_dash_charlike111 ) ( ( "\n" ) , ( 1 ) ) ) ) ) ) ) { char3270 = ( ( from_dash_charlike111 ) ( ( " " ) , ( 1 ) ) ); bg3271 = ( ( Color_544_Color8 ) ( ( Color8_545_Red8 ) ) ); } if ( ( ! eq1097 ( ( ( * ( rs3263 ) ) .f_fg ) , ( ( * ( c3265 ) ) .f_fg ) ) ) ) { ( ( set_dash_fg1109 ) ( ( ( * ( c3265 ) ) .f_fg ) ) ); (* rs3263 ) .f_fg = ( ( * ( c3265 ) ) .f_fg ); } if ( ( ! eq1097 ( ( ( * ( rs3263 ) ) .f_bg ) , ( bg3271 ) ) ) ) { ( ( set_dash_bg1168 ) ( ( bg3271 ) ) ); (* rs3263 ) .f_bg = ( bg3271 ); } ( ( print_dash_str94 ) ( ( char3270 ) ) ); (* rs3263 ) .f_x = ( op_dash_add394 ( ( ( * ( rs3263 ) ) .f_x ) , ( from_dash_integral106 ( 1 ) ) ) ); return ( Unit_4_Unit ); } static uint32_t i32_dash_u321174 ( int32_t x579 ) { return ( (uint32_t ) ( x579 ) ); } static uint32_t render_dash_screen1068 ( struct Screen_541 * screen3274 ) { int32_t w3275 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3274 ) ) .f_tui ) ) .f_width ) ) ); int32_t h3276 = ( ( u32_dash_i32388 ) ( ( ( * ( ( * ( screen3274 ) ) .f_tui ) ) .f_height ) ) ); struct RenderState_1069 temp1070 = ( (struct RenderState_1069) { .f_x = ( from_dash_integral106 ( 0 ) ) , .f_y = ( from_dash_integral106 ( 0 ) ) , .f_fg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_bg = ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , .f_changes = ( from_dash_integral106 ( 0 ) ) } ); struct RenderState_1069 * rs3277 = ( &temp1070 ); ( ( move_dash_cursor_dash_to1071 ) ( ( from_dash_integral106 ( 0 ) ) , ( from_dash_integral106 ( 0 ) ) ) ); struct RangeIter_363 temp1091 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( h3276 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond1092 = next366 (&temp1091); if ( __cond1092 .tag == 0 ) { break; } int32_t y3279 = __cond1092 .stuff .Maybe_137_Just_s .field0; struct RangeIter_363 temp1093 = into_dash_iter365 ( ( ( to369 ) ( ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( w3275 ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ); while (true) { struct Maybe_137 __cond1094 = next366 (&temp1093); if ( __cond1094 .tag == 0 ) { break; } int32_t x3281 = __cond1094 .stuff .Maybe_137_Just_s .field0; size_t i3282 = ( ( i32_dash_size266 ) ( ( op_dash_add275 ( ( op_dash_mul865 ( ( y3279 ) , ( w3275 ) ) ) , ( x3281 ) ) ) ) ); struct Cell_543 * cur3283 = ( ( get_dash_ptr571 ) ( ( ( * ( screen3274 ) ) .f_current ) , ( i3282 ) ) ); struct Cell_543 * prev3284 = ( ( get_dash_ptr571 ) ( ( ( * ( screen3274 ) ) .f_previous ) , ( i3282 ) ) ); if ( ( ( ! eq1095 ( ( cur3283 ) , ( prev3284 ) ) ) || ( ( * ( screen3274 ) ) .f_requires_dash_full_dash_redraw ) ) ) { (* rs3277 ) .f_changes = ( op_dash_add394 ( ( ( * ( rs3277 ) ) .f_changes ) , ( from_dash_integral106 ( 1 ) ) ) ); ( ( emit_dash_cell1108 ) ( ( rs3277 ) , ( cur3283 ) , ( ( i32_dash_u321174 ) ( ( x3281 ) ) ) , ( ( i32_dash_u321174 ) ( ( y3279 ) ) ) ) ); (* prev3284 ) = ( * ( cur3283 ) ); } } } (* screen3274 ) .f_requires_dash_full_dash_redraw = ( false ); ( ( reset_dash_colors498 ) ( ) ); ( ( flush_dash_stdout501 ) ( ) ); return ( ( * ( rs3277 ) ) .f_changes ); } static void * cast_dash_ptr1181 ( struct timespec * * p349 ) { return ( (void * ) ( p349 ) ); } static size_t size_dash_of1182 ( struct timespec * x340 ) { return ( sizeof( ( x340 ) ) ); } static struct timespec * zeroed1179 ( ) { struct timespec * temp1180; struct timespec * x549 = ( temp1180 ); ( ( memset ) ( ( ( cast_dash_ptr1181 ) ( ( & ( x549 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( ( size_dash_of1182 ) ( ( x549 ) ) ) ) ); return ( x549 ); } static struct timespec * null_dash_ptr1178 ( ) { return ( ( zeroed1179 ) ( ) ); } static enum Unit_4 sync1175 ( struct Tui_55 * tui3150 ) { if ( ( eq832 ( ( ( * ( tui3150 ) ) .f_target_dash_fps ) , ( from_dash_integral106 ( 0 ) ) ) ) ) { return ( Unit_4_Unit ); } int64_t frame_dash_ns3151 = ( op_dash_div737 ( ( from_dash_integral71 ( 1000000000 ) ) , ( ( size_dash_i6479 ) ( ( ( u32_dash_size555 ) ( ( ( * ( tui3150 ) ) .f_target_dash_fps ) ) ) ) ) ) ); struct timespec temp1176 = ( ( undefined529 ) ( ) ); struct timespec * now3152 = ( &temp1176 ); ( ( clock_gettime ) ( ( ( clock_dash_monotonic531 ) ( ) ) , ( now3152 ) ) ); int64_t elapsed_dash_ns3153 = ( op_dash_add150 ( ( op_dash_mul69 ( ( op_dash_sub739 ( ( ( * ( now3152 ) ) .tv_sec ) , ( ( ( * ( tui3150 ) ) .f_last_dash_sync ) .tv_sec ) ) ) , ( from_dash_integral71 ( 1000000000 ) ) ) ) , ( op_dash_sub739 ( ( ( * ( now3152 ) ) .tv_nsec ) , ( ( ( * ( tui3150 ) ) .f_last_dash_sync ) .tv_nsec ) ) ) ) ); int64_t sleep_dash_ns3154 = ( op_dash_sub739 ( ( frame_dash_ns3151 ) , ( elapsed_dash_ns3153 ) ) ); if ( ( cmp757 ( ( sleep_dash_ns3154 ) , ( from_dash_integral71 ( 0 ) ) ) == 2 ) ) { struct timespec temp1177 = ( (struct timespec) { .tv_sec = ( from_dash_integral71 ( 0 ) ) , .tv_nsec = ( sleep_dash_ns3154 ) } ); struct timespec * ts3155 = ( &temp1177 ); ( ( nanosleep ) ( ( ts3155 ) , ( ( null_dash_ptr1178 ) ( ) ) ) ); } struct timespec temp1183 = ( ( undefined529 ) ( ) ); struct timespec * last_dash_sync3156 = ( &temp1183 ); ( ( clock_gettime ) ( ( ( clock_dash_monotonic531 ) ( ) ) , ( last_dash_sync3156 ) ) ); (* tui3150 ) .f_last_dash_sync = ( * ( last_dash_sync3156 ) ); (* tui3150 ) .f_fps_dash_count = ( op_dash_add394 ( ( ( * ( tui3150 ) ) .f_fps_dash_count ) , ( from_dash_integral106 ( 1 ) ) ) ); int64_t fps_dash_elapsed_dash_ms3157 = ( op_dash_add150 ( ( op_dash_mul69 ( ( op_dash_sub739 ( ( ( ( * ( tui3150 ) ) .f_last_dash_sync ) .tv_sec ) , ( ( ( * ( tui3150 ) ) .f_fps_dash_ts ) .tv_sec ) ) ) , ( from_dash_integral71 ( 1000 ) ) ) ) , ( op_dash_div737 ( ( op_dash_sub739 ( ( ( ( * ( tui3150 ) ) .f_last_dash_sync ) .tv_nsec ) , ( ( ( * ( tui3150 ) ) .f_fps_dash_ts ) .tv_nsec ) ) ) , ( from_dash_integral71 ( 1000000 ) ) ) ) ) ); if ( ( cmp757 ( ( fps_dash_elapsed_dash_ms3157 ) , ( from_dash_integral71 ( 1000 ) ) ) != 0 ) ) { (* tui3150 ) .f_actual_dash_fps = ( ( * ( tui3150 ) ) .f_fps_dash_count ); (* tui3150 ) .f_fps_dash_count = ( from_dash_integral106 ( 0 ) ); (* tui3150 ) .f_fps_dash_ts = ( ( * ( tui3150 ) ) .f_last_dash_sync ); } return ( Unit_4_Unit ); } static void * cast_dash_ptr1186 ( struct Cell_543 * p349 ) { return ( (void * ) ( p349 ) ); } static enum Unit_4 free1185 ( enum CAllocator_6 dref1863 , struct Slice_542 slice1865 ) { if (!( dref1863 == CAllocator_6_CAllocator )) { printf("%s\n", "pattern not matched to enter function"); exit ( 1 ); } ( ( free ) ( ( ( cast_dash_ptr1186 ) ( ( ( slice1865 ) .f_ptr ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 free_dash_screen1184 ( struct Screen_541 * screen3254 ) { enum CAllocator_6 al3255 = ( ( * ( screen3254 ) ) .f_al ); ( ( free1185 ) ( ( al3255 ) , ( ( * ( screen3254 ) ) .f_current ) ) ); ( ( free1185 ) ( ( al3255 ) , ( ( * ( screen3254 ) ) .f_previous ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 disable_dash_mouse1188 ( ) { ( ( print_dash_str91 ) ( ( ( from_dash_string110 ) ( ( "\x1b[?1000l\x1b[?1006l" ) , ( 16 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 show_dash_cursor1189 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[?25h" ) , ( 6 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 reset_dash_cursor_dash_position1190 ( ) { ( ( print495 ) ( ( ( from_dash_string110 ) ( ( "\x1b[H" ) , ( 3 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 disable_dash_raw_dash_mode1191 ( struct Termios_57 * og_dash_termios3130 ) { ( ( tcsetattr ) ( ( ( stdin_dash_fileno426 ) ( ) ) , ( ( tcsa_dash_flush493 ) ( ) ) , ( ( cast_dash_ptr427 ) ( ( og_dash_termios3130 ) ) ) ) ); return ( Unit_4_Unit ); } static enum Unit_4 deinit1187 ( struct Tui_55 * tui3160 ) { ( ( disable_dash_mouse1188 ) ( ) ); ( ( show_dash_cursor1189 ) ( ) ); ( ( reset_dash_colors498 ) ( ) ); ( ( clear_dash_screen499 ) ( ) ); ( ( reset_dash_cursor_dash_position1190 ) ( ) ); ( ( disable_dash_raw_dash_mode1191 ) ( ( & ( ( * ( tui3160 ) ) .f_orig_dash_termios ) ) ) ); ( ( flush_dash_stdout501 ) ( ) ); return ( Unit_4_Unit ); } int main(int argc, const char **argv) { _global_argc = argc; _global_argv = argv; size_t starting_dash_size1947 = ( ( from_dash_integral0 ( 8 ) ) ); size_t growth_dash_factor1948 = ( ( from_dash_integral0 ( 2 ) ) ); size_t shrink_dash_factor1949 = ( ( from_dash_integral0 ( 8 ) ) ); struct env1 envinst1 = { .starting_dash_size1947 = starting_dash_size1947 , .growth_dash_factor1948 = growth_dash_factor1948 , }; struct env2 envinst2 = { .envinst1 = envinst1 , }; struct env8 envinst8 = { .envinst2 = envinst2 , }; struct env10 envinst10 = { .envinst8 = envinst8 , }; struct env12 envinst12 = { .envinst10 = envinst10 , }; struct env15 envinst15 = { .envinst12 = envinst12 , }; struct env18 envinst18 = { .envinst12 = envinst12 , }; struct env19 envinst19 = { .envinst12 = envinst12 , }; struct env20 envinst20 = { .envinst15 = envinst15 , .envinst12 = envinst12 , }; struct env27 envinst27 = { .envinst18 = envinst18 , .envinst12 = envinst12 , }; struct env30 envinst30 = { .envinst19 = envinst19 , .envinst12 = envinst12 , }; struct env32 envinst32 = { .envinst20 = envinst20 , }; struct env34 envinst34 = { .envinst27 = envinst27 , }; struct env36 envinst36 = { .envinst30 = envinst30 , }; struct env38 envinst38 = { .envinst36 = envinst36 , }; struct env40 envinst40 = { .envinst38 = envinst38 , .envinst12 = envinst12 , }; ( ( srand ) ( ( ( cast43 ) ( ( ( time ) ( ( ( null_dash_c_dash_ptr44 ) ( ) ) ) ) ) ) ) ); bool temp50 = ( false ); bool * should_dash_resize3140 = ( &temp50 ); struct env51 envinst51 = { .should_dash_resize3140 = should_dash_resize3140 , }; struct env52 envinst52 = { .should_dash_resize3140 = should_dash_resize3140 , }; struct env53 envinst53 = { .envinst52 = envinst52 , }; struct env59 envinst59 = { .envinst52 = envinst52 , }; struct env61 envinst61 = { .envinst32 = envinst32 , }; struct env63 envinst63 = { .envinst34 = envinst34 , .envinst40 = envinst40 , }; struct Slice_66 args3485 = ( ( get67 ) ( ) ); size_t width3486 = ( from_dash_integral0 ( 9 ) ); size_t height3487 = ( from_dash_integral0 ( 9 ) ); int32_t bombs3488 = ( from_dash_integral48 ( 10 ) ); struct Slice_66 dref3489 = ( args3485 ); const char* __larr__82[3]; const char* *dref3490 = __larr__82; if ( deconstruct73 ( dref3489 , & dref3490 , 3 , ( struct ListSpread_74 ) { .tag = 0 } , NULL , 0 ) ) { width3486 = ( ( i64_dash_size83 ) ( ( ( or_dash_fail84 ) ( ( ( parse_dash_int121 ) ( ( dref3490[0] ) ) ) , ( ( from_dash_string110 ) ( ( "could not parse width" ) , ( 21 ) ) ) ) ) ) ); height3487 = ( ( i64_dash_size83 ) ( ( ( or_dash_fail84 ) ( ( ( parse_dash_int121 ) ( ( dref3490[1] ) ) ) , ( ( from_dash_string110 ) ( ( "could not parse height" ) , ( 22 ) ) ) ) ) ) ); bombs3488 = ( ( i64_dash_i32152 ) ( ( ( or_dash_fail84 ) ( ( ( parse_dash_int121 ) ( ( dref3490[2] ) ) ) , ( ( from_dash_string110 ) ( ( "could not parse bombs" ) , ( 21 ) ) ) ) ) ) ); } else { const char* *dref3494 = NULL; if ( deconstruct73 ( dref3489 , & dref3494 , 0 , ( struct ListSpread_74 ) { .tag = 0 } , NULL , 0 ) ) { } else { if ( true ) { ( ( panic86 ) ( ( ( from_dash_string110 ) ( ( "args??" ) , ( 6 ) ) ) ) ); } } } enum CAllocator_6 al3495 = ( ( idc154 ) ( ) ); struct envunion157 temp156 = ( (struct envunion157){ .fun = ( struct Stats_155 (*) ( struct env61* , enum CAllocator_6 ) )load_dash_score158 , .env = envinst61 } ); struct Stats_155 stats3496 = ( temp156.fun ( &temp156.env , ( al3495 ) ) ); enum GameState_329 game_dash_state3497 = ( GameState_329_InProgress ); struct TileMap_330 tilemap3498 = ( ( generate_dash_map334 ) ( ( width3486 ) , ( height3487 ) , ( bombs3488 ) , ( al3495 ) ) ); struct Controls_415 controls3499 = ( (struct Controls_415) { .f_cursor_dash_x = ( op_dash_div417 ( ( ( size_dash_i3293 ) ( ( width3486 ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , .f_cursor_dash_y = ( op_dash_div417 ( ( ( size_dash_i3293 ) ( ( height3487 ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , .f_current_dash_control_dash_scheme = ( ControlScheme_416_MouseControls ) } ); struct envunion420 temp419 = ( (struct envunion420){ .fun = ( struct Tui_55 (*) ( struct env51* ) )mk421 , .env = envinst51 } ); struct Tui_55 temp418 = ( temp419.fun ( &temp419.env ) ); struct Tui_55 * tui3500 = ( &temp418 ); enum CAllocator_6 al3501 = ( ( idc154 ) ( ) ); struct Screen_541 temp548 = ( ( mk_dash_screen549 ) ( ( tui3500 ) , ( al3501 ) ) ); struct Screen_541 * screen3502 = ( &temp548 ); bool running3503 = ( true ); while ( ( running3503 ) ) { struct env592 envinst592 = { .envinst53 = envinst53 , .tui3500 = tui3500 , }; struct FunIter_591 temp590 = into_dash_iter600 ( ( ( from_dash_function601 ) ( ( (struct envunion599){ .fun = ( struct Maybe_594 (*) ( struct env592* ) )lam602 , .env = envinst592 } ) ) ) ); while (true) { struct Maybe_594 __cond777 = next778 (&temp590); if ( __cond777 .tag == 0 ) { break; } struct InputEvent_595 ev3505 = __cond777 .stuff .Maybe_594_Just_s .field0; struct InputEvent_595 dref3506 = ( ev3505 ); if ( dref3506.tag == InputEvent_595_Key_t && dref3506 .stuff .InputEvent_595_Key_s .field0.tag == Key_596_Char_t ) { if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "q" ) , ( 1 ) ) ) ) ) ) { running3503 = ( false ); } else { if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "r" ) , ( 1 ) ) ) ) ) ) { tilemap3498 = ( ( generate_dash_map334 ) ( ( width3486 ) , ( height3487 ) , ( bombs3488 ) , ( al3501 ) ) ); game_dash_state3497 = ( GameState_329_InProgress ); } else { if ( ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_InProgress ) ) ) && ( eq782 ( ( ( controls3499 ) .f_current_dash_control_dash_scheme ) , ( ControlScheme_416_MouseControls ) ) ) ) ) { controls3499 .f_current_dash_control_dash_scheme = ( ControlScheme_416_KeyControls ); } else { if ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_InProgress ) ) ) ) { if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "h" ) , ( 1 ) ) ) ) ) ) { controls3499 .f_cursor_dash_x = ( ( clamp784 ) ( ( op_dash_sub735 ( ( ( controls3499 ) .f_cursor_dash_x ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_width ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); } if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "j" ) , ( 1 ) ) ) ) ) ) { controls3499 .f_cursor_dash_y = ( ( clamp784 ) ( ( op_dash_add275 ( ( ( controls3499 ) .f_cursor_dash_y ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_height ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); } if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "k" ) , ( 1 ) ) ) ) ) ) { controls3499 .f_cursor_dash_y = ( ( clamp784 ) ( ( op_dash_sub735 ( ( ( controls3499 ) .f_cursor_dash_y ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_height ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); } if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "l" ) , ( 1 ) ) ) ) ) ) { controls3499 .f_cursor_dash_x = ( ( clamp784 ) ( ( op_dash_add275 ( ( ( controls3499 ) .f_cursor_dash_x ) , ( from_dash_integral48 ( 1 ) ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_width ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ); } if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( " " ) , ( 1 ) ) ) ) ) ) { int32_t x3508 = ( ( controls3499 ) .f_cursor_dash_x ); int32_t y3509 = ( ( controls3499 ) .f_cursor_dash_y ); if ( ( ( ! ( ( elem_dash_get396 ( ( tilemap3498 ) , ( ( Tuple2_397_Tuple2 ) ( ( x3508 ) , ( y3509 ) ) ) ) ) .f_flagged ) ) && ( ( uncover_dash_tile785 ) ( ( tilemap3498 ) , ( x3508 ) , ( y3509 ) ) ) ) ) { game_dash_state3497 = ( GameState_329_Failed ); } if ( ( ( is_dash_game_dash_won798 ) ( ( tilemap3498 ) ) ) ) { game_dash_state3497 = ( GameState_329_Won ); stats3496 .f_total_dash_wins = ( op_dash_add394 ( ( ( stats3496 ) .f_total_dash_wins ) , ( from_dash_integral106 ( 1 ) ) ) ); struct envunion819 temp818 = ( (struct envunion819){ .fun = ( enum Unit_4 (*) ( struct env63* , struct Stats_155 , enum CAllocator_6 ) )save_dash_score820 , .env = envinst63 } ); ( temp818.fun ( &temp818.env , ( stats3496 ) , ( al3501 ) ) ); } } if ( ( eq656 ( ( dref3506 .stuff .InputEvent_595_Key_s .field0 .stuff .Key_596_Char_s .field0 ) , ( ( from_dash_charlike657 ) ( ( "n" ) , ( 1 ) ) ) ) ) ) { ( ( toggle_dash_flag941 ) ( ( tilemap3498 ) , ( ( controls3499 ) .f_cursor_dash_x ) , ( ( controls3499 ) .f_cursor_dash_y ) ) ); } } } } } } else { if ( dref3506.tag == InputEvent_595_Mouse_t ) { controls3499 .f_current_dash_control_dash_scheme = ( ControlScheme_416_MouseControls ); int32_t x3511 = ( op_dash_sub735 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_x ) , ( ( fst398 ) ( ( ( get_dash_board_dash_off945 ) ( ( tui3500 ) , ( tilemap3498 ) ) ) ) ) ) ); int32_t y3512 = ( op_dash_sub735 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_y ) , ( ( snd399 ) ( ( ( get_dash_board_dash_off945 ) ( ( tui3500 ) , ( tilemap3498 ) ) ) ) ) ) ); if ( ( ( eq946 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_button ) , ( MouseButton_598_MouseLeft ) ) ) && ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_pressed ) ) ) { if ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_InProgress ) ) ) ) { if ( ( ( ! ( ( elem_dash_get396 ( ( tilemap3498 ) , ( ( Tuple2_397_Tuple2 ) ( ( x3511 ) , ( y3512 ) ) ) ) ) .f_flagged ) ) && ( ( uncover_dash_tile785 ) ( ( tilemap3498 ) , ( x3511 ) , ( y3512 ) ) ) ) ) { game_dash_state3497 = ( GameState_329_Failed ); } if ( ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_InProgress ) ) ) && ( ( is_dash_game_dash_won798 ) ( ( tilemap3498 ) ) ) ) ) { game_dash_state3497 = ( GameState_329_Won ); stats3496 .f_total_dash_wins = ( op_dash_add394 ( ( ( stats3496 ) .f_total_dash_wins ) , ( from_dash_integral106 ( 1 ) ) ) ); struct envunion951 temp950 = ( (struct envunion951){ .fun = ( enum Unit_4 (*) ( struct env63* , struct Stats_155 , enum CAllocator_6 ) )save_dash_score820 , .env = envinst63 } ); ( temp950.fun ( &temp950.env , ( stats3496 ) , ( al3501 ) ) ); } } } if ( ( ( eq946 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_button ) , ( MouseButton_598_MouseRight ) ) ) && ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_pressed ) ) ) { if ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_InProgress ) ) ) ) { ( ( toggle_dash_flag941 ) ( ( tilemap3498 ) , ( x3511 ) , ( y3512 ) ) ); } } if ( ( ( ( ( eq946 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_button ) , ( MouseButton_598_MouseLeft ) ) ) || ( eq946 ( ( ( dref3506 .stuff .InputEvent_595_Mouse_s .field0 ) .f_button ) , ( MouseButton_598_MouseRight ) ) ) ) && ( ( between952 ) ( ( x3511 ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_width ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ) && ( ( between952 ) ( ( y3512 ) , ( from_dash_integral48 ( 0 ) ) , ( op_dash_sub735 ( ( ( tilemap3498 ) .f_height ) , ( from_dash_integral48 ( 1 ) ) ) ) ) ) ) ) { controls3499 .f_cursor_dash_x = ( x3511 ); controls3499 .f_cursor_dash_y = ( y3512 ); } } } } struct envunion956 temp955 = ( (struct envunion956){ .fun = ( bool (*) ( struct env59* , struct Screen_541 * ) )resize_dash_screen_dash_if_dash_needed957 , .env = envinst59 } ); ( temp955.fun ( &temp955.env , ( screen3502 ) ) ); if ( ( ( should_dash_redraw959 ) ( ( tui3500 ) ) ) ) { ( ( clear_dash_screen960 ) ( ( screen3502 ) ) ); ( ( set_dash_screen_dash_colors969 ) ( ( screen3502 ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); ( ( fill_dash_default970 ) ( ( screen3502 ) ) ); ( ( draw_dash_str980 ) ( ( screen3502 ) , ( ( StrConcat_981_StrConcat ) ( ( ( from_dash_string110 ) ( ( "total wins: " ) , ( 12 ) ) ) , ( ( stats3496 ) .f_total_dash_wins ) ) ) , ( from_dash_integral48 ( 0 ) ) , ( from_dash_integral48 ( 0 ) ) ) ); ( ( render_dash_tiles1000 ) ( ( screen3502 ) , ( tilemap3498 ) , ( ( get_dash_board_dash_off945 ) ( ( tui3500 ) , ( tilemap3498 ) ) ) , ( game_dash_state3497 ) , ( controls3499 ) ) ); ( ( set_dash_screen_dash_colors969 ) ( ( screen3502 ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) , ( (struct Color_544) { .tag = Color_544_ColorDefault_t } ) ) ); if ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_Failed ) ) ) ) { ( ( draw_dash_str_dash_center1052 ) ( ( screen3502 ) , ( ( from_dash_string110 ) ( ( "ya failed. restart? (r)" ) , ( 23 ) ) ) , ( op_dash_div417 ( ( ( u32_dash_i32388 ) ( ( ( * ( tui3500 ) ) .f_width ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , ( op_dash_add275 ( ( op_dash_add275 ( ( ( tilemap3498 ) .f_height ) , ( ( snd399 ) ( ( ( get_dash_board_dash_off945 ) ( ( tui3500 ) , ( tilemap3498 ) ) ) ) ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) ) ); } else { if ( ( eq780 ( ( game_dash_state3497 ) , ( GameState_329_Won ) ) ) ) { ( ( draw_dash_str_dash_center1052 ) ( ( screen3502 ) , ( ( from_dash_string110 ) ( ( "ya won. quit? (q)" ) , ( 17 ) ) ) , ( op_dash_div417 ( ( ( u32_dash_i32388 ) ( ( ( * ( tui3500 ) ) .f_width ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) , ( op_dash_add275 ( ( op_dash_add275 ( ( ( tilemap3498 ) .f_height ) , ( ( snd399 ) ( ( ( get_dash_board_dash_off945 ) ( ( tui3500 ) , ( tilemap3498 ) ) ) ) ) ) ) , ( from_dash_integral48 ( 2 ) ) ) ) ) ); } } ( ( render_dash_screen1068 ) ( ( screen3502 ) ) ); } ( ( sync1175 ) ( ( tui3500 ) ) ); } ( ( free_dash_screen1184 ) ( ( screen3502 ) ) ); ( ( deinit1187 ) ( ( tui3500 ) ) ); }