You can represent such a branching behaviour in bimonoidal categories (also known as rig categories).
In addition to your multiplicative monoidal structure $\otimes$, which is used to represent compound systems, you need another monoidal structure $\oplus$ to model the branching histories. A category is bimonoidal when it has these two structures and $\otimes$ distributes over $\oplus$.
Let us consider a slight variation on your example specification to illustrate that:
f(x,y) = if (x > 10)
then x + 3
else y + 3
You can model it like this:
- $a : \text{Int} \rightarrow \text{Int} \oplus \text{Int}$ is the map that sends its input to the first component if it is greater than 10, and to the second component otherwise
- $b : \text{Int} \rightarrow \text{Int}$ is the morphism that adds 3 to its argument
- $c : \text{Int} \rightarrow I$ is the discarding map, where $I$ is the monoidal unit for $\otimes$.
- $d : \text{Int} \oplus \text{Int} \rightarrow \text{Int}$ is the codiagonal map (mapping both sides of the sum to the same object).
Then your algorithm can be represented as $d \circ ((b \otimes c) \oplus (c \otimes b)) \circ (a \otimes 1_{\text{Int}})$. You can represent it graphically using sheet diagrams for bimonoidal categories, which generalize string diagrams for monoidal categories:
Manipulate diagram interactively
(The reason why I tweaked your example a bit is to demonstrate how the multiplicative monoidal structure can be used in these diagrams. Your example only had a single variable so it could be represented with the additive monoidal structure only, so with regular string diagrams for that monoidal structure.)