/* -*-c-*- *********************************************************/
/*******************************************************************/
/*******************************************************************/
/**
  This file is VM main loop.
  
  ----
  This file is auto generated by insns2vm.rb
  DO NOT TOUCH!

  If you want to fix something, you must edit 'insns.c'
 */



INSN_ENTRY(nop){

{





  DEBUG_ENTER_INSN("nop");
  ADD_PC(1+0);
  #define CURRENT_INSN_nop 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_nop_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(nop));
{
#line 39 "./insns.def"
    /* none */
#line 35 "vm.inc"


#undef CURRENT_INSN_nop
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(nop);
}}
}


INSN_ENTRY(getlocal){

{
  VALUE val;

  lindex_t idx = (lindex_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getlocal");
  ADD_PC(1+1);
  #define CURRENT_INSN_getlocal 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getlocal_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getlocal));
  USAGE_ANALYSIS_OPERAND(BIN(getlocal), 0, idx);
{
#line 57 "./insns.def"
    val = *(GET_LFP() - idx);
#line 66 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getlocal
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getlocal);
}}
}


INSN_ENTRY(setlocal){

{


  lindex_t idx = (lindex_t)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setlocal");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_setlocal 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setlocal_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setlocal));
  USAGE_ANALYSIS_OPERAND(BIN(setlocal), 0, idx);
{
#line 71 "./insns.def"
    (*(GET_LFP() - idx)) = val;
#line 98 "vm.inc"


#undef CURRENT_INSN_setlocal
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setlocal);
}}
}


INSN_ENTRY(getspecial){

{
  VALUE val;

  num_t type = (num_t)GET_OPERAND(2);
  num_t idx = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getspecial");
  ADD_PC(1+2);
  #define CURRENT_INSN_getspecial 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getspecial_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getspecial));
  USAGE_ANALYSIS_OPERAND(BIN(getspecial), 0, idx);
  USAGE_ANALYSIS_OPERAND(BIN(getspecial), 1, type);
{
#line 85 "./insns.def"
    if (type == 0) {
	VALUE *pv = lfp_svar(GET_LFP(), idx);
	val = *pv;
    }
    else {
	VALUE backref = *lfp_svar(GET_LFP(), 1);
	if (type & 0x01) {
	    switch (type >> 1) {
	    case '&':
		val = rb_reg_last_match(backref);
		break;
	    case '`':
		val = rb_reg_match_pre(backref);
		break;
	    case '\'':
		val = rb_reg_match_post(backref);
		break;
	    case '+':
		val = rb_reg_match_last(backref);
		break;
	    default:
		rb_bug("unexpected back-ref");
	    }
	}
	else {
	    val = rb_reg_nth_match(type >> 1, backref);
	}
    }
#line 158 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getspecial
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getspecial);
}}
}


INSN_ENTRY(setspecial){

{


  num_t idx = (num_t)GET_OPERAND(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("setspecial");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_setspecial 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setspecial_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setspecial));
  USAGE_ANALYSIS_OPERAND(BIN(setspecial), 0, idx);
{
#line 126 "./insns.def"
    VALUE *pv = lfp_svar(GET_LFP(), idx);
    *pv = obj;
#line 191 "vm.inc"


#undef CURRENT_INSN_setspecial
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setspecial);
}}
}


INSN_ENTRY(getdynamic){

{
  VALUE val;

  num_t level = (num_t)GET_OPERAND(2);
  dindex_t idx = (dindex_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getdynamic");
  ADD_PC(1+2);
  #define CURRENT_INSN_getdynamic 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getdynamic_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getdynamic));
  USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 0, idx);
  USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 1, level);
{
#line 143 "./insns.def"
    int i;
    VALUE *dfp2 = GET_DFP();
    for (i = 0; i < level; i++) {
	dfp2 = GET_PREV_DFP(dfp2);
    }
    val = *(dfp2 - idx);
#line 229 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getdynamic
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getdynamic);
}}
}


INSN_ENTRY(setdynamic){

{


  num_t level = (num_t)GET_OPERAND(2);
  dindex_t idx = (dindex_t)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setdynamic");
  ADD_PC(1+2);
  POPN(1);
  #define CURRENT_INSN_setdynamic 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setdynamic_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setdynamic));
  USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 0, idx);
  USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 1, level);
{
#line 164 "./insns.def"
    int i;
    VALUE *dfp2 = GET_DFP();
    for (i = 0; i < level; i++) {
	dfp2 = GET_PREV_DFP(dfp2);
    }
    *(dfp2 - idx) = val;
#line 268 "vm.inc"


#undef CURRENT_INSN_setdynamic
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setdynamic);
}}
}


INSN_ENTRY(getinstancevariable){

{
  VALUE val;

  ID id = (ID)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getinstancevariable");
  ADD_PC(1+1);
  #define CURRENT_INSN_getinstancevariable 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getinstancevariable_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getinstancevariable));
  USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 0, id);
{
#line 183 "./insns.def"
    val = rb_ivar_get(GET_SELF(), id);
#line 299 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getinstancevariable
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getinstancevariable);
}}
}


INSN_ENTRY(setinstancevariable){

{


  ID id = (ID)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setinstancevariable");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_setinstancevariable 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setinstancevariable_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setinstancevariable));
  USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 0, id);
{
#line 197 "./insns.def"
    rb_ivar_set(GET_SELF(), id, val);
#line 331 "vm.inc"


#undef CURRENT_INSN_setinstancevariable
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setinstancevariable);
}}
}


INSN_ENTRY(getclassvariable){

{
  VALUE val;

  ID id = (ID)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getclassvariable");
  ADD_PC(1+1);
  #define CURRENT_INSN_getclassvariable 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getclassvariable_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getclassvariable));
  USAGE_ANALYSIS_OPERAND(BIN(getclassvariable), 0, id);
{
#line 211 "./insns.def"
    VALUE klass = eval_get_cvar_base(th, GET_ISEQ());
    val = rb_cvar_get(klass, id);
#line 363 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getclassvariable
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getclassvariable);
}}
}


INSN_ENTRY(setclassvariable){

{


  VALUE declp = (VALUE)GET_OPERAND(2);
  ID id = (ID)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setclassvariable");
  ADD_PC(1+2);
  POPN(1);
  #define CURRENT_INSN_setclassvariable 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setclassvariable_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setclassvariable));
  USAGE_ANALYSIS_OPERAND(BIN(setclassvariable), 0, id);
  USAGE_ANALYSIS_OPERAND(BIN(setclassvariable), 1, declp);
{
#line 226 "./insns.def"
    VALUE klass = eval_get_cvar_base(th, GET_ISEQ());

    if (declp == Qtrue && RTEST(ruby_verbose) && FL_TEST(klass, FL_SINGLETON)) {
	rb_warn("declaring singleton class variable");
    }
    rb_cvar_set(klass, id, val, declp);
#line 402 "vm.inc"


#undef CURRENT_INSN_setclassvariable
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setclassvariable);
}}
}


INSN_ENTRY(getconstant){

{
  VALUE val;

  ID id = (ID)GET_OPERAND(1);
  VALUE klass = TOPN(0);

  DEBUG_ENTER_INSN("getconstant");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_getconstant 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getconstant_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getconstant));
  USAGE_ANALYSIS_OPERAND(BIN(getconstant), 0, id);
{
#line 252 "./insns.def"
    val = eval_get_ev_const(th, GET_ISEQ(), klass, id, 0);
#line 434 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getconstant
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getconstant);
}}
}


INSN_ENTRY(setconstant){

{


  ID id = (ID)GET_OPERAND(1);
  VALUE val = TOPN(1);
  VALUE klass = TOPN(0);

  DEBUG_ENTER_INSN("setconstant");
  ADD_PC(1+1);
  POPN(2);
  #define CURRENT_INSN_setconstant 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setconstant_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setconstant));
  USAGE_ANALYSIS_OPERAND(BIN(setconstant), 0, id);
{
#line 275 "./insns.def"
    if (klass == Qnil) {
	klass = th_get_cbase(th);
    }
    if (NIL_P(klass)) {
	rb_raise(rb_eTypeError, "no class/module to define constant");
    }

    switch (TYPE(klass)) {
    case T_CLASS:
    case T_MODULE:
	break;
    default:
	rb_raise(rb_eTypeError, "%s is not a class/module",
		 RSTRING(rb_obj_as_string(klass))->ptr);
    }

    rb_const_set(klass, id, val);
    INC_VM_STATE_VERSION();
#line 484 "vm.inc"


#undef CURRENT_INSN_setconstant
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setconstant);
}}
}


