calling a function from main loop using push button code

i need to embed the push button code in the original code to select between 2 functions ( loop1() and loop2() )

void loop()
{
  if (digitalRead(anInput) == HIGH)
  {
    loop1();
  }
  else
  {
    loop2();
  }
}