What was thought to be a relatively straightforward summer for the Miami Heat has hit a snag over contract talks with Dwyane Wade.

Wade must decide by June 29 whether to opt out of the final year of a contract that would pay him $16.1 million next season.

The star shooting guard hinted last month that he intended to exercise his option, a heavily-preferred scenario for the Heat organization. However, the 33-year-old is now considering the possibility of opting out in order to secure one last lucrative long-term deal, and is reportedly willing to test the open market and leave the Heat, if necessary, in order to get it.

There is believed to be a sizable gap between what Wade is demanding and what the Heat is offering. That impasse has led to speculation that Wade’s long-term future with the Heat is in doubt.

Despite the uncertainty, it seems highly unlikely that the Heat would part ways with the biggest star in its history. Neither Wade nor the Heat would want such an outcome (nor would any other team in the NBA which Wade would consider likely be willing to pay him what he seeks anyway). Such tensions are merely a tactic employed by either party to gain leverage during the very early stages of what figures to be a challenging multi-month negotiation. But there are real concerns that underlie such posturing.

Wade’s desire for one last big contract from the Heat can easily be justified: He has guided the Heat to five NBA finals and three titles, he played a critical role in luring LeBron James and Chris Bosh to Miami, he has comported himself with class over the course of a brilliant twelve-year career, and he has sacrificed substantial salary in order to give the Heat flexibility over the past five years.

Last summer, in order to give the Heat flexibility to augment its roster, Wade opted out of the final two years of a contract that would have paid him $41.8 million. He instead accepted a rather shocking two-year, $31.1 million deal, which included a player option for next season.

As a result, over the first five years of what might have otherwise been the full six-year maximum contract we were all eager to give him to stay in the summer of 2010, Wade has now sacrificed a total of $18 million for the betterment of his team. If he were to exercise his option, that sacrifice would increase to $27 million.

It only seems natural, then, that Wade would want a show of appreciation in return.

Wade reportedly wants to opt out this summer, with the hope that the Heat would give him a three-year deal that would extend past his 36th birthday. The Heat would love to give it to him in theory, but paying him what he’s seeking would present significant challenges in practice.

Since Wade executed his two-year contract last July, things have changed substantially for Miami.

In November, the Heat signed what it hopes is its center of the future in Whiteside. Whiteside was signed to a two-year minimum salary contract that extends through the 2015-16 NBA season. He has thus far rewarded the team with boundless energy, youthful exuberance, and quick ascent. In his limited experience, Whiteside has been rampaging through the NBA with reckless abandon, utilizing his massive 7-foot-7-inch wingspan to throw down monstrous alley-oop dunks, snatch rebounds out of the sky from high above the rim, swat basketballs as Godzilla would planes, and generally wreak havoc on both ends of the floor.

In February, the Heat acquired what it hopes is its point guard of the future in Goran Dragic. Dragic will opt out of the final year of his four-year contract that would have paid him $7.5 million. He has indicated that he enjoys Miami, and will remain with the Heat if his financial goals are met. The Heat paid a steep price to get him, headlined by two future first round draft picks, which tells you everything you need to know about how willing they will be to pay him his money. Dragic will be eligible to receive a five-year deal, with a starting salary of as much as $18.8 million and a total payout of as much as $108 million, though for a player entering his age 29 season, it could prove to be an overpay, even with the cap due to rise dramatically. A smaller deal which pays out the max in the first year but declines in the second year before again maxing out would be a nice concession by Dragic, in that it would give the Heat more flexibility for the summer of 2016 but still pay out a lofty $97 million. The most any other team can give him: four years, $80 million.

The Heat is preparing for a future around Dragic, Chris Bosh, and Whiteside, or at least for the possibility of doing so if Whiteside should have a second consecutive breakout season next year. The Heat therefore cannot make any decisions this summer that would compromise its ability to retain Whiteside when he becomes a free agent the following summer.

If he continues to progress along his current trajectory, Whiteside can expect a massive payday. That includes the possibility of anything up to a maximum contract. And because the Heat will not have accrued his full Bird rights (explained in detail here), they’ll need to set aside cap space to give it to him.

Only after securing Dragic and ensuring that it will have adequate cap space to retain Whiteside can the Heat circle back to demands of Wade.

So let’s walk through the math that Pat Riley and the Heat are currently doing.