INSN_ENTRY(getglobal){

{
  VALUE val;

  GENTRY entry = (GENTRY)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getglobal");
  ADD_PC(1+1);
  #define CURRENT_INSN_getglobal 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getglobal_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getglobal));
  USAGE_ANALYSIS_OPERAND(BIN(getglobal), 0, entry);
{
#line 306 "./insns.def"
    val = GET_GLOBAL(entry);
#line 515 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getglobal
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getglobal);
}}
}


INSN_ENTRY(setglobal){

{


  GENTRY entry = (GENTRY)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setglobal");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_setglobal 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setglobal_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setglobal));
  USAGE_ANALYSIS_OPERAND(BIN(setglobal), 0, entry);
{
#line 320 "./insns.def"
    SET_GLOBAL(entry, val);
#line 547 "vm.inc"


#undef CURRENT_INSN_setglobal
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setglobal);
}}
}


INSN_ENTRY(putnil){

{
  VALUE val;




  DEBUG_ENTER_INSN("putnil");
  ADD_PC(1+0);
  #define CURRENT_INSN_putnil 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putnil_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putnil));
{
#line 339 "./insns.def"
    val = Qnil;
#line 577 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putnil
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putnil);
}}
}


INSN_ENTRY(putself){

{
  VALUE val;




  DEBUG_ENTER_INSN("putself");
  ADD_PC(1+0);
  #define CURRENT_INSN_putself 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putself_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putself));
{
#line 353 "./insns.def"
    val = GET_SELF();
#line 607 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putself
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putself);
}}
}


INSN_ENTRY(putundef){

{
  VALUE val;




  DEBUG_ENTER_INSN("putundef");
  ADD_PC(1+0);
  #define CURRENT_INSN_putundef 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putundef_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putundef));
{
#line 367 "./insns.def"
    val = Qundef;
#line 637 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putundef
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putundef);
}}
}


INSN_ENTRY(putobject){

{


  VALUE val = (VALUE)GET_OPERAND(1);


  DEBUG_ENTER_INSN("putobject");
  ADD_PC(1+1);
  #define CURRENT_INSN_putobject 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putobject_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putobject));
  USAGE_ANALYSIS_OPERAND(BIN(putobject), 0, val);
{
#line 382 "./insns.def"
    /* */
#line 668 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putobject
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putobject);
}}
}


INSN_ENTRY(putstring){

{


  VALUE val = (VALUE)GET_OPERAND(1);


  DEBUG_ENTER_INSN("putstring");
  ADD_PC(1+1);
  #define CURRENT_INSN_putstring 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putstring_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putstring));
  USAGE_ANALYSIS_OPERAND(BIN(putstring), 0, val);
{
#line 397 "./insns.def"
    val = rb_str_new3(val);
#line 699 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putstring
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putstring);
}}
}


INSN_ENTRY(concatstrings){

{
  VALUE val;

  num_t num = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("concatstrings");
  ADD_PC(1+1);
  #define CURRENT_INSN_concatstrings 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_concatstrings_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(concatstrings));
  USAGE_ANALYSIS_OPERAND(BIN(concatstrings), 0, num);
{
#line 411 "./insns.def"
    int i;
    VALUE v;

    val = rb_str_new(0, 0);
    for (i = num - 1; i >= 0; i--) {
	v = TOPN(i);
	rb_str_append(val, v);
    }
    POPN(num);
#line 738 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_concatstrings
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(concatstrings);
}}
}


INSN_ENTRY(tostring){

{



  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("tostring");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_tostring 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_tostring_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(tostring));
{
#line 433 "./insns.def"
    val = rb_obj_as_string(val);
#line 769 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_tostring
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(tostring);
}}
}


INSN_ENTRY(toregexp){

{
  VALUE val;

  num_t flag = (num_t)GET_OPERAND(1);
  VALUE str = TOPN(0);

  DEBUG_ENTER_INSN("toregexp");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_toregexp 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_toregexp_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(toregexp));
  USAGE_ANALYSIS_OPERAND(BIN(toregexp), 0, flag);
{
#line 447 "./insns.def"
    val = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, flag);
#line 801 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_toregexp
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(toregexp);
}}
}


INSN_ENTRY(newarray){

{
  VALUE val;

  num_t num = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("newarray");
  ADD_PC(1+1);
  #define CURRENT_INSN_newarray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_newarray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(newarray));
  USAGE_ANALYSIS_OPERAND(BIN(newarray), 0, num);
{
#line 461 "./insns.def"
    val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
    POPN(num);
#line 833 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_newarray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(newarray);
}}
}


INSN_ENTRY(duparray){

{
  VALUE val;

  VALUE ary = (VALUE)GET_OPERAND(1);


  DEBUG_ENTER_INSN("duparray");
  ADD_PC(1+1);
  #define CURRENT_INSN_duparray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_duparray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(duparray));
  USAGE_ANALYSIS_OPERAND(BIN(duparray), 0, ary);
{
#line 476 "./insns.def"
    val = rb_ary_dup(ary);
#line 864 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_duparray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(duparray);
}}
}


INSN_ENTRY(expandarray){

{


  num_t flag = (num_t)GET_OPERAND(2);
  num_t num = (num_t)GET_OPERAND(1);
  VALUE ary = TOPN(0);

  DEBUG_ENTER_INSN("expandarray");
  ADD_PC(1+2);
  POPN(1);
  #define CURRENT_INSN_expandarray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_expandarray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(expandarray));
  USAGE_ANALYSIS_OPERAND(BIN(expandarray), 0, num);
  USAGE_ANALYSIS_OPERAND(BIN(expandarray), 1, flag);
{
#line 494 "./insns.def"
    int i;
    if ((long)num >= 0) {
	int len;
	if (TYPE(ary) != T_ARRAY) {
	    ary = rb_ary_to_ary(ary);
	}
	len = RARRAY(ary)->len;
	for (i = 0; i < len && i < num; i++) {
	    PUSH(RARRAY(ary)->ptr[i]);
	}
	for (; i < num; i++) {
	    PUSH(Qnil);
	}
	if (flag) {
	    if (len > num) {
		PUSH(rb_ary_new4(len - num, &RARRAY(ary)->ptr[num]));
	    }
	    else {
		PUSH(rb_ary_new());
	    }
	}
    }
    else {
	long holdnum = -num;
	VALUE val;

	val = rb_ary_new4(holdnum, STACK_ADDR_FROM_TOP(holdnum));
	if (CLASS_OF(ary) == rb_cArray) {
	    val = rb_ary_concat(val, ary);
	}
	else {
	    rb_ary_push(val, ary);
	}
	POPN(holdnum);
	PUSH(val);
    }
#line 933 "vm.inc"


#undef CURRENT_INSN_expandarray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(expandarray);
}}
}


INSN_ENTRY(concatarray){

{
  VALUE ary;


  VALUE ary1 = TOPN(1);
  VALUE ary2st = TOPN(0);

  DEBUG_ENTER_INSN("concatarray");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_concatarray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_concatarray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(concatarray));
{
#line 543 "./insns.def"
    VALUE ary2 = ary2st;

    if (ary2 == Qnil) {
	ary = ary1;
    }
    else {
	if (TYPE(ary2) != T_ARRAY) {
	    ary2 = rb_Array(ary2);
	}
	ary = rb_ary_concat(ary1, ary2);
    }
#line 975 "vm.inc"
  PUSH(ary);

#undef CURRENT_INSN_concatarray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(concatarray);
}}
}


INSN_ENTRY(splatarray){

{
  VALUE obj;

  VALUE flag = (VALUE)GET_OPERAND(1);
  VALUE ary = TOPN(0);

  DEBUG_ENTER_INSN("splatarray");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_splatarray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_splatarray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(splatarray));
  USAGE_ANALYSIS_OPERAND(BIN(splatarray), 0, flag);
{
#line 567 "./insns.def"
    if (flag == Qfalse) {
	/* NODE_SPLAT */
	obj = rb_Array(ary);
    }
    else {
	/* NODE_SVALUE */
	if (RARRAY(ary)->len == 0) {
	    obj = Qnil;
	}
	else if (RARRAY(ary)->len == 1) {
	    obj = RARRAY(ary)->ptr[0];
	}
	else {
	    obj = ary;
	}
    }
#line 1022 "vm.inc"
  PUSH(obj);

#undef CURRENT_INSN_splatarray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(splatarray);
}}
}


