Program: 30641
Project: 30641
Buggy source:
public IAEItemStack request(MECraftingInventory inv,long l,BaseActionSource src) throws CraftBranchFailure, InterruptedException {
  job.handlepausing();
  what.setStackSize(l);
  if (slot >= 0 && parent != null && parent.details.isCraftable()) {
    for (    IAEItemStack fuzz : inv.getItemList().findFuzzy(what,FuzzyMode.IGNORE_ALL)) {
      if (parent.details.isValidItemForSlot(slot,fuzz.getItemStack(),world)) {
        fuzz=fuzz.copy();
        fuzz.setStackSize(l);
        IAEItemStack available=inv.extractItems(fuzz,Actionable.MODULATE,src);
        if (available != null) {
          if (!exhausted)           used.add(job.checkUse(available));
          bytes+=available.getStackSize();
          l-=available.getStackSize();
          if (l == 0)           return available;
        }
      }
    }
  }
 else {
    IAEItemStack available=inv.extractItems(what,Actionable.MODULATE,src);
    if (available != null) {
      if (!exhausted)       used.add(job.checkUse(available));
      bytes+=available.getStackSize();
      l-=available.getStackSize();
      if (l == 0)       return available;
    }
  }
  exhausted=true;
  if (nodes.size() == 1) {
    CraftingTreeProcess pro=nodes.get(0);
    while (pro.possible && l > 0) {
      pro.request(inv,pro.getTimes(l,pro.getAmountCrafted(what).getStackSize()),src);
      what.setStackSize(l);
      IAEItemStack available=inv.extractItems(what,Actionable.MODULATE,src);
      if (available != null) {
        bytes+=available.getStackSize();
        l-=available.getStackSize();
        if (l <= 0)         return available;
      }
 else       pro.possible=false;
    }
  }
 else   if (nodes.size() > 1) {
    for (    CraftingTreeProcess pro : nodes) {
      try {
        while (pro.possible && l > 0) {
          MECraftingInventory subInv=new MECraftingInventory(inv,true,true,true);
          pro.request(subInv,1,src);
          subInv.commit(src);
          what.setStackSize(l);
          IAEItemStack available=inv.extractItems(what,Actionable.MODULATE,src);
          if (available != null) {
            bytes+=available.getStackSize();
            l-=available.getStackSize();
            if (l <= 0)             return available;
          }
 else           pro.possible=false;
        }
      }
 catch (      CraftBranchFailure fail) {
        pro.possible=true;
      }
    }
  }
  if (sim) {
    missing+=l;
    bytes+=l;
    IAEItemStack rv=what.copy();
    rv.setStackSize(l);
    return rv;
  }
  throw new CraftBranchFailure(what,l);
}

Fixed version (ground truth):
public IAEItemStack request(MECraftingInventory inv,long l,BaseActionSource src) throws CraftBranchFailure, InterruptedException {
  job.handlepausing();
  List<IAEItemStack> thingsUsed=new LinkedList();
  what.setStackSize(l);
  if (slot >= 0 && parent != null && parent.details.isCraftable()) {
    for (    IAEItemStack fuzz : inv.getItemList().findFuzzy(what,FuzzyMode.IGNORE_ALL)) {
      if (parent.details.isValidItemForSlot(slot,fuzz.getItemStack(),world)) {
        fuzz=fuzz.copy();
        fuzz.setStackSize(l);
        IAEItemStack available=inv.extractItems(fuzz,Actionable.MODULATE,src);
        if (available != null) {
          if (!exhausted) {
            IAEItemStack is=job.checkUse(available);
            thingsUsed.add(is.copy());
            used.add(is);
          }
          bytes+=available.getStackSize();
          l-=available.getStackSize();
          if (l == 0)           return available;
        }
      }
    }
  }
 else {
    IAEItemStack available=inv.extractItems(what,Actionable.MODULATE,src);
    if (available != null) {
      if (!exhausted) {
        IAEItemStack is=job.checkUse(available);
        thingsUsed.add(is.copy());
        used.add(is);
      }
      bytes+=available.getStackSize();
      l-=available.getStackSize();
      if (l == 0)       return available;
    }
  }
  exhausted=true;
  if (nodes.size() == 1) {
    CraftingTreeProcess pro=nodes.get(0);
    while (pro.possible && l > 0) {
      pro.request(inv,pro.getTimes(l,pro.getAmountCrafted(what).getStackSize()),src);
      what.setStackSize(l);
      IAEItemStack available=inv.extractItems(what,Actionable.MODULATE,src);
      if (available != null) {
        bytes+=available.getStackSize();
        l-=available.getStackSize();
        if (l <= 0)         return available;
      }
 else       pro.possible=false;
    }
  }
 else   if (nodes.size() > 1) {
    for (    CraftingTreeProcess pro : nodes) {
      try {
        while (pro.possible && l > 0) {
          MECraftingInventory subInv=new MECraftingInventory(inv,true,true,true);
          pro.request(subInv,1,src);
          what.setStackSize(l);
          IAEItemStack available=subInv.extractItems(what,Actionable.MODULATE,src);
          if (available != null) {
            subInv.commit(src);
            bytes+=available.getStackSize();
            l-=available.getStackSize();
            if (l <= 0)             return available;
          }
 else           pro.possible=false;
        }
      }
 catch (      CraftBranchFailure fail) {
        pro.possible=true;
      }
    }
  }
  if (sim) {
    missing+=l;
    bytes+=l;
    IAEItemStack rv=what.copy();
    rv.setStackSize(l);
    return rv;
  }
  for (  IAEItemStack o : thingsUsed) {
    job.refund(o.copy());
    o.setStackSize(-o.getStackSize());
    used.add(o);
  }
  throw new CraftBranchFailure(what,l);
}