
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Zibo barbecue has become popular with its strength, and "Jinzi Gan Kao" has become a new trend in tourism during the May Day golden week this year, which has also promoted the economic development of other local tourism industries. A certain tourist souvenir shop sells two types of souvenirs, $A$ and $B$. It is known that a profit of $60$ yuan can be made by selling one piece of type $A$ souvenir, and a profit of $80$ yuan can be made by selling one piece of type $B$ souvenir. The tourist souvenir shop plans to purchase a total of $40$ pieces of type $A$ and type $B$ souvenirs at once. If all of them are sold out, the total profit obtained will be $y$ yuan. Let $x$ represent the number of type $A$ souvenirs purchased.<br/>$(1)$ Find the functional relationship between $y$ and $x$;<br/>$(2)$ If the quantity of type $B$ souvenirs purchased this time does not exceed $3$ times the quantity of type $A$ souvenirs, when purchasing how many pieces of type $A$ souvenirs, can the shop make the maximum profit, and what is the maximum profit?

Present the answer in LaTex format: \boxed{Your answer}
user