INSN_ENTRY(checkincludearray){

{
  VALUE result;

  VALUE flag = (VALUE)GET_OPERAND(1);
  VALUE obj = TOPN(1);
  VALUE ary = TOPN(0);

  DEBUG_ENTER_INSN("checkincludearray");
  ADD_PC(1+1);
  POPN(2);
  #define CURRENT_INSN_checkincludearray 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_checkincludearray_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(checkincludearray));
  USAGE_ANALYSIS_OPERAND(BIN(checkincludearray), 0, flag);
{
#line 596 "./insns.def"
    int i;
    result = Qfalse;

    if (TYPE(ary) != T_ARRAY) {
	ary = rb_Array(ary);
    }

    if (flag == Qtrue) {
	/* NODE_CASE */
	for (i = 0; i < RARRAY(ary)->len; i++) {
	    // TODO: fix me (use another method dispatch)
	    if (RTEST(rb_funcall2(RARRAY(ary)->ptr[i], idEqq, 1, &obj))) {
		result = Qtrue;
		break;
	    }
	}
    }
    else {
	obj = Qfalse;
	/* NODE_WHEN */
	for (i = 0; i < RARRAY(ary)->len; i++) {
	    if (RTEST(RARRAY(ary)->ptr[i])) {
		obj = result = Qtrue;
		break;
	    }
	}
    }
#line 1081 "vm.inc"
  PUSH(obj);
  PUSH(result);

#undef CURRENT_INSN_checkincludearray
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(checkincludearray);
}}
}


INSN_ENTRY(newhash){

{
  VALUE val;

  num_t num = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("newhash");
  ADD_PC(1+1);
  #define CURRENT_INSN_newhash 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_newhash_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(newhash));
  USAGE_ANALYSIS_OPERAND(BIN(newhash), 0, num);
{
#line 636 "./insns.def"
    int i;
    VALUE k, v;
    val = rb_hash_new();

    for (i = num; i > 0; i -= 2) {
	v = TOPN(i - 2);
	k = TOPN(i - 1);
	rb_hash_aset(val, k, v);
    }
    POPN(num);
#line 1122 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_newhash
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(newhash);
}}
}


INSN_ENTRY(newrange){

{
  VALUE val;

  num_t flag = (num_t)GET_OPERAND(1);
  VALUE low = TOPN(1);
  VALUE high = TOPN(0);

  DEBUG_ENTER_INSN("newrange");
  ADD_PC(1+1);
  POPN(2);
  #define CURRENT_INSN_newrange 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_newrange_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(newrange));
  USAGE_ANALYSIS_OPERAND(BIN(newrange), 0, flag);
{
#line 659 "./insns.def"
    val = rb_range_new(low, high, flag);
#line 1155 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_newrange
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(newrange);
}}
}


INSN_ENTRY(putnot){

{
  VALUE val;


  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("putnot");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_putnot 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_putnot_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(putnot));
{
#line 673 "./insns.def"
    if (RTEST(obj)) {
	val = Qfalse;
    }
    else {
	val = Qtrue;
    }
#line 1191 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_putnot
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(putnot);
}}
}


INSN_ENTRY(pop){

{



  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("pop");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_pop 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_pop_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(pop));
{
#line 697 "./insns.def"
    val = val;
    /* none */
#line 1223 "vm.inc"


#undef CURRENT_INSN_pop
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(pop);
}}
}


INSN_ENTRY(dup){

{
  VALUE val2;
  VALUE val1;


  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("dup");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_dup 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_dup_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(dup));
{
#line 712 "./insns.def"
    val1 = val2 = val;
#line 1255 "vm.inc"
  PUSH(val1);
  PUSH(val2);

#undef CURRENT_INSN_dup
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(dup);
}}
}


INSN_ENTRY(dupn){

{


  num_t n = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("dupn");
  ADD_PC(1+1);
  #define CURRENT_INSN_dupn 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_dupn_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(dupn));
  USAGE_ANALYSIS_OPERAND(BIN(dupn), 0, n);
{
#line 726 "./insns.def"
    int i;
    VALUE *sp = STACK_ADDR_FROM_TOP(n);
    for (i = 0; i < n; i++) {
	GET_SP()[i] = sp[i];
    }
    INC_SP(n);
#line 1292 "vm.inc"


#undef CURRENT_INSN_dupn
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(dupn);
}}
}


INSN_ENTRY(swap){

{



  VALUE val = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("swap");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_swap 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_swap_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(swap));
{
#line 746 "./insns.def"
    /* none */
#line 1324 "vm.inc"
  PUSH(obj);
  PUSH(val);

#undef CURRENT_INSN_swap
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(swap);
}}
}


INSN_ENTRY(reput){

{



  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("reput");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_reput 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_reput_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(reput));
{
#line 760 "./insns.def"
    /* none */
#line 1356 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_reput
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(reput);
}}
}


INSN_ENTRY(topn){

{
  VALUE val;

  num_t n = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("topn");
  ADD_PC(1+1);
  #define CURRENT_INSN_topn 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_topn_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(topn));
  USAGE_ANALYSIS_OPERAND(BIN(topn), 0, n);
{
#line 774 "./insns.def"
    val = TOPN(n);
#line 1387 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_topn
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(topn);
}}
}


INSN_ENTRY(emptstack){

{





  DEBUG_ENTER_INSN("emptstack");
  ADD_PC(1+0);
  #define CURRENT_INSN_emptstack 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_emptstack_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(emptstack));
{
#line 788 "./insns.def"
    SET_SP(GET_CFP()->bp);
#line 1417 "vm.inc"


#undef CURRENT_INSN_emptstack
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(emptstack);
}}
}


