We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).

Strict Trs:
  { g(S(x), y) -> g(x, S(y))
  , g(0(), x2) -> x2
  , f(y, S(x)) -> f(S(y), x)
  , f(x1, 0()) -> g(x1, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  YES(?,O(n^1))

The problem is match-bounded by 2. The enriched problem is
compatible with the following automaton.
{ g_0(2, 2) -> 1
, g_0(2, 4) -> 1
, g_0(4, 2) -> 1
, g_0(4, 4) -> 1
, g_1(2, 5) -> 1
, g_1(2, 6) -> 3
, g_1(4, 5) -> 1
, g_1(4, 6) -> 3
, g_1(5, 6) -> 3
, g_2(2, 7) -> 3
, g_2(4, 7) -> 3
, g_2(5, 7) -> 3
, S_0(2) -> 1
, S_0(2) -> 2
, S_0(4) -> 1
, S_0(4) -> 2
, S_1(2) -> 1
, S_1(2) -> 5
, S_1(4) -> 1
, S_1(4) -> 5
, S_1(5) -> 1
, S_1(5) -> 5
, S_1(6) -> 3
, S_1(6) -> 6
, S_1(7) -> 3
, S_1(7) -> 6
, S_2(6) -> 3
, S_2(6) -> 7
, S_2(7) -> 3
, S_2(7) -> 7
, f_0(2, 2) -> 3
, f_0(2, 4) -> 3
, f_0(4, 2) -> 3
, f_0(4, 4) -> 3
, f_1(5, 2) -> 3
, f_1(5, 4) -> 3
, 0_0() -> 1
, 0_0() -> 4
, 0_1() -> 3
, 0_1() -> 6 }

Hurray, we answered YES(?,O(n^1))