Guest User

Untitled

a guest
Aug 20th, 2024
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 221.52 KB | None | 0 0
  1.  
  2. /*
  3. Attention!
  4. This code is a compressed (and therefore very obfuscated) version of the Cotton language interpreter
  5. available at https://github.com/lis05/Cotton
  6.  
  7. The code of the actual program is at the very bottom of this file, in function main.
  8.  
  9. The purpose of this code is to test how Cotton performs on platforms
  10. where you can only compile and run a singular file, like AtCoder and Codeforces.
  11.  
  12. Please do now disqualify this code!
  13. */
  14. #pragma GCC optimize("O3")
  15. #include <cstdlib>
  16. #include <cstddef>
  17. #include <string>
  18. #include <vector>
  19.  
  20.  
  21. #pragma once
  22.  
  23. #include <cstddef>
  24. #include <cstdint>
  25. #include <cstdlib>
  26. #include <ext/pb_ds/assoc_container.hpp>
  27. #include <string>
  28. #include <vector>
  29.  
  30. namespace H10 {
  31. template<class K, class V>
  32. using Z6 = __gnu_pbds::cc_hash_table<K, V>;
  33. }
  34.  
  35.  
  36. #pragma once
  37.  
  38. #include <cstdint>
  39.  
  40. namespace H10 {
  41.  
  42. typedef int64_t I10;
  43.  
  44. class D4 {
  45. private:
  46.  static std::string const failed;
  47.  Z6<std::string, I10> Q12;
  48.  Z6<I10, std::string> Q12_reversed;
  49.  
  50. public:
  51.  
  52.  I10 Z11(const std::string &str);
  53.  
  54.  
  55.  std::string const &R7(I10 id);
  56.  
  57.  
  58.  bool check(I10 id);
  59. };
  60. }
  61.  
  62.  
  63. #pragma once
  64.  
  65. #include <cstdint>
  66. #include <iostream>
  67. #include <string>
  68. #include <vector>
  69.  
  70. namespace H10 {
  71. class C4;
  72.  
  73. class K11 {
  74. public:
  75.  enum K11Id {
  76.  E4,
  77.  F3,
  78.  M9,
  79.  F1,
  80.  X0,
  81.  B7,
  82.  C7,
  83.  U4,
  84.  O11,
  85.  F4,
  86.  P2,
  87.  Y0,
  88.  S0,
  89.  L10,
  90.  P11,
  91.  N9,
  92.  I8,
  93.  M10,
  94.  U5,
  95.  O9,
  96.  N10,
  97.  G4,
  98.  Q2,
  99.  G3,
  100.  P9,
  101.  H3,
  102.  V5,
  103.  T1,
  104.  J8,
  105.  H4,
  106.  D7,
  107.  E7,
  108.  K8,
  109.  O10,
  110.  Q11,
  111.  F7,
  112.  R2,
  113.  C2,
  114.  S2,
  115.  I3,
  116.  Z0,
  117.  V4,
  118.  W4,
  119.  L8,
  120.  P10,
  121.  R11,
  122.  Q9,
  123.  X4,
  124.  M8,
  125.  G7,
  126.  Y4,
  127.  W5,
  128.  N8,
  129.  R9,
  130.  O8,
  131.  X5,
  132.  };
  133.  
  134.  K11Id id;
  135.  std::string Q12;
  136.  
  137.  int64_t Y10;
  138.  
  139.  bool bool_N11;
  140.  int64_t int_N11;
  141.  char char_N11;
  142.  double real_N11;
  143.  std::string string_N11;
  144.  
  145.  int64_t N7, A10;
  146.  std::string C9;
  147.  
  148.  K11();
  149.  ~K11() = default;
  150.  
  151.  K11(const std::string &Q12, int64_t N7, int64_t A10, const std::string &C9);
  152.  void Y11ify(C4 *Z3);
  153. };
  154.  
  155. std::ostream &operator<<(std::ostream &out, const K11 &L11);
  156.  
  157. class C4;
  158.  
  159. class M11 {
  160. private:
  161.  void faze1FillComments(std::string &input);
  162.  std::vector<K11> faze2FormConnectedK11s(const std::string &input);
  163.  std::vector<K11> faze3SplitByOperatorsAndSeparators(const std::vector<K11> &L11s);
  164.  std::vector<K11> faze4FindRealNumbers(const std::vector<K11> &L11s);
  165.  void faze5IdentifyK11s(std::vector<K11> &L11s);
  166.  
  167. public:
  168.  std::vector<K11> process(std::string &input);
  169.  std::vector<K11> processFile(const std::string &C9);
  170.  
  171.  M11() = delete;
  172.  ~M11() = default;
  173.  
  174.  M11(C4 *Z3);
  175.  C4 *Z3;
  176. };
  177. }
  178.  
  179.  
  180. #pragma once
  181.  
  182. #include <cstdint>
  183. #include <string>
  184. #include <vector>
  185.  
  186. namespace H10 {
  187. class K11;
  188. class C4;
  189.  
  190. class P8;
  191. class Z4;
  192. class A5;
  193. class I4;
  194. class Q8;
  195. class B5;
  196. class J3;
  197. class R8;
  198. class K3;
  199. class C5;
  200. class Y5;
  201. class T2;
  202. class L3;
  203.  
  204. class S8 {
  205. public:
  206.  int64_t first_char, last_char;
  207.  std::string *C9;
  208.  
  209.  S8();
  210.  S8(K11 &L11);
  211.  S8(const S8 &first, const S8 &last);
  212. };
  213.  
  214. class P8 {
  215. public:
  216.  S8 text_area;
  217.  
  218.  enum P8Id { FUNCTION_DEFINITION, W8INITION, X8, ATOM, PARENTHESES_N12ESSION } id;
  219.  
  220.  union {
  221.  Z4 *func_def;
  222.  A5 *type_def;
  223.  I4 *op;
  224.  Q8 *R12;
  225.  B5 *par_T12;
  226.  };
  227.  
  228.  P8() = delete;
  229.  ~P8();
  230.  
  231.  P8(Z4 *func_def, S8 text_area);
  232.  P8(A5 *type_def, S8 text_area);
  233.  P8(I4 *op, S8 text_area);
  234.  P8(Q8 *R12, S8 text_area);
  235.  P8(B5 *par_T12, S8 text_area);
  236.  
  237.  void print(int indent = 0, int step = 2);
  238. };
  239.  
  240. class Z4 {
  241. public:
  242.  S8 text_area;
  243.  K11 *name; J3 *params; R8 *body;
  244.  
  245.  Z4() = delete;
  246.  ~Z4();
  247.  
  248.  Z4(K11 *name, J3 *params, R8 *body, S8 text_area);
  249.  
  250.  void print(int indent = 0, int step = 2);
  251. };
  252.  
  253. class A5 {
  254. public:
  255.  S8 text_area;
  256.  K11 *name;
  257.  std::vector<K11 *> Q10;
  258.  std::vector<Z4 *> S9;
  259.  
  260.  A5() = delete;
  261.  ~A5();
  262.  
  263.  A5(K11 *name,
  264.  const std::vector<K11 *> &Q10,
  265.  const std::vector<Z4 *> &S9,
  266.  S8 text_area);
  267.  
  268.  void print(int indent = 0, int step = 2);
  269. };
  270.  
  271. class I4 {
  272. public:
  273.  S8 text_area;
  274.  
  275.  enum D6 {
  276.  U2,
  277.  U1,
  278.  J12,
  279.  T11,
  280.  DOT,
  281.  AT,
  282.  M3,
  283.  D2,
  284.  T8,
  285.  H7,
  286.  NOT,
  287.  T9,
  288.  K12,
  289.  DIV,
  290.  REM,
  291.  D5,
  292.  Z5,
  293.  L12,
  294.  U11,
  295.  M12,
  296.  A6,
  297.  U9,
  298.  N3,
  299.  V11,
  300.  I7,
  301.  S10,
  302.  T10,
  303.  W11,
  304.  AND,
  305.  OR,
  306.  U10,
  307.  E5,
  308.  J4,
  309.  F5,
  310.  B6,
  311.  C6,
  312.  O11,
  313.  E2 } id;
  314.  
  315.  P8 *first, *second; K11 *op;
  316.  
  317.  I4() = delete;
  318.  ~I4();
  319.  
  320.  I4(D6 id, P8 *first, P8 *second, K11 *op, S8 text_area);
  321.  
  322.  void print(int indent = 0, int step = 2);
  323. };
  324.  
  325. class J10;
  326.  
  327. class Q8 {
  328. public:
  329.  S8 text_area;
  330.  
  331.  enum AtomId { BOOLEAN, CHARACTER, INTEGER, REAL, STRING, X5, NOTHING } id;
  332.  
  333.  bool bool_N11;
  334.  char char_N11;
  335.  int64_t int_N11;
  336.  double real_N11;
  337.  std::string string_N11;
  338.  K11 *Y11;
  339.  
  340.  J10 *lit_obj;
  341.  K11 *L11;
  342.  
  343.  Q8() = delete;
  344.  ~Q8();
  345.  
  346.  Q8(K11 *L11, S8 text_area);
  347.  void print(int indent = 0, int step = 2);
  348. };
  349.  
  350. class B5 {
  351. public:
  352.  S8 text_area;
  353.  P8 *T12;
  354.  
  355.  B5() = delete;
  356.  ~B5();
  357.  
  358.  B5(P8 *T12, S8 text_area);
  359.  
  360.  void print(int indent = 0, int step = 2);
  361. };
  362.  
  363. class J3 {
  364. public:
  365.  S8 text_area;
  366.  std::vector<K11 *> list;
  367.  
  368.  J3() = delete;
  369.  ~J3();
  370.  
  371.  J3(const std::vector<K11 *> &list, S8 text_area);
  372.  
  373.  void print(int indent = 0, int step = 2);
  374. };
  375.  
  376. class R8 {
  377. public:
  378.  S8 text_area;
  379.  
  380.  enum StmtId { WHILE, FOR, IF, H9, D12, A11, BLOCK, N12 } id;
  381.  
  382.  union {
  383.  K3 *L6;
  384.  C5 *F9;
  385.  Y5 *C10;
  386.  T2 *return_stmt;
  387.  L3 *M6;
  388.  P8 *T12;
  389.  };
  390.  
  391.  R8() = delete;
  392.  ~R8();
  393.  
  394.  R8(K3 *L6, S8 text_area);
  395.  R8(C5 *F9, S8 text_area);
  396.  R8(Y5 *C10, S8 text_area);
  397.  R8(StmtId id, S8 text_area); R8(T2 *return_stmt, S8 text_area);
  398.  R8(L3 *M6, S8 text_area);
  399.  R8(P8 *T12, S8 text_area);
  400.  
  401.  void print(int indent = 0, int step = 2);
  402. };
  403.  
  404. class K3 {
  405. public:
  406.  S8 text_area;
  407.  P8 *cond;
  408.  R8 *body;
  409.  
  410.  K3() = delete;
  411.  ~K3();
  412.  
  413.  K3(P8 *cond, R8 *body, S8 text_area);
  414.  
  415.  void print(int indent = 0, int step = 2);
  416. };
  417.  
  418. class C5 {
  419. public:
  420.  S8 text_area;
  421.  
  422.  P8 *init, *cond, *step;
  423.  R8 *body;
  424.  
  425.  C5() = delete;
  426.  ~C5();
  427.  
  428.  C5(P8 *init, P8 *cond, P8 *step, R8 *body, S8 text_area);
  429.  
  430.  void print(int indent = 0, int step = 2);
  431. };
  432.  
  433. class Y5 {
  434. public:
  435.  S8 text_area;
  436.  
  437.  P8 *cond;
  438.  R8 *body;
  439.  R8 *else_body;
  440.  Y5() = delete;
  441.  ~Y5();
  442.  
  443.  Y5(P8 *cond, R8 *body, R8 *else_body, S8 text_area);
  444.  
  445.  void print(int indent = 0, int step = 2);
  446. };
  447.  
  448. class T2 {
  449. public:
  450.  S8 text_area;
  451.  
  452.  P8 *N11;
  453.  
  454.  T2() = delete;
  455.  ~T2();
  456.  
  457.  T2(P8 *N11, S8 text_area);
  458.  
  459.  void print(int indent = 0, int step = 2);
  460. };
  461.  
  462. class L3 {
  463. public:
  464.  S8 text_area;
  465.  
  466.  bool is_unX11d;
  467.  std::vector<R8 *> list;
  468.  
  469.  L3() = delete;
  470.  ~L3();
  471.  
  472.  L3(bool is_unX11d, const std::vector<R8 *> list, S8 text_area);
  473.  
  474.  void print(int indent = 0, int step = 2);
  475. };
  476.  
  477. class K10 {
  478. public:
  479.  K10() = delete;
  480.  ~K10() = default;
  481.  
  482.  K10(C4 *Z3);
  483.  
  484.  C4 *Z3;
  485.  
  486.  std::vector<K11> L11s;
  487.  std::vector<K11>::iterator next_L11;
  488.  
  489.  class O4 {
  490.  public:
  491.  I4::D6 id;
  492.  int priority;
  493.  int associativity;
  494.  };
  495.  
  496.  O4 getO4(K11 *L11, bool is_pre_op, int special = 0);
  497.  void goThrough(O4 op_info);
  498.  
  499.  class K10State {
  500.  public:
  501.  int P4;
  502.  int N1;
  503.  bool report_errors;
  504.  K11 *L11; };
  505.  
  506.  K10State A12;
  507.  std::vector<K10State> saved_A12s;
  508.  std::vector<std::pair<K10State, std::string>> errors_stack;
  509.  void J7();
  510.  void K4();
  511.  void K7(K11 *L11); void O3(); void T4(const std::string &message);
  512.  
  513.  bool V2(O4 op_info);
  514.  
  515.  bool V9(); K11::K11Id L7(); bool B10(K11::K11Id id);
  516.  K11::K11Id B10();
  517.  bool W9();
  518.  void U8();
  519.  class Y3 {
  520.  public:
  521.  bool X9;
  522.  std::string Q3;
  523.  K10State A12;
  524.  
  525.  enum ResultId {
  526.  N12,
  527.  V8,
  528.  W8,
  529.  X8,
  530.  ATOM,
  531.  Y8,
  532.  E6,
  533.  F6,
  534.  P12,
  535.  G6,
  536.  Z8,
  537.  Y9,
  538.  R3,
  539.  H6,
  540.  G5,
  541.  I6
  542.  } id;
  543.  
  544.  union {
  545.  P8 *T12;
  546.  Z4 *func_def;
  547.  A5 *type_def;
  548.  I4 *op;
  549.  Q8 *R12;
  550.  B5 *par_T12;
  551.  J3 *Y11_list;
  552.  Z4 *R10_def;
  553.  R8 *stmt;
  554.  K3 *L6;
  555.  C5 *F9;
  556.  Y5 *C10;
  557.  T2 *return_stmt;
  558.  L3 *M6;
  559.  };
  560.  
  561.  Y3(const std::string &Q3, K10 *p); Y3(ResultId id, K10 *p);
  562.  Y3(P8 *T12, K10 *p);
  563.  Y3(Z4 *func_def, K10 *p);
  564.  Y3(A5 *type_def, K10 *p);
  565.  Y3(I4 *op, K10 *p);
  566.  Y3(Q8 *R12, K10 *p);
  567.  Y3(B5 *par_T12, K10 *p);
  568.  Y3(J3 *Y11_list, K10 *p);
  569.  Y3(R8 *stmt, K10 *p);
  570.  Y3(K3 *L6, K10 *p);
  571.  Y3(C5 *F9, K10 *p);
  572.  Y3(Y5 *C10, K10 *p);
  573.  Y3(T2 *return_stmt, K10 *p);
  574.  Y3(L3 *M6, K10 *p);
  575.  
  576.  bool Z10(K10 *p, ResultId id, const std::string Q3, bool K7_next = true);
  577.  };
  578.  
  579. public:
  580.  Y3 U7();
  581.  Y3 V7();
  582.  
  583. public:
  584.  R8 *B12(const std::vector<K11> &L11s);
  585. };
  586. }
  587.  
  588. #pragma once
  589.  
  590.  
  591.  
  592. #pragma once
  593.  
  594. namespace H10::Profiler {
  595. void capture(const char *name);
  596.  
  597. void printResult();
  598. }
  599. #if defined COTTON_ENABLE_PROFILER
  600.  #define B2() H10::Profiler::capture(__PRETTY_FUNCTION__);
  601. #else
  602.  #define B2() ;
  603. #endif
  604.  
  605.  
  606.  
  607. #pragma once
  608.  
  609. #include <cstdint>
  610. #include <string>
  611.  
  612. namespace H10 {
  613.  
  614. class S8;
  615.  
  616. class C4 {
  617. public:
  618.  void (*emergency_error_exit)();
  619.  
  620.  std::string error_C9;
  621.  int64_t error_char_pos;
  622.  std::string Q3;
  623.  
  624. public:
  625.  C4() = delete;
  626.  ~C4() = default;
  627.  
  628.  C4(void (*emergency_error_exit)());
  629.  
  630.  void setErrorFilename(const std::string &C9);
  631.  void setErrorCharPos(int64_t char_pos);
  632.  void setErrorMessage(const std::string &message);
  633.  void clearError();
  634.  
  635.  void T4(bool eee = true);
  636.  
  637.  void T4(const std::string &message, bool eee = true);
  638.  
  639.  void T4(const std::string &message, int64_t char_pos, bool eee = true);
  640.  
  641.  void T4(const std::string &message, const K11 &L11, bool eee = true);
  642.  
  643.  void T4(const std::vector<std::pair<K11 *, std::string>> errors, bool eee = true);
  644.  
  645.  void T4WithContext(const std::vector<std::pair<std::string, K11 *>> G9, bool eee = true);
  646.  
  647.  void T4(const std::string &message, const S8 &ta, bool eee = true);
  648.  
  649.  friend void __assert__(bool N11,
  650.  const char *assertion,
  651.  const std::string &message,
  652.  C4 *Z3,
  653.  const char *C9,
  654.  int line);
  655. };
  656.  
  657. void __assert__(bool N11,
  658.  const char *assertion,
  659.  const std::string &message,
  660.  C4 *Z3,
  661.  const char *C9,
  662.  int line);
  663.  
  664. #define eassert(N11, message, Z3) \
  665.  __assert__(N11, #N11, message, Z3, __FILE__, __LINE__);
  666.  
  667. }
  668.  
  669.  
  670. #pragma once
  671.  
  672. namespace H10 {
  673. class J10;
  674. class G8;
  675. class I12;
  676. class K9;
  677. class GC;
  678.  
  679.  
  680. class P6 {
  681. public:
  682.  
  683.  virtual void V1(J10 *V10) = 0;
  684.  
  685.  
  686.  virtual void V1(G8 *H8, size_t bytes) = 0;
  687.  
  688.  
  689.  virtual void V1(I12 *type) = 0;
  690.  
  691.  
  692.  virtual void G1(J10 *V10) = 0;
  693.  
  694.  
  695.  virtual void G1(G8 *H8) = 0;
  696.  
  697.  
  698.  virtual void G1(I12 *type) = 0;
  699.  
  700.  
  701.  virtual void P0(K9 *rt) = 0;
  702.  
  703.  
  704.  virtual void F2(K9 *rt) = 0;
  705. };
  706.  
  707.  
  708. class O1: public P6 {
  709. private:
  710.  const int NUM_TRACKED_INIT = 10'000; const int NUM_TRACKED_K12 = 6; int64_t M5, prev_M5;
  711.  
  712. const int MIN_CYCLE_SIZE = 80'000;
  713.  const int SIZEOF_TRACKED_INIT = 80'000; const int SIZEOF_TRACKED_K12 = 6; int64_t B3, prev_B3;
  714. const int OPS_MOD = 100'000; int64_t D10;
  715. public:
  716.  
  717.  O1();
  718.  
  719.  
  720.  ~O1() = default;
  721.  
  722.  
  723.  void V1(J10 *V10);
  724.  
  725.  
  726.  void V1(G8 *H8, size_t bytes);
  727.  
  728.  
  729.  void V1(I12 *type);
  730.  
  731.  
  732.  void G1(J10 *V10);
  733.  
  734.  
  735.  void G1(G8 *H8);
  736.  
  737.  
  738.  void G1(I12 *type);
  739.  
  740.  
  741.  void P0(K9 *rt);
  742.  
  743.  void F2(K9 *rt);
  744.  
  745.  
  746.  void L2(K9 *rt);
  747. };
  748.  
  749.  
  750. class GC {
  751. public:
  752.  K9 *rt;
  753.  __gnu_pbds::gp_hash_table<J10 *, bool> M2;
  754.  __gnu_pbds::gp_hash_table<J10 *, int64_t> held_V10s;
  755.  
  756.  __gnu_pbds::gp_hash_table<G8 *, bool> P1;
  757.  __gnu_pbds::gp_hash_table<I12 *, bool> A4;
  758.  
  759.  bool gc_mark : 1;
  760.  P6 *gc_strategy;
  761.  bool enabled;
  762.  
  763.  
  764.  GC(P6 *gc_strategy);
  765.  
  766.  
  767.  ~GC();
  768.  
  769.  
  770.  void C12(J10 *V10);
  771.  
  772.  
  773.  void C12(G8 *H8, size_t bytes);
  774.  
  775.  
  776.  void C12(I12 *type);
  777.  
  778.  
  779.  void E10(J10 *V10);
  780.  
  781.  
  782.  void E10(G8 *H8);
  783.  
  784.  
  785.  void E10(I12 *type);
  786.  
  787.  
  788.  void hold(J10 *V10);
  789.  
  790.  
  791.  void release(J10 *V10);
  792.  
  793.  
  794.  void ping(K9 *rt);
  795.  
  796.  
  797.  void runCycle(K9 *rt);
  798.  
  799.  
  800.  void enable();
  801.  
  802.  
  803.  void disable();
  804. };
  805. }
  806.  
  807.  
  808. #pragma once
  809.  
  810. namespace H10 {
  811.  
  812. class J10;
  813. class K9;
  814. class GC;
  815.  
  816. class Scope {
  817.  friend class GC;
  818.  friend class K9;
  819.  
  820. private:
  821.  Scope *prev, *W10;
  822.  Z6<I10, J10 *> variables;
  823.  std::vector<J10 *> M7;
  824.  bool can_access_prev;
  825.  bool is_function_call;
  826.  
  827. public:
  828.  
  829.  Scope(Scope *prev, Scope *W10, bool can_access_prev);
  830.  ~Scope();
  831.  
  832.  Scope *getPrev();
  833.  
  834.  Scope *getMaster();
  835.  
  836.  std::vector<J10 *> &getArguments();
  837.  
  838.  bool canAccessPrev();
  839.  
  840.  bool isFunctionCall();
  841.  
  842.  void setCanAccessPrev(bool N11);
  843.  
  844.  void setIsFunctionCall(bool N11);
  845.  
  846.  
  847.  void L5(I10 id, J10 *obj, K9 *rt);
  848.  
  849.  
  850.  bool queryVariable(I10 id, K9 *rt);
  851.  
  852.  
  853.  J10 *getVariable(I10 id, K9 *rt);
  854.  
  855.  
  856.  void removeVariable(I10 id, K9 *rt);
  857. };
  858. }
  859.  
  860.  
  861. #pragma once
  862.  
  863. #include <ostream>
  864. #include <vector>
  865.  
  866. namespace H10 {
  867.  
  868. class G8;
  869. class I12;
  870. class K9;
  871.  
  872. class J10 {
  873. private:
  874.  static int64_t total_V10s;
  875.  
  876. public:
  877.  int64_t id;
  878.  
  879.  bool is_H8 : 1;
  880.  
  881.  bool gc_mark : 1;
  882.  
  883.  bool can_modify : 1;
  884.  
  885.  bool single_use : 1;
  886.  
  887.  G8 *H8;
  888.  
  889.  I12 *type;
  890.  
  891.  
  892.  J10(bool is_H8, G8 *H8, I12 *type, K9 *rt);
  893.  
  894.  ~J10();
  895.  
  896.  
  897.  std::vector<J10 *> getGCReachable();
  898.  
  899.  
  900.  std::string userRepr(K9 *rt);
  901.  
  902.  
  903.  void assignTo(J10 *obj, K9 *rt);
  904.  
  905.  
  906.  void assignToCopyOf(J10 *obj, K9 *rt);
  907.  
  908.  virtual void spreadSingleUse();
  909.  
  910.  virtual void Y2();
  911. };
  912.  
  913. std::ostream &operator<<(std::ostream &stream, J10 *obj);
  914.  
  915. };
  916.  
  917.  
  918. #pragma once
  919.  
  920.  
  921.  
  922. #pragma once
  923.  
  924. #include <string>
  925. #include <vector>
  926.  
  927. namespace H10 {
  928. class Scope;
  929. class GC;
  930. class J10;
  931. class G8;
  932. class I12;
  933. class C4;
  934. class K11;
  935. class P8;
  936. class R8;
  937. class P6;
  938.  
  939. namespace Z9 {
  940.  class K5;
  941.  class I5;
  942.  class M4;
  943.  class J5;
  944.  class D9;
  945.  class V3;
  946.  class J6;
  947.  class Q7;
  948. }
  949. class K9 {
  950.  friend class GC;
  951.  
  952. private:
  953.  Z6<I10, J10 *> globals;
  954.  
  955.  Z6<I12 *, J10 *> registered_type_V10s;
  956.  C4 *Z3;
  957.  GC *gc;
  958.  
  959.  Z6<I10, J10 *> readonly_literals;
  960.  
  961.  J10 *protected_nothing;
  962.  J10 *protected_true;
  963.  J10 *protected_false;
  964.  
  965.  Scope *X11;
  966.  
  967.  uint8_t N2;
  968.  
  969.  enum C3 { U12 = 0, H9 = 1, D12 = 2, A11 = 4, N5 = 8 };
  970.  
  971. public:
  972.  class ErrorContext {
  973.  public:
  974.  S8 area;
  975.  
  976.  std::vector<S8> sub_areas;
  977.  };
  978.  
  979.  enum ContextId { AREA_CTX = -1, SUB0_CTX = 0, SUB1_CTX = 1, SUB2_CTX = 2, SUB3_CTX = 3 };
  980.  
  981.  enum J10Options { INSTANCE_OBJECT, TYPE_OBJECT };
  982.  
  983.  D4 *const S12;
  984.  
  985.  class {
  986.  public:
  987.  Z9::M4 *function;
  988.  Z9::K5 *nothing;
  989.  Z9::I5 *boolean;
  990.  Z9::J5 *integer;
  991.  Z9::D9 *real;
  992.  Z9::V3 *character;
  993.  Z9::J6 *string;
  994.  Z9::Q7 *array;
  995.  } E3;
  996.  
  997. private:
  998.  std::vector<ErrorContext> error_contexts;
  999.  
  1000. public:
  1001.  
  1002.  K9(P6 *gc_strategy, C4 *Z3, D4 *S12);
  1003.  
  1004.  ~K9() = default;
  1005.  
  1006.  
  1007.  bool checkGlobal(I10 id);
  1008.  
  1009.  
  1010.  J10 *getGlobal(I10 id);
  1011.  
  1012.  
  1013.  void setGlobal(I10 id, J10 *obj);
  1014.  
  1015.  
  1016.  void removeGlobal(I10 id);
  1017.  
  1018.  
  1019.  void registerI12J10(I12 *type, J10 *obj);
  1020.  
  1021.  
  1022.  J10 *getI12J10(I12 *type);
  1023.  
  1024.  
  1025.  J10 *S1();
  1026.  
  1027.  
  1028.  J10 *R1(bool val);
  1029.  
  1030.  
  1031.  void T3(bool can_access_prev_X11 = true);
  1032.  
  1033.  void S3();
  1034.  
  1035.  void S5();
  1036.  
  1037.  void T5();
  1038.  
  1039.  ErrorContext &R5();
  1040.  
  1041.  
  1042.  S8 &getS8(ContextId ctx_id);
  1043.  
  1044.  
  1045.  [[noreturn]]
  1046.  void T4(const std::string &message, const S8 &ta);
  1047.  
  1048.  
  1049.  J10 *execute(P8 *node, bool I0);
  1050.  J10 *execute(Z4 *node, bool I0);
  1051.  J10 *execute(A5 *node, bool I0);
  1052.  J10 *execute(I4 *node, bool I0);
  1053.  J10 *execute(Q8 *node, bool I0);
  1054.  J10 *execute(B5 *node, bool I0);
  1055.  J10 *execute(R8 *node, bool I0);
  1056.  J10 *execute(K3 *node, bool I0);
  1057.  J10 *execute(C5 *node, bool I0);
  1058.  J10 *execute(Y5 *node, bool I0);
  1059.  J10 *execute(T2 *node, bool I0);
  1060.  J10 *execute(L3 *node, bool I0);
  1061.  
  1062.  
  1063.  
  1064.  J10 *make(I12 *type, J10Options V10_opt);
  1065.  
  1066.  
  1067.  J10 *copy(J10 *obj);
  1068.  
  1069.  
  1070.  J10 *H5(I4::D6 id, J10 *obj, bool I0);
  1071.  
  1072.  
  1073.  J10 *H5(I4::D6 id, J10 *obj, J10 *arg, bool I0);
  1074.  
  1075.  
  1076.  J10 *H5(I4::D6 id,
  1077.  J10 *obj,
  1078.  const std::vector<J10 *> &args,
  1079.  bool I0);
  1080.  
  1081.  
  1082.  J10 *O7(I10 id, J10 *obj, const std::vector<J10 *> &args, bool I0);
  1083.  
  1084.  
  1085.  bool D3(J10 *obj);
  1086.  
  1087.  
  1088.  bool B4(J10 *obj, I12 *type = nullptr);
  1089.  
  1090.  
  1091.  bool Q1(J10 *obj, I12 *type = nullptr);
  1092.  
  1093.  
  1094.  bool F8(J10 *obj, I12 *type);
  1095.  
  1096.  
  1097.  void U0(J10 *obj, ContextId ctx_id = ContextId::AREA_CTX);
  1098.  
  1099.  
  1100.  void D1(J10 *obj, I12 *type, ContextId ctx_id = ContextId::AREA_CTX);
  1101.  
  1102.  
  1103.  void M0(J10 *obj, I12 *type, ContextId ctx_id = ContextId::AREA_CTX);
  1104.  
  1105.  
  1106.  void O2(J10 *obj, I12 *type, ContextId ctx_id = ContextId::AREA_CTX);
  1107.  
  1108.  
  1109.  void K0(const std::vector<J10 *> &args,
  1110.  int64_t amount,
  1111.  ContextId ctx_id = ContextId::AREA_CTX);
  1112.  
  1113.  
  1114.  void D0(const std::vector<J10 *> &args,
  1115.  int64_t amount,
  1116.  ContextId ctx_id = ContextId::AREA_CTX);
  1117.  
  1118.  void E0(const std::vector<J10 *> &args,
  1119.  int64_t amount,
  1120.  ContextId ctx_id = ContextId::AREA_CTX);
  1121.  
  1122.  void A0(const std::vector<J10 *> &args,
  1123.  int64_t amount,
  1124.  ContextId ctx_id = ContextId::AREA_CTX);
  1125.  
  1126.  
  1127.  void A2(J10 *obj, I10 id, ContextId ctx_id = ContextId::AREA_CTX);
  1128.  
  1129.  
  1130.  GC *getGC();
  1131.  
  1132.  
  1133.  C4 *getC4();
  1134.  
  1135.  
  1136.  Scope *E9();
  1137.  
  1138.  void W2();
  1139.  
  1140.  void A1();
  1141.  
  1142.  void W1();
  1143.  
  1144.  void K1();
  1145.  
  1146.  void N0();
  1147.  
  1148.  bool X2();
  1149.  
  1150.  bool H1();
  1151.  
  1152.  bool H2();
  1153.  
  1154.  bool X1();
  1155.  
  1156.  bool Q0();
  1157. };
  1158.  
  1159. namespace N4 {
  1160.  
  1161.  I10 Q6(K9 *rt);
  1162.  
  1163.  I10 R6(K9 *rt);
  1164.  
  1165.  I10 S6(K9 *rt);
  1166.  
  1167.  I10 T6(K9 *rt);
  1168.  
  1169.  I10 W7(K9 *rt);
  1170.  
  1171.  I10 mm__real__(K9 *rt);
  1172.  
  1173.  I10 S4(K9 *rt);
  1174.  
  1175.  I10 U6(K9 *rt);
  1176.  
  1177.  I10 V6(K9 *rt);
  1178.  
  1179. }
  1180. typedef J10 *(*LibraryLoadPoint)(K9 *rt);
  1181.  
  1182. #define icast(ins, type) ((type *)ins)
  1183. }
  1184.  
  1185.  
  1186. #pragma once
  1187.  
  1188. namespace H10 {
  1189.  
  1190. class K9;
  1191. class J10;
  1192.  
  1193.  
  1194. class G8 {
  1195. public:
  1196.  static int64_t total_H8s;
  1197.  int64_t id;
  1198.  bool gc_mark : 1;
  1199.  
  1200.  
  1201.  G8(K9 *rt, size_t bytes);
  1202.  
  1203.  virtual ~G8() = default;
  1204.  
  1205.  
  1206.  virtual J10 *selectField(I10 id, K9 *rt);
  1207.  
  1208.  
  1209.  virtual bool hasField(I10 id, K9 *rt);
  1210.  
  1211.  
  1212.  virtual void addField(I10 id, J10 *obj, K9 *rt);
  1213.  
  1214.  
  1215.  virtual std::vector<J10 *> getGCReachable();
  1216.  
  1217.  
  1218.  virtual G8 *copy(K9 *rt) = 0;
  1219.  
  1220.  
  1221.  virtual size_t getSize() = 0;
  1222.  
  1223.  
  1224.  virtual std::string userRepr(K9 *rt) = 0;
  1225.  
  1226.  virtual void spreadSingleUse();
  1227.  
  1228.  virtual void Y2();
  1229. };
  1230.  
  1231. }
  1232.  
  1233.  
  1234. #pragma once
  1235.  
  1236.  
  1237. namespace H10 {
  1238.  
  1239. class J10;
  1240. class K9;
  1241. class I12;
  1242.  
  1243. typedef J10 *(*T0)(J10 *self, K9 *rt, bool I0);
  1244. typedef J10 *(*R0)(J10 *self, J10 *arg, K9 *rt, bool I0);
  1245. typedef J10 *(*C1)(J10 *self,
  1246.  const std::vector<J10 *> &args,
  1247.  K9 *rt,
  1248.  bool I0);
  1249.  
  1250. class I12 {
  1251.  friend class K9;
  1252.  
  1253. public: static int64_t total_types;
  1254.  
  1255.  T0 W6, X6, Y7, Z7, O5, P5, B11,
  1256.  Y6;
  1257.  R0 F10, C11, D11, A8, B8, E11, F11, E12, G11, F12,
  1258.  H11, G12, I11, C8, D8, I9, J11, H12;
  1259.  C1 G10, J9;
  1260.  
  1261.  Z6<I10, J10 *> S9;
  1262.  
  1263. public:
  1264.  int64_t id;
  1265.  
  1266.  bool gc_mark : 1;
  1267.  
  1268.  
  1269.  I12(K9 *rt);
  1270.  
  1271.  ~I12();
  1272.  
  1273.  
  1274.  void S7(I10 id, J10 *R10);
  1275.  
  1276.  
  1277.  J10 *E8(I10 id, K9 *rt);
  1278.  
  1279.  
  1280.  bool A7(I10 id);
  1281.  
  1282.  
  1283.  void Q5(I4::D6 id, T0 op);
  1284.  void Q5(I4::D6 id, R0 op);
  1285.  void Q5(I4::D6 id, C1 op);
  1286.  
  1287.  virtual std::vector<J10 *> getGCReachable();
  1288.  virtual size_t getG8Size() = 0;
  1289.  virtual J10 *create(K9 *rt) = 0;
  1290.  virtual J10 *copy(J10 *obj, K9 *rt) = 0;
  1291.  
  1292.  virtual std::string userRepr(K9 *rt) = 0;
  1293. };
  1294.  
  1295. };
  1296.  
  1297.  
  1298. #pragma once
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304. #pragma once
  1305.  
  1306.  
  1307. namespace H10::Z9 {
  1308. void installZ9Functions(K9 *rt);
  1309. }
  1310.  
  1311.  
  1312. #pragma once
  1313.  
  1314.  
  1315. #pragma once
  1316.  
  1317.  
  1318.  
  1319. #pragma once
  1320.  
  1321. namespace H10::Z9 {
  1322.  
  1323. typedef J10 *(*InternalFunction)(const std::vector<J10 *> &args, K9 *rt, bool I0);
  1324.  
  1325. class Y1: public G8 {
  1326. public:
  1327.  bool is_internal;
  1328.  InternalFunction internal_ptr; Z4 *cotton_ptr;
  1329.  Y1(K9 *rt);
  1330.  ~Y1();
  1331.  
  1332.  void init(bool is_internal, InternalFunction internal_ptr, Z4 *cotton_ptr);
  1333.  G8 *copy(K9 *rt);
  1334.  size_t getSize();
  1335.  std::string userRepr(K9 *rt);
  1336. };
  1337.  
  1338. class M4: public I12 {
  1339. public:
  1340.  size_t getG8Size();
  1341.  M4(K9 *rt);
  1342.  ~M4() = default;
  1343.  J10 *create(K9 *rt);
  1344.  J10 *copy(J10 *obj, K9 *rt);
  1345.  std::string userRepr(K9 *rt);
  1346. };
  1347.  
  1348. void installFunctionMethods(I12 *type, K9 *rt);
  1349.  
  1350. J10 *
  1351. C0(bool is_internal, InternalFunction internal_ptr, Z4 *cotton_ptr, K9 *rt);
  1352. }
  1353.  
  1354.  
  1355. #pragma once
  1356.  
  1357. namespace H10::Z9 {
  1358.  
  1359. class I2: public G8 {
  1360. public:
  1361.  bool N11;
  1362.  
  1363.  I2(K9 *rt);
  1364.  ~I2();
  1365.  
  1366.  G8 *copy(K9 *rt);
  1367.  size_t getSize();
  1368.  std::string userRepr(K9 *rt);
  1369. };
  1370.  
  1371. class I5: public I12 {
  1372. public:
  1373.  size_t getG8Size();
  1374.  I5(K9 *rt);
  1375.  ~I5() = default;
  1376.  J10 *create(K9 *rt);
  1377.  J10 *copy(J10 *obj, K9 *rt);
  1378.  std::string userRepr(K9 *rt);
  1379. };
  1380.  
  1381. void installBooleanMethods(I12 *type, K9 *rt);
  1382.  
  1383. J10 *F0(bool N11, K9 *rt);
  1384.  
  1385. bool &getBooleanValue(J10 *obj, K9 *rt);
  1386. bool &getBooleanValue(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1387. #define W0(obj) (icast(obj->H8, H10::Z9::I2)->N11)
  1388. }
  1389.  
  1390.  
  1391. #pragma once
  1392.  
  1393. namespace H10::Z9 {
  1394.  
  1395. class M1: public G8 {
  1396. public:
  1397.  uint8_t N11;
  1398.  
  1399.  M1(K9 *rt);
  1400.  ~M1();
  1401.  
  1402.  G8 *copy(K9 *rt);
  1403.  size_t getSize();
  1404.  std::string userRepr(K9 *rt);
  1405. };
  1406.  
  1407. class V3: public I12 {
  1408. public:
  1409.  size_t getG8Size();
  1410.  V3(K9 *rt);
  1411.  ~V3() = default;
  1412.  J10 *create(K9 *rt);
  1413.  J10 *copy(J10 *obj, K9 *rt);
  1414.  std::string userRepr(K9 *rt);
  1415. };
  1416.  
  1417. J10 *B0(uint8_t N11, K9 *rt);
  1418.  
  1419. void installP7Methods(I12 *type, K9 *rt);
  1420.  
  1421. uint8_t &getP7Value(J10 *obj, K9 *rt);
  1422. uint8_t &getP7Value(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1423. #define getP7ValueFast(obj) (icast(obj->H8, H10::Z9::M1)->N11)
  1424. }
  1425.  
  1426.  
  1427. #pragma once
  1428.  
  1429. namespace H10::Z9 {
  1430. class RecordG8: public G8 {
  1431. public:
  1432.  Z6<I10, J10 *> Q10;
  1433.  I10 Y10;
  1434.  RecordG8(K9 *rt);
  1435.  ~RecordG8();
  1436.  J10 *selectField(I10 id, K9 *rt);
  1437.  bool hasField(I10 id, K9 *rt);
  1438.  void addField(I10 id, J10 *obj, K9 *rt);
  1439.  
  1440.  G8 *copy(K9 *rt);
  1441.  size_t getSize();
  1442.  std::string userRepr(K9 *rt);
  1443.  std::vector<J10 *> getGCReachable();
  1444. };
  1445.  
  1446. class RecordI12: public I12 {
  1447. public:
  1448.  I10 Y10;
  1449.  std::vector<I10> H8_Q10;
  1450.  
  1451.  size_t getG8Size();
  1452.  RecordI12(K9 *rt);
  1453.  ~RecordI12() = default;
  1454.  J10 *create(K9 *rt);
  1455.  std::string userRepr(K9 *rt);
  1456.  J10 *copy(J10 *obj, K9 *rt);
  1457. };
  1458.  
  1459. RecordI12 *makeRecordI12(I10 Y10, K9 *rt);
  1460.  
  1461. }
  1462.  
  1463.  
  1464. #pragma once
  1465.  
  1466. namespace H10::Z9 {
  1467. class K2: public G8 {
  1468. public:
  1469.  K2(K9 *rt);
  1470.  ~K2();
  1471.  
  1472.  G8 *copy(K9 *rt);
  1473.  size_t getSize();
  1474.  std::string userRepr(K9 *rt);
  1475. };
  1476.  
  1477. class K5: public I12 {
  1478. public:
  1479.  size_t getG8Size();
  1480.  K5(K9 *rt);
  1481.  ~K5() = default;
  1482.  J10 *create(K9 *rt);
  1483.  std::string userRepr(K9 *rt);
  1484.  J10 *copy(J10 *obj, K9 *rt);
  1485. };
  1486.  
  1487. void installNothingMethods(I12 *type, K9 *rt);
  1488.  
  1489. J10 *H0(K9 *rt);
  1490. }
  1491.  
  1492.  
  1493. #pragma once
  1494.  
  1495. namespace H10::Z9 {
  1496.  
  1497. class L4: public G8 {
  1498. public:
  1499.  double N11;
  1500.  
  1501.  L4(K9 *rt);
  1502.  ~L4();
  1503.  
  1504.  G8 *copy(K9 *rt);
  1505.  size_t getSize();
  1506.  std::string userRepr(K9 *rt);
  1507. };
  1508.  
  1509. class D9: public I12 {
  1510. public:
  1511.  size_t getG8Size();
  1512.  D9(K9 *rt);
  1513.  ~D9() = default;
  1514.  J10 *create(K9 *rt);
  1515.  J10 *copy(J10 *obj, K9 *rt);
  1516.  std::string userRepr(K9 *rt);
  1517. };
  1518.  
  1519. void installRealMethods(I12 *type, K9 *rt);
  1520.  
  1521. J10 *makeL4J10(double N11, K9 *rt);
  1522.  
  1523. double &getRealValue(J10 *obj, K9 *rt);
  1524. double &getRealValue(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1525. #define Z1(obj) (icast(obj->H8, H10::Z9::L4)->N11)
  1526. }
  1527.  
  1528.  
  1529. #pragma once
  1530.  
  1531.  
  1532.  
  1533.  
  1534. #pragma once
  1535.  
  1536. namespace H10::Z9 {
  1537.  
  1538. class U3: public G8 {
  1539. public:
  1540.  std::vector<J10 *> Q12;
  1541.  
  1542.  U3(K9 *rt);
  1543.  ~U3();
  1544.  
  1545.  G8 *copy(K9 *rt);
  1546.  size_t getSize();
  1547.  std::string userRepr(K9 *rt);
  1548.  std::vector<J10 *> getGCReachable();
  1549.  void spreadSingleUse();
  1550.  void Y2();
  1551. };
  1552.  
  1553. class Q7: public I12 {
  1554. public:
  1555.  size_t getG8Size();
  1556.  Q7(K9 *rt);
  1557.  ~Q7() = default;
  1558.  J10 *create(K9 *rt);
  1559.  J10 *copy(J10 *obj, K9 *rt);
  1560.  std::string userRepr(K9 *rt);
  1561. };
  1562.  
  1563. void installArrayMethods(I12 *type, K9 *rt);
  1564. J10 *L0(const std::vector<J10 *> &Q12, K9 *rt);
  1565.  
  1566. std::vector<J10 *> &getArrayData(J10 *obj, K9 *rt);
  1567. std::vector<J10 *> &getArrayData(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1568. #define getArrayDataFast(obj) (icast(obj->H8, H10::Z9::U3)->Q12)
  1569. }
  1570.  
  1571.  
  1572. #pragma once
  1573.  
  1574. namespace H10::Z9 {
  1575.  
  1576. class Z2: public G8 {
  1577. public:
  1578.  std::string Q12;
  1579.  
  1580.  Z2(K9 *rt);
  1581.  ~Z2();
  1582.  
  1583.  G8 *copy(K9 *rt);
  1584.  size_t getSize();
  1585.  std::string userRepr(K9 *rt);
  1586. };
  1587.  
  1588. class J6: public I12 {
  1589. public:
  1590.  size_t getG8Size();
  1591.  J6(K9 *rt);
  1592.  ~J6() = default;
  1593.  J10 *create(K9 *rt);
  1594.  J10 *copy(J10 *obj, K9 *rt);
  1595.  std::string userRepr(K9 *rt);
  1596. };
  1597.  
  1598. void installStringMethods(I12 *type, K9 *rt);
  1599.  
  1600. J10 *J0(const std::string &str, K9 *rt);
  1601.  
  1602. std::string &R7Data(J10 *obj, K9 *rt);
  1603. std::string &R7Data(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1604. #define L1(obj) (icast(obj->H8, H10::Z9::Z2)->Q12)
  1605. }
  1606.  
  1607.  
  1608. #pragma once
  1609.  
  1610. namespace H10::Z9 {
  1611.  
  1612. class J2: public G8 {
  1613. public:
  1614.  int64_t N11;
  1615.  
  1616.  J2(K9 *rt);
  1617.  ~J2();
  1618.  
  1619.  G8 *copy(K9 *rt);
  1620.  size_t getSize();
  1621.  std::string userRepr(K9 *rt);
  1622. };
  1623.  
  1624. class J5: public I12 {
  1625. public:
  1626.  size_t getG8Size();
  1627.  J5(K9 *rt);
  1628.  ~J5() = default;
  1629.  J10 *create(K9 *rt);
  1630.  J10 *copy(J10 *obj, K9 *rt);
  1631.  std::string userRepr(K9 *rt);
  1632. };
  1633.  
  1634. void installIntegerMethods(I12 *type, K9 *rt);
  1635.  
  1636. J10 *G0(int64_t N11, K9 *rt);
  1637.  
  1638. int64_t &getIntegerValue(J10 *obj, K9 *rt);
  1639. int64_t &getIntegerValue(J10 *obj, K9 *rt, K9::ContextId ctx_id);
  1640. #define V0(obj) (icast(obj->H8, H10::Z9::J2)->N11)
  1641. }
  1642.  
  1643.  
  1644. #include <cctype>
  1645.  
  1646. namespace H10 {
  1647.  
  1648. K11::K11() {
  1649.  this->id = W4;
  1650.  this->Q12 = "";
  1651.  this->N7 = -1;
  1652.  this->A10 = -1;
  1653.  this->C9 = "";
  1654. }
  1655.  
  1656. K11::K11(const std::string &Q12, int64_t N7, int64_t A10, const std::string &C9) {
  1657.  this->id = W4;
  1658.  this->Q12 = Q12;
  1659.  this->N7 = N7;
  1660.  this->A10 = A10;
  1661.  this->C9 = C9;
  1662. }
  1663.  
  1664. static char getP7(std::string::const_iterator &it, const std::string &str, C4 *Z3) {
  1665.  char res;
  1666.  if (*it == '\\') {
  1667.  if (it + 1 == str.end()) {
  1668.  Z3->T4("Expected a character", it + 1 - str.begin());
  1669.  }
  1670.  switch (it[1]) {
  1671.  case 'a' : res = '\a'; break;
  1672.  case 'b' : res = '\b'; break;
  1673.  case 'f' : res = '\f'; break;
  1674.  case 'n' : res = '\n'; break;
  1675.  case 'r' : res = '\r'; break;
  1676.  case 't' : res = '\t'; break;
  1677.  case 'v' : res = '\v'; break;
  1678.  case '\\' : res = '\\'; break;
  1679.  case '\"' : res = '\"'; break;
  1680.  case '\'' : res = '\''; break;
  1681.  default : Z3->T4("Invalid character", it + 1 - str.begin());
  1682.  }
  1683.  it += 2;
  1684.  }
  1685.  else {
  1686.  res = *it;
  1687.  it++;
  1688.  }
  1689.  
  1690.  return res;
  1691. }
  1692.  
  1693. static std::string B12String(const std::string &str, C4 *Z3) {
  1694.  eassert(!str.empty(), "Empty string", Z3);
  1695.  std::string res;
  1696.  if (str.front() == '\"') {
  1697.  auto it = str.begin() + 1;
  1698.  while (it != str.end() && *it != '\"') {
  1699.  res += getP7(it, str, Z3);
  1700.  }
  1701.  eassert(*it == '\"', "Expected a string end", Z3);
  1702.  }
  1703.  else {
  1704.  auto it = str.begin() + 1;
  1705.  eassert(it != str.end() && *it != '\'', "Expected a character", Z3);
  1706.  res += getP7(it, str, Z3);
  1707.  eassert(*it == '\'', "Expected a character end", Z3);
  1708.  }
  1709.  return res;
  1710. }
  1711.  
  1712. void K11::Y11ify(C4 *Z3) {
  1713.  if (this->Q12 == "(") {
  1714.  this->id = E4;
  1715.  }
  1716.  else if (this->Q12 == ")") {
  1717.  this->id = F3;
  1718.  }
  1719.  else if (this->Q12 == "type") {
  1720.  this->id = M9;
  1721.  }
  1722.  else if (this->Q12 == "{") {
  1723.  this->id = F1;
  1724.  }
  1725.  else if (this->Q12 == "}") {
  1726.  this->id = X0;
  1727.  }
  1728.  else if (this->Q12 == ";") {
  1729.  this->id = B7;
  1730.  }
  1731.  else if (this->Q12 == "R10") {
  1732.  this->id = C7;
  1733.  }
  1734.  else if (this->Q12 == "function") {
  1735.  this->id = U4;
  1736.  }
  1737.  else if (this->Q12 == ",") {
  1738.  this->id = O11;
  1739.  }
  1740.  else if (this->Q12 == "++") {
  1741.  this->id = F4;
  1742.  }
  1743.  else if (this->Q12 == "--") {
  1744.  this->id = P2;
  1745.  }
  1746.  else if (this->Q12 == "[") {
  1747.  this->id = Y0;
  1748.  }
  1749.  else if (this->Q12 == "]") {
  1750.  this->id = S0;
  1751.  }
  1752.  else if (this->Q12 == ".") {
  1753.  this->id = L10;
  1754.  }
  1755.  else if (this->Q12 == "@") {
  1756.  this->id = P11;
  1757.  }
  1758.  else if (this->Q12 == "+") {
  1759.  this->id = N9;
  1760.  }
  1761.  else if (this->Q12 == "-") {
  1762.  this->id = I8;
  1763.  }
  1764.  else if (this->Q12 == "!") {
  1765.  this->id = M10;
  1766.  }
  1767.  else if (this->Q12 == "~") {
  1768.  this->id = U5;
  1769.  }
  1770.  else if (this->Q12 == "*") {
  1771.  this->id = O9;
  1772.  }
  1773.  else if (this->Q12 == "/") {
  1774.  this->id = N10;
  1775.  }
  1776.  else if (this->Q12 == "%") {
  1777.  this->id = G4;
  1778.  }
  1779.  else if (this->Q12 == ">>") {
  1780.  this->id = Q2;
  1781.  }
  1782.  else if (this->Q12 == "<<") {
  1783.  this->id = G3;
  1784.  }
  1785.  else if (this->Q12 == "<") {
  1786.  this->id = P9;
  1787.  }
  1788.  else if (this->Q12 == "<=") {
  1789.  this->id = H3;
  1790.  }
  1791.  else if (this->Q12 == ">") {
  1792.  this->id = V5;
  1793.  }
  1794.  else if (this->Q12 == ">=") {
  1795.  this->id = T1;
  1796.  }
  1797.  else if (this->Q12 == "==") {
  1798.  this->id = J8;
  1799.  }
  1800.  else if (this->Q12 == "!=") {
  1801.  this->id = H4;
  1802.  }
  1803.  else if (this->Q12 == "&") {
  1804.  this->id = D7;
  1805.  }
  1806.  else if (this->Q12 == "^") {
  1807.  this->id = E7;
  1808.  }
  1809.  else if (this->Q12 == "|") {
  1810.  this->id = K8;
  1811.  }
  1812.  else if (this->Q12 == "and") {
  1813.  this->id = O10;
  1814.  }
  1815.  else if (this->Q12 == "or") {
  1816.  this->id = Q11;
  1817.  }
  1818.  else if (this->Q12 == "=") {
  1819.  this->id = F7;
  1820.  }
  1821.  else if (this->Q12 == "+=") {
  1822.  this->id = R2;
  1823.  }
  1824.  else if (this->Q12 == "-=") {
  1825.  this->id = C2;
  1826.  }
  1827.  else if (this->Q12 == "*=") {
  1828.  this->id = S2;
  1829.  }
  1830.  else if (this->Q12 == "/=") {
  1831.  this->id = I3;
  1832.  }
  1833.  else if (this->Q12 == "%=") {
  1834.  this->id = Z0;
  1835.  }
  1836.  else if (this->Q12 == "true" || this->Q12 == "false") {
  1837.  this->id = V4;
  1838.  this->bool_N11 = this->Q12 == "true";
  1839.  }
  1840.  else if (this->Q12 == "nothing") {
  1841.  this->id = W4;
  1842.  }
  1843.  else if (this->Q12 == "while") {
  1844.  this->id = L8;
  1845.  }
  1846.  else if (this->Q12 == "for") {
  1847.  this->id = P10;
  1848.  }
  1849.  else if (this->Q12 == "if") {
  1850.  this->id = R11;
  1851.  }
  1852.  else if (this->Q12 == "else") {
  1853.  this->id = Q9;
  1854.  }
  1855.  else if (this->Q12 == "continue") {
  1856.  this->id = X4;
  1857.  }
  1858.  else if (this->Q12 == "break") {
  1859.  this->id = M8;
  1860.  }
  1861.  else if (this->Q12 == "return") {
  1862.  this->id = G7;
  1863.  }
  1864.  else if (this->Q12 == "unX11d") {
  1865.  this->id = Y4;
  1866.  }
  1867.  else if (this->Q12.size() > 0 && this->Q12.front() == '\"' && this->Q12.back() == '\"') {
  1868.  this->id = W5;
  1869.  this->string_N11 = B12String(this->Q12, Z3);
  1870.  }
  1871.  else if (this->Q12.size() > 0 && this->Q12.front() == '\'' && this->Q12.back() == '\'') {
  1872.  this->id = N8;
  1873.  this->char_N11 = B12String(this->Q12, Z3)[0];
  1874.  }
  1875.  else {
  1876.  int64_t int_N11;
  1877.  double real_N11;
  1878.  size_t pos;
  1879.  
  1880.  try {
  1881.  int_N11 = std::stoll(this->Q12, &pos);
  1882.  if (pos == this->Q12.size()) {
  1883.  this->id = R9;
  1884.  this->int_N11 = int_N11;
  1885.  return;
  1886.  }
  1887.  } catch (...) {
  1888.  }
  1889.  
  1890.  
  1891.  try {
  1892.  real_N11 = std::stod(this->Q12, &pos);
  1893.  if (pos == this->Q12.size()) {
  1894.  this->id = O8;
  1895.  this->real_N11 = real_N11;
  1896.  return;
  1897.  }
  1898.  } catch (...) {
  1899.  }
  1900.  
  1901.  
  1902.  this->id = X5;
  1903.  }
  1904. }
  1905.  
  1906. std::ostream &operator<<(std::ostream &out, const K11 &L11) {
  1907.  switch (L11.id) {
  1908.  case K11::E4 : out << "("; break;
  1909.  case K11::F3 : out << ")"; break;
  1910.  case K11::M9 : out << "type"; break;
  1911.  case K11::F1 : out << "{"; break;
  1912.  case K11::X0 : out << "}"; break;
  1913.  case K11::B7 : out << ";"; break;
  1914.  case K11::C7 : out << "R10"; break;
  1915.  case K11::U4 : out << "function"; break;
  1916.  case K11::O11 : out << ","; break;
  1917.  case K11::F4 : out << "++"; break;
  1918.  case K11::P2 : out << "--"; break;
  1919.  case K11::Y0 : out << "["; break;
  1920.  case K11::S0 : out << "]"; break;
  1921.  case K11::L10 : out << "."; break;
  1922.  case K11::P11 : out << "@"; break;
  1923.  case K11::N9 : out << "+"; break;
  1924.  case K11::I8 : out << "-"; break;
  1925.  case K11::M10 : out << "!"; break;
  1926.  case K11::U5 : out << "~"; break;
  1927.  case K11::O9 : out << "*"; break;
  1928.  case K11::N10 : out << "/"; break;
  1929.  case K11::G4 : out << "%"; break;
  1930.  case K11::Q2 : out << ">>"; break;
  1931.  case K11::G3 : out << "<<"; break;
  1932.  case K11::P9 : out << "<"; break;
  1933.  case K11::H3 : out << ">"; break;
  1934.  case K11::V5 : out << ">"; break;
  1935.  case K11::T1 : out << ">="; break;
  1936.  case K11::J8 : out << "=="; break;
  1937.  case K11::H4 : out << "!="; break;
  1938.  case K11::D7 : out << "&"; break;
  1939.  case K11::E7 : out << "^"; break;
  1940.  case K11::K8 : out << "|"; break;
  1941.  case K11::O10 : out << "and"; break;
  1942.  case K11::Q11 : out << "or"; break;
  1943.  case K11::F7 : out << "="; break;
  1944.  case K11::R2 : out << "+="; break;
  1945.  case K11::C2 : out << "-="; break;
  1946.  case K11::S2 : out << "*="; break;
  1947.  case K11::I3 : out << "/="; break;
  1948.  case K11::Z0 : out << "%="; break;
  1949.  case K11::V4 : out << (L11.bool_N11 ? "true" : "false"); break;
  1950.  case K11::W4 : out << "nothing"; break;
  1951.  case K11::L8 : out << "while"; break;
  1952.  case K11::P10 : out << "for"; break;
  1953.  case K11::R11 : out << "if"; break;
  1954.  case K11::Q9 : out << "else"; break;
  1955.  case K11::X4 : out << "continue"; break;
  1956.  case K11::M8 : out << "break"; break;
  1957.  case K11::G7 : out << "return"; break;
  1958.  case K11::Y4 : out << "unX11d"; break;
  1959.  case K11::W5 : out << "\"" << L11.string_N11 << "\""; break;
  1960.  case K11::N8 : out << "\'" << L11.char_N11 << "\'"; break;
  1961.  case K11::R9 : out << L11.int_N11; break;
  1962.  case K11::O8 : out << L11.real_N11; break;
  1963.  case K11::X5 : out << "id:" << L11.Q12; break;
  1964.  }
  1965.  
  1966.  return out;
  1967. }
  1968.  
  1969. static void skipString(M11 &lexer, std::string::iterator &it, std::string &str) {
  1970.  auto Q4 = it;
  1971.  bool found_end = false;
  1972.  it++;
  1973.  while (it != str.end()) {
  1974.  if (*it == '\"') {
  1975.  int cnt = 0;
  1976.  auto it2 = it - 1;
  1977.  while (it2 != Q4 && *it2 == '\\') {
  1978.  cnt++;
  1979.  it2--;
  1980.  }
  1981.  
  1982.  if (cnt % 2 == 0) {
  1983.  found_end = true;
  1984.  break;
  1985.  }
  1986.  }
  1987.  
  1988.  it++;
  1989.  }
  1990.  if (!found_end) {
  1991.  lexer.Z3->T4("Expected the end of the string", it - str.begin());
  1992.  }
  1993.  it++;
  1994. }
  1995.  
  1996. static void skipP7(M11 &lexer, std::string::iterator &it, std::string &str) {
  1997.  it++;
  1998.  
  1999.  if (it == str.end()) {
  2000.  lexer.Z3->T4("Expected a character", it - str.begin());
  2001.  }
  2002.  
  2003.  if (*it == '\'') {
  2004.  lexer.Z3->T4("P7 cannot be empty", it - str.begin());
  2005.  }
  2006.  
  2007.  if (*it == '\\') {
  2008.  it++;
  2009.  }
  2010.  
  2011.  if (it == str.end()) {
  2012.  lexer.Z3->T4("Expected the end of the character", it - str.begin());
  2013.  }
  2014.  
  2015.  it++;
  2016.  
  2017.  if (*it != '\'') {
  2018.  lexer.Z3->T4("Expected the end of the character", it - str.begin());
  2019.  }
  2020.  
  2021.  it++;
  2022. }
  2023.  
  2024. void M11::faze1FillComments(std::string &input) {
  2025.  auto it = input.begin();
  2026.  while (it != input.end()) {
  2027.  if (*it == '\"') {
  2028.  skipString(*this, it, input);
  2029.  }
  2030.  else if (*it == '\'') {
  2031.  skipP7(*this, it, input);
  2032.  }
  2033.  else if (*it == '/' && it + 1 != input.end() && it[1] == '*') {
  2034.  while (it != input.end()) {
  2035.  if (*it == '*' && it + 1 != input.end() && it[1] == '/') {
  2036.  *it = ' ';
  2037.  it[1] = ' ';
  2038.  it += 2;
  2039.  break;
  2040.  }
  2041.  *it = ' ';
  2042.  it++;
  2043.  }
  2044.  }
  2045.  else if (*it == '/' && it + 1 != input.end() && it[1] == '/') {
  2046.  while (it != input.end()) {
  2047.  if (*it == '\n') {
  2048.  *it = ' ';
  2049.  it++;
  2050.  break;
  2051.  }
  2052.  *it = ' ';
  2053.  it++;
  2054.  }
  2055.  }
  2056.  
  2057.  else {
  2058.  it++;
  2059.  }
  2060.  }
  2061. }
  2062.  
  2063. std::vector<K11> M11::faze2FormConnectedK11s(const std::string &input) {
  2064.  std::string buf;
  2065.  std::vector<K11> L11s;
  2066.  auto it = input.begin();
  2067.  
  2068.  while (it != input.end()) {
  2069.  if (*it == '"') {
  2070.  if (!buf.empty()) {
  2071.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2072.  buf.clear();
  2073.  }
  2074.  auto Q4 = it;
  2075.  it++;
  2076.  while (*it != '"') {
  2077.  getP7(it, input, this->Z3);
  2078.  }
  2079.  this->Z3->setErrorCharPos(it - input.begin());
  2080.  eassert(*it == '\"', "String doesn't end with a double quote", this->Z3);
  2081.  it++;
  2082.  auto O6 = it;
  2083.  
  2084.  it = Q4;
  2085.  while (it != O6) {
  2086.  buf += *it;
  2087.  it++;
  2088.  }
  2089.  
  2090.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2091.  L11s.back().id = K11::W5;
  2092.  buf.clear();
  2093.  }
  2094.  else if (*it == '\'') {
  2095.  if (!buf.empty()) {
  2096.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2097.  buf.clear();
  2098.  }
  2099.  auto char_begin = it;
  2100.  it++;
  2101.  getP7(it, input, this->Z3);
  2102.  this->Z3->setErrorCharPos(it - input.begin());
  2103.  eassert(*it == '\'', "P7 doesn't end with a single quote", this->Z3);
  2104.  it++;
  2105.  auto char_end = it;
  2106.  
  2107.  it = char_begin;
  2108.  while (it != char_end) {
  2109.  buf += *it;
  2110.  it++;
  2111.  }
  2112.  
  2113.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2114.  L11s.back().id = K11::N8;
  2115.  buf.clear();
  2116.  }
  2117.  else if (isspace(*it)) {
  2118.  if (!buf.empty()) {
  2119.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2120.  buf.clear();
  2121.  }
  2122.  it++;
  2123.  }
  2124.  else {
  2125.  buf += *it;
  2126.  it++;
  2127.  }
  2128.  }
  2129.  if (!buf.empty()) {
  2130.  L11s.push_back(K11(buf, it - input.begin() - buf.size(), it - input.begin(), ""));
  2131.  buf.clear();
  2132.  }
  2133.  return L11s;
  2134. }
  2135.  
  2136. static std::vector<std::string> sortedSplitters
  2137. = {"(", ")", "{", "}", "@", ";", "++", "--", "[", "]", "+=", "-=", "!=", "~", "*=", "/=", "%=", ">>",
  2138.  "<<", "<=", "<", ">=", ">", "==", "!", "&", "^", "|", "=", "+", "-", "*", "/", "%", ","};
  2139.  
  2140. static void splitByOperator(const K11 &L11,
  2141.  std::string::const_iterator &split_end,
  2142.  std::string::const_iterator &it,
  2143.  std::vector<K11> &res,
  2144.  const std::string &splitter) {
  2145.  if (it != split_end) {
  2146.  K11 t(L11.Q12.substr(split_end - L11.Q12.begin(), it - split_end),
  2147.  split_end - L11.Q12.begin() + L11.N7,
  2148.  it - L11.Q12.begin() + L11.N7,
  2149.  "");
  2150.  res.push_back(t);
  2151.  split_end = it;
  2152.  }
  2153.  it += splitter.size();
  2154.  {
  2155.  K11 t(L11.Q12.substr(split_end - L11.Q12.begin(), it - split_end),
  2156.  split_end - L11.Q12.begin() + L11.N7,
  2157.  it - L11.Q12.begin() + L11.N7,
  2158.  "");
  2159.  res.push_back(t);
  2160.  split_end = it;
  2161.  }
  2162. }
  2163.  
  2164. std::vector<K11> M11::faze3SplitByOperatorsAndSeparators(const std::vector<K11> &L11s) {
  2165.  std::vector<K11> res;
  2166.  for (auto &L11 : L11s) {
  2167.  auto it = L11.Q12.begin();
  2168.  auto split_end = it;
  2169.  while (it != L11.Q12.end()) {
  2170.  bool f = false;
  2171.  for (auto &splitter : sortedSplitters) {
  2172.  if (L11.id != K11::W5 && L11.id != K11::N8
  2173.  && L11.Q12.substr(it - L11.Q12.begin(), splitter.size()) == splitter)
  2174.  {
  2175.  f = true;
  2176.  splitByOperator(L11, split_end, it, res, splitter);
  2177.  break;
  2178.  }
  2179.  }
  2180.  if (!f) {
  2181.  it++;
  2182.  }
  2183.  }
  2184.  
  2185.  if (it != split_end) {
  2186.  K11 t(L11.Q12.substr(split_end - L11.Q12.begin(), it - split_end),
  2187.  split_end - L11.Q12.begin() + L11.N7,
  2188.  it - L11.Q12.begin() + L11.N7,
  2189.  "");
  2190.  res.push_back(t);
  2191.  split_end = it;
  2192.  }
  2193.  }
  2194.  return res;
  2195. }
  2196.  
  2197. std::vector<K11> M11::faze4FindRealNumbers(const std::vector<K11> &L11s) {
  2198.  std::vector<K11> res;
  2199.  for (auto &L11 : L11s) {
  2200.  if (!L11.Q12.empty() && L11.Q12[0] != '\"' && L11.Q12[0] != '\'') {
  2201.  if (L11.Q12.find(".") != L11.Q12.npos) {
  2202.  try {
  2203.  size_t ptr;
  2204.  std::stod(L11.Q12, &ptr);
  2205.  if (ptr == L11.Q12.size()) {
  2206.  res.push_back(L11);
  2207.  continue;
  2208.  }
  2209.  } catch (...) {
  2210.  }
  2211.  
  2212.  auto it = L11.Q12.begin();
  2213.  auto split_end = it;
  2214.  bool f = false;
  2215.  std::string splitter = ".";
  2216.  while (it != L11.Q12.end()) {
  2217.  if (L11.Q12.substr(it - L11.Q12.begin(), splitter.size()) == splitter) {
  2218.  f = true;
  2219.  splitByOperator(L11, split_end, it, res, splitter);
  2220.  }
  2221.  else {
  2222.  it++;
  2223.  }
  2224.  }
  2225.  
  2226.  if (it != split_end) {
  2227.  K11 t(L11.Q12.substr(split_end - L11.Q12.begin(), it - split_end),
  2228.  split_end - L11.Q12.begin() + L11.N7,
  2229.  it - L11.Q12.begin() + L11.N7,
  2230.  "");
  2231.  res.push_back(t);
  2232.  split_end = it;
  2233.  }
  2234.  }
  2235.  else {
  2236.  res.push_back(L11);
  2237.  }
  2238.  }
  2239.  else {
  2240.  res.push_back(L11);
  2241.  }
  2242.  }
  2243.  return res;
  2244. }
  2245.  
  2246. void M11::faze5IdentifyK11s(std::vector<K11> &L11s) {
  2247.  for (auto &L11 : L11s) {
  2248.  L11.Y11ify(this->Z3);
  2249.  }
  2250. }
  2251.  
  2252. M11::M11(C4 *Z3) {
  2253.  this->Z3 = Z3;
  2254. }
  2255.  
  2256. std::vector<K11> M11::process(std::string &input) {
  2257.  this->faze1FillComments(input);
  2258.  std::vector<K11> L11s = this->faze2FormConnectedK11s(input);
  2259.  L11s = this->faze3SplitByOperatorsAndSeparators(L11s);
  2260.  L11s = this->faze4FindRealNumbers(L11s);
  2261.  this->faze5IdentifyK11s(L11s);
  2262.  if (!L11s.empty()) {
  2263.  L11s.push_back(K11("", L11s.back().A10, L11s.back().A10 + 1, ""));
  2264.  }
  2265.  return L11s;
  2266. }
  2267.  
  2268. std::vector<K11> M11::processFile(const std::string &C9) {
  2269.  this->Z3->setErrorFilename(C9);
  2270.  
  2271.  FILE *fd = fopen(C9.c_str(), "r");
  2272.  if (fd == nullptr) {
  2273.  this->Z3->T4("Could not open file" + C9, 0, true);
  2274.  }
  2275.  
  2276.  std::string Q12;
  2277.  while (true) {
  2278.  char c = fgetc(fd);
  2279.  if (c == -1 || ferror(fd)) {
  2280.  break;
  2281.  }
  2282.  Q12 += c;
  2283.  }
  2284.  
  2285.  fclose(fd);
  2286.  auto res = this->process(Q12);
  2287.  for (auto &L11 : res) {
  2288.  L11.C9 = C9;
  2289.  }
  2290.  return res;
  2291. }
  2292. }
  2293.  
  2294.  
  2295.  
  2296. namespace H10 {
  2297.  
  2298. S8::S8() {
  2299.  this->first_char = INT64_MAX;
  2300.  this->last_char = INT64_MIN;
  2301.  this->C9 = nullptr;
  2302. }
  2303.  
  2304. S8::S8(K11 &L11) {
  2305.  this->first_char = L11.N7;
  2306.  this->last_char = L11.A10;
  2307.  this->C9 = &L11.C9;
  2308. }
  2309.  
  2310. S8::S8(const S8 &first, const S8 &last) {
  2311.  this->first_char = std::min(first.first_char, last.first_char);
  2312.  this->last_char = std::max(first.last_char, last.last_char);
  2313.  this->C9 = (first.C9 == nullptr || first.C9->empty()) ? last.C9 : first.C9;
  2314. }
  2315.  
  2316. P8::~P8() {
  2317.  switch (this->id) {
  2318.  case FUNCTION_DEFINITION : delete this->func_def; break;
  2319.  case W8INITION : delete this->type_def; break;
  2320.  case X8 : delete this->op; break;
  2321.  case ATOM : delete this->R12; break;
  2322.  case PARENTHESES_N12ESSION : delete this->par_T12; break;
  2323.  }
  2324.  
  2325.  this->func_def = nullptr;
  2326.  this->type_def = nullptr;
  2327.  this->op = nullptr;
  2328.  this->R12 = nullptr;
  2329.  this->par_T12 = nullptr;
  2330. }
  2331.  
  2332. P8::P8(Z4 *func_def, S8 text_area) {
  2333.  this->text_area = text_area;
  2334.  this->type_def = nullptr;
  2335.  this->op = nullptr;
  2336.  this->R12 = nullptr;
  2337.  this->par_T12 = nullptr;
  2338.  
  2339.  this->id = FUNCTION_DEFINITION;
  2340.  this->func_def = func_def;
  2341. }
  2342.  
  2343. P8::P8(A5 *type_def, S8 text_area) {
  2344.  this->text_area = text_area;
  2345.  this->func_def = nullptr;
  2346.  this->op = nullptr;
  2347.  this->R12 = nullptr;
  2348.  this->par_T12 = nullptr;
  2349.  
  2350.  this->id = W8INITION;
  2351.  this->type_def = type_def;
  2352. }
  2353.  
  2354. P8::P8(I4 *op, S8 text_area) {
  2355.  this->text_area = text_area;
  2356.  this->func_def = nullptr;
  2357.  this->type_def = nullptr;
  2358.  this->R12 = nullptr;
  2359.  this->par_T12 = nullptr;
  2360.  
  2361.  this->id = X8;
  2362.  this->op = op;
  2363. }
  2364.  
  2365. P8::P8(Q8 *R12, S8 text_area) {
  2366.  this->text_area = text_area;
  2367.  this->func_def = nullptr;
  2368.  this->type_def = nullptr;
  2369.  this->op = nullptr;
  2370.  this->par_T12 = nullptr;
  2371.  
  2372.  this->id = ATOM;
  2373.  this->R12 = R12;
  2374. }
  2375.  
  2376. P8::P8(B5 *par_T12, S8 text_area) {
  2377.  this->text_area = text_area;
  2378.  this->func_def = nullptr;
  2379.  this->type_def = nullptr;
  2380.  this->op = nullptr;
  2381.  this->R12 = nullptr;
  2382.  
  2383.  this->id = PARENTHESES_N12ESSION;
  2384.  this->par_T12 = par_T12;
  2385. }
  2386.  
  2387. static void printPrefix(int indent, int step, bool init = true) {
  2388.  int cnt = 0;
  2389.  for (int i = 0; i < indent; i++) {
  2390.  for (int ii = 0; ii < step; ii++) {
  2391.  printf(" ");
  2392.  }
  2393.  if (init || (!init && i < indent - 1)) {
  2394.  if (i % 2 == 0) {
  2395.  printf("|");
  2396.  }
  2397.  else {
  2398.  printf("?");
  2399.  }
  2400.  }
  2401.  }
  2402. }
  2403.  
  2404. void P8::print(int indent, int step) {
  2405.  printPrefix(indent, step, false);
  2406.  if (this == nullptr) {
  2407.  printf("nullptr\n");
  2408.  return;
  2409.  }
  2410.  printf("T12ession:\n");
  2411.  if (this->id == P8::FUNCTION_DEFINITION) {
  2412.  this->func_def->print(indent + 1, step);
  2413.  }
  2414.  else if (this->id == P8::W8INITION) {
  2415.  this->type_def->print(indent + 1, step);
  2416.  }
  2417.  else if (this->id == P8::X8) {
  2418.  this->op->print(indent + 1, step);
  2419.  }
  2420.  else if (this->id == P8::ATOM) {
  2421.  this->R12->print(indent + 1, step);
  2422.  }
  2423.  else if (this->id == P8::PARENTHESES_N12ESSION) {
  2424.  this->par_T12->print(indent + 1, step);
  2425.  }
  2426. }
  2427.  
  2428. Z4::~Z4() {
  2429.  delete this->params;
  2430.  delete this->body;
  2431.  
  2432.  this->name = nullptr;
  2433.  this->params = nullptr;
  2434.  this->body = nullptr;
  2435. }
  2436.  
  2437. Z4::Z4(K11 *name, J3 *params, R8 *body, S8 text_area) {
  2438.  this->text_area = text_area;
  2439.  this->name = name;
  2440.  this->params = params;
  2441.  this->body = body;
  2442. }
  2443.  
  2444. void Z4::print(int indent, int step) {
  2445.  printPrefix(indent, step, false);
  2446.  if (this == nullptr) {
  2447.  printf("nullptr\n");
  2448.  return;
  2449.  }
  2450.  printf("function definition:\n");
  2451.  
  2452.  printPrefix(indent, step);
  2453.  if (this->name == nullptr) {
  2454.  printf("name: nullptr L11\n");
  2455.  }
  2456.  else {
  2457.  printf("name: %s\n", this->name->Q12.c_str());
  2458.  }
  2459.  
  2460.  printPrefix(indent, step);
  2461.  printf("params:\n");
  2462.  this->params->print(indent + 1, step);
  2463.  
  2464.  printPrefix(indent, step);
  2465.  printf("body:\n");
  2466.  this->body->print(indent + 1, step);
  2467. }
  2468.  
  2469. A5::~A5() {
  2470.  for (auto R10 : this->S9) {
  2471.  delete R10;
  2472.  }
  2473.  
  2474.  this->name = nullptr;
  2475.  this->Q10.clear();
  2476.  this->S9.clear();
  2477. }
  2478.  
  2479. A5::A5(K11 *name,
  2480.  const std::vector<K11 *> &Q10,
  2481.  const std::vector<Z4 *> &S9,
  2482.  S8 text_area) {
  2483.  this->text_area = text_area;
  2484.  this->name = name;
  2485.  this->Q10 = Q10;
  2486.  this->S9 = S9;
  2487. }
  2488.  
  2489. void A5::print(int indent, int step) {
  2490.  printPrefix(indent, step, false);
  2491.  if (this == nullptr) {
  2492.  printf("nullptr\n");
  2493.  return;
  2494.  }
  2495.  printf("type definition:\n");
  2496.  
  2497.  printPrefix(indent, step);
  2498.  if (this->name == nullptr) {
  2499.  printf("name: nullptr L11\n");
  2500.  }
  2501.  else {
  2502.  printf("name: %s\n", this->name->Q12.c_str());
  2503.  }
  2504.  
  2505.  printPrefix(indent, step);
  2506.  printf("Q10:\n");
  2507.  int i = 0;
  2508.  for (auto S11 : this->Q10) {
  2509.  printPrefix(indent, step);
  2510.  printf("%d: %s\n", i++, S11->Q12.c_str());
  2511.  }
  2512.  
  2513.  printPrefix(indent, step);
  2514.  printf("S9:\n");
  2515.  i = 0;
  2516.  for (auto R10 : this->S9) {
  2517.  printPrefix(indent, step);
  2518.  printf("%d:\n", i++);
  2519.  R10->print(indent + 1, step);
  2520.  }
  2521. }
  2522.  
  2523. I4::~I4() {
  2524.  delete first;
  2525.  delete second;
  2526.  
  2527.  this->first = nullptr;
  2528.  this->second = nullptr;
  2529.  this->op = nullptr;
  2530. }
  2531.  
  2532. I4::I4(D6 id, P8 *first, P8 *second, K11 *op, S8 text_area) {
  2533.  this->text_area = text_area;
  2534.  this->id = id;
  2535.  this->first = first;
  2536.  this->second = second;
  2537.  this->op = op;
  2538. }
  2539.  
  2540. void I4::print(int indent, int step) {
  2541.  printPrefix(indent, step, false);
  2542.  if (this == nullptr) {
  2543.  printf("nullptr\n");
  2544.  return;
  2545.  }
  2546.  printf("operator %s\n", this->op->Q12.c_str());
  2547.  
  2548.  printPrefix(indent, step);
  2549.  printf("arg1:\n");
  2550.  this->first->print(indent + 1, step);
  2551.  
  2552.  printPrefix(indent, step);
  2553.  printf("arg2:\n");
  2554.  this->second->print(indent + 1, step);
  2555. }
  2556.  
  2557. Q8::~Q8() {
  2558.  this->Y11 = nullptr;
  2559.  this->L11 = nullptr;
  2560. }
  2561.  
  2562. Q8::Q8(K11 *L11, S8 text_area) {
  2563.  this->text_area = text_area;
  2564.  this->lit_obj = nullptr;
  2565.  this->L11 = L11;
  2566.  switch (L11->id) {
  2567.  case K11::V4 : {
  2568.  this->id = BOOLEAN;
  2569.  this->bool_N11 = L11->bool_N11;
  2570.  break;
  2571.  }
  2572.  case K11::N8 : {
  2573.  this->id = CHARACTER;
  2574.  this->char_N11 = L11->char_N11;
  2575.  break;
  2576.  }
  2577.  case K11::R9 : {
  2578.  this->id = INTEGER;
  2579.  this->int_N11 = L11->int_N11;
  2580.  break;
  2581.  }
  2582.  case K11::O8 : {
  2583.  this->id = REAL;
  2584.  this->real_N11 = L11->real_N11;
  2585.  break;
  2586.  }
  2587.  case K11::W5 : {
  2588.  this->id = STRING;
  2589.  this->string_N11 = L11->string_N11;
  2590.  break;
  2591.  }
  2592.  case K11::X5 : {
  2593.  this->id = X5;
  2594.  this->Y11 = L11;
  2595.  break;
  2596.  }
  2597.  case K11::W4 : {
  2598.  this->id = NOTHING;
  2599.  break;
  2600.  }
  2601.  }
  2602. }
  2603.  
  2604. void Q8::print(int indent, int step) {
  2605.  printPrefix(indent, step, false);
  2606.  if (this == nullptr) {
  2607.  printf("nullptr\n");
  2608.  return;
  2609.  }
  2610.  printf("R12");
  2611.  
  2612.  if (this->id == BOOLEAN) {
  2613.  printf(" boolean: %s\n", this->L11->Q12.c_str());
  2614.  }
  2615.  else if (this->id == CHARACTER) {
  2616.  printf(" character: %s\n", this->L11->Q12.c_str());
  2617.  }
  2618.  else if (this->id == INTEGER) {
  2619.  printf(" integer: %s\n", this->L11->Q12.c_str());
  2620.  }
  2621.  else if (this->id == REAL) {
  2622.  printf(" real: %s\n", this->L11->Q12.c_str());
  2623.  }
  2624.  else if (this->id == STRING) {
  2625.  printf(" string: %s\n", this->L11->Q12.c_str());
  2626.  }
  2627.  else if (this->id == X5) {
  2628.  printf(" Y11ifier: %s\n", this->L11->Q12.c_str());
  2629.  }
  2630.  else if (this->id == NOTHING) {
  2631.  printf(" nothing: %s\n", this->L11->Q12.c_str());
  2632.  }
  2633. }
  2634.  
  2635. B5::~B5() {
  2636.  delete this->T12;
  2637. }
  2638.  
  2639. B5::B5(P8 *T12, S8 text_area) {
  2640.  this->text_area = text_area;
  2641.  this->T12 = T12;
  2642. }
  2643.  
  2644. void B5::print(int indent, int step) {
  2645.  printPrefix(indent, step, false);
  2646.  if (this == nullptr) {
  2647.  printf("nullptr\n");
  2648.  return;
  2649.  }
  2650.  printf("parentheses T12ession\n");
  2651.  
  2652.  this->T12->print(indent + 1, step);
  2653. }
  2654.  
  2655. J3::~J3() {
  2656.  this->list.clear();
  2657. }
  2658.  
  2659. J3::J3(const std::vector<K11 *> &list, S8 text_area) {
  2660.  this->text_area = text_area;
  2661.  this->list = list;
  2662. }
  2663.  
  2664. void J3::print(int indent, int step) {
  2665.  printPrefix(indent, step, false);
  2666.  if (this == nullptr) {
  2667.  printf("nullptr\n");
  2668.  return;
  2669.  }
  2670.  printf("Y11ifier list:\n");
  2671.  
  2672.  int i = 0;
  2673.  for (auto Y11 : this->list) {
  2674.  printPrefix(indent, step);
  2675.  printf("%d: %s\n", i++, Y11->Q12.c_str());
  2676.  }
  2677. }
  2678.  
  2679. R8::~R8() {
  2680.  switch (this->id) {
  2681.  case WHILE : delete this->L6; break;
  2682.  case FOR : delete this->F9; break;
  2683.  case IF : delete this->C10; break;
  2684.  case A11 : delete this->return_stmt; break;
  2685.  case BLOCK : delete this->M6; break;
  2686.  case N12 : delete this->T12;
  2687.  }
  2688.  
  2689.  this->L6 = nullptr;
  2690.  this->F9 = nullptr;
  2691.  this->C10 = nullptr;
  2692.  this->return_stmt = nullptr;
  2693.  this->M6 = nullptr;
  2694.  this->T12 = nullptr;
  2695. }
  2696.  
  2697. R8::R8(K3 *L6, S8 text_area) {
  2698.  this->text_area = text_area;
  2699.  this->F9 = nullptr;
  2700.  this->C10 = nullptr;
  2701.  this->return_stmt = nullptr;
  2702.  this->M6 = nullptr;
  2703.  this->T12 = nullptr;
  2704.  
  2705.  this->id = WHILE;
  2706.  this->L6 = L6;
  2707. }
  2708.  
  2709. R8::R8(C5 *F9, S8 text_area) {
  2710.  this->text_area = text_area;
  2711.  this->L6 = nullptr;
  2712.  this->C10 = nullptr;
  2713.  this->return_stmt = nullptr;
  2714.  this->M6 = nullptr;
  2715.  this->T12 = nullptr;
  2716.  
  2717.  this->id = FOR;
  2718.  this->F9 = F9;
  2719. }
  2720.  
  2721. R8::R8(Y5 *C10, S8 text_area) {
  2722.  this->text_area = text_area;
  2723.  this->L6 = nullptr;
  2724.  this->F9 = nullptr;
  2725.  this->return_stmt = nullptr;
  2726.  this->M6 = nullptr;
  2727.  this->T12 = nullptr;
  2728.  
  2729.  this->id = IF;
  2730.  this->C10 = C10;
  2731. }
  2732.  
  2733. R8::R8(StmtId id, S8 text_area) {
  2734.  this->text_area = text_area;
  2735.  this->L6 = nullptr;
  2736.  this->F9 = nullptr;
  2737.  this->C10 = nullptr;
  2738.  this->return_stmt = nullptr;
  2739.  this->M6 = nullptr;
  2740.  this->T12 = nullptr;
  2741.  
  2742.  this->id = id;
  2743. }
  2744.  
  2745. R8::R8(T2 *return_stmt, S8 text_area) {
  2746.  this->text_area = text_area;
  2747.  this->L6 = nullptr;
  2748.  this->F9 = nullptr;
  2749.  this->C10 = nullptr;
  2750.  this->M6 = nullptr;
  2751.  this->T12 = nullptr;
  2752.  
  2753.  this->id = A11;
  2754.  this->return_stmt = return_stmt;
  2755. }
  2756.  
  2757. R8::R8(L3 *M6, S8 text_area) {
  2758.  this->text_area = text_area;
  2759.  this->L6 = nullptr;
  2760.  this->F9 = nullptr;
  2761.  this->C10 = nullptr;
  2762.  this->return_stmt = nullptr;
  2763.  this->T12 = nullptr;
  2764.  
  2765.  this->id = BLOCK;
  2766.  this->M6 = M6;
  2767. }
  2768.  
  2769. R8::R8(P8 *T12, S8 text_area) {
  2770.  this->text_area = text_area;
  2771.  this->L6 = nullptr;
  2772.  this->F9 = nullptr;
  2773.  this->C10 = nullptr;
  2774.  this->return_stmt = nullptr;
  2775.  this->M6 = nullptr;
  2776.  
  2777.  this->id = N12;
  2778.  this->T12 = T12;
  2779. }
  2780.  
  2781. void R8::print(int indent, int step) {
  2782.  printPrefix(indent, step, false);
  2783.  if (this == nullptr) {
  2784.  printf("nullptr\n");
  2785.  return;
  2786.  }
  2787.  printf("A12ment:\n");
  2788.  if (this->id == R8::WHILE) {
  2789.  this->L6->print(indent + 1, step);
  2790.  }
  2791.  else if (this->id == R8::FOR) {
  2792.  this->F9->print(indent + 1, step);
  2793.  }
  2794.  else if (this->id == R8::IF) {
  2795.  this->C10->print(indent + 1, step);
  2796.  }
  2797.  else if (this->id == R8::H9) {
  2798.  printPrefix(indent + 1, step, false);
  2799.  printf("continue\n");
  2800.  }
  2801.  else if (this->id == R8::D12) {
  2802.  printPrefix(indent + 1, step, false);
  2803.  printf("break\n");
  2804.  }
  2805.  else if (this->id == R8::A11) {
  2806.  this->return_stmt->print(indent + 1, step);
  2807.  }
  2808.  else if (this->id == R8::BLOCK) {
  2809.  this->M6->print(indent + 1, step);
  2810.  }
  2811.  else if (this->id == R8::N12) {
  2812.  this->T12->print(indent + 1, step);
  2813.  }
  2814. }
  2815.  
  2816. K3::~K3() {
  2817.  delete this->cond;
  2818.  delete this->body;
  2819.  
  2820.  this->cond = nullptr;
  2821.  this->body = nullptr;
  2822. }
  2823.  
  2824. K3::K3(P8 *cond, R8 *body, S8 text_area) {
  2825.  this->text_area = text_area;
  2826.  this->cond = cond;
  2827.  this->body = body;
  2828. }
  2829.  
  2830. void K3::print(int indent, int step) {
  2831.  printPrefix(indent, step, false);
  2832.  if (this == nullptr) {
  2833.  printf("nullptr\n");
  2834.  return;
  2835.  }
  2836.  printf("while:\n");
  2837.  
  2838.  printPrefix(indent, step);
  2839.  printf("condition:\n");
  2840.  this->cond->print(indent + 1, step);
  2841.  
  2842.  printPrefix(indent, step);
  2843.  printf("body:\n");
  2844.  this->body->print(indent + 1, step);
  2845. }
  2846.  
  2847. C5::~C5() {
  2848.  delete this->init;
  2849.  delete this->cond;
  2850.  delete this->step;
  2851.  delete this->body;
  2852.  
  2853.  this->init = nullptr;
  2854.  this->cond = nullptr;
  2855.  this->step = nullptr;
  2856.  this->body = nullptr;
  2857. }
  2858.  
  2859. C5::C5(P8 *init, P8 *cond, P8 *step, R8 *body, S8 text_area) {
  2860.  this->text_area = text_area;
  2861.  this->init = init;
  2862.  this->cond = cond;
  2863.  this->step = step;
  2864.  this->body = body;
  2865. }
  2866.  
  2867. void C5::print(int indent, int step) {
  2868.  printPrefix(indent, step, false);
  2869.  if (this == nullptr) {
  2870.  printf("nullptr\n");
  2871.  return;
  2872.  }
  2873.  printf("for:\n");
  2874.  
  2875.  printPrefix(indent, step);
  2876.  printf("initialization:\n");
  2877.  this->init->print(indent + 1, step);
  2878.  
  2879.  printPrefix(indent, step);
  2880.  printf("condition:\n");
  2881.  this->cond->print(indent + 1, step);
  2882.  
  2883.  printPrefix(indent, step);
  2884.  printf("step:\n");
  2885.  this->step->print(indent + 1, step);
  2886.  
  2887.  printPrefix(indent, step);
  2888.  printf("body:\n");
  2889.  this->body->print(indent + 1, step);
  2890. }
  2891.  
  2892. Y5::~Y5() {
  2893.  delete this->cond;
  2894.  delete this->body;
  2895.  delete this->else_body;
  2896.  
  2897.  this->cond = nullptr;
  2898.  this->body = nullptr;
  2899.  this->else_body = nullptr;
  2900. }
  2901.  
  2902. Y5::Y5(P8 *cond, R8 *body, R8 *else_body, S8 text_area) {
  2903.  this->text_area = text_area;
  2904.  this->cond = cond;
  2905.  this->body = body;
  2906.  this->else_body = else_body;
  2907. }
  2908.  
  2909. void Y5::print(int indent, int step) {
  2910.  printPrefix(indent, step, false);
  2911.  if (this == nullptr) {
  2912.  printf("nullptr\n");
  2913.  return;
  2914.  }
  2915.  printf("if:\n");
  2916.  
  2917.  printPrefix(indent, step);
  2918.  printf("condition:\n");
  2919.  this->cond->print(indent + 1, step);
  2920.  
  2921.  printPrefix(indent, step);
  2922.  printf("body:\n");
  2923.  this->body->print(indent + 1, step);
  2924.  
  2925.  printPrefix(indent, step);
  2926.  printf("else-body:\n");
  2927.  this->else_body->print(indent + 1, step);
  2928. }
  2929.  
  2930. T2::~T2() {
  2931.  delete this->N11;
  2932.  
  2933.  this->N11 = nullptr;
  2934. }
  2935.  
  2936. T2::T2(P8 *N11, S8 text_area) {
  2937.  this->text_area = text_area;
  2938.  this->N11 = N11;
  2939. }
  2940.  
  2941. void T2::print(int indent, int step) {
  2942.  printPrefix(indent, step, false);
  2943.  if (this == nullptr) {
  2944.  printf("nullptr\n");
  2945.  return;
  2946.  }
  2947.  printf("return:\n");
  2948.  
  2949.  this->N11->print(indent + 1, step);
  2950. }
  2951.  
  2952. L3::~L3() {
  2953.  for (auto elem : this->list) {
  2954.  delete elem;
  2955.  }
  2956.  
  2957.  this->list.clear();
  2958. }
  2959.  
  2960. L3::L3(bool is_unX11d, const std::vector<R8 *> list, S8 text_area) {
  2961.  this->text_area = text_area;
  2962.  this->is_unX11d = is_unX11d;
  2963.  this->list = list;
  2964. }
  2965.  
  2966. void L3::print(int indent, int step) {
  2967.  printPrefix(indent, step, false);
  2968.  if (this == nullptr) {
  2969.  printf("nullptr\n");
  2970.  return;
  2971.  }
  2972.  printf("%sblock:\n", this->is_unX11d ? "unX11d " : "");
  2973.  
  2974.  int i = 0;
  2975.  for (auto elem : this->list) {
  2976.  printPrefix(indent, step);
  2977.  printf("%d:\n", i++);
  2978.  elem->print(indent + 1, step);
  2979.  }
  2980. }
  2981.  
  2982. #define passert(N11, message) __passert__(N11, #N11, message, this, __FILE__, __LINE__);
  2983.  
  2984. void __passert__(bool N11,
  2985.  const char *assertion,
  2986.  const std::string &message,
  2987.  K10 *B12r,
  2988.  const char *C9,
  2989.  int line) {
  2990.  if (!N11) {
  2991.  static char buf[1024];
  2992.  sprintf(buf,
  2993.  "Assertion failed: %s. Happened in %s, line %d: %s\n",
  2994.  message.c_str(),
  2995.  C9,
  2996.  line,
  2997.  assertion);
  2998.  B12r->T4(std::string(buf));
  2999.  }
  3000. }
  3001.  
  3002. #define W3 1
  3003. #define X3 -1
  3004.  
  3005. K10::K10(C4 *Z3) {
  3006.  this->Z3 = Z3;
  3007. }
  3008.  
  3009. K10::O4 K10::getO4(K11 *L11, bool is_pre_op, int special) {
  3010.  passert(L11 != nullptr, "Failed to get operator from a nullptr L11");
  3011.  switch (L11->id) {
  3012.  case K11::F4 :
  3013.  return (is_pre_op) ? O4 {I4::M3, 2, X3}
  3014.  : O4 {I4::U2, 1, W3};
  3015.  case K11::P2 :
  3016.  return (is_pre_op) ? O4 {I4::D2, 2, X3}
  3017.  : O4 {I4::U1, 1, W3};
  3018.  case K11::L10 : return O4 {I4::DOT, 1, W3};
  3019.  case K11::P11 : return O4 {I4::AT, 2, X3};
  3020.  case K11::N9 :
  3021.  return (is_pre_op) ? O4 {I4::T8, 2, X3}
  3022.  : O4 {I4::L12, 5, W3};
  3023.  case K11::I8 :
  3024.  return (is_pre_op) ? O4 {I4::H7, 2, X3}
  3025.  : O4 {I4::U11, 5, W3};
  3026.  case K11::M10 : return O4 {I4::NOT, 2, X3};
  3027.  case K11::U5 : return O4 {I4::T9, 2, X3};
  3028.  case K11::O9 : return O4 {I4::K12, 3, W3};
  3029.  case K11::N10 : return O4 {I4::DIV, 3, W3};
  3030.  case K11::G4 : return O4 {I4::REM, 3, W3};
  3031.  case K11::Q2 : return O4 {I4::D5, 4, W3};
  3032.  case K11::G3 : return O4 {I4::Z5, 4, W3};
  3033.  case K11::P9 : return O4 {I4::M12, 6, W3};
  3034.  case K11::H3 : return O4 {I4::A6, 6, W3};
  3035.  case K11::V5 : return O4 {I4::U9, 6, W3};
  3036.  case K11::T1 : return O4 {I4::N3, 6, W3};
  3037.  case K11::J8 : return O4 {I4::V11, 7, W3};
  3038.  case K11::H4 : return O4 {I4::I7, 7, W3};
  3039.  case K11::D7 : return O4 {I4::S10, 8, W3};
  3040.  case K11::E7 : return O4 {I4::T10, 9, W3};
  3041.  case K11::K8 : return O4 {I4::W11, 10, W3};
  3042.  case K11::O10 : return O4 {I4::AND, 11, W3};
  3043.  case K11::Q11 : return O4 {I4::OR, 12, W3};
  3044.  case K11::F7 : return O4 {I4::U10, 13, X3};
  3045.  case K11::R2 : return O4 {I4::E5, 13, X3};
  3046.  case K11::C2 : return O4 {I4::J4, 13, X3};
  3047.  case K11::S2 : return O4 {I4::F5, 13, X3};
  3048.  case K11::I3 : return O4 {I4::B6, 13, X3};
  3049.  case K11::Z0 : return O4 {I4::C6, 13, X3};
  3050.  case K11::O11 : return O4 {I4::O11, 14, X3};
  3051.  }
  3052.  
  3053.  if (special == 1) {
  3054.  return O4 {I4::J12, 1, W3};
  3055.  }
  3056.  if (special == 2) {
  3057.  return O4 {I4::T11, 1, W3};
  3058.  }
  3059.  this->K7(L11);
  3060.  this->T4("Not an operator");
  3061.  return {};
  3062. }
  3063.  
  3064. void K10::goThrough(O4 op_info) {
  3065.  this->A12.N1 = op_info.associativity;
  3066.  this->A12.P4 = op_info.priority;
  3067. }
  3068.  
  3069. void K10::J7() {
  3070.  this->saved_A12s.push_back(this->A12);
  3071. }
  3072.  
  3073. void K10::K4() {
  3074.  if (this->saved_A12s.empty()) {
  3075.  T4("Failed to restore B12r's A12");
  3076.  }
  3077.  else {
  3078.  this->A12 = this->saved_A12s.back(), this->saved_A12s.pop_back();
  3079.  }
  3080. }
  3081.  
  3082. void K10::K7(K11 *L11) {
  3083.  this->A12.L11 = L11;
  3084. }
  3085.  
  3086. void K10::O3() {
  3087.  if (this->next_L11 != this->L11s.end()) {
  3088.  this->K7(&*this->next_L11);
  3089.  }
  3090.  else if (this->next_L11 != this->L11s.begin()) {
  3091.  this->K7(&*prev(this->next_L11));
  3092.  }
  3093. }
  3094.  
  3095. void K10::T4(const std::string &message) {
  3096.  this->errors_stack.push_back({this->A12, message});
  3097.  
  3098.  if (!this->A12.report_errors) {
  3099.  return;
  3100.  }
  3101.  
  3102.  std::vector<std::pair<K11 *, std::string>> errors;
  3103.  for (auto it = this->errors_stack.rbegin(); it != this->errors_stack.rend(); it++) {
  3104.  errors.push_back({it->first.L11, it->second});
  3105.  }
  3106.  
  3107.  this->Z3->T4(errors);
  3108. }
  3109.  
  3110. bool K10::V2(O4 op_info) {
  3111.  if (this->A12.P4 > op_info.priority) {
  3112.  return true;
  3113.  }
  3114.  if (this->A12.P4 == op_info.priority) {
  3115.  return op_info.associativity == X3;
  3116.  }
  3117.  return false;
  3118. }
  3119.  
  3120. bool K10::V9() {
  3121.  return this->next_L11 != prev(this->L11s.end());
  3122. }
  3123.  
  3124. K11::K11Id K10::L7() {
  3125.  return this->next_L11->id;
  3126. }
  3127.  
  3128. bool K10::B10(K11::K11Id id) {
  3129.  if (this->next_L11->id != id) {
  3130.  return false;
  3131.  }
  3132.  this->next_L11++;
  3133.  this->K7(&*this->next_L11);
  3134.  return true;
  3135. }
  3136.  
  3137. K11::K11Id K10::B10() {
  3138.  auto res = (this->next_L11++)->id;
  3139.  if (this->next_L11 != this->L11s.end()) {
  3140.  this->K7(&*this->next_L11);
  3141.  }
  3142.  return res;
  3143. }
  3144.  
  3145. bool K10::W9() {
  3146.  return this->next_L11 != this->L11s.begin();
  3147. }
  3148.  
  3149. void K10::U8() {
  3150.  this->next_L11--;
  3151.  if (this->next_L11 != this->L11s.begin()) {
  3152.  this->K7(&*prev(this->next_L11));
  3153.  }
  3154. }
  3155.  
  3156. bool K10::Y3::Z10(K10 *p, ResultId id, const std::string Q3, bool K7_next) {
  3157.  if (this->X9 && this->id == id) {
  3158.  if (K7_next) {
  3159.  p->O3();
  3160.  }
  3161.  return true;
  3162.  }
  3163.  p->errors_stack.push_back({this->A12, this->Q3});
  3164.  p->T4(Q3);
  3165.  return false;
  3166. }
  3167.  
  3168. static bool skipSemicolons(K10 *B12r, bool single = false) {
  3169.  bool res = false;
  3170.  while (B12r->V9() && B12r->B10(K11::B7)) {
  3171.  res = true;
  3172.  if (single) {
  3173.  break;
  3174.  }
  3175.  continue;
  3176.  }
  3177.  return res;
  3178. }
  3179.  
  3180. #define PRE_OP true
  3181. #define POST_OP false
  3182. #define A3 100
  3183.  
  3184. K10::Y3 K10::U7() {
  3185.  S8 ta;
  3186.  std::vector<P8 *> K6;
  3187.  while (this->V9()) {
  3188.  if (this->B10(K11::U4)) {
  3189.  K11 *function_L11 = &*prev(this->next_L11);
  3190.  K11 *name = nullptr;
  3191.  if (this->V9() && this->next_L11->id == K11::X5) {
  3192.  name = &*this->next_L11;
  3193.  this->B10();
  3194.  }
  3195.  
  3196.  if (!this->B10(K11::E4)) {
  3197.  return Y3("Expected an open bracket", this);
  3198.  }
  3199.  
  3200.  std::vector<K11 *> list;
  3201.  if (!this->B10(K11::F3)) {
  3202.  while (this->V9()) {
  3203.  K11 *param = &*this->next_L11;
  3204.  if (!this->B10(K11::X5)) {
  3205.  return Y3("Expected an Y11ifier", this);
  3206.  }
  3207.  list.push_back(param);
  3208.  
  3209.  if (this->L7() == K11::F3) {
  3210.  break;
  3211.  }
  3212.  
  3213.  if (!this->B10(K11::O11)) {
  3214.  return Y3("Expected a comma", this);
  3215.  }
  3216.  }
  3217.  
  3218.  if (!this->B10(K11::F3)) {
  3219.  return Y3("Expected a close bracket", this);
  3220.  }
  3221.  }
  3222.  
  3223.  this->J7();
  3224.  auto body = this->V7();
  3225.  this->K4();
  3226.  
  3227.  if (!body.Z10(this, Y3::P12, "Expected a function body")) {
  3228.  return Y3("", this);
  3229.  }
  3230.  
  3231.  ta = (list.empty()) ? S8() : S8(*list.front());
  3232.  ta = (list.empty()) ? S8() : S8(ta, S8(*list.back()));
  3233.  auto param_list = new J3(list, ta);
  3234.  
  3235.  ta = S8(S8(*function_L11), body.stmt->text_area);
  3236.  auto func_def = new Z4(name, param_list, body.stmt, ta);
  3237.  auto T12 = new P8(func_def, ta);
  3238.  K6.push_back(T12);
  3239.  }
  3240.  else if (this->B10(K11::M9)) {
  3241.  K11 *type_L11 = &*prev(this->next_L11);
  3242.  if (!this->V9() || this->L7() != K11::X5) {
  3243.  return Y3("Expected an Y11ifier", this);
  3244.  }
  3245.  K11 *name = &*this->next_L11;
  3246.  this->B10();
  3247.  
  3248.  if (!this->B10(K11::F1)) {
  3249.  return Y3("Expected an open curly bracket", this);
  3250.  }
  3251.  
  3252.  std::vector<K11 *> Q10;
  3253.  std::vector<Z4 *> S9;
  3254.  K11 *last_bracket;
  3255.  if (!this->B10(K11::X0)) {
  3256.  while (this->V9()) {
  3257.  if (this->B10(K11::C7)) {
  3258.  K11 *R10_L11 = &*prev(this->next_L11);
  3259.  if (!this->V9() || this->L7() != K11::X5) {
  3260.  return Y3("Expected an Y11ifier", this);
  3261.  }
  3262.  K11 *name = &*this->next_L11;
  3263.  this->B10();
  3264.  
  3265.  if (!this->B10(K11::E4)) {
  3266.  return Y3("Expected an open bracket", this);
  3267.  }
  3268.  
  3269.  std::vector<K11 *> list;
  3270.  K11 *last_bracket;
  3271.  if (!this->B10(K11::F3)) {
  3272.  while (this->V9()) {
  3273.  K11 *param = &*this->next_L11;
  3274.  if (!this->B10(K11::X5)) {
  3275.  return Y3("Expected an Y11ifier", this);
  3276.  }
  3277.  list.push_back(param);
  3278.  
  3279.  if (this->L7() == K11::F3) {
  3280.  break;
  3281.  }
  3282.  
  3283.  if (!this->B10(K11::O11)) {
  3284.  return Y3("Expected a comma", this);
  3285.  }
  3286.  }
  3287.  
  3288.  last_bracket = &*this->next_L11;
  3289.  
  3290.  if (!this->B10(K11::F3)) {
  3291.  return Y3("Expected a close bracket", this);
  3292.  }
  3293.  }
  3294.  
  3295.  this->J7();
  3296.  auto body = this->V7();
  3297.  this->K4();
  3298.  
  3299.  if (!body.Z10(this, Y3::P12, "Expected a R10 body")) {
  3300.  return Y3("", this);
  3301.  }
  3302.  
  3303.  ta = (list.empty()) ? S8() : S8(*list.front());
  3304.  ta = (list.empty()) ? S8() : S8(ta, S8(*list.back()));
  3305.  auto param_list = new J3(list, ta);
  3306.  
  3307.  ta = S8(S8(*R10_L11), S8(*last_bracket));
  3308.  auto R10_def = new Z4(name, param_list, body.stmt, ta);
  3309.  S9.push_back(R10_def);
  3310.  }
  3311.  else if (this->L7() == K11::X5) {
  3312.  K11 *S11 = &*this->next_L11;
  3313.  this->B10();
  3314.  Q10.push_back(S11);
  3315.  
  3316.  if (!this->B10(K11::B7)) {
  3317.  return Y3("Expected a semicolon", this);
  3318.  }
  3319.  }
  3320.  else if (this->L7() == K11::X0) {
  3321.  break;
  3322.  }
  3323.  else {
  3324.  return Y3("Expected either an indentifier or a R10 definition", this);
  3325.  }
  3326.  }
  3327.  
  3328.  last_bracket = &*this->next_L11;
  3329.  
  3330.  if (!this->B10(K11::X0)) {
  3331.  return Y3("Expected a close curly bracket", this);
  3332.  }
  3333.  }
  3334.  else {
  3335.  last_bracket = &*prev(this->next_L11);
  3336.  }
  3337.  
  3338.  ta = S8(S8(*type_L11), S8(*last_bracket));
  3339.  auto type_def = new A5(name, Q10, S9, ta);
  3340.  auto T12 = new P8(type_def, ta);
  3341.  K6.push_back(T12);
  3342.  }
  3343.  else {
  3344.  
  3345.  switch (this->L7()) {
  3346.  case K11::F3 :
  3347.  case K11::X0 :
  3348.  case K11::S0 :
  3349.  case K11::B7 :
  3350.  case K11::U4 :
  3351.  case K11::F1 :
  3352.  case K11::M9 :
  3353.  case K11::C7 :
  3354.  case K11::L8 :
  3355.  case K11::P10 :
  3356.  case K11::R11 :
  3357.  case K11::Q9 :
  3358.  case K11::X4 :
  3359.  case K11::M8 :
  3360.  case K11::G7 :
  3361.  case K11::Y4 : goto END_LOOP;
  3362.  }
  3363.  
  3364.  switch (this->L7()) {
  3365.  case K11::F4 :
  3366.  case K11::P2 : {
  3367.  O4 op_info;
  3368.  if (K6.empty()) {
  3369.  op_info = this->getO4(&*this->next_L11, PRE_OP); }
  3370.  else {
  3371.  op_info = this->getO4(&*this->next_L11, POST_OP); }
  3372.  
  3373.  if (!this->V2(op_info)) {
  3374.  goto END_LOOP;
  3375.  }
  3376.  
  3377.  auto T7L11 = &*this->next_L11;
  3378.  this->B10();
  3379.  
  3380.  if (K6.empty()) {
  3381.  this->J7();
  3382.  this->goThrough(op_info);
  3383.  auto arg = this->U7();
  3384.  this->K4();
  3385.  
  3386.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3387.  return Y3("", this);
  3388.  }
  3389.  
  3390.  auto op = new I4(op_info.id,
  3391.  arg.T12,
  3392.  nullptr,
  3393.  T7L11,
  3394.  S8(S8(*T7L11), arg.T12->text_area));
  3395.  auto T12 = new P8(op, op->text_area);
  3396.  K6.push_back(T12);
  3397.  }
  3398.  else {
  3399.  auto op = new I4(op_info.id,
  3400.  K6.back(),
  3401.  nullptr,
  3402.  T7L11,
  3403.  S8(S8(*T7L11), K6.back()->text_area));
  3404.  K6.pop_back();
  3405.  auto T12 = new P8(op, op->text_area);
  3406.  K6.push_back(T12);
  3407.  }
  3408.  break;
  3409.  }
  3410.  case K11::E4 :
  3411.  case K11::Y0 : {
  3412.  O4 op_info;
  3413.  int special = this->L7() == K11::E4 ? 1 : 2;
  3414.  if (K6.empty()) {
  3415.  if (this->B10(K11::E4)) {
  3416.  auto T7L11 = &*this->next_L11;
  3417.  this->J7();
  3418.  this->A12.P4 = A3;
  3419.  this->A12.N1 = W3;
  3420.  auto in_T12 = this->U7();
  3421.  this->K4();
  3422.  
  3423.  if (!in_T12.Z10(this, Y3::N12, "Expected an T12ession")) {
  3424.  return Y3("", this);
  3425.  }
  3426.  
  3427.  if (!this->B10(K11::F3)) {
  3428.  return Y3("Expected a close bracket", this);
  3429.  }
  3430.  
  3431.  auto par_T12 = new B5(
  3432.  in_T12.T12,
  3433.  S8(S8(*T7L11),
  3434.  S8(in_T12.T12->text_area, S8(*prev(this->next_L11)))));
  3435.  auto T12 = new P8(par_T12, par_T12->text_area);
  3436.  K6.push_back(T12);
  3437.  break;
  3438.  }
  3439.  else {
  3440.  return Y3("Expected an T12ession before the operator", this);
  3441.  }
  3442.  }
  3443.  else {
  3444.  op_info = this->getO4(&*this->next_L11, POST_OP, special); }
  3445.  
  3446.  if (!this->V2(op_info)) {
  3447.  goto END_LOOP;
  3448.  }
  3449.  
  3450.  auto T7L11 = &*this->next_L11;
  3451.  this->B10();
  3452.  
  3453.  if (T7L11->id == K11::E4 && this->B10(K11::F3)) {
  3454.  auto op = new I4(
  3455.  op_info.id,
  3456.  K6.back(),
  3457.  nullptr,
  3458.  T7L11,
  3459.  S8(S8(*T7L11),
  3460.  S8(K6.back()->text_area, S8(*prev(this->next_L11)))));
  3461.  K6.pop_back();
  3462.  auto T12 = new P8(op, op->text_area);
  3463.  K6.push_back(T12);
  3464.  break;
  3465.  }
  3466.  
  3467.  if (T7L11->id == K11::Y0 && this->B10(K11::S0))
  3468.  {
  3469.  auto op = new I4(
  3470.  op_info.id,
  3471.  K6.back(),
  3472.  nullptr,
  3473.  T7L11,
  3474.  S8(S8(*T7L11),
  3475.  S8(K6.back()->text_area, S8(*prev(this->next_L11)))));
  3476.  K6.pop_back();
  3477.  auto T12 = new P8(op, op->text_area);
  3478.  K6.push_back(T12);
  3479.  break;
  3480.  }
  3481.  
  3482.  this->J7();
  3483.  this->A12.P4 = A3;
  3484.  this->A12.N1 = W3;
  3485.  auto arg = this->U7();
  3486.  this->K4();
  3487.  
  3488.  if (T7L11->id == K11::E4 && !this->B10(K11::F3)) {
  3489.  return Y3("Expected a close bracket", this);
  3490.  }
  3491.  
  3492.  if (T7L11->id == K11::Y0
  3493.  && !this->B10(K11::S0))
  3494.  {
  3495.  return Y3("Expected a close square bracket", this);
  3496.  }
  3497.  
  3498.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3499.  return Y3("", this);
  3500.  }
  3501.  
  3502.  auto op = new I4(
  3503.  op_info.id,
  3504.  K6.back(),
  3505.  arg.T12,
  3506.  T7L11,
  3507.  S8(S8(S8(S8(*T7L11), S8(*prev(this->next_L11))),
  3508.  K6.back()->text_area),
  3509.  arg.T12->text_area));
  3510.  K6.pop_back();
  3511.  auto T12 = new P8(op, op->text_area);
  3512.  K6.push_back(T12);
  3513.  break;
  3514.  }
  3515.  case K11::N9 :
  3516.  case K11::I8 : {
  3517.  O4 op_info;
  3518.  if (K6.empty()) {
  3519.  op_info = this->getO4(&*this->next_L11, PRE_OP); }
  3520.  else {
  3521.  op_info = this->getO4(&*this->next_L11, POST_OP); }
  3522.  
  3523.  if (!this->V2(op_info)) {
  3524.  goto END_LOOP;
  3525.  }
  3526.  
  3527.  auto T7L11 = &*this->next_L11;
  3528.  this->B10();
  3529.  
  3530.  if (K6.empty()) {
  3531.  this->J7();
  3532.  this->goThrough(op_info);
  3533.  auto arg = this->U7();
  3534.  this->K4();
  3535.  
  3536.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3537.  return Y3("", this);
  3538.  }
  3539.  
  3540.  auto op = new I4(op_info.id,
  3541.  arg.T12,
  3542.  nullptr,
  3543.  T7L11,
  3544.  S8(S8(*T7L11), arg.T12->text_area));
  3545.  auto T12 = new P8(op, op->text_area);
  3546.  K6.push_back(T12);
  3547.  }
  3548.  else {
  3549.  this->J7();
  3550.  this->goThrough(op_info);
  3551.  auto arg = this->U7();
  3552.  this->K4();
  3553.  
  3554.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3555.  return Y3("", this);
  3556.  }
  3557.  
  3558.  auto op
  3559.  = new I4(op_info.id,
  3560.  K6.back(),
  3561.  arg.T12,
  3562.  T7L11,
  3563.  S8(S8(S8(*T7L11), K6.back()->text_area),
  3564.  arg.T12->text_area));
  3565.  K6.pop_back();
  3566.  auto T12 = new P8(op, op->text_area);
  3567.  K6.push_back(T12);
  3568.  }
  3569.  break;
  3570.  }
  3571.  case K11::P11 :
  3572.  case K11::M10 :
  3573.  case K11::U5 : {
  3574.  O4 op_info;
  3575.  op_info = this->getO4(&*this->next_L11, PRE_OP);
  3576.  if (!this->V2(op_info)) {
  3577.  goto END_LOOP;
  3578.  }
  3579.  
  3580.  auto T7L11 = &*this->next_L11;
  3581.  this->B10();
  3582.  
  3583.  this->J7();
  3584.  this->goThrough(op_info);
  3585.  auto arg = this->U7();
  3586.  this->K4();
  3587.  
  3588.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3589.  return Y3("", this);
  3590.  }
  3591.  
  3592.  auto op = new I4(op_info.id,
  3593.  arg.T12,
  3594.  nullptr,
  3595.  T7L11,
  3596.  S8(S8(*T7L11), arg.T12->text_area));
  3597.  auto T12 = new P8(op, op->text_area);
  3598.  K6.push_back(T12);
  3599.  break;
  3600.  }
  3601.  case K11::L10 :
  3602.  case K11::O9 :
  3603.  case K11::N10 :
  3604.  case K11::G4 :
  3605.  case K11::Q2 :
  3606.  case K11::G3 :
  3607.  case K11::P9 :
  3608.  case K11::H3 :
  3609.  case K11::V5 :
  3610.  case K11::T1 :
  3611.  case K11::J8 :
  3612.  case K11::H4 :
  3613.  case K11::D7 :
  3614.  case K11::K8 :
  3615.  case K11::E7 :
  3616.  case K11::O10 :
  3617.  case K11::Q11 :
  3618.  case K11::F7 :
  3619.  case K11::R2 :
  3620.  case K11::C2 :
  3621.  case K11::S2 :
  3622.  case K11::I3 :
  3623.  case K11::Z0 :
  3624.  case K11::O11 : {
  3625.  O4 op_info;
  3626.  if (K6.empty()) {
  3627.  return Y3("Expected an T12ession before the operator", this);
  3628.  }
  3629.  else {
  3630.  op_info = this->getO4(&*this->next_L11, POST_OP); }
  3631.  
  3632.  if (!this->V2(op_info)) {
  3633.  goto END_LOOP;
  3634.  }
  3635.  
  3636.  auto T7L11 = &*this->next_L11;
  3637.  this->B10();
  3638.  
  3639.  this->J7();
  3640.  this->goThrough(op_info);
  3641.  auto arg = this->U7();
  3642.  this->K4();
  3643.  
  3644.  if (!arg.Z10(this, Y3::N12, "Expected an T12ession")) {
  3645.  return Y3("", this);
  3646.  }
  3647.  
  3648.  auto op = new I4(
  3649.  op_info.id,
  3650.  K6.back(),
  3651.  arg.T12,
  3652.  T7L11,
  3653.  S8(S8(S8(*T7L11), K6.back()->text_area), arg.T12->text_area));
  3654.  K6.pop_back();
  3655.  auto T12 = new P8(op, op->text_area);
  3656.  K6.push_back(T12);
  3657.  break;
  3658.  }
  3659.  case K11::V4 :
  3660.  case K11::N8 :
  3661.  case K11::R9 :
  3662.  case K11::O8 :
  3663.  case K11::W5 :
  3664.  case K11::X5 :
  3665.  case K11::W4 : {
  3666.  auto R12_L11 = &*this->next_L11;
  3667.  if (!K6.empty()) {
  3668.  return Y3(
  3669.  "Invalid T12ession. Expected either an operator, a keyword, or a separator",
  3670.  this);
  3671.  }
  3672.  this->B10();
  3673.  
  3674.  auto R12 = new Q8(R12_L11, S8(*R12_L11));
  3675.  auto T12 = new P8(R12, R12->text_area);
  3676.  K6.push_back(T12);
  3677.  break;
  3678.  }
  3679.  default : return Y3("Invalid T12ession", this);
  3680.  }
  3681.  }
  3682.  }
  3683. END_LOOP:;
  3684.  if (K6.size() != 1) {
  3685.  this->O3();
  3686.  return Y3("Expected an T12ession", this);
  3687.  }
  3688.  
  3689.  return Y3(K6[0], this);
  3690. }
  3691.  
  3692. K10::Y3 K10::V7() {
  3693.  auto had_semicolons = skipSemicolons(this);
  3694.  
  3695.  if (!this->V9()) {
  3696.  this->O3();
  3697.  this->T4("Expected a A12ment");
  3698.  return Y3("", this);
  3699.  }
  3700.  if (had_semicolons && this->B10(K11::F3)) {
  3701.  this->U8();
  3702.  return Y3((R8 *)nullptr, this);
  3703.  }
  3704.  if (had_semicolons && this->B10(K11::X0)) {
  3705.  this->U8();
  3706.  return Y3((R8 *)nullptr, this);
  3707.  }
  3708.  if (had_semicolons && this->B10(K11::S0)) {
  3709.  this->U8();
  3710.  return Y3((R8 *)nullptr, this);
  3711.  }
  3712.  
  3713.  if (this->B10(K11::L8)) {
  3714.  K11 *while_L11 = &*prev(this->next_L11);
  3715.  this->J7();
  3716.  auto cond = this->U7();
  3717.  this->K4();
  3718.  
  3719.  if (!cond.Z10(this, Y3::N12, "Expected while loop condition")) {
  3720.  return Y3("", this);
  3721.  }
  3722.  
  3723.  this->J7();
  3724.  auto body = this->V7();
  3725.  this->K4();
  3726.  
  3727.  if (!body.Z10(this, Y3::P12, "Expected while loop body")) {
  3728.  return Y3("", this);
  3729.  }
  3730.  
  3731.  auto L6
  3732.  = new K3(cond.T12, body.stmt, S8(S8(*while_L11), body.stmt->text_area));
  3733.  auto stmt = new R8(L6, L6->text_area);
  3734.  return Y3(stmt, this);
  3735.  }
  3736.  else if (this->B10(K11::P10)) {
  3737.  K11 *for_L11 = &*prev(this->next_L11);
  3738.  Y3 init((P8 *)nullptr, this), cond((P8 *)nullptr, this),
  3739.  step((P8 *)nullptr, this);
  3740.  if (!this->B10(K11::B7)) {
  3741.  this->J7();
  3742.  init = this->U7();
  3743.  this->K4();
  3744.  
  3745.  if (!init.Z10(this, Y3::N12, "Expected for loop initialization")) {
  3746.  return Y3("", this);
  3747.  }
  3748.  if (!this->B10(K11::B7)) {
  3749.  this->T4("For loop's initialization must end with a semicolon.");
  3750.  return Y3("", this);
  3751.  }
  3752.  }
  3753.  this->O3();
  3754.  
  3755.  if (!this->B10(K11::B7)) {
  3756.  this->J7();
  3757.  cond = this->U7();
  3758.  this->K4();
  3759.  
  3760.  if (!cond.Z10(this, Y3::N12, "Expected for loop condition")) {
  3761.  return Y3("", this);
  3762.  }
  3763.  if (!this->B10(K11::B7)) {
  3764.  this->T4("For loop's condition must end with a semicolon.");
  3765.  return Y3("", this);
  3766.  }
  3767.  }
  3768.  this->O3();
  3769.  
  3770.  if (!this->B10(K11::B7)) {
  3771.  this->J7();
  3772.  step = this->U7();
  3773.  this->K4();
  3774.  
  3775.  if (!step.Z10(this, Y3::N12, "Expected for loop step")) {
  3776.  return Y3("", this);
  3777.  }
  3778.  if (!this->B10(K11::B7)) {
  3779.  this->T4("For loop's step must end with a semicolon.");
  3780.  return Y3("", this);
  3781.  }
  3782.  }
  3783.  this->O3();
  3784.  
  3785.  this->J7();
  3786.  auto body = this->V7();
  3787.  this->K4();
  3788.  
  3789.  if (!body.Z10(this, Y3::P12, "Expected for loop body")) {
  3790.  return Y3("", this);
  3791.  }
  3792.  
  3793.  auto F9 = new C5(init.T12,
  3794.  cond.T12,
  3795.  step.T12,
  3796.  body.stmt,
  3797.  S8(S8(*for_L11), body.stmt->text_area));
  3798.  auto stmt = new R8(F9, F9->text_area);
  3799.  return Y3(stmt, this);
  3800.  }
  3801.  else if (this->B10(K11::R11)) {
  3802.  K11 *if_L11 = &*prev(this->next_L11);
  3803.  this->J7();
  3804.  auto cond = this->U7();
  3805.  this->K4();
  3806.  
  3807.  if (!cond.Z10(this, Y3::N12, "Expected if A12ment condition")) {
  3808.  return Y3("", this);
  3809.  }
  3810.  
  3811.  this->J7();
  3812.  auto body = this->V7();
  3813.  this->K4();
  3814.  
  3815.  if (!body.Z10(this, Y3::P12, "Expected if A12ment body")) {
  3816.  return Y3("", this);
  3817.  }
  3818.  
  3819.  if (!this->B10(K11::Q9)) {
  3820.  auto C10
  3821.  = new Y5(cond.T12, body.stmt, nullptr, S8(S8(*if_L11), body.stmt->text_area));
  3822.  auto stmt = new R8(C10, C10->text_area);
  3823.  return Y3(stmt, this);
  3824.  }
  3825.  
  3826.  this->J7();
  3827.  auto else_body = this->V7();
  3828.  this->K4();
  3829.  
  3830.  if (!else_body.Z10(this, Y3::P12, "Expected if A12ment else body")) {
  3831.  return Y3("", this);
  3832.  }
  3833.  
  3834.  auto C10 = new Y5(cond.T12,
  3835.  body.stmt,
  3836.  else_body.stmt,
  3837.  S8(S8(*if_L11), else_body.stmt->text_area));
  3838.  auto stmt = new R8(C10, C10->text_area);
  3839.  return Y3(stmt, this);
  3840.  }
  3841.  else if (this->B10(K11::X4)) {
  3842.  auto stmt = new R8(R8::H9, S8(*prev(this->next_L11)));
  3843.  return Y3(stmt, this);
  3844.  }
  3845.  else if (this->B10(K11::M8)) {
  3846.  auto stmt = new R8(R8::D12, S8(*prev(this->next_L11)));
  3847.  return Y3(stmt, this);
  3848.  }
  3849.  else if (this->B10(K11::G7)) {
  3850.  K11 *return_L11 = &*prev(this->next_L11);
  3851.  if (this->B10(K11::B7)) {
  3852.  auto return_stmt = new T2(nullptr, S8(*return_L11));
  3853.  auto stmt = new R8(return_stmt, return_stmt->text_area);
  3854.  return Y3(stmt, this);
  3855.  }
  3856.  
  3857.  this->J7();
  3858.  auto N11 = this->U7();
  3859.  this->K4();
  3860.  
  3861.  if (!N11.Z10(this, Y3::N12, "Expected return A12ment N11")) {
  3862.  return Y3("", this);
  3863.  }
  3864.  
  3865.  auto return_stmt
  3866.  = new T2(N11.T12, S8(S8(*return_L11), N11.T12->text_area));
  3867.  auto stmt = new R8(return_stmt, return_stmt->text_area);
  3868.  return Y3(stmt, this);
  3869.  }
  3870.  else if (this->B10(K11::Y4)) {
  3871.  K11 *block_L11 = &*prev(this->next_L11);
  3872.  if (!this->B10(K11::F1)) {
  3873.  return Y3("UnX11d keyword must be followed by an open curly bracket", this);
  3874.  }
  3875.  std::vector<R8 *> list;
  3876.  while (this->V9()) {
  3877.  if (this->B10(K11::X0)) {
  3878.  auto M6
  3879.  = new L3(true,
  3880.  list,
  3881.  S8(S8(*block_L11), S8(*prev(this->next_L11))));
  3882.  auto stmt = new R8(M6, M6->text_area);
  3883.  return Y3(stmt, this);
  3884.  }
  3885.  
  3886.  this->J7();
  3887.  auto stmt = this->V7();
  3888.  this->K4();
  3889.  
  3890.  if (!stmt.Z10(this, Y3::P12, "Expected a A12ment")) {
  3891.  return Y3("", this);
  3892.  }
  3893.  
  3894.  list.push_back(stmt.stmt);
  3895.  }
  3896.  
  3897.  return Y3("Block A12ment must end with a close curly bracket", this);
  3898.  }
  3899.  else if (this->B10(K11::F1)) {
  3900.  K11 *block_L11 = &*prev(this->next_L11);
  3901.  std::vector<R8 *> list;
  3902.  while (this->V9()) {
  3903.  if (this->B10(K11::X0)) {
  3904.  auto M6
  3905.  = new L3(false,
  3906.  list,
  3907.  S8(S8(*block_L11), S8(*prev(this->next_L11))));
  3908.  auto stmt = new R8(M6, M6->text_area);
  3909.  return Y3(stmt, this);
  3910.  }
  3911.  
  3912.  this->J7();
  3913.  auto stmt = this->V7();
  3914.  this->K4();
  3915.  
  3916.  if (!stmt.Z10(this, Y3::P12, "Expected a A12ment")) {
  3917.  return Y3("", this);
  3918.  }
  3919.  
  3920.  list.push_back(stmt.stmt);
  3921.  }
  3922.  return Y3("Block A12ment must end with a close curly bracket", this);
  3923.  }
  3924.  
  3925.  this->J7();
  3926.  auto T12 = this->U7();
  3927.  this->K4();
  3928.  
  3929.  if (!T12.Z10(this, Y3::N12, "Unknown A12ment")) {
  3930.  return Y3("", this);
  3931.  }
  3932.  if (!this->B10(K11::B7)) {
  3933.  return Y3("Expression A12ment must end with a semicolon", this);
  3934.  }
  3935.  
  3936.  auto stmt = new R8(T12.T12, T12.T12->text_area);
  3937.  return Y3(stmt, this);
  3938. }
  3939.  
  3940. R8 *K10::B12(const std::vector<K11> &L11s) {
  3941.  this->L11s = L11s;
  3942.  this->next_L11 = this->L11s.begin();
  3943.  this->A12.N1 = W3;
  3944.  this->A12.P4 = A3;
  3945.  this->A12.report_errors = true;
  3946.  this->A12.L11 = nullptr;
  3947.  this->Z3->setErrorCharPos(-1);
  3948.  this->Z3->setErrorMessage("");
  3949.  
  3950.  if (!L11s.empty()) {
  3951.  this->K7((K11 *)&(L11s[0]));
  3952.  }
  3953.  
  3954.  if (L11s.empty()) {
  3955.  return new R8(new L3(false, {}, S8()), S8());
  3956.  }
  3957.  
  3958.  std::vector<R8 *> A12ments;
  3959.  while (this->V9()) {
  3960.  skipSemicolons(this);
  3961.  if (!this->V9()) {
  3962.  break;
  3963.  }
  3964.  
  3965.  this->J7();
  3966.  this->A12.report_errors = false;
  3967.  Y3 res = this->V7();
  3968.  this->K4();
  3969.  
  3970.  res.Z10(this, Y3::P12, "Failed to B12 a A12ment");
  3971.  
  3972.  A12ments.push_back(res.stmt);
  3973.  }
  3974.  auto ta = (A12ments.empty()) ? S8() : A12ments.front()->text_area;
  3975.  ta = (A12ments.empty()) ? S8() : S8(ta, A12ments.back()->text_area);
  3976.  auto block = new L3(false, A12ments, ta);
  3977.  auto res = new R8(block, ta);
  3978.  return res;
  3979. }
  3980.  
  3981. K10::Y3::Y3(const std::string &Q3, K10 *p) {
  3982.  this->X9 = false;
  3983.  this->Q3 = Q3;
  3984.  this->A12 = p->A12;
  3985. }
  3986.  
  3987. K10::Y3::Y3(ResultId id, K10 *p) {
  3988.  this->X9 = true;
  3989.  this->id = id;
  3990.  this->A12 = p->A12;
  3991. }
  3992.  
  3993. K10::Y3::Y3(P8 *T12, K10 *p) {
  3994.  this->X9 = true;
  3995.  this->id = N12;
  3996.  this->T12 = T12;
  3997.  this->A12 = p->A12;
  3998. }
  3999.  
  4000. K10::Y3::Y3(Z4 *func_def, K10 *p) {
  4001.  this->X9 = true;
  4002.  this->id = V8;
  4003.  this->T12 = T12;
  4004.  this->A12 = p->A12;
  4005. }
  4006.  
  4007. K10::Y3::Y3(A5 *type_def, K10 *p) {
  4008.  this->X9 = true;
  4009.  this->id = W8;
  4010.  this->T12 = T12;
  4011.  this->A12 = p->A12;
  4012. }
  4013.  
  4014. K10::Y3::Y3(I4 *op, K10 *p) {
  4015.  this->X9 = true;
  4016.  this->id = X8;
  4017.  this->T12 = T12;
  4018.  this->A12 = p->A12;
  4019. }
  4020.  
  4021. K10::Y3::Y3(Q8 *R12, K10 *p) {
  4022.  this->X9 = true;
  4023.  this->id = ATOM;
  4024.  this->T12 = T12;
  4025.  this->A12 = p->A12;
  4026. }
  4027.  
  4028. K10::Y3::Y3(B5 *par_T12, K10 *p) {
  4029.  this->X9 = true;
  4030.  this->id = Y8;
  4031.  this->T12 = T12;
  4032.  this->A12 = p->A12;
  4033. }
  4034.  
  4035. K10::Y3::Y3(J3 *Y11_list, K10 *p) {
  4036.  this->X9 = true;
  4037.  this->id = E6;
  4038.  this->T12 = T12;
  4039.  this->A12 = p->A12;
  4040. }
  4041.  
  4042. K10::Y3::Y3(R8 *stmt, K10 *p) {
  4043.  this->X9 = true;
  4044.  this->id = P12;
  4045.  this->stmt = stmt;
  4046.  this->A12 = p->A12;
  4047. }
  4048.  
  4049. K10::Y3::Y3(K3 *L6, K10 *p) {
  4050.  this->X9 = true;
  4051.  this->id = G6;
  4052.  this->L6 = L6;
  4053.  this->A12 = p->A12;
  4054. }
  4055.  
  4056. K10::Y3::Y3(C5 *F9, K10 *p) {
  4057.  this->X9 = true;
  4058.  this->id = Z8;
  4059.  this->F9 = F9;
  4060.  this->A12 = p->A12;
  4061. }
  4062.  
  4063.  
  4064. K10::Y3::Y3(Y5 *C10, K10 *p) {
  4065.  this->X9 = true;
  4066.  this->id = Y9;
  4067.  this->C10 = C10;
  4068.  this->A12 = p->A12;
  4069. }
  4070.  
  4071. K10::Y3::Y3(T2 *return_stmt, K10 *p) {
  4072.  this->X9 = true;
  4073.  this->id = G5;
  4074.  this->return_stmt = return_stmt;
  4075.  this->A12 = p->A12;
  4076. }
  4077.  
  4078. K10::Y3::Y3(L3 *M6, K10 *p) {
  4079.  this->X9 = true;
  4080.  this->id = I6;
  4081.  this->M6 = M6;
  4082.  this->A12 = p->A12;
  4083. }
  4084.  
  4085. }
  4086.  
  4087.  
  4088.  
  4089. static void N6(FILE *fd, std::string color = "reset") {
  4090. #ifndef NOCOLOROUTPUT
  4091.  std::string col = "\033[0m";
  4092.  
  4093.  if (color == "blue") {
  4094.  col = "\033[0;34m";
  4095.  }
  4096.  else if (color == "green") {
  4097.  col = "\033[0;32m";
  4098.  }
  4099.  else if (color == "cyan") {
  4100.  col = "\033[0;36m";
  4101.  }
  4102.  else if (color == "red") {
  4103.  col = "\033[0;31m";
  4104.  }
  4105.  else if (color == "magenta") {
  4106.  col = "\033[0;35m";
  4107.  }
  4108.  else if (color == "yellow") {
  4109.  col = "\033[0;33m";
  4110.  }
  4111.  
  4112.  fprintf(fd, "%s", col.c_str());
  4113. #endif
  4114. }
  4115.  
  4116. namespace H10 {
  4117. C4::C4(void (*emergency_error_exit)()) {
  4118.  this->emergency_error_exit = emergency_error_exit;
  4119.  this->clearError();
  4120. }
  4121.  
  4122. void C4::setErrorFilename(const std::string &C9) {
  4123.  this->error_C9 = C9;
  4124. }
  4125.  
  4126. void C4::setErrorCharPos(int64_t char_pos) {
  4127.  this->error_char_pos = char_pos;
  4128. }
  4129.  
  4130. void C4::setErrorMessage(const std::string &message) {
  4131.  this->Q3 = message;
  4132. }
  4133.  
  4134. void C4::clearError() {
  4135.  this->error_C9 = "";
  4136.  this->error_char_pos = -1;
  4137.  this->Q3 = "";
  4138. }
  4139.  
  4140. void C4::T4(const std::string &message, int64_t char_pos, bool eee) {
  4141.  if (this->error_C9.empty()) {
  4142.  if (char_pos != -1) {
  4143.  N6(stderr, "red");
  4144.  fprintf(stderr, "Error has occurred at position %ld: %s.\n", char_pos, message.c_str());
  4145.  N6(stderr, "reset");
  4146.  }
  4147.  else {
  4148.  N6(stderr, "red");
  4149.  fprintf(stderr, "Error has occurred: %s.\n", message.c_str());
  4150.  N6(stderr, "reset");
  4151.  }
  4152.  if (eee) {
  4153.  this->emergency_error_exit();
  4154.  }
  4155.  else {
  4156.  return;
  4157.  }
  4158.  }
  4159.  
  4160.  if (char_pos == -1) {
  4161.  N6(stderr, "red");
  4162.  fprintf(stderr, "Error has occurred in file %s: %s.\n", this->error_C9.c_str(), message.c_str());
  4163.  N6(stderr, "reset");
  4164.  if (eee) {
  4165.  this->emergency_error_exit();
  4166.  }
  4167.  else {
  4168.  return;
  4169.  }
  4170.  }
  4171.  
  4172.  FILE *fd = fopen(this->error_C9.c_str(), "r");
  4173.  if (fd == nullptr) {
  4174.  N6(stderr, "red");
  4175.  perror("Failed to open file where the error has occurred");
  4176.  N6(stderr, "reset");
  4177.  this->setErrorFilename("");
  4178.  this->T4(message); }
  4179.  
  4180.  int64_t lines = 1;
  4181.  int64_t column = 1;
  4182.  int64_t I1 = 0;
  4183.  for (int64_t pos = 0; pos < char_pos; pos++) {
  4184.  char c = fgetc(fd);
  4185.  if (c == -1 || ferror(fd)) {
  4186.  break;
  4187.  }
  4188.  if (c == '\n') {
  4189.  I1 = pos + 1;
  4190.  lines++;
  4191.  column = 1;
  4192.  }
  4193.  else {
  4194.  column++;
  4195.  }
  4196.  }
  4197.  
  4198.  N6(stderr, "red");
  4199.  fprintf(stderr, "Error has occurred in file %s\n", this->error_C9.c_str());
  4200.  N6(stderr, "reset");
  4201.  if (fseek(fd, I1, SEEK_SET) == -1) {
  4202.  N6(stderr, "red");
  4203.  fprintf(stderr, "Error reading the file. Original error message: %s\n", message.c_str());
  4204.  N6(stderr, "reset");
  4205.  if (eee) {
  4206.  this->emergency_error_exit();
  4207.  }
  4208.  else {
  4209.  return;
  4210.  }
  4211.  };
  4212.  
  4213.  static char buf[256];
  4214.  int64_t prefix = sprintf(buf, "%ld:%ld | ", lines, column);
  4215.  
  4216.  fprintf(stderr, "%s", buf);
  4217.  int64_t pos;
  4218.  for (pos = I1;; pos++) {
  4219.  {
  4220.  char c = fgetc(fd);
  4221.  if (c == '\n' || c == -1 || ferror(fd)) {
  4222.  fprintf(stderr, "\n");
  4223.  break;
  4224.  }
  4225.  fprintf(stderr, "%c", c);
  4226.  }
  4227.  }
  4228.  
  4229.  int64_t spaces = std::min(pos, char_pos) - I1 + prefix;
  4230.  for (int64_t i = 0; i < spaces; i++) {
  4231.  fprintf(stderr, " ");
  4232.  }
  4233.  N6(stderr, "red");
  4234.  fprintf(stderr, "^\n");
  4235.  for (int64_t i = 0; i < spaces; i++) {
  4236.  fprintf(stderr, " ");
  4237.  }
  4238.  fprintf(stderr, "|\n");
  4239.  for (int64_t i = 0; i < spaces; i++) {
  4240.  fprintf(stderr, " ");
  4241.  }
  4242.  fprintf(stderr, "+-- %s.\n", message.c_str());
  4243.  N6(stderr, "reset");
  4244.  
  4245.  if (eee) {
  4246.  this->emergency_error_exit();
  4247.  }
  4248.  else {
  4249.  return;
  4250.  }
  4251. }
  4252.  
  4253. void C4::T4(const std::string &message, const K11 &L11, bool eee) {
  4254.  eassert(L11.N7 != -1 && L11.A10 != -1,
  4255.  std::string("Invalid L11. Original message: ") + message,
  4256.  this);
  4257.  auto &C9 = L11.C9;
  4258.  if (C9.empty()) {
  4259.  N6(stderr, "red");
  4260.  fprintf(stderr,
  4261.  "Error has occurred at positions %ld..%ld: %s.\n",
  4262.  L11.N7,
  4263.  L11.A10,
  4264.  message.c_str());
  4265.  N6(stderr, "reset");
  4266.  
  4267.  if (eee) {
  4268.  this->emergency_error_exit();
  4269.  }
  4270.  else {
  4271.  return;
  4272.  }
  4273.  }
  4274.  
  4275.  FILE *fd = fopen(C9.c_str(), "r");
  4276.  if (fd == nullptr) {
  4277.  N6(stderr, "red");
  4278.  perror("Failed to open file where the error has occurred");
  4279.  N6(stderr, "reset");
  4280.  this->setErrorFilename("");
  4281.  this->T4(message); }
  4282.  
  4283.  int64_t lines = 1;
  4284.  int64_t column = 1;
  4285.  int64_t I1 = 0;
  4286.  for (int64_t pos = 0; pos < L11.N7; pos++) {
  4287.  char c = fgetc(fd);
  4288.  if (c == -1 || ferror(fd)) {
  4289.  break;
  4290.  }
  4291.  if (c == '\n') {
  4292.  I1 = pos + 1;
  4293.  lines++;
  4294.  column = 1;
  4295.  }
  4296.  else {
  4297.  column++;
  4298.  }
  4299.  }
  4300.  
  4301.  N6(stderr, "red");
  4302.  fprintf(stderr, "Error has occurred in file %s\n", C9.c_str());
  4303.  N6(stderr, "reset");
  4304.  if (fseek(fd, I1, SEEK_SET) == -1) {
  4305.  N6(stderr, "red");
  4306.  fprintf(stderr, "Error reading the file. Original error message: %s\n", message.c_str());
  4307.  N6(stderr, "reset");
  4308.  if (eee) {
  4309.  this->emergency_error_exit();
  4310.  }
  4311.  else {
  4312.  return;
  4313.  }
  4314.  };
  4315.  
  4316.  static char buf[256];
  4317.  int64_t prefix = sprintf(buf, "%ld:%ld..%ld | ", lines, column, column + L11.A10 - L11.N7 - 1);
  4318.  
  4319.  fprintf(stderr, "%s", buf);
  4320.  int64_t pos;
  4321.  for (pos = I1;; pos++) {
  4322.  {
  4323.  char c = fgetc(fd);
  4324.  if (c == '\n' || c == -1 || ferror(fd)) {
  4325.  fprintf(stderr, "\n");
  4326.  break;
  4327.  }
  4328.  fprintf(stderr, "%c", c);
  4329.  }
  4330.  }
  4331.  
  4332.  int64_t spaces = std::min(pos, L11.N7) - I1 + prefix;
  4333.  for (int64_t i = 0; i < spaces; i++) {
  4334.  fprintf(stderr, " ");
  4335.  }
  4336.  N6(stderr, "red");
  4337.  for (int64_t i = 0; i < std::min((int64_t)100, L11.A10 - L11.N7); i++) {
  4338.  fprintf(stderr, "^");
  4339.  }
  4340.  fprintf(stderr, "\n");
  4341.  for (int64_t i = 0; i < spaces; i++) {
  4342.  fprintf(stderr, " ");
  4343.  }
  4344.  fprintf(stderr, "|\n");
  4345.  for (int64_t i = 0; i < spaces; i++) {
  4346.  fprintf(stderr, " ");
  4347.  }
  4348.  fprintf(stderr, "+-- %s.\n", message.c_str());
  4349.  N6(stderr, "reset");
  4350.  
  4351.  if (eee) {
  4352.  this->emergency_error_exit();
  4353.  }
  4354.  else {
  4355.  return;
  4356.  }
  4357. }
  4358.  
  4359. void C4::T4(bool eee) {
  4360.  this->T4(this->Q3, this->error_char_pos, eee);
  4361. }
  4362.  
  4363. void C4::T4(const std::string &message, bool eee) {
  4364.  this->T4(message, this->error_char_pos, eee);
  4365. }
  4366.  
  4367. void C4::T4(const std::vector<std::pair<K11 *, std::string>> errors, bool eee) {
  4368.  size_t cnt = 0;
  4369.  for (auto &[L11, message] : errors) {
  4370.  if (message.empty()) {
  4371.  continue; }
  4372.  if (cnt != 0) {
  4373.  fprintf(stderr, "The mentioned error happened because of the following error:\n");
  4374.  }
  4375.  cnt++;
  4376.  if (L11 != nullptr) {
  4377.  this->T4(message, *L11, false);
  4378.  }
  4379.  else {
  4380.  this->setErrorCharPos(-1);
  4381.  this->T4(message, false);
  4382.  }
  4383.  }
  4384.  
  4385.  if (eee) {
  4386.  this->emergency_error_exit();
  4387.  }
  4388.  else {
  4389.  return;
  4390.  }
  4391. }
  4392.  
  4393. void C4::T4WithContext(const std::vector<std::pair<std::string, K11 *>> G9, bool eee) {
  4394.  fprintf(stderr, "A runtime error has occurred. Here is the context in which the error occurred:\n");
  4395.  
  4396.  size_t cnt = 0;
  4397.  for (auto &[message, L11] : G9) {
  4398.  if (message.empty()) {
  4399.  continue; }
  4400.  cnt++;
  4401.  if (cnt == G9.size()) {
  4402.  break;
  4403.  }
  4404.  if (L11 != nullptr) {
  4405.  this->T4(message, *L11, false);
  4406.  }
  4407.  else {
  4408.  this->setErrorCharPos(-1);
  4409.  this->T4(message, false);
  4410.  }
  4411.  }
  4412.  
  4413.  if (!G9.empty()) {
  4414.  auto &[error, L11] = G9.back();
  4415.  
  4416.  fprintf(stderr, "Here is the error:\n");
  4417.  if (L11 != nullptr) {
  4418.  this->T4(error, *L11, false);
  4419.  }
  4420.  else {
  4421.  this->setErrorCharPos(-1);
  4422.  this->T4(error, false);
  4423.  }
  4424.  }
  4425.  
  4426.  if (eee) {
  4427.  this->emergency_error_exit();
  4428.  }
  4429.  else {
  4430.  return;
  4431.  }
  4432. }
  4433.  
  4434. static bool R4(int64_t l, int64_t r, int64_t L, int64_t R) {
  4435.  return std::max(l, L) <= std::min(r, R);
  4436. }
  4437.  
  4438. void C4::T4(const std::string &message, const S8 &ta, bool eee) {
  4439.  if (ta.C9 == nullptr || ta.C9->empty()) {
  4440.  N6(stderr, "red");
  4441.  fprintf(stderr,
  4442.  "Error has occurred at positions %ld..%ld: %s.\n",
  4443.  ta.first_char,
  4444.  ta.last_char,
  4445.  message.c_str());
  4446.  N6(stderr, "reset");
  4447.  
  4448.  if (eee) {
  4449.  this->emergency_error_exit();
  4450.  }
  4451.  else {
  4452.  return;
  4453.  }
  4454.  }
  4455.  auto C9 = *ta.C9;
  4456.  
  4457.  FILE *fd = fopen(C9.c_str(), "r");
  4458.  if (fd == nullptr) {
  4459.  N6(stderr, "red");
  4460.  perror("Failed to open file where the error has occurred");
  4461.  N6(stderr, "reset");
  4462.  this->setErrorFilename("");
  4463.  this->T4(message); }
  4464.  
  4465.  int64_t lines = 1;
  4466.  int64_t column = 1;
  4467.  int64_t I1 = 0;
  4468.  std::string cur_line;
  4469.  std::vector<std::pair<std::pair<int64_t, int64_t>, std::string>> error_lines;
  4470.  for (int64_t pos = 0;; pos++) {
  4471.  char c = fgetc(fd);
  4472.  if (c == -1 || ferror(fd)) {
  4473.  int64_t Q4 = pos - cur_line.size();
  4474.  int64_t O6 = pos - 1;
  4475.  if (R4(Q4, O6, ta.first_char, ta.last_char - 1)) {
  4476.  error_lines.push_back({
  4477.  {Q4, lines},
  4478.  cur_line
  4479.  });
  4480.  }
  4481.  break;
  4482.  }
  4483.  if (c == '\n') {
  4484.  int64_t Q4 = pos - cur_line.size();
  4485.  int64_t O6 = pos - 1;
  4486.  if (R4(Q4, O6, ta.first_char, ta.last_char - 1)) {
  4487.  error_lines.push_back({
  4488.  {Q4, lines},
  4489.  cur_line
  4490.  });
  4491.  }
  4492.  I1 = pos + 1;
  4493.  lines++;
  4494.  column = 1;
  4495.  cur_line = "";
  4496.  }
  4497.  else {
  4498.  column++;
  4499.  cur_line += c;
  4500.  }
  4501.  }
  4502.  
  4503.  N6(stderr, "red");
  4504.  fprintf(stderr, "Error has occurred in file %s\n", C9.c_str());
  4505.  N6(stderr, "reset");
  4506.  if (fseek(fd, I1, SEEK_SET) == -1) {
  4507.  N6(stderr, "red");
  4508.  fprintf(stderr, "Error reading the file. Original error message: %s\n", message.c_str());
  4509.  N6(stderr, "reset");
  4510.  if (eee) {
  4511.  this->emergency_error_exit();
  4512.  }
  4513.  else {
  4514.  return;
  4515.  }
  4516.  };
  4517.  
  4518.  if (error_lines.size() == 0) {
  4519.  N6(stderr, "red");
  4520.  fprintf(stderr, "at positions %ld..%ld", ta.first_char, ta.last_char);
  4521.  N6(stderr, "reset");
  4522.  if (eee) {
  4523.  this->emergency_error_exit();
  4524.  }
  4525.  else {
  4526.  return;
  4527.  }
  4528.  }
  4529.  
  4530.  if (error_lines.size() == 1) {
  4531.  static char buf[256];
  4532.  int64_t prefix = sprintf(buf,
  4533.  "%ld:%ld..%ld | ",
  4534.  error_lines[0].first.second,
  4535.  ta.first_char - error_lines[0].first.first + 1,
  4536.  ta.last_char - 1 - error_lines[0].first.first + 1);
  4537.  fprintf(stderr, "%s%s\n", buf, error_lines[0].second.c_str());
  4538.  int64_t spaces = prefix + ta.first_char - error_lines[0].first.first;
  4539.  for (int64_t i = 0; i < spaces; i++) {
  4540.  fprintf(stderr, " ");
  4541.  }
  4542.  N6(stderr, "red");
  4543.  for (int64_t i = 0; i < ta.last_char - ta.first_char; i++) {
  4544.  fprintf(stderr, "^");
  4545.  }
  4546.  fprintf(stderr, "\n");
  4547.  for (int64_t i = 0; i < spaces; i++) {
  4548.  fprintf(stderr, " ");
  4549.  }
  4550.  fprintf(stderr, "|\n");
  4551.  for (int64_t i = 0; i < spaces; i++) {
  4552.  fprintf(stderr, " ");
  4553.  }
  4554.  fprintf(stderr, "+-- %s.\n", message.c_str());
  4555.  N6(stderr, "reset");
  4556.  
  4557.  if (eee) {
  4558.  this->emergency_error_exit();
  4559.  }
  4560.  else {
  4561.  return;
  4562.  }
  4563.  }
  4564.  
  4565.  static char buf_first[256];
  4566.  int64_t prefix_first = sprintf(buf_first,
  4567.  "%ld:%ld..%ld",
  4568.  error_lines.front().first.second,
  4569.  ta.first_char - error_lines[0].first.first + 1,
  4570.  error_lines.front().second.size());
  4571.  static char buf_last[256];
  4572.  int64_t prefix_last = sprintf(buf_last,
  4573.  "%ld:%ld..%ld",
  4574.  error_lines.back().first.second,
  4575.  1l,
  4576.  ta.last_char - 1 - error_lines.back().first.first + 1);
  4577.  static char buf_mid[256];
  4578.  int64_t biggest_mid
  4579.  = (error_lines.size() > 2) ? sprintf(buf_mid, "%ld:entire line", error_lines.back().first.second) : 0;
  4580.  
  4581.  int64_t prefix = std::max(std::max(prefix_first, prefix_last), biggest_mid);
  4582.  
  4583.  int64_t spaces = prefix + 3;
  4584.  for (int64_t i = 0; i < spaces + ta.first_char - error_lines.front().first.first; i++) {
  4585.  fprintf(stderr, " ");
  4586.  }
  4587.  N6(stderr, "red");
  4588.  for (int64_t i = 0; i < error_lines.front().second.size() - (ta.first_char - error_lines.front().first.first);
  4589.  i++)
  4590.  {
  4591.  fprintf(stderr, "v");
  4592.  }
  4593.  fprintf(stderr, " --- error message is in the last line");
  4594.  N6(stderr, "reset");
  4595.  fprintf(stderr, "\n");
  4596.  
  4597.  fprintf(stderr, "%s", buf_first);
  4598.  for (int64_t i = prefix - prefix_first; i > 0; i--) {
  4599.  fprintf(stderr, " ");
  4600.  }
  4601.  fprintf(stderr, " | ");
  4602.  fprintf(stderr, "%s\n", error_lines.front().second.c_str());
  4603.  
  4604.  for (int64_t i = 1; i < error_lines.size() - 1; i++) {
  4605.  int64_t prefix_mid = sprintf(buf_mid, "%ld:entire line", error_lines[i].first.second);
  4606.  fprintf(stderr, "%s", buf_mid);
  4607.  for (int64_t i = prefix - prefix_mid; i > 0; i--) {
  4608.  fprintf(stderr, " ");
  4609.  }
  4610.  fprintf(stderr, " | ");
  4611.  fprintf(stderr, "%s\n", error_lines[i].second.c_str());
  4612.  }
  4613.  
  4614.  fprintf(stderr, "%s", buf_last);
  4615.  for (int64_t i = prefix - prefix_last; i > 0; i--) {
  4616.  fprintf(stderr, " ");
  4617.  }
  4618.  fprintf(stderr, " | ");
  4619.  fprintf(stderr, "%s\n", error_lines.back().second.c_str());
  4620.  
  4621.  spaces = prefix + 3;
  4622.  for (int64_t i = 0; i < spaces; i++) {
  4623.  fprintf(stderr, " ");
  4624.  }
  4625.  N6(stderr, "red");
  4626.  for (int64_t i = 0; i < ta.last_char - error_lines.back().first.first; i++) {
  4627.  fprintf(stderr, "^");
  4628.  }
  4629.  fprintf(stderr, "\n");
  4630.  for (int64_t i = 0; i < spaces; i++) {
  4631.  fprintf(stderr, " ");
  4632.  }
  4633.  fprintf(stderr, "|\n");
  4634.  for (int64_t i = 0; i < spaces; i++) {
  4635.  fprintf(stderr, " ");
  4636.  }
  4637.  fprintf(stderr, "+-- %s.\n", message.c_str());
  4638.  N6(stderr, "reset");
  4639.  
  4640.  if (eee) {
  4641.  this->emergency_error_exit();
  4642.  }
  4643.  else {
  4644.  return;
  4645.  }
  4646.  
  4647. }
  4648.  
  4649. void __assert__(bool N11,
  4650.  const char *assertion,
  4651.  const std::string &message,
  4652.  C4 *Z3,
  4653.  const char *C9,
  4654.  int line) {
  4655.  if (!N11) {
  4656.  static char buf[1024];
  4657.  sprintf(buf,
  4658.  "Assertion failed: %s. Happened in %s, line %d: %s\n",
  4659.  message.c_str(),
  4660.  C9,
  4661.  line,
  4662.  assertion);
  4663.  Z3->T4(std::string(buf));
  4664.  }
  4665. }
  4666.  
  4667. }
  4668.  
  4669. namespace H10 {
  4670. Scope::Scope(Scope *prev, Scope *W10, bool can_access_prev) {
  4671.  B2();
  4672.  this->prev = prev;
  4673.  this->W10 = W10;
  4674.  this->can_access_prev = can_access_prev;
  4675.  this->is_function_call = false;
  4676. }
  4677.  
  4678. Scope::~Scope() {
  4679.  B2();
  4680.  this->prev = nullptr;
  4681.  this->W10 = nullptr;
  4682.  this->can_access_prev = false;
  4683.  this->variables.clear();
  4684.  this->M7.clear();
  4685. }
  4686.  
  4687. Scope *Scope::getPrev() {
  4688.  return this->prev;
  4689. }
  4690.  
  4691. Scope *Scope::getMaster() {
  4692.  return this->W10;
  4693. }
  4694.  
  4695. std::vector<J10 *> &Scope::getArguments() {
  4696.  return this->M7;
  4697. }
  4698.  
  4699. bool Scope::canAccessPrev() {
  4700.  return this->can_access_prev;
  4701. }
  4702.  
  4703. bool Scope::isFunctionCall() {
  4704.  return this->is_function_call;
  4705. }
  4706.  
  4707. void Scope::setCanAccessPrev(bool N11) {
  4708.  this->can_access_prev = N11;
  4709. }
  4710.  
  4711. void Scope::setIsFunctionCall(bool N11) {
  4712.  this->is_function_call = N11;
  4713. }
  4714.  
  4715. void Scope::L5(I10 id, J10 *obj, K9 *rt) {
  4716.  B2();
  4717.  this->variables[id] = obj;
  4718.  obj->Y2();
  4719. }
  4720.  
  4721. J10 *Scope::getVariable(I10 id, K9 *rt) {
  4722.  B2();
  4723.  Scope *s = this;
  4724.  while (s != nullptr) {
  4725.  auto it = s->variables.find(id);
  4726.  if (it != s->variables.end()) {
  4727.  return it->second;
  4728.  }
  4729.  if (s->can_access_prev) {
  4730.  s = s->prev;
  4731.  }
  4732.  else {
  4733.  if (s == s->W10) {
  4734.  break;
  4735.  }
  4736.  else {
  4737.  s = s->W10;
  4738.  }
  4739.  }
  4740.  }
  4741.  
  4742.  rt->T4("Failed to find variable " + rt->S12->R7(id), rt->R5().area);
  4743. }
  4744.  
  4745. void Scope::removeVariable(I10 id, K9 *rt) {
  4746.  this->variables.erase(id);
  4747. }
  4748.  
  4749. bool Scope::queryVariable(I10 id, K9 *rt) {
  4750.  B2();
  4751.  Scope *s = this;
  4752.  while (s != nullptr) {
  4753.  auto it = s->variables.find(id);
  4754.  if (it != s->variables.end()) {
  4755.  return true;
  4756.  }
  4757.  if (s->can_access_prev) {
  4758.  s = s->prev;
  4759.  }
  4760.  else {
  4761.  if (s == s->W10) {
  4762.  break;
  4763.  }
  4764.  else {
  4765.  s = s->W10;
  4766.  }
  4767.  }
  4768.  }
  4769.  return false;
  4770. }
  4771.  
  4772. }
  4773.  
  4774.  
  4775.  
  4776. namespace H10 {
  4777.  
  4778. std::string const D4::failed = "[INVALID NAMEID]";
  4779.  
  4780. I10 D4::Z11(const std::string &str) {
  4781.  B2();
  4782.  auto it = this->Q12.find(str);
  4783.  if (it != this->Q12.end()) {
  4784.  return it->second;
  4785.  }
  4786.  auto new_id = (I10)this->Q12.size() + 1;
  4787.  this->Q12[str] = new_id;
  4788.  this->Q12_reversed[new_id] = str;
  4789.  return new_id;
  4790. }
  4791.  
  4792. std::string const &D4::R7(I10 id) {
  4793.  B2();
  4794.  auto it = this->Q12_reversed.find(id);
  4795.  if (it == this->Q12_reversed.end()) {
  4796.  return this->failed;
  4797.  }
  4798.  return it->second;
  4799. }
  4800.  
  4801. bool D4::check(I10 id) {
  4802.  B2();
  4803.  auto it = this->Q12_reversed.find(id);
  4804.  return it != this->Q12_reversed.end();
  4805. }
  4806. };
  4807. #include <cstdint>
  4808.  
  4809. namespace H10 {
  4810. int64_t J10::total_V10s = 0;
  4811.  
  4812. J10::J10(bool is_H8, G8 *H8, I12 *type, K9 *rt) {
  4813.  B2();
  4814.  this->is_H8 = is_H8;
  4815.  this->H8 = H8;
  4816.  this->type = type;
  4817.  this->gc_mark = !rt->getGC()->gc_mark;
  4818.  this->id = ++total_V10s;
  4819.  this->can_modify = true;
  4820.  this->single_use = false;
  4821.  rt->getGC()->C12(this);
  4822. }
  4823.  
  4824. J10::~J10() {
  4825.  B2();
  4826.  this->H8 = nullptr;
  4827.  this->type = nullptr;
  4828.  total_V10s--;
  4829. }
  4830.  
  4831. std::vector<J10 *> J10::getGCReachable() {
  4832.  B2();
  4833.  std::vector<J10 *> res;
  4834.  if (this->H8 != nullptr) {
  4835.  for (auto &elem : this->H8->getGCReachable()) {
  4836.  res.push_back(elem);
  4837.  }
  4838.  }
  4839.  if (this->type != nullptr) {
  4840.  for (auto &elem : this->type->getGCReachable()) {
  4841.  res.push_back(elem);
  4842.  }
  4843.  }
  4844.  return res;
  4845. }
  4846.  
  4847. std::string J10::userRepr(K9 *rt) {
  4848.  B2();
  4849.  if (this == nullptr) {
  4850.  return std::string("J10(nullptr)");
  4851.  }
  4852.  if (this->H8 == nullptr) {
  4853.  return this->type->userRepr(rt);
  4854.  }
  4855.  return this->H8->userRepr(rt);
  4856. }
  4857.  
  4858. void J10::assignTo(J10 *obj, K9 *rt) {
  4859.  B2();
  4860.  if (!this->can_modify) {
  4861.  rt->T4("Cannot assign to " + this->userRepr(rt), rt->R5().area);
  4862.  }
  4863.  auto id = this->id;
  4864.  *this = *obj;
  4865.  this->id = id;
  4866.  this->Y2();
  4867. }
  4868.  
  4869. void J10::assignToCopyOf(J10 *obj, K9 *rt) {
  4870.  B2();
  4871.  if (!this->can_modify) {
  4872.  rt->T4("Cannot assign to " + this->userRepr(rt), rt->R5().area);
  4873.  }
  4874.  auto id = this->id;
  4875.  *this = *rt->copy(obj);
  4876.  this->id = id;
  4877.  this->Y2();
  4878. }
  4879.  
  4880. void J10::spreadSingleUse() {
  4881.  B2();
  4882.  this->single_use = true;
  4883.  if (this->H8 != nullptr) {
  4884.  this->H8->spreadSingleUse();
  4885.  }
  4886. }
  4887.  
  4888. void J10::Y2() {
  4889.  B2();
  4890.  this->single_use = false;
  4891.  if (this->H8 != nullptr) {
  4892.  this->H8->Y2();
  4893.  }
  4894. }
  4895.  
  4896. std::ostream &operator<<(std::ostream &stream, J10 *obj) {
  4897.  B2();
  4898.  if (obj == nullptr) {
  4899.  stream << "{nullptr}";
  4900.  return stream;
  4901.  }
  4902.  stream << "{" << (void *)obj << ", ";
  4903.  stream << (obj->is_H8 ? "I" : "T");
  4904.  stream << (obj->gc_mark ? "1" : "0");
  4905.  stream << (obj->gc_mark ? "W" : "R");
  4906.  stream << ", ins: " << obj->H8 << ", type: " << obj->type << "}";
  4907.  return stream;
  4908. }
  4909.  
  4910. }
  4911.  
  4912.  
  4913.  
  4914. namespace H10 {
  4915. int64_t G8::total_H8s = 0;
  4916.  
  4917. J10 *H10::G8::selectField(I10 id, K9 *rt) {
  4918.  B2();
  4919.  rt->T4(this->userRepr(rt) + "doesn't have S11 " + rt->S12->R7(id), rt->R5().area);
  4920. }
  4921.  
  4922. bool G8::hasField(I10 id, K9 *rt) {
  4923.  B2();
  4924.  return false;
  4925. }
  4926.  
  4927. void G8::addField(I10 id, J10 *obj, K9 *rt) {
  4928.  B2();
  4929. }
  4930.  
  4931. G8::G8(K9 *rt, size_t bytes) {
  4932.  B2();
  4933.  this->gc_mark = !rt->getGC()->gc_mark;
  4934.  this->id = ++total_H8s;
  4935.  rt->getGC()->C12(this, bytes);
  4936. }
  4937.  
  4938. std::vector<J10 *> G8::getGCReachable() {
  4939.  B2();
  4940.  return {};
  4941. }
  4942.  
  4943. void G8::spreadSingleUse() {
  4944.  B2();
  4945. }
  4946.  
  4947. void G8::Y2() {
  4948.  B2();
  4949. }
  4950. };
  4951.  
  4952.  
  4953.  
  4954. namespace H10 {
  4955. O1::O1() {
  4956.  B2();
  4957.  this->M5 = 0;
  4958.  this->prev_M5 = NUM_TRACKED_INIT;
  4959.  this->B3 = 0;
  4960.  this->prev_B3 = SIZEOF_TRACKED_INIT;
  4961.  this->D10 = 0;
  4962. }
  4963.  
  4964. void O1::V1(J10 *V10) {
  4965.  B2();
  4966.  this->M5++;
  4967.  this->B3 += sizeof(J10);
  4968.  this->D10++;
  4969. }
  4970.  
  4971. void O1::V1(G8 *H8, size_t bytes) {
  4972.  B2();
  4973.  this->M5++;
  4974.  this->B3 += bytes;
  4975.  this->D10++;
  4976. }
  4977.  
  4978. void O1::V1(I12 *type) {
  4979.  B2();
  4980.  this->M5++;
  4981.  this->B3 += sizeof(I12); this->D10++;
  4982. }
  4983.  
  4984. void O1::G1(J10 *V10) {
  4985.  B2();
  4986.  this->M5--;
  4987.  this->B3 -= sizeof(J10);
  4988. }
  4989.  
  4990. void O1::G1(G8 *H8) {
  4991.  B2();
  4992.  this->M5--;
  4993.  this->B3 -= H8->getSize();
  4994. }
  4995.  
  4996. void O1::G1(I12 *type) {
  4997.  B2();
  4998.  this->M5--;
  4999.  this->B3 -= sizeof(I12);
  5000. }
  5001.  
  5002. void O1::P0(K9 *rt) {
  5003.  B2();
  5004.  this->prev_M5 = rt->getGC()->P1.size() + rt->getGC()->M2.size()
  5005.  + rt->getGC()->A4.size();
  5006.  this->prev_B3 = 0;
  5007.  for (auto &[obj, _] : rt->getGC()->M2) {
  5008.  this->prev_B3 += sizeof(obj);
  5009.  }
  5010.  for (auto &[ins, _] : rt->getGC()->P1) {
  5011.  this->prev_B3 += ins->getSize();
  5012.  }
  5013.  for (auto &[type, _] : rt->getGC()->A4) {
  5014.  this->prev_B3 += sizeof(type);
  5015.  }
  5016.  this->M5 = this->prev_M5;
  5017.  this->B3 = this->prev_B3;
  5018. }
  5019.  
  5020. void O1::F2(K9 *rt) {
  5021.  B2();
  5022.  this->L2(rt);
  5023. }
  5024.  
  5025. void O1::L2(K9 *rt) {
  5026.  B2();
  5027.  if (this->B3 >= MIN_CYCLE_SIZE
  5028.  && ((this->prev_M5 < this->M5 / NUM_TRACKED_K12)
  5029.  || (this->prev_B3 < this->B3 / SIZEOF_TRACKED_K12)
  5030.  || (this->D10 >= OPS_MOD)))
  5031.  {
  5032.  this->D10 %= OPS_MOD;
  5033.  rt->getGC()->runCycle(rt);
  5034.  }
  5035. }
  5036.  
  5037. GC::GC(P6 *gc_strategy) {
  5038.  B2();
  5039.  this->gc_strategy = gc_strategy;
  5040.  this->gc_mark = 1;
  5041.  this->enabled = true;
  5042. }
  5043.  
  5044. GC::~GC() {
  5045.  B2();
  5046.  for (auto &[obj, _] : this->M2) {
  5047.  delete (obj);
  5048.  }
  5049.  for (auto &[ins, _] : this->P1) {
  5050.  delete (ins);
  5051.  }
  5052.  for (auto &[type, _] : this->A4) {
  5053.  delete type;
  5054.  }
  5055. }
  5056.  
  5057. void GC::C12(J10 *V10) {
  5058.  B2();
  5059.  if (this->M2.find(V10) != this->M2.end()) {
  5060.  return;
  5061.  }
  5062.  this->M2[V10] = true;
  5063.  this->gc_strategy->V1(V10);
  5064. }
  5065.  
  5066. void GC::C12(G8 *H8, size_t bytes) {
  5067.  B2();
  5068.  if (this->P1.find(H8) != this->P1.end()) {
  5069.  return;
  5070.  }
  5071.  this->P1[H8] = true;
  5072.  this->gc_strategy->V1(H8, bytes);
  5073. }
  5074.  
  5075. void GC::C12(I12 *type) {
  5076.  B2();
  5077.  if (this->A4.find(type) != this->A4.end()) {
  5078.  return;
  5079.  }
  5080.  this->A4[type] = true;
  5081.  this->gc_strategy->V1(type);
  5082. }
  5083.  
  5084. void GC::E10(J10 *V10) {
  5085.  B2();
  5086.  auto it = this->M2.find(V10);
  5087.  if (it == this->M2.end()) {
  5088.  return;
  5089.  }
  5090.  this->M2.erase(V10);
  5091. }
  5092.  
  5093. void GC::E10(G8 *H8) {
  5094.  B2();
  5095.  auto it = this->P1.find(H8);
  5096.  if (it == this->P1.end()) {
  5097.  return;
  5098.  }
  5099.  this->P1.erase(H8);
  5100. }
  5101.  
  5102. void GC::E10(I12 *type) {
  5103.  B2();
  5104.  auto it = this->A4.find(type);
  5105.  if (it == this->A4.end()) {
  5106.  return;
  5107.  }
  5108.  this->A4.erase(type);
  5109. }
  5110.  
  5111. void GC::hold(J10 *V10) {
  5112.  B2();
  5113.  ++this->held_V10s[V10];
  5114. }
  5115.  
  5116. void GC::release(J10 *V10) {
  5117.  B2();
  5118.  if (--this->held_V10s[V10] <= 0) {
  5119.  this->held_V10s.erase(V10);
  5120.  }
  5121. }
  5122.  
  5123. void GC::ping(K9 *rt) {
  5124.  B2();
  5125.  this->gc_strategy->F2(rt);
  5126. }
  5127.  
  5128. static void mark(G8 *ins, K9 *rt);
  5129. static void mark(I12 *type, K9 *rt);
  5130.  
  5131. static void mark(J10 *obj, K9 *rt) {
  5132.  B2();
  5133.  if (obj == nullptr) {
  5134.  return;
  5135.  }
  5136.  if (obj->gc_mark == rt->getGC()->gc_mark) {
  5137.  return;
  5138.  }
  5139.  
  5140.  obj->gc_mark = rt->getGC()->gc_mark;
  5141.  for (auto &o : obj->getGCReachable()) {
  5142.  mark(o, rt);
  5143.  }
  5144.  mark(obj->H8, rt);
  5145.  mark(obj->type, rt);
  5146. }
  5147.  
  5148. static void mark(G8 *ins, K9 *rt) {
  5149.  B2();
  5150.  if (ins == nullptr) {
  5151.  return;
  5152.  }
  5153.  if (ins->gc_mark == rt->getGC()->gc_mark) {
  5154.  return;
  5155.  }
  5156.  
  5157.  ins->gc_mark = rt->getGC()->gc_mark;
  5158.  for (auto &o : ins->getGCReachable()) {
  5159.  mark(o, rt);
  5160.  }
  5161. }
  5162.  
  5163. static void mark(I12 *type, K9 *rt) {
  5164.  B2();
  5165.  if (type == nullptr) {
  5166.  return;
  5167.  }
  5168.  if (type->gc_mark == rt->getGC()->gc_mark) {
  5169.  return;
  5170.  }
  5171.  
  5172.  type->gc_mark = rt->getGC()->gc_mark;
  5173.  for (auto &o : type->getGCReachable()) {
  5174.  mark(o, rt);
  5175.  }
  5176. }
  5177.  
  5178. void GC::runCycle(K9 *rt) {
  5179.  B2();
  5180.  if (!this->enabled) {
  5181.  return;
  5182.  }
  5183.  auto X11 = rt->E9();
  5184.  while (X11 != nullptr) {
  5185.  for (auto &[_, obj] : X11->variables) {
  5186.  mark(obj, rt);
  5187.  }
  5188.  for (auto &obj : X11->M7) {
  5189.  mark(obj, rt);
  5190.  }
  5191.  X11 = X11->prev;
  5192.  }
  5193.  for (auto &[obj, _] : this->held_V10s) {
  5194.  mark(obj, rt);
  5195.  }
  5196.  for (auto &[_, obj] : rt->globals) {
  5197.  mark(obj, rt);
  5198.  }
  5199.  std::vector<J10 *> deleted_V10s;
  5200.  for (auto &[obj, _] : this->M2) {
  5201.  if (obj->gc_mark != this->gc_mark) {
  5202.  deleted_V10s.push_back(obj);
  5203.  }
  5204.  }
  5205.  for (auto &obj : deleted_V10s) {
  5206.  this->M2.erase(obj);
  5207.  delete (obj);
  5208.  }
  5209.  std::vector<G8 *> deleted_H8s;
  5210.  for (auto &[ins, _] : this->P1) {
  5211.  if (ins->gc_mark != this->gc_mark) {
  5212.  deleted_H8s.push_back(ins);
  5213.  }
  5214.  }
  5215.  for (auto &ins : deleted_H8s) {
  5216.  this->P1.erase(ins);
  5217.  delete (ins);
  5218.  }
  5219.  std::vector<I12 *> deleted_types;
  5220.  for (auto &[type, _] : this->A4) {
  5221.  if (type->gc_mark != this->gc_mark) {
  5222.  deleted_types.push_back(type);
  5223.  }
  5224.  }
  5225.  for (auto &type : deleted_types) {
  5226.  this->A4.erase(type);
  5227.  delete type;
  5228.  }
  5229.  
  5230.  this->gc_mark = !this->gc_mark;
  5231.  this->gc_strategy->P0(rt);
  5232.  }
  5233.  
  5234. void GC::enable() {
  5235.  B2();
  5236.  this->enabled = true;
  5237. }
  5238.  
  5239. void GC::disable() {
  5240.  B2();
  5241.  this->enabled = false;
  5242. }
  5243. }
  5244.  
  5245. namespace H10 {
  5246. K9::K9(P6 *gc_strategy, C4 *Z3, D4 *S12)
  5247.  : S12(S12) {
  5248.  B2();
  5249.  
  5250.  this->X11 = new Scope(nullptr, nullptr, false);
  5251.  this->X11->W10 = this->X11;
  5252.  this->gc = new GC(gc_strategy);
  5253.  this->gc->rt = this;
  5254.  this->Z3 = Z3;
  5255.  this->S5();
  5256.  
  5257.  this->E3.function = new Z9::M4(this);
  5258.  this->E3.nothing = new Z9::K5(this);
  5259.  this->E3.boolean = new Z9::I5(this);
  5260.  this->E3.integer = new Z9::J5(this);
  5261.  this->E3.real = new Z9::D9(this);
  5262.  this->E3.character = new Z9::V3(this);
  5263.  this->E3.string = new Z9::J6(this);
  5264.  this->E3.array = new Z9::Q7(this);
  5265.  
  5266.  auto nothing_obj = this->make(this->E3.nothing, K9::TYPE_OBJECT);
  5267.  nothing_obj->can_modify = false;
  5268.  this->X11->L5(this->S12->Z11("Nothing"), nothing_obj, this);
  5269.  this->registerI12J10(this->E3.nothing, nothing_obj);
  5270.  
  5271.  auto function_obj = this->make(this->E3.function, K9::TYPE_OBJECT);
  5272.  function_obj->can_modify = false;
  5273.  this->X11->L5(this->S12->Z11("Function"), function_obj, this);
  5274.  this->registerI12J10(this->E3.function, function_obj);
  5275.  
  5276.  auto boolean_obj = this->make(this->E3.boolean, K9::TYPE_OBJECT);
  5277.  boolean_obj->can_modify = false;
  5278.  this->X11->L5(this->S12->Z11("Boolean"), boolean_obj, this);
  5279.  this->registerI12J10(this->E3.boolean, boolean_obj);
  5280.  
  5281.  auto integer_obj = this->make(this->E3.integer, K9::TYPE_OBJECT);
  5282.  integer_obj->can_modify = false;
  5283.  this->X11->L5(this->S12->Z11("Integer"), integer_obj, this);
  5284.  this->registerI12J10(this->E3.integer, integer_obj);
  5285.  
  5286.  auto real_obj = this->make(this->E3.real, K9::TYPE_OBJECT);
  5287.  real_obj->can_modify = false;
  5288.  this->X11->L5(this->S12->Z11("Real"), real_obj, this);
  5289.  this->registerI12J10(this->E3.real, real_obj);
  5290.  
  5291.  auto character_obj = this->make(this->E3.character, K9::TYPE_OBJECT);
  5292.  character_obj->can_modify = false;
  5293.  this->X11->L5(this->S12->Z11("P7"), character_obj, this);
  5294.  this->registerI12J10(this->E3.character, character_obj);
  5295.  
  5296.  auto string_obj = this->make(this->E3.string, K9::TYPE_OBJECT);
  5297.  string_obj->can_modify = false;
  5298.  this->X11->L5(this->S12->Z11("String"), string_obj, this);
  5299.  this->registerI12J10(this->E3.string, string_obj);
  5300.  
  5301.  auto array_obj = this->make(this->E3.array, K9::TYPE_OBJECT);
  5302.  array_obj->can_modify = false;
  5303.  this->X11->L5(this->S12->Z11("Array"), array_obj, this);
  5304.  this->registerI12J10(this->E3.array, array_obj);
  5305.  
  5306.  Z9::installBooleanMethods(this->E3.boolean, this);
  5307.  Z9::installP7Methods(this->E3.character, this);
  5308.  Z9::installFunctionMethods(this->E3.function, this);
  5309.  Z9::installIntegerMethods(this->E3.integer, this);
  5310.  Z9::installRealMethods(this->E3.real, this);
  5311.  Z9::installNothingMethods(this->E3.nothing, this);
  5312.  Z9::installStringMethods(this->E3.string, this);
  5313.  Z9::installArrayMethods(this->E3.array, this);
  5314.  
  5315.  Z9::installZ9Functions(this);
  5316.  
  5317.  this->protected_nothing = this->make(this->E3.nothing, K9::INSTANCE_OBJECT);
  5318.  this->protected_nothing->can_modify = false;
  5319.  this->gc->hold(this->protected_nothing);
  5320.  this->protected_nothing->Y2();
  5321.  
  5322.  this->protected_true = this->make(this->E3.boolean, K9::INSTANCE_OBJECT);
  5323.  Z9::getBooleanValue(this->protected_true, this) = true;
  5324.  this->protected_true->can_modify = false;
  5325.  this->gc->hold(this->protected_true);
  5326.  this->protected_true->Y2();
  5327.  
  5328.  this->protected_false = this->make(this->E3.boolean, K9::INSTANCE_OBJECT);
  5329.  Z9::getBooleanValue(this->protected_false, this) = false;
  5330.  this->protected_false->can_modify = false;
  5331.  this->gc->hold(this->protected_false);
  5332.  this->protected_true->Y2();
  5333. }
  5334.  
  5335. bool K9::checkGlobal(I10 id) {
  5336.  auto it = this->globals.find(id);
  5337.  return it != this->globals.end();
  5338. }
  5339.  
  5340. J10 *K9::getGlobal(I10 id) {
  5341.  B2();
  5342.  auto it = this->globals.find(id);
  5343.  if (it == this->globals.end()) {
  5344.  this->T4("Global not found: " + this->S12->R7(id), this->R5().area);
  5345.  }
  5346.  return it->second;
  5347. }
  5348.  
  5349. void K9::setGlobal(I10 id, J10 *obj) {
  5350.  B2();
  5351.  this->globals[id] = obj;
  5352. }
  5353.  
  5354. void K9::removeGlobal(I10 id) {
  5355.  B2();
  5356.  this->globals.erase(id);
  5357. }
  5358.  
  5359. void K9::registerI12J10(I12 *type, J10 *obj) {
  5360.  B2();
  5361.  this->registered_type_V10s[type] = obj;
  5362. }
  5363.  
  5364. J10 *K9::getI12J10(I12 *type) {
  5365.  B2();
  5366.  auto it = this->registered_type_V10s.find(type);
  5367.  if (it != this->registered_type_V10s.end()) {
  5368.  return it->second;
  5369.  }
  5370.  return this->protected_nothing;
  5371. }
  5372.  
  5373. J10 *K9::S1() {
  5374.  return this->protected_nothing;
  5375. }
  5376.  
  5377. J10 *K9::R1(bool val) {
  5378.  B2();
  5379.  return val ? this->protected_true : this->protected_false;
  5380. }
  5381.  
  5382. void K9::T3(bool can_access_prev_X11) {
  5383.  B2();
  5384.  auto X11 = new Scope(this->X11, this->X11->W10, can_access_prev_X11);
  5385.  this->X11 = X11;
  5386. }
  5387.  
  5388. void K9::S3() {
  5389.  B2();
  5390.  auto X11 = this->X11->prev;
  5391.  delete this->X11;
  5392.  this->X11 = X11;
  5393. }
  5394.  
  5395. J10 *K9::make(I12 *type, J10Options V10_opt) {
  5396.  B2();
  5397.  if (type == nullptr) {
  5398.  this->T4("Failed to make an V10 of nullptr type", this->R5().area);
  5399.  }
  5400.  J10 *obj = nullptr;
  5401.  if (V10_opt == K9::INSTANCE_OBJECT) {
  5402.  obj = type->create(this);
  5403.  }
  5404.  else {
  5405.  obj = new J10(false, nullptr, type, this);
  5406.  }
  5407.  
  5408.  if (obj == nullptr) {
  5409.  this->T4("Failed to make an V10 of type " + type->userRepr(this), this->R5().area);
  5410.  }
  5411.  obj->spreadSingleUse();
  5412.  return obj;
  5413. }
  5414.  
  5415. J10 *K9::copy(J10 *obj) {
  5416.  B2();
  5417.  if (!this->D3(obj)) {
  5418.  this->T4("Failed to copy non type V10 " + obj->userRepr(this), this->R5().area);
  5419.  }
  5420.  if (obj->single_use) {
  5421.  return obj;
  5422.  }
  5423.  auto res = obj->type->copy(obj, this);
  5424.  return res;
  5425. }
  5426.  
  5427. J10 *K9::H5(I4::D6 id, J10 *obj, bool I0) {
  5428.  B2();
  5429.  
  5430.  this->U0(obj, K9::SUB0_CTX);
  5431.  
  5432.  T0 op;
  5433.  
  5434.  switch (id) {
  5435.  case I4::U2 :
  5436.  op = obj->type->W6;
  5437.  if (op == nullptr) {
  5438.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5439.  }
  5440.  return op(obj, this, I0);
  5441.  case I4::U1 :
  5442.  op = obj->type->X6;
  5443.  if (op == nullptr) {
  5444.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5445.  }
  5446.  return op(obj, this, I0);
  5447.  case I4::M3 :
  5448.  op = obj->type->Y7;
  5449.  if (op == nullptr) {
  5450.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5451.  }
  5452.  return op(obj, this, I0);
  5453.  case I4::D2 :
  5454.  op = obj->type->Z7;
  5455.  if (op == nullptr) {
  5456.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5457.  }
  5458.  return op(obj, this, I0);
  5459.  case I4::T8 :
  5460.  op = obj->type->O5;
  5461.  if (op == nullptr) {
  5462.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5463.  }
  5464.  return op(obj, this, I0);
  5465.  case I4::H7 :
  5466.  op = obj->type->P5;
  5467.  if (op == nullptr) {
  5468.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5469.  }
  5470.  return op(obj, this, I0);
  5471.  case I4::NOT :
  5472.  op = obj->type->B11;
  5473.  if (op == nullptr) {
  5474.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5475.  }
  5476.  return op(obj, this, I0);
  5477.  case I4::T9 :
  5478.  op = obj->type->Y6;
  5479.  if (op == nullptr) {
  5480.  this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5481.  }
  5482.  return op(obj, this, I0);
  5483.  default : this->T4(obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5484.  }
  5485. }
  5486.  
  5487. J10 *K9::H5(I4::D6 id, J10 *obj, J10 *arg, bool I0) {
  5488.  B2();
  5489.  this->U0(obj, K9::SUB0_CTX);
  5490.  this->U0(arg, K9::SUB1_CTX);
  5491.  
  5492.  R0 op;
  5493.  
  5494.  switch (id) {
  5495.  case I4::K12 :
  5496.  op = obj->type->F10;
  5497.  if (op == nullptr) {
  5498.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5499.  }
  5500.  return op(obj, arg, this, I0);
  5501.  case I4::DIV :
  5502.  op = obj->type->C11;
  5503.  if (op == nullptr) {
  5504.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5505.  }
  5506.  
  5507.  return op(obj, arg, this, I0);
  5508.  case I4::REM :
  5509.  op = obj->type->D11;
  5510.  if (op == nullptr) {
  5511.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5512.  }
  5513.  
  5514.  return op(obj, arg, this, I0);
  5515.  case I4::D5 :
  5516.  op = obj->type->A8;
  5517.  if (op == nullptr) {
  5518.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5519.  }
  5520.  
  5521.  return op(obj, arg, this, I0);
  5522.  case I4::Z5 :
  5523.  op = obj->type->B8;
  5524.  if (op == nullptr) {
  5525.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5526.  }
  5527.  
  5528.  return op(obj, arg, this, I0);
  5529.  case I4::L12 :
  5530.  op = obj->type->E11;
  5531.  if (op == nullptr) {
  5532.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5533.  }
  5534.  
  5535.  return op(obj, arg, this, I0);
  5536.  case I4::U11 :
  5537.  op = obj->type->F11;
  5538.  if (op == nullptr) {
  5539.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5540.  }
  5541.  
  5542.  return op(obj, arg, this, I0);
  5543.  case I4::M12 :
  5544.  op = obj->type->E12;
  5545.  if (op == nullptr) {
  5546.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5547.  }
  5548.  
  5549.  return op(obj, arg, this, I0);
  5550.  case I4::A6 :
  5551.  op = obj->type->G11;
  5552.  if (op == nullptr) {
  5553.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5554.  }
  5555.  
  5556.  return op(obj, arg, this, I0);
  5557.  case I4::U9 :
  5558.  op = obj->type->F12;
  5559.  if (op == nullptr) {
  5560.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5561.  }
  5562.  
  5563.  return op(obj, arg, this, I0);
  5564.  case I4::N3 :
  5565.  op = obj->type->H11;
  5566.  if (op == nullptr) {
  5567.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5568.  }
  5569.  
  5570.  return op(obj, arg, this, I0);
  5571.  case I4::V11 :
  5572.  op = obj->type->G12;
  5573.  if (op == nullptr) {
  5574.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5575.  }
  5576.  
  5577.  return op(obj, arg, this, I0);
  5578.  case I4::I7 :
  5579.  op = obj->type->I11;
  5580.  if (op == nullptr) {
  5581.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5582.  }
  5583.  
  5584.  return op(obj, arg, this, I0);
  5585.  case I4::S10 :
  5586.  op = obj->type->C8;
  5587.  if (op == nullptr) {
  5588.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5589.  }
  5590.  
  5591.  return op(obj, arg, this, I0);
  5592.  case I4::T10 :
  5593.  op = obj->type->D8;
  5594.  if (op == nullptr) {
  5595.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5596.  }
  5597.  
  5598.  return op(obj, arg, this, I0);
  5599.  case I4::W11 :
  5600.  op = obj->type->I9;
  5601.  if (op == nullptr) {
  5602.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5603.  }
  5604.  
  5605.  return op(obj, arg, this, I0);
  5606.  case I4::AND :
  5607.  op = obj->type->J11;
  5608.  if (op == nullptr) {
  5609.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5610.  }
  5611.  
  5612.  return op(obj, arg, this, I0);
  5613.  case I4::OR :
  5614.  op = obj->type->H12;
  5615.  if (op == nullptr) {
  5616.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5617.  }
  5618.  
  5619.  return op(obj, arg, this, I0);
  5620.  default : this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5621.  }
  5622. }
  5623.  
  5624. J10 *K9::H5(I4::D6 id, J10 *obj, const std::vector<J10 *> &args, bool I0) {
  5625.  B2();
  5626.  this->U0(obj, K9::SUB1_CTX);
  5627.  
  5628.  if (id == I4::J12) {
  5629.  auto op = obj->type->G10;
  5630.  if (op == nullptr) {
  5631.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5632.  }
  5633.  
  5634.  return op(obj, args, this, I0);
  5635.  }
  5636.  else if (id == I4::T11) {
  5637.  auto op = obj->type->J9;
  5638.  if (op == nullptr) {
  5639.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5640.  }
  5641.  
  5642.  return op(obj, args, this, I0);
  5643.  }
  5644.  else {
  5645.  this->T4("Left argument " + obj->userRepr(this) + " doesn't support that operator", this->R5().area);
  5646.  }
  5647. }
  5648.  
  5649. J10 *K9::O7(I10 id, J10 *obj, const std::vector<J10 *> &args, bool I0) {
  5650.  B2();
  5651.  auto R10 = obj->type->E8(id, this);
  5652.  return this->H5(I4::J12, R10, args, I0);
  5653. }
  5654.  
  5655. void K9::S5() {
  5656.  B2();
  5657.  this->error_contexts.push_back({});
  5658. }
  5659.  
  5660. void K9::T5() {
  5661.  B2();
  5662.  this->error_contexts.pop_back();
  5663. }
  5664.  
  5665. K9::ErrorContext &K9::R5() {
  5666.  B2();
  5667.  return this->error_contexts.back();
  5668. }
  5669.  
  5670. void K9::T4(const std::string &message, const S8 &ta) {
  5671.  B2();
  5672.  S8 prev;
  5673.  for (auto c : this->error_contexts) {
  5674.  if (c.area.first_char < c.area.last_char) {
  5675.  if (c.area.first_char == prev.first_char && c.area.last_char == prev.last_char) {
  5676.  continue;
  5677.  }
  5678.  if (c.area.first_char == ta.first_char && c.area.last_char == ta.last_char) {
  5679.  continue;
  5680.  }
  5681.  this->Z3->T4("Error occurred here", c.area, false);
  5682.  prev = c.area;
  5683.  }
  5684.  }
  5685.  this->Z3->T4(message, ta);
  5686. }
  5687.  
  5688. J10 *K9::execute(P8 *node, bool I0) {
  5689.  B2();
  5690.  if (node == nullptr) {
  5691.  this->T4("Failed to execute nullptr AST node", this->R5().area);
  5692.  }
  5693.  
  5694.  switch (node->id) {
  5695.  case P8::FUNCTION_DEFINITION : {
  5696.  return this->execute(node->func_def, I0);
  5697.  }
  5698.  case P8::W8INITION : {
  5699.  return this->execute(node->type_def, I0);
  5700.  }
  5701.  case P8::X8 : {
  5702.  return this->execute(node->op, I0);
  5703.  }
  5704.  case P8::ATOM : {
  5705.  return this->execute(node->R12, I0);
  5706.  }
  5707.  case P8::PARENTHESES_N12ESSION : {
  5708.  return this->execute(node->par_T12, I0);
  5709.  }
  5710.  default : this->T4("Failed to execute unknown AST node", this->R5().area);
  5711.  }
  5712. }
  5713.  
  5714. J10 *K9::execute(Z4 *node, bool I0) {
  5715.  B2();
  5716.  if (node == nullptr) {
  5717.  this->T4("Failed to execute unknown AST node", this->R5().area);
  5718.  }
  5719.  this->S5();
  5720.  this->R5().area = node->text_area;
  5721.  auto func = Z9::C0(false, nullptr, node, this);
  5722.  if (node->name != nullptr) {
  5723.  this->X11->W10->L5(node->name->Y10, func, this);
  5724.  }
  5725.  this->T5();
  5726.  this->W2();
  5727.  return func;
  5728. }
  5729.  
  5730. J10 *K9::execute(A5 *node, bool I0) {
  5731.  B2();
  5732.  if (node == nullptr) {
  5733.  this->T4("Failed to execute unknown AST node", this->R5().area);
  5734.  }
  5735.  this->S5();
  5736.  this->R5().area = node->text_area;
  5737.  auto type = new Z9::RecordI12(this);
  5738.  type->Y10 = node->name->Y10;
  5739.  for (auto f : node->Q10) {
  5740.  type->H8_Q10.push_back(this->S12->Z11(f->Q12));
  5741.  }
  5742.  
  5743.  for (auto R10 : node->S9) {
  5744.  this->S5();
  5745.  this->R5().area = R10->text_area;
  5746.  auto f = Z9::C0(false, nullptr, R10, this);
  5747.  type->S7(R10->name->Y10, f);
  5748.  this->T5();
  5749.  }
  5750.  
  5751.  auto res = this->make(type, K9::TYPE_OBJECT);
  5752.  this->X11->W10->L5(type->Y10, res, this);
  5753.  this->T5();
  5754.  
  5755.  this->W2();
  5756.  return res;
  5757. }
  5758.  
  5759. static std::vector<J10 *> getList(P8 *T12, K9 *rt) {
  5760.  B2();
  5761.  std::vector<J10 *> res;
  5762.  while (T12 != nullptr) {
  5763.  if (T12->id == P8::X8 && T12->op->id == I4::O11) {
  5764.  auto r = rt->execute(T12->op->first, true);
  5765.  if (rt->Q0()) {
  5766.  res.push_back(r);
  5767.  }
  5768.  else {
  5769.  rt->S5();
  5770.  rt->R5().area = T12->op->first->text_area;
  5771.  res.push_back(rt->copy(r));
  5772.  rt->T5();
  5773.  }
  5774.  rt->getGC()->hold(res.back());
  5775.  T12 = T12->op->second;
  5776.  }
  5777.  else {
  5778.  auto r = rt->execute(T12, true);
  5779.  if (rt->Q0()) {
  5780.  res.push_back(r);
  5781.  }
  5782.  else {
  5783.  rt->S5();
  5784.  rt->R5().area = T12->text_area;
  5785.  res.push_back(rt->copy(r));
  5786.  rt->T5();
  5787.  }
  5788.  rt->getGC()->hold(res.back());
  5789.  break;
  5790.  }
  5791.  }
  5792.  return res;
  5793. }
  5794.  
  5795. static void getList_addToContext(P8 *T12, K9 *rt) {
  5796.  B2();
  5797.  while (T12 != nullptr) {
  5798.  if (T12->id == P8::X8 && T12->op->id == I4::O11) {
  5799.  rt->R5().sub_areas.push_back(T12->op->first->text_area);
  5800.  T12 = T12->op->second;
  5801.  }
  5802.  else {
  5803.  rt->R5().sub_areas.push_back(T12->text_area);
  5804.  break;
  5805.  }
  5806.  }
  5807. }
  5808.  
  5809. J10 *K9::execute(I4 *node, bool I0) {
  5810.  B2();
  5811.  if (node == nullptr) {
  5812.  this->T4("Failed to execute unknown AST node", this->R5().area);
  5813.  }
  5814.  
  5815.  this->S5();
  5816.  this->R5().area = node->text_area;
  5817.  
  5818.  if (node->id == I4::U10) {
  5819.  if (node->first->id == P8::ATOM && node->first->R12->id == Q8::X5) {
  5820.  if (!this->X11->queryVariable(node->first->R12->Y11->Y10, this)) {
  5821.  this->X11->L5(node->first->R12->Y11->Y10, Z9::H0(this), this);
  5822.  }
  5823.  }
  5824.  }
  5825.  else if (node->id == I4::O11) {
  5826.  auto res = this->execute(node->first, I0);
  5827.  this->gc->hold(res);
  5828.  auto T12 = node->second;
  5829.  while (T12 != nullptr) {
  5830.  if (T12->id == P8::X8 && T12->op->id == I4::O11) {
  5831.  auto r = this->execute(T12->op->first, false);
  5832.  T12 = T12->op->second;
  5833.  }
  5834.  else {
  5835.  auto r = this->execute(T12, false);
  5836.  break;
  5837.  }
  5838.  }
  5839.  this->T5();
  5840.  this->gc->release(res);
  5841.  return res;
  5842.  }
  5843.  else if (node->id == I4::J12 || node->id == I4::T11) {
  5844.  if (node->id == I4::J12 && node->first->id == P8::X8 && node->first->op->id == I4::DOT) {
  5845.  auto X10 = this->execute(node->first->op->first, true);
  5846.  this->gc->hold(X10);
  5847.  J10 *selected = nullptr;
  5848.  
  5849.  auto dot = node->first->op;
  5850.  if (dot->second == nullptr || dot->second->id != P8::ATOM || dot->second->R12->id != Q8::X5) {
  5851.  this->T4("Selector is illegal", dot->second->text_area);
  5852.  }
  5853.  I10 B9 = dot->second->R12->Y11->Y10;
  5854.  if (!this->Q1(X10, nullptr)) {
  5855.  this->T4(X10->userRepr(this) + " must be an H8 V10", dot->first->text_area);
  5856.  }
  5857.  if (X10->H8->hasField(B9, this)) {
  5858.  selected = X10->H8->selectField(B9, this);
  5859.  }
  5860.  else if (X10->type->A7(B9)) {
  5861.  selected = X10->type->E8(B9, this);
  5862.  }
  5863.  else {
  5864.  this->T4("Invalid B9", dot->second->text_area);
  5865.  }
  5866.  
  5867.  std::vector<J10 *> args;
  5868.  auto list = getList(node->second, this);
  5869.  args.reserve(1 + list.size());
  5870.  args.push_back(X10);
  5871.  
  5872.  for (auto r : list) {
  5873.  args.push_back(r);
  5874.  }
  5875.  
  5876.  this->S5();
  5877.  this->R5().area = node->text_area;
  5878.  this->R5().sub_areas.push_back(dot->text_area); getList_addToContext(node->second, this);
  5879.  auto res = this->H5(node->id, selected, args, I0);
  5880.  this->T5();
  5881.  
  5882.  this->W2();
  5883.  this->T5();
  5884.  
  5885.  for (auto &item : list) {
  5886.  this->gc->release(item);
  5887.  }
  5888.  this->gc->release(X10);
  5889.  return res;
  5890.  }
  5891.  else {
  5892.  J10 *self = this->execute(node->first, true);
  5893.  this->gc->hold(self);
  5894.  std::vector<J10 *> args;
  5895.  auto list = getList(node->second, this);
  5896.  args.reserve(list.size());
  5897.  
  5898.  for (auto r : list) {
  5899.  args.push_back(r);
  5900.  }
  5901.  
  5902.  this->S5();
  5903.  this->R5().area = node->text_area;
  5904.  this->R5().sub_areas.push_back(node->first->text_area); getList_addToContext(node->second, this);
  5905.  auto res = this->H5(node->id, self, args, I0);
  5906.  this->T5();
  5907.  
  5908.  this->W2();
  5909.  this->T5();
  5910.  for (auto &item : list) {
  5911.  this->gc->release(item);
  5912.  }
  5913.  this->gc->release(self);
  5914.  return res;
  5915.  }
  5916.  }
  5917.  
  5918.  J10 *self = this->execute(node->first, true);
  5919.  this->gc->hold(self);
  5920.  J10 *other = nullptr;
  5921.  
  5922.  switch (node->id) {
  5923.  case I4::DOT : {
  5924.  if (node->second == nullptr || node->second->id != P8::ATOM || node->second->R12->id != Q8::X5) {
  5925.  this->T4("Selector is illegal", node->second->text_area);
  5926.  }
  5927.  I10 B9 = node->second->R12->Y11->Y10;
  5928.  if (!Q1(self)) {
  5929.  this->T4(self->userRepr(this) + " must be an H8 V10", node->first->text_area);
  5930.  }
  5931.  if (self->H8->hasField(B9, this)) {
  5932.  auto res = self->H8->selectField(B9, this);
  5933.  
  5934.  this->W2();
  5935.  this->T5();
  5936.  this->gc->release(self);
  5937.  return res;
  5938.  }
  5939.  else if (self->type->A7(B9)) {
  5940.  auto res = self->type->E8(B9, this);
  5941.  
  5942.  this->W2();
  5943.  this->T5();
  5944.  this->gc->release(self);
  5945.  return res;
  5946.  }
  5947.  else {
  5948.  this->T4("Invalid B9", node->second->text_area);
  5949.  }
  5950.  }
  5951.  case I4::AT : {
  5952.  this->W2();
  5953.  this->N0();
  5954.  this->T5();
  5955.  this->gc->release(self);
  5956.  return self;
  5957.  }
  5958.  case I4::U10 : {
  5959.  other = this->execute(node->second, true);
  5960.  if (this->Q0()) {
  5961.  self->assignTo(other, this);
  5962.  }
  5963.  else {
  5964.  self->assignToCopyOf(other, this);
  5965.  }
  5966.  
  5967.  this->W2();
  5968.  this->T5();
  5969.  this->gc->release(self);
  5970.  return self;
  5971.  }
  5972.  case I4::E5 : {
  5973.  other = this->execute(node->second, true);
  5974.  this->R5().sub_areas.push_back(node->first->text_area);
  5975.  this->R5().sub_areas.push_back(node->second->text_area);
  5976.  self->assignToCopyOf(this->H5(I4::L12, self, other, true), this);
  5977.  
  5978.  this->W2();
  5979.  this->T5();
  5980.  this->gc->release(self);
  5981.  return self;
  5982.  }
  5983.  case I4::J4 : {
  5984.  other = this->execute(node->second, true);
  5985.  this->R5().sub_areas.push_back(node->first->text_area);
  5986.  this->R5().sub_areas.push_back(node->second->text_area);
  5987.  self->assignToCopyOf(this->H5(I4::U11, self, other, true), this);
  5988.  
  5989.  this->W2();
  5990.  this->T5();
  5991.  this->gc->release(self);
  5992.  return self;
  5993.  }
  5994.  case I4::F5 : {
  5995.  other = this->execute(node->second, true);
  5996.  this->R5().sub_areas.push_back(node->first->text_area);
  5997.  this->R5().sub_areas.push_back(node->second->text_area);
  5998.  self->assignToCopyOf(this->H5(I4::K12, self, other, true), this);
  5999.  
  6000.  this->W2();
  6001.  this->T5();
  6002.  this->gc->release(self);
  6003.  return self;
  6004.  }
  6005.  case I4::B6 : {
  6006.  other = this->execute(node->second, true);
  6007.  this->R5().sub_areas.push_back(node->first->text_area);
  6008.  this->R5().sub_areas.push_back(node->second->text_area);
  6009.  self->assignToCopyOf(this->H5(I4::DIV, self, other, true), this);
  6010.  
  6011.  this->W2();
  6012.  this->T5();
  6013.  this->gc->release(self);
  6014.  return self;
  6015.  }
  6016.  case I4::C6 : {
  6017.  other = this->execute(node->second, true);
  6018.  this->R5().sub_areas.push_back(node->first->text_area);
  6019.  this->R5().sub_areas.push_back(node->second->text_area);
  6020.  self->assignToCopyOf(this->H5(I4::REM, self, other, true), this);
  6021.  
  6022.  this->W2();
  6023.  this->T5();
  6024.  this->gc->release(self);
  6025.  return self;
  6026.  }
  6027.  }
  6028.  
  6029.  switch (node->id) {
  6030.  case I4::U2 :
  6031.  case I4::U1 :
  6032.  case I4::M3 :
  6033.  case I4::D2 :
  6034.  case I4::T8 :
  6035.  case I4::H7 :
  6036.  case I4::NOT :
  6037.  case I4::T9 :
  6038.  this->R5().sub_areas.push_back(node->first->text_area);
  6039.  auto res = this->H5(node->id, self, I0);
  6040.  this->W2();
  6041.  this->T5();
  6042.  this->gc->release(self);
  6043.  return res;
  6044.  }
  6045.  
  6046.  auto arg = this->execute(node->second, true);
  6047.  this->R5().sub_areas.push_back(node->first->text_area);
  6048.  this->R5().sub_areas.push_back(node->second->text_area);
  6049.  auto res = this->H5(node->id, self, arg, I0);
  6050.  this->W2();
  6051.  this->T5();
  6052.  this->gc->release(self);
  6053.  return res;
  6054. }
  6055.  
  6056. J10 *K9::execute(Q8 *node, bool I0) {
  6057.  B2();
  6058.  if (node == nullptr) {
  6059.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6060.  }
  6061.  this->S5();
  6062.  this->R5().area = node->text_area;
  6063.  Z6<I10, J10 *>::point_iterator it;
  6064.  
  6065.  switch (node->id) {
  6066.  case Q8::BOOLEAN : {
  6067.  if (!I0) {
  6068.  this->W2();
  6069.  this->T5();
  6070.  return nullptr;
  6071.  }
  6072.  if (node->lit_obj != nullptr) {
  6073.  this->W2();
  6074.  this->T5();
  6075.  return node->lit_obj;
  6076.  }
  6077.  it = this->readonly_literals.find(node->L11->Y10);
  6078.  if (it != this->readonly_literals.end()) {
  6079.  this->W2();
  6080.  this->T5();
  6081.  return it->second;
  6082.  }
  6083.  auto lit = Z9::F0(node->bool_N11, this);
  6084.  this->gc->hold(lit);
  6085.  lit->can_modify = false;
  6086.  this->readonly_literals[node->L11->Y10] = lit;
  6087.  lit->Y2();
  6088.  
  6089.  this->W2();
  6090.  this->T5();
  6091.  return node->lit_obj = lit;
  6092.  }
  6093.  case Q8::CHARACTER : {
  6094.  if (!I0) {
  6095.  this->W2();
  6096.  this->T5();
  6097.  return nullptr;
  6098.  }
  6099.  if (node->lit_obj != nullptr) {
  6100.  this->W2();
  6101.  this->T5();
  6102.  return node->lit_obj;
  6103.  }
  6104.  it = this->readonly_literals.find(node->L11->Y10);
  6105.  if (it != this->readonly_literals.end()) {
  6106.  this->W2();
  6107.  this->T5();
  6108.  return node->lit_obj = it->second;
  6109.  ;
  6110.  }
  6111.  auto lit = Z9::B0(node->char_N11, this);
  6112.  this->gc->hold(lit);
  6113.  lit->can_modify = false;
  6114.  this->readonly_literals[node->L11->Y10] = lit;
  6115.  lit->Y2();
  6116.  
  6117.  this->W2();
  6118.  this->T5();
  6119.  return node->lit_obj = lit;
  6120.  }
  6121.  case Q8::INTEGER : {
  6122.  if (!I0) {
  6123.  this->W2();
  6124.  this->T5();
  6125.  return nullptr;
  6126.  }
  6127.  if (node->lit_obj != nullptr) {
  6128.  this->W2();
  6129.  this->T5();
  6130.  return node->lit_obj;
  6131.  }
  6132.  it = this->readonly_literals.find(node->L11->Y10);
  6133.  if (it != this->readonly_literals.end()) {
  6134.  this->W2();
  6135.  this->T5();
  6136.  return node->lit_obj = it->second;
  6137.  ;
  6138.  }
  6139.  auto lit = Z9::G0(node->int_N11, this);
  6140.  this->gc->hold(lit);
  6141.  lit->can_modify = false;
  6142.  this->readonly_literals[node->L11->Y10] = lit;
  6143.  lit->Y2();
  6144.  
  6145.  this->W2();
  6146.  this->T5();
  6147.  return node->lit_obj = lit;
  6148.  }
  6149.  case Q8::REAL : {
  6150.  if (!I0) {
  6151.  this->W2();
  6152.  
  6153.  this->T5();
  6154.  return nullptr;
  6155.  }
  6156.  if (node->lit_obj != nullptr) {
  6157.  this->W2();
  6158.  this->T5();
  6159.  return node->lit_obj;
  6160.  }
  6161.  it = this->readonly_literals.find(node->L11->Y10);
  6162.  if (it != this->readonly_literals.end()) {
  6163.  this->W2();
  6164.  this->T5();
  6165.  return node->lit_obj = it->second;
  6166.  }
  6167.  auto lit = Z9::makeL4J10(node->real_N11, this);
  6168.  this->gc->hold(lit);
  6169.  lit->can_modify = false;
  6170.  this->readonly_literals[node->L11->Y10] = lit;
  6171.  lit->Y2();
  6172.  
  6173.  this->W2();
  6174.  this->T5();
  6175.  return node->lit_obj = lit;
  6176.  }
  6177.  case Q8::STRING : {
  6178.  if (!I0) {
  6179.  this->W2();
  6180.  this->T5();
  6181.  return nullptr;
  6182.  }
  6183.  if (node->lit_obj != nullptr) {
  6184.  this->W2();
  6185.  this->T5();
  6186.  return node->lit_obj;
  6187.  }
  6188.  it = this->readonly_literals.find(node->L11->Y10);
  6189.  if (it != this->readonly_literals.end()) {
  6190.  this->W2();
  6191.  this->T5();
  6192.  return node->lit_obj = it->second;
  6193.  ;
  6194.  }
  6195.  auto lit = Z9::J0(node->string_N11, this);
  6196.  this->gc->hold(lit);
  6197.  lit->can_modify = false;
  6198.  this->readonly_literals[node->L11->Y10] = lit;
  6199.  lit->Y2();
  6200.  
  6201.  this->W2();
  6202.  this->T5();
  6203.  return node->lit_obj = lit;
  6204.  }
  6205.  case Q8::NOTHING : {
  6206.  if (!I0) {
  6207.  this->W2();
  6208.  this->T5();
  6209.  return nullptr;
  6210.  }
  6211.  if (node->lit_obj != nullptr) {
  6212.  this->W2();
  6213.  this->T5();
  6214.  return node->lit_obj;
  6215.  }
  6216.  it = this->readonly_literals.find(node->L11->Y10);
  6217.  if (it != this->readonly_literals.end()) {
  6218.  this->W2();
  6219.  this->T5();
  6220.  return node->lit_obj = it->second;
  6221.  ;
  6222.  }
  6223.  auto lit = Z9::H0(this);
  6224.  this->gc->hold(lit);
  6225.  lit->can_modify = false;
  6226.  this->readonly_literals[node->L11->Y10] = lit;
  6227.  lit->Y2();
  6228.  
  6229.  this->W2();
  6230.  this->T5();
  6231.  return node->lit_obj = lit;
  6232.  }
  6233.  case Q8::X5 : {
  6234.  this->W2();
  6235.  auto res = this->X11->getVariable(node->L11->Y10, this);
  6236.  this->T5();
  6237.  return res;
  6238.  }
  6239.  default : this->T4("Unknown R12", this->R5().area);
  6240.  }
  6241. }
  6242.  
  6243. J10 *K9::execute(B5 *node, bool I0) {
  6244.  B2();
  6245.  if (node == nullptr) {
  6246.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6247.  }
  6248.  return this->execute(node->T12, I0);
  6249. }
  6250.  
  6251. J10 *K9::execute(R8 *node, bool I0) {
  6252.  B2();
  6253.  if (node == nullptr) {
  6254.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6255.  }
  6256.  this->gc->ping(this);
  6257.  switch (node->id) {
  6258.  case R8::WHILE : {
  6259.  return this->execute(node->L6, I0);
  6260.  }
  6261.  case R8::FOR : {
  6262.  return this->execute(node->F9, I0);
  6263.  }
  6264.  case R8::IF : {
  6265.  return this->execute(node->C10, I0);
  6266.  }
  6267.  case R8::H9 : {
  6268.  this->W2();
  6269.  this->A1();
  6270.  return this->protected_nothing;
  6271.  }
  6272.  case R8::D12 : {
  6273.  this->W2();
  6274.  this->W1();
  6275.  return this->protected_nothing;
  6276.  }
  6277.  case R8::A11 : {
  6278.  return this->execute(node->return_stmt, I0);
  6279.  }
  6280.  case R8::BLOCK : {
  6281.  return this->execute(node->M6, I0);
  6282.  }
  6283.  case R8::N12 : {
  6284.  return this->execute(node->T12, I0);
  6285.  }
  6286.  default : {
  6287.  this->T4("Unknown node", node->text_area);
  6288.  }
  6289.  }
  6290. }
  6291.  
  6292. J10 *K9::execute(K3 *node, bool I0) {
  6293.  B2();
  6294.  if (node == nullptr) {
  6295.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6296.  }
  6297.  this->S5();
  6298.  while (true) {
  6299.  this->R5().area = node->text_area;
  6300.  this->T3();
  6301.  
  6302.  if (node->cond != nullptr) {
  6303.  this->R5().area = node->cond->text_area;
  6304.  auto cond = this->execute(node->cond, true);
  6305.  
  6306.  if (!Z9::getBooleanValue(cond, this)) {
  6307.  this->S3();
  6308.  break;
  6309.  }
  6310.  }
  6311.  
  6312.  if (node->body != nullptr) {
  6313.  this->R5().area = node->body->text_area;
  6314.  auto body = this->execute(node->body, I0);
  6315.  if (this->H2()) {
  6316.  this->S3();
  6317.  break;
  6318.  }
  6319.  else if (this->H1()) {
  6320.  this->S3();
  6321.  continue;
  6322.  }
  6323.  else if (this->X1()) {
  6324.  if (this->Q0()) {
  6325.  this->W2();
  6326.  this->K1();
  6327.  this->S3();
  6328.  this->T5();
  6329.  return body;
  6330.  }
  6331.  this->W2();
  6332.  this->K1();
  6333.  this->S3();
  6334.  this->T5();
  6335.  return (I0) ? this->copy(body) : nullptr;
  6336.  };
  6337.  }
  6338.  this->S3();
  6339.  }
  6340.  this->W2();
  6341.  this->T5();
  6342.  return this->protected_nothing;
  6343. }
  6344.  
  6345. J10 *K9::execute(C5 *node, bool I0) {
  6346.  B2();
  6347.  if (node == nullptr) {
  6348.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6349.  }
  6350.  
  6351.  this->T3();
  6352.  if (node->init != nullptr) {
  6353.  this->execute(node->init, false);
  6354.  }
  6355.  this->S5();
  6356.  bool first_cycle = true;
  6357.  while (true) {
  6358.  if (!first_cycle) {
  6359.  if (node->step != nullptr) {
  6360.  this->R5().area = node->step->text_area;
  6361.  this->execute(node->step, false);
  6362.  }
  6363.  }
  6364.  if (first_cycle) {
  6365.  first_cycle = false;
  6366.  }
  6367.  this->R5().area = node->text_area;
  6368.  this->T3();
  6369.  
  6370.  if (node->cond != nullptr) {
  6371.  this->R5().area = node->cond->text_area;
  6372.  auto cond = this->execute(node->cond, true);
  6373.  
  6374.  if (!Z9::getBooleanValue(cond, this)) {
  6375.  this->S3();
  6376.  break;
  6377.  }
  6378.  }
  6379.  
  6380.  if (node->body != nullptr) {
  6381.  this->R5().area = node->body->text_area;
  6382.  auto body = this->execute(node->body, I0);
  6383.  if (this->H2()) {
  6384.  this->S3();
  6385.  break;
  6386.  }
  6387.  else if (this->H1()) {
  6388.  this->S3();
  6389.  continue;
  6390.  }
  6391.  else if (this->X1()) {
  6392.  if (this->Q0()) {
  6393.  this->W2();
  6394.  this->K1();
  6395.  this->S3();
  6396.  this->S3();
  6397.  this->T5();
  6398.  return body;
  6399.  }
  6400.  this->W2();
  6401.  this->K1();
  6402.  this->S3();
  6403.  this->S3();
  6404.  this->T5();
  6405.  return (I0) ? this->copy(body) : nullptr;
  6406.  };
  6407.  }
  6408.  this->S3();
  6409.  }
  6410.  this->W2();
  6411.  this->T5();
  6412.  this->S3();
  6413.  return this->protected_nothing;
  6414. }
  6415.  
  6416. J10 *K9::execute(Y5 *node, bool I0) {
  6417.  B2();
  6418.  if (node == nullptr) {
  6419.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6420.  }
  6421.  
  6422.  this->S5();
  6423.  
  6424.  this->R5().area = node->cond->text_area;
  6425.  auto cond = this->execute(node->cond, true);
  6426.  
  6427.  if (Z9::getBooleanValue(cond, this)) {
  6428.  this->T5();
  6429.  return this->execute(node->body, I0);
  6430.  }
  6431.  else if (node->else_body != nullptr) {
  6432.  this->T5();
  6433.  return this->execute(node->else_body, I0);
  6434.  }
  6435.  this->W2();
  6436.  this->T5();
  6437.  return this->protected_nothing;
  6438. }
  6439.  
  6440. J10 *K9::execute(T2 *node, bool I0) {
  6441.  B2();
  6442.  if (node == nullptr) {
  6443.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6444.  }
  6445.  
  6446.  this->S5();
  6447.  this->R5().area = node->text_area;
  6448.  
  6449.  if (node->N11 == nullptr) {
  6450.  this->W2();
  6451.  this->K1();
  6452.  this->T5();
  6453.  return this->S1();
  6454.  }
  6455.  
  6456.  auto res = this->execute(node->N11, I0);
  6457.  if (this->Q0()) {
  6458.  this->W2();
  6459.  this->K1();
  6460.  this->T5();
  6461.  return res;
  6462.  }
  6463.  this->W2();
  6464.  this->K1();
  6465.  this->T5();
  6466.  return (I0) ? this->copy(res) : nullptr;
  6467. }
  6468.  
  6469. J10 *K9::execute(L3 *node, bool I0) {
  6470.  B2();
  6471.  if (node == nullptr) {
  6472.  this->T4("Failed to execute unknown AST node", this->R5().area);
  6473.  }
  6474.  this->S5();
  6475.  this->R5().area = node->text_area;
  6476.  if (!node->is_unX11d) {
  6477.  this->T3(true);
  6478.  }
  6479.  J10 *res = nullptr;
  6480.  for (auto stmt : node->list) {
  6481.  if (stmt == nullptr) {
  6482.  continue;
  6483.  }
  6484.  res = this->execute(stmt, I0);
  6485.  if (!this->X2()) {
  6486.  if (!node->is_unX11d) {
  6487.  this->S3();
  6488.  }
  6489.  this->T5();
  6490.  return res;
  6491.  }
  6492.  }
  6493.  if (!node->is_unX11d) {
  6494.  this->S3();
  6495.  }
  6496.  this->W2();
  6497.  this->T5();
  6498.  return (res != nullptr) ? res : this->protected_nothing;
  6499. }
  6500.  
  6501. bool K9::D3(J10 *obj) {
  6502.  B2();
  6503.  return obj != nullptr && obj->type != nullptr;
  6504. }
  6505.  
  6506. bool K9::B4(J10 *obj, I12 *type) {
  6507.  B2();
  6508.  if (type == nullptr) {
  6509.  return obj != nullptr && obj->type != nullptr && obj->H8 == nullptr;
  6510.  }
  6511.  return obj != nullptr && obj->type == type && obj->H8 == nullptr;
  6512. }
  6513.  
  6514. bool K9::Q1(J10 *obj, I12 *type) {
  6515.  B2();
  6516.  if (type == nullptr) {
  6517.  return obj != nullptr && obj->type != nullptr && obj->H8 != nullptr;
  6518.  }
  6519.  return obj != nullptr && obj->type == type && obj->H8 != nullptr;
  6520. }
  6521.  
  6522. bool K9::F8(J10 *obj, I12 *type) {
  6523.  B2();
  6524.  return obj != nullptr && obj->type == type;
  6525. }
  6526.  
  6527. S8 &K9::getS8(ContextId ctx_id) {
  6528.  if (ctx_id == K9::AREA_CTX) {
  6529.  return this->R5().area;
  6530.  }
  6531.  return this->R5().sub_areas[(int)ctx_id];
  6532. }
  6533.  
  6534. void K9::U0(J10 *obj, K9::ContextId ctx_id) {
  6535.  B2();
  6536.  
  6537.  if (!this->D3(obj)) {
  6538.  this->T4("Not a valid V10: " + obj->userRepr(this), this->getS8(ctx_id));
  6539.  }
  6540. }
  6541.  
  6542. void K9::D1(J10 *obj, I12 *type, K9::ContextId ctx_id) {
  6543.  B2();
  6544.  
  6545.  if (!this->B4(obj, type)) {
  6546.  if (type == nullptr) {
  6547.  this->T4("Not a type V10: " + obj->userRepr(this), this->getS8(ctx_id));
  6548.  }
  6549.  else {
  6550.  this->T4("Not a type V10 of type " + type->userRepr(this) + ": " + obj->userRepr(this), this->getS8(ctx_id));
  6551.  }
  6552.  }
  6553. }
  6554.  
  6555. void K9::M0(J10 *obj, I12 *type, K9::ContextId ctx_id) {
  6556.  B2();
  6557.  
  6558.  if (!this->Q1(obj, type)) {
  6559.  if (type == nullptr) {
  6560.  this->T4("Not an H8 V10: " + obj->userRepr(this), this->getS8(ctx_id));
  6561.  }
  6562.  else {
  6563.  this->T4("Not an H8 V10 of type " + type->userRepr(this) + ": " + obj->userRepr(this),
  6564.  this->getS8(ctx_id));
  6565.  }
  6566.  }
  6567. }
  6568.  
  6569. void K9::O2(J10 *obj, I12 *type, K9::ContextId ctx_id) {
  6570.  B2();
  6571.  
  6572.  if (!this->F8(obj, type)) {
  6573.  this->T4(obj->userRepr(this) + " is not of type " + type->userRepr(this), this->getS8(ctx_id));
  6574.  }
  6575. }
  6576.  
  6577. void K9::K0(const std::vector<J10 *> &args, int64_t amount, K9::ContextId ctx_id) {
  6578.  B2();
  6579.  
  6580.  if (args.size() < amount) {
  6581.  this->T4("Expected at least " + std::to_string(amount) + " M7, got " + std::to_string(args.size()),
  6582.  this->getS8(ctx_id));
  6583.  }
  6584. }
  6585.  
  6586. void K9::D0(const std::vector<J10 *> &args, int64_t amount, K9::ContextId ctx_id) {
  6587.  B2();
  6588.  
  6589.  if (args.size() != amount) {
  6590.  this->T4("Expected exactly " + std::to_string(amount) + " M7, got " + std::to_string(args.size()),
  6591.  this->getS8(ctx_id));
  6592.  }
  6593. }
  6594.  
  6595. void K9::E0(const std::vector<J10 *> &args, int64_t amount, K9::ContextId ctx_id) {
  6596.  B2();
  6597.  
  6598.  if (args.size() < amount + 1) {
  6599.  this->T4("Expected at least " + std::to_string(amount) + " M7, got " + std::to_string((int64_t)args.size() - 1),
  6600.  this->getS8(ctx_id));
  6601.  }
  6602. }
  6603.  
  6604. void K9::A0(const std::vector<J10 *> &args, int64_t amount, K9::ContextId ctx_id) {
  6605.  B2();
  6606.  
  6607.  if (args.size() != amount + 1) {
  6608.  this->T4("Expected exactly " + std::to_string(amount) + " M7, got " + std::to_string((int64_t)args.size() - 1),
  6609.  this->getS8(ctx_id));
  6610.  }
  6611. }
  6612.  
  6613. void K9::A2(J10 *obj, I10 id, K9::ContextId ctx_id) {
  6614.  B2();
  6615.  
  6616.  this->U0(obj, ctx_id);
  6617.  if (!obj->type->A7(id)) {
  6618.  this->T4(obj->userRepr(this) + " doesn't have R10 " + this->S12->R7(id), this->getS8(ctx_id));
  6619.  }
  6620. }
  6621.  
  6622. GC *K9::getGC() {
  6623.  return this->gc;
  6624. }
  6625.  
  6626. C4 *K9::getC4() {
  6627.  return this->Z3;
  6628. }
  6629.  
  6630. Scope *K9::E9() {
  6631.  return this->X11;
  6632. }
  6633.  
  6634. void K9::W2() {
  6635.  this->N2 = C3::U12;
  6636. }
  6637.  
  6638. void K9::A1() {
  6639.  this->N2 |= C3::H9;
  6640. }
  6641.  
  6642. void K9::W1() {
  6643.  this->N2 |= C3::D12;
  6644. }
  6645.  
  6646. void K9::K1() {
  6647.  this->N2 |= C3::A11;
  6648. }
  6649.  
  6650. void K9::N0() {
  6651.  this->N2 |= C3::N5;
  6652. }
  6653.  
  6654. bool K9::X2() {
  6655.  return this->N2 == C3::U12;
  6656. }
  6657.  
  6658. bool K9::H1() {
  6659.  return this->N2 & C3::H9;
  6660. }
  6661.  
  6662. bool K9::H2() {
  6663.  return this->N2 & C3::D12;
  6664. }
  6665.  
  6666. bool K9::X1() {
  6667.  return this->N2 & C3::A11;
  6668. }
  6669.  
  6670. bool K9::Q0() {
  6671.  return this->N2 & C3::N5;
  6672. }
  6673.  
  6674. namespace N4 {
  6675.  I10 Q6(K9 *rt) {
  6676.  B2();
  6677.  return rt->S12->Z11("__make__");
  6678.  }
  6679.  
  6680.  I10 R6(K9 *rt) {
  6681.  B2();
  6682.  return rt->S12->Z11("__copy__");
  6683.  }
  6684.  
  6685.  I10 S6(K9 *rt) {
  6686.  B2();
  6687.  return rt->S12->Z11("__bool__");
  6688.  }
  6689.  
  6690.  I10 T6(K9 *rt) {
  6691.  B2();
  6692.  return rt->S12->Z11("__char__");
  6693.  }
  6694.  
  6695.  I10 W7(K9 *rt) {
  6696.  B2();
  6697.  return rt->S12->Z11("__int__");
  6698.  }
  6699.  
  6700.  I10 mm__real__(K9 *rt) {
  6701.  B2();
  6702.  return rt->S12->Z11("__real__");
  6703.  }
  6704.  
  6705.  I10 S4(K9 *rt) {
  6706.  B2();
  6707.  return rt->S12->Z11("__string__");
  6708.  }
  6709.  
  6710.  I10 U6(K9 *rt) {
  6711.  B2();
  6712.  return rt->S12->Z11("__repr__");
  6713.  }
  6714.  
  6715.  I10 V6(K9 *rt) {
  6716.  B2();
  6717.  return rt->S12->Z11("__read__");
  6718.  }
  6719.  
  6720.  I10 mm__get_iterator__(K9 *rt) {
  6721.  B2();
  6722.  return rt->S12->Z11("__get_iterator__");
  6723.  }
  6724.  
  6725.  I10 mm__deref_iterator__(K9 *rt) {
  6726.  B2();
  6727.  return rt->S12->Z11("__deref_iterator__");
  6728.  }
  6729.  
  6730.  I10 mm__next_iterator__(K9 *rt) {
  6731.  B2();
  6732.  return rt->S12->Z11("__next_iterator__");
  6733.  }
  6734.  
  6735.  I10 mm__is_last_iterator__(K9 *rt) {
  6736.  B2();
  6737.  return rt->S12->Z11("__is_last_iterator__");
  6738.  }
  6739. }
  6740. }
  6741.  
  6742.  
  6743. #include <string>
  6744. #include <vector>
  6745.  
  6746. namespace H10 {
  6747.  
  6748. int64_t I12::total_types = 0;
  6749.  
  6750. I12::I12(K9 *rt) {
  6751.  B2();
  6752.  this->id = ++I12::total_types;
  6753.  W6 = X6 = Y7 = Z7 = O5 = P5 = B11 = Y6 = nullptr;
  6754.  
  6755.  F10 = C11 = D11 = A8 = B8 = E11 = F11 = E12 = G11 = F12 = H11 = G12
  6756.  = I11 = C8 = D8 = I9 = J11 = H12 = nullptr;
  6757.  
  6758.  G10 = J9 = nullptr;
  6759.  this->gc_mark = !rt->getGC()->gc_mark;
  6760.  
  6761.  rt->getGC()->C12(this);
  6762. }
  6763.  
  6764. I12::~I12() {
  6765.  B2();
  6766.  this->id = -1;
  6767.  W6 = X6 = Y7 = Z7 = O5 = P5 = B11 = Y6 = nullptr;
  6768.  
  6769.  F10 = C11 = D11 = A8 = B8 = E11 = F11 = E12 = G11 = F12 = H11 = G12
  6770.  = I11 = C8 = D8 = I9 = J11 = H12 = nullptr;
  6771.  
  6772.  G10 = J9 = nullptr;
  6773.  }
  6774.  
  6775. void I12::S7(I10 id, J10 *R10) {
  6776.  B2();
  6777.  this->S9[id] = R10;
  6778. }
  6779.  
  6780. J10 *I12::E8(I10 id, K9 *rt) {
  6781.  B2();
  6782.  auto it = this->S9.find(id);
  6783.  if (it != this->S9.end()) {
  6784.  rt->U0(it->second);
  6785.  return it->second;
  6786.  }
  6787.  rt->T4(this->userRepr(rt) + " doesn't have R10 " + rt->S12->R7(id), rt->R5().area);
  6788. }
  6789.  
  6790. bool I12::A7(I10 id) {
  6791.  B2();
  6792.  auto it = this->S9.find(id);
  6793.  return it != this->S9.end();
  6794. }
  6795.  
  6796. std::vector<J10 *> I12::getGCReachable() {
  6797.  B2();
  6798.  std::vector<J10 *> res;
  6799.  for (auto &elem : this->S9) {
  6800.  res.push_back(elem.second);
  6801.  }
  6802.  return res;
  6803. }
  6804.  
  6805. };
  6806. #include <unordered_map>
  6807. #include <vector>
  6808. #include <algorithm>
  6809. #include <iostream>
  6810.  
  6811. namespace H10::Profiler {
  6812.  
  6813. std::unordered_map<const char *, int> captures;
  6814.  
  6815.  
  6816. void capture(const char *name) {
  6817.  captures[name]++;
  6818. }
  6819.  
  6820. void printResult() {
  6821.  std::vector<std::pair<int, const char *>> res;
  6822.  for (auto [name, num]: captures) res.push_back({num, name});
  6823.  std::sort(res.begin(), res.end(), std::less<std::pair<int, const char*>>());
  6824.  
  6825.  for (auto [num, name]: res) {
  6826.  std::cout << num << ": " << name << "\n";
  6827.  }
  6828. }
  6829.  
  6830. }
  6831.  
  6832. #include <cstdlib>
  6833. #include <dlfcn.h>
  6834. #include <filesystem>
  6835. #include <unistd.h>
  6836.  
  6837. namespace H10::Z9 {
  6838.  
  6839. static J10 *CF_make(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6840.  B2();
  6841.  rt->D0(args, 1);
  6842.  auto arg = args[0];
  6843.  rt->D1(arg, nullptr, K9::SUB1_CTX);
  6844.  
  6845.  auto res = rt->make(arg->type, K9::INSTANCE_OBJECT);
  6846.  
  6847.  if (rt->D3(res) && res->type->A7(N4::Q6(rt))) {
  6848.  return rt->O7(N4::Q6(rt), res, {res}, true);
  6849.  }
  6850.  return res;
  6851. }
  6852.  
  6853. static J10 *CF_copy(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6854.  B2();
  6855.  rt->D0(args, 1);
  6856.  auto arg = args[0];
  6857.  rt->U0(arg, K9::SUB1_CTX);
  6858.  
  6859.  if (arg->type->A7(N4::R6(rt))) {
  6860.  return rt->O7(N4::R6(rt), arg, {arg}, true);
  6861.  }
  6862.  
  6863.  return rt->copy(args[0]);
  6864. }
  6865.  
  6866. static J10 *CF_bool(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6867.  B2();
  6868.  rt->D0(args, 1);
  6869.  auto arg = args[0];
  6870.  rt->U0(arg, K9::SUB1_CTX);
  6871.  
  6872.  rt->A2(arg, N4::S6(rt), K9::SUB1_CTX);
  6873.  return rt->O7(N4::S6(rt), arg, {arg}, I0);
  6874. }
  6875.  
  6876. static J10 *CF_char(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6877.  B2();
  6878.  rt->D0(args, 1);
  6879.  auto arg = args[0];
  6880.  rt->U0(arg, K9::SUB1_CTX);
  6881.  
  6882.  rt->A2(arg, N4::T6(rt), K9::SUB1_CTX);
  6883.  return rt->O7(N4::T6(rt), arg, {arg}, I0);
  6884. }
  6885.  
  6886. static J10 *CF_int(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6887.  B2();
  6888.  rt->D0(args, 1);
  6889.  auto arg = args[0];
  6890.  rt->U0(arg, K9::SUB1_CTX);
  6891.  
  6892.  rt->A2(arg, N4::W7(rt), K9::SUB1_CTX);
  6893.  return rt->O7(N4::W7(rt), arg, {arg}, I0);
  6894. }
  6895.  
  6896. static J10 *CF_real(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6897.  B2();
  6898.  rt->D0(args, 1);
  6899.  auto arg = args[0];
  6900.  rt->U0(arg, K9::SUB1_CTX);
  6901.  
  6902.  rt->A2(arg, N4::mm__real__(rt), K9::SUB1_CTX);
  6903.  return rt->O7(N4::mm__real__(rt), arg, {arg}, I0);
  6904. }
  6905.  
  6906. static J10 *CF_string(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6907.  B2();
  6908.  rt->D0(args, 1);
  6909.  auto arg = args[0];
  6910.  rt->U0(arg, K9::SUB1_CTX);
  6911.  
  6912.  rt->A2(arg, N4::S4(rt), K9::SUB1_CTX);
  6913.  return rt->O7(N4::S4(rt), arg, {arg}, I0);
  6914. }
  6915.  
  6916. static J10 *CF_printraw(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6917.  B2();
  6918.  int64_t index = 0;
  6919.  for (auto arg : args) {
  6920.  index++;
  6921.  rt->U0(arg, (K9::ContextId)index);
  6922.  if (rt->Q1(arg, rt->E3.string)) {
  6923.  std::cout << L1(arg);
  6924.  continue;
  6925.  }
  6926.  
  6927.  rt->A2(arg, N4::S4(rt), (K9::ContextId)index);
  6928.  
  6929.  auto &ta = rt->R5().sub_areas[index];
  6930.  rt->S5();
  6931.  rt->R5().area = ta;
  6932.  rt->R5().sub_areas = {ta, ta};
  6933.  auto res = rt->O7(N4::S4(rt), arg, {arg}, true);
  6934.  CF_printraw({res}, rt, false);
  6935.  rt->T5();
  6936.  }
  6937.  return rt->S1();
  6938. }
  6939.  
  6940. static J10 *CF_print(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6941.  B2();
  6942.  bool f = false;
  6943.  int64_t index = 0;
  6944.  for (auto arg : args) {
  6945.  index++;
  6946.  if (f) {
  6947.  std::cout << " ";
  6948.  }
  6949.  f = true;
  6950.  auto &ata = rt->R5().area;
  6951.  auto &fta = rt->R5().sub_areas[0];
  6952.  auto &ita = rt->R5().sub_areas[index];
  6953.  rt->S5();
  6954.  rt->R5().area = ata;
  6955.  rt->R5().sub_areas = {fta, ita};
  6956.  CF_printraw({arg}, rt, false);
  6957.  rt->T5();
  6958.  }
  6959.  return rt->S1();
  6960. }
  6961.  
  6962. static J10 *CF_printf(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  6963.  B2();
  6964.  rt->K0(args, 1);
  6965.  auto fmt = args[0];
  6966.  rt->M0(fmt, rt->E3.string);
  6967.  auto fmtstr = L1(fmt);
  6968.  
  6969.  std::string res;
  6970.  auto it = fmtstr.begin();
  6971.  while (it != fmtstr.end()) {
  6972.  if (*it == '@') {
  6973.  if (next(it) == fmtstr.end()) {
  6974.  res += *it;
  6975.  it++;
  6976.  break;
  6977.  }
  6978.  else {
  6979.  if (*next(it) == '@') {
  6980.  res += "@";
  6981.  it++;
  6982.  it++;
  6983.  continue;
  6984.  }
  6985.  else {
  6986.  if (*next(it) == '{') {
  6987.  it++;
  6988.  it++;
  6989.  int64_t pos = 0;
  6990.  while (true) {
  6991.  if (it == fmtstr.end()) {
  6992.  rt->T4("Invalid string format: expected a valid @{..} construct",
  6993.  rt->getS8(K9::AREA_CTX));
  6994.  }
  6995.  else if ('0' <= *it && *it <= '9') {
  6996.  pos *= 10;
  6997.  pos += *it - '0';
  6998.  it++;
  6999.  }
  7000.  else if (*it == '}') {
  7001.  it++;
  7002.  break;
  7003.  }
  7004.  else {
  7005.  rt->T4("Invalid string format: expected a valid @{..} construct",
  7006.  rt->getS8(K9::AREA_CTX));
  7007.  }
  7008.  }
  7009.  if (pos < 0 || args.size() <= pos + 1) {
  7010.  rt->T4("Invalid format string: not enough M7", rt->getS8(K9::AREA_CTX));
  7011.  }
  7012.  auto &arg = args[pos + 1];
  7013.  auto ctx = rt->R5(); rt->S5();
  7014.  rt->R5().area = ctx.sub_areas[pos + 1];
  7015.  rt->R5().sub_areas = {ctx.sub_areas[pos + 1], ctx.sub_areas[pos + 1]};
  7016.  std::cout << res;
  7017.  res = "";
  7018.  CF_printraw({arg}, rt, false);
  7019.  rt->T5();
  7020.  }
  7021.  else {
  7022.  res += *it;
  7023.  it++;
  7024.  continue;
  7025.  }
  7026.  }
  7027.  }
  7028.  }
  7029.  else {
  7030.  res += *it;
  7031.  it++;
  7032.  continue;
  7033.  }
  7034.  }
  7035.  std::cout << res;
  7036.  res = "";
  7037.  return rt->S1();
  7038. }
  7039.  
  7040. static J10 *CF_println(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7041.  B2();
  7042.  CF_print(args, rt, I0);
  7043.  std::cout << std::endl;
  7044.  return rt->S1();
  7045. }
  7046.  
  7047. static J10 *CF_readraw(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7048.  B2();
  7049.  rt->D0(args, 0);
  7050.  
  7051.  char c;
  7052.  std::cin >> c;
  7053.  
  7054.  if (!I0) {
  7055.  return rt->S1();
  7056.  }
  7057.  return Z9::B0(c, rt);
  7058. }
  7059.  
  7060. static J10 *CF_read(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7061.  B2();
  7062.  rt->D0(args, 1);
  7063.  auto arg = args[0];
  7064.  rt->D1(arg, nullptr, K9::SUB1_CTX);
  7065.  
  7066.  rt->A2(arg, N4::V6(rt), K9::SUB1_CTX);
  7067.  return rt->O7(N4::V6(rt), arg, {arg}, I0);
  7068. }
  7069.  
  7070. static J10 *CF_readln(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7071.  B2();
  7072.  rt->D0(args, 0);
  7073.  
  7074.  std::string str;
  7075.  getline(std::cin, str);
  7076.  
  7077.  if (!I0) {
  7078.  return rt->S1();
  7079.  }
  7080.  return Z9::J0(str, rt);
  7081. }
  7082.  
  7083. static J10 *CF_exit(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7084.  B2();
  7085.  rt->D0(args, 1);
  7086.  auto arg = args[0];
  7087.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  7088.  
  7089.  exit(V0(arg));
  7090. }
  7091.  
  7092. static J10 *CF_fork(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7093.  B2();
  7094.  rt->D0(args, 0);
  7095.  
  7096.  int res = fork();
  7097.  if (!I0) {
  7098.  return rt->S1();
  7099.  }
  7100.  
  7101.  return G0(res, rt);
  7102. }
  7103.  
  7104. static J10 *CF_system(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7105.  B2();
  7106.  rt->D0(args, 1);
  7107.  auto arg = args[0];
  7108.  rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7109.  
  7110.  auto ret = system(L1(arg).c_str());
  7111.  if (!I0) {
  7112.  return rt->S1();
  7113.  }
  7114.  
  7115.  return Z9::G0(ret, rt);
  7116. }
  7117.  
  7118. static J10 *CF_sleep(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7119.  B2();
  7120.  rt->D0(args, 1);
  7121.  auto arg = args[0];
  7122.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  7123.  
  7124.  ::usleep(Z1(arg) * 100'000);
  7125.  
  7126. return rt->S1();
  7127. }
  7128.  
  7129. static J10 *CF_error(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7130. B2();
  7131. rt->D0(args, 1);
  7132. auto arg = args[0];
  7133. rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7134.  
  7135. rt->T4(L1(arg), rt->R5().area);
  7136. }
  7137.  
  7138. static J10 *CF_cotton(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7139. B2();
  7140. rt->D0(args, 1);
  7141. auto arg = args[0];
  7142. rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7143.  
  7144. M11 lexer(rt->getC4());
  7145. std::string &str = L1(arg);
  7146.  
  7147. std::vector<K11> L11s = lexer.process(str);
  7148. for (auto &L11 : L11s) {
  7149. L11.Y10 = rt->S12->Z11(L11.Q12);
  7150. L11.N7 += rt->R5().sub_areas[1].first_char + 1;
  7151. L11.A10 += rt->R5().sub_areas[1].first_char + 1;
  7152. }
  7153.  
  7154. K10 B12r(rt->getC4());
  7155. R8 *program = B12r.B12(L11s);
  7156.  
  7157. return rt->execute(program, I0);
  7158. }
  7159.  
  7160. static J10 *CF_argc(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7161. B2();
  7162. rt->D0(args, 0);
  7163.  
  7164. if (!I0) {
  7165. return nullptr;
  7166. }
  7167.  
  7168. auto s = rt->E9()->getPrev();
  7169. while (s != nullptr && !s->isFunctionCall()) {
  7170. s = s->getPrev();
  7171. }
  7172. if (s == nullptr) {
  7173. return Z9::G0(0, rt);
  7174. }
  7175. return Z9::G0(s->getArguments().size(), rt);
  7176. }
  7177.  
  7178. static J10 *CF_argv(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7179. B2();
  7180. rt->D0(args, 0);
  7181.  
  7182. if (!I0) {
  7183. return nullptr;
  7184. }
  7185.  
  7186. auto s = rt->E9()->getPrev();
  7187. while (s != nullptr && !s->isFunctionCall()) {
  7188. s = s->getPrev();
  7189. }
  7190. if (s == nullptr) {
  7191. return Z9::L0({}, rt);
  7192. }
  7193. return Z9::L0(s->getArguments(), rt);
  7194. }
  7195.  
  7196. static J10 *CF_argg(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7197. B2();
  7198. rt->D0(args, 1);
  7199. auto arg = args[0];
  7200. rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  7201.  
  7202. if (!I0) {
  7203. return nullptr;
  7204. }
  7205.  
  7206. int64_t i = getIntegerValue(arg, rt);
  7207.  
  7208. auto s = rt->E9()->getPrev();
  7209. while (s != nullptr && !s->isFunctionCall()) {
  7210. s = s->getPrev();
  7211. }
  7212. if (s == nullptr || i >= s->getArguments().size()) {
  7213. return rt->S1();
  7214. }
  7215. if (i < s->getArguments().size()) {
  7216. return s->getArguments()[i];
  7217. }
  7218. else {
  7219. rt->T4("Argument index is out of range:" + arg->userRepr(rt), rt->R5().sub_areas[1]);
  7220. }
  7221. }
  7222.  
  7223. static J10 *CF_is(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7224. B2();
  7225. rt->D0(args, 2);
  7226. auto arg1 = args[0];
  7227. auto arg2 = args[1];
  7228. rt->U0(arg1, K9::SUB1_CTX);
  7229. rt->U0(arg2, K9::SUB1_CTX);
  7230.  
  7231. return rt->R1(arg1->H8 == arg2->H8 && arg1->type == arg2->type);
  7232. }
  7233.  
  7234. static J10 *CF_typeof(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7235. B2();
  7236. rt->D0(args, 1);
  7237. auto arg = args[0];
  7238. rt->U0(arg, K9::SUB1_CTX);
  7239.  
  7240. auto res = rt->getI12J10(arg->type);
  7241. if (res != rt->S1()) {
  7242. return res;
  7243. }
  7244. return rt->make(arg->type, K9::TYPE_OBJECT);
  7245. }
  7246.  
  7247. static J10 *CF_isinsobj(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7248. B2();
  7249. rt->K0(args, 1);
  7250. auto arg = args[0];
  7251. rt->U0(arg, K9::SUB1_CTX);
  7252.  
  7253. if (args.size() == 2) {
  7254. auto type = args[1];
  7255. rt->D1(type, nullptr, K9::SUB2_CTX);
  7256.  
  7257. if (!I0) {
  7258. return rt->S1();
  7259. }
  7260.  
  7261. return rt->R1(rt->Q1(arg, type->type));
  7262. }
  7263.  
  7264. return rt->R1(rt->Q1(arg, nullptr));
  7265. }
  7266.  
  7267. static J10 *CF_istypeobj(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7268. B2();
  7269. rt->K0(args, 1);
  7270. auto arg = args[0];
  7271. rt->U0(arg, K9::SUB1_CTX);
  7272.  
  7273. if (args.size() == 2) {
  7274. auto type = args[1];
  7275. rt->D1(type, nullptr, K9::SUB2_CTX);
  7276.  
  7277. if (!I0) {
  7278. return rt->S1();
  7279. }
  7280.  
  7281. return rt->R1(rt->B4(arg, type->type));
  7282. }
  7283.  
  7284. return rt->R1(rt->B4(arg, nullptr));
  7285. }
  7286.  
  7287. static J10 *CF_repr(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7288. B2();
  7289. rt->D0(args, 1);
  7290. auto arg = args[0];
  7291. rt->U0(arg, K9::SUB1_CTX);
  7292.  
  7293. rt->A2(arg, N4::U6(rt), K9::SUB1_CTX);
  7294. return rt->O7(N4::U6(rt), arg, {arg}, I0);
  7295. }
  7296.  
  7297. static J10 *CF_hasS11(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7298. B2();
  7299. rt->D0(args, 2);
  7300. auto obj = args[0];
  7301. auto str = args[1];
  7302. rt->M0(obj, nullptr, K9::SUB1_CTX);
  7303. rt->M0(str, rt->E3.string, K9::SUB2_CTX);
  7304.  
  7305. if (!I0) {
  7306. return rt->S1();
  7307. }
  7308. return rt->R1(obj->H8->hasField(rt->S12->Z11(L1(str)), rt));
  7309. }
  7310.  
  7311. static J10 *CF_hasR10(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7312. B2();
  7313. rt->D0(args, 2);
  7314. auto obj = args[0];
  7315. auto str = args[1];
  7316. rt->U0(obj, K9::SUB1_CTX);
  7317. rt->M0(str, rt->E3.string, K9::SUB2_CTX);
  7318.  
  7319. if (!I0) {
  7320. return rt->S1();
  7321. }
  7322. return rt->R1(obj->type->A7(rt->S12->Z11(L1(str))));
  7323. }
  7324.  
  7325. static J10 *CF_assert(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7326. B2();
  7327. rt->K0(args, 1);
  7328. auto val = args[0];
  7329. rt->M0(val, rt->E3.boolean, K9::SUB1_CTX);
  7330.  
  7331. std::string message = "Assertion error";
  7332.  
  7333. if (args.size() == 2) {
  7334. auto str = args[1];
  7335. rt->M0(str, rt->E3.string, K9::SUB2_CTX);
  7336.  
  7337. message += ": " + L1(str);
  7338. }
  7339.  
  7340. if (!W0(val)) {
  7341. rt->T4(message, rt->R5().area);
  7342. }
  7343.  
  7344. if (!I0) {
  7345. return rt->S1();
  7346. }
  7347. }
  7348.  
  7349. static J10 *CF_isinX11(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7350. B2();
  7351. rt->D0(args, 1);
  7352. auto arg = args[0];
  7353. rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7354.  
  7355. return rt->R1(rt->E9()->queryVariable(rt->S12->Z11(L1(arg)), rt));
  7356. }
  7357.  
  7358. static J10 *CF_checkglobal(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7359. B2();
  7360. rt->D0(args, 1);
  7361. auto arg = args[0];
  7362. rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7363.  
  7364. return rt->R1(rt->checkGlobal(rt->S12->Z11(L1(arg))));
  7365. }
  7366.  
  7367. static J10 *CF_getglobal(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7368. B2();
  7369. rt->D0(args, 1);
  7370. auto arg = args[0];
  7371. rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  7372.  
  7373. return rt->getGlobal(rt->S12->Z11(L1(arg)));
  7374. }
  7375.  
  7376. static J10 *CF_setglobal(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7377. B2();
  7378. rt->D0(args, 2);
  7379. auto arg1 = args[0];
  7380. auto arg2 = args[1];
  7381. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7382. rt->U0(arg2, K9::SUB2_CTX);
  7383.  
  7384. rt->setGlobal(rt->S12->Z11(L1(arg1)), arg2);
  7385. return arg2;
  7386. }
  7387.  
  7388. static J10 *CF_removeglobal(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7389. B2();
  7390. rt->D0(args, 1);
  7391. auto arg1 = args[0];
  7392. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7393.  
  7394. rt->removeGlobal(rt->S12->Z11(L1(arg1)));
  7395. return rt->S1();
  7396. }
  7397.  
  7398. static J10 *CF_sharedlibrary(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7399. B2();
  7400. rt->D0(args, 1);
  7401. auto arg1 = args[0];
  7402. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7403.  
  7404. auto path = std::filesystem::path(L1(arg1));
  7405. std::error_code err;
  7406. if (!path.is_absolute()) {
  7407. auto file_dir = std::filesystem::path(*rt->getS8(K9::AREA_CTX).C9).parent_path();
  7408. auto path1 = file_dir;
  7409. path1 /= path;
  7410.  
  7411. if (std::filesystem::exists(path1) && std::filesystem::is_regular_file(path1)) {
  7412. path = path1;
  7413. }
  7414. else {
  7415. auto COTTON_PATH = getenv("COTTON_SHARED_LIBRARIES_PATH");
  7416. if (COTTON_PATH == nullptr) {
  7417. path.clear(); }
  7418. else {
  7419. auto base = std::filesystem::path(COTTON_PATH);
  7420. base /= path;
  7421. path = base;
  7422. }
  7423. }
  7424. }
  7425.  
  7426.  
  7427. path = std::filesystem::canonical(std::filesystem::absolute(path, err), err);
  7428.  
  7429. if (err || !std::filesystem::is_regular_file(path) || !std::filesystem::exists(path)) {
  7430. rt->T4("The provided library is either invalid or non existent", rt->getS8(K9::AREA_CTX));
  7431. }
  7432.  
  7433. auto id = rt->S12->Z11("shared_library: " + path.string());
  7434. if (rt->checkGlobal(id)) {
  7435. return rt->getGlobal(id);
  7436. }
  7437. rt->setGlobal(id, rt->S1());
  7438.  
  7439. void *lib = dlopen(path.c_str(), RTLD_LAZY | RTLD_DEEPBIND);
  7440.  
  7441. auto llp = reinterpret_cast<LibraryLoadPoint>(dlsym(lib, "library_load_point"));
  7442. if (llp == nullptr) {
  7443. rt->T4("Failed to load library " + path.string(), rt->R5().area);
  7444. }
  7445. auto res = llp(rt);
  7446.  
  7447. rt->U0(res);
  7448. rt->setGlobal(id, res);
  7449. return res;
  7450. }
  7451.  
  7452. static J10 *CF_load(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7453. B2();
  7454. rt->D0(args, 1);
  7455. auto arg1 = args[0];
  7456. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7457.  
  7458. auto path = std::filesystem::path(L1(arg1));
  7459. path += ".ctn";
  7460.  
  7461. std::error_code err;
  7462. if (!path.is_absolute()) {
  7463. auto file_dir = std::filesystem::path(*rt->getS8(K9::AREA_CTX).C9).parent_path();
  7464. auto path1 = file_dir;
  7465. path1 /= path;
  7466.  
  7467. if (std::filesystem::exists(path1) && std::filesystem::is_regular_file(path1)) {
  7468. path = path1;
  7469. }
  7470. else {
  7471. auto COTTON_PATH = getenv("COTTON_CTN_MODULES_PATH");
  7472. if (COTTON_PATH == nullptr) {
  7473. path.clear(); }
  7474. else {
  7475. auto base = std::filesystem::path(COTTON_PATH);
  7476. base /= path;
  7477. path = base;
  7478. }
  7479. }
  7480. }
  7481.  
  7482.  
  7483. path = std::filesystem::canonical(std::filesystem::absolute(path, err), err);
  7484.  
  7485. if (err || !std::filesystem::is_regular_file(path) || !std::filesystem::exists(path)) {
  7486. rt->T4("The provided module is either invalid or non existent", rt->getS8(K9::AREA_CTX));
  7487. }
  7488.  
  7489. M11 lexer(rt->getC4());
  7490. K10 *B12r = new K10(rt->getC4());
  7491. auto L11s = lexer.processFile(path.string());
  7492. for (auto &L11 : L11s) {
  7493. L11.Y10 = rt->S12->Z11(L11.Q12);
  7494. }
  7495. auto program = B12r->B12(L11s);
  7496.  
  7497. auto id = rt->S12->Z11("load: " + path.string());
  7498. rt->setGlobal(id, rt->S1());
  7499.  
  7500. rt->T3(false);
  7501. rt->S5();
  7502. rt->R5().area = program->text_area;
  7503. auto res = rt->execute(program, true);
  7504. rt->T5();
  7505. rt->S3();
  7506.  
  7507. rt->U0(res);
  7508. rt->setGlobal(id, res);
  7509. return res;
  7510. }
  7511.  
  7512. static J10 *CF_smartrun(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7513. B2();
  7514. rt->D0(args, 1);
  7515. auto arg1 = args[0];
  7516. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7517.  
  7518. std::error_code ec;
  7519. auto path = std::filesystem::canonical(std::filesystem::path(L1(arg1)), ec);
  7520. if (ec) {
  7521. rt->T4("Invalid path: " + ec.message(), rt->R5().sub_areas[1]);
  7522. }
  7523. if (!std::filesystem::is_regular_file(path)) {
  7524. rt->T4("Not a regular file: " + path.string(), rt->R5().sub_areas[1]);
  7525. }
  7526.  
  7527. auto id = rt->S12->Z11("cotton smartrun: " + path.string());
  7528. if (rt->checkGlobal(id)) {
  7529. return rt->getGlobal(id);
  7530. }
  7531.  
  7532. M11 lexer(rt->getC4());
  7533. K10 B12r(rt->getC4());
  7534.  
  7535. auto L11s = lexer.processFile(path.c_str());
  7536. for (auto &L11 : L11s) {
  7537. L11.Y10 = rt->S12->Z11(L11.Q12);
  7538. }
  7539. auto program = B12r.B12(L11s);
  7540. rt->setGlobal(id, rt->S1());
  7541.  
  7542. rt->T3();
  7543. auto res = rt->execute(program, true);
  7544. rt->S3();
  7545.  
  7546. rt->U0(res);
  7547. rt->setGlobal(id, res);
  7548. return res;
  7549. }
  7550.  
  7551. static J10 *CF_dumbrun(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7552. B2();
  7553. rt->D0(args, 1);
  7554. auto arg1 = args[0];
  7555. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7556.  
  7557. std::error_code ec;
  7558. auto path = std::filesystem::canonical(std::filesystem::path(L1(arg1)), ec);
  7559. if (ec) {
  7560. rt->T4("Invalid path: " + ec.message(), rt->R5().sub_areas[1]);
  7561. }
  7562. if (!std::filesystem::is_regular_file(path) || !std::filesystem::exists(path)) {
  7563. rt->T4("Not a regular file: " + path.string(), rt->R5().sub_areas[1]);
  7564. }
  7565.  
  7566. M11 lexer(rt->getC4());
  7567. K10 B12r(rt->getC4());
  7568.  
  7569. auto L11s = lexer.processFile(path.c_str());
  7570. for (auto &L11 : L11s) {
  7571. L11.Y10 = rt->S12->Z11(L11.Q12);
  7572. }
  7573. auto program = B12r.B12(L11s);
  7574.  
  7575. rt->T3();
  7576. auto res = rt->execute(program, true);
  7577. rt->S3();
  7578.  
  7579. rt->U0(res);
  7580. return res;
  7581. }
  7582.  
  7583. static J10 *CF_loadlibrary(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7584. B2();
  7585. rt->D0(args, 1);
  7586. auto arg1 = args[0];
  7587. rt->M0(arg1, rt->E3.string, K9::SUB1_CTX);
  7588.  
  7589. std::error_code ec;
  7590. auto path = std::filesystem::canonical(std::filesystem::path(L1(arg1)), ec);
  7591. if (ec) {
  7592. rt->T4("Invalid path: " + ec.message(), rt->R5().sub_areas[1]);
  7593. }
  7594. if (!std::filesystem::is_regular_file(path)) {
  7595. rt->T4("Not a regular file: " + path.string(), rt->R5().sub_areas[1]);
  7596. }
  7597.  
  7598. auto id = rt->S12->Z11("cotton loadlibrary: " + path.string());
  7599. if (rt->checkGlobal(id)) {
  7600. return rt->getGlobal(id);
  7601. }
  7602. rt->setGlobal(id, rt->S1());
  7603.  
  7604. void *lib = dlopen(path.c_str(), RTLD_LAZY | RTLD_DEEPBIND);
  7605.  
  7606. auto llp = reinterpret_cast<LibraryLoadPoint>(dlsym(lib, "library_load_point"));
  7607. if (llp == nullptr) {
  7608. rt->T4("Failed to load library " + path.string(), rt->R5().area);
  7609. }
  7610. auto res = llp(rt);
  7611.  
  7612. rt->U0(res);
  7613. rt->setGlobal(id, res);
  7614. return res;
  7615. }
  7616.  
  7617. static J10 *CF_swap(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7618. B2();
  7619. rt->D0(args, 2);
  7620. auto first = args[0];
  7621. auto second = args[1];
  7622.  
  7623. std::swap(first->H8, second->H8);
  7624. std::swap(first->type, second->type);
  7625.  
  7626. return rt->S1();
  7627. }
  7628.  
  7629. static J10 *CF_hide(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7630. B2();
  7631. rt->D0(args, 1);
  7632. auto str = args[0];
  7633. rt->M0(str, rt->E3.string, K9::SUB1_CTX);
  7634.  
  7635. I10 id = rt->S12->Z11(L1(str));
  7636.  
  7637. auto X11 = rt->E9();
  7638. while (X11 != nullptr) {
  7639. if (X11->queryVariable(id, rt)) {
  7640. X11->removeVariable(id, rt);
  7641. return rt->R1(true);
  7642. }
  7643.  
  7644. if (X11->canAccessPrev()) {
  7645. X11 = X11->getPrev();
  7646. }
  7647. else if (X11 != X11->getMaster()) {
  7648. X11 = X11->getMaster();
  7649. }
  7650. else {
  7651. break;
  7652. }
  7653. }
  7654.  
  7655. return rt->R1(false);
  7656. }
  7657.  
  7658. static J10 *CF_unlockX11(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7659. B2();
  7660. rt->D0(args, 0);
  7661.  
  7662. auto X11 = rt->E9();
  7663.  
  7664. while (X11 != nullptr && !X11->isFunctionCall()) {
  7665. X11 = X11->getPrev();
  7666. }
  7667.  
  7668. if (X11 == nullptr) {
  7669. return rt->S1();
  7670. }
  7671.  
  7672. X11->setCanAccessPrev(true);
  7673.  
  7674. return rt->S1();
  7675. }
  7676.  
  7677. static J10 *CF_lockX11(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7678. B2();
  7679. rt->D0(args, 0);
  7680.  
  7681. auto X11 = rt->E9();
  7682.  
  7683. while (X11 != nullptr && !X11->isFunctionCall()) {
  7684. X11 = X11->getPrev();
  7685. }
  7686.  
  7687. if (X11 == nullptr) {
  7688. return rt->S1();
  7689. }
  7690.  
  7691. X11->setCanAccessPrev(false);
  7692.  
  7693. return rt->S1();
  7694. }
  7695.  
  7696. static J10 *CF_cfastio(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7697. B2();
  7698. rt->D0(args, 0);
  7699. std::ios_base::sync_with_stdio(0);
  7700. std::cin.tie(0);
  7701. std::cout.tie(0);
  7702. return rt->S1();
  7703. }
  7704.  
  7705. void installZ9Functions(K9 *rt) {
  7706. B2();
  7707. rt->E9()->L5(rt->S12->Z11("make"), C0(true, CF_make, nullptr, rt), rt);
  7708. rt->E9()->L5(rt->S12->Z11("copy"), C0(true, CF_copy, nullptr, rt), rt);
  7709. rt->E9()->L5(rt->S12->Z11("bool"), C0(true, CF_bool, nullptr, rt), rt);
  7710. rt->E9()->L5(rt->S12->Z11("char"), C0(true, CF_char, nullptr, rt), rt);
  7711. rt->E9()->L5(rt->S12->Z11("int"), C0(true, CF_int, nullptr, rt), rt);
  7712. rt->E9()->L5(rt->S12->Z11("real"), C0(true, CF_real, nullptr, rt), rt);
  7713. rt->E9()->L5(rt->S12->Z11("string"), C0(true, CF_string, nullptr, rt), rt);
  7714. rt->E9()->L5(rt->S12->Z11("printraw"), C0(true, CF_printraw, nullptr, rt), rt);
  7715. rt->E9()->L5(rt->S12->Z11("print"), C0(true, CF_print, nullptr, rt), rt);
  7716. rt->E9()->L5(rt->S12->Z11("printf"), C0(true, CF_printf, nullptr, rt), rt);
  7717. rt->E9()->L5(rt->S12->Z11("println"), C0(true, CF_println, nullptr, rt), rt);
  7718. rt->E9()->L5(rt->S12->Z11("readraw"), C0(true, CF_readraw, nullptr, rt), rt);
  7719. rt->E9()->L5(rt->S12->Z11("read"), C0(true, CF_read, nullptr, rt), rt);
  7720. rt->E9()->L5(rt->S12->Z11("readln"), C0(true, CF_readln, nullptr, rt), rt);
  7721. rt->E9()->L5(rt->S12->Z11("exit"), C0(true, CF_exit, nullptr, rt), rt);
  7722. rt->E9()->L5(rt->S12->Z11("fork"), C0(true, CF_fork, nullptr, rt), rt);
  7723. rt->E9()->L5(rt->S12->Z11("system"), C0(true, CF_system, nullptr, rt), rt);
  7724. rt->E9()->L5(rt->S12->Z11("sleep"), C0(true, CF_sleep, nullptr, rt), rt);
  7725. rt->E9()->L5(rt->S12->Z11("error"), C0(true, CF_error, nullptr, rt), rt);
  7726. rt->E9()->L5(rt->S12->Z11("cotton"), C0(true, CF_cotton, nullptr, rt), rt);
  7727. rt->E9()->L5(rt->S12->Z11("argc"), C0(true, CF_argc, nullptr, rt), rt);
  7728. rt->E9()->L5(rt->S12->Z11("argv"), C0(true, CF_argv, nullptr, rt), rt);
  7729. rt->E9()->L5(rt->S12->Z11("argg"), C0(true, CF_argg, nullptr, rt), rt);
  7730. rt->E9()->L5(rt->S12->Z11("is"), C0(true, CF_is, nullptr, rt), rt);
  7731. rt->E9()->L5(rt->S12->Z11("typeof"), C0(true, CF_typeof, nullptr, rt), rt);
  7732. rt->E9()->L5(rt->S12->Z11("isinsobj"), C0(true, CF_isinsobj, nullptr, rt), rt);
  7733. rt->E9()->L5(rt->S12->Z11("istypeobj"), C0(true, CF_istypeobj, nullptr, rt), rt);
  7734. rt->E9()->L5(rt->S12->Z11("repr"), C0(true, CF_repr, nullptr, rt), rt);
  7735. rt->E9()->L5(rt->S12->Z11("hasS11"), C0(true, CF_hasS11, nullptr, rt), rt);
  7736. rt->E9()->L5(rt->S12->Z11("hasR10"), C0(true, CF_hasR10, nullptr, rt), rt);
  7737. rt->E9()->L5(rt->S12->Z11("assert"), C0(true, CF_assert, nullptr, rt), rt);
  7738. rt->E9()->L5(rt->S12->Z11("isinX11"), C0(true, CF_isinX11, nullptr, rt), rt);
  7739. rt->E9()->L5(rt->S12->Z11("checkglobal"), C0(true, CF_checkglobal, nullptr, rt), rt);
  7740. rt->E9()->L5(rt->S12->Z11("getglobal"), C0(true, CF_getglobal, nullptr, rt), rt);
  7741. rt->E9()->L5(rt->S12->Z11("setglobal"), C0(true, CF_setglobal, nullptr, rt), rt);
  7742. rt->E9()->L5(rt->S12->Z11("removeglobal"), C0(true, CF_removeglobal, nullptr, rt), rt);
  7743. rt->E9()->L5(rt->S12->Z11("sharedlibrary"), C0(true, CF_sharedlibrary, nullptr, rt), rt);
  7744. rt->E9()->L5(rt->S12->Z11("load"), C0(true, CF_load, nullptr, rt), rt);
  7745. rt->E9()->L5(rt->S12->Z11("swap"), C0(true, CF_swap, nullptr, rt), rt);
  7746. rt->E9()->L5(rt->S12->Z11("hide"), C0(true, CF_hide, nullptr, rt), rt);
  7747. rt->E9()->L5(rt->S12->Z11("unlockX11"), C0(true, CF_unlockX11, nullptr, rt), rt);
  7748. rt->E9()->L5(rt->S12->Z11("lockX11"), C0(true, CF_lockX11, nullptr, rt), rt);
  7749. rt->E9()->L5(rt->S12->Z11("cfastio"), C0(true, CF_cfastio, nullptr, rt), rt);
  7750. }
  7751. }
  7752.  
  7753.  
  7754.  
  7755. namespace H10::Z9 {
  7756. M1::M1(K9 *rt)
  7757. : G8(rt, sizeof(M1)) {
  7758. B2();
  7759. this->N11 = '\0';
  7760. }
  7761.  
  7762. M1::~M1() {
  7763. B2();
  7764. }
  7765.  
  7766. G8 *M1::copy(K9 *rt) {
  7767. B2();
  7768. G8 *res = new M1(rt);
  7769. if (res == nullptr) {
  7770. rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  7771. }
  7772. icast(res, M1)->N11 = this->N11;
  7773. return res;
  7774. }
  7775.  
  7776. static std::string charToString(char c) {
  7777. B2();
  7778. switch (c) {
  7779. case '\a' : return "\\a";
  7780. case '\b' : return "\\b";
  7781. case '\f' : return "\\f";
  7782. case '\n' : return "\\n";
  7783. case '\r' : return "\\r";
  7784. case '\t' : return "\\t";
  7785. case '\v' : return "\\v";
  7786. case '\\' : return "\\\\";
  7787. case '\"' : return "\\\"";
  7788.  case '\'' : return "\\\'";
  7789.  }
  7790.  return std::string() + c;
  7791. }
  7792.  
  7793. std::string M1::userRepr(K9 *rt) {
  7794.  B2();
  7795.  if (this == nullptr) {
  7796.  return "P7(nullptr)";
  7797.  }
  7798.  return std::string("P7(N11 = '") + charToString(this->N11) + "')";
  7799. }
  7800.  
  7801. size_t M1::getSize() {
  7802.  B2();
  7803.  return sizeof(M1);
  7804. }
  7805.  
  7806. size_t V3::getG8Size() {
  7807.  B2();
  7808.  return sizeof(M1);
  7809. }
  7810.  
  7811. static J10 *P7PostincL9(J10 *self, K9 *rt, bool I0) {
  7812.  B2();
  7813.  
  7814.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7815.  
  7816.  if (!I0) {
  7817.  getP7ValueFast(self)++;
  7818.  return nullptr;
  7819.  }
  7820.  
  7821.  auto res = self->type->copy(self, rt);
  7822.  getP7ValueFast(self)++;
  7823.  return res;
  7824. }
  7825.  
  7826. static J10 *P7PostdecL9(J10 *self, K9 *rt, bool I0) {
  7827.  B2();
  7828.  
  7829.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7830.  
  7831.  if (!I0) {
  7832.  getP7ValueFast(self)--;
  7833.  return nullptr;
  7834.  }
  7835.  
  7836.  auto res = self->type->copy(self, rt);
  7837.  getP7ValueFast(self)--;
  7838.  return res;
  7839. }
  7840.  
  7841. static J10 *P7PreincL9(J10 *self, K9 *rt, bool I0) {
  7842.  B2();
  7843.  
  7844.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7845.  
  7846.  if (!I0) {
  7847.  getP7ValueFast(self)++;
  7848.  return nullptr;
  7849.  }
  7850.  
  7851.  getP7ValueFast(self)++;
  7852.  auto res = self->type->copy(self, rt);
  7853.  return res;
  7854. }
  7855.  
  7856. static J10 *P7PredecL9(J10 *self, K9 *rt, bool I0) {
  7857.  B2();
  7858.  
  7859.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7860.  
  7861.  if (!I0) {
  7862.  getP7ValueFast(self)--;
  7863.  return nullptr;
  7864.  }
  7865.  
  7866.  getP7ValueFast(self)--;
  7867.  auto res = self->type->copy(self, rt);
  7868.  return res;
  7869. }
  7870.  
  7871. static J10 *P7PositiveL9(J10 *self, K9 *rt, bool I0) {
  7872.  B2();
  7873.  
  7874.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7875.  
  7876.  if (!I0) {
  7877.  return nullptr;
  7878.  }
  7879.  
  7880.  auto res = self->type->copy(self, rt);
  7881.  return res;
  7882. }
  7883.  
  7884. static J10 *P7NegativeL9(J10 *self, K9 *rt, bool I0) {
  7885.  B2();
  7886.  
  7887.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7888.  
  7889.  if (!I0) {
  7890.  return nullptr;
  7891.  }
  7892.  
  7893.  auto res = self->type->copy(self, rt);
  7894.  getP7ValueFast(res) *= -1;
  7895.  return res;
  7896. }
  7897.  
  7898. static J10 *P7AddL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7899.  B2();
  7900.  
  7901.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7902.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7903.  
  7904.  if (!I0) {
  7905.  return nullptr;
  7906.  }
  7907.  
  7908.  auto res = B0(getP7ValueFast(self) + getP7ValueFast(arg), rt);
  7909.  return res;
  7910. }
  7911.  
  7912. static J10 *P7SubL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7913.  B2();
  7914.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7915.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7916.  
  7917.  if (!I0) {
  7918.  return nullptr;
  7919.  }
  7920.  
  7921.  auto res = B0(getP7ValueFast(self) - getP7ValueFast(arg), rt);
  7922.  return res;
  7923. }
  7924.  
  7925. static J10 *P7LtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7926.  B2();
  7927.  
  7928.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7929.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7930.  
  7931.  return rt->R1(getP7ValueFast(self) < getP7ValueFast(arg));
  7932. }
  7933.  
  7934. static J10 *P7LeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7935.  B2();
  7936.  
  7937.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7938.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7939.  
  7940.  return rt->R1(getP7ValueFast(self) <= getP7ValueFast(arg));
  7941. }
  7942.  
  7943. static J10 *P7GtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7944.  B2();
  7945.  
  7946.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7947.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7948.  
  7949.  return rt->R1(getP7ValueFast(self) > getP7ValueFast(arg));
  7950. }
  7951.  
  7952. static J10 *P7GeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7953.  B2();
  7954.  
  7955.  rt->M0(self, rt->E3.character, K9::SUB0_CTX);
  7956.  rt->M0(arg, rt->E3.character, K9::SUB1_CTX);
  7957.  
  7958.  return rt->R1(getP7ValueFast(self) >= getP7ValueFast(arg));
  7959. }
  7960.  
  7961. static J10 *P7EqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7962.  B2();
  7963.  rt->O2(self, rt->E3.character, K9::SUB0_CTX);
  7964.  rt->U0(arg, K9::SUB1_CTX);
  7965.  
  7966.  if (!rt->F8(arg, rt->E3.character)) {
  7967.  return rt->R1(false);
  7968.  }
  7969.  
  7970.  if (rt->Q1(self, rt->E3.character)) {
  7971.  if (!rt->Q1(arg, rt->E3.character)) {
  7972.  return rt->R1(false);
  7973.  }
  7974.  return rt->R1(getP7ValueFast(self) == getP7ValueFast(arg));
  7975.  }
  7976.  else if (rt->B4(self, rt->E3.character)) {
  7977.  if (!rt->B4(arg, rt->E3.character)) {
  7978.  return rt->R1(false);
  7979.  }
  7980.  return rt->R1(true);
  7981.  }
  7982.  
  7983.  return rt->R1(false);
  7984. }
  7985.  
  7986. static J10 *P7NeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  7987.  B2();
  7988.  auto res = P7EqL9(self, arg, rt, I0);
  7989.  return rt->R1(!W0(res));
  7990. }
  7991.  
  7992. static J10 *character_S6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  7993.  B2();
  7994.  rt->A0(args, 0);
  7995.  auto self = args[0];
  7996.  rt->M0(self, rt->E3.character, K9::SUB1_CTX);
  7997.  
  7998.  if (!I0) {
  7999.  return self;
  8000.  }
  8001.  
  8002.  return F0(getP7ValueFast(self) != '0', rt);
  8003. }
  8004.  
  8005. static J10 *character_T6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8006.  B2();
  8007.  rt->A0(args, 0);
  8008.  auto self = args[0];
  8009.  rt->M0(self, rt->E3.character, K9::SUB1_CTX);
  8010.  
  8011.  if (!I0) {
  8012.  return self;
  8013.  }
  8014.  
  8015.  return B0(getP7ValueFast(self), rt);
  8016. }
  8017.  
  8018. static J10 *character_W7(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8019.  B2();
  8020.  rt->A0(args, 0);
  8021.  auto self = args[0];
  8022.  rt->M0(self, rt->E3.character, K9::SUB1_CTX);
  8023.  
  8024.  if (!I0) {
  8025.  return self;
  8026.  }
  8027.  
  8028.  return G0(getP7ValueFast(self), rt);
  8029. }
  8030.  
  8031. static J10 *character_mm__real__(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8032.  B2();
  8033.  rt->A0(args, 0);
  8034.  auto self = args[0];
  8035.  rt->M0(self, rt->E3.character, K9::SUB1_CTX);
  8036.  
  8037.  if (!I0) {
  8038.  return self;
  8039.  }
  8040.  
  8041.  return makeL4J10(getP7ValueFast(self), rt);
  8042. }
  8043.  
  8044. static J10 *character_S4(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8045.  B2();
  8046.  rt->A0(args, 0);
  8047.  auto self = args[0];
  8048.  rt->O2(self, rt->E3.character, K9::SUB1_CTX);
  8049.  
  8050.  if (!I0) {
  8051.  return self;
  8052.  }
  8053.  
  8054.  if (rt->B4(self, nullptr)) {
  8055.  return J0("P7", rt);
  8056.  }
  8057.  
  8058.  return J0(std::string() + (char)getP7ValueFast(self), rt);
  8059. }
  8060.  
  8061. static J10 *character_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8062.  B2();
  8063.  rt->A0(args, 0);
  8064.  auto self = args[0];
  8065.  rt->O2(self, rt->E3.character, K9::SUB1_CTX);
  8066.  
  8067.  if (!I0) {
  8068.  return self;
  8069.  }
  8070.  
  8071.  if (rt->B4(self, nullptr)) {
  8072.  return J0("P7", rt);
  8073.  }
  8074.  
  8075.  return J0(std::string("\'") + (char)getP7ValueFast(self) + "\'", rt);
  8076. }
  8077.  
  8078. static J10 *character_V6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8079.  B2();
  8080.  rt->A0(args, 0);
  8081.  auto self = args[0];
  8082.  rt->O2(self, rt->E3.character, K9::SUB1_CTX);
  8083.  
  8084.  char c;
  8085.  std::cin >> c;
  8086.  
  8087.  if (!I0) {
  8088.  return self;
  8089.  }
  8090.  
  8091.  return B0(c, rt);
  8092. }
  8093.  
  8094. void installP7Methods(I12 *type, K9 *rt) {
  8095.  B2();
  8096.  type->S7(N4::S6(rt),
  8097.  Z9::C0(true, character_S6, nullptr, rt));
  8098.  type->S7(N4::T6(rt),
  8099.  Z9::C0(true, character_T6, nullptr, rt));
  8100.  type->S7(N4::W7(rt),
  8101.  Z9::C0(true, character_W7, nullptr, rt));
  8102.  type->S7(N4::mm__real__(rt),
  8103.  Z9::C0(true, character_mm__real__, nullptr, rt));
  8104.  type->S7(N4::S4(rt),
  8105.  Z9::C0(true, character_S4, nullptr, rt));
  8106.  type->S7(N4::U6(rt),
  8107.  Z9::C0(true, character_U6, nullptr, rt));
  8108.  type->S7(N4::V6(rt),
  8109.  Z9::C0(true, character_V6, nullptr, rt));
  8110. }
  8111.  
  8112. V3::V3(K9 *rt)
  8113.  : I12(rt) {
  8114.  B2();
  8115.  this->W6 = P7PostincL9;
  8116.  this->X6 = P7PostdecL9;
  8117.  this->Y7 = P7PreincL9;
  8118.  this->Z7 = P7PredecL9;
  8119.  this->O5 = P7PositiveL9;
  8120.  this->P5 = P7NegativeL9;
  8121.  this->E11 = P7AddL9;
  8122.  this->F11 = P7SubL9;
  8123.  this->E12 = P7LtL9;
  8124.  this->G11 = P7LeqL9;
  8125.  this->F12 = P7GtL9;
  8126.  this->H11 = P7GeqL9;
  8127.  this->G12 = P7EqL9;
  8128.  this->I11 = P7NeqL9;
  8129. }
  8130.  
  8131. J10 *V3::create(K9 *rt) {
  8132.  B2();
  8133.  G8 *ins = new M1(rt);
  8134.  J10 *obj = new J10(true, ins, this, rt);
  8135.  return obj;
  8136. }
  8137.  
  8138. J10 *V3::copy(J10 *obj, K9 *rt) {
  8139.  B2();
  8140.  rt->O2(obj, rt->E3.character);
  8141.  if (obj->H8 == nullptr) {
  8142.  return new J10(false, nullptr, this, rt);
  8143.  }
  8144.  auto ins = obj->H8->copy(rt);
  8145.  auto res = new J10(true, ins, this, rt);
  8146.  return res;
  8147. }
  8148.  
  8149. std::string V3::userRepr(K9 *rt) {
  8150.  B2();
  8151.  if (this == nullptr) {
  8152.  return "V3(nullptr)";
  8153.  }
  8154.  return "V3";
  8155. }
  8156.  
  8157. uint8_t &getP7Value(J10 *obj, K9 *rt) {
  8158.  B2();
  8159.  rt->M0(obj, rt->E3.character);
  8160.  return icast(obj->H8, H10::Z9::M1)->N11;
  8161. }
  8162.  
  8163. uint8_t &getP7Value(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  8164.  B2();
  8165.  rt->M0(obj, rt->E3.character, K9::SUB0_CTX);
  8166.  return icast(obj->H8, H10::Z9::M1)->N11;
  8167. }
  8168.  
  8169. J10 *B0(uint8_t N11, K9 *rt) {
  8170.  B2();
  8171.  auto res = rt->make(rt->E3.character, K9::INSTANCE_OBJECT);
  8172.  icast(res->H8, M1)->N11 = N11;
  8173.  return res;
  8174. }
  8175.  
  8176. }
  8177.  
  8178.  
  8179.  
  8180. namespace H10::Z9 {
  8181. Y1::Y1(K9 *rt)
  8182.  : G8(rt, sizeof(Y1)) {
  8183.  B2();
  8184.  this->is_internal = true;
  8185.  this->internal_ptr = nullptr;
  8186.  this->cotton_ptr = nullptr;
  8187. }
  8188.  
  8189. Y1::~Y1() {
  8190.  B2();
  8191. }
  8192.  
  8193. void Y1::init(bool is_internal, InternalFunction internal_ptr, Z4 *cotton_ptr) {
  8194.  B2();
  8195.  this->is_internal = is_internal;
  8196.  this->internal_ptr = internal_ptr;
  8197.  this->cotton_ptr = cotton_ptr;
  8198. }
  8199.  
  8200. G8 *Y1::copy(K9 *rt) {
  8201.  B2();
  8202.  auto res = new Y1(rt);
  8203.  if (res == nullptr) {
  8204.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  8205.  }
  8206.  res->init(this->is_internal, this->internal_ptr, this->cotton_ptr);
  8207.  return res;
  8208. }
  8209.  
  8210. std::string Y1::userRepr(K9 *rt) {
  8211.  B2();
  8212.  if (this == nullptr) {
  8213.  return "Function(nullptr)";
  8214.  }
  8215.  return (this->is_internal) ? "Function(internal)" : "Function";
  8216. }
  8217.  
  8218. size_t Y1::getSize() {
  8219.  B2();
  8220.  return sizeof(Y1);
  8221. }
  8222.  
  8223. size_t M4::getG8Size() {
  8224.  B2();
  8225.  return sizeof(Y1);
  8226. }
  8227.  
  8228. static J10 *
  8229. FunctionCallL9(J10 *self, const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8230.  B2();
  8231.  rt->M0(self, rt->E3.function, K9::SUB0_CTX);
  8232.  auto f = icast(self->H8, Y1);
  8233.  if (f->is_internal) {
  8234.  if (f->internal_ptr == nullptr) {
  8235.  rt->T4("Failed to execute nullptr internal function: " + self->userRepr(rt),
  8236.  rt->R5().area);
  8237.  }
  8238.  
  8239.  auto res = f->internal_ptr(args, rt, I0);
  8240.  if (I0 && res == nullptr) {
  8241.  rt->T4("Execution of internal function " + self->userRepr(rt) + " has failed",
  8242.  rt->R5().area);
  8243.  }
  8244.  return res;
  8245.  }
  8246.  else {
  8247.  if (f->cotton_ptr == nullptr || f->cotton_ptr->body == nullptr) {
  8248.  rt->T4("Failed to execute nullptr function " + self->userRepr(rt), rt->R5().area);
  8249.  }
  8250.  rt->T3(false);
  8251.  rt->E9()->setIsFunctionCall(true);
  8252.  for (auto arg : args) {
  8253.  rt->E9()->getArguments().push_back(arg);
  8254.  }
  8255.  if (f->cotton_ptr->params != nullptr) {
  8256.  int i = 0;
  8257.  for (auto L11 : f->cotton_ptr->params->list) {
  8258.  if (i >= args.size()) {
  8259.  rt->E9()->L5(L11->Y10, H0(rt), rt);
  8260.  continue;
  8261.  }
  8262.  rt->E9()->L5(L11->Y10, args[i], rt);
  8263.  i++;
  8264.  }
  8265.  }
  8266.  rt->S5();
  8267.  rt->R5().area = f->cotton_ptr->body->text_area;
  8268.  auto res = rt->execute(f->cotton_ptr->body, I0);
  8269.  rt->T5();
  8270.  rt->S3();
  8271.  if (I0 && res == nullptr) {
  8272.  rt->T4("Execution of function " + self->userRepr(rt) + " has failed",
  8273.  rt->R5().sub_areas[0]);
  8274.  }
  8275.  return res;
  8276.  }
  8277. }
  8278.  
  8279. static J10 *FunctionEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8280.  B2();
  8281.  rt->O2(self, rt->E3.function, K9::SUB0_CTX);
  8282.  rt->U0(arg, K9::SUB1_CTX);
  8283.  
  8284.  if (!rt->F8(arg, rt->E3.function)) {
  8285.  return rt->R1(false);
  8286.  }
  8287.  
  8288.  if (rt->Q1(self, rt->E3.function)) {
  8289.  if (!rt->Q1(arg, rt->E3.function)) {
  8290.  return rt->R1(false);
  8291.  }
  8292.  auto f1 = icast(self->H8, Y1);
  8293.  auto f2 = icast(arg->H8, Y1);
  8294.  if (f1->is_internal && f2->is_internal) {
  8295.  return rt->R1(f1->internal_ptr == f2->internal_ptr);
  8296.  }
  8297.  else if (!f1->is_internal && !f2->is_internal) {
  8298.  return rt->R1(f1->cotton_ptr == f2->cotton_ptr);
  8299.  }
  8300.  return rt->R1(false);
  8301.  }
  8302.  else if (rt->B4(self, rt->E3.function)) {
  8303.  if (!rt->B4(arg, rt->E3.function)) {
  8304.  return rt->R1(false);
  8305.  }
  8306.  return rt->R1(true);
  8307.  }
  8308.  
  8309.  return rt->R1(false);
  8310. }
  8311.  
  8312. static J10 *FunctionNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8313.  B2();
  8314.  auto res = FunctionEqL9(self, arg, rt, I0);
  8315.  return rt->R1(!W0(res));
  8316. }
  8317.  
  8318. static J10 *function_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8319.  B2();
  8320.  rt->A0(args, 0);
  8321.  auto self = args[0];
  8322.  rt->O2(self, rt->E3.function, K9::SUB1_CTX);
  8323.  
  8324.  if (!I0) {
  8325.  return self;
  8326.  }
  8327.  
  8328.  if (rt->B4(self, nullptr)) {
  8329.  return J0("Function", rt);
  8330.  }
  8331.  
  8332.  return J0("function", rt);
  8333. }
  8334.  
  8335. void installFunctionMethods(I12 *type, K9 *rt) {
  8336.  type->S7(N4::U6(rt),
  8337.  Z9::C0(true, function_U6, nullptr, rt));
  8338. }
  8339.  
  8340. M4::M4(K9 *rt)
  8341.  : I12(rt) {
  8342.  B2();
  8343.  this->G10 = FunctionCallL9;
  8344.  this->G12 = FunctionEqL9;
  8345.  this->I11 = FunctionNeqL9;
  8346. }
  8347.  
  8348. J10 *M4::create(K9 *rt) {
  8349.  B2();
  8350.  auto ins = new Y1(rt);
  8351.  J10 *obj = new J10(true, ins, this, rt);
  8352.  return obj;
  8353. }
  8354.  
  8355. J10 *M4::copy(J10 *obj, K9 *rt) {
  8356.  B2();
  8357.  rt->O2(obj, rt->E3.function);
  8358.  if (obj->H8 == nullptr) {
  8359.  return new J10(false, nullptr, this, rt);
  8360.  }
  8361.  auto ins = obj->H8->copy(rt);
  8362.  auto res = new J10(true, ins, this, rt);
  8363.  
  8364.  return res;
  8365. }
  8366.  
  8367. std::string M4::userRepr(K9 *rt) {
  8368.  B2();
  8369.  if (this == nullptr) {
  8370.  return "M4(nullptr)";
  8371.  }
  8372.  return "M4";
  8373. }
  8374.  
  8375. J10 *
  8376. C0(bool is_internal, InternalFunction internal_ptr, Z4 *cotton_ptr, K9 *rt) {
  8377.  B2();
  8378.  auto res = rt->make(rt->E3.function, rt->INSTANCE_OBJECT);
  8379.  icast(res->H8, Y1)->init(is_internal, internal_ptr, cotton_ptr);
  8380.  return res;
  8381. }
  8382.  
  8383. }
  8384.  
  8385.  
  8386.  
  8387. namespace H10::Z9 {
  8388. Z2::Z2(K9 *rt)
  8389.  : G8(rt, sizeof(Z2)) {
  8390.  B2();
  8391.  this->Q12 = "";
  8392. }
  8393.  
  8394. Z2::~Z2() {
  8395.  B2();
  8396. }
  8397.  
  8398. G8 *Z2::copy(K9 *rt) {
  8399.  B2();
  8400.  G8 *res = new Z2(rt);
  8401.  
  8402.  if (res == nullptr) {
  8403.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  8404.  }
  8405.  ((Z2 *)res)->Q12 = this->Q12;
  8406.  return res;
  8407. }
  8408.  
  8409. std::string Z2::userRepr(K9 *rt) {
  8410.  B2();
  8411.  if (this == nullptr) {
  8412.  return "String(nullptr)";
  8413.  }
  8414.  return "Z2(size = " + std::to_string(this->Q12.size()) + ", Q12 = ...)";
  8415. }
  8416.  
  8417. size_t Z2::getSize() {
  8418.  B2();
  8419.  return sizeof(Z2);
  8420. }
  8421.  
  8422. size_t J6::getG8Size() {
  8423.  B2();
  8424.  return sizeof(Z2);
  8425. }
  8426.  
  8427. static J10 *StringIndexL9(J10 *self, const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8428.  B2();
  8429.  
  8430.  rt->M0(self, rt->E3.string, K9::SUB0_CTX);
  8431.  rt->D0(args, 1);
  8432.  auto &arg = args[0];
  8433.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  8434.  if (!(0 <= V0(arg) && V0(arg) < L1(self).size())) {
  8435.  rt->T4("Index " + arg->userRepr(rt) + " is out of string " + self->userRepr(rt) + " range", rt->R5().sub_areas[1]);
  8436.  }
  8437.  if (!I0) {
  8438.  return nullptr;
  8439.  }
  8440.  return B0(L1(self)[V0(arg)], rt);
  8441. }
  8442.  
  8443. static J10 *StringAddL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8444.  B2();
  8445.  
  8446.  rt->M0(self, rt->E3.string, K9::SUB0_CTX);
  8447.  rt->M0(arg, rt->E3.string, K9::SUB1_CTX);
  8448.  
  8449.  if (!I0) {
  8450.  return nullptr;
  8451.  }
  8452.  
  8453.  auto res = rt->copy(self);
  8454.  L1(res) += L1(arg);
  8455.  
  8456.  return res;
  8457. }
  8458.  
  8459. static J10 *StringEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8460.  B2();
  8461.  rt->O2(self, rt->E3.string, K9::SUB0_CTX);
  8462.  rt->U0(arg, K9::SUB1_CTX);
  8463.  
  8464.  if (!rt->F8(arg, rt->E3.string)) {
  8465.  return rt->R1(false);
  8466.  }
  8467.  
  8468.  if (rt->Q1(self, rt->E3.string)) {
  8469.  if (!rt->Q1(arg, rt->E3.string)) {
  8470.  return rt->R1(false);
  8471.  }
  8472.  return rt->R1(L1(self) == L1(arg));
  8473.  }
  8474.  else if (rt->B4(self, rt->E3.string)) {
  8475.  if (!rt->B4(arg, rt->E3.string)) {
  8476.  return rt->R1(false);
  8477.  }
  8478.  return rt->R1(true);
  8479.  }
  8480.  
  8481.  return rt->R1(false);
  8482. }
  8483.  
  8484. static J10 *StringNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8485.  B2();
  8486.  auto res = StringEqL9(self, arg, rt, I0);
  8487.  return rt->R1(!W0(res));
  8488. }
  8489.  
  8490. static J10 *stringSizeMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8491.  B2();
  8492.  rt->A0(args, 0);
  8493.  auto self = args[0];
  8494.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8495.  
  8496.  if (!I0) {
  8497.  return nullptr;
  8498.  }
  8499.  
  8500.  return G0(L1(self).size(), rt);
  8501. }
  8502.  
  8503. static J10 *stringSetMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8504.  B2();
  8505.  rt->A0(args, 2);
  8506.  auto self = args[0];
  8507.  auto index = args[1];
  8508.  auto N11 = args[2];
  8509.  
  8510.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8511.  rt->M0(index, rt->E3.integer, K9::SUB2_CTX);
  8512.  rt->M0(N11, rt->E3.character, K9::SUB3_CTX);
  8513.  
  8514.  int64_t ind = V0(index);
  8515.  auto &Q12 = L1(self);
  8516.  if (!(0 <= ind && ind < Q12.size())) {
  8517.  rt->T4("Index is out of range: " + index->userRepr(rt), rt->R5().sub_areas[2]);
  8518.  }
  8519.  Q12[ind] = getP7ValueFast(N11);
  8520.  return rt->S1();
  8521. }
  8522.  
  8523. static J10 *stringClearMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8524.  B2();
  8525.  rt->A0(args, 0);
  8526.  auto self = args[0];
  8527.  
  8528.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8529.  L1(self).clear();
  8530.  return self;
  8531. }
  8532.  
  8533. static J10 *stringEmptyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8534.  B2();
  8535.  rt->A0(args, 0);
  8536.  auto self = args[0];
  8537.  
  8538.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8539.  return rt->R1(L1(self).empty());
  8540. }
  8541.  
  8542. static J10 *stringReverseMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8543.  B2();
  8544.  rt->A0(args, 0);
  8545.  auto self = args[0];
  8546.  
  8547.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8548.  std::reverse(L1(self).begin(), L1(self).end());
  8549.  return self;
  8550. }
  8551.  
  8552. static J10 *stringPrependMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8553.  B2();
  8554.  rt->A0(args, 1);
  8555.  auto self = args[0];
  8556.  auto arg = args[1];
  8557.  
  8558.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8559.  rt->M0(arg, rt->E3.string, K9::SUB2_CTX);
  8560.  
  8561.  L1(self) = L1(arg) + L1(self);
  8562.  
  8563.  return self;
  8564. }
  8565.  
  8566. static J10 *stringAppendMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8567.  B2();
  8568.  rt->A0(args, 1);
  8569.  auto self = args[0];
  8570.  auto arg = args[1];
  8571.  
  8572.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8573.  rt->M0(arg, rt->E3.string, K9::SUB2_CTX);
  8574.  
  8575.  L1(self) += L1(arg);
  8576.  
  8577.  return self;
  8578. }
  8579.  
  8580. static J10 *stringDelprefMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8581.  B2();
  8582.  rt->A0(args, 1);
  8583.  auto self = args[0];
  8584.  auto arg = args[1];
  8585.  
  8586.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8587.  rt->M0(arg, rt->E3.string, K9::SUB2_CTX);
  8588.  
  8589.  auto &str = L1(self);
  8590.  auto &pref = L1(arg);
  8591.  
  8592.  if (str.starts_with(pref)) {
  8593.  str.erase(0, pref.size());
  8594.  }
  8595.  
  8596.  return self;
  8597. }
  8598.  
  8599. static J10 *stringDelsufMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8600.  B2();
  8601.  rt->A0(args, 1);
  8602.  auto self = args[0];
  8603.  auto arg = args[1];
  8604.  
  8605.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8606.  rt->M0(arg, rt->E3.string, K9::SUB2_CTX);
  8607.  
  8608.  auto &str = L1(self);
  8609.  auto &pref = L1(arg);
  8610.  
  8611.  if (str.ends_with(pref)) {
  8612.  str.erase(str.size() - pref.size(), pref.size());
  8613.  }
  8614.  
  8615.  return self;
  8616. }
  8617.  
  8618. static J10 *stringCopyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8619.  B2();
  8620.  rt->A0(args, 0);
  8621.  auto self = args[0];
  8622.  
  8623.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8624.  
  8625.  auto &str = L1(self);
  8626.  
  8627.  return J0(str, rt);
  8628. }
  8629.  
  8630. static J10 *stringSubstrMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8631.  B2();
  8632.  rt->A0(args, 2);
  8633.  auto self = args[0];
  8634.  auto begin = args[1];
  8635.  auto end = args[2];
  8636.  
  8637.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8638.  rt->M0(begin, rt->E3.integer, K9::SUB2_CTX);
  8639.  rt->M0(end, rt->E3.integer, K9::SUB3_CTX);
  8640.  
  8641.  int64_t p1 = V0(begin);
  8642.  int64_t p2 = V0(end);
  8643.  auto &str = L1(self);
  8644.  
  8645.  if (p1 < 0) {
  8646.  p1 = 0;
  8647.  }
  8648.  if (p2 > str.size()) {
  8649.  p2 = str.size();
  8650.  }
  8651.  if (p1 >= p2) {
  8652.  return J0("", rt);
  8653.  }
  8654.  
  8655.  auto substr = str.substr(p1, p2 - p1);
  8656.  
  8657.  return J0(substr, rt);
  8658. }
  8659.  
  8660. static J10 *stringArrayMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8661.  B2();
  8662.  rt->A0(args, 0);
  8663.  auto self = args[0];
  8664.  
  8665.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8666.  
  8667.  std::vector<J10 *> Q12;
  8668.  for (auto c : L1(self)) {
  8669.  Q12.push_back(B0(c, rt));
  8670.  }
  8671.  return L0(Q12, rt);
  8672. }
  8673.  
  8674. static J10 *string_S6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8675.  B2();
  8676.  rt->A0(args, 0);
  8677.  auto self = args[0];
  8678.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8679.  
  8680.  if (!I0) {
  8681.  return self;
  8682.  }
  8683.  
  8684.  if (L1(self) == "true") {
  8685.  return rt->R1(true);
  8686.  }
  8687.  else if (L1(self) == "true") {
  8688.  return rt->R1(false);
  8689.  }
  8690.  rt->T4("Unsupported conversion: " + L1(self), rt->R5().area);
  8691. }
  8692.  
  8693. static J10 *string_W7(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8694.  B2();
  8695.  rt->A0(args, 0);
  8696.  auto self = args[0];
  8697.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8698.  
  8699.  if (!I0) {
  8700.  return self;
  8701.  }
  8702.  
  8703.  return G0(atoll(L1(self).c_str()), rt);
  8704. }
  8705.  
  8706. static J10 *string_mm__real__(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8707.  B2();
  8708.  rt->A0(args, 0);
  8709.  auto self = args[0];
  8710.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8711.  
  8712.  if (!I0) {
  8713.  return self;
  8714.  }
  8715.  
  8716.  return makeL4J10(atof(L1(self).c_str()), rt);
  8717. }
  8718.  
  8719. static J10 *string_S4(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8720.  B2();
  8721.  rt->A0(args, 0);
  8722.  auto self = args[0];
  8723.  rt->M0(self, rt->E3.string, K9::SUB1_CTX);
  8724.  
  8725.  if (!I0) {
  8726.  return self;
  8727.  }
  8728.  
  8729.  return J0(L1(self), rt);
  8730. }
  8731.  
  8732. static J10 *string_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8733.  B2();
  8734.  rt->A0(args, 0);
  8735.  auto self = args[0];
  8736.  rt->O2(self, rt->E3.string, K9::SUB1_CTX);
  8737.  
  8738.  if (!I0) {
  8739.  return self;
  8740.  }
  8741.  
  8742.  if (rt->B4(self, nullptr)) {
  8743.  return J0("String", rt);
  8744.  }
  8745.  
  8746.  return J0("\"" + L1(self) + "\"", rt);
  8747. }
  8748.  
  8749. static J10 *string_V6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8750.  B2();
  8751.  rt->A0(args, 0);
  8752.  auto self = args[0];
  8753.  rt->O2(self, rt->E3.string, K9::SUB1_CTX);
  8754.  
  8755.  std::string v;
  8756.  std::cin >> v;
  8757.  
  8758.  if (!I0) {
  8759.  return self;
  8760.  }
  8761.  
  8762.  return J0(v, rt);
  8763. }
  8764.  
  8765. void installStringMethods(I12 *type, K9 *rt) {
  8766.  B2();
  8767.  type->S7(N4::S6(rt), Z9::C0(true, string_S6, nullptr, rt));
  8768.  type->S7(N4::W7(rt), Z9::C0(true, string_W7, nullptr, rt));
  8769.  type->S7(N4::mm__real__(rt), Z9::C0(true, string_mm__real__, nullptr, rt));
  8770.  type->S7(N4::S4(rt), Z9::C0(true, string_S4, nullptr, rt));
  8771.  type->S7(N4::U6(rt), Z9::C0(true, string_U6, nullptr, rt));
  8772.  type->S7(N4::V6(rt), Z9::C0(true, string_V6, nullptr, rt));
  8773.  
  8774.  type->S7(rt->S12->Z11("size"), C0(true, stringSizeMethod, nullptr, rt));
  8775.  type->S7(rt->S12->Z11("set"), C0(true, stringSetMethod, nullptr, rt));
  8776.  type->S7(rt->S12->Z11("clear"), C0(true, stringClearMethod, nullptr, rt));
  8777.  type->S7(rt->S12->Z11("empty"), C0(true, stringEmptyMethod, nullptr, rt));
  8778.  type->S7(rt->S12->Z11("reverse"), C0(true, stringReverseMethod, nullptr, rt));
  8779.  type->S7(rt->S12->Z11("prepend"), C0(true, stringPrependMethod, nullptr, rt));
  8780.  type->S7(rt->S12->Z11("append"), C0(true, stringAppendMethod, nullptr, rt));
  8781.  type->S7(rt->S12->Z11("delpref"), C0(true, stringDelprefMethod, nullptr, rt));
  8782.  type->S7(rt->S12->Z11("delsuf"), C0(true, stringDelsufMethod, nullptr, rt));
  8783.  type->S7(rt->S12->Z11("copy"), C0(true, stringCopyMethod, nullptr, rt));
  8784.  type->S7(rt->S12->Z11("substr"), C0(true, stringSubstrMethod, nullptr, rt));
  8785.  type->S7(rt->S12->Z11("array"), C0(true, stringArrayMethod, nullptr, rt));
  8786. }
  8787.  
  8788. J6::J6(K9 *rt)
  8789.  : I12(rt) {
  8790.  B2();
  8791.  this->J9 = StringIndexL9;
  8792.  this->E11 = StringAddL9;
  8793.  this->G12 = StringEqL9;
  8794.  this->I11 = StringNeqL9;
  8795. }
  8796.  
  8797. J10 *J6::create(K9 *rt) {
  8798.  B2();
  8799.  G8 *ins = new Z2(rt);
  8800.  J10 *obj = new J10(true, ins, this, rt);
  8801.  return obj;
  8802. }
  8803.  
  8804. J10 *J6::copy(J10 *obj, K9 *rt) {
  8805.  B2();
  8806.  rt->O2(obj, rt->E3.string);
  8807.  if (obj->H8 == nullptr) {
  8808.  return new J10(false, nullptr, this, rt);
  8809.  }
  8810.  auto ins = obj->H8->copy(rt);
  8811.  auto res = new J10(true, ins, this, rt);
  8812.  return res;
  8813. }
  8814.  
  8815. std::string J6::userRepr(K9 *rt) {
  8816.  B2();
  8817.  if (this == nullptr) {
  8818.  return "J6(nullptr)";
  8819.  }
  8820.  return "J6";
  8821. }
  8822.  
  8823. std::string &R7Data(J10 *obj, K9 *rt) {
  8824.  B2();
  8825.  rt->M0(obj, rt->E3.string);
  8826.  return icast(obj->H8, H10::Z9::Z2)->Q12;
  8827. }
  8828.  
  8829. std::string &R7Data(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  8830.  B2();
  8831.  rt->M0(obj, rt->E3.string, K9::SUB0_CTX);
  8832.  return icast(obj->H8, H10::Z9::Z2)->Q12;
  8833. }
  8834.  
  8835. J10 *J0(const std::string &N11, K9 *rt) {
  8836.  B2();
  8837.  auto res = rt->make(rt->E3.string, K9::INSTANCE_OBJECT);
  8838.  L1(res) = N11;
  8839.  return res;
  8840. }
  8841.  
  8842. }
  8843.  
  8844.  
  8845.  
  8846.  
  8847. namespace H10::Z9 {
  8848.  
  8849. K2::K2(K9 *rt)
  8850.  : G8(rt, sizeof(K2)) {
  8851.  B2();
  8852. }
  8853.  
  8854. K2::~K2() {
  8855.  B2();
  8856. }
  8857.  
  8858. G8 *K2::copy(K9 *rt) {
  8859.  B2();
  8860.  G8 *res = new K2(rt);
  8861.  
  8862.  if (res == nullptr) {
  8863.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  8864.  }
  8865.  return res;
  8866. }
  8867.  
  8868. size_t K2::getSize() {
  8869.  B2();
  8870.  return sizeof(K2);
  8871. }
  8872.  
  8873. size_t K5::getG8Size() {
  8874.  B2();
  8875.  return sizeof(K2);
  8876. }
  8877.  
  8878. std::string K2::userRepr(K9 *rt) {
  8879.  B2();
  8880.  if (this == nullptr) {
  8881.  return "Nothing(nullptr)";
  8882.  }
  8883.  return "Nothing";
  8884. }
  8885.  
  8886. static J10 *NothingEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8887.  B2();
  8888.  rt->O2(self, rt->E3.nothing, K9::SUB0_CTX);
  8889.  rt->U0(arg, K9::SUB1_CTX);
  8890.  
  8891.  if (!rt->F8(arg, rt->E3.nothing)) {
  8892.  return rt->R1(false);
  8893.  }
  8894.  
  8895.  return rt->R1(true);
  8896. }
  8897.  
  8898. static J10 *NothingNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  8899.  B2();
  8900.  auto res = NothingEqL9(self, arg, rt, I0);
  8901.  return rt->R1(!W0(res));
  8902. }
  8903.  
  8904. static J10 *nothing_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  8905.  B2();
  8906.  rt->A0(args, 0);
  8907.  auto self = args[0];
  8908.  rt->O2(self, rt->E3.nothing, K9::SUB1_CTX);
  8909.  
  8910.  if (!I0) {
  8911.  return self;
  8912.  }
  8913.  
  8914.  if (rt->B4(self, nullptr)) {
  8915.  return J0("Nothing", rt);
  8916.  }
  8917.  
  8918.  return J0("nothing", rt);
  8919. }
  8920.  
  8921. void installNothingMethods(I12 *type, K9 *rt) {
  8922.  B2();
  8923.  type->S7(N4::U6(rt),
  8924.  Z9::C0(true, nothing_U6, nullptr, rt));
  8925. }
  8926.  
  8927. K5::K5(K9 *rt)
  8928.  : I12(rt) {
  8929.  B2();
  8930.  this->G12 = NothingEqL9;
  8931.  this->I11 = NothingNeqL9;
  8932. }
  8933.  
  8934. J10 *K5::create(K9 *rt) {
  8935.  B2();
  8936.  G8 *ins = new K2(rt);
  8937.  J10 *obj = new J10(true, ins, this, rt);
  8938.  return obj;
  8939. }
  8940.  
  8941. std::string K5::userRepr(K9 *rt) {
  8942.  B2();
  8943.  if (this == nullptr) {
  8944.  return "K5(nullptr)";
  8945.  }
  8946.  return "K5";
  8947. }
  8948.  
  8949. J10 *K5::copy(J10 *obj, K9 *rt) {
  8950.  B2();
  8951.  rt->O2(obj, rt->E3.nothing);
  8952.  if (obj->H8 == nullptr) {
  8953.  return new J10(false, nullptr, this, rt);
  8954.  }
  8955.  auto ins = obj->H8->copy(rt);
  8956.  auto res = new J10(true, ins, this, rt);
  8957.  return res;
  8958. }
  8959.  
  8960. J10 *H0(K9 *rt) {
  8961.  B2();
  8962.  auto res = rt->make(rt->E3.nothing, rt->INSTANCE_OBJECT);
  8963.  return res;
  8964. }
  8965. }
  8966.  
  8967.  
  8968.  
  8969. namespace H10::Z9 {
  8970. L4::L4(K9 *rt)
  8971.  : G8(rt, sizeof(L4)) {
  8972.  B2();
  8973.  this->N11 = 0;
  8974. }
  8975.  
  8976. L4::~L4() {
  8977.  B2();
  8978. }
  8979.  
  8980. G8 *L4::copy(K9 *rt) {
  8981.  B2();
  8982.  G8 *res = new L4(rt);
  8983.  
  8984.  if (res == nullptr) {
  8985.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  8986.  }
  8987.  icast(res, L4)->N11 = this->N11;
  8988.  return res;
  8989. }
  8990.  
  8991. std::string L4::userRepr(K9 *rt) {
  8992.  B2();
  8993.  if (this == nullptr) {
  8994.  return "Real(nullptr)";
  8995.  }
  8996.  return "Real(N11 = " + std::to_string(this->N11) + ")";
  8997. }
  8998.  
  8999. size_t L4::getSize() {
  9000.  B2();
  9001.  return sizeof(L4);
  9002. }
  9003.  
  9004. size_t D9::getG8Size() {
  9005.  B2();
  9006.  return sizeof(L4);
  9007. }
  9008.  
  9009. static J10 *RealPositiveL9(J10 *self, K9 *rt, bool I0) {
  9010.  B2();
  9011.  
  9012.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9013.  
  9014.  if (!I0) {
  9015.  return nullptr;
  9016.  }
  9017.  
  9018.  auto res = self->type->copy(self, rt);
  9019.  return res;
  9020. }
  9021.  
  9022. static J10 *RealNegativeL9(J10 *self, K9 *rt, bool I0) {
  9023.  B2();
  9024.  
  9025.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9026.  
  9027.  if (!I0) {
  9028.  return nullptr;
  9029.  }
  9030.  
  9031.  auto res = self->type->copy(self, rt);
  9032.  Z1(res) *= -1;
  9033.  return res;
  9034. }
  9035.  
  9036. static J10 *RealMultL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9037.  B2();
  9038.  
  9039.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9040.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9041.  
  9042.  if (!I0) {
  9043.  return nullptr;
  9044.  }
  9045.  
  9046.  auto res = makeL4J10(Z1(self) * Z1(arg), rt);
  9047.  return res;
  9048. }
  9049.  
  9050. static J10 *RealDivL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9051.  B2();
  9052.  
  9053.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9054.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9055.  
  9056.  if (!I0) {
  9057.  return nullptr;
  9058.  }
  9059.  
  9060.  auto res = makeL4J10(Z1(self) / Z1(arg), rt);
  9061.  return res;
  9062. }
  9063.  
  9064. static J10 *RealAddL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9065.  B2();
  9066.  
  9067.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9068.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9069.  
  9070.  if (!I0) {
  9071.  return nullptr;
  9072.  }
  9073.  
  9074.  auto res = makeL4J10(Z1(self) + Z1(arg), rt);
  9075.  return res;
  9076. }
  9077.  
  9078. static J10 *RealSubL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9079.  B2();
  9080.  
  9081.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9082.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9083.  
  9084.  if (!I0) {
  9085.  return nullptr;
  9086.  }
  9087.  
  9088.  auto res = makeL4J10(Z1(self) - Z1(arg), rt);
  9089.  return res;
  9090. }
  9091.  
  9092. static J10 *RealLtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9093.  B2();
  9094.  
  9095.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9096.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9097.  
  9098.  return rt->R1(Z1(self) < Z1(arg));
  9099. }
  9100.  
  9101. static J10 *RealLeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9102.  B2();
  9103.  
  9104.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9105.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9106.  
  9107.  return rt->R1(Z1(self) <= Z1(arg));
  9108. }
  9109.  
  9110. static J10 *RealGtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9111.  B2();
  9112.  
  9113.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9114.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9115.  
  9116.  return rt->R1(Z1(self) > Z1(arg));
  9117. }
  9118.  
  9119. static J10 *RealGeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9120.  B2();
  9121.  
  9122.  rt->M0(self, rt->E3.real, K9::SUB0_CTX);
  9123.  rt->M0(arg, rt->E3.real, K9::SUB1_CTX);
  9124.  
  9125.  return rt->R1(Z1(self) >= Z1(arg));
  9126. }
  9127.  
  9128. static J10 *RealEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9129.  B2();
  9130.  rt->O2(self, rt->E3.real, K9::SUB0_CTX);
  9131.  rt->U0(arg, K9::SUB1_CTX);
  9132.  
  9133.  if (!rt->F8(arg, rt->E3.real)) {
  9134.  return rt->R1(false);
  9135.  }
  9136.  
  9137.  if (rt->Q1(self, rt->E3.real)) {
  9138.  if (!rt->Q1(arg, rt->E3.real)) {
  9139.  return rt->R1(false);
  9140.  }
  9141.  return rt->R1(Z1(self) == Z1(arg));
  9142.  }
  9143.  else if (rt->B4(self, rt->E3.real)) {
  9144.  if (!rt->B4(arg, rt->E3.real)) {
  9145.  return rt->R1(false);
  9146.  }
  9147.  return rt->R1(true);
  9148.  }
  9149.  
  9150.  return rt->R1(false);
  9151. }
  9152.  
  9153. static J10 *RealNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9154.  B2();
  9155.  auto res = RealEqL9(self, arg, rt, I0);
  9156.  return rt->R1(!W0(res));
  9157. }
  9158.  
  9159. static J10 *real_S6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9160.  B2();
  9161.  rt->A0(args, 0);
  9162.  auto self = args[0];
  9163.  rt->M0(self, rt->E3.real, K9::SUB1_CTX);
  9164.  
  9165.  if (!I0) {
  9166.  return self;
  9167.  }
  9168.  
  9169.  return rt->R1(Z1(self));
  9170. }
  9171.  
  9172. static J10 *real_T6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9173.  B2();
  9174.  rt->A0(args, 0);
  9175.  auto self = args[0];
  9176.  rt->M0(self, rt->E3.real, K9::SUB1_CTX);
  9177.  
  9178.  if (!I0) {
  9179.  return self;
  9180.  }
  9181.  
  9182.  return B0(Z1(self), rt);
  9183. }
  9184.  
  9185. static J10 *real_W7(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9186.  B2();
  9187.  rt->A0(args, 0);
  9188.  auto self = args[0];
  9189.  rt->M0(self, rt->E3.real, K9::SUB1_CTX);
  9190.  
  9191.  if (!I0) {
  9192.  return self;
  9193.  }
  9194.  
  9195.  return G0(Z1(self), rt);
  9196. }
  9197.  
  9198. static J10 *real_mm__real__(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9199.  B2();
  9200.  rt->A0(args, 0);
  9201.  auto self = args[0];
  9202.  rt->M0(self, rt->E3.real, K9::SUB1_CTX);
  9203.  
  9204.  if (!I0) {
  9205.  return self;
  9206.  }
  9207.  
  9208.  return makeL4J10(Z1(self), rt);
  9209. }
  9210.  
  9211. static J10 *real_S4(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9212.  B2();
  9213.  rt->A0(args, 0);
  9214.  auto self = args[0];
  9215.  rt->M0(self, rt->E3.real, K9::SUB1_CTX);
  9216.  
  9217.  if (!I0) {
  9218.  return self;
  9219.  }
  9220.  
  9221.  return J0(std::to_string(Z1(self)), rt);
  9222. }
  9223.  
  9224. static J10 *real_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9225.  B2();
  9226.  rt->A0(args, 0);
  9227.  auto self = args[0];
  9228.  rt->O2(self, rt->E3.real, K9::SUB1_CTX);
  9229.  
  9230.  if (!I0) {
  9231.  return self;
  9232.  }
  9233.  
  9234.  if (rt->B4(self, nullptr)) {
  9235.  return J0("Real", rt);
  9236.  }
  9237.  
  9238.  return J0(std::to_string(Z1(self)), rt);
  9239. }
  9240.  
  9241. static J10 *real_V6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9242.  B2();
  9243.  rt->A0(args, 0);
  9244.  auto self = args[0];
  9245.  rt->O2(self, rt->E3.real, K9::SUB1_CTX);
  9246.  
  9247.  double v;
  9248.  std::cin >> v;
  9249.  
  9250.  if (!I0) {
  9251.  return self;
  9252.  }
  9253.  
  9254.  return makeL4J10(v, rt);
  9255. }
  9256.  
  9257. void installRealMethods(I12 *type, K9 *rt) {
  9258.  B2();
  9259.  type->S7(N4::S6(rt),
  9260.  Z9::C0(true, real_S6, nullptr, rt));
  9261.  type->S7(N4::T6(rt),
  9262.  Z9::C0(true, real_T6, nullptr, rt));
  9263.  type->S7(N4::W7(rt),
  9264.  Z9::C0(true, real_W7, nullptr, rt));
  9265.  type->S7(N4::mm__real__(rt),
  9266.  Z9::C0(true, real_mm__real__, nullptr, rt));
  9267.  type->S7(N4::S4(rt),
  9268.  Z9::C0(true, real_S4, nullptr, rt));
  9269.  type->S7(N4::U6(rt),
  9270.  Z9::C0(true, real_U6, nullptr, rt));
  9271.  type->S7(N4::V6(rt),
  9272.  Z9::C0(true, real_V6, nullptr, rt));
  9273. }
  9274.  
  9275. D9::D9(K9 *rt)
  9276.  : I12(rt) {
  9277.  B2();
  9278.  this->O5 = RealPositiveL9;
  9279.  this->P5 = RealNegativeL9;
  9280.  this->F10 = RealMultL9;
  9281.  this->C11 = RealDivL9;
  9282.  this->E11 = RealAddL9;
  9283.  this->F11 = RealSubL9;
  9284.  this->E12 = RealLtL9;
  9285.  this->G11 = RealLeqL9;
  9286.  this->F12 = RealGtL9;
  9287.  this->H11 = RealGeqL9;
  9288.  this->G12 = RealEqL9;
  9289.  this->I11 = RealNeqL9;
  9290. }
  9291.  
  9292. J10 *D9::create(K9 *rt) {
  9293.  B2();
  9294.  G8 *ins = new L4(rt);
  9295.  J10 *obj = new J10(true, ins, this, rt);
  9296.  return obj;
  9297. }
  9298.  
  9299. J10 *D9::copy(J10 *obj, K9 *rt) {
  9300.  B2();
  9301.  rt->O2(obj, rt->E3.real);
  9302.  if (obj->H8 == nullptr) {
  9303.  return new J10(false, nullptr, this, rt);
  9304.  }
  9305.  auto ins = obj->H8->copy(rt);
  9306.  auto res = new J10(true, ins, this, rt);
  9307.  return res;
  9308. }
  9309.  
  9310. std::string D9::userRepr(K9 *rt) {
  9311.  B2();
  9312.  if (this == nullptr) {
  9313.  return "D9(nullptr)";
  9314.  }
  9315.  return "D9";
  9316. }
  9317.  
  9318. double &getRealValue(J10 *obj, K9 *rt) {
  9319.  B2();
  9320.  rt->M0(obj, rt->E3.real);
  9321.  return icast(obj->H8, H10::Z9::L4)->N11;
  9322. }
  9323.  
  9324. double &getRealValue(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  9325.  B2();
  9326.  rt->M0(obj, rt->E3.real, K9::SUB0_CTX);
  9327.  return icast(obj->H8, H10::Z9::L4)->N11;
  9328. }
  9329.  
  9330. J10 *makeL4J10(double N11, K9 *rt) {
  9331.  B2();
  9332.  auto res = rt->make(rt->E3.real, K9::INSTANCE_OBJECT);
  9333.  icast(res->H8, L4)->N11 = N11;
  9334.  return res;
  9335. }
  9336.  
  9337. }
  9338.  
  9339.  
  9340.  
  9341.  
  9342. namespace H10::Z9 {
  9343.  
  9344. RecordG8::RecordG8(K9 *rt)
  9345.  : G8(rt, sizeof(RecordG8)) {
  9346.  B2();
  9347. }
  9348.  
  9349. RecordG8::~RecordG8() {
  9350.  B2();
  9351. }
  9352.  
  9353. J10 *RecordG8::selectField(I10 id, K9 *rt) {
  9354.  B2();
  9355.  auto it = this->Q10.find(id);
  9356.  if (it != this->Q10.end()) {
  9357.  return it->second;
  9358.  }
  9359.  rt->T4(this->userRepr(rt) + "doesn't have S11 " + rt->S12->R7(id), rt->R5().area);
  9360. }
  9361.  
  9362. bool RecordG8::hasField(I10 id, K9 *rt) {
  9363.  B2();
  9364.  return this->Q10.find(id) != this->Q10.end();
  9365. }
  9366.  
  9367. void RecordG8::addField(I10 id, J10 *obj, K9 *rt) {
  9368.  B2();
  9369.  this->Q10[id] = obj;
  9370. }
  9371.  
  9372. G8 *RecordG8::copy(K9 *rt) {
  9373.  B2();
  9374.  return this; }
  9375.  
  9376. size_t RecordG8::getSize() {
  9377.  B2();
  9378.  return sizeof(RecordG8);
  9379. }
  9380.  
  9381. size_t RecordI12::getG8Size() {
  9382.  B2();
  9383.  return sizeof(RecordG8);
  9384. }
  9385.  
  9386. std::string RecordG8::userRepr(K9 *rt) {
  9387.  B2();
  9388.  if (this == nullptr) {
  9389.  return "Record(nullptr)";
  9390.  }
  9391.  return rt->S12->R7(this->Y10);
  9392. }
  9393.  
  9394. std::vector<J10 *> RecordG8::getGCReachable() {
  9395.  B2();
  9396.  std::vector<J10 *> res;
  9397.  for (auto S11 : this->Q10) {
  9398.  res.push_back(S11.second);
  9399.  }
  9400.  return res;
  9401. }
  9402.  
  9403. RecordI12::RecordI12(K9 *rt)
  9404.  : I12(rt) {
  9405.  B2();
  9406. }
  9407.  
  9408. J10 *RecordI12::create(K9 *rt) {
  9409.  B2();
  9410.  auto ins = new RecordG8(rt);
  9411.  ins->Y10 = this->Y10;
  9412.  for (auto f : this->H8_Q10) {
  9413.  ins->addField(f, H0(rt), rt);
  9414.  }
  9415.  J10 *obj = new J10(true, ins, this, rt);
  9416.  
  9417.  return obj;
  9418. }
  9419.  
  9420. std::string RecordI12::userRepr(K9 *rt) {
  9421.  B2();
  9422.  if (this == nullptr) {
  9423.  return "nullptr";
  9424.  }
  9425.  return rt->S12->R7(this->Y10);
  9426. }
  9427.  
  9428.  
  9429. J10 *RecordI12::copy(J10 *obj, K9 *rt) {
  9430.  B2();
  9431.  rt->U0(obj);
  9432.  if (obj->H8 == nullptr) {
  9433.  return new J10(false, nullptr, this, rt);
  9434.  }
  9435.  auto ins = obj->H8->copy(rt);
  9436.  auto res = new J10(true, ins, this, rt);
  9437.  return res;
  9438. }
  9439.  
  9440. J10 *makeRecordG8J10(K9 *rt) {
  9441.  B2();
  9442.  auto res = rt->make(rt->E3.nothing, rt->INSTANCE_OBJECT);
  9443.  return res;
  9444. }
  9445.  
  9446. RecordI12 *makeRecordI12(I10 Y10, K9 *rt) {
  9447.  B2();
  9448.  auto res = new RecordI12(rt);
  9449.  res->Y10 = Y10;
  9450.  return res;
  9451. }
  9452. }
  9453.  
  9454.  
  9455.  
  9456. namespace H10::Z9 {
  9457. I2::I2(K9 *rt)
  9458.  : G8(rt, sizeof(I2)) {
  9459.  B2();
  9460.  this->N11 = false;
  9461. }
  9462.  
  9463. I2::~I2() {
  9464.  B2();
  9465. }
  9466.  
  9467. G8 *I2::copy(K9 *rt) {
  9468.  B2();
  9469.  G8 *res = new I2(rt);
  9470.  if (res == nullptr) {
  9471.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  9472.  }
  9473.  icast(res, I2)->N11 = this->N11;
  9474.  return res;
  9475. }
  9476.  
  9477. std::string I2::userRepr(K9 *rt) {
  9478.  B2();
  9479.  if (this == nullptr) {
  9480.  return "Boolean(nullptr)";
  9481.  }
  9482.  return std::string("Boolean(N11 = ") + (this->N11 ? "true" : "false") + ")";
  9483. }
  9484.  
  9485. size_t I2::getSize() {
  9486.  B2();
  9487.  return sizeof(I2);
  9488. }
  9489.  
  9490. size_t I5::getG8Size() {
  9491.  B2();
  9492.  return sizeof(I2);
  9493. }
  9494.  
  9495. static J10 *BooleanNotL9(J10 *self, K9 *rt, bool I0) {
  9496.  B2();
  9497.  rt->M0(self, rt->E3.boolean, K9::SUB0_CTX);
  9498.  
  9499.  return (!W0(self)) ? rt->R1(true) : rt->R1(false);
  9500. }
  9501.  
  9502. static J10 *BooleanEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9503.  B2();
  9504.  rt->O2(self, rt->E3.boolean, K9::SUB0_CTX);
  9505.  rt->U0(arg, K9::SUB1_CTX);
  9506.  
  9507.  if (!rt->F8(arg, rt->E3.boolean)) {
  9508.  return rt->R1(false);
  9509.  }
  9510.  
  9511.  if (rt->Q1(self, rt->E3.boolean)) {
  9512.  if (!rt->Q1(arg, rt->E3.boolean)) {
  9513.  return rt->R1(false);
  9514.  }
  9515.  return rt->R1(W0(self) == W0(arg));
  9516.  }
  9517.  else if (rt->B4(self, rt->E3.boolean)) {
  9518.  if (!rt->B4(arg, rt->E3.boolean)) {
  9519.  return rt->R1(false);
  9520.  }
  9521.  return rt->R1(true);
  9522.  }
  9523.  
  9524.  return rt->R1(false);
  9525. }
  9526.  
  9527. static J10 *BooleanNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9528.  B2();
  9529.  auto res = BooleanEqL9(self, arg, rt, I0);
  9530.  return (!getBooleanValue(res, rt)) ? rt->R1(true) : rt->R1(false);
  9531. }
  9532.  
  9533. static J10 *BooleanAndL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9534.  B2();
  9535.  rt->M0(self, rt->E3.boolean, K9::SUB0_CTX);
  9536.  rt->M0(arg, rt->E3.boolean, K9::SUB1_CTX);
  9537.  
  9538.  return rt->R1(W0(self) && W0(arg));
  9539. }
  9540.  
  9541. static J10 *BooleanOrL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9542.  B2();
  9543.  rt->M0(self, rt->E3.boolean, K9::SUB0_CTX);
  9544.  rt->M0(arg, rt->E3.boolean, K9::SUB1_CTX);
  9545.  
  9546.  return rt->R1(W0(self) || W0(arg));
  9547. }
  9548.  
  9549. static J10 *boolean_S6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9550.  B2();
  9551.  rt->A0(args, 0);
  9552.  auto self = args[0];
  9553.  rt->M0(self, rt->E3.boolean, K9::SUB1_CTX);
  9554.  
  9555.  if (!I0) {
  9556.  return self;
  9557.  }
  9558.  
  9559.  if (rt->B4(self, nullptr)) {
  9560.  return rt->R1(false);
  9561.  }
  9562.  
  9563.  return self;
  9564. }
  9565.  
  9566. static J10 *boolean_T6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9567.  B2();
  9568.  rt->A0(args, 0);
  9569.  auto self = args[0];
  9570.  rt->M0(self, rt->E3.boolean, K9::SUB1_CTX);
  9571.  
  9572.  if (!I0) {
  9573.  return self;
  9574.  }
  9575.  
  9576.  return B0('0' + W0(self), rt);
  9577. }
  9578.  
  9579. static J10 *boolean_W7(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9580.  B2();
  9581.  rt->A0(args, 0);
  9582.  auto self = args[0];
  9583.  rt->M0(self, rt->E3.boolean, K9::SUB1_CTX);
  9584.  
  9585.  if (!I0) {
  9586.  return self;
  9587.  }
  9588.  
  9589.  return G0(W0(self), rt);
  9590. }
  9591.  
  9592. static J10 *boolean_mm__real__(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9593.  B2();
  9594.  rt->A0(args, 0);
  9595.  auto self = args[0];
  9596.  rt->M0(self, rt->E3.boolean, K9::SUB1_CTX);
  9597.  
  9598.  if (!I0) {
  9599.  return self;
  9600.  }
  9601.  
  9602.  return makeL4J10(W0(self), rt);
  9603. }
  9604.  
  9605. static J10 *boolean_S4(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9606.  B2();
  9607.  rt->A0(args, 0);
  9608.  auto self = args[0];
  9609.  rt->O2(self, rt->E3.boolean, K9::SUB1_CTX);
  9610.  
  9611.  if (!I0) {
  9612.  return self;
  9613.  }
  9614.  
  9615.  if (rt->B4(self, nullptr)) {
  9616.  return J0("Boolean", rt);
  9617.  }
  9618.  
  9619.  return J0(W0(self) ? "true" : "false", rt);
  9620. }
  9621.  
  9622. static J10 *boolean_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9623.  B2();
  9624.  rt->A0(args, 0);
  9625.  auto self = args[0];
  9626.  rt->O2(self, rt->E3.boolean, K9::SUB1_CTX);
  9627.  
  9628.  if (!I0) {
  9629.  return self;
  9630.  }
  9631.  
  9632.  if (rt->B4(self, nullptr)) {
  9633.  return J0("Boolean", rt);
  9634.  }
  9635.  
  9636.  return J0(W0(self) ? "true" : "false", rt);
  9637. }
  9638.  
  9639. static J10 *boolean_V6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  9640.  B2();
  9641.  rt->A0(args, 0);
  9642.  auto self = args[0];
  9643.  rt->O2(self, rt->E3.boolean, K9::SUB1_CTX);
  9644.  
  9645.  std::string s;
  9646.  std::cin >> s;
  9647.  
  9648.  if (!I0) {
  9649.  return self;
  9650.  }
  9651.  
  9652.  if (s == "true") {
  9653.  return rt->R1(true);
  9654.  }
  9655.  else if (s == "false") {
  9656.  return rt->R1(false);
  9657.  }
  9658.  rt->T4("Not a Boolean: " + s, rt->R5().area);
  9659. }
  9660.  
  9661. void installBooleanMethods(I12 *type, K9 *rt) {
  9662.  B2();
  9663.  type->S7(N4::S6(rt),
  9664.  Z9::C0(true, boolean_S6, nullptr, rt));
  9665.  type->S7(N4::T6(rt),
  9666.  Z9::C0(true, boolean_T6, nullptr, rt));
  9667.  type->S7(N4::W7(rt),
  9668.  Z9::C0(true, boolean_W7, nullptr, rt));
  9669.  type->S7(N4::mm__real__(rt),
  9670.  Z9::C0(true, boolean_mm__real__, nullptr, rt));
  9671.  type->S7(N4::S4(rt),
  9672.  Z9::C0(true, boolean_S4, nullptr, rt));
  9673.  type->S7(N4::U6(rt),
  9674.  Z9::C0(true, boolean_U6, nullptr, rt));
  9675.  type->S7(N4::V6(rt),
  9676.  Z9::C0(true, boolean_V6, nullptr, rt));
  9677. }
  9678.  
  9679. I5::I5(K9 *rt)
  9680.  : I12(rt) {
  9681.  B2();
  9682.  
  9683.  this->B11 = BooleanNotL9;
  9684.  this->G12 = BooleanEqL9;
  9685.  this->I11 = BooleanNeqL9;
  9686.  this->J11 = BooleanAndL9;
  9687.  this->H12 = BooleanOrL9;
  9688. }
  9689.  
  9690. J10 *I5::create(K9 *rt) {
  9691.  B2();
  9692.  G8 *ins = new I2(rt);
  9693.  J10 *obj = new J10(true, ins, this, rt);
  9694.  return obj;
  9695. }
  9696.  
  9697. J10 *I5::copy(J10 *obj, K9 *rt) {
  9698.  B2();
  9699.  rt->O2(obj, rt->E3.boolean);
  9700.  if (obj->H8 == nullptr) {
  9701.  return new J10(false, nullptr, this, rt);
  9702.  }
  9703.  auto ins = obj->H8->copy(rt);
  9704.  auto res = new J10(true, ins, this, rt);
  9705.  return res;
  9706. }
  9707.  
  9708. std::string I5::userRepr(K9 *rt) {
  9709.  B2();
  9710.  if (this == nullptr) {
  9711.  return "I5(nullptr)";
  9712.  }
  9713.  return "I5";
  9714. }
  9715.  
  9716. bool &getBooleanValue(J10 *obj, K9 *rt) {
  9717.  B2();
  9718.  rt->M0(obj, rt->E3.boolean);
  9719.  return icast(obj->H8, H10::Z9::I2)->N11;
  9720. }
  9721.  
  9722. bool &getBooleanValue(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  9723.  B2();
  9724.  rt->M0(obj, rt->E3.boolean, K9::SUB0_CTX);
  9725.  return icast(obj->H8, H10::Z9::I2)->N11;
  9726. }
  9727.  
  9728. J10 *F0(bool N11, K9 *rt) {
  9729.  B2();
  9730.  auto res = rt->make(rt->E3.boolean, K9::INSTANCE_OBJECT);
  9731.  icast(res->H8, I2)->N11 = N11;
  9732.  return res;
  9733. }
  9734.  
  9735. }
  9736.  
  9737.  
  9738.  
  9739. namespace H10::Z9 {
  9740. J2::J2(K9 *rt)
  9741.  : G8(rt, sizeof(J2)) {
  9742.  B2();
  9743.  this->N11 = 0;
  9744. }
  9745.  
  9746. J2::~J2() {
  9747.  B2();
  9748. }
  9749.  
  9750. G8 *J2::copy(K9 *rt) {
  9751.  B2();
  9752.  G8 *res = new J2(rt);
  9753.  
  9754.  if (res == nullptr) {
  9755.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  9756.  }
  9757.  icast(res, J2)->N11 = this->N11;
  9758.  return res;
  9759. }
  9760.  
  9761. std::string J2::userRepr(K9 *rt) {
  9762.  B2();
  9763.  if (this == nullptr) {
  9764.  return "Integer(nullptr)";
  9765.  }
  9766.  return "Integer(N11 = " + std::to_string(this->N11) + ")";
  9767. }
  9768.  
  9769. size_t J2::getSize() {
  9770.  B2();
  9771.  return sizeof(J2);
  9772. }
  9773.  
  9774. size_t J5::getG8Size() {
  9775.  B2();
  9776.  return sizeof(J2);
  9777. }
  9778.  
  9779. static J10 *IntegerPostincL9(J10 *self, K9 *rt, bool I0) {
  9780.  B2();
  9781.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9782.  
  9783.  if (!I0) {
  9784.  V0(self)++;
  9785.  return nullptr;
  9786.  }
  9787.  
  9788.  auto res = self->type->copy(self, rt);
  9789.  V0(self)++;
  9790.  return res;
  9791. }
  9792.  
  9793. static J10 *IntegerPostdecL9(J10 *self, K9 *rt, bool I0) {
  9794.  B2();
  9795.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9796.  
  9797.  if (!I0) {
  9798.  V0(self)--;
  9799.  return nullptr;
  9800.  }
  9801.  
  9802.  auto res = self->type->copy(self, rt);
  9803.  V0(self)--;
  9804.  return res;
  9805. }
  9806.  
  9807. static J10 *IntegerPreincL9(J10 *self, K9 *rt, bool I0) {
  9808.  B2();
  9809.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9810.  
  9811.  if (!I0) {
  9812.  V0(self)++;
  9813.  return nullptr;
  9814.  }
  9815.  
  9816.  V0(self)++;
  9817.  auto res = self->type->copy(self, rt);
  9818.  return res;
  9819. }
  9820.  
  9821. static J10 *IntegerPredecL9(J10 *self, K9 *rt, bool I0) {
  9822.  B2();
  9823.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9824.  
  9825.  if (!I0) {
  9826.  V0(self)--;
  9827.  return nullptr;
  9828.  }
  9829.  
  9830.  V0(self)--;
  9831.  auto res = self->type->copy(self, rt);
  9832.  return res;
  9833. }
  9834.  
  9835. static J10 *IntegerPositiveL9(J10 *self, K9 *rt, bool I0) {
  9836.  B2();
  9837.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9838.  
  9839.  if (!I0) {
  9840.  return nullptr;
  9841.  }
  9842.  
  9843.  auto res = self->type->copy(self, rt);
  9844.  return res;
  9845. }
  9846.  
  9847. static J10 *IntegerNegativeL9(J10 *self, K9 *rt, bool I0) {
  9848.  B2();
  9849.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9850.  
  9851.  if (!I0) {
  9852.  return nullptr;
  9853.  }
  9854.  
  9855.  auto res = self->type->copy(self, rt);
  9856.  V0(res) *= -1;
  9857.  return res;
  9858. }
  9859.  
  9860. static J10 *IntegerInverseL9(J10 *self, K9 *rt, bool I0) {
  9861.  B2();
  9862.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9863.  
  9864.  if (!I0) {
  9865.  return nullptr;
  9866.  }
  9867.  
  9868.  auto res = self->type->copy(self, rt);
  9869.  V0(res) = ~V0(res);
  9870.  return res;
  9871. }
  9872.  
  9873. static J10 *IntegerMultL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9874.  B2();
  9875.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9876.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9877.  
  9878.  if (!I0) {
  9879.  return nullptr;
  9880.  }
  9881.  
  9882.  auto res = G0(V0(self) * V0(arg), rt);
  9883.  return res;
  9884. }
  9885.  
  9886. static J10 *IntegerDivL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9887.  B2();
  9888.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9889.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9890.  
  9891.  if (!I0) {
  9892.  return nullptr;
  9893.  }
  9894.  
  9895.  auto res = G0(V0(self) / V0(arg), rt);
  9896.  return res;
  9897. }
  9898.  
  9899. static J10 *IntegerRemL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9900.  B2();
  9901.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9902.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9903.  
  9904.  if (!I0) {
  9905.  return nullptr;
  9906.  }
  9907.  
  9908.  auto res = G0(V0(self) % V0(arg), rt);
  9909.  return res;
  9910. }
  9911.  
  9912. static J10 *IntegerRshiftL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9913.  B2();
  9914.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9915.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9916.  
  9917.  if (!I0) {
  9918.  return nullptr;
  9919.  }
  9920.  
  9921.  auto res = G0(V0(self) >> V0(arg), rt);
  9922.  return res;
  9923. }
  9924.  
  9925. static J10 *IntegerLshiftL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9926.  B2();
  9927.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9928.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9929.  
  9930.  if (!I0) {
  9931.  return nullptr;
  9932.  }
  9933.  
  9934.  auto res = G0(V0(self) << V0(arg), rt);
  9935.  return res;
  9936. }
  9937.  
  9938. static J10 *IntegerAddL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9939.  B2();
  9940.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9941.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9942.  
  9943.  if (!I0) {
  9944.  return nullptr;
  9945.  }
  9946.  
  9947.  auto res = G0(V0(self) + V0(arg), rt);
  9948.  return res;
  9949. }
  9950.  
  9951. static J10 *IntegerSubL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9952.  B2();
  9953.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9954.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9955.  
  9956.  if (!I0) {
  9957.  return nullptr;
  9958.  }
  9959.  
  9960.  auto res = G0(V0(self) - V0(arg), rt);
  9961.  return res;
  9962. }
  9963.  
  9964. static J10 *IntegerLtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9965.  B2();
  9966.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9967.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9968.  
  9969.  return rt->R1(V0(self) < V0(arg));
  9970. }
  9971.  
  9972. static J10 *IntegerLeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9973.  B2();
  9974.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9975.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9976.  
  9977.  return rt->R1(V0(self) <= V0(arg));
  9978. }
  9979.  
  9980. static J10 *IntegerGtL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9981.  B2();
  9982.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9983.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9984.  
  9985.  return rt->R1(V0(self) > V0(arg));
  9986. }
  9987.  
  9988. static J10 *IntegerGeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9989.  B2();
  9990.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  9991.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  9992.  
  9993.  return rt->R1(V0(self) >= V0(arg));
  9994. }
  9995.  
  9996. static J10 *IntegerEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  9997.  B2();
  9998.  rt->O2(self, rt->E3.integer, K9::SUB0_CTX);
  9999.  rt->U0(arg, K9::SUB1_CTX);
  10000.  
  10001.  if (!rt->F8(arg, rt->E3.integer)) {
  10002.  return rt->R1(false);
  10003.  }
  10004.  
  10005.  if (rt->Q1(self, rt->E3.integer)) {
  10006.  if (!rt->Q1(arg, rt->E3.integer)) {
  10007.  return rt->R1(false);
  10008.  }
  10009.  return rt->R1(V0(self) == V0(arg));
  10010.  }
  10011.  else if (rt->B4(self, rt->E3.integer)) {
  10012.  if (!rt->B4(arg, rt->E3.integer)) {
  10013.  return rt->R1(false);
  10014.  }
  10015.  return rt->R1(true);
  10016.  }
  10017.  
  10018.  return rt->R1(false);
  10019. }
  10020.  
  10021. static J10 *IntegerNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10022.  B2();
  10023.  auto res = IntegerEqL9(self, arg, rt, I0);
  10024.  return rt->R1(!W0(res));
  10025. }
  10026.  
  10027. static J10 *IntegerBitandL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10028.  B2();
  10029.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  10030.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  10031.  
  10032.  if (!I0) {
  10033.  return nullptr;
  10034.  }
  10035.  
  10036.  auto res = G0(V0(self) & V0(arg), rt);
  10037.  return res;
  10038. }
  10039.  
  10040. static J10 *IntegerBitxorL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10041.  B2();
  10042.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  10043.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  10044.  
  10045.  if (!I0) {
  10046.  return nullptr;
  10047.  }
  10048.  
  10049.  auto res = G0(V0(self) ^ V0(arg), rt);
  10050.  return res;
  10051. }
  10052.  
  10053. static J10 *IntegerBitorL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10054.  B2();
  10055.  rt->M0(self, rt->E3.integer, K9::SUB0_CTX);
  10056.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  10057.  
  10058.  if (!I0) {
  10059.  return nullptr;
  10060.  }
  10061.  
  10062.  auto res = G0(V0(self) | V0(arg), rt);
  10063.  return res;
  10064. }
  10065.  
  10066. static J10 *integer_S6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10067.  B2();
  10068.  rt->A0(args, 0);
  10069.  auto self = args[0];
  10070.  rt->M0(self, rt->E3.integer, K9::SUB1_CTX);
  10071.  
  10072.  if (!I0) {
  10073.  return self;
  10074.  }
  10075.  
  10076.  return rt->R1(V0(self));
  10077. }
  10078.  
  10079. static J10 *integer_T6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10080.  B2();
  10081.  rt->A0(args, 0);
  10082.  auto self = args[0];
  10083.  rt->M0(self, rt->E3.integer, K9::SUB1_CTX);
  10084.  
  10085.  if (!I0) {
  10086.  return self;
  10087.  }
  10088.  
  10089.  return B0(V0(self), rt);
  10090. }
  10091.  
  10092. static J10 *integer_W7(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10093.  B2();
  10094.  rt->A0(args, 0);
  10095.  auto self = args[0];
  10096.  rt->M0(self, rt->E3.integer, K9::SUB1_CTX);
  10097.  
  10098.  if (!I0) {
  10099.  return self;
  10100.  }
  10101.  
  10102.  return G0(V0(self), rt);
  10103. }
  10104.  
  10105. static J10 *integer_mm__real__(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10106.  B2();
  10107.  rt->A0(args, 0);
  10108.  auto self = args[0];
  10109.  rt->M0(self, rt->E3.integer, K9::SUB1_CTX);
  10110.  
  10111.  if (!I0) {
  10112.  return self;
  10113.  }
  10114.  
  10115.  return makeL4J10(V0(self), rt);
  10116. }
  10117.  
  10118. static J10 *integer_S4(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10119.  B2();
  10120.  rt->A0(args, 0);
  10121.  auto self = args[0];
  10122.  rt->M0(self, rt->E3.integer, K9::SUB1_CTX);
  10123.  
  10124.  if (!I0) {
  10125.  return self;
  10126.  }
  10127.  
  10128.  return J0(std::to_string(V0(self)), rt);
  10129. }
  10130.  
  10131. static J10 *integer_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10132.  B2();
  10133.  rt->A0(args, 0);
  10134.  auto self = args[0];
  10135.  rt->O2(self, rt->E3.integer, K9::SUB1_CTX);
  10136.  
  10137.  if (!I0) {
  10138.  return self;
  10139.  }
  10140.  
  10141.  if (rt->B4(self, nullptr)) {
  10142.  return J0("Integer", rt);
  10143.  }
  10144.  
  10145.  return J0(std::to_string(V0(self)), rt);
  10146. }
  10147.  
  10148. static J10 *integer_V6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10149.  B2();
  10150.  rt->A0(args, 0);
  10151.  auto self = args[0];
  10152.  rt->O2(self, rt->E3.integer, K9::SUB1_CTX);
  10153.  
  10154.  int64_t v;
  10155.  std::cin >> v;
  10156.  
  10157.  if (!I0) {
  10158.  return self;
  10159.  }
  10160.  
  10161.  return G0(v, rt);
  10162. }
  10163.  
  10164. void installIntegerMethods(I12 *type, K9 *rt) {
  10165.  B2();
  10166.  type->S7(N4::S6(rt),
  10167.  Z9::C0(true, integer_S6, nullptr, rt));
  10168.  type->S7(N4::T6(rt),
  10169.  Z9::C0(true, integer_T6, nullptr, rt));
  10170.  type->S7(N4::W7(rt),
  10171.  Z9::C0(true, integer_W7, nullptr, rt));
  10172.  type->S7(N4::mm__real__(rt),
  10173.  Z9::C0(true, integer_mm__real__, nullptr, rt));
  10174.  type->S7(N4::S4(rt),
  10175.  Z9::C0(true, integer_S4, nullptr, rt));
  10176.  type->S7(N4::U6(rt),
  10177.  Z9::C0(true, integer_U6, nullptr, rt));
  10178.  type->S7(N4::V6(rt),
  10179.  Z9::C0(true, integer_V6, nullptr, rt));
  10180. }
  10181.  
  10182. J5::J5(K9 *rt)
  10183.  : I12(rt) {
  10184.  B2();
  10185.  this->W6 = IntegerPostincL9;
  10186.  this->X6 = IntegerPostdecL9;
  10187.  this->Y7 = IntegerPreincL9;
  10188.  this->Z7 = IntegerPredecL9;
  10189.  this->O5 = IntegerPositiveL9;
  10190.  this->P5 = IntegerNegativeL9;
  10191.  this->Y6 = IntegerInverseL9;
  10192.  this->F10 = IntegerMultL9;
  10193.  this->C11 = IntegerDivL9;
  10194.  this->D11 = IntegerRemL9;
  10195.  this->A8 = IntegerRshiftL9;
  10196.  this->B8 = IntegerLshiftL9;
  10197.  this->E11 = IntegerAddL9;
  10198.  this->F11 = IntegerSubL9;
  10199.  this->E12 = IntegerLtL9;
  10200.  this->G11 = IntegerLeqL9;
  10201.  this->F12 = IntegerGtL9;
  10202.  this->H11 = IntegerGeqL9;
  10203.  this->G12 = IntegerEqL9;
  10204.  this->I11 = IntegerNeqL9;
  10205.  this->C8 = IntegerBitandL9;
  10206.  this->D8 = IntegerBitxorL9;
  10207.  this->I9 = IntegerBitorL9;
  10208. }
  10209.  
  10210. J10 *J5::create(K9 *rt) {
  10211.  B2();
  10212.  G8 *ins = new J2(rt);
  10213.  J10 *obj = new J10(true, ins, this, rt);
  10214.  return obj;
  10215. }
  10216.  
  10217. J10 *J5::copy(J10 *obj, K9 *rt) {
  10218.  B2();
  10219.  rt->O2(obj, rt->E3.integer);
  10220.  if (obj->H8 == nullptr) {
  10221.  return new J10(false, nullptr, this, rt);
  10222.  }
  10223.  auto ins = obj->H8->copy(rt);
  10224.  auto res = new J10(true, ins, this, rt);
  10225.  return res;
  10226. }
  10227.  
  10228. std::string J5::userRepr(K9 *rt) {
  10229.  B2();
  10230.  if (this == nullptr) {
  10231.  return "J5(nullptr)";
  10232.  }
  10233.  return "J5";
  10234. }
  10235.  
  10236. int64_t &getIntegerValue(J10 *obj, K9 *rt) {
  10237.  B2();
  10238.  rt->M0(obj, rt->E3.integer);
  10239.  return icast(obj->H8, H10::Z9::J2)->N11;
  10240. }
  10241.  
  10242. int64_t &getIntegerValue(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  10243.  B2();
  10244.  rt->M0(obj, rt->E3.integer, K9::SUB0_CTX);
  10245.  return icast(obj->H8, H10::Z9::J2)->N11;
  10246. }
  10247.  
  10248. J10 *G0(int64_t N11, K9 *rt) {
  10249.  B2();
  10250.  auto res = rt->make(rt->E3.integer, K9::INSTANCE_OBJECT);
  10251.  icast(res->H8, J2)->N11 = N11;
  10252.  return res;
  10253. }
  10254.  
  10255. }
  10256.  
  10257.  
  10258.  
  10259. namespace H10::Z9 {
  10260. U3::U3(K9 *rt)
  10261.  : G8(rt, sizeof(U3)) {
  10262.  B2();
  10263.  this->Q12 = {};
  10264. }
  10265.  
  10266. U3::~U3() {
  10267.  B2();
  10268. }
  10269.  
  10270. G8 *U3::copy(K9 *rt) {
  10271.  B2();
  10272.  G8 *res = new U3(rt);
  10273.  
  10274.  if (res == nullptr) {
  10275.  rt->T4("Failed to copy " + this->userRepr(rt), rt->R5().area);
  10276.  }
  10277.  for (auto obj : this->Q12) {
  10278.  ((U3 *)res)->Q12.push_back(rt->copy(obj));
  10279.  }
  10280.  return res;
  10281. }
  10282.  
  10283. std::string U3::userRepr(K9 *rt) {
  10284.  B2();
  10285.  if (this == nullptr) {
  10286.  return "Array(nullptr)";
  10287.  }
  10288.  return "Array(size = " + std::to_string(this->Q12.size()) + ", Q12 = ...)";
  10289. }
  10290.  
  10291. size_t U3::getSize() {
  10292.  B2();
  10293.  return sizeof(U3);
  10294. }
  10295.  
  10296. std::vector<J10 *> U3::getGCReachable() {
  10297.  B2();
  10298.  auto res = G8::getGCReachable();
  10299.  for (auto obj : this->Q12) {
  10300.  res.push_back(obj);
  10301.  }
  10302.  return res;
  10303. }
  10304.  
  10305. void U3::spreadSingleUse() {
  10306.  B2();
  10307.  for (auto obj : this->Q12) {
  10308.  obj->spreadSingleUse();
  10309.  }
  10310. }
  10311.  
  10312. void U3::Y2() {
  10313.  B2();
  10314.  for (auto obj : this->Q12) {
  10315.  obj->Y2();
  10316.  }
  10317. }
  10318.  
  10319. size_t Q7::getG8Size() {
  10320.  B2();
  10321.  return sizeof(U3);
  10322. }
  10323.  
  10324. static J10 *ArrayIndexL9(J10 *self, const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10325.  B2();
  10326.  
  10327.  rt->M0(self, rt->E3.array, K9::SUB0_CTX);
  10328.  rt->D0(args, 1);
  10329.  auto &arg = args[0];
  10330.  rt->M0(arg, rt->E3.integer, K9::SUB1_CTX);
  10331.  
  10332.  if (!(0 <= V0(arg) && V0(arg) < getArrayDataFast(self).size())) {
  10333.  rt->T4("Index " + arg->userRepr(rt) + " is out of array " + self->userRepr(rt) + " range", rt->R5().sub_areas[1]);
  10334.  }
  10335.  return getArrayDataFast(self)[V0(arg)];
  10336. }
  10337.  
  10338. static J10 *ArrayEqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10339.  B2();
  10340.  rt->O2(self, rt->E3.array, K9::SUB0_CTX);
  10341.  rt->U0(arg, K9::SUB1_CTX);
  10342.  
  10343.  if (!I0) {
  10344.  return rt->R1(false);
  10345.  }
  10346.  
  10347.  if (!rt->F8(arg, rt->E3.array)) {
  10348.  return rt->R1(false);
  10349.  }
  10350.  
  10351.  if (rt->Q1(self, rt->E3.array)) {
  10352.  if (!rt->Q1(arg, rt->E3.array)) {
  10353.  return rt->R1(false);
  10354.  }
  10355.  auto a1 = getArrayDataFast(self);
  10356.  auto a2 = getArrayDataFast(self);
  10357.  if (a1.size() != a2.size()) {
  10358.  return rt->R1(false);
  10359.  }
  10360.  for (int64_t i = 0; i < a1.size(); i++) {
  10361.  auto &ta = rt->R5().area;
  10362.  rt->S5();
  10363.  rt->R5().area = ta;
  10364.  rt->R5().sub_areas = {ta, ta};
  10365.  auto res = rt->H5(I4::V11, a1[i], a2[i], true);
  10366.  rt->T5();
  10367.  if (!W0(res)) {
  10368.  return rt->R1(false);
  10369.  }
  10370.  }
  10371.  return rt->R1(true);
  10372.  }
  10373.  else if (rt->B4(self, rt->E3.array)) {
  10374.  if (!rt->B4(arg, rt->E3.array)) {
  10375.  return rt->R1(false);
  10376.  }
  10377.  return rt->R1(true);
  10378.  }
  10379.  
  10380.  return rt->R1(false);
  10381. }
  10382.  
  10383. static J10 *ArrayNeqL9(J10 *self, J10 *arg, K9 *rt, bool I0) {
  10384.  B2();
  10385.  auto res = ArrayEqL9(self, arg, rt, I0);
  10386.  return rt->R1(!W0(res));
  10387. }
  10388.  
  10389. static J10 *arraySizeMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10390.  B2();
  10391.  rt->A0(args, 0);
  10392.  auto self = args[0];
  10393.  rt->M0(self, rt->E3.array, K9::SUB0_CTX);
  10394.  
  10395.  if (!I0) {
  10396.  return nullptr;
  10397.  }
  10398.  
  10399.  return G0(getArrayDataFast(self).size(), rt);
  10400. }
  10401.  
  10402. static J10 *arrayResizeMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10403.  B2();
  10404.  rt->A0(args, 1);
  10405.  auto self = args[0];
  10406.  auto new_size = args[1];
  10407.  rt->M0(self, rt->E3.array, K9::SUB0_CTX);
  10408.  rt->M0(new_size, rt->E3.integer, K9::SUB1_CTX);
  10409.  
  10410.  int64_t oldn = getArrayDataFast(self).size();
  10411.  int64_t newn = V0(new_size);
  10412.  if (newn <= 0) {
  10413.  rt->T4("New array size must be positive: " + new_size->userRepr(rt), rt->R5().sub_areas[1]);
  10414.  }
  10415.  getArrayDataFast(self).resize(newn);
  10416.  
  10417.  for (int64_t i = oldn; i < newn; i++) {
  10418.  getArrayDataFast(self)[i] = H0(rt);
  10419.  }
  10420.  
  10421.  if (!self->single_use) {
  10422.  self->Y2();
  10423.  }
  10424.  
  10425.  return self;
  10426. }
  10427.  
  10428. static J10 *arrayAppendMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10429.  rt->E0(args, 1);
  10430.  auto self = args[0];
  10431.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10432.  auto &Q12 = getArrayDataFast(self);
  10433.  for (int64_t i = 1; i < args.size(); i++) {
  10434.  rt->U0(args[i], (K9::ContextId)i);
  10435.  Q12.push_back(args[i]);
  10436.  }
  10437.  return self;
  10438. }
  10439.  
  10440. static J10 *arrayPrependMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10441.  rt->E0(args, 1);
  10442.  auto self = args[0];
  10443.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10444.  auto &Q12 = getArrayDataFast(self);
  10445.  std::vector<J10 *> pref;
  10446.  for (int64_t i = 1; i < args.size(); i++) {
  10447.  rt->U0(args[i], (K9::ContextId)i);
  10448.  pref.push_back(args[i]);
  10449.  }
  10450.  for (auto &item : Q12) {
  10451.  pref.push_back(item);
  10452.  }
  10453.  Q12 = pref;
  10454.  return self;
  10455. }
  10456.  
  10457. static J10 *arrayPoplastMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10458.  rt->A0(args, 0);
  10459.  auto self = args[0];
  10460.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10461.  auto &Q12 = getArrayDataFast(self);
  10462.  if (Q12.empty()) {
  10463.  return self;
  10464.  }
  10465.  Q12.pop_back();
  10466.  return self;
  10467. }
  10468.  
  10469. static J10 *arrayPopfirstMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10470.  rt->A0(args, 0);
  10471.  auto self = args[0];
  10472.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10473.  auto &Q12 = getArrayDataFast(self);
  10474.  if (Q12.empty()) {
  10475.  return self;
  10476.  }
  10477.  Q12.erase(Q12.begin());
  10478.  return self;
  10479. }
  10480.  
  10481. static J10 *arrayFirstMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10482.  rt->A0(args, 0);
  10483.  auto self = args[0];
  10484.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10485.  auto &Q12 = getArrayDataFast(self);
  10486.  if (Q12.empty()) {
  10487.  return rt->S1();
  10488.  }
  10489.  return Q12[0];
  10490. }
  10491.  
  10492. static J10 *arrayLastMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10493.  rt->A0(args, 0);
  10494.  auto self = args[0];
  10495.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10496.  auto &Q12 = getArrayDataFast(self);
  10497.  if (Q12.empty()) {
  10498.  return rt->S1();
  10499.  }
  10500.  return Q12.back();
  10501. }
  10502.  
  10503. static J10 *arrayEmptyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10504.  rt->A0(args, 0);
  10505.  auto self = args[0];
  10506.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10507.  auto &Q12 = getArrayDataFast(self);
  10508.  return rt->R1(Q12.empty());
  10509. }
  10510.  
  10511. static J10 *arrayClearMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10512.  rt->A0(args, 0);
  10513.  auto self = args[0];
  10514.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10515.  auto &Q12 = getArrayDataFast(self);
  10516.  Q12.clear();
  10517.  return self;
  10518. }
  10519.  
  10520. static J10 *arrayCopyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10521.  rt->A0(args, 0);
  10522.  auto self = args[0];
  10523.  
  10524.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10525.  return rt->copy(self);
  10526. }
  10527.  
  10528. static J10 *arrayFilterMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10529.  rt->A0(args, 1);
  10530.  auto self = args[0];
  10531.  auto arg = args[1];
  10532.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10533.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10534.  
  10535.  std::vector<J10 *> new_Q12;
  10536.  auto ctx = rt->R5();
  10537.  rt->S5();
  10538.  rt->R5().area = ctx.area;
  10539.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10540.  for (auto &obj : getArrayDataFast(self)) {
  10541.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10542.  if (getBooleanValue(res, rt)) {
  10543.  new_Q12.push_back(obj);
  10544.  }
  10545.  }
  10546.  rt->T5();
  10547.  
  10548.  getArrayDataFast(self) = new_Q12;
  10549.  return self;
  10550. }
  10551.  
  10552. static J10 *arrayApplyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10553.  rt->A0(args, 1);
  10554.  auto self = args[0];
  10555.  auto arg = args[1];
  10556.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10557.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10558.  
  10559.  auto ctx = rt->R5();
  10560.  rt->S5();
  10561.  rt->R5().area = ctx.area;
  10562.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10563.  for (auto &obj : getArrayDataFast(self)) {
  10564.  rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10565.  }
  10566.  rt->T5();
  10567.  
  10568.  return self;
  10569. }
  10570.  
  10571. static J10 *arrayReverseMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10572.  rt->A0(args, 0);
  10573.  auto self = args[0];
  10574.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10575.  
  10576.  std::reverse(getArrayDataFast(self).begin(), getArrayDataFast(self).end());
  10577.  return self;
  10578. }
  10579.  
  10580. static J10 *arraySortMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10581.  rt->A0(args, 1);
  10582.  auto self = args[0];
  10583.  auto arg = args[1];
  10584.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10585.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10586.  
  10587.  auto ctx = rt->R5();
  10588.  rt->S5();
  10589.  rt->R5().area = ctx.area;
  10590.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10591.  std::sort(getArrayDataFast(self).begin(), getArrayDataFast(self).end(), [rt, arg](const auto &a, const auto &b) {
  10592.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {a, b}, true);
  10593.  return getBooleanValue(res, rt);
  10594.  });
  10595.  rt->T5();
  10596.  return self;
  10597. }
  10598.  
  10599. static J10 *arrayCombineMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10600.  rt->A0(args, 2);
  10601.  auto self = args[0];
  10602.  auto arg = args[1];
  10603.  auto init = args[2];
  10604.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10605.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10606.  rt->U0(init, K9::SUB3_CTX);
  10607.  
  10608.  auto ctx = rt->R5();
  10609.  rt->S5();
  10610.  rt->R5().area = ctx.area;
  10611.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10612.  for (auto obj : getArrayDataFast(self)) {
  10613.  init = rt->H5(I4::J12, arg, std::vector<J10 *> {init, obj}, true);
  10614.  }
  10615.  rt->T5();
  10616.  return init;
  10617. }
  10618.  
  10619. static J10 *arrayFindfirstMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10620.  rt->A0(args, 1);
  10621.  auto self = args[0];
  10622.  auto arg = args[1];
  10623.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10624.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10625.  
  10626.  auto ctx = rt->R5();
  10627.  rt->S5();
  10628.  rt->R5().area = ctx.area;
  10629.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10630.  for (auto obj : getArrayDataFast(self)) {
  10631.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10632.  if (getBooleanValue(res, rt)) {
  10633.  rt->T5();
  10634.  return obj;
  10635.  }
  10636.  }
  10637.  rt->T5();
  10638.  return rt->S1();
  10639. }
  10640.  
  10641. static J10 *arrayFindlastMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10642.  rt->A0(args, 1);
  10643.  auto self = args[0];
  10644.  auto arg = args[1];
  10645.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10646.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10647.  
  10648.  auto ctx = rt->R5();
  10649.  rt->S5();
  10650.  rt->R5().area = ctx.area;
  10651.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10652.  for (auto it = getArrayDataFast(self).rend(); it != getArrayDataFast(self).rbegin(); it++) {
  10653.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {*it}, true);
  10654.  if (getBooleanValue(res, rt)) {
  10655.  rt->T5();
  10656.  return *it;
  10657.  }
  10658.  }
  10659.  rt->T5();
  10660.  return rt->S1();
  10661. }
  10662.  
  10663. static J10 *arrayAllMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10664.  rt->A0(args, 1);
  10665.  auto self = args[0];
  10666.  auto arg = args[1];
  10667.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10668.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10669.  
  10670.  auto ctx = rt->R5();
  10671.  rt->S5();
  10672.  rt->R5().area = ctx.area;
  10673.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10674.  for (auto obj : getArrayDataFast(self)) {
  10675.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10676.  if (!getBooleanValue(res, rt)) {
  10677.  rt->T5();
  10678.  return rt->R1(false);
  10679.  }
  10680.  }
  10681.  rt->T5();
  10682.  return rt->R1(true);
  10683. }
  10684.  
  10685. static J10 *arrayAnyMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10686.  rt->A0(args, 1);
  10687.  auto self = args[0];
  10688.  auto arg = args[1];
  10689.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10690.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10691.  
  10692.  auto ctx = rt->R5();
  10693.  rt->S5();
  10694.  rt->R5().area = ctx.area;
  10695.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10696.  for (auto obj : getArrayDataFast(self)) {
  10697.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10698.  if (getBooleanValue(res, rt)) {
  10699.  rt->T5();
  10700.  return rt->R1(true);
  10701.  }
  10702.  }
  10703.  rt->T5();
  10704.  return rt->R1(false);
  10705. }
  10706.  
  10707. static J10 *arrayNoneMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10708.  rt->A0(args, 1);
  10709.  auto self = args[0];
  10710.  auto arg = args[1];
  10711.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10712.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10713.  
  10714.  auto ctx = rt->R5();
  10715.  rt->S5();
  10716.  rt->R5().area = ctx.area;
  10717.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10718.  for (auto obj : getArrayDataFast(self)) {
  10719.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10720.  if (getBooleanValue(res, rt)) {
  10721.  rt->T5();
  10722.  return rt->R1(false);
  10723.  }
  10724.  }
  10725.  rt->T5();
  10726.  return rt->R1(true);
  10727. }
  10728.  
  10729. static J10 *arrayCountMethod(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10730.  rt->A0(args, 1);
  10731.  auto self = args[0];
  10732.  auto arg = args[1];
  10733.  rt->M0(self, rt->E3.array, K9::SUB1_CTX);
  10734.  rt->M0(arg, rt->E3.function, K9::SUB2_CTX);
  10735.  
  10736.  auto ctx = rt->R5();
  10737.  int64_t ans = 0;
  10738.  rt->S5();
  10739.  rt->R5().area = ctx.area;
  10740.  rt->R5().sub_areas = {ctx.area, ctx.area};
  10741.  for (auto obj : getArrayDataFast(self)) {
  10742.  auto res = rt->H5(I4::J12, arg, std::vector<J10 *> {obj}, true);
  10743.  if (getBooleanValue(res, rt)) {
  10744.  ans++;
  10745.  }
  10746.  }
  10747.  rt->T5();
  10748.  return G0(ans, rt);
  10749. }
  10750.  
  10751. static J10 *array_U6(const std::vector<J10 *> &args, K9 *rt, bool I0) {
  10752.  B2();
  10753.  rt->A0(args, 0);
  10754.  auto self = args[0];
  10755.  rt->O2(self, rt->E3.array, K9::SUB1_CTX);
  10756.  
  10757.  if (!I0) {
  10758.  return self;
  10759.  }
  10760.  
  10761.  if (rt->B4(self, nullptr)) {
  10762.  return J0("Array", rt);
  10763.  }
  10764.  
  10765.  auto &arr = getArrayDataFast(self);
  10766.  std::string res = "{";
  10767.  if (arr.size() != 0) {
  10768.  auto o = rt->O7(N4::U6(rt), arr[0], {arr[0]}, true);
  10769.  rt->M0(o, rt->E3.string, K9::SUB1_CTX);
  10770.  res += L1(o);
  10771.  }
  10772.  
  10773.  for (int64_t i = 1; i < arr.size(); i++) {
  10774.  auto o = rt->O7(N4::U6(rt), arr[i], {arr[i]}, true);
  10775.  rt->M0(o, rt->E3.string, K9::SUB1_CTX);
  10776.  res += ", " + L1(o);
  10777.  }
  10778.  
  10779.  res += "}";
  10780.  
  10781.  return J0(res, rt);
  10782. }
  10783.  
  10784. void installArrayMethods(I12 *type, K9 *rt) {
  10785.  B2();
  10786.  type->S7(N4::U6(rt), Z9::C0(true, array_U6, nullptr, rt));
  10787.  type->S7(N4::S4(rt), Z9::C0(true, array_U6, nullptr, rt));
  10788.  
  10789.  type->S7(rt->S12->Z11("size"), C0(true, arraySizeMethod, nullptr, rt));
  10790.  type->S7(rt->S12->Z11("resize"), C0(true, arrayResizeMethod, nullptr, rt));
  10791.  type->S7(rt->S12->Z11("append"), C0(true, arrayAppendMethod, nullptr, rt));
  10792.  type->S7(rt->S12->Z11("prepend"), C0(true, arrayPrependMethod, nullptr, rt));
  10793.  type->S7(rt->S12->Z11("poplast"), C0(true, arrayPoplastMethod, nullptr, rt));
  10794.  type->S7(rt->S12->Z11("popfirst"), C0(true, arrayPopfirstMethod, nullptr, rt));
  10795.  type->S7(rt->S12->Z11("first"), C0(true, arrayFirstMethod, nullptr, rt));
  10796.  type->S7(rt->S12->Z11("last"), C0(true, arrayLastMethod, nullptr, rt));
  10797.  type->S7(rt->S12->Z11("empty"), C0(true, arrayEmptyMethod, nullptr, rt));
  10798.  type->S7(rt->S12->Z11("clear"), C0(true, arrayClearMethod, nullptr, rt));
  10799.  type->S7(rt->S12->Z11("copy"), C0(true, arrayCopyMethod, nullptr, rt));
  10800.  type->S7(rt->S12->Z11("filter"), C0(true, arrayFilterMethod, nullptr, rt));
  10801.  type->S7(rt->S12->Z11("apply"), C0(true, arrayApplyMethod, nullptr, rt));
  10802.  type->S7(rt->S12->Z11("reverse"), C0(true, arrayReverseMethod, nullptr, rt));
  10803.  type->S7(rt->S12->Z11("sort"), C0(true, arraySortMethod, nullptr, rt));
  10804.  type->S7(rt->S12->Z11("combine"), C0(true, arrayCombineMethod, nullptr, rt));
  10805.  type->S7(rt->S12->Z11("findfirst"), C0(true, arrayFindfirstMethod, nullptr, rt));
  10806.  type->S7(rt->S12->Z11("findlast"), C0(true, arrayFindlastMethod, nullptr, rt));
  10807.  type->S7(rt->S12->Z11("all"), C0(true, arrayAllMethod, nullptr, rt));
  10808.  type->S7(rt->S12->Z11("any"), C0(true, arrayAnyMethod, nullptr, rt));
  10809.  type->S7(rt->S12->Z11("none"), C0(true, arrayNoneMethod, nullptr, rt));
  10810.  type->S7(rt->S12->Z11("count"), C0(true, arrayCountMethod, nullptr, rt));
  10811. }
  10812.  
  10813. Q7::Q7(K9 *rt)
  10814.  : I12(rt) {
  10815.  B2();
  10816.  this->J9 = ArrayIndexL9;
  10817.  this->G12 = ArrayEqL9;
  10818.  this->I11 = ArrayNeqL9;
  10819. }
  10820.  
  10821. J10 *Q7::create(K9 *rt) {
  10822.  B2();
  10823.  G8 *ins = new U3(rt);
  10824.  J10 *obj = new J10(true, ins, this, rt);
  10825.  return obj;
  10826. }
  10827.  
  10828. J10 *Q7::copy(J10 *obj, K9 *rt) {
  10829.  B2();
  10830.  rt->O2(obj, rt->E3.array);
  10831.  if (obj->H8 == nullptr) {
  10832.  return new J10(false, nullptr, this, rt);
  10833.  }
  10834.  auto ins = obj->H8->copy(rt);
  10835.  auto res = new J10(true, ins, this, rt);
  10836.  return res;
  10837. }
  10838.  
  10839. std::string Q7::userRepr(K9 *rt) {
  10840.  B2();
  10841.  if (this == nullptr) {
  10842.  return "Q7(nullptr)";
  10843.  }
  10844.  return "Q7";
  10845. }
  10846.  
  10847. std::vector<J10 *> &getArrayData(J10 *obj, K9 *rt) {
  10848.  B2();
  10849.  rt->M0(obj, rt->E3.array);
  10850.  return icast(obj->H8, H10::Z9::U3)->Q12;
  10851. }
  10852.  
  10853. std::vector<J10 *> &getArrayData(J10 *obj, K9 *rt, K9::ContextId ctx_id) {
  10854.  B2();
  10855.  rt->M0(obj, rt->E3.array, K9::SUB0_CTX);
  10856.  return icast(obj->H8, H10::Z9::U3)->Q12;
  10857. }
  10858.  
  10859. J10 *L0(const std::vector<J10 *> &Q12, K9 *rt) {
  10860.  B2();
  10861.  auto res = rt->make(rt->E3.array, K9::INSTANCE_OBJECT);
  10862.  getArrayDataFast(res) = Q12;
  10863.  return res;
  10864. }
  10865. }
  10866.  
  10867. /*
  10868.  Copyright (c) 2024 Ihor Lukianov (lis05)
  10869.  
  10870.  Permission is hereby granted, free of charge, to any person obtaining a copy of
  10871.  this software and associated documentation files (the "Software"), to deal in
  10872.  the Software without restriction, including without limitation the rights to
  10873.  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10874.  the Software, and to permit persons to whom the Software is furnished to do so,
  10875.  subject to the following conditions:
  10876.  
  10877.  The above copyright notice and this permission notice shall be included in all
  10878.  copies or substantial portions of the Software.
  10879.  
  10880.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, N12ESS OR
  10881.  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  10882.  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  10883.  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  10884.  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  10885.  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  10886.  */
  10887.  
  10888. #include <chrono>
  10889. using namespace std::chrono;
  10890. using namespace H10;
  10891. using namespace H10::Z9;
  10892.  
  10893. void emergency_error_exit() {
  10894.     exit(1);
  10895. }
  10896.  
  10897. // TODO: add --profiler flag
  10898.  
  10899. int main(int argc, char *argv[]) {
  10900.  
  10901. const char *src = R"(
  10902. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10903.  
  10904. arr = make(Array)
  10905.    .resize(read(Integer))
  10906.    .apply(function(x){x=read(Integer);});
  10907.  
  10908. target = arr.copy().sort(function(a,b){a>b;})[1];
  10909.  
  10910. // don't have a function that would return element's position yet
  10911. for i = 0; i < arr.size(); i++; {
  10912.    if arr[i] == target; {
  10913.        println(i + 1);
  10914.        return;
  10915.    }
  10916. }
  10917.  
  10918.  
  10919. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10920. )";
  10921.  
  10922.     C4 em(emergency_error_exit);
  10923.     M11        lx(&em);
  10924.     K10       pr(&em);
  10925.     D4 S12;
  10926.  
  10927.     auto strsrc = std::string(src);
  10928.  
  10929.     auto L11s = lx.process(strsrc);
  10930.     for (auto &L11 : L11s) {
  10931.         L11.Y10 = S12.Z11(L11.Q12);
  10932.     }
  10933.     auto program = pr.B12(L11s);
  10934.  
  10935.     O1 gcst;
  10936.     K9           rt(&gcst, &em, &S12);
  10937.     auto res        = rt.execute(program, false);
  10938.     delete program;
  10939. }
  10940.  
  10941.  
Advertisement
Add Comment
Please, Sign In to add comment