INSN_ENTRY(definemethod){

{


  num_t is_singleton = (num_t)GET_OPERAND(3);
  VALUE body = (VALUE)GET_OPERAND(2);
  ID id = (ID)GET_OPERAND(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("definemethod");
  ADD_PC(1+3);
  POPN(1);
  #define CURRENT_INSN_definemethod 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_definemethod_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(definemethod));
  USAGE_ANALYSIS_OPERAND(BIN(definemethod), 0, id);
  USAGE_ANALYSIS_OPERAND(BIN(definemethod), 1, body);
  USAGE_ANALYSIS_OPERAND(BIN(definemethod), 2, is_singleton);
{
#line 807 "./insns.def"
    eval_define_method(th, obj, id, body, is_singleton,
		       get_cref(GET_ISEQ(), GET_LFP()));
#line 1454 "vm.inc"


#undef CURRENT_INSN_definemethod
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(definemethod);
}}
}


INSN_ENTRY(alias){

{


  ID id2 = (ID)GET_OPERAND(3);
  ID id1 = (ID)GET_OPERAND(2);
  VALUE v_p = (VALUE)GET_OPERAND(1);


  DEBUG_ENTER_INSN("alias");
  ADD_PC(1+3);
  #define CURRENT_INSN_alias 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_alias_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(alias));
  USAGE_ANALYSIS_OPERAND(BIN(alias), 0, v_p);
  USAGE_ANALYSIS_OPERAND(BIN(alias), 1, id1);
  USAGE_ANALYSIS_OPERAND(BIN(alias), 2, id2);
{
#line 823 "./insns.def"
    VALUE klass;

    if (v_p == Qtrue) {
	rb_alias_variable(id1, id2);
    }
    else {
	klass = get_cref(GET_ISEQ(), GET_LFP())->nd_clss;
	rb_alias(klass, id1, id2);
    }
#line 1497 "vm.inc"


#undef CURRENT_INSN_alias
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(alias);
}}
}


INSN_ENTRY(undef){

{


  ID id = (ID)GET_OPERAND(1);


  DEBUG_ENTER_INSN("undef");
  ADD_PC(1+1);
  #define CURRENT_INSN_undef 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_undef_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(undef));
  USAGE_ANALYSIS_OPERAND(BIN(undef), 0, id);
{
#line 845 "./insns.def"
    VALUE klass = get_cref(GET_ISEQ(), GET_LFP())->nd_clss;
    rb_undef(klass, id);
    INC_VM_STATE_VERSION();
#line 1530 "vm.inc"


#undef CURRENT_INSN_undef
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(undef);
}}
}


INSN_ENTRY(defined){

{
  VALUE val;

  VALUE needstr = (VALUE)GET_OPERAND(3);
  VALUE obj = (VALUE)GET_OPERAND(2);
  num_t type = (num_t)GET_OPERAND(1);
  VALUE v = TOPN(0);

  DEBUG_ENTER_INSN("defined");
  ADD_PC(1+3);
  POPN(1);
  #define CURRENT_INSN_defined 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_defined_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(defined));
  USAGE_ANALYSIS_OPERAND(BIN(defined), 0, type);
  USAGE_ANALYSIS_OPERAND(BIN(defined), 1, obj);
  USAGE_ANALYSIS_OPERAND(BIN(defined), 2, needstr);
{
#line 861 "./insns.def"
    VALUE klass;
    char *expr_type = 0;
    char buf[0x10];
    
    val = Qnil;

    switch (type) {
      case DEFINED_IVAR:
	if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
	    expr_type = "instance-variable";
	}
	break;
      case DEFINED_GVAR:
	if (rb_gvar_defined((struct global_entry *)(obj & ~1))) {
	    expr_type = "global-variable";
	}
	break;
      case DEFINED_CVAR:
	klass = get_cref(GET_ISEQ(), GET_LFP())->nd_clss;
	if (rb_cvar_defined(klass, SYM2ID(obj))) {
	    expr_type = "class variable";
	}
	break;
      case DEFINED_CONST:
	klass = v;
	if (eval_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
	    expr_type = "constant";
	}
	break;
      case DEFINED_FUNC:
	klass = CLASS_OF(v);
	if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
	    expr_type = "method";
	}
	break;
      case DEFINED_METHOD:{
	  VALUE klass = CLASS_OF(v);
	  NODE *method = (NODE *) rb_method_node(klass, SYM2ID(obj));

	  if (method) {
	      if (!(method->nd_noex & NOEX_PRIVATE)) {
		  if (!((method->nd_noex & NOEX_PROTECTED) &&
			!rb_obj_is_kind_of(GET_SELF(),
					   rb_class_real(klass)))) {
		      expr_type = "method";
		  }
	      }
	  }
	  break;
      }
      case DEFINED_YIELD:
	if (GET_BLOCK_PTR()) {
	    expr_type = "yield";
	}
	break;
      case DEFINED_ZSUPER:{
	  yarv_iseq_t *ip = GET_ISEQ();
	  while (ip) {
	      if (ip->defined_method_id) {
		  break;
	      }
	      ip = ip->parent_iseq;
	  }
	  if (ip) {
	      VALUE klass = eval_search_super_klass(ip->klass, GET_SELF());
	      if (rb_method_boundp(klass, ip->defined_method_id, 0)) {
		  expr_type = "super";
	      }
	  }
	  break;
      }
      case DEFINED_REF:{
	  int nth = FIX2INT(obj);
	  VALUE backref = *lfp_svar(GET_LFP(), 1);
	  
	  if (rb_reg_nth_match(nth, backref) != Qnil) {
	      snprintf(buf, 0x10, "$%d", nth);
	      expr_type = buf;
	  }
	  break;
      }
      default:
	rb_bug("unimplemented defined? type (VM)");
	break;
    }
    if (expr_type != 0) {
	if (needstr != Qfalse) {
	    val = rb_str_new2(expr_type);
	}
	else {
	    val = Qtrue;
	}
    }
#line 1658 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_defined
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(defined);
}}
}


INSN_ENTRY(postexe){

{


  BLOCKISEQ blockiseq = (BLOCKISEQ)GET_OPERAND(1);


  DEBUG_ENTER_INSN("postexe");
  ADD_PC(1+1);
  #define CURRENT_INSN_postexe 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_postexe_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(postexe));
  USAGE_ANALYSIS_OPERAND(BIN(postexe), 0, blockiseq);
{
#line 967 "./insns.def"
    yarv_block_t *blockptr;
    VALUE proc;

    blockptr = GET_BLOCK_PTR_IN_CFP(GET_CFP());
    blockptr->iseq = blockiseq;
    blockptr->proc = 0;

    proc = th_make_proc(th, GET_CFP(), blockptr);
    rb_set_end_proc(call_yarv_end_proc, proc);
#line 1697 "vm.inc"


#undef CURRENT_INSN_postexe
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(postexe);
}}
}


INSN_ENTRY(trace){

{


  VALUE args = (VALUE)GET_OPERAND(2);
  num_t flag = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("trace");
  ADD_PC(1+2);
  #define CURRENT_INSN_trace 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_trace_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(trace));
  USAGE_ANALYSIS_OPERAND(BIN(trace), 0, flag);
  USAGE_ANALYSIS_OPERAND(BIN(trace), 1, args);
{
#line 989 "./insns.def"
    /* TODO: trace instruction design */
    if (th->vm->trace_flag & flag) {
	/* */
	args = Qnil;
    }
#line 1734 "vm.inc"


#undef CURRENT_INSN_trace
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(trace);
}}
}


INSN_ENTRY(classdef){

{
  VALUE val;

  VALUE klass_iseqval = (VALUE)GET_OPERAND(2);
  ID id = (ID)GET_OPERAND(1);
  VALUE cbase = TOPN(1);
  VALUE super = TOPN(0);

  DEBUG_ENTER_INSN("classdef");
  ADD_PC(1+2);
  POPN(2);
  #define CURRENT_INSN_classdef 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_classdef_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(classdef));
  USAGE_ANALYSIS_OPERAND(BIN(classdef), 0, id);
  USAGE_ANALYSIS_OPERAND(BIN(classdef), 1, klass_iseqval);
{
#line 1015 "./insns.def"
    /* val is dummy.  classdef returns class scope value */
    yarv_iseq_t *klass_iseq;
    VALUE klass;

    if (super == Qnil) {
	super = rb_cObject;
    }
    if (cbase == Qnil) {
	cbase = th_get_cbase(th);
    }

    /* find klass */
    if (rb_const_defined_at(cbase, id)) {
	/* already exist */
	klass = rb_const_get_at(cbase, id);
	if (TYPE(klass) != T_CLASS) {
	    rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
	}

	if (super != rb_cObject) {
	    VALUE tmp;
	    tmp = rb_class_real(RCLASS(klass)->super);

	    if (tmp != super) {
		rb_raise(rb_eTypeError, "superclass mismatch for class %s",
			 rb_id2name(id));
	    }
	}
    }
    else {
	/* new class declaration */
	klass = rb_define_class_id(id, super);
	rb_set_class_path(klass, cbase, rb_id2name(id));
	rb_const_set(cbase, id, klass);
	rb_class_inherited(super, klass);
    }

    GetISeqVal(klass_iseqval, klass_iseq);
    COPY_CREF(klass_iseq->cref_stack, th_cref_push(th, klass, NOEX_PUBLIC));

    /* enter scope */
    push_frame(th, klass_iseq,
	       FRAME_MAGIC_CLASS, klass, (VALUE) GET_DFP() | 0x02,
	       klass_iseq->iseq_encoded, GET_SP(), 0,
	       klass_iseq->local_size);
    RESTORE_REGS();

    INC_VM_STATE_VERSION();
    NEXT_INSN();
#line 1817 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_classdef
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(classdef);
}}
}


INSN_ENTRY(singletonclassdef){

{
  VALUE val;

  VALUE sclass_iseqval = (VALUE)GET_OPERAND(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("singletonclassdef");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_singletonclassdef 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_singletonclassdef_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(singletonclassdef));
  USAGE_ANALYSIS_OPERAND(BIN(singletonclassdef), 0, sclass_iseqval);
{
#line 1077 "./insns.def"
    /* val is dummy.  classdef returns class scope value */
    yarv_iseq_t *sklass_iseq;
    VALUE klass;

    GetISeqVal(sclass_iseqval, sklass_iseq);
    klass = rb_singleton_class(obj);

    COPY_CREF(sklass_iseq->cref_stack, th_cref_push(th, klass, NOEX_PUBLIC));

    /* enter scope */
    push_frame(th, sklass_iseq,
	       FRAME_MAGIC_CLASS, klass, (VALUE) GET_DFP() | 0x02,
	       sklass_iseq->iseq_encoded, GET_SP(), 0,
	       sklass_iseq->local_size);
    RESTORE_REGS();
    
    INC_VM_STATE_VERSION();
    NEXT_INSN();
#line 1866 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_singletonclassdef
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(singletonclassdef);
}}
}


