	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	_TextProc]
;
; Line 5:	int TextProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_TextProc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 020H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_2:
;
; Line 6:	{
;
;
; Line 8:	CTLWINDOW *ct = GetControl(wnd);
;
	MOV	EAX,DWORD [ESI+0108H]
	MOV	DWORD [EBP-08H],EAX
;
; Line 9:	char *cp, *cp2 = ct->itext;
;
	MOV	EAX,DWORD [EBP-08H]
	MOV	EAX,DWORD [EAX+018H]
	MOV	DWORD [EBP-04H],EAX
;
; Line 10:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 08H
	JE	SHORT	L_5
	CMP	EAX,BYTE 09H
	JE	SHORT	L_7
	CMP	EAX,BYTE 024H
	JE	SHORT	L_6
	JMP	NEAR	L_4
L_5:
;
; Line 12:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_1
L_6:
;
; Line 14:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_1
L_7:
;
; Line 16:	if (ct == NULL ||
;
	CMP	DWORD [EBP-08H],BYTE 00H
	JE	SHORT	L_10
	MOV	EAX,DWORD [EBP-08H]
	CMP	DWORD [EAX+018H],BYTE 00H
	JE	SHORT	L_10
	CMP	DWORD [ESI+098H],BYTE 00H
	JE	SHORT	L_8
L_10:
;
; Line 19:	break;
;
	JMP	NEAR	L_3
L_8:
;
; Line 20:	len = min(ct->dwnd.h, MsgHeight(cp2));
;
	PUSH	DWORD [EBP-04H]
	CALL	_MsgHeight
	POP	ECX
	MOV	ECX,DWORD [EBP-08H]
	CMP	DWORD [ECX+0CH],EAX
	JGE	SHORT	L_11
	MOV	EAX,DWORD [EBP-08H]
	MOV	EAX,DWORD [EAX+0CH]
	JMP	SHORT	L_12
L_11:
	PUSH	DWORD [EBP-04H]
	CALL	_MsgHeight
	POP	ECX
L_12:
	MOV	DWORD [EBP-0CH],EAX
;
; Line 21:	cp = cp2;
;
	MOV	EBX,DWORD [EBP-04H]
	MOV	DWORD [EBP-010H],00H
	JMP	NEAR	L_15
L_13:
;
; Line 25:	char *cp1 = cp;
;
	MOV	DWORD [EBP-01CH],EBX
;
; Line 26:	char *np = strchr(cp, '\n');
;
	PUSH	BYTE 0AH
	PUSH	EBX
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	DWORD [EBP-018H],EAX
;
; Line 27:	if (np != NULL)
;
	CMP	DWORD [EBP-018H],BYTE 00H
	JE	SHORT	L_17
;
; Line 28:	*np = '\0';
;
	MOV	EAX,DWORD [EBP-018H]
	MOV	BYTE [EAX+00H],00H
L_17:
;
; Line 29:	mlen = strlen(cp);
;
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-020H],EAX
	JMP	SHORT	L_19
L_21:
;
; Line 31:	mlen += 3;
;
	ADD	DWORD [EBP-020H],BYTE 03H
;
; Line 32:	cp1++;
;
	INC	DWORD [EBP-01CH]
L_19:
;
; Line 30:	while ((cp1=strchr(cp1,SHORTCUTCHAR)) != NULL) {
;
	PUSH	BYTE 07EH
	PUSH	DWORD [EBP-01CH]
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	DWORD [EBP-01CH],EAX
	TEST	EAX,EAX
	JNE	SHORT	L_21
L_20:
;
; Line 34:	if (np != NULL)
;
	CMP	DWORD [EBP-018H],BYTE 00H
	JE	SHORT	L_22
;
; Line 35:	*np = '\n';
;
	MOV	EAX,DWORD [EBP-018H]
	MOV	BYTE [EAX+00H],0AH
L_22:
;
; Line 36:	txt = DFmalloc((mlen+1) * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [EBP-020H]
	INC	EAX
	SHL	EAX,01H
	PUSH	EAX
	CALL	_DFmalloc
	POP	ECX
	MOV	EDI,EAX
;
; Line 37:	CopyCommand(txt, cp, FALSE, WndForeground(wnd),
;
	MOVSX	EAX,BYTE [ESI+035H]
	PUSH	EAX
	MOVSX	EAX,BYTE [ESI+034H]
	PUSH	EAX
	PUSH	BYTE 00H
	PUSH	EBX
	PUSH	EDI
	CALL	_CopyCommand
	ADD	ESP,BYTE 014H
;
; Line 39:	txt[mlen].ch = '\0';
;
	MOV	EAX,DWORD [EBP-020H]
	MOV	BYTE [EDI+EAX*2+00H],00H
;
; Line 40:	SendMessage(wnd, ADDTEXT, (PARAM)txt, 1);
;
	PUSH	BYTE 01H
	PUSH	EDI
	PUSH	BYTE 030H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 41:	if ((cp = strchr(cp, '\n')) != NULL)
;
	PUSH	BYTE 0AH
	PUSH	EBX
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	EBX,EAX
	TEST	EAX,EAX
	JE	SHORT	L_24
;
; Line 42:	cp++;
;
	INC	EBX
L_24:
;
; Line 43:	free(txt);
;
	PUSH	EDI
	CALL	_free
	POP	ECX
;
; Line 22:	for (i = 0; i < len; i++)    {
;
L_14:
	INC	DWORD [EBP-010H]
L_15:
	MOV	EAX,DWORD [EBP-010H]
	CMP	EAX,DWORD [EBP-0CH]
	JL	NEAR	L_13
L_16:
;
; Line 45:	break;
;
	JMP	SHORT	L_3
L_4:
;
; Line 47:	break;
;
	JMP	SHORT	L_3
L_3:
;
; Line 49:	return BaseWndProc(TEXT, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+09CH]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_1:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
SECTION _CONST

SECTION _TEXT
[EXTERN	_MsgHeight]
[EXTERN	_strlen]
[EXTERN	_DFmalloc]
[EXTERN	_free]
[EXTERN	_classdefs]
[EXTERN	_SendMessage]
[EXTERN	_strchr]
[EXTERN	_CopyCommand]
