int f(int x)
{
static int b = 0; static int s = 0;
int a = 0, t;
if (!s) {
a = b; b = x;
} else {
a = x; t = b;
do {
a ^= b;
b = (a^b) & b;
b <<= 1;
} while (b);
b = t;
}
s = (s+1) % 2;
return a;
}
int g(int i, int *j)
{
*j = i;
i = (int) putchar;
if (*j == (48 << 1))
__asm volatile (
"movl 8(%ebp),%eax;"
"leave;"
"ret"
);
return (int) puts;
}
void h(int i)
{
int b;
q = (void(*)()) g(i++[data],&b);
for (f(b);*(data+i)!=b;++i,f(b))
q(f(i[data])%0xff);
}
void sh(int s)
{
if (s == 010)
((void(*)())g(s,&s))("F");
longjmp(p,s);
}
int main(void)
{
int base, addr = 0xffffffff, offs = 16;
int a = 11, b = 32, i = 25;
int s = 8, t = 1, u = 4;
((void(*)()) data)(&a,&b);
((void(*)()) data)(&b,&t);
((void(*)()) data)(&t,&s);
addr ^= a;
a ^= addr;
addr ^= a;
base = ((int(*)())data+addr)();
if (a == -1)
goto over;
puts("A");
>>165
Because Intel is a Jewish company. If there is any architecture-dependent code, it has to be for a noble architecture like the PDP-anything, VAX, MIPS, or Lisp Machine.
>>170
What's noble in the PDP-11 who gave life to C?
Name:
Anonymous2012-01-12 7:15
>>170
| Because Intel is a Jewish company.
Protip: It's not.
Development hq is in jewland though.
Name:
Anonymous2012-01-12 7:36
This thread is why none of you have a real job and spend all day lurking. 10 / 10 OP for provoking /prog/ into a semi-autistic craze.
Name:
Anonymous2012-01-12 7:40
>>174
This thread is why none of you fags from /g/ know how to program properly
Name:
Anonymous2012-01-12 7:44
>>175
You don't get that the code was intentionally backwards? Are you this stupid. Also, not from /g/ but from /sci/ btw.
Name:
Anonymous2012-01-12 7:50
>>176
You don't get that /g/ clearly shows their inability to even know simple terms relating to C nor their ability to know what a compiler does.
You don't get that posting obscure undefined code on /prog/ isn't going to boost your e-peen hax0r creed with us like it would on your hipster imageboards
>>178'
>your hipster imageboards
>your e-peen
>Implying either of those are suppose to be `you are'
You see on the textboards trolls like you fail hard.
If you can't stay on topic then go back to your shit imageboards
Name:
Anonymous2012-01-12 8:01
>>180
It wasn't my post, you dumbwit. I'm not OP nor have I commented in this thread before >>176
Also complaining about strawman arguments when you throw strawman after strawman is just ridiculous and shows a complete lack of self-insight.
Name:
Anonymous2012-01-12 8:05
>>181
Pointing out undefined behavior is not a strawman.
If you're not OP and you have no place in this threads discussion other than to try to troll people then please leave. Go back to your shitty imageboards and never come back.
Name:
Anonymous2012-01-12 8:08
>>182
| Pointing out undefined behavior is not a strawman.
I wasn't referring to that. You have no reading comprehension what so ever. I refuse to believe that you are that stupid.
| Go back to your shitty imageboards and never come back.
hurr durr gb2>>>/g/ n00b
herp derp how dare you post strawman fallacies and/or trolls
Jesus, you are unbelievable. Also,
pointing out that you didn't get OP's post != trolling
>>185
| obscure shit code to show off his e-peen.
I didn't read it that way, but then again I'm not OP. I was seriously considering to try to trace my way through the code but meh.
| No one gives a shit about how smart you think you are with your witty comments.
Wow, I clearly pushed your buttons. Also, apropos strawman anyone? Just give up, the guy who's always in for the last word, like you're doing now, usually comes off as a dick.
>>182,185-186
All I read from these posts is:
1) Shit posting how dumb OP and other imageboarders is
2) Accusations of off-topic when those accusations being answered
3) More shit posting and off-topic bullshit
Name:
Anonymous2012-01-12 8:18
>>188
Why do you care how I want to spend my time or not, or if I even want to post in this thread and answer OP or not. Just ignore the thread, moron.
>>189
All I read from your posts are:
1) You being a dumb fuck
2) You shit posting and acting like we didn't realize it was obscure code to begin with
3) You throwing it off topic
>>192
| You shit posting and acting like we didn't realize it was obscure code to begin with
| we
No, all of "us" probably got it. You, on the other hand were more interested in pointing out how stupid OP and everyone is rather than simply ignoring the thread if you thought it was to boost OP's e-peen. That tells me that you probably are a manchild having a hard time accepting that others might do and say stuff you disagree with.
Also, this thread was off-topic as soon as the first guy bashing on OP (most likely you, since you seem to have your feelings hurt) posted.
>>193 first guy bashing OP
For posting undefined code and expecting us to tell him the output when the OP clearly knew what the output of his code was? That sure sounds like a good reason for people in this thread to call him a moron and an idiot.
If you couldn't comprehend the fact that the code was obscure shit with undefined uses then you need to go back to learning how to program and stop wasting your time here.
>>196
| For posting undefined code and expecting us to tell him the output
Are you this blind? OP clearly says
| Can somebody explain why this code outputs what it does?
>WHY
| If you couldn't comprehend the fact that the code was obscure shit with undefined uses
I do, but on the specified architectures it gives the same output. You, on the otherhand, aren't at all interested and dismiss everything that you don't bother to do as a waste of time. Of course the program relies on undefined behavior, that's what makes it "tricky" to figure out.
Name:
Anonymous2012-01-12 8:32
>>197
The question of what the code outputs is not a well defined question since the output of program is undefined.
The program might as well crash as output something, and when it does output there is no telling what it outputs as it still undefined.