```01:       INTEGER FUNCTION ILAPREC( PREC )
02: *
03: *  -- LAPACK routine (version 3.2) --
04: *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
05: *     October 2008
06: *     .. Scalar Arguments ..
07:       CHARACTER          PREC
08: *     ..
09: *
10: *  Purpose
11: *  =======
12: *
13: *  This subroutine translated from a character string specifying an
14: *  intermediate precision to the relevant BLAST-specified integer
15: *  constant.
16: *
17: *  ILAPREC returns an INTEGER.  If ILAPREC < 0, then the input is not a
18: *  character indicating a supported intermediate precision.  Otherwise
19: *  ILAPREC returns the constant value corresponding to PREC.
20: *
21: *  Arguments
22: *  =========
23: *  PREC   (input) CHARACTER*1
24: *          Specifies the form of the system of equations:
25: *          = 'S':  Single
26: *          = 'D':  Double
27: *          = 'I':  Indigenous
28: *          = 'X', 'E':  Extra
29: *  =====================================================================
30: *
31: *     .. Parameters ..
32:       INTEGER BLAS_PREC_SINGLE, BLAS_PREC_DOUBLE, BLAS_PREC_INDIGENOUS,
33:      \$           BLAS_PREC_EXTRA
34:       PARAMETER ( BLAS_PREC_SINGLE = 211, BLAS_PREC_DOUBLE = 212,
35:      \$     BLAS_PREC_INDIGENOUS = 213, BLAS_PREC_EXTRA = 214 )
36: *     ..
37: *     .. External Functions ..
38:       LOGICAL            LSAME
39:       EXTERNAL           LSAME
40: *     ..
41: *     .. Executable Statements ..
42:       IF( LSAME( PREC, 'S' ) ) THEN
43:          ILAPREC = BLAS_PREC_SINGLE
44:       ELSE IF( LSAME( PREC, 'D' ) ) THEN
45:          ILAPREC = BLAS_PREC_DOUBLE
46:       ELSE IF( LSAME( PREC, 'I' ) ) THEN
47:          ILAPREC = BLAS_PREC_INDIGENOUS
48:       ELSE IF( LSAME( PREC, 'X' ) .OR. LSAME( PREC, 'E' ) ) THEN
49:          ILAPREC = BLAS_PREC_EXTRA
50:       ELSE
51:          ILAPREC = -1
52:       END IF
53:       RETURN
54: *
55: *     End of ILAPREC
56: *
57:       END
58: ```