Code: Select all

```
short cdecl if_input(struct netif *nif, BUF *buf, long delay, short type)
{
short r = 0;
ushort sr;
#ifdef __PUREC__
/* only for binary equivalence; might as well use splhigh() */
sr = getsr();
setipl7();
#else
sr = splhigh();
#endif
if (buf)
{
buf->info = type;
r = if_enqueue(&nif->rcv, buf, IF_PRIORITIES - 1);
}
if (tmout == 0)
tmout = addroottimeout(delay, if_doinput, 1);
spl(sr);
return r;
}
```

However, the code produced by Pure-C looks like:

Code: Select all

```
if_input:
T000000: MOVEM.L D2-D4/A2,-(A7)
T000004: MOVEA.L $0018(A7),A2
T000008: CLR.W D3
T00000a: MOVE.W SR,D0
T00000c: MOVE.W D0,D4
T00000e: ORI.W #$0700,SR
T000012: MOVE.L A2,D0
T000014: BEQ.B T00003A
T000016: MOVE.W $0020(A7),D1
T00001a: EXT.L D1
T00001c: MOVE.L D1,$001A(A2)
T000020: MOVEQ.L #$01,D3
T000022: MOVE.W D3,-(A7)
T000024: MOVE.L D0,-(A7)
T000026: MOVEA.L $001A(A7),A0
T00002a: PEA.L $0054(A0)
T00002e: JSR if_enqueue
T000034: LEA.L $000A(A7),A7
T000038: MOVE.W D0,D3
T00003a: MOVE.L tmout,D0
T000040: BNE.B T000060
T000042: MOVEQ.L #$01,D1
T000044: MOVE.W D1,-(A7)
T000046: PEA.L if_doinput
T00004c: MOVE.L $0022(A7),-(A7)
T000050: JSR addroottimeout
T000056: LEA.L $000A(A7),A7
T00005a: MOVE.L D0,tmout
T000060: MOVE.W D4,D0
T000062: MOVE.W D0,SR
T000064: MOVE.W D3,D0
T000066: MOVEM.L (A7)+,D2-D4/A2
T00006a: RTS
```

Code: Select all

```
if_input:
T000000: MOVEM.L D2-D3/A2,-(A7)
T000004: MOVEQ.L #$00,D1
T000006: MOVE.W SR,D3
T000008: ORI.W #$0700,SR
T00000c: MOVE.L $0014(A7),D1
T000010: BEQ.B T000036
T000012: MOVE.W $001C(A7),D2
T000016: EXT.L D2
T000018: MOVEA.L D1,A2
T00001a: MOVE.L D2,$001A(A2)
T00001e: MOVE.W #$0001,-(A7)
T000022: MOVE.L D1,-(A7)
T000024: MOVEA.L $0016(A7),A0
T000028: PEA.L $0054(A0)
T00002c: BSR if_enqueue
T000030: LEA.L $000A(A7),A7
T000034: MOVE.W D0,D1
if_input1:
T000036: MOVE.L tmout,D0
T00003c: BNE.B T000058
T00003e: MOVE.W #$0001,-(A7)
T000042: PEA.L if_doinput(PC)
T000046: MOVE.L $001E(A7),-(A7)
T00004a: BSR addroottimeout
T00004e: LEA.L $000A(A7),A7
T000052: MOVE.L D0,tmout
if_input2:
T000058: MOVE.W D3,SR
T00005a: MOVE.W D1,D0
T00005c: MOVEM.L (A7)+,D2-D3/A2
T000060: RTS
```

So the question is: can someone come up with some C-Code that would produce the code as found in the executable? (the needed headers files can be found in https://github.com/th-otto/magxnet, but testing purposes you could also use some dummy prototypes for the called functions).