#!/bin/sh -e

nonflags=($@)
nonflags=(${nonflags[@]##-*})
lastfile=${nonflags[@]: -1}

case "$(basename -- $lastfile)" in
  (e-attachment-store.c | audio-inline.c)
    # CIL tracker bug #2815129
    exec gcc "$@" ;;
  (*)
    exec /usr/bin/sampler-cc \
    --threads \
    --sampler-scheme=branches \
    --sampler-scheme=g-object-unref \
    --sampler-scheme=returns \
    "$@" ;;
esac
