Optimized code from the latest solc does a better job with the multiply() function, which is a leaf. Non-leaf functions remain costly to get out of, as shown by adding a layer to the test.

```
contract fun {
function multiply(uint x, uint y) public returns (uint) {
return x * y;
}
function test_mul(uint x, uint y) public returns (uint) {
return multiply(x,y);
}
function test(uint x, uint y) public returns (uint) {
return test_mul(2,3);
}
}
```

Here is what solc can do now with just `jump`

:

```
1 MULTIPLY:
5 mul
3 swap1
8 jump
=
17 gas
1 TEST_MUL:
5 0x00
5 RTN
5 dup4
5 dup4
5 MULTIPLY
8 jump
=
34 gas
1 RTN:
3 swap4
3 swap3
2 pop
2 pop
2 pop
8 jump
=
21 gas (twice)
TEST:
5 0x00
5 RTN
5 0x02
5 0x03
5 TEST_MUL
5 jump
=
30 gas
123 gas TOTAL
```

But with `jumpsub`

and `returnsub`

only a third as much gas is needed.

```
1 MULTIPLY:
5 mul
3 returnsub
=
9 gas
1 TEST_MUL:
3 MULTIPLY
5 jumpsub
3 returnsub
=
12 gas
1 TEST:
3 0x02
3 0x03
3 TEST_MUL
5 jumpsub
3 returnsub
=
18 gas
39 gas TOTAL
```