To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of cars as `x` and the number of trucks as `y`. The objective is to maximize profit, which can be calculated as $5000x + 8000y$.

The constraints are based on the available time for assembly line and mechanic work. Each car requires 2 hours on the assembly line and 1 hour of mechanic time, while each truck requires 2.5 hours on the assembly line and 1.5 hours of mechanic time. The total available time for assembly line work is 800 hours, and for mechanic work is 600 hours. This gives us two constraints: 

1. Assembly line constraint: $2x + 2.5y \leq 800$
2. Mechanic time constraint: $x + 1.5y \leq 600$

Additionally, the number of cars and trucks cannot be negative, so we have non-negativity constraints: $x \geq 0$ and $y \geq 0$.

Now, let's write this problem in Gurobi code using Python:

```python
from gurobipy import *

# Create a new model
m = Model("Auto_Production")

# Define the decision variables
x = m.addVar(vtype=GRB.CONTINUOUS, name="cars", lb=0)
y = m.addVar(vtype=GRB.CONTINUOUS, name="trucks", lb=0)

# Define the objective function: Maximize profit
m.setObjective(5000*x + 8000*y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(2*x + 2.5*y <= 800, "assembly_line")
m.addConstr(x + 1.5*y <= 600, "mechanic_time")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print(f"Optimal solution: Produce {x.x:.0f} cars and {y.x:.0f} trucks.")
    print(f"Maximum profit: ${m.objVal:.2f}")
else:
    print("No optimal solution found")
```