The league issued initial salary cap guidance for the 2016-17 season last month of $89.0 million.

The Heat, as of now, only has two players under guaranteed contract for the 2016-17 NBA season: Bosh at $23.7 million and Josh McRoberts at $5.8 million. To that, add as much as $20.2 million if Dragic receives a max contract and as much as $2.6 million if the Heat keeps the tenth overall pick in the coming draft. That’s four players, at up to $52.4 million.

So: $89.0 million – $52.4 million = $36.7 million of cap space remaining.

We can now subtract a potential maximum salary for Whiteside in order to see what’s left over for Wade. A max for Whiteside is currently projected at $20.9 million. After incorporating roster charges, that leaves just $12.5 million for Wade.

The huge gulf facing the Heat in its negotiations with Wade is therefore one of basic mathematics: It cannot ensure its ability to retain Whiteside the following summer unless it offers Wade a contract that pays out no more than $12.5 million in 2016-17.

The Heat may not be willing to offer Wade even that much. Consider this: Offering that much would leave the Heat with no remaining room below the cap to address the small forward position or bolster its bench, it would require the Heat to decline its team option on Shabazz Napier for the 2016-17 season (for which the Heat has until Nov. 2 to decide whether to do), and it would not allow the Heat to sign any players to multi-year contracts this summer (including Luol Deng, as well as anyone signed with the mid-level exception). That’s a lot to sacrifice for a player whose best days are surely behind him. It would also leave no flexibility to account for the possibility that the finalized cap figure will ultimately come in below $89.0 million, which, given how it was derived, is a distinct possibility(1).

The largest three-year contract the Heat can possibly build around a $12.5 million salary for the 2016-17 season would be $40 million. But, given all the tangential factors, it would not be all that surprising to suspect the Heat’s preliminary offer to Wade would be in the range of just $30 million over three years with a $10 million cap hit for the 2016-17 season.

With Wade holding a $16.1 million option for next season, and with the cap expected to skyrocket the season after that, one could assume Wade is perhaps seeking somewhere closer to $60 million over those same three years.

That’s a sizable gap.

How would you bridge it? There is no easy answer.

***

The most intuitive way to bridge the gap without sacrificing its flexibility for the summer of 2016 would be to create savings elsewhere, and apply those savings to Wade.

From where might those savings come?

Bosh is under long-term guaranteed contract. By rule, existing contracts cannot be modified to provide less money in any season. So he’s out. That leaves only Dragic, McRoberts and the tenth overall pick in the upcoming draft.

Dragic is a real possibility. Given that the Heat can offer him as much as $108 million over five years while no other team can offer more than $80 million over four, it seems imminently possible, perhaps even likely, that Dragic will ultimately be willing to accept less than a full maximum contract from the Heat. The question is how much less. The Heat could essentially leverage the extra year in its arsenal to offer more total money than can anyone else, but at a lower average salary. If Dragic were to accept, say, a 10 percent discount from the max, which would still pay out a whopping $97 million (as structured above), it would produce $3 million of savings for the summer of 2016. Trading McRoberts could save another $5 million. Trading the draft pick yet another $2 million. That’s a possible $10 million total.

Which means that if the Heat wants to pay Wade just $10 million per year but Wade wants closer to $20 million, Riley could potentially make up the entire difference by asking Dragic to take less than a max contract and trading both McRoberts and the team’s upcoming draft pick. But even if all that were possible, do you really want to be destroying the team’s depth like that? And if the Heat were to be able to generate that kind of savings, do you really want to be redeploying it on an aging Wade rather than a building block for the future?

After all, Riley’s vision is surely not focused solely on retaining Dragic, Bosh and Whiteside but also on building depth around them.

***

Another possible way for the Heat to bridge the gap without sacrificing its flexibility for the summer of 2016 would be to replace Wade’s $16.1 million salary with a larger one for next season, and then re-sign him for solid, but not huge, money for another two seasons after that. The Heat figures to be capped out this summer anyway – no matter how it proceeds with Wade, the Heat will almost certainly have access only to its drafts picks and the $3.4 million taxpayer mid-level exception – so doing so would not sacrifice any flexibility for this summer either.

If Wade were to decline his option, he would be eligible for an up to $22.0 million projected maximum salary for the 2015-16 season (which would also be his cap hold).

