    externalintegerfn  search(integer  start, finish, char)
      label  found, loop, rest, notfound
      *movl_start,1
      *subl3_1,finish,2
      *incl_2
      *blss_notfound
    loop:
      *cmpl_2,#65535
      *bleq_rest
      *subl2_#65535,2
      *locc_char,#65535,(1)
      *bneq_found
      *brb_loop
    rest:
      *locc_char,2,(1)
      *bneq_found
    notfound:
      result  = 0
    found:
      *movl_1,start
      result  = start
    end

    external  integer  fn  search back(integer  start, finish, char)
      label  loop, found, notfound
      *movzbl_char,2
      *addl3_#1,finish,1
      *subl3_start,1,0
      *bgtr_loop
      *brb_notfound
    loop:
      *cmpb_2,-(1)
      *beql_found
      *sobgtr_0,loop
    notfound:
      result  = 0
    found:
      *movl_1,start
      result  = start
    end
    external  integer  fn  count(integer  start, finish, char)
      label  loop, again, end
      *movl_start,1
      *subl3_1,finish,2
      *incl_2
      *movzbl_char,3
      *clrl_4
      *movzwl_#65535,5
    loop:  *movl_2,0
           *blss_end
           *decl_1
           *subl2_5,2
           *blss_again
           *movl_5,0
    again: *locc_3,0,1(1)
           *beql_loop
           *incl_4
           *decl_0
           *brb_again

    end:   *movl_4,start
           result  = start
    end

    endoffile