1long udivmodsi4 ();
2
3long
4__divsi3 (long a, long b)
5{
6  int neg = 0;
7  long res;
8
9  if (a < 0)
10    {
11      a = -a;
12      neg = !neg;
13    }
14
15  if (b < 0)
16    {
17      b = -b;
18      neg = !neg;
19    }
20
21  res = udivmodsi4 (a, b, 0);
22
23  if (neg)
24    res = -res;
25
26  return res;
27}
28
29long
30__modsi3 (long a, long b)
31{
32  int neg = 0;
33  long res;
34
35  if (a < 0)
36    {
37      a = -a;
38      neg = 1;
39    }
40
41  if (b < 0)
42    b = -b;
43
44  res = udivmodsi4 (a, b, 1);
45
46  if (neg)
47    res = -res;
48
49  return res;
50}
51