(BraceGroup
  left: <Id.Lit_LBrace '{'>
  children: [
    (C {<.>} {<'/DietPi/dietpi/func/dietpi-globals'>})
    (C {<G_CHECK_ROOT_USER>})
    (C {<export>} {<Id.Lit_VarLike 'G_PROGRAM_NAME='> (SQ <DietPi-dphys-swapfile>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SWAP_SIZE_CURRENT='> name:SWAP_SIZE_CURRENT)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [112]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'SWAP_LOCATION_CURRENT='>
              name: SWAP_LOCATION_CURRENT
            )
          op: assign_op.Equal
          rhs: {(SQ <'/var/swap'>)}
          spids: [116]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-f>} {<'/etc/dphys-swapfile'>} {<Id.Lit_RBracket ']'>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_SIZE_CURRENT='>
                      name: SWAP_SIZE_CURRENT
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<cat>} {<'/etc/dphys-swapfile'>})
                              (C {<grep>} {<-m1>} {(SQ <'^CONF_SWAPSIZE='>)})
                              (C {<sed>} {(SQ <'s/.*=//'>)})
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [137]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_LOCATION_CURRENT='>
                      name: SWAP_LOCATION_CURRENT
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<cat>} {<'/etc/dphys-swapfile'>})
                              (C {<grep>} {<-m1>} {(SQ <'^CONF_SWAPFILE='>)})
                              (C {<sed>} {(SQ <'s/.*=//'>)})
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [163]
                )
              ]
              redirects: []
            )
          ]
          spids: [122 133]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SWAP_SIZE_TARGET='> name:SWAP_SIZE_TARGET)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName SWAP_SIZE_CURRENT)}
          spids: [194]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_EqualTilde
                          left: {($ Id.VSub_Number 1)}
                          right: 
                            {<Id.Lit_Other '^'> <-> <Id.Lit_Other '?'> <Id.Lit_Other '['> <0-9> 
                              <Id.Lit_Other ']'> <Id.Lit_Other '+'> <Id.Lit_Other '$'>
                            }
                        )
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_SIZE_TARGET='>
                      name: SWAP_SIZE_TARGET
                    )
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [221]
                )
              ]
              redirects: []
            )
          ]
          spids: [198 218]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'SWAP_LOCATION_TARGET='>
              name: SWAP_LOCATION_TARGET
            )
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName SWAP_LOCATION_CURRENT)}
          spids: [229]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number 2))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_LOCATION_TARGET='>
                      name: SWAP_LOCATION_TARGET
                    )
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                  spids: [253]
                )
              ]
              redirects: []
            )
          ]
          spids: [233 250]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SERVICE_MODE='> name:SERVICE_MODE)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [261]
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name: Generate_Default_Conf
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<_EOF_>}
                      here_end_span_id: 287
                      stdin_parts: [<'CONF_SWAPSIZE=0\n'> <'CONF_SWAPFILE=/var/swap\n'>]
                    )
                )
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<'/etc/dphys-swapfile'>}
                )
              ]
              more_env: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: Delete_Swapfile
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<G_DIETPI-NOTIFY>} {<2>} 
              {
                (DQ <'Deleting existing swapfile ('> ($ Id.VSub_DollarName SWAP_LOCATION_CURRENT) <')'> 
                  <Id.Lit_BadBackslash '\\'> <n>
                )
              }
            )
            (command.Simple
              words: [{<rm>} {(DQ ($ Id.VSub_DollarName SWAP_LOCATION_CURRENT))}]
              redirects: [
                (redir
                  op: <Id.Redir_AndGreat '&>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<'/dev/null'>}
                )
              ]
              more_env: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: Update_Conf
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<sed>} {<-i>} 
              {
                (DQ <'/CONF_SWAPSIZE/c'> <Id.Lit_BadBackslash '\\'> <'CONF_SWAPSIZE='> 
                  ($ Id.VSub_DollarName SWAP_SIZE_TARGET)
                )
              } {<'/etc/dphys-swapfile'>}
            )
            (C {<sed>} {<-i>} 
              {
                (DQ <'/CONF_SWAPFILE/c'> <Id.Lit_BadBackslash '\\'> <'CONF_SWAPFILE='> 
                  ($ Id.VSub_DollarName SWAP_LOCATION_TARGET)
                )
              } {<'/etc/dphys-swapfile'>}
            )
            (C {<sed>} {<-i>} 
              {
                (DQ <'/^AUTO_SETUP_SWAPFILE_SIZE=/c'> <Id.Lit_BadBackslash '\\'> 
                  <'AUTO_SETUP_SWAPFILE_SIZE='> ($ Id.VSub_DollarName SWAP_SIZE_TARGET)
                )
              } {<'/DietPi/dietpi.txt'>}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: Swap_Disable
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<G_DIETPI-NOTIFY>} {<3>} {<DietPi>} {<Disable>} {<swapfile>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_SIZE_TARGET='>
                      name: SWAP_SIZE_TARGET
                    )
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [408]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SERVICE_MODE='> name:SERVICE_MODE)
                  op: assign_op.Equal
                  rhs: {(DQ <disable>)}
                  spids: [412]
                )
              ]
              redirects: []
            )
            (C {<Generate_Default_Conf>})
            (C {<dphys-swapfile>} {<swapoff>})
            (C {<Delete_Swapfile>})
            (C {<Update_Conf>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: Swap_Enable
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<G_DIETPI-NOTIFY>} {<3>} {<DietPi>} {<Generating>} {<new>} {<swapfile>})
            (C {<G_DIETPI-NOTIFY>} {<2>} 
              {(DQ <'Size     = '> ($ Id.VSub_DollarName SWAP_SIZE_TARGET) <' MB'>)}
            )
            (C {<G_DIETPI-NOTIFY>} {<2>} 
              {(DQ <'Location = '> ($ Id.VSub_DollarName SWAP_LOCATION_TARGET))}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SERVICE_MODE='> name:SERVICE_MODE)
                  op: assign_op.Equal
                  rhs: {(DQ <enable>)}
                  spids: [481]
                )
              ]
              redirects: []
            )
            (C {<Generate_Default_Conf>})
            (C {<dphys-swapfile>} {<swapoff>})
            (C {<Delete_Swapfile>})
            (C {<Update_Conf>})
            (C {<dphys-swapfile>} {<setup>})
            (C {<chmod>} {<600>} {(DQ ($ Id.VSub_DollarName SWAP_LOCATION_TARGET))})
            (C {<dphys-swapfile>} {<swapon>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_Number 1))} {<Id.Lit_RBracket ']'>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {<-e>} 
              {
                (DQ ($ Id.VSub_DollarName SWAP_SIZE_CURRENT) <' '> 
                  ($ Id.VSub_DollarName SWAP_LOCATION_CURRENT)
                )
              }
            )
          ]
          spids: [545 558]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_DEqual
                          left: {($ Id.VSub_DollarName SWAP_SIZE_TARGET)}
                          right: {<Id.Lit_Digits 0>}
                        )
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<Swap_Disable>})]
          spids: [578 592]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_DEqual
                          left: {($ Id.VSub_DollarName SWAP_SIZE_TARGET)}
                          right: {<Id.Lit_Digits 1>}
                        )
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'SWAP_SIZE_TARGET='>
                      name: SWAP_SIZE_TARGET
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {<Id.Lit_Digits 2048>}
                            right: 
                              {
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: 
                                    (command.Pipeline
                                      children: [
                                        (C {<free>} {<-m>})
                                        (C {<grep>} {<-m1>} {(SQ <'Mem:'>)})
                                        (C {<awk>} {(SQ <'{print $2}'>)})
                                      ]
                                      negated: F
                                      stderr_indices: []
                                    )
                                  right: <Id.Eof_RParen _>
                                )
                              }
                          )
                      )
                    }
                  spids: [622]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Less
                                  left: {($ Id.VSub_DollarName SWAP_SIZE_TARGET)}
                                  right: {<Id.Lit_Digits 0>}
                                )
                              redirects: []
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<Swap_Disable>})]
                  spids: [657 671]
                )
              ]
              else_action: [(C {<Swap_Enable>})]
              redirects: []
            )
          ]
          spids: [604 618]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_GreatEqual
                          left: {($ Id.VSub_DollarName SWAP_SIZE_TARGET)}
                          right: {<Id.Lit_Digits 2>}
                        )
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<Swap_Enable>})]
          spids: [695 709]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName SERVICE_MODE))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<systemctl>} {(DQ ($ Id.VSub_DollarName SERVICE_MODE))} {<dphys-swapfile>})
            (C {<G_DIETPI-NOTIFY>} {<2>} {(DQ <Completed> <Id.Lit_BadBackslash '\\'> <n>)})
          ]
          spids: [729 746]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
  ]
  redirects: []
  right: <Id.Lit_RBrace '}'>
)