	SECTION _TEXT align=1 CLASS=CODE USE32
	SECTION _DATA align=16 CLASS=DATA USE32
	SECTION _BSS align=16 CLASS=BSS USE32
	SECTION _CONST align=16 CLASS=CONST USE32
	SECTION _STRING align=4 CLASS=STRING USE32
	SECTION cstartup align=4 CLASS=INITDATA USE32
	SECTION crundown align=4 CLASS=EXITDATA USE32
	SECTION cppinit  align=4 CLASS=CPPINIT USE32
	SECTION cppexit  align=4 CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	_AllocationError]
;
; Line 5:	void AllocationError(void)
;
_AllocationError:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,084H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
L_8:
;
; Line 6:	{
;
;
; Line 18:	RECT rc = {30,11,47,13};
;
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD L_6
	LEA	EDI,[EBP-010H]
	PUSH	SS
	POP	ES
	CLD
	MOV	ECX,04H
	REP	MOVSD
	POP	EDI
	POP	ESI
;
; Line 19:	if (!OnceIn)	{
;
	CMP	DWORD [L_1],BYTE 00H
	JNE	NEAR	L_9
;
; Line 20:	OnceIn = TRUE;
;
	MOV	DWORD [L_1],01H
;
; Line 22:	SendMessage(ApplicationWindow, CLOSE_WINDOW, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 07H
	PUSH	DWORD [_ApplicationWindow]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 23:	getvideo(rc, savbuf);
;
	LEA	EAX,[EBP-07CH]
	PUSH	EAX
	PUSH	DWORD [EBP-010H+0CH]
	PUSH	DWORD [EBP-010H+08H]
	PUSH	DWORD [EBP-010H+04H]
	PUSH	DWORD [EBP-010H+00H]
	CALL	_getvideo
	ADD	ESP,BYTE 014H
	MOV	ESI,00H
	JMP	SHORT	L_13
L_11:
	MOV	EBX,00H
	JMP	SHORT	L_17
L_15:
;
; Line 26:	int c = (255 & (*(*(ErrMsg+y)+x))) | 0x7000;
;
	MOV	EAX,DWORD [EBX*4+L_2+00H]
	MOVSX	EAX,BYTE [EAX+ESI+00H]
	MOVZX	EAX,AL
	OR	EAX,07000H
	MOV	EDI,EAX
;
; Line 27:	PutVideoChar(x+rc.lf, y+rc.tp, c);
;
	PUSH	EDI
	MOV	EAX,EBX
	ADD	EAX,DWORD [EBP-0CH]
	PUSH	EAX
	MOV	EAX,ESI
	ADD	EAX,DWORD [EBP-010H]
	PUSH	EAX
	CALL	_PutVideoChar
	ADD	ESP,BYTE 0CH
;
; Line 25:	for (y = 0; y < 3; y++)		{
;
L_16:
	INC	EBX
L_17:
	CMP	EBX,BYTE 03H
	JL	SHORT	L_15
L_18:
;
; Line 24:	for (x = 0; x < 18; x++)	{
;
L_12:
	INC	ESI
L_13:
	CMP	ESI,BYTE 012H
	JL	SHORT	L_11
L_14:
;
; Line 30:	getkey();
;
	CALL	_getkey
;
; Line 31:	storevideo(rc, savbuf);
;
	LEA	EAX,[EBP-07CH]
	PUSH	EAX
	PUSH	DWORD [EBP-010H+0CH]
	PUSH	DWORD [EBP-010H+08H]
	PUSH	DWORD [EBP-010H+04H]
	PUSH	DWORD [EBP-010H+00H]
	CALL	_storevideo
	ADD	ESP,BYTE 014H
;
; Line 32:	if (AllocTesting)
;
	CMP	DWORD [_AllocTesting],BYTE 00H
	JE	SHORT	L_19
;
; Line 33:	longjmp(AllocError, 1);
;
	PUSH	BYTE 01H
	PUSH	DWORD _AllocError
	CALL	_longjmp
	ADD	ESP,BYTE 08H
L_19:
L_9:
;
; Line 35:	}
;
L_7:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_DFcalloc]
;
; Line 37:	void *DFcalloc(size_t nitems, size_t size)
;
_DFcalloc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+0CH]
L_22:
;
; Line 38:	{
;
;
; Line 39:	void *rtn = calloc(nitems, size);
;
	PUSH	ESI
	PUSH	DWORD [EBP+08H]
	CALL	_calloc
	ADD	ESP,BYTE 08H
	MOV	EBX,EAX
;
; Line 40:	if (size && rtn == NULL)
;
	TEST	ESI,ESI
	JE	SHORT	L_23
	TEST	EBX,EBX
	JNE	SHORT	L_23
;
; Line 41:	AllocationError();
;
	CALL	_AllocationError
L_23:
;
; Line 42:	return rtn;
;
	MOV	EAX,EBX
L_21:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_DFmalloc]
;
; Line 45:	void *DFmalloc(size_t size)
;
_DFmalloc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_26:
;
; Line 46:	{
;
;
; Line 47:	void *rtn = malloc(size);
;
	PUSH	ESI
	CALL	_malloc
	POP	ECX
	MOV	EBX,EAX
;
; Line 48:	if (size && rtn == NULL)
;
	TEST	ESI,ESI
	JE	SHORT	L_27
	TEST	EBX,EBX
	JNE	SHORT	L_27
;
; Line 49:	AllocationError();
;
	CALL	_AllocationError
L_27:
;
; Line 50:	return rtn;
;
	MOV	EAX,EBX
L_25:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_DFrealloc]
;
; Line 53:	void *DFrealloc(void *block, size_t size)
;
_DFrealloc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+0CH]
L_30:
;
; Line 54:	{
;
;
; Line 55:	void *rtn = realloc(block, size);
;
	PUSH	ESI
	PUSH	DWORD [EBP+08H]
	CALL	_realloc
	ADD	ESP,BYTE 08H
	MOV	EBX,EAX
;
; Line 56:	if (size && rtn == NULL)
;
	TEST	ESI,ESI
	JE	SHORT	L_31
	TEST	EBX,EBX
	JNE	SHORT	L_31
;
; Line 57:	AllocationError();
;
	CALL	_AllocationError
L_31:
;
; Line 58:	return rtn;
;
	MOV	EAX,EBX
L_29:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
SECTION _STRING
L_5:
	DB	0C0H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H
	DB	0C4H,0C4H,0C4H,0C4H,0C4H,0D9H,00H
L_4:
	DB	0B3H,020H,04FH,075H,074H,020H,06FH,066H,020H,04DH,065H,06DH
	DB	06FH,072H,079H,021H,020H,0B3H,00H
L_3:
	DB	0DAH,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H,0C4H
	DB	0C4H,0C4H,0C4H,0C4H,0C4H,0BFH,00H
SECTION _DATA

L_1	DD	00H

L_2	DD	L_3,L_4,L_5

L_6	DD	01EH,0BH,02FH,0DH
SECTION _CONST

SECTION _TEXT
[EXTERN	_malloc]
[EXTERN	_PutVideoChar]
[EXTERN	_calloc]
[EXTERN	_AllocError]
[EXTERN	_longjmp]
[EXTERN	_ApplicationWindow]
[EXTERN	_getkey]
[EXTERN	_storevideo]
[EXTERN	_getvideo]
[EXTERN	_SendMessage]
[EXTERN	_AllocTesting]
[EXTERN	_realloc]
