1/*
2Copyright (c) 1990 The Regents of the University of California.
3All rights reserved.
4
5Redistribution and use in source and binary forms are permitted
6provided that the above copyright notice and this paragraph are
7duplicated in all such forms and that any documentation,
8and/or other materials related to such
9distribution and use acknowledge that the software was developed
10by the University of California, Berkeley.  The name of the
11University may not be used to endorse or promote products derived
12from this software without specific prior written permission.
13THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17	.file "strchr.S"
18
19	.section .text
20	.global _strchr
21	.type	 _strchr,@function
22_strchr:
23	movm [d2,d3,a2,a3],(sp)
24	add -12,sp
25.Lend_of_prologue:
26	mov d0,a1
27	movbu d1,(7,sp)
28#ifndef __OPTIMIZE_SIZE__
29	btst 3,d0
30	bne .L20
31	clr d0
32	setlb
33	mov sp,a2
34	mov d0,d3
35	add d3,a2
36	mov a2,a0
37	add 12,a0
38	movbu (7,sp),d3
39	movbu d3,(-4,a0)
40	inc d0
41	cmp 3,d0
42	lls
43	mov a1,a0
44	mov -16843009,a1
45	mov (a0),d2
46	mov a1,d1
47	add d2,d1
48	mov d2,d0
49	not d0
50	and d0,d1
51	mov -2139062144,d3
52	mov d3,(0,sp)
53	btst -2139062144,d1
54	bne .L27
55	jmp .L38
56.L28:
57	inc4 a0
58	mov (a0),d2
59	mov a1,d1
60	add d2,d1
61	mov d2,d0
62	not d0
63	and d0,d1
64	mov (0,sp),d3
65	and d3,d1
66	bne .L27
67.L38:
68	mov (8,sp),d0
69	xor d2,d0
70	mov a1,d1
71	add d0,d1
72	not d0
73	and d0,d1
74	and d3,d1
75	beq .L28
76.L27:
77	mov a0,a1
78.L20:
79#endif
80	movbu (a1),d0
81	cmp 0,d0
82	beq .L32
83	movbu (7,sp),d1
84	setlb
85	cmp d1,d0
86	beq .L36
87	inc a1
88	movbu (a1),d0
89	cmp 0,d0
90	lne
91.L32:
92	movbu (7,sp),d0
93	movbu (a1),d3
94	cmp d0,d3
95	beq .L36
96	mov 0,a0
97	jmp .Lepilogue
98.L36:
99	mov a1,a0
100.Lepilogue:
101	ret [d2,d3,a2,a3],28
102.Lend_of_strchr:
103	.size	 _strchr, .Lend_of_strchr - _strchr
104
105	.section	.debug_frame,"",@progbits
106.Lstart_of_debug_frame:
107	# Common Information Entry (CIE)
108	.4byte	.Lend_of_CIE - .Lstart_of_CIE	# CIE Length
109.Lstart_of_CIE:
110	.4byte	 0xffffffff			# CIE Identifier Tag
111	.byte	 0x1				# CIE Version
112	.ascii   "\0"				# CIE Augmentation
113	.uleb128 0x1				# CIE Code Alignment Factor
114	.sleb128 -4				# CIE Data Alignment Factor
115	.byte	 0x32				# CIE RA Column
116	.byte	 0xc				# DW_CFA_def_cfa
117	.uleb128 0x9
118	.uleb128 0x0
119	.byte	 0xb2				# DW_CFA_offset, column 0x32
120	.uleb128 0x0
121	.align   2
122.Lend_of_CIE:
123
124	# Frame Description Entry (FDE)
125	.4byte	.Lend_of_FDE - .Lstart_of_FDE	# FDE Length
126.Lstart_of_FDE:
127	.4byte	 .Lstart_of_debug_frame		# FDE CIE offset
128	.4byte	 _strchr			# FDE initial location
129	.4byte	 .Lend_of_strchr - _strchr	# FDE address range
130	.byte	 0x4				# DW_CFA_advance_loc4
131	.4byte	 .Lend_of_prologue - _strchr
132	.byte	 0xe				# DW_CFA_def_cfa_offset
133	.uleb128 0x4
134	.byte	 0x87				# DW_CFA_offset, column 0x7
135	.uleb128 0x1
136	.align 2
137.Lend_of_FDE:
138