INSN_ENTRY(moduledef){

{
  VALUE val;

  VALUE module_iseqval = (VALUE)GET_OPERAND(2);
  ID id = (ID)GET_OPERAND(1);
  VALUE mbase = TOPN(0);

  DEBUG_ENTER_INSN("moduledef");
  ADD_PC(1+2);
  POPN(1);
  #define CURRENT_INSN_moduledef 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_moduledef_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(moduledef));
  USAGE_ANALYSIS_OPERAND(BIN(moduledef), 0, id);
  USAGE_ANALYSIS_OPERAND(BIN(moduledef), 1, module_iseqval);
{
#line 1108 "./insns.def"
    yarv_iseq_t *module_iseq;
    VALUE module;

    if (mbase == Qnil) {
	mbase = th_get_cbase(th);
    }

    /* find klass */
    if (rb_const_defined_at(mbase, id)) {
	module = rb_const_get_at(mbase, id);
	/* already exist */
	if (TYPE(module) != T_MODULE) {
	    rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
	}
    }
    else {
	/* new module declaration */
	module = rb_define_module_id(id);
	rb_set_class_path(module, mbase, rb_id2name(id));
	rb_const_set(mbase, id, module);
    }

    GetISeqVal(module_iseqval, module_iseq);
    COPY_CREF(module_iseq->cref_stack, th_cref_push(th, module, NOEX_PUBLIC));

    /* enter scope */
    push_frame(th, module_iseq,
	       FRAME_MAGIC_CLASS, module, (VALUE) GET_DFP() | 0x02,
	       module_iseq->iseq_encoded, GET_SP(), 0,
	       module_iseq->local_size);
    RESTORE_REGS();

    INC_VM_STATE_VERSION();
    NEXT_INSN();
#line 1933 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_moduledef
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(moduledef);
}}
}


INSN_ENTRY(send){

{
  VALUE val;

  IC ic = (IC)GET_OPERAND(5);
  num_t op_flag = (num_t)GET_OPERAND(4);
  BLOCKISEQ blockiseq = (BLOCKISEQ)GET_OPERAND(3);
  num_t op_argc = (num_t)GET_OPERAND(2);
  ID id = (ID)GET_OPERAND(1);


  DEBUG_ENTER_INSN("send");
  ADD_PC(1+5);
  #define CURRENT_INSN_send 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_send_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(send));
  USAGE_ANALYSIS_OPERAND(BIN(send), 0, id);
  USAGE_ANALYSIS_OPERAND(BIN(send), 1, op_argc);
  USAGE_ANALYSIS_OPERAND(BIN(send), 2, blockiseq);
  USAGE_ANALYSIS_OPERAND(BIN(send), 3, op_flag);
  USAGE_ANALYSIS_OPERAND(BIN(send), 4, ic);
{
#line 1164 "./insns.def"
    NODE *mn;
    VALUE recv;
    VALUE klass;
    yarv_block_t *blockptr = 0;
    num_t num = op_argc;
    num_t flag = op_flag;

    macro_eval_setup_send_arguments(num, blockptr, flag, blockiseq);
    recv = TOPN(num);
    klass = CLASS_OF(recv);

    mn = eval_method_search(id, klass, ic);

#if CURRENT_INSN_send || CURRENT_INSN_send_SC_xx_ax
#if !YARV_AOT_COMPILED
    if (0) {
	if (0) {
	    LABEL_IS_SC(start_init_in_send_for_opt_1):
	    num = 1;
	    recv = TOPN(1);
	}
	else if (0) {
	    LABEL_IS_SC(start_init_in_send_for_opt_2):
	    num = 2;
	    recv = TOPN(2);
	}
	flag = 0;
	id = tmp_id;
	klass = CLASS_OF(recv);
	blockptr = 0;
	mn = rb_method_node(klass, id);
    }
    if (0) {
	LABEL_IS_SC(start_init_in_super):
	{
	    yarv_iseq_t *iseq = GET_ISEQ();
	    yarv_iseq_t *ip = iseq;

	    num = tmp_num;
	    flag = VM_CALL_FCALL_BIT;
	    recv = GET_SELF();

	    while (ip && !ip->klass) {
		ip = ip->parent_iseq;
	    }

	    if (ip == 0) {
		rb_raise(rb_eNoMethodError, "super called outside of method");
	    }

	    id = ip->defined_method_id;
	    
	    if (ip != ip->local_iseq) {
		/* defined by method_defined() */
		yarv_control_frame_t *lcfp = GET_CFP();

		while (lcfp->iseq != ip) {
		    VALUE *tdfp = GET_PREV_DFP(lcfp->dfp);
		    while (1) {
			lcfp = YARV_PREVIOUS_CONTROL_FRAME(lcfp);
			if (lcfp->dfp == tdfp) {
			    break;
			}
		    }
		}

		/* dirty hack */
		id    = (ID) ((VALUE *)(lcfp+1)->block_iseq)[0];
		klass =      ((VALUE *)(lcfp+1)->block_iseq)[1];

		if (TOPN(num) == Qfalse) {
		    /* for ZSUPER */
		    int i;
		    POPN(num);
		    num = ip->argc;
		    for (i = 0; i < ip->argc; i++) {
			PUSH(lcfp->dfp[i - ip->local_size]);
		    }
		}
	    }
	    klass = eval_search_super_klass(ip->klass, recv);
	    flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
	    blockptr = tmp_blockptr;
	    mn = rb_method_node(klass, id);
	}
    }
    LABEL_IS_SC(start_method_dispatch):
#endif
#endif
    macro_eval_invoke_method(recv, klass, id, num, mn, blockptr);
    YARV_CHECK_INTS();
#line 2062 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_send
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(send);
}}
}


INSN_ENTRY(super){

{
  VALUE val;

  num_t flag = (num_t)GET_OPERAND(3);
  BLOCKISEQ blockiseq = (BLOCKISEQ)GET_OPERAND(2);
  num_t op_argc = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("super");
  ADD_PC(1+3);
  #define CURRENT_INSN_super 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_super_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(super));
  USAGE_ANALYSIS_OPERAND(BIN(super), 0, op_argc);
  USAGE_ANALYSIS_OPERAND(BIN(super), 1, blockiseq);
  USAGE_ANALYSIS_OPERAND(BIN(super), 2, flag);
{
#line 1268 "./insns.def"
#if YARV_AOT_COMPILED
    /* TODO: */
    rb_bug("...");
#else
    tmp_num = op_argc;
    tmp_blockptr = 0;
    macro_eval_setup_send_arguments(tmp_num, tmp_blockptr, flag, blockiseq);
    if (!tmp_blockptr && !(flag & VM_CALL_ARGS_BLOCKARG_BIT)) {
	tmp_blockptr = GET_BLOCK_PTR();
    }
    goto LABEL_IS_SC(start_init_in_super);
#endif
#line 2108 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_super
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(super);
}}
}


INSN_ENTRY(yield){

{
  VALUE val;

  num_t flag = (num_t)GET_OPERAND(2);
  num_t num = (num_t)GET_OPERAND(1);


  DEBUG_ENTER_INSN("yield");
  ADD_PC(1+2);
  #define CURRENT_INSN_yield 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_yield_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(yield));
  USAGE_ANALYSIS_OPERAND(BIN(yield), 0, num);
  USAGE_ANALYSIS_OPERAND(BIN(yield), 1, flag);
{
#line 1293 "./insns.def"
    yarv_block_t *block = GET_BLOCK_PTR();
    yarv_iseq_t *iseq;
    int argc = num;

    if (GET_ISEQ()->local_iseq->type != ISEQ_TYPE_METHOD || block == 0) {
	th_localjump_error("no block given (yield)", Qnil, 0);
    }
    iseq = block->iseq;

    if (BUILTIN_TYPE(iseq) != T_NODE) {
	if (flag & VM_CALL_ARGS_SPLAT_BIT) {
	    VALUE ary = TOPN(0);
	    if (CLASS_OF(ary) != rb_cArray) {
		/* not a [BUG] */
	    }
	    else {
		VALUE *ptr = RARRAY(ary)->ptr;
		VALUE *dst = GET_SP() - 1;
		int i, len = RARRAY(ary)->len;
		for (i = 0; i < len; i++) {
		    dst[i] = ptr[i];
		}
		argc += i - 1;
		INC_SP(i - 1);
	    }
	}

	INC_SP(-argc);
	argc = th_yield_setup_args(iseq, argc, GET_SP());
	INC_SP(argc);

	push_frame(th, iseq,
		   FRAME_MAGIC_BLOCK, block->self, (VALUE) block->dfp,
		   iseq->iseq_encoded, GET_SP(), block->lfp,
		   iseq->local_size - argc);

	reg_cfp->sp -= argc;
	RESTORE_REGS();
	NEXT_INSN();
	/* unreachable */
    }
    else {
	val = th_invoke_yield_cfunc(th, block, block->self,
				    num, STACK_ADDR_FROM_TOP(num));
	POPN(num);
    }
#line 2186 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_yield
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(yield);
}}
}