Having Wade opt out of the $16.1 million for the final year of his contract and replacing it with a new one year contract at $22.0 million would produce a $6 million windfall, which would represent a huge gesture on the part of the Heat organization, and could serve as an impetus for Wade to return the favor by tabling his discussions over a multi-year contract for one more season, at a point in time when the Heat itself would have more clarity as to what it could offer. It would seemingly be a nice solution for both sides.

Here’s how it would work: Let’s assume that the Heat is prepared to offer Wade $30 million over three years, while Wade is seeking $60 million. Maybe they come to an agreement at three years, $43 million. If you break that payout up into a pair of consecutive contracts, the Heat could offer Wade a one-year $22 million max deal this summer, followed by a two-year $21 million deal the year after. In this scenario, both sides win. Wade gets his $43 million. The Heat reduces his 2016-17 salary to the $10.0 million it was hoping for(2).

But here’s the thing: It’s expensive.

The Heat is likely to be a taxpayer next season. And that will carry with it severe consequences.

If the Heat exceeds the tax threshold next season, it would become the NBA’s first team to ever pay the “repeater tax,” which adds an extra $1 for every dollar a team is over the luxury tax threshold, over and above the incremental tax rates that would apply. The repeater tax is triggered when a team has paid the tax in four of the previous five seasons. The Heat has paid the tax in three of the last four years.

For every dollar by which the Heat exceeds the tax level next season, it will need to pay at least $2.50 in taxes. That rate increases to $2.75 per dollar for any incremental amount by which the Heat exceeds the tax by $5 million, increasing further to $3.50 per dollar for any incremental amount by which the Heat exceeds the tax by $10 million, increasing further to $4.25 per dollar for any incremental by which the Heat exceeds the tax by $15 million, and increasing an additional $0.50 for each $5 million increment thereafter.

If Deng exercises his player option for next season and Dragic re-signs at or near the max, granting Wade such a large raise would push the Heat’s team salary to as much as $100 million or more (excluding potential trade scenarios). A team salary at that level would trigger a tax payment of more than $58 million.

The total payroll obligation — $158 million – would shatter the team’s previous all-time record of $103 million from 2013-14, and that’s before accounting for the possible utilization of the mid-level exception.

Whether Arison would be willing to spend at those elevated levels remains unclear(3).

The Heat can, however, alleviate the high tax burden that giving Wade the max would create by trading non-essential pieces this summer. Among those for whom the Heat will likely pursue trade options include Mario Chalmers and Chris Andersen, who have expiring contracts of $4.3 million and $5.0 million, respectively. Such moves would have no impact on the summer of 2016, but could more than offset the impact of giving Wade an extra $6 million next year in order to get him to the max.

***

If the Heat remains committed to keeping Wade’s 2016-17 salary at just $10 million in order to preserve the necessary cap space to re-sign Whiteside the following summer even at the max, it can offer Wade just three basic alternatives(4):

Reject the player option, and sign a three-year contract with a total payout of $32 million: $10.8 million in 2015-16, $10.0 million in 2016-17, and $10.8 million in 2017-18. Neither Wade nor the Heat would prefer this approach. Exercise the player option, and sign a two-year $21 million contract the following summer, for a combined payout of $37 million: $16.1 million in 2015-16, $10.0 million in 2016-17, and $10.8 million in 2017-18. The Heat heavily prefers this approach, but Wade is likely seeking a higher total payout. This approach also requires that Wade have a ton of trust in Riley, and the leap of faith that he will ultimately stick to his word. Reject the player option, sign a one-year $22 million max contract this summer, and sign a two-year $21 million contract the following summer, for a combined payout of $43 million. This may be closer to the range of what Wade would ultimately be willing to accept. But, given the luxury tax consequences for next season, it would likely be way to0 expensive for the Heat.

If none of these options is acceptable to both parties, and if the impass remains, the Heat may be forced to give Wade something of a soft-spoken ultimatum: accept the $16.1 million player option for next season, or receive no guarantee to be back with the Heat for a thirteenth season.

If Wade does not return, the Heat would have a couple of options with which to fill the position with a player more ideally suited as a complement to Dragic in the backcourt. Regardless of Wade’s decision, the team is likely to seek out options to address a need at the position in the form of a player who has the ability to space the floor. The Heat ranked 24th in three-point field goal percentage this past season, at 33.4 percent.

