#include <array>
#include <cstring>
#include <iostream>

struct Oops {
    char a;
    int b;
};

void foo(std::array<char, 8>&) {
}
void (*foo_ptr)(std::array<char, 8>&) = foo;

bool __attribute__((noinline)) bar(Oops& o, char a, int b) {
    union {
        std::array<char, 8> x;
        Oops y;
    };
    x = {'P', 'o', 'p', 'a', 'p', 'o', 'p', 'a'};
    foo_ptr(x);
    y = {a, b};
    return std::memcmp(&o, &y, sizeof y) == 0;
}

int main() {
    Oops a = {1, 2};
    if (bar(a, 1, 2)) {
        std::cout << "Everything's fine" << std::endl;
    } else {
        std::cout << "Someone's an idiot" << std::endl;
    }
}