INSN_ENTRY(end){

{



  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("end");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_end 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_end_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(end));
{
#line 1352 "./insns.def"
#if IGNORE_OPTIMIZE
    if (reg_cfp->sp != reg_cfp->bp) {
	rb_bug("Stack consistency error (sp: %p, bp: %p)",
	       reg_cfp->sp, reg_cfp->bp);
    }
#endif
    YARV_CHECK_INTS();
    POP_CONTROL_STACK_FRAME(th);
    RESTORE_REGS();
#line 2225 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_end
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(end);
}}
}


INSN_ENTRY(finish){

{



  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("finish");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_finish 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_finish_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(finish));
{
#line 1374 "./insns.def"
    th->cfp++;
    return val;
#line 2257 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_finish
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(finish);
}}
}


INSN_ENTRY(throw){

{
  VALUE val;

  num_t throw_state = (num_t)GET_OPERAND(1);
  VALUE throwobj = TOPN(0);

  DEBUG_ENTER_INSN("throw");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_throw 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_throw_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(throw));
  USAGE_ANALYSIS_OPERAND(BIN(throw), 0, throw_state);
{
#line 1393 "./insns.def"
    num_t state = throw_state & 0xff;
    num_t flag = throw_state & 0x8000;
    num_t level = throw_state >> 16;
    val = Qnil;			/* dummy */

    if (state != 0) {
	VALUE *pt;
	int i;
	if (flag != 0) {
	    if (throw_state & 0x4000) {
		pt = (void *)1;
	    }
	    else {
		pt = 0;
	    }
	}
	else {
	    if (state == TAG_BREAK || state == TAG_RETRY) {
		pt = GC_GUARDED_PTR_REF((VALUE *) * GET_DFP());
		for (i = 0; i < level; i++) {
		    pt = GC_GUARDED_PTR_REF((VALUE *) * pt);
		}
	    }
	    else if (state == TAG_RETURN) {
		yarv_control_frame_t *cfp = GET_CFP();
		int is_orphan = 1;
		VALUE *dfp = GET_DFP();
		
		/* check orphan */
		while ((VALUE *) cfp < th->stack + th->stack_size) {
		    if (GET_LFP() == cfp->lfp) {
			is_orphan = 0;
			break;
		    }
		    else if (dfp == cfp->dfp) {
			/* return from lambda{} */
			if (cfp->magic == FRAME_MAGIC_LAMBDA) {
			    is_orphan = 0;
			    break;
			}
			dfp = GC_GUARDED_PTR_REF(*cfp->dfp);
		    }
		    cfp++;
		}
		if (is_orphan) {
		    th_localjump_error("unexpected return", throwobj,
				       TAG_RETURN);
		}

		/* set current lfp */
		pt = GET_LFP();
	    }
	    else {
		rb_bug("isns(throw): unsupport thorw type");
	    }
	}
	th->state = state;
	return (VALUE) NEW_THROW_OBJECT(throwobj, (VALUE) pt, state);
    }
    else {
	/* continue throw */
	VALUE err = throwobj;

	if (FIXNUM_P(err)) {
	    th->state = FIX2INT(err);
	}
	else if (BUILTIN_TYPE(err) == T_NODE) {
	    th->state = GET_THROWOBJ_STATE(err);
	}
	else {
	    th->state = FIX2INT(rb_ivar_get(err, idThrowState));
	}
	return err;
    }
    /* unreachable */
#line 2363 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_throw
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(throw);
}}
}


INSN_ENTRY(jump){

{


  OFFSET dst = (OFFSET)GET_OPERAND(1);


  DEBUG_ENTER_INSN("jump");
  ADD_PC(1+1);
  #define CURRENT_INSN_jump 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_jump_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(jump));
  USAGE_ANALYSIS_OPERAND(BIN(jump), 0, dst);
{
#line 1485 "./insns.def"
    YARV_CHECK_INTS();
    JUMP(dst);
#line 2395 "vm.inc"


#undef CURRENT_INSN_jump
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(jump);
}}
}


INSN_ENTRY(if){

{


  OFFSET dst = (OFFSET)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("if");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_if 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_if_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(if));
  USAGE_ANALYSIS_OPERAND(BIN(if), 0, dst);
{
#line 1500 "./insns.def"
    if (RTEST(val)) {
	YARV_CHECK_INTS();
	JUMP(dst);
    }
#line 2430 "vm.inc"


#undef CURRENT_INSN_if
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(if);
}}
}


INSN_ENTRY(unless){

{


  OFFSET dst = (OFFSET)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("unless");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_unless 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_unless_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(unless));
  USAGE_ANALYSIS_OPERAND(BIN(unless), 0, dst);
{
#line 1517 "./insns.def"
    if (!RTEST(val)) {
	YARV_CHECK_INTS();
	JUMP(dst);
    }
#line 2465 "vm.inc"


#undef CURRENT_INSN_unless
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(unless);
}}
}


INSN_ENTRY(getinlinecache){

{
  VALUE val;

  OFFSET dst = (OFFSET)GET_OPERAND(2);
  IC ic = (IC)GET_OPERAND(1);


  DEBUG_ENTER_INSN("getinlinecache");
  ADD_PC(1+2);
  #define CURRENT_INSN_getinlinecache 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_getinlinecache_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(getinlinecache));
  USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 0, ic);
  USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 1, dst);
{
#line 1539 "./insns.def"
    if (ic->ic_vmstat == GET_VM_STATE_VERSION()) {
	val = ic->ic_value;
	JUMP(dst);
    }
    else {
	/* none */
	val = Qnil;
    }
#line 2505 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_getinlinecache
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(getinlinecache);
}}
}


INSN_ENTRY(onceinlinecache){

{
  VALUE val;

  OFFSET dst = (OFFSET)GET_OPERAND(2);
  IC ic = (IC)GET_OPERAND(1);


  DEBUG_ENTER_INSN("onceinlinecache");
  ADD_PC(1+2);
  #define CURRENT_INSN_onceinlinecache 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_onceinlinecache_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(onceinlinecache));
  USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 0, ic);
  USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 1, dst);
{
#line 1560 "./insns.def"
    if (ic->ic_vmstat) {
	val = ic->ic_value;
	JUMP(dst);
    }
    else {
	/* none */
	val = Qnil;
    }
#line 2545 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_onceinlinecache
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(onceinlinecache);
}}
}


INSN_ENTRY(setinlinecache){

{


  OFFSET dst = (OFFSET)GET_OPERAND(1);
  VALUE val = TOPN(0);

  DEBUG_ENTER_INSN("setinlinecache");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_setinlinecache 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_setinlinecache_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(setinlinecache));
  USAGE_ANALYSIS_OPERAND(BIN(setinlinecache), 0, dst);
{
#line 1581 "./insns.def"
    IC ic = (IC) * (GET_PC() + dst + 1);

    ic->ic_value = val;
    ic->ic_vmstat = GET_VM_STATE_VERSION();
#line 2580 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_setinlinecache
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(setinlinecache);
}}
}


INSN_ENTRY(opt_case_dispatch){

{


  OFFSET else_offset = (OFFSET)GET_OPERAND(2);
  CDHASH hash = (CDHASH)GET_OPERAND(1);
  VALUE key = TOPN(0);

  DEBUG_ENTER_INSN("opt_case_dispatch");
  ADD_PC(1+2);
  POPN(1);
  #define CURRENT_INSN_opt_case_dispatch 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_case_dispatch_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_case_dispatch));
  USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 0, hash);
  USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 1, else_offset);
{
#line 1598 "./insns.def"
    if (0) {
	/* if some === method is overrided */
    }
    else {
	VALUE val;
	if (st_lookup(RHASH(hash)->tbl, key, &val)) {
	    JUMP(FIX2INT(val));
	}
	else {
	    JUMP(else_offset);
	}
    }
#line 2625 "vm.inc"


#undef CURRENT_INSN_opt_case_dispatch
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_case_dispatch);
}}
}


