/* bs03r1.f -- translated by f2c (version 20000817).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* Subroutine */ int bs03r1_c(integer *n, real *ra)
{
static integer i__, j, l, ir;
static real rra;
/* Parameter adjustments */
--ra;
/* Function Body */
l = *n / 2 + 1;
ir = *n;
L10:
if (l <= 1) {
goto L51;
}
--l;
rra = ra[l];
goto L52;
L51:
rra = ra[ir];
ra[ir] = ra[1];
--ir;
if (ir != 1) {
goto L52;
}
ra[1] = rra;
return 0;
L52:
i__ = l;
j = l + l;
L20:
if (j > ir) {
goto L55;
}
if (j < ir && ra[j] < ra[j + 1]) {
++j;
}
if (rra >= ra[j]) {
goto L53;
}
ra[i__] = ra[j];
i__ = j;
j += j;
goto L54;
L53:
j = ir + 1;
L54:
goto L20;
L55:
ra[i__] = rra;
goto L10;
} /* bs03r1_c */