Q:

Bitwise operation on big endian and little endian differences

I'm sorting the "children" of prefixes for IP address space. For example, 8.8.8.0/24 is the child of 8.8.8.0/23 in IP address space. I'm confused as to why the following two operations provide different results on my x86 little endian system
A little background information:
A /24 means that the first 24 bits of a 32 bit IPv4 address are "defined". That means that 8.8.8.0/24 encompasses 8.8.8.0 - 8.8.8.255. Similarly, for every bit that's not defined, the amount of address space doubles. 8.8.8.0/23 would have only the first 23 bits defined, so the actual address space goes from 8.8.8.0 - 8.8.9.255, or twice the size of a /24.
Now the confusion I'm having is with the following bitshifts
inet_addr("8.8.8.0") << (32 - 23) produces 269488128
inet_addr("8.8.9.0") << (32 - 23) produces 303042560

inet_addr produces a big endian number. However, when converting it to little endian -
htonl(inet_addr("8.8.8.0")) >> 9 produces 263172
htonl(inet_addr("8.8.9.0")) >> 9 produces 263172

Which is the expected result. Dropping the last 9 bits would mean that 8.8.9.0 would be equal to 8.8.8.0 in theory.
What am I missing here? Shouldn't it work the same for big endian?
Edit: Not a duplicate because I do understand the difference in how endianness affects the way numbers are stored, but I'm clearly missing something with these bitwise operators. The question is more to do with bitwise than endianness - the endianness is just there to foster an example

A:

x86 is little endian. The number 1 in binary in little endian is 
|10000000|00000000|00000000|00000000

If you bit shift this left by 9 bits it becomes...
|00000000|01000000|00000000|00000000

Most people when thinking in binary think the number 1 is represented as follows and some people think this is big endian but it's not...
|00000000|00000000|00000000|00000001

The big endian representation of 1 is
|00000000|00000000|00000000|10000000

Try this code
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>

void print_bin(uint64_t num, size_t bytes) {
  int i = 0;
  for(i = bytes * 8; i > 0; i--) {
    (i % 8 == 0) ? printf("|") : 1;
    (num & 1)    ? printf("1") : printf("0");
    num >>= 1;
  }
  printf("\n");
}

int main(void) {
  in_addr_t left    = inet_addr("8.8.8.0");
  in_addr_t right   = inet_addr("8.8.9.0");
  in_addr_t left_h    = htonl(left);
  in_addr_t right_h   = htonl(right);
  in_addr_t left_s  = left  << 9;
  in_addr_t right_s = right >> 9;
  assert(left  != right);
  printf("left != right\n");
  print_bin(left, 4);
  print_bin(right, 4);
  printf("Big Endian if on x86\n");
  print_bin(left_s, 4);
  print_bin(right_s, 4);
  printf("Little Endian if on x86\n");
  print_bin(left_h, 4);
  print_bin(right_h, 4);
  return 0;
}

This is the output
left != right
|00010000|00010000|00010000|00000000
|00010000|00010000|10010000|00000000
Big Endian if on x86
|00000000|00001000|00001000|00001000
|00100001|00100000|00000000|00000000
Little Endian if on x86
|00000000|00010000|00010000|00010000
|00000000|10010000|00010000|00010000