INSN_ENTRY(opt_checkenv){

{





  DEBUG_ENTER_INSN("opt_checkenv");
  ADD_PC(1+0);
  #define CURRENT_INSN_opt_checkenv 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_checkenv_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_checkenv));
{
#line 1623 "./insns.def"
    if (GET_CFP()->bp != GET_DFP() + 1) {
	VALUE *new_dfp = GET_CFP()->bp - 1;
	/* TODO: copy env and clean stack at creating env? */
	*new_dfp = *GET_DFP();
	SET_DFP(new_dfp);
    }
#line 2660 "vm.inc"


#undef CURRENT_INSN_opt_checkenv
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_checkenv);
}}
}


INSN_ENTRY(opt_plus){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_plus");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_plus 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_plus_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_plus));
{
#line 1646 "./insns.def"
    if (0) {

    }
#if 1
    else if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_PLUS)) {
	/* fixnum + fixnum */
	val = (recv + (obj & (~1)));
	if ((~(recv ^ obj) & (recv ^ val)) & 0x80000000) {
	    val = rb_big_plus(rb_int2big(INT2FIX(recv)),
			      rb_int2big(INT2FIX(obj)));
	}
    }
#endif

    else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
	if (0) {
	}
#if 1
	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
		 HEAP_CLASS_OF(obj) == rb_cFloat &&
		 BASIC_OP_UNREDEFINED(FLOAT_PLUS)) {
	    val = rb_float_new(RFLOAT(recv)->value + RFLOAT(obj)->value);
	}
#endif

#if 1
	else if (HEAP_CLASS_OF(recv) == rb_cString &&
		 HEAP_CLASS_OF(obj) == rb_cString &&
		 BASIC_OP_UNREDEFINED(STRING_PLUS)) {
	    val = rb_str_plus(recv, obj);
	}
#endif
#if 1
	else if (HEAP_CLASS_OF(recv) == rb_cArray) {
	    val = rb_ary_plus(recv, obj);
	}
#endif
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):

#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idPLUS, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idPLUS;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 2744 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_plus
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_plus);
}}
}


INSN_ENTRY(opt_minus){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_minus");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_minus 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_minus_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_minus));
{
#line 1712 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_MINUS)) {
	long a, b, c;

	a = FIX2LONG(recv);
	b = FIX2LONG(obj);
	c = a - b;
	val = LONG2FIX(c);

	if (FIX2LONG(val) != c) {
	    val = rb_big_minus(rb_int2big(a), rb_int2big(b));
	}
    }
    else {
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idMINUS, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idMINUS;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 2798 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_minus
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_minus);
}}
}


INSN_ENTRY(opt_mult){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_mult");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_mult 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_mult_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_mult));
{
#line 1748 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_MULT)) {
	long a, b, c;

	a = FIX2LONG(recv);
	if (a == 0) {
	    val = recv;
	}
	else {
	    b = FIX2LONG(obj);
	    c = a * b;
	    val = LONG2FIX(c);

	    if (FIX2LONG(val) != c || c / a != b) {
		val = rb_big_mul(rb_int2big(a), rb_int2big(b));
	    }
	}
    }
    else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
	if (0) {
	}
#if 1
	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
		 HEAP_CLASS_OF(obj) == rb_cFloat) {
	    val = rb_float_new(RFLOAT(recv)->value * RFLOAT(obj)->value);
	}
#endif
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):

	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idMULT, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idMULT;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 2872 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_mult
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_mult);
}}
}


INSN_ENTRY(opt_div){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_div");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_div 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_div_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_div));
{
#line 1804 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_MULT)) {
	long x, y, div;

	x = FIX2LONG(recv);
	y = FIX2LONG(obj);
	{
	    /* copied from numeric.c#fixdivmod */
	    long mod;
	    if (y == 0)
		rb_num_zerodiv();
	    if (y < 0) {
		if (x < 0)
		    div = -x / -y;
		else
		    div = -(x / -y);
	    }
	    else {
		if (x < 0)
		    div = -(-x / y);
		else
		    div = x / y;
	    }
	    mod = x - div * y;
	    if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
		mod += y;
		div -= 1;
	    }
	}
	val = LONG2FIX(div);
    }
    else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
	if (0) {
	}
#if 1
	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
		 HEAP_CLASS_OF(obj) == rb_cFloat) {
	    val = rb_float_new(RFLOAT(recv)->value / RFLOAT(obj)->value);
	}
#endif
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):

	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idDIV, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idDIV;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 2959 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_div
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_div);
}}
}


INSN_ENTRY(opt_mod){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_mod");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_mod 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_mod_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_mod));
{
#line 1873 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_MULT)) {
	long x, y, mod;

	x = FIX2LONG(recv);
	y = FIX2LONG(obj);
	{
	    /* copied from numeric.c#fixdivmod */
	    long div;

	    if (y == 0)
		rb_num_zerodiv();
	    if (y < 0) {
		if (x < 0)
		    div = -x / -y;
		else
		    div = -(x / -y);
	    }
	    else {
		if (x < 0)
		    div = -(-x / y);
		else
		    div = x / y;
	    }
	    mod = x - div * y;
	    if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
		mod += y;
		div -= 1;
	    }
	}
	val = LONG2FIX(mod);
    }
    else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
	if (0) {
	}
	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
		 HEAP_CLASS_OF(obj) == rb_cFloat) {
	    double x = RFLOAT(recv)->value;
	    double y = RFLOAT(obj)->value;
	    double div, mod;

	    /* copied from numeric.c#flodivmod */
#if 0 && defined(HAVE_FMOD) && !__x86_64__	/* temporary */
	    mod = fmod(x, y);
	    printf("-- %f %% %f = %f\n", x, y, mod);
#else
	    {
		double z;

		modf(x / y, &z);
		mod = x - z * y;
	    }
#endif
	    div = (x - mod) / y;
	    if (y * mod < 0) {
		mod += y;
		div -= 1.0;
	    }
	    val = rb_float_new(mod);
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):

	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idMOD, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idMOD;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3066 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_mod
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_mod);
}}
}


INSN_ENTRY(opt_eq){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_eq");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_eq 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_eq_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_eq));
{
#line 1962 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_LT)) {
	long a = FIX2LONG(recv), b = FIX2LONG(obj);

	if (a == b) {
	    val = Qtrue;
	}
	else {
	    val = Qfalse;
	}
    }
    else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
	if (0) {
	}
	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
		 HEAP_CLASS_OF(recv) == rb_cFloat) {
	    double a = RFLOAT(recv)->value;
	    double b = RFLOAT(obj)->value;

	    if (isnan(a) || isnan(b)) {
		val = Qfalse;
	    }
	    else if (a == b) {
		val = Qtrue;
	    }
	    else {
		val = Qfalse;
	    }
	}
	else if (HEAP_CLASS_OF(recv) == rb_cString &&
		 HEAP_CLASS_OF(obj) == rb_cString) {

	    VALUE str1 = recv;
	    VALUE str2 = obj;
	    if (str1 == str2) {
		val = Qtrue;
	    }
	    else if (RSTRING(str1)->len == RSTRING(str2)->len &&
		     rb_memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr,
			       RSTRING(str1)->len) == 0) {
		val = Qtrue;
	    }
	    else {
		val = Qfalse;
	    }
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idEq, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idEq;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3158 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_eq
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_eq);
}}
}


INSN_ENTRY(opt_lt){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_lt");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_lt 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_lt_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_lt));
{
#line 2037 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_LT)) {
	long a = FIX2LONG(recv), b = FIX2LONG(obj);

	if (a < b) {
	    val = Qtrue;
	}
	else {
	    val = Qfalse;
	}
    }
    else {
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idLT, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idLT;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3210 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_lt
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_lt);
}}
}


INSN_ENTRY(opt_le){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_le");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_le 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_le_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_le));
{
#line 2071 "./insns.def"
    if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED(FIXNUM_LT)) {
	long a = FIX2LONG(recv), b = FIX2LONG(obj);

	if (a <= b) {
	    val = Qtrue;
	}
	else {
	    val = Qfalse;
	}
    }
    else {
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idLE, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idLE;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3262 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_le
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_le);
}}
}


