(CommandList
  children: [
    (C {(set)} {(-e)})
    (C {(modprobe)} {(test_firmware)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DIR)
          op: Equal
          rhs: {(/sys/devices/virtual/misc/test_firmware)}
          spids: [25]
        )
      ]
      spids: [25]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:HAS_FW_LOADER_USER_HELPER)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (If
                        arms: [
                          (if_arm
                            cond: [
                              (Sentence
                                child: 
                                  (C {(Lit_Other "[")} {(-d)} {(/sys/class/firmware/)} {(Lit_Other "]")})
                                terminator: <Op_Semi ";">
                              )
                            ]
                            action: [(Sentence child:(C {(echo)} {(yes)}) terminator:<Op_Semi ";">)]
                            spids: [-1 51]
                          )
                        ]
                        else_action: [(Sentence child:(C {(echo)} {(no)}) terminator:<Op_Semi ";">)]
                        spids: [58 65]
                      )
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [39 66]
              )
            }
          spids: [38]
        )
      ]
      spids: [38]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$HAS_FW_LOADER_USER_HELPER"))} {(Lit_Other "=")} 
                  {(DQ (yes))} {(Lit_Other "]")}
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:OLD_TIMEOUT)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(cat)} {(/sys/class/firmware/timeout)})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [90 94]
                      )
                    }
                  spids: [89]
                )
              ]
              spids: [89]
            )
          ]
          spids: [-1 86]
        )
      ]
      spids: [-1 96]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:OLD_FWPATH)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(cat)} {(/sys/module/firmware_class/parameters/path)})]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [100 104]
              )
            }
          spids: [99]
        )
      ]
      spids: [99]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:FWPATH)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(mktemp)} {(-d)})])
                left_token: <Left_CommandSub "$(">
                spids: [108 112]
              )
            }
          spids: [107]
        )
      ]
      spids: [107]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:FW)
          op: Equal
          rhs: {(DQ ($ VSub_Name "$FWPATH") (/test-firmware.bin))}
          spids: [114]
        )
      ]
      spids: [114]
    )
    (FuncDef
      name: test_finish
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$HAS_FW_LOADER_USER_HELPER"))} 
                          {(Lit_Other "=")} {(DQ (yes))} {(Lit_Other "]")}
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (SimpleCommand
                      words: [{(echo)} {(DQ ($ VSub_Name "$OLD_TIMEOUT"))}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(/sys/class/firmware/timeout)}
                          spids: [154]
                        )
                      ]
                    )
                  ]
                  spids: [-1 145]
                )
              ]
              spids: [-1 158]
            )
            (SimpleCommand
              words: [{(echo)} {(-n)} {(DQ ($ VSub_Name "$OLD_PATH"))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(/sys/module/firmware_class/parameters/path)}
                  spids: [169]
                )
              ]
            )
            (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$FW"))})
            (C {(rmdir)} {(DQ ($ VSub_Name "$FWPATH"))})
          ]
          spids: [125]
        )
      spids: [121 124]
    )
    (C {(trap)} {(DQ (test_finish))} {(EXIT)})
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$HAS_FW_LOADER_USER_HELPER"))} {(Lit_Other "=")} 
                  {(DQ (yes))} {(Lit_Other "]")}
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(1)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(/sys/class/firmware/timeout)}
                  spids: [228]
                )
              ]
            )
          ]
          spids: [-1 217]
        )
      ]
      spids: [-1 231]
    )
    (SimpleCommand
      words: [{(echo)} {(-n)} {(DQ ($ VSub_Name "$FWPATH"))}]
      redirects: [
        (Redir
          op_id: Redir_Great
          fd: -1
          arg_word: {(/sys/module/firmware_class/parameters/path)}
          spids: [245]
        )
      ]
    )
    (SimpleCommand
      words: [{(echo)} {(DQ (ABCD0123))}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(DQ ($ VSub_Name "$FW"))} spids:[258])]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:NAME)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(basename)} {(DQ ($ VSub_Name "$FW"))})])
                left_token: <Left_CommandSub "$(">
                spids: [265 271]
              )
            }
          spids: [264]
        )
      ]
      spids: [264]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(printf)} {(SQ <"\\000">)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$DIR")) (/trigger_request)}
                      spids: [282]
                    )
                  ]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": empty filename should not succeed"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[299])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 289]
        )
      ]
      spids: [-1 307]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(printf)} {(SQ <"\\000">)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$DIR")) (/trigger_async_request)}
                      spids: [318]
                    )
                  ]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {(DQ ($ VSub_Number "$0") (": empty filename should not succeed (async)"))}
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[335])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 325]
        )
      ]
      spids: [-1 343]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(-n)} {(DQ (nope-) ($ VSub_Name "$NAME"))}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$DIR")) (/trigger_request)}
                      spids: [360]
                    )
                  ]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": firmware shouldn't have loaded"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[377])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 367]
        )
      ]
      spids: [-1 385]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(diff)} {(-q)} {(DQ ($ VSub_Name "$FW"))} {(/dev/test_firmware)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[399])]
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": firmware was not expected to match"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[414])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 404]
        )
      ]
      else_action: [
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: 
                    (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$HAS_FW_LOADER_USER_HELPER"))} 
                      {(Lit_Other "=")} {(DQ (yes))} {(Lit_Other "]")}
                    )
                  terminator: <Op_Semi ";">
                )
              ]
              action: [(C {(echo)} {(DQ ($ VSub_Number "$0") (": timeout works"))})]
              spids: [-1 442]
            )
          ]
          spids: [-1 453]
        )
      ]
      spids: [422 455]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(echo)} {(-n)} {(DQ ($ VSub_Name "$NAME"))}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$DIR")) (/trigger_request)}
                          spids: [476]
                        )
                      ]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": could not trigger request"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[494])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 484]
        )
      ]
      spids: [-1 502]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(diff)} {(-q)} {(DQ ($ VSub_Name "$FW"))} {(/dev/test_firmware)}]
                      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[522])]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": firmware was not loaded"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[537])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 527]
        )
      ]
      else_action: [(C {(echo)} {(DQ ($ VSub_Number "$0") (": filesystem loading works"))})]
      spids: [545 555]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(echo)} {(-n)} {(DQ ($ VSub_Name "$NAME"))}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$DIR")) (/trigger_async_request)}
                          spids: [573]
                        )
                      ]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": could not trigger async request"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[591])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 581]
        )
      ]
      spids: [-1 599]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(diff)} {(-q)} {(DQ ($ VSub_Name "$FW"))} {(/dev/test_firmware)}]
                      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[619])]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_Number "$0") (": firmware was not loaded (async)"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[634])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [-1 624]
        )
      ]
      else_action: [(C {(echo)} {(DQ ($ VSub_Number "$0") (": async filesystem loading works"))})]
      spids: [642 652]
    )
    (C {(exit)} {(0)})
  ]
)