+
+/*
+ * Reentrant, but slower version of rindex
+ */
+5:
+ movl r1,r3
+ clrl r4 # r4 = pointer to last match
+6:
+ locc $0,$65535,(r3) # look for '\0'
+ bneq 8f
+ decw r0 # r0 = 65535
+1:
+ locc r2,r0,(r3) # look for c
+ bneq 7f
+ movl r1,r3 # reset pointer and ...
+ jbr 6b # ... try again
+7:
+ movl r1,r4 # stash pointer ...
+ addl3 $1,r1,r3 # ... skip over match and ...
+ decl r0 # ... decrement count
+ jbr 6b # ... try again
+8:
+ subl3 r3,r1,r0 # length of short block
+ incl r0 # +1 for '\0'
+9:
+ locc r2,r0,(r3) # look for c
+ beql 0f
+ movl r1,r4 # stash pointer ...
+ addl3 $1,r1,r3 # ... skip over match ...
+ decl r0 # ... adjust count and ...
+ jbr 9b # ... try again
+0:
+ movl r4,r0 # return stashed pointer
+ ret