In that respect, Kentucky shooting guard Devin Booker represents an intriguing candidate for the Heat’s selection with the 10th pick in the draft next month. While there may be players in the draft who might have bigger overall impacts, no one player has a skill more tailor-made for his team than would be Booker’s elite three-point shooting for the Heat. Booker is, quite simply, the best three-point shooter in the draft. His tremendous mechanics and his quick, smooth and high release suggest it will transition well to the pro game. But he’s also a deceptive athlete and a solid defender. He helped his draft stock during agility testing in the combine, coming away with the fastest lane agility score of any player in attendance. Part of Booker’s intrigue is in his ability to be a two-way player. Another part is his age. Booker is the youngest player to register for the draft (he won’t turn 19 years old until Oct. 30), a fact that belies his maturity.

While a Wade departure would not provide the Heat with cap space (even if Deng were to leave as well), it would provide the Heat with access to the larger $5.5 million mid-level exception as well.

A Wade departure could conceivably prove beneficial for the Heat over the years to come. A floor-spacing shooting guard, whether it’s a drafted player such as Booker or a free agent to be signed with the mid-level exception, could open up the floor substantially alongside Bosh for a penetrating point guard as is Dragic as well as provide more space for a low post center as is Whiteside. It could also free up substantial cap space for the Heat to make a run at an A-list free agent in the summer of 2016, to fill what could then become the lone remaining need at small forward. The Heat would project to have the same $12 million it would have for Wade, but that could increase dollar-for-dollar if Dragic and/or Whiteside ultimately command less than a maximum salary and by a further $5 million if McRoberts is ultimately traded. In fact, it’s not all that difficult to conceive of a scenario whereby the Heat retain Dragic, a drafted shooting guard such as Booker, Bosh and Whiteside and still possess enough room under the cap to dangle a $20+ million maximum salary at an elite small forward in the summer of 2016 (maybe even, if the stars align, Kevin Durant).

Riley has frequently mentioned the desire to have Wade eventually retire as a member of the team. But Wade and the Heat have been down this road before. Although Wade’s negotiations appeared amicable and uneventful last summer, there was concern in 2010 he would leave in that offseason, when, amid that free agency, he took a meeting with his hometown Chicago Bulls.

It seems far too premature at present to suggest that Wade will even host such exploratory conversations with outside teams this time around, let alone leave, but the issues are both understandable and challenging to resolve. A Wade departure, depending upon your perspective, could then be either beneficial or extremely damaging.

What was once thought to be a relatively straightforward summer has become far more unpredictable.

Notes:

(1) Under normal circumstances, the projected $89 million cap figure would be a solid baseline from which to start. However, the league’s current salary cap situation is rather unique in that not all of the massive projected cap increase from $67 million in 2015-16 to $89 million in 2016-17 is based on revenues. Instead, $3.3 million of it based upon an assumption made by the league that NBA teams will not ramp up spending on player salaries fast enough next season to accommodate the rising cap from $63.1 million this past season to $67 million next season, which in turn triggers a salary cap adjustment. If teams ramp up their spending more than expected this summer, the projected $89 million salary cap for 2016-17 could fall substantially.

(2) This approach is technically illegal. It is against collective bargaining rules to negotiate future contracts that do not start the following season, which means that Dwyane Wade and the Miami Heat could negotiate the one-year maximum deal this summer but not the follow-up two-year deal. However, this is not to say that such negotiations do not happen all the time across the NBA anyway. If such negotiations are not reduced to paper, it is very difficult to prove they ever existed.

By the way, it is also technically illegal for Wade and the Heat to be speaking right now. Wade is still under contract, and is not eligible for an extension. According to collective bargaining rules, no team (including a player’s current team) can speak to any player who is currently under contract about a new contract (i.e., not an extension) until the start of free agency on July 1st.

(3) Another alternative is for Wade to sign a four, or even five, year deal. While the Over-36 rules would complicate a five-year deal, the cap-related consequences of such an Over-36 contract could actually benefit the Heat.

(4) This scenario presupposes that the Heat want to limit Dwyane Wade’s 2016-17 salary to $10 million. As noted earlier, the team can go as high as $12.5 million and still retain enough cap room to re-sign Hassan Whiteside even the max. At a $12.5 million 2016-17 salary, the three alternatives would pay out $40 million, $42 million and $48 million, respectively.