INSN_ENTRY(opt_ltlt){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_ltlt");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_ltlt 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_ltlt_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_ltlt));
{
#line 2105 "./insns.def"
    if (0) {
    }
    if (!SPECIAL_CONST_P(recv) && SPECIAL_CONST_P(obj)) {
	if (HEAP_CLASS_OF(recv) == rb_cString &&
	    HEAP_CLASS_OF(obj) == rb_cString &&
	    BASIC_OP_UNREDEFINED(STRING_LTLT)) {
	    val = rb_str_concat(recv, obj);
	}
	else if (HEAP_CLASS_OF(recv) == rb_cArray &&
		 BASIC_OP_UNREDEFINED(ARRAY_LTLT)) {
	    val = rb_ary_push(recv, obj);
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idLTLT, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idLTLT;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3321 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_ltlt
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_ltlt);
}}
}


INSN_ENTRY(opt_aref){

{
  VALUE val;


  VALUE recv = TOPN(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_aref");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_aref 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_aref_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_aref));
{
#line 2146 "./insns.def"
    if (!SPECIAL_CONST_P(recv)) {
	if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
	    val = rb_ary_entry(recv, FIX2LONG(obj));
	}
	else if (HEAP_CLASS_OF(recv) == rb_cHash) {
	    val = rb_hash_aref(recv, obj);
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idAREF, 1, obj);
#else
	PUSH(recv);
	PUSH(obj);
	tmp_id = idAREF;
	goto LABEL_IS_SC(start_init_in_send_for_opt_1);
#endif
    }
#line 3375 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_aref
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_aref);
}}
}


INSN_ENTRY(opt_aset){

{
  VALUE val;


  VALUE recv = TOPN(2);
  VALUE obj = TOPN(1);
  VALUE set = TOPN(0);

  DEBUG_ENTER_INSN("opt_aset");
  ADD_PC(1+0);
  POPN(3);
  #define CURRENT_INSN_opt_aset 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_aset_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_aset));
{
#line 2182 "./insns.def"
    if (!SPECIAL_CONST_P(recv)) {
	if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
	    rb_ary_store(recv, FIX2LONG(obj), set);
	    val = set;
	}
	else if (HEAP_CLASS_OF(recv) == rb_cHash) {
	    rb_hash_aset(recv, obj, set);
	    val = set;
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idASET, 2, obj, set);
#else
	PUSH(recv);
	PUSH(obj);
	PUSH(set);
	tmp_id = idASET;
	goto LABEL_IS_SC(start_init_in_send_for_opt_2);
#endif
    }
#line 3433 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_aset
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_aset);
}}
}


INSN_ENTRY(opt_length){

{
  VALUE val;


  VALUE recv = TOPN(0);

  DEBUG_ENTER_INSN("opt_length");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_opt_length 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_length_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_length));
{
#line 2221 "./insns.def"
    if (!SPECIAL_CONST_P(recv)) {
	if (HEAP_CLASS_OF(recv) == rb_cArray) {
	    val = LONG2NUM(RARRAY(recv)->len);
	}
	else if (HEAP_CLASS_OF(recv) == rb_cString) {
	    val = LONG2NUM(RSTRING(recv)->len);
	}
	else if (HEAP_CLASS_OF(recv) == rb_cHash) {
	    val = INT2FIX(RHASH(recv)->tbl->num_entries);
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idLength, 0);
#else
	val = rb_funcall(recv, idLength, 0);
#endif
    }
#line 3486 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_length
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_length);
}}
}


INSN_ENTRY(opt_succ){

{
  VALUE val;


  VALUE recv = TOPN(0);

  DEBUG_ENTER_INSN("opt_succ");
  ADD_PC(1+0);
  POPN(1);
  #define CURRENT_INSN_opt_succ 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_succ_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_succ));
{
#line 2257 "./insns.def"
    if (SPECIAL_CONST_P(recv)) {
	if (FIXNUM_P(recv) && BASIC_OP_UNREDEFINED(FIXNUM_SUCC)) {
	    const VALUE obj = INT2FIX(1);
	    /* fixnum + INT2FIX(1) */
	    val = (recv + (obj & (~1)));
	    if ((~(recv ^ obj) & (recv ^ val)) & 0x80000000) {
		val = rb_big_plus(rb_int2big(INT2FIX(recv)),
				  rb_int2big(INT2FIX(obj)));
	    }
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    else {
	if (HEAP_CLASS_OF(recv) == rb_cString) {
	    val = rb_str_succ(recv);
	}
	else if (HEAP_CLASS_OF(recv) == rb_cTime) {
	    val = rb_time_succ(recv);
	}
	else {
	    goto INSN_LABEL(normal_dispatch);
	}
    }
    if (0) {
      INSN_LABEL(normal_dispatch):
	/* other */
#ifdef YARV_AOT_COMPILED
	val = rb_funcall(recv, idSucc, 0);
#else
	val = rb_funcall(recv, idSucc, 0);
#endif
    }
#line 3550 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_succ
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_succ);
}}
}


INSN_ENTRY(opt_regexpmatch1){

{
  VALUE val;

  VALUE r = (VALUE)GET_OPERAND(1);
  VALUE obj = TOPN(0);

  DEBUG_ENTER_INSN("opt_regexpmatch1");
  ADD_PC(1+1);
  POPN(1);
  #define CURRENT_INSN_opt_regexpmatch1 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_regexpmatch1_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch1));
  USAGE_ANALYSIS_OPERAND(BIN(opt_regexpmatch1), 0, r);
{
#line 2304 "./insns.def"
    val = rb_reg_match(r, obj);
#line 3582 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_regexpmatch1
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_regexpmatch1);
}}
}


INSN_ENTRY(opt_regexpmatch2){

{
  VALUE val;


  VALUE obj2 = TOPN(1);
  VALUE obj1 = TOPN(0);

  DEBUG_ENTER_INSN("opt_regexpmatch2");
  ADD_PC(1+0);
  POPN(2);
  #define CURRENT_INSN_opt_regexpmatch2 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_regexpmatch2_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch2));
{
#line 2318 "./insns.def"
    if (TYPE(obj2) == T_STRING) {
	val = rb_reg_match(obj1, obj2);
    }
    else {
	val = rb_funcall(obj2, idEqTilde, 1, obj1);
    }
#line 3619 "vm.inc"
  PUSH(val);

#undef CURRENT_INSN_opt_regexpmatch2
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_regexpmatch2);
}}
}


INSN_ENTRY(opt_call_native_compiled){

{





  DEBUG_ENTER_INSN("opt_call_native_compiled");
  ADD_PC(1+0);
  #define CURRENT_INSN_opt_call_native_compiled 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_opt_call_native_compiled_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(opt_call_native_compiled));
{
#line 2337 "./insns.def"
#if __GNUC__ && OPT_USE_JIT_COMPILE
    yarv_iseq_t *iseq = GET_ISEQ();
    void *label = (void *)iseq->jit_compiled;

    breakpoint();
    SET_PC(iseq->iseq_orig);
    goto *label;
#else
    rb_bug("opt_call_native_compiled is not supported");
#endif
#line 3658 "vm.inc"


#undef CURRENT_INSN_opt_call_native_compiled
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(opt_call_native_compiled);
}}
}


INSN_ENTRY(bitblt){

{
  VALUE ret;




  DEBUG_ENTER_INSN("bitblt");
  ADD_PC(1+0);
  #define CURRENT_INSN_bitblt 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_bitblt_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(bitblt));
{
#line 2360 "./insns.def"
    ret = rb_str_new2("a bit of bacon, lettuce and tomato");
#line 3688 "vm.inc"
  PUSH(ret);

#undef CURRENT_INSN_bitblt
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(bitblt);
}}
}


INSN_ENTRY(answer){

{
  VALUE ret;




  DEBUG_ENTER_INSN("answer");
  ADD_PC(1+0);
  #define CURRENT_INSN_answer 1
  #define INSN_IS_SC()     0
  #define INSN_LABEL(lab)  LABEL_answer_##lab
  #define LABEL_IS_SC(lab) LABEL_##lab##_##t
  USAGE_ANALYSIS_INSN(BIN(answer));
{
#line 2374 "./insns.def"
    ret = INT2FIX(42);
#line 3718 "vm.inc"
  PUSH(ret);

#undef CURRENT_INSN_answer
#undef INSN_IS_SC
#undef INSN_LABEL
#undef LABEL_IS_SC
  END_INSN(answer);
}}
}


