+ if (super == NULL || super->vftbl->subtype_depth >= DISPLAY_SIZE) {
+ // Represents the following semantic:
+ // if (*(s->vftbl + t->vftbl->subtype_offset) == t->vftbl) true;
+ // Preconditions:
+ // REG_ITMP2==s->vftbl; REG_ITMP3==t->vftbl;
+ M_LDR_INTERN(REG_ITMP1, REG_ITMP3, OFFSET(vftbl_t, subtype_offset));
+ M_LDR_REG(REG_ITMP1, REG_ITMP2, REG_ITMP1);
+ M_CMP(REG_ITMP1, REG_ITMP3);
+ emit_label_beq(cd, BRANCH_LABEL_6); /* true */
+
+ // Represents the following semantic:
+ // if (t->vftbl->subtype_offset != OFFSET(vftbl_t, subtype_display[DISPLAY_SIZE])) false;
+ // Preconditions:
+ // REG_ITMP3==t->vftbl;
+ if (super == NULL) {
+ M_LDR_INTERN(REG_ITMP1, REG_ITMP3, OFFSET(vftbl_t, subtype_offset));
+ M_CMP_IMM(REG_ITMP1, OFFSET(vftbl_t, subtype_display[DISPLAY_SIZE]));
+ emit_label_bne(cd, BRANCH_LABEL_7); /* false */
+ }
+
+ // Represents the following semantic:
+ // if (s->vftbl->subtype_depth < t->vftbl->subtype_depth) false;
+ // Preconditions:
+ // REG_ITMP2==s->vftbl; REG_ITMP3==t->vftbl;
+ M_LDR_INTERN(REG_ITMP1, REG_ITMP2, OFFSET(vftbl_t, subtype_depth));
+ M_LDR_INTERN(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, subtype_depth));
+ M_CMP(REG_ITMP1, REG_ITMP3);
+ emit_label_blt(cd, BRANCH_LABEL_8); /* false */
+
+ // Represents the following semantic:
+ // if (s->vftbl->subtype_overflow[t->vftbl->subtype_depth - DISPLAY_SIZE] != t->vftbl) false;
+ // Preconditions:
+ // REG_ITMP2==s->vftbl; REG_ITMP3==t->vftbl->subtype_depth;
+ M_LDR_INTERN(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, subtype_overflow));
+ M_ADD(REG_ITMP2, REG_ITMP2, REG_LSL(REG_ITMP3, 2)); /* REG_ITMP2 = REG_ITMP2 + 4 * REG_ITMP3 */
+ M_LDR_INTERN(REG_ITMP2, REG_ITMP2, -DISPLAY_SIZE * SIZEOF_VOID_P);
+ M_DSEG_LOAD(REG_ITMP3, disp); /* reload REG_ITMP3, was destroyed */
+ M_CMP(REG_ITMP2, REG_ITMP3);
+
+ emit_label(cd, BRANCH_LABEL_6);
+ if (super == NULL)
+ emit_label(cd, BRANCH_LABEL_7);
+ emit_label(cd, BRANCH_LABEL_8);
+
+ /* If d == REG_ITMP2, then it's destroyed */
+ if (d == REG_ITMP2)
+ M_EOR(d, d, d);
+ M_MOVEQ_IMM(1, d);
+ }
+ else {
+ // Represents the following semantic:
+ // *(s->vftbl + t->vftbl->subtype_offset) == t->vftbl;
+ // Preconditions:
+ // REG_ITMP2==s->vftbl; REG_ITMP3==t->vftbl;
+ M_ALD(REG_ITMP2, REG_ITMP2, super->vftbl->subtype_offset);
+ M_CMP(REG_ITMP2, REG_ITMP3);
+ /* If d == REG_ITMP2, then it's destroyed */
+ if (d == REG_ITMP2)
+ M_EOR(d, d, d);
+ M_MOVEQ_IMM(1, d);
+ }