Too Long; Didn't Read
The program prints the binary representation of different access mode flags that are used in the open() function. The flags have “values that correspond to single bits”, (Hacking: The Art of Exploitation, Jon Erickson) and consequently, the flags can be added together (using the OR operator) to create new behavior. We use a bit mask (the mask) with a value of 4278190080 (this number requires four bytes) to isolate each byte. The outer loop runs four times — and is in charge of isolating each byte and checking if the msb (most significant bit) is set.