def strlen(state, s):
cpu = state.cpu<EOL>if issymbolic(s):<EOL><INDENT>raise ConcretizeArgument(state.cpu, <NUM_LIT:1>)<EOL><DEDENT>zero_idx = _find_zero(cpu, state.constraints, s)<EOL>ret = zero_idx<EOL>for offset in range(zero_idx - <NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>byt = cpu.read_int(s + offset, <NUM_LIT:8>)<EOL>if issymbolic(byt):<EOL><INDENT>ret = ITEBV(cpu.address_bit_size, byt == <NUM_LIT:0>, offset, ret)<EOL><DEDENT><DEDENT>return ret<EOL>
strlen symbolic model.

Algorithm: Walks from end of string not including NULL building ITE tree when current byte is symbolic.

:param State state: current program state
:param int s: Address of string
:return: Symbolic strlen result
:rtype: Expression or int