Program: 91493
Project: 91493
Buggy source:
public synchronized void put(long h,K key,V value,boolean ifPresent,boolean ifAbsent){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean foundSmall=false, foundLarge=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      final DirectStore store=map.get(key);
      if (store == null) {
        if (ifPresent && !ifAbsent)         return;
        break;
      }
      if (ifAbsent)       return;
      bytes.storePositionAndSize(store,0,store.size());
      foundLarge=true;
      break;
    }
 else {
      bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
      K key2=getKey();
      if (equals(key,key2)) {
        if (ifAbsent && !ifPresent)         return;
        foundSmall=true;
        break;
      }
    }
  }
  tmpBytes.reset();
  if (csKey)   tmpBytes.writeUTFΔ((CharSequence)key);
 else   tmpBytes.writeObject(key);
  long startOfValuePos=tmpBytes.position();
  if (bytesMarshallable)   ((BytesMarshallable)value).writeMarshallable(tmpBytes);
 else   tmpBytes.writeObject(value);
  long size=tmpBytes.position();
  if (size <= smallEntrySize) {
    if (foundSmall) {
      bytes.position(0);
      bytes.write(tmpBytes,0,size);
      return;
    }
 else     if (foundLarge) {
      remove(hash,key);
    }
    int position=(int)(h & (entriesPerSegment - 1));
    int free=usedSet.nextClearBit(position);
    if (free >= entriesPerSegment)     free=usedSet.nextClearBit(0);
    if (free < entriesPerSegment) {
      bytes.storePositionAndSize(store,free * smallEntrySize,smallEntrySize);
      bytes.write(tmpBytes,0,size);
      smallMap.put(hash,free);
      usedSet.set(free);
      this.size++;
      return;
    }
  }
  if (foundSmall) {
    remove(hash,key);
  }
 else   if (foundLarge) {
    if (bytes.capacity() <= size || bytes.capacity() - size < (size >> 3)) {
      bytes.write(tmpBytes,startOfValuePos,size);
      return;
    }
    remove(hash,key);
  }
  size=size - startOfValuePos;
  DirectStore store=new DirectStore(bmf,size);
  bytes.storePositionAndSize(store,0,size);
  bytes.write(tmpBytes,startOfValuePos,size);
  map.put(key,store);
  offHeapUsed+=size;
  this.size++;
}

Fixed version (ground truth):
public synchronized void put(long h,K key,V value,boolean ifPresent,boolean ifAbsent){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean foundSmall=false, foundLarge=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      Object key2=key instanceof CharSequence ? key.toString() : key;
      final DirectStore store=map.get(key2);
      if (store == null) {
        if (ifPresent && !ifAbsent)         return;
        break;
      }
      if (ifAbsent)       return;
      bytes.storePositionAndSize(store,0,store.size());
      foundLarge=true;
      break;
    }
 else {
      bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
      K key2=getKey();
      if (equals(key,key2)) {
        if (ifAbsent && !ifPresent)         return;
        foundSmall=true;
        break;
      }
    }
  }
  tmpBytes.reset();
  if (csKey)   tmpBytes.writeUTFΔ((CharSequence)key);
 else   tmpBytes.writeObject(key);
  long startOfValuePos=tmpBytes.position();
  if (bytesMarshallable)   ((BytesMarshallable)value).writeMarshallable(tmpBytes);
 else   tmpBytes.writeObject(value);
  long size=tmpBytes.position();
  if (size <= smallEntrySize) {
    if (foundSmall) {
      bytes.position(0);
      bytes.write(tmpBytes,0,size);
      return;
    }
 else     if (foundLarge) {
      remove(hash,key);
    }
    int position=(int)(h & (entriesPerSegment - 1));
    int free=usedSet.nextClearBit(position);
    if (free >= entriesPerSegment)     free=usedSet.nextClearBit(0);
    if (free < entriesPerSegment) {
      bytes.storePositionAndSize(store,free * smallEntrySize,smallEntrySize);
      bytes.write(tmpBytes,0,size);
      smallMap.put(hash,free);
      usedSet.set(free);
      this.size++;
      return;
    }
  }
  if (foundSmall) {
    remove(hash,key);
  }
 else   if (foundLarge) {
    if (bytes.capacity() <= size || bytes.capacity() - size < (size >> 3)) {
      bytes.write(tmpBytes,startOfValuePos,size);
      return;
    }
    remove(hash,key);
  }
  size=size - startOfValuePos;
  DirectStore store=new DirectStore(bmf,size);
  bytes.storePositionAndSize(store,0,size);
  bytes.write(tmpBytes,startOfValuePos,size);
  K key2=key instanceof CharSequence ? (K)key.toString() : key;
  map.put(key2,store);
  offHeapUsed+=size;
  this.size++;
}