#include <iostream>
using namespace std;
void *allocateSpaceAndUses() {
return malloc(42); // Made up
}
class SelectInst
{
public:
int x;
};
void *operator new(size_t Size, unsigned Us) {
return allocateSpaceAndUses(); // Allocates enough space for Size and for Us uses
}
SelectInst *Create() {
return new(3) SelectInst();
}
int main()
{
auto ptr = Create();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCAqYWxsb2NhdGVTcGFjZUFuZFVzZXMoKSB7CglyZXR1cm4gbWFsbG9jKDQyKTsgLy8gTWFkZSB1cAp9CgpjbGFzcyBTZWxlY3RJbnN0CnsKcHVibGljOgogIGludCB4Owp9OwoKdm9pZCAqb3BlcmF0b3IgbmV3KHNpemVfdCBTaXplLCB1bnNpZ25lZCBVcykgewogIHJldHVybiBhbGxvY2F0ZVNwYWNlQW5kVXNlcygpOyAgLy8gQWxsb2NhdGVzIGVub3VnaCBzcGFjZSBmb3IgU2l6ZSBhbmQgZm9yIFVzIHVzZXMKfQoKU2VsZWN0SW5zdCAqQ3JlYXRlKCkgewogIHJldHVybiBuZXcoMykgU2VsZWN0SW5zdCgpOwp9CgppbnQgbWFpbigpCnsKICBhdXRvIHB0ciA9IENyZWF0ZSgpOwogIHJldHVybiAwOwp9