SHARE
TWEET

Untitled

a guest Jan 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <mruby.h>
  2. #include <mruby/value.h>
  3. #include <mruby/array.h>
  4. #include <mruby/throw.h>
  5. #include <mruby/proc.h>
  6. #include <math.h>
  7. #include <stdio.h>
  8. #undef mrb_int
  9.  
  10. typedef void *gproc;
  11. struct env2 {
  12. mrb_int v116;
  13. mrb_value v117;
  14. };
  15. struct env3 {
  16. struct env2 *prev;
  17. };
  18. struct cls0 {
  19. };
  20. mrb_value main_Object_0(mrb_state *, mrb_value self);
  21. mrb_value foo__Object__1(mrb_state *, mrb_value self, mrb_value v103);
  22. struct proc3 {
  23. int id;
  24. void *code[1];
  25. struct env2 *env;
  26. mrb_value self;
  27. };
  28. mrb_value p3_Object_0_2(mrb_state *,mrb_value mrbproc, mrb_value v122);
  29. int main(int argc, char **argv)
  30. {
  31.   mrb_state *mrb = mrb_open();
  32.   struct mrb_jmpbuf c_jmp;
  33.  
  34.   MRB_TRY(&c_jmp) {
  35.     mrb->jmp = &c_jmp;
  36.     main_Object_0(mrb, mrb_top_self(mrb));
  37.   }
  38.   MRB_CATCH(&c_jmp) {
  39.     mrb_p(mrb, mrb_obj_value(mrb->exc));
  40.     return 1;
  41.   }
  42.   MRB_END_EXC(&c_jmp);
  43.  
  44.   return 0;
  45. }
  46. mrb_value main_Object_0(mrb_state *mrb, mrb_value self) {
  47. mrb_value v14;
  48. mrb_value v17;
  49. mrb_value v20;
  50. L0:;
  51. v14 = foo__Object__1(mrb, self, mrb_nil_value());
  52. v17 = ((mrb_value (*)())(((void **)(MRB_PROC_CFUNC(mrb_proc_ptr(v14))))[0]))(mrb, v14, mrb_nil_value());
  53. v20 = ((mrb_value (*)())(((void **)(MRB_PROC_CFUNC(mrb_proc_ptr(v14))))[0]))(mrb, v14, mrb_nil_value());
  54. return v20;
  55. }
  56. mrb_value foo__Object__1(mrb_state *mrb, mrb_value self, mrb_value v103) {
  57. struct env2 env;
  58. struct REnv *venv = NULL;
  59. mrb_int v116;
  60. mrb_value vv118;
  61. mrb_value v141;
  62. mrb_value v143;
  63. mrb_value v149;
  64. L5:;
  65. v116 = 123;
  66. if (venv)
  67. venv->stack[1] = (mrb_fixnum_value(v116));
  68. if (venv)
  69. venv->stack[2] = mrb_nil_value();
  70. struct proc3 v118;
  71. v118.id = 3;
  72. v118.self = self;
  73. v118.env = &env;
  74. v118.code[0] = (void *)p3_Object_0_2;
  75. vv118 = ({
  76.  mrb_value tmpval[3];
  77. struct RProc *tproc;
  78. {
  79. tmpval[0] = ((struct proc3 *)((gproc)&v118))->self;
  80. tmpval[1] = (mrb_fixnum_value(v116));
  81. tmpval[2] = mrb_nil_value();
  82. tproc = mrb_proc_new_cfunc_with_env(mrb, ((struct proc3 *)(gproc)&v118)->code, 3, tmpval);
  83. venv = tproc->e.env;
  84. }
  85. mrb_obj_value(tproc);
  86. });
  87. v141 = vv118;
  88. if (venv)
  89. venv->stack[2] = v141;
  90. v143 = ((mrb_value (*)())(((void **)(MRB_PROC_CFUNC(mrb_proc_ptr(vv118))))[0]))(mrb, vv118, mrb_nil_value());
  91. if (venv)
  92. venv->stack[1] = (mrb_fixnum_value((v116 + 32)));
  93. v149 = ((mrb_value (*)())(((void **)(MRB_PROC_CFUNC(mrb_proc_ptr(v141))))[0]))(mrb, v141, mrb_nil_value());
  94. return v141;
  95. }
  96. mrb_value p3_Object_0_2(mrb_state *mrb,mrb_value mrbproc, mrb_value v122) {
  97. struct RProc *proc;
  98. mrb_value self;
  99. struct env3 env;
  100. struct REnv *venv = NULL;
  101. mrb_int v130;
  102. mrb_int v133;
  103. mrb_int v135;
  104. mrb_value v137;
  105. mrb_value v139;
  106. proc = mrb_proc_ptr(mrbproc);
  107. self = proc->e.env->stack[0];
  108. L6:;
  109. v130 = (mrb_fixnum((mrb_proc_ptr(mrbproc))->e.env->stack[1]));
  110. (mrb_proc_ptr(mrbproc))->e.env->stack[1] = (mrb_fixnum_value((v130 + 1)));
  111. v133 = (mrb_fixnum((mrb_proc_ptr(mrbproc))->e.env->stack[1]));
  112. mrb_p(mrb, (mrb_fixnum_value(v133)));
  113. v135 = v133;
  114. v137 = (mrb_proc_ptr(mrbproc))->e.env->stack[2];
  115. mrb_p(mrb, v137);
  116. v139 = v137;
  117. return v139;
  118. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top