codeGenBlock :: CG a -> CG (a,[IR.Instruction])
codeGenBlock genM = do
  instructions <- state $ \s@CGState{..} -> (_sInstructions, s {_sInstructions = []})
  ret <- genM
  blockInstructions <- state $ \s@CGState{..} -> (reverse _sInstructions, s {_sInstructions = instructions})
  pure (ret, blockInstructions)
codeGenBlock :: CG a -> CG (a,[IR.Instruction])
codeGenBlock genM = do
  instructions <- state $ \s@CGState{..} -> (_sInstructions, s {_sInstructions = []})
  ret <- genM
  blockInstructions <- state $ \s@CGState{..} -> (reverse _sInstructions, s {_sInstructions = instructions})
  pure (ret, blockInstructions)
codeGenBlock genM = do
  instructions <- state $ \s@CGState{..} -> (_sInstructions, s {_sInstructions = []})
  ret <- genM
  blockInstructions <- state $ \s@CGState{..} -> (reverse _sInstructions, s {_sInstructions = instructions})
  pure (ret, blockInstructions)