private int getAvailableLabel() {
    int candidate = getMinimumUnreservedLabel();

    for (BasicBlock bb : result) {
      int label = bb.getLabel();
      if (label >= candidate) {
        candidate = label + 1;
      }
    }

    return candidate;
  }
Gets an unreserved and available label. Labels are distributed this way:

<ul>
  <li>[0, maxLabel[ are the labels of the blocks directly corresponding to the input bytecode.
  <li>[maxLabel, maxLabel + method.getCatches().size()[ are reserved for exception setup
      blocks.
  <li>[maxLabel + method.getCatches().size(), maxLabel + method.getCatches().size() +
      SPECIAL_LABEL_COUNT[ are reserved for special blocks, ie param assignement, return and
      synch blocks.
  <li>[maxLabel method.getCatches().size() + SPECIAL_LABEL_COUNT, getAvailableLabel()[ assigned
      labels. Note that some of the assigned labels may not be used any more if they were
      assigned to a block that was deleted since.
</ul>

@return {@code >= 0;} an available label with the guaranty that all greater labels are also
    available.
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/Ropper.java