(command.CommandList
  children: [
    (C {<atf_test_case>} {<empty_r>})
    (command.ShFunction
      name: empty_r_head
      body: (BraceGroup children:[(C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse an empty file'>)})])
    )
    (command.ShFunction
      name: empty_r_body
      body: 
        (BraceGroup
          children: [
            (C {<touch>} {<infile>} {<expectfile>})
            (command.Simple
              words: [{<tail>} {<-r>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<file_r>})
    (command.ShFunction
      name: file_r_head
      body: (BraceGroup children:[(C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a file'>)})])
    )
    (command.ShFunction
      name: file_r_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 200
                      stdin_parts: [
                        <'This is the first line\n'>
                        <'This is the second line\n'>
                        <'This is the third line\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expectfile>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 216
                      stdin_parts: [
                        <'This is the third line\n'>
                        <'This is the second line\n'>
                        <'This is the first line\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<file_rn2>})
    (command.ShFunction
      name: file_rn2_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse the last two lines of a file'>)})]
        )
    )
    (command.ShFunction
      name: file_rn2_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 305
                      stdin_parts: [
                        <'This is the first line\n'>
                        <'This is the second line\n'>
                        <'This is the third line\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expectfile>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 320
                      stdin_parts: [<'This is the third line\n'> <'This is the second line\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rn2>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rn2>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<file_rc28>})
    (command.ShFunction
      name: file_rc28_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a file and display the last 28 characters'>)})
          ]
        )
    )
    (command.ShFunction
      name: file_rc28_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 409
                      stdin_parts: [
                        <'This is the first line\n'>
                        <'This is the second line\n'>
                        <'This is the third line\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expectfile>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<HERE>}
                      here_end_span_id: 424
                      stdin_parts: [<'This is the third line\n'> <'line\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc28>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc28>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_r>})
    (command.ShFunction
      name: longfile_r_head
      body: (BraceGroup children:[(C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a long file'>)})])
    )
    (command.ShFunction
      name: longfile_r_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%0511d'>)} {<1030>} {<0>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%0511d'>)} {<1030>} {<1029>} {<0>} {<-1>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_r_enomem>})
    (command.ShFunction
      name: longfile_r_enomem_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a file that\'s too long to store in RAM'>)})
          ]
        )
    )
    (command.ShFunction
      name: longfile_r_enomem_body
      body: 
        (BraceGroup
          children: [
            (BraceGroup
              children: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {<ulimit>} {<-v>} {<32768>})
                    (C {<atf_skip>} {(DQ <'Can\'t adjust ulimit'>)})
                  ]
                )
                (command.Sentence
                  child: 
                    (command.Pipeline
                      children: [
                        (C {<jot>} {<-w>} {(DQ <'%01023d'>)} {<32768>} {<0>})
                        (command.Simple
                          words: [{<tail>} {<-r>}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<outfile>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      negated: F
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_QMark '$?'))} {<-ne>} {<1>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<atf_skip>} {(DQ <'Didn\'t get ENOMEM.  Adjust test parameters'>)})]
                  spids: [670 685]
                )
              ]
            )
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%01023d'>)} {<10>} {<32767>} {<0>} {<-1>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<head>} {<-n>} {<10>} {<outfile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outtrunc>})]
              do_fork: T
            )
            (C {<diff>} {<expectfile>} {<outtrunc>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outtrunc>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_r_longlines>})
    (command.ShFunction
      name: longfile_r_longlines_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a long file with extremely long lines'>)})
          ]
        )
    )
    (command.ShFunction
      name: longfile_r_longlines_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<0>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<18000>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<36000>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<36000>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<18000>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<0>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-r>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_rc135782>})
    (command.ShFunction
      name: longfile_rc135782_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a long file and print the last 135,782 bytes'>)})
          ]
        )
    )
    (command.ShFunction
      name: longfile_rc135782_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%063d'>)} {<9000>} {<0>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%063d'>)} {<2121>} {<8999>} {<0>} {<-1>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {(DQ <0000000000000000000000000000000006878>)}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc135782>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc135782>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_rc145782_longlines>})
    (command.ShFunction
      name: longfile_rc145782_longlines_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} 
              {
                (DQ 
                  <'Reverse a long file with extremely long lines and print the last 145,782 bytes'>
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: longfile_rc145782_longlines_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<0>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<18000>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<36000>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<18000>} {<36000>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<echo>} {<-n>} {(DQ <'35777 '>)}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-s>} {(DQ <' '>)} {<-w>} {(DQ <'%07d'>)} {<222>} {<35778>}]
              redirects: [(redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc145782>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rc145782>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (C {<atf_test_case>} {<longfile_rn2500>})
    (command.ShFunction
      name: longfile_rn2500_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Reverse a long file and print the last 2,500 lines'>)})
          ]
        )
    )
    (command.ShFunction
      name: longfile_rn2500_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%063d'>)} {<9000>} {<0>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<infile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<jot>} {<-w>} {(DQ <'%063d'>)} {<2500>} {<8999>} {<0>} {<-1>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expectfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rn2500>} {<infile>}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
              do_fork: T
            )
            (command.Simple
              words: [{<tail>} {<-rn2500>}]
              redirects: [
                (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outpipe>})
              ]
              do_fork: T
            )
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outfile>})
            (C {<atf_check>} {<cmp>} {<expectfile>} {<outpipe>})
          ]
        )
    )
    (command.ShFunction
      name: atf_init_test_cases
      body: 
        (BraceGroup
          children: [
            (C {<atf_add_test_case>} {<empty_r>})
            (C {<atf_add_test_case>} {<file_r>})
            (C {<atf_add_test_case>} {<file_rc28>})
            (C {<atf_add_test_case>} {<file_rn2>})
            (C {<atf_add_test_case>} {<longfile_r>})
            (C {<atf_add_test_case>} {<longfile_r_enomem>})
            (C {<atf_add_test_case>} {<longfile_r_longlines>})
            (C {<atf_add_test_case>} {<longfile_rc135782>})
            (C {<atf_add_test_case>} {<longfile_rc145782_longlines>})
            (C {<atf_add_test_case>} {<longfile_rn2500>})
          ]
        )
    )
  ]
)