(TranslationUnit
    [(Module
        template_02_m
        (TriviaNode
            []
            [(EndOfLine)
            (EndOfLine)]
        )
        []
        [(ImplicitNone
            []
            (TriviaNode
                []
                [(EndOfLine)
                (EndOfLine)]
            )
        )]
        [(Requirement
            eq
            [t
            ne]
            [(DerivedType
                t
                []
                ()
                [(SimpleAttribute
                    AttrDeferred
                )]
                []
                []
            )]
            [(Function
                ne
                [(lhs)
                (rhs)]
                []
                ()
                ()
                ()
                []
                []
                []
                [(Declaration
                    (AttrType
                        TypeType
                        []
                        ()
                        t
                        None
                    )
                    [(AttrIntent
                        In
                    )]
                    [(lhs
                    []
                    []
                    ()
                    ()
                    None
                    ())
                    (rhs
                    []
                    []
                    ()
                    ()
                    None
                    ())]
                    ()
                )
                (Declaration
                    (AttrType
                        TypeLogical
                        []
                        ()
                        ()
                        None
                    )
                    []
                    [(ne
                    []
                    []
                    ()
                    ()
                    None
                    ())]
                    ()
                )]
                []
                []
                []
            )]
        )
        (Template
            change_positions_tmpl
            [t
            ne]
            [(Require
                [(UnitRequire
                    eq
                    [(AttrName
                        t
                    )
                    (AttrName
                        ne
                    )]
                )]
            )
            (Declaration
                ()
                [(SimpleAttribute
                    AttrPrivate
                )]
                []
                ()
            )
            (Declaration
                ()
                [(SimpleAttribute
                    AttrPublic
                )]
                [(change_positions_t
                []
                []
                ()
                ()
                None
                ())]
                ()
            )]
            [(Function
                change_positions_t
                [(vec)]
                []
                mask
                ()
                ()
                []
                []
                []
                [(Declaration
                    (AttrType
                        TypeType
                        []
                        ()
                        t
                        None
                    )
                    [(AttrIntent
                        In
                    )]
                    [(vec
                    [(()
                    ()
                    DimensionExpr)]
                    []
                    ()
                    ()
                    None
                    ())]
                    ()
                )
                (Declaration
                    (AttrType
                        TypeInteger
                        []
                        ()
                        ()
                        None
                    )
                    [(SimpleAttribute
                        AttrAllocatable
                    )]
                    [(pos
                    [(()
                    ()
                    DimensionExpr)]
                    []
                    ()
                    ()
                    None
                    ())
                    (mask
                    [(()
                    ()
                    DimensionExpr)]
                    []
                    ()
                    ()
                    None
                    ())]
                    ()
                )
                (Declaration
                    (AttrType
                        TypeInteger
                        []
                        ()
                        ()
                        None
                    )
                    []
                    [(i
                    []
                    []
                    ()
                    ()
                    None
                    ())
                    (j
                    []
                    []
                    ()
                    ()
                    None
                    ())
                    (n
                    []
                    []
                    ()
                    ()
                    None
                    ())]
                    ()
                )]
                [(Assignment
                    0
                    n
                    (FuncCallOrArray
                        size
                        []
                        [(()
                        vec
                        ()
                        0)]
                        []
                        []
                        []
                    )
                    ()
                )
                (Allocate
                    0
                    [(()
                    (FuncCallOrArray
                        pos
                        []
                        [(()
                        n
                        ()
                        0)]
                        []
                        []
                        []
                    )
                    ()
                    0)]
                    []
                    ()
                )
                (If
                    0
                    ()
                    (< n 1)
                    [(Return
                        0
                        ()
                        ()
                    )]
                    []
                    ()
                    ()
                    ()
                )
                (Assignment
                    0
                    pos
                    0
                    ()
                )
                (Assignment
                    0
                    (FuncCallOrArray
                        pos
                        []
                        [(()
                        1
                        ()
                        0)]
                        []
                        []
                        []
                    )
                    1
                    ()
                )
                (Assignment
                    0
                    j
                    1
                    ()
                )
                (DoLoop
                    0
                    ()
                    0
                    i
                    2
                    n
                    ()
                    [(If
                        0
                        ()
                        (FuncCallOrArray
                            ne
                            []
                            [(()
                            (FuncCallOrArray
                                vec
                                []
                                [(()
                                i
                                ()
                                0)]
                                []
                                []
                                []
                            )
                            ()
                            0)
                            (()
                            (FuncCallOrArray
                                vec
                                []
                                [(()
                                (- i 1)
                                ()
                                0)]
                                []
                                []
                                []
                            )
                            ()
                            0)]
                            []
                            []
                            []
                        )
                        [(Assignment
                            0
                            j
                            (+ j 1)
                            ()
                        )
                        (Assignment
                            0
                            (FuncCallOrArray
                                pos
                                []
                                [(()
                                j
                                ()
                                0)]
                                []
                                []
                                []
                            )
                            i
                            ()
                        )]
                        []
                        ()
                        ()
                        ()
                    )]
                    ()
                    ()
                )
                (Allocate
                    0
                    [(()
                    (FuncCallOrArray
                        mask
                        []
                        [(()
                        j
                        ()
                        0)]
                        []
                        []
                        []
                    )
                    ()
                    0)]
                    []
                    ()
                )
                (DoLoop
                    0
                    ()
                    0
                    i
                    1
                    j
                    ()
                    [(Assignment
                        0
                        (FuncCallOrArray
                            mask
                            []
                            [(()
                            i
                            ()
                            0)]
                            []
                            []
                            []
                        )
                        (FuncCallOrArray
                            pos
                            []
                            [(()
                            i
                            ()
                            0)]
                            []
                            []
                            []
                        )
                        ()
                    )]
                    ()
                    ()
                )]
                []
                []
            )]
        )]
        []
        []
    )
    (Program
        template_02
        ()
        [(Use
            []
            template_02_m
            []
            .false.
            ()
        )]
        [(ImplicitNone
            []
            ()
        )]
        [(Instantiate
            change_positions_tmpl
            [(AttrType
                TypeInteger
                []
                ()
                ()
                None
            )
            (AttrIntrinsicOperator
                NOTEQ
            )]
            [(UseSymbol
                change_positions_t
                change_positions_int
            )]
        )
        (Instantiate
            change_positions_tmpl
            [(AttrType
                TypeCharacter
                []
                ()
                ()
                None
            )
            (AttrIntrinsicOperator
                NOTEQ
            )]
            [(UseSymbol
                change_positions_t
                change_positions_chr
            )]
        )]
        [(Print
            0
            ()
            [(FuncCallOrArray
                change_positions_int
                []
                [(()
                (ArrayInitializer
                    ()
                    ()
                    [3
                    3
                    6
                    2
                    2
                    2
                    1]
                )
                ()
                0)]
                []
                []
                []
            )]
            ()
        )
        (Print
            0
            ()
            [(FuncCallOrArray
                change_positions_chr
                []
                [(()
                (ArrayInitializer
                    ()
                    ()
                    [(String "a" ())
                    (String "a" ())
                    (String "b" ())
                    (String "p" ())
                    (String "p" ())
                    (String "p" ())
                    (String "o" ())]
                )
                ()
                0)]
                []
                []
                []
            )]
            ()
        )]
        []
    )]
)
