  We compute the index of BPS states for two stacks of D4-branes wrapped on
ample divisors and overlapping over a compact Riemann surface inside
non-compact Calabi-Yau 3-fold. This index is given in terms of U(N) x U(M)
q-deformed Yang Mills theory with bifundamental matter. From the factorization
in the limit of large D4 charge, we argue that our result computes the jump in
the index of BPS states across the wall of the marginal stability for the split
flow of a D4 brane fragmenting into a pair of D4 branes.
