Need help with LED controll from qty 6 74HC165 shift reg. ic`s

I got 6 Shift Register 74HC165 connected together.
I need to convert these bit data from the 6 74HC164 ics to controll Leds.

uint64_t oldOptionSwitch = 0;   // previous state of all the inputs
   uint64_t optionSwitch = 0;
  for( int i=40; i>=0; i-=8)
  {
    optionSwitch |= ((uint64_t) ReadOne165()) << i;
  }

  for( int i = 0; i<48; i++)
  {
    if( bitRead( optionSwitch, i) != bitRead( oldOptionSwitch,i))
    {
      //Serial.println( "Read Data:");
      //if( i < 10)
      //  Serial.print( " ");
      Serial.print( i);
      Serial.print( " is now ");
      Serial.println( bitRead( optionSwitch, i) == 0 ? "Released" : "Pressed");
    }
  }
 
  oldOptionSwitch = optionSwitch;
  byte ReadOne165()
{
  byte ret = 0x00;

  // The first one that is read is the highest bit (input D7 of the 74HC165).
  for( int i=7; i>=0; i--)
  {
    if( digitalRead( SerData) == HIGH)
      bitSet( ret, i);

    digitalWrite( PCLK, HIGH);
    delayMicroseconds( pulseWidth);
    digitalWrite( PCLK, LOW);
  }

  return( ret);
}

What I need help with is how to split the "optionSwitch" to be able to set LEDs to High or Low depending on what button is pressed.

I was thinking like
int LED1
int LED2
...and so on...

I know
Led 1 is bit nr 47 of 48.
Led 2 is bit nr 46 of 48.

Post your code as one complete sketch.

(while I wait, here is my guess, which is probably wrong)

Wherever your "controll Leds" function is... test each bit of the variable holding the "Leds" using a "mask"... you will be making a "int to bin" converter.

int mask = 1; // a single bit to "AND" with each bit of a variable
for (bit = 0; bit < 8; bit++) {
  if (mask && optionSwitch) // bitwise "AND" of "1" and the LSB of optionSwitch
    mask << 1; // shift the mask left (you could also shift optionSwitch right)
    controllLeds(bit, on); // call "conrollLeds" with the bit
}

Here is a simulation of "int to bin" counting from 0 to 59 and lighting the binary equivalent of LEDs...