	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
;
; Line 16:	static BOOL AddTextMsg(WINDOW wnd, char *txt, BOOL wide)
;
_AddTextMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_2:
;
; Line 17:	{
;
;
; Line 20:	if (wide)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JE	SHORT	L_3
;
; Line 21:	adln = tstrlen(txt);
;
	PUSH	DWORD [EBP+0CH]
	CALL	_tstrlen
	POP	ECX
	MOV	DWORD [EBP-04H],EAX
	JMP	SHORT	L_4
L_3:
;
; Line 23:	adln = strlen(txt);
;
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-04H],EAX
L_4:
;
; Line 27:	if (wnd->text != NULL)    {
;
	CMP	DWORD [ESI+098H],BYTE 00H
	JE	SHORT	L_5
;
; Line 33:	if (wnd->textlen+adln + 2 > wnd->textalloc)    {
;
	MOV	EAX,DWORD [ESI+09CH]
	ADD	EAX,DWORD [EBP-04H]
	ADD	EAX,BYTE 02H
	CMP	EAX,DWORD [ESI+0A0H]
	JBE	SHORT	L_7
;
; Line 34:	wnd->textalloc = wnd->textlen + adln + 2;
;
	MOV	EAX,DWORD [ESI+09CH]
	ADD	EAX,DWORD [EBP-04H]
	ADD	EAX,BYTE 02H
	MOV	DWORD [ESI+0A0H],EAX
;
; Line 35:	wnd->text = DFrealloc(wnd->text, wnd->textalloc * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [ESI+0A0H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	DWORD [ESI+098H]
	CALL	_DFrealloc
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+098H],EAX
L_7:
	JMP	SHORT	L_6
L_5:
;
; Line 40:	wnd->textalloc = adln + 2;
;
	MOV	EAX,DWORD [EBP-04H]
	ADD	EAX,BYTE 02H
	MOV	DWORD [ESI+0A0H],EAX
;
; Line 41:	wnd->text = DFcalloc(1, wnd->textalloc * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [ESI+0A0H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	BYTE 01H
	CALL	_DFcalloc
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+098H],EAX
;
; Line 42:	wnd->textlen = 0;
;
	MOV	DWORD [ESI+09CH],00H
L_6:
;
; Line 44:	ChangedText(wnd, TRUE);
;
	PUSH	BYTE 01H
	PUSH	ESI
	CALL	_ChangedText
	ADD	ESP,BYTE 08H
;
; Line 45:	if (wnd->text != NULL)    {
;
	CMP	DWORD [ESI+098H],BYTE 00H
	JE	NEAR	L_9
;
; Line 47:	ATTRCHR *cp = wnd->text + wnd->textlen;
;
	MOV	EDI,DWORD [ESI+09CH]
	SHL	EDI,01H
	ADD	EDI,DWORD [ESI+098H]
;
; Line 48:	int attr = clr(WndForeground(wnd),WndBackground(wnd));
;
	MOVSX	EAX,BYTE [ESI+035H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [ESI+034H]
	OR	ECX,EAX
	MOV	EBX,ECX
;
; Line 49:	if (wide)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JE	SHORT	L_11
;
; Line 51:	memcpy(cp, txt, adln * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [EBP-04H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	PUSH	EDI
	CALL	_memcpy
	ADD	ESP,BYTE 0CH
	JMP	SHORT	L_12
L_11:
	JMP	SHORT	L_13
L_15:
;
; Line 57:	cp->ch = *txt++;
;
	MOV	EAX,DWORD [EBP+0CH]
	INC	DWORD [EBP+0CH]
	MOV	AL,BYTE [EAX+00H]
	MOV	BYTE [EDI+00H],AL
;
; Line 58:	cp->attrib = attr;
;
	MOV	BYTE [EDI+01H],BL
;
; Line 59:	cp++;
;
	ADD	EDI,BYTE 02H
L_13:
;
; Line 55:	while (*txt)
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_15
L_14:
L_12:
;
; Line 62:	wnd->textlen += adln;
;
	MOV	EAX,DWORD [EBP-04H]
	ADD	DWORD [ESI+09CH],EAX
;
; Line 63:	cp = wnd->text + wnd->textlen;
;
	MOV	EDI,DWORD [ESI+09CH]
	SHL	EDI,01H
	ADD	EDI,DWORD [ESI+098H]
;
; Line 64:	cp->ch = '\n';
;
	MOV	BYTE [EDI+00H],0AH
;
; Line 65:	cp->attrib = attr;
;
	MOV	BYTE [EDI+01H],BL
;
; Line 66:	(++cp)->ch = '\0';
;
	ADD	EDI,BYTE 02H
	MOV	BYTE [EDI+00H],00H
;
; Line 67:	wnd->textlen++;
;
	INC	DWORD [ESI+09CH]
;
; Line 68:	BuildTextPointers(wnd);
;
	PUSH	ESI
	CALL	_BuildTextPointers
	POP	ECX
;
; Line 69:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_1
L_9:
;
; Line 71:	return FALSE;
;
	MOV	EAX,00H
L_1:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 75:	static void DeleteTextMsg(WINDOW wnd, int lno)
;
_DeleteTextMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+0CH]
L_17:
;
; Line 76:	{
;
;
; Line 77:	ATTRCHR *cp1 = TextLine(wnd, lno);
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	EAX,DWORD [EAX+EDI*4+00H]
	SHL	EAX,01H
	ADD	EAX,DWORD [ESI+098H]
	MOV	DWORD [EBP-04H],EAX
;
; Line 78:	--wnd->wlines;
;
	DEC	DWORD [ESI+090H]
;
; Line 79:	if (lno == wnd->wlines)
;
	CMP	EDI,DWORD [ESI+090H]
	JNE	SHORT	L_18
;
; Line 80:	cp1->ch = '\0';
;
	MOV	EAX,DWORD [EBP-04H]
	MOV	BYTE [EAX+00H],00H
	JMP	SHORT	L_19
L_18:
;
; Line 82:	ATTRCHR *cp2 = TextLine(wnd, lno+1);
;
	MOV	EAX,DWORD [ESI+0C4H]
	LEA	EAX,[EAX+EDI*4+00H]
	MOV	EBX,DWORD [EAX+04H]
	SHL	EBX,01H
	ADD	EBX,DWORD [ESI+098H]
;
; Line 83:	memmove(cp1, cp2, (tstrlen(cp2)+1) * sizeof(ATTRCHR));
;
	PUSH	EBX
	CALL	_tstrlen
	POP	ECX
	INC	EAX
	SHL	EAX,01H
	PUSH	EAX
	PUSH	EBX
	PUSH	DWORD [EBP-04H]
	CALL	_memmove
	ADD	ESP,BYTE 0CH
L_19:
;
; Line 85:	BuildTextPointers(wnd);
;
	PUSH	ESI
	CALL	_BuildTextPointers
	POP	ECX
;
; Line 86:	}
;
L_16:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 89:	static void InsertTextMsg(WINDOW wnd, char *txt, int lno)
;
_InsertTextMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+08H]
L_21:
;
; Line 90:	{
;
;
; Line 91:	if (AddTextMsg(wnd, txt, 0))	{
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	EDI
	CALL	_AddTextMsg
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JE	NEAR	L_22
;
; Line 92:	int len = strlen(txt)+1;
;
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	INC	EAX
	MOV	DWORD [EBP-08H],EAX
;
; Line 93:	ATTRCHR *cp2 = TextLine(wnd, lno);
;
	MOV	EAX,DWORD [EDI+0C4H]
	MOV	ECX,DWORD [EBP+010H]
	MOV	ESI,DWORD [EAX+ECX*4+00H]
	SHL	ESI,01H
	ADD	ESI,DWORD [EDI+098H]
;
; Line 94:	ATTRCHR *cp1 = cp2+len;
;
	MOV	EAX,DWORD [EBP-08H]
	SHL	EAX,01H
	ADD	EAX,ESI
	MOV	DWORD [EBP-04H],EAX
;
; Line 95:	int attr = clr(WndForeground(wnd),WndBackground(wnd));
;
	MOVSX	EAX,BYTE [EDI+035H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [EDI+034H]
	OR	ECX,EAX
	MOV	EBX,ECX
;
; Line 96:	memmove(cp1, cp2, (tstrlen(cp2)-len) * sizeof(ATTRCHR));
;
	PUSH	ESI
	CALL	_tstrlen
	POP	ECX
	SUB	EAX,DWORD [EBP-08H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	ESI
	PUSH	DWORD [EBP-04H]
	CALL	_memmove
	ADD	ESP,BYTE 0CH
;
; Line 97:	strcpy(cp2, txt);
;
	PUSH	DWORD [EBP+0CH]
	PUSH	ESI
	CALL	_strcpy
	ADD	ESP,BYTE 08H
	JMP	SHORT	L_24
L_26:
;
; Line 100:	cp2->ch = *txt++;
;
	MOV	EAX,DWORD [EBP+0CH]
	INC	DWORD [EBP+0CH]
	MOV	AL,BYTE [EAX+00H]
	MOV	BYTE [ESI+00H],AL
;
; Line 101:	cp2->attrib = attr;
;
	MOV	BYTE [ESI+01H],BL
;
; Line 102:	cp2++;
;
	ADD	ESI,BYTE 02H
L_24:
;
; Line 98:	while (*txt)
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_26
L_25:
;
; Line 104:	cp2->ch = '\n';
;
	MOV	BYTE [ESI+00H],0AH
;
; Line 105:	cp2->attrib = attr;
;
	MOV	BYTE [ESI+01H],BL
;
; Line 106:	BuildTextPointers(wnd);
;
	PUSH	EDI
	CALL	_BuildTextPointers
	POP	ECX
;
; Line 107:	ChangedText(wnd, TRUE);
;
	PUSH	BYTE 01H
	PUSH	EDI
	CALL	_ChangedText
	ADD	ESP,BYTE 08H
L_22:
;
; Line 109:	}
;
L_20:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 112:	static void SetTextMsg(WINDOW wnd, char *txt, BOOL wide)
;
_SetTextMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 0CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+0CH]
L_28:
;
; Line 113:	{
;
;
; Line 116:	int attr = clr(WndForeground(wnd),WndBackground(wnd));
;
	MOVSX	EAX,BYTE [EDI+035H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [EDI+034H]
	OR	ECX,EAX
	MOV	DWORD [EBP-04H],ECX
;
; Line 118:	if (wide)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JE	SHORT	L_29
;
; Line 119:	len = tstrlen(txt);
;
	PUSH	EBX
	CALL	_tstrlen
	POP	ECX
	MOV	DWORD [EBP-08H],EAX
	JMP	SHORT	L_30
L_29:
;
; Line 121:	len = strlen(txt);
;
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-08H],EAX
L_30:
;
; Line 122:	SendMessage(wnd, CLEARTEXT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 033H
	PUSH	EDI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 123:	wnd->textalloc = len + 2;
;
	MOV	EAX,DWORD [EBP-08H]
	ADD	EAX,BYTE 02H
	MOV	DWORD [EDI+0A0H],EAX
;
; Line 124:	wnd->textlen = len;
;
	MOV	EAX,DWORD [EBP-08H]
	MOV	DWORD [EDI+09CH],EAX
;
; Line 125:	wnd->text=DFrealloc(wnd->text, wnd->textalloc * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [EDI+0A0H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	DWORD [EDI+098H]
	CALL	_DFrealloc
	ADD	ESP,BYTE 08H
	MOV	DWORD [EDI+098H],EAX
;
; Line 126:	cp = wnd->text ;
;
	MOV	ESI,DWORD [EDI+098H]
;
; Line 127:	if (wide)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JE	SHORT	L_31
;
; Line 129:	memcpy(cp, txt, len* sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [EBP-08H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	EBX
	PUSH	ESI
	CALL	_memcpy
	ADD	ESP,BYTE 0CH
;
; Line 130:	cp += len;
;
	MOV	EAX,DWORD [EBP-08H]
	SHL	EAX,01H
	ADD	ESI,EAX
	JMP	SHORT	L_32
L_31:
	JMP	SHORT	L_33
L_35:
;
; Line 136:	cp->ch = *txt++;
;
	MOV	EAX,EBX
	INC	EBX
	MOV	AL,BYTE [EAX+00H]
	MOV	BYTE [ESI+00H],AL
;
; Line 137:	cp->attrib = attr;
;
	MOV	EAX,DWORD [EBP-04H]
	MOV	BYTE [ESI+01H],AL
;
; Line 138:	cp++;
;
	ADD	ESI,BYTE 02H
L_33:
;
; Line 134:	while (*txt)
;
	CMP	BYTE [EBX+00H],BYTE 00H
	JNE	SHORT	L_35
L_34:
L_32:
;
; Line 141:	cp->ch = '\n';
;
	MOV	BYTE [ESI+00H],0AH
;
; Line 142:	cp->attrib = attr;
;
	MOV	EAX,DWORD [EBP-04H]
	MOV	BYTE [ESI+01H],AL
;
; Line 143:	cp++;
;
	ADD	ESI,BYTE 02H
;
; Line 144:	cp->ch = '\0';
;
	MOV	BYTE [ESI+00H],00H
;
; Line 145:	BuildTextPointers(wnd);
;
	PUSH	EDI
	CALL	_BuildTextPointers
	POP	ECX
;
; Line 146:	}
;
L_27:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 149:	static void ClearTextMsg(WINDOW wnd)
;
_ClearTextMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_37:
;
; Line 150:	{
;
;
; Line 152:	if (wnd->text != NULL)
;
	CMP	DWORD [ESI+098H],BYTE 00H
	JE	SHORT	L_38
;
; Line 153:	free(wnd->text);
;
	PUSH	DWORD [ESI+098H]
	CALL	_free
	POP	ECX
L_38:
;
; Line 154:	wnd->text = NULL;
;
	MOV	DWORD [ESI+098H],00H
;
; Line 155:	wnd->textlen = 0;
;
	MOV	DWORD [ESI+09CH],00H
;
; Line 156:	wnd->textalloc = 0;
;
	MOV	DWORD [ESI+0A0H],00H
;
; Line 157:	wnd->wlines = 0;
;
	MOV	DWORD [ESI+090H],00H
;
; Line 158:	wnd->textwidth = 0;
;
	MOV	DWORD [ESI+0A8H],00H
;
; Line 159:	wnd->wtop = wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
	MOV	DWORD [ESI+094H],00H
;
; Line 160:	ClearTextBlock(wnd);
;
	MOV	DWORD [ESI+0B8H],00H
	MOV	DWORD [ESI+0B0H],00H
	MOV	DWORD [ESI+0B4H],00H
	MOV	DWORD [ESI+0ACH],00H
;
; Line 161:	ClearTextPointers(wnd);
;
	PUSH	ESI
	CALL	_ClearTextPointers
	POP	ECX
;
; Line 162:	}
;
L_36:
	POP	ESI
	POP	EBP
	RET
;
; Line 165:	static int KeyboardMsg(WINDOW wnd, PARAM p1)
;
_KeyboardMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
L_41:
;
; Line 166:	{
;
;
; Line 167:	switch ((int) p1)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,DWORD 010CDH
	JE	NEAR	L_46
	JG	SHORT	L_54
	CMP	EAX,DWORD 010C8H
	JE	NEAR	L_44
	JG	SHORT	L_55
	CMP	EAX,DWORD 010C7H
	JE	NEAR	L_52
	JG	NEAR	L_43
	CMP	EAX,DWORD 01084H
	JE	NEAR	L_50
	JMP	NEAR	L_43
L_55:
	CMP	EAX,DWORD 010CBH
	JE	NEAR	L_47
	JG	NEAR	L_43
	CMP	EAX,DWORD 010C9H
	JE	NEAR	L_48
	JMP	NEAR	L_43
L_54:
	CMP	EAX,DWORD 010D1H
	JE	NEAR	L_49
	JG	SHORT	L_56
	CMP	EAX,DWORD 010D0H
	JE	SHORT	L_45
	JG	NEAR	L_43
	CMP	EAX,DWORD 010CFH
	JE	NEAR	L_53
	JMP	NEAR	L_43
L_56:
	CMP	EAX,DWORD 010F6H
	JE	NEAR	L_51
	JMP	NEAR	L_43
L_44:
;
; Line 169:	return SendMessage(wnd,SCROLL,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 035H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_40
L_45:
;
; Line 171:	return SendMessage(wnd,SCROLL,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 035H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_40
L_46:
;
; Line 173:	return SendMessage(wnd,HORIZSCROLL,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 036H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_40
L_47:
;
; Line 175:	return SendMessage(wnd,HORIZSCROLL,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 036H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_48:
;
; Line 177:	return SendMessage(wnd,SCROLLPAGE,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 037H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_49:
;
; Line 179:	return SendMessage(wnd,SCROLLPAGE,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 037H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_50:
;
; Line 181:	return SendMessage(wnd,HORIZPAGE,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 038H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_51:
;
; Line 183:	return SendMessage(wnd,HORIZPAGE,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 038H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_52:
;
; Line 185:	return SendMessage(wnd,SCROLLDOC,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 039H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_53:
;
; Line 187:	return SendMessage(wnd,SCROLLDOC,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 039H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_40
L_43:
;
; Line 189:	break;
;
	JMP	SHORT	L_42
L_42:
;
; Line 191:	return FALSE;
;
	MOV	EAX,00H
L_40:
	POP	EBX
	POP	EBP
	RET
;
; Line 195:	static int LeftButtonMsg(WINDOW wnd, PARAM p1, PARAM p2)
;
_LeftButtonMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 018H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	LEA	EDI,[EBP-018H]
L_58:
;
; Line 196:	{
;
;
; Line 197:	int mx = (int) p1 - GetLeft(wnd);
;
	MOV	EAX,DWORD [EBP+0CH]
	SUB	EAX,DWORD [ESI+0CH]
	MOV	DWORD [EBP-04H],EAX
;
; Line 198:	int my = (int) p2 - GetTop(wnd);
;
	MOV	EBX,DWORD [EBP+010H]
	SUB	EBX,DWORD [ESI+010H]
;
; Line 199:	if (TestAttribute(wnd, VSCROLLBAR) &&
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 010H
	JE	NEAR	L_59
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	CMP	DWORD [EBP-04H],EAX
	JNE	NEAR	L_59
;
; Line 202:	if (my == 0 || my == ClientHeight(wnd)+1)
;
	TEST	EBX,EBX
	JE	NEAR	L_63
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_64
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_64
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_64
	MOV	EAX,03H
	JMP	SHORT	L_65
L_64:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_69
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_68
L_69:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_66
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_66
L_68:
	MOV	EAX,02H
	JMP	SHORT	L_67
L_66:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_70
	MOV	EAX,01H
	JMP	SHORT	L_71
L_70:
	MOV	EAX,00H
L_71:
L_67:
L_65:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_72
	MOV	EAX,01H
	JMP	SHORT	L_73
L_72:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_74
	MOV	EAX,01H
	JMP	SHORT	L_75
L_74:
	MOV	EAX,00H
L_75:
L_73:
	SUB	ECX,EAX
	INC	ECX
	CMP	EBX,ECX
	JNE	SHORT	L_61
L_63:
;
; Line 204:	return FALSE;
;
	MOV	EAX,00H
	JMP	NEAR	L_57
L_61:
;
; Line 205:	if (my == 1)
;
	CMP	EBX,BYTE 01H
	JNE	SHORT	L_76
;
; Line 207:	return SendMessage(wnd, SCROLL, FALSE, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 035H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_76:
;
; Line 208:	if (my == ClientHeight(wnd))
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_80
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_80
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_80
	MOV	EAX,03H
	JMP	SHORT	L_81
L_80:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_85
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_84
L_85:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_82
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_82
L_84:
	MOV	EAX,02H
	JMP	SHORT	L_83
L_82:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_86
	MOV	EAX,01H
	JMP	SHORT	L_87
L_86:
	MOV	EAX,00H
L_87:
L_83:
L_81:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_88
	MOV	EAX,01H
	JMP	SHORT	L_89
L_88:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_90
	MOV	EAX,01H
	JMP	SHORT	L_91
L_90:
	MOV	EAX,00H
L_91:
L_89:
	SUB	ECX,EAX
	CMP	EBX,ECX
	JNE	SHORT	L_78
;
; Line 210:	return SendMessage(wnd, SCROLL, TRUE, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 035H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_78:
;
; Line 212:	if (!VSliding && my-1 == wnd->VScrollBox)    {
;
	CMP	DWORD [_VSliding],BYTE 00H
	JNE	SHORT	L_92
	MOV	EAX,EBX
	DEC	EAX
	CMP	EAX,DWORD [ESI+0C0H]
	JNE	SHORT	L_92
;
; Line 214:	VSliding = TRUE;
;
	MOV	DWORD [_VSliding],01H
;
; Line 215:	rc.lf = rc.rt = GetRight(wnd);
;
	MOV	EAX,DWORD [ESI+014H]
	MOV	DWORD [EBP-010H],EAX
	MOV	DWORD [EBP-018H],EAX
;
; Line 216:	rc.tp = GetTop(wnd)+2;
;
	MOV	EAX,DWORD [ESI+010H]
	ADD	EAX,BYTE 02H
	MOV	DWORD [EBP-014H],EAX
;
; Line 217:	rc.bt = GetBottom(wnd)-2;
;
	MOV	EAX,DWORD [ESI+018H]
	SUB	EAX,BYTE 02H
	MOV	DWORD [EBP-0CH],EAX
;
; Line 218:	return SendMessage(NULL, MOUSE_TRAVEL,
;
	PUSH	BYTE 00H
	LEA	EAX,[EBP-018H]
	PUSH	EAX
	PUSH	BYTE 021H
	PUSH	BYTE 00H
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_92:
;
; Line 221:	if (my-1 < wnd->VScrollBox)
;
	MOV	EAX,EBX
	DEC	EAX
	CMP	EAX,DWORD [ESI+0C0H]
	JGE	SHORT	L_94
;
; Line 222:	return SendMessage(wnd,SCROLLPAGE,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 037H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_94:
;
; Line 223:	if (my-1 > wnd->VScrollBox)
;
	MOV	EAX,EBX
	DEC	EAX
	CMP	EAX,DWORD [ESI+0C0H]
	JLE	SHORT	L_96
;
; Line 224:	return SendMessage(wnd,SCROLLPAGE,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 037H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_96:
L_59:
;
; Line 226:	if (TestAttribute(wnd, HSCROLLBAR) &&
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 020H
	JE	NEAR	L_98
	MOV	EAX,DWORD [ESI+01CH]
	DEC	EAX
	CMP	EBX,EAX
	JNE	NEAR	L_98
;
; Line 229:	if (mx == 0 || my == ClientWidth(wnd)+1)
;
	CMP	DWORD [EBP-04H],BYTE 00H
	JE	SHORT	L_102
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_103
	MOV	EAX,01H
	JMP	SHORT	L_104
L_103:
	MOV	EAX,00H
L_104:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	INC	ECX
	CMP	EBX,ECX
	JNE	SHORT	L_100
L_102:
;
; Line 231:	return FALSE;
;
	MOV	EAX,00H
	JMP	NEAR	L_57
L_100:
;
; Line 232:	if (mx == 1)
;
	CMP	DWORD [EBP-04H],BYTE 01H
	JNE	SHORT	L_105
;
; Line 233:	return SendMessage(wnd, HORIZSCROLL,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 036H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_105:
;
; Line 234:	if (mx == WindowWidth(wnd)-2)
;
	MOV	EAX,DWORD [ESI+020H]
	SUB	EAX,BYTE 02H
	CMP	DWORD [EBP-04H],EAX
	JNE	SHORT	L_107
;
; Line 235:	return SendMessage(wnd, HORIZSCROLL,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 036H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_57
L_107:
;
; Line 236:	if (!HSliding && mx-1 == wnd->HScrollBox)    {
;
	CMP	DWORD [_HSliding],BYTE 00H
	JNE	SHORT	L_109
	MOV	EAX,DWORD [EBP-04H]
	DEC	EAX
	CMP	EAX,DWORD [ESI+0BCH]
	JNE	SHORT	L_109
;
; Line 239:	rc.lf = GetLeft(wnd)+2;
;
	MOV	EAX,DWORD [ESI+0CH]
	ADD	EAX,BYTE 02H
	MOV	DWORD [SS:EDI+00H],EAX
;
; Line 240:	rc.rt = GetRight(wnd)-2;
;
	MOV	EAX,DWORD [ESI+014H]
	SUB	EAX,BYTE 02H
	MOV	DWORD [SS:EDI+08H],EAX
;
; Line 241:	rc.tp = rc.bt = GetBottom(wnd);
;
	MOV	EAX,DWORD [ESI+018H]
	MOV	DWORD [SS:EDI+0CH],EAX
	MOV	DWORD [SS:EDI+04H],EAX
;
; Line 243:	SendMessage(NULL,MOUSE_TRAVEL,(PARAM)&rc,0);
;
	PUSH	BYTE 00H
	PUSH	EDI
	PUSH	BYTE 021H
	PUSH	BYTE 00H
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 244:	HSliding = TRUE;
;
	MOV	DWORD [_HSliding],01H
;
; Line 245:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_57
L_109:
;
; Line 247:	if (mx-1 < wnd->HScrollBox)
;
	MOV	EAX,DWORD [EBP-04H]
	DEC	EAX
	CMP	EAX,DWORD [ESI+0BCH]
	JGE	SHORT	L_111
;
; Line 248:	return SendMessage(wnd,HORIZPAGE,FALSE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 038H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_57
L_111:
;
; Line 249:	if (mx-1 > wnd->HScrollBox)
;
	MOV	EAX,DWORD [EBP-04H]
	DEC	EAX
	CMP	EAX,DWORD [ESI+0BCH]
	JLE	SHORT	L_113
;
; Line 250:	return SendMessage(wnd,HORIZPAGE,TRUE,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 038H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_57
L_113:
L_98:
;
; Line 252:	return FALSE;
;
	MOV	EAX,00H
L_57:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 256:	static BOOL MouseMovedMsg(WINDOW wnd, PARAM p1, PARAM p2)
;
_MouseMovedMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_116:
;
; Line 257:	{
;
;
; Line 258:	int mx = (int) p1 - GetLeft(wnd);
;
	MOV	EDI,DWORD [EBP+0CH]
	SUB	EDI,DWORD [ESI+0CH]
;
; Line 259:	int my = (int) p2 - GetTop(wnd);
;
	MOV	EBX,DWORD [EBP+010H]
	SUB	EBX,DWORD [ESI+010H]
;
; Line 260:	if (VSliding)    {
;
	CMP	DWORD [_VSliding],BYTE 00H
	JE	SHORT	L_117
;
; Line 262:	if (my-1 != wnd->VScrollBox)    {
;
	MOV	EAX,EBX
	DEC	EAX
	CMP	EAX,DWORD [ESI+0C0H]
	JE	SHORT	L_119
;
; Line 263:	foreground = FrameForeground(wnd);
;
	MOVSX	EAX,BYTE [ESI+038H]
	MOV	DWORD [_foreground],EAX
;
; Line 264:	background = FrameBackground(wnd);
;
	MOVSX	EAX,BYTE [ESI+039H]
	MOV	DWORD [_background],EAX
;
; Line 265:	wputch(wnd, SCROLLBARCHAR, WindowWidth(wnd)-1,
;
	MOV	EAX,DWORD [ESI+0C0H]
	INC	EAX
	PUSH	EAX
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	PUSH	EAX
	PUSH	DWORD 0B0H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 267:	wnd->VScrollBox = my-1;
;
	MOV	EAX,EBX
	DEC	EAX
	MOV	DWORD [ESI+0C0H],EAX
;
; Line 268:	wputch(wnd, SCROLLBOXCHAR, WindowWidth(wnd)-1,
;
	PUSH	EBX
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	PUSH	EAX
	PUSH	DWORD 0B2H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
L_119:
;
; Line 271:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_115
L_117:
;
; Line 273:	if (HSliding)    {
;
	CMP	DWORD [_HSliding],BYTE 00H
	JE	SHORT	L_121
;
; Line 275:	if (mx-1 != wnd->HScrollBox)    {
;
	MOV	EAX,EDI
	DEC	EAX
	CMP	EAX,DWORD [ESI+0BCH]
	JE	SHORT	L_123
;
; Line 276:	foreground = FrameForeground(wnd);
;
	MOVSX	EAX,BYTE [ESI+038H]
	MOV	DWORD [_foreground],EAX
;
; Line 277:	background = FrameBackground(wnd);
;
	MOVSX	EAX,BYTE [ESI+039H]
	MOV	DWORD [_background],EAX
;
; Line 278:	wputch(wnd, SCROLLBARCHAR, wnd->HScrollBox+1,
;
	MOV	EAX,DWORD [ESI+01CH]
	DEC	EAX
	PUSH	EAX
	MOV	EAX,DWORD [ESI+0BCH]
	INC	EAX
	PUSH	EAX
	PUSH	DWORD 0B0H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 280:	wnd->HScrollBox = mx-1;
;
	MOV	EAX,EDI
	DEC	EAX
	MOV	DWORD [ESI+0BCH],EAX
;
; Line 281:	wputch(wnd, SCROLLBOXCHAR, mx, WindowHeight(wnd)-1);
;
	MOV	EAX,DWORD [ESI+01CH]
	DEC	EAX
	PUSH	EAX
	PUSH	EDI
	PUSH	DWORD 0B2H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
L_123:
;
; Line 283:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_115
L_121:
;
; Line 285:	return FALSE;
;
	MOV	EAX,00H
L_115:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 289:	static void ButtonReleasedMsg(WINDOW wnd)
;
_ButtonReleasedMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	EBX,DWORD [EBP+08H]
	MOV	ESI,DWORD _VSliding
L_126:
;
; Line 290:	{
;
;
; Line 291:	if (HSliding || VSliding)    {
;
	CMP	DWORD [_HSliding],BYTE 00H
	JNE	SHORT	L_129
	CMP	DWORD [ESI+00H],BYTE 00H
	JE	SHORT	L_127
L_129:
;
; Line 293:	SendMessage(NULL, MOUSE_TRAVEL, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 021H
	PUSH	BYTE 00H
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 294:	VSliding ? ComputeWindowTop(wnd):ComputeWindowLeft(wnd);
;
	CMP	DWORD [ESI+00H],BYTE 00H
	JE	SHORT	L_130
	PUSH	EBX
	CALL	_ComputeWindowTop
	POP	ECX
	JMP	SHORT	L_131
L_130:
	PUSH	EBX
	CALL	_ComputeWindowLeft
	POP	ECX
L_131:
;
; Line 295:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 296:	SendMessage(wnd, KEYBOARD_CURSOR, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 018H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 297:	VSliding = HSliding = FALSE;
;
	MOV	DWORD [_HSliding],00H
	MOV	DWORD [ESI+00H],00H
L_127:
;
; Line 299:	}
;
L_125:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 302:	static BOOL ScrollMsg(WINDOW wnd, PARAM p1)
;
_ScrollMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 024H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	LEA	EDI,[EBP-020H]
L_133:
;
; Line 303:	{
;
;
; Line 305:	if (p1)    {
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JE	NEAR	L_134
;
; Line 307:	if (wnd->wtop+ClientHeight(wnd) >= wnd->wlines)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_138
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_138
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_138
	MOV	EAX,03H
	JMP	SHORT	L_139
L_138:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_143
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_142
L_143:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_140
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_140
L_142:
	MOV	EAX,02H
	JMP	SHORT	L_141
L_140:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_144
	MOV	EAX,01H
	JMP	SHORT	L_145
L_144:
	MOV	EAX,00H
L_145:
L_141:
L_139:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_146
	MOV	EAX,01H
	JMP	SHORT	L_147
L_146:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_148
	MOV	EAX,01H
	JMP	SHORT	L_149
L_148:
	MOV	EAX,00H
L_149:
L_147:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	ECX,DWORD [ESI+090H]
	JL	SHORT	L_136
;
; Line 308:	return FALSE;
;
	MOV	EAX,00H
	JMP	NEAR	L_132
L_136:
;
; Line 309:	wnd->wtop++;
;
	INC	DWORD [ESI+094H]
	JMP	SHORT	L_135
L_134:
;
; Line 313:	if (wnd->wtop == 0)
;
	CMP	DWORD [ESI+094H],BYTE 00H
	JNE	SHORT	L_150
;
; Line 314:	return FALSE;
;
	MOV	EAX,00H
	JMP	NEAR	L_132
L_150:
;
; Line 315:	--wnd->wtop;
;
	DEC	DWORD [ESI+094H]
L_135:
;
; Line 317:	if (isVisible(wnd))    {
;
	PUSH	ESI
	CALL	_isVisible
	POP	ECX
	TEST	EAX,EAX
	JE	NEAR	L_152
;
; Line 319:	rc = ClipRectangle(wnd, ClientRect(wnd));
;
	PUSH	ESI
	LEA	EAX,[EBP-010H]
	PUSH	EAX
	CALL	_ClientRect
	ADD	ESP,BYTE 08H
	PUSH	DWORD [EAX+00H+0CH]
	PUSH	DWORD [EAX+00H+08H]
	PUSH	DWORD [EAX+00H+04H]
	PUSH	DWORD [EAX+00H+00H]
	PUSH	ESI
	PUSH	EDI
	CALL	_ClipRectangle
	ADD	ESP,BYTE 018H
;
; Line 320:	if (ValidRect(rc))    {
;
	CMP	DWORD [SS:EDI+08H],BYTE 00H
	JNE	SHORT	L_156
	CMP	DWORD [SS:EDI+00H],BYTE 00H
	JNE	SHORT	L_156
	CMP	DWORD [SS:EDI+04H],BYTE 00H
	JNE	SHORT	L_156
	CMP	DWORD [SS:EDI+0CH],BYTE 00H
	JE	NEAR	L_154
L_156:
;
; Line 322:	if (wnd != inFocus)
;
	CMP	ESI,DWORD [_inFocus]
	JE	SHORT	L_157
;
; Line 323:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_158
L_157:
;
; Line 325:	scroll_window(wnd, rc, (int)p1);
;
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [SS:EDI+00H+0CH]
	PUSH	DWORD [SS:EDI+00H+08H]
	PUSH	DWORD [SS:EDI+00H+04H]
	PUSH	DWORD [SS:EDI+00H+00H]
	PUSH	ESI
	CALL	_scroll_window
	ADD	ESP,BYTE 018H
;
; Line 326:	if (!(int)p1)
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JNE	SHORT	L_159
;
; Line 328:	WriteTextLine(wnd,NULL,wnd->wtop,FALSE);
;
	PUSH	BYTE 00H
	PUSH	DWORD [ESI+094H]
	PUSH	BYTE 00H
	PUSH	ESI
	CALL	_WriteTextLine
	ADD	ESP,BYTE 010H
	JMP	NEAR	L_160
L_159:
;
; Line 331:	int y=RectBottom(rc)-GetClientTop(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_161
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_161
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_161
	MOV	EAX,03H
	JMP	SHORT	L_162
L_161:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_166
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_165
L_166:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_163
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_163
L_165:
	MOV	EAX,02H
	JMP	SHORT	L_164
L_163:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_167
	MOV	EAX,01H
	JMP	SHORT	L_168
L_167:
	MOV	EAX,00H
L_168:
L_164:
L_162:
	ADD	EAX,DWORD [ESI+010H]
	MOV	ECX,DWORD [SS:EDI+0CH]
	SUB	ECX,EAX
	MOV	DWORD [EBP-024H],ECX
;
; Line 332:	WriteTextLine(wnd, NULL,
;
	PUSH	BYTE 00H
	MOV	EAX,DWORD [ESI+094H]
	ADD	EAX,DWORD [EBP-024H]
	PUSH	EAX
	PUSH	BYTE 00H
	PUSH	ESI
	CALL	_WriteTextLine
	ADD	ESP,BYTE 010H
L_160:
L_158:
L_154:
;
; Line 338:	if (TestAttribute(wnd, VSCROLLBAR))    {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 010H
	JE	SHORT	L_169
;
; Line 339:	int vscrollbox = ComputeVScrollBox(wnd);
;
	PUSH	ESI
	CALL	_ComputeVScrollBox
	POP	ECX
	MOV	EBX,EAX
;
; Line 340:	if (vscrollbox != wnd->VScrollBox)
;
	CMP	EBX,DWORD [ESI+0C0H]
	JE	SHORT	L_171
;
; Line 341:	MoveScrollBox(wnd, vscrollbox);
;
	PUSH	EBX
	PUSH	ESI
	CALL	_MoveScrollBox
	ADD	ESP,BYTE 08H
L_171:
L_169:
L_152:
;
; Line 344:	return TRUE;
;
	MOV	EAX,01H
L_132:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 348:	static BOOL HorizScrollMsg(WINDOW wnd, PARAM p1)
;
_HorizScrollMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_174:
;
; Line 349:	{
;
;
; Line 351:	if (p1)    {
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JE	SHORT	L_175
;
; Line 353:	if (wnd->wleft + ClientWidth(wnd)-1 >= wnd->textwidth)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_179
	MOV	EAX,01H
	JMP	SHORT	L_180
L_179:
	MOV	EAX,00H
L_180:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+0A4H]
	DEC	ECX
	CMP	ECX,DWORD [ESI+0A8H]
	JL	SHORT	L_177
;
; Line 354:	return FALSE;
;
	MOV	EAX,00H
	JMP	SHORT	L_173
L_177:
;
; Line 355:	wnd->wleft++;
;
	INC	DWORD [ESI+0A4H]
	JMP	SHORT	L_176
L_175:
;
; Line 359:	if (wnd->wleft == 0)
;
	CMP	DWORD [ESI+0A4H],BYTE 00H
	JNE	SHORT	L_181
;
; Line 360:	return FALSE;
;
	MOV	EAX,00H
	JMP	SHORT	L_173
L_181:
;
; Line 361:	--wnd->wleft;
;
	DEC	DWORD [ESI+0A4H]
L_176:
;
; Line 363:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 364:	return TRUE;
;
	MOV	EAX,01H
L_173:
	POP	ESI
	POP	EBP
	RET
;
; Line 368:	static void ScrollPageMsg(WINDOW wnd, PARAM p1)
;
_ScrollPageMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_184:
;
; Line 369:	{
;
;
; Line 371:	if ((int) p1 == FALSE)    {
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JNE	NEAR	L_185
;
; Line 373:	if (wnd->wtop)
;
	CMP	DWORD [ESI+094H],BYTE 00H
	JE	NEAR	L_187
;
; Line 374:	wnd->wtop -= ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_189
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_189
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_189
	MOV	EAX,03H
	JMP	SHORT	L_190
L_189:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_194
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_193
L_194:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_191
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_191
L_193:
	MOV	EAX,02H
	JMP	SHORT	L_192
L_191:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_195
	MOV	EAX,01H
	JMP	SHORT	L_196
L_195:
	MOV	EAX,00H
L_196:
L_192:
L_190:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_197
	MOV	EAX,01H
	JMP	SHORT	L_198
L_197:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_199
	MOV	EAX,01H
	JMP	SHORT	L_200
L_199:
	MOV	EAX,00H
L_200:
L_198:
	SUB	ECX,EAX
	SUB	DWORD [ESI+094H],ECX
L_187:
	JMP	NEAR	L_186
L_185:
;
; Line 378:	if (wnd->wtop+ClientHeight(wnd) < wnd->wlines) {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_203
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_203
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_203
	MOV	EAX,03H
	JMP	SHORT	L_204
L_203:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_208
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_207
L_208:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_205
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_205
L_207:
	MOV	EAX,02H
	JMP	SHORT	L_206
L_205:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_209
	MOV	EAX,01H
	JMP	SHORT	L_210
L_209:
	MOV	EAX,00H
L_210:
L_206:
L_204:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_211
	MOV	EAX,01H
	JMP	SHORT	L_212
L_211:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_213
	MOV	EAX,01H
	JMP	SHORT	L_214
L_213:
	MOV	EAX,00H
L_214:
L_212:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	ECX,DWORD [ESI+090H]
	JGE	NEAR	L_201
;
; Line 379:	wnd->wtop += ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_215
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_215
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_215
	MOV	EAX,03H
	JMP	SHORT	L_216
L_215:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_220
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_219
L_220:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_217
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_217
L_219:
	MOV	EAX,02H
	JMP	SHORT	L_218
L_217:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_221
	MOV	EAX,01H
	JMP	SHORT	L_222
L_221:
	MOV	EAX,00H
L_222:
L_218:
L_216:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_223
	MOV	EAX,01H
	JMP	SHORT	L_224
L_223:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_225
	MOV	EAX,01H
	JMP	SHORT	L_226
L_225:
	MOV	EAX,00H
L_226:
L_224:
	SUB	ECX,EAX
	ADD	DWORD [ESI+094H],ECX
;
; Line 380:	if (wnd->wtop>wnd->wlines-ClientHeight(wnd))
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_229
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_229
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_229
	MOV	EAX,03H
	JMP	SHORT	L_230
L_229:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_234
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_233
L_234:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_231
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_231
L_233:
	MOV	EAX,02H
	JMP	SHORT	L_232
L_231:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_235
	MOV	EAX,01H
	JMP	SHORT	L_236
L_235:
	MOV	EAX,00H
L_236:
L_232:
L_230:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_237
	MOV	EAX,01H
	JMP	SHORT	L_238
L_237:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_239
	MOV	EAX,01H
	JMP	SHORT	L_240
L_239:
	MOV	EAX,00H
L_240:
L_238:
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+090H]
	SUB	EAX,ECX
	CMP	DWORD [ESI+094H],EAX
	JLE	NEAR	L_227
;
; Line 381:	wnd->wtop=wnd->wlines-ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_241
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_241
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_241
	MOV	EAX,03H
	JMP	SHORT	L_242
L_241:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_246
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_245
L_246:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_243
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_243
L_245:
	MOV	EAX,02H
	JMP	SHORT	L_244
L_243:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_247
	MOV	EAX,01H
	JMP	SHORT	L_248
L_247:
	MOV	EAX,00H
L_248:
L_244:
L_242:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_249
	MOV	EAX,01H
	JMP	SHORT	L_250
L_249:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_251
	MOV	EAX,01H
	JMP	SHORT	L_252
L_251:
	MOV	EAX,00H
L_252:
L_250:
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+090H]
	SUB	EAX,ECX
	MOV	DWORD [ESI+094H],EAX
L_227:
L_201:
L_186:
;
; Line 384:	if (wnd->wtop < 0)
;
	CMP	DWORD [ESI+094H],BYTE 00H
	JGE	SHORT	L_253
;
; Line 385:	wnd->wtop = 0;
;
	MOV	DWORD [ESI+094H],00H
L_253:
;
; Line 386:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 387:	}
;
L_183:
	POP	ESI
	POP	EBP
	RET
;
; Line 390:	static void HorizScrollPageMsg(WINDOW wnd, PARAM p1)
;
_HorizScrollPageMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_256:
;
; Line 391:	{
;
;
; Line 393:	if ((int) p1 == FALSE)
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JNE	SHORT	L_257
;
; Line 395:	wnd->wleft -= ClientWidth(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_259
	MOV	EAX,01H
	JMP	SHORT	L_260
L_259:
	MOV	EAX,00H
L_260:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	SUB	DWORD [ESI+0A4H],ECX
	JMP	SHORT	L_258
L_257:
;
; Line 398:	wnd->wleft += ClientWidth(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_261
	MOV	EAX,01H
	JMP	SHORT	L_262
L_261:
	MOV	EAX,00H
L_262:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	ADD	DWORD [ESI+0A4H],ECX
;
; Line 399:	if (wnd->wleft > wnd->textwidth-ClientWidth(wnd))
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_265
	MOV	EAX,01H
	JMP	SHORT	L_266
L_265:
	MOV	EAX,00H
L_266:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+0A8H]
	SUB	EAX,ECX
	CMP	DWORD [ESI+0A4H],EAX
	JLE	SHORT	L_263
;
; Line 400:	wnd->wleft = wnd->textwidth-ClientWidth(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_267
	MOV	EAX,01H
	JMP	SHORT	L_268
L_267:
	MOV	EAX,00H
L_268:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+0A8H]
	SUB	EAX,ECX
	MOV	DWORD [ESI+0A4H],EAX
L_263:
L_258:
;
; Line 402:	if (wnd->wleft < 0)
;
	CMP	DWORD [ESI+0A4H],BYTE 00H
	JGE	SHORT	L_269
;
; Line 403:	wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
L_269:
;
; Line 404:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 405:	}
;
L_255:
	POP	ESI
	POP	EBP
	RET
;
; Line 408:	static void ScrollDocMsg(WINDOW wnd, PARAM p1)
;
_ScrollDocMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_272:
;
; Line 409:	{
;
;
; Line 411:	if ((int) p1)
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JE	SHORT	L_273
;
; Line 412:	wnd->wtop = wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
	MOV	DWORD [ESI+094H],00H
	JMP	NEAR	L_274
L_273:
;
; Line 413:	else if (wnd->wtop+ClientHeight(wnd) < wnd->wlines){
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_277
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_277
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_277
	MOV	EAX,03H
	JMP	SHORT	L_278
L_277:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_282
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_281
L_282:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_279
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_279
L_281:
	MOV	EAX,02H
	JMP	SHORT	L_280
L_279:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_283
	MOV	EAX,01H
	JMP	SHORT	L_284
L_283:
	MOV	EAX,00H
L_284:
L_280:
L_278:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_285
	MOV	EAX,01H
	JMP	SHORT	L_286
L_285:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_287
	MOV	EAX,01H
	JMP	SHORT	L_288
L_287:
	MOV	EAX,00H
L_288:
L_286:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	ECX,DWORD [ESI+090H]
	JGE	NEAR	L_275
;
; Line 414:	wnd->wtop = wnd->wlines-ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_289
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_289
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_289
	MOV	EAX,03H
	JMP	SHORT	L_290
L_289:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_294
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_293
L_294:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_291
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_291
L_293:
	MOV	EAX,02H
	JMP	SHORT	L_292
L_291:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_295
	MOV	EAX,01H
	JMP	SHORT	L_296
L_295:
	MOV	EAX,00H
L_296:
L_292:
L_290:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_297
	MOV	EAX,01H
	JMP	SHORT	L_298
L_297:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_299
	MOV	EAX,01H
	JMP	SHORT	L_300
L_299:
	MOV	EAX,00H
L_300:
L_298:
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+090H]
	SUB	EAX,ECX
	MOV	DWORD [ESI+094H],EAX
;
; Line 415:	wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
L_275:
L_274:
;
; Line 417:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 418:	}
;
L_271:
	POP	ESI
	POP	EBP
	RET
;
; Line 421:	static void PaintMsg(WINDOW wnd, PARAM p1, PARAM p2)
;
_PaintMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,0F4H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_302:
;
; Line 422:	{
;
;
; Line 429:	if ((RECT *)p1 == NULL)
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JNE	SHORT	L_303
;
; Line 430:	rc=RelativeWindowRect(wnd, WindowRect(wnd));
;
	PUSH	DWORD [ESI+0CH+0CH]
	PUSH	DWORD [ESI+0CH+08H]
	PUSH	DWORD [ESI+0CH+04H]
	PUSH	DWORD [ESI+0CH+00H]
	PUSH	ESI
	LEA	EAX,[EBP-0ECH]
	PUSH	EAX
	CALL	_RelativeWindowRect
	ADD	ESP,BYTE 018H
	JMP	SHORT	L_304
L_303:
;
; Line 432:	rc= *(RECT *)p1;
;
	MOV	EAX,DWORD [EBP+0CH]
	PUSH	ESI
	PUSH	EDI
	LEA	ESI,[EAX+00H]
	LEA	EDI,[EBP-0ECH]
	PUSH	SS
	POP	ES
	CLD
	MOV	ECX,04H
	REP	MOVSD
	POP	EDI
	POP	ESI
L_304:
;
; Line 433:	if (TestAttribute(wnd, HASBORDER) &&
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_305
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	CMP	DWORD [EBP-0E4H],EAX
	JL	SHORT	L_305
;
; Line 435:	if (RectLeft(rc) >= WindowWidth(wnd)-1)
;
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	CMP	DWORD [EBP-0ECH],EAX
	JNL	NEAR	L_301
;
; Line 436:	return;
;
L_307:
;
; Line 437:	RectRight(rc) = WindowWidth(wnd)-2;
;
	MOV	EAX,DWORD [ESI+020H]
	SUB	EAX,BYTE 02H
	MOV	DWORD [EBP-0E4H],EAX
L_305:
;
; Line 439:	rcc = AdjustRectangle(wnd, rc);
;
	PUSH	DWORD [EBP-0ECH+0CH]
	PUSH	DWORD [EBP-0ECH+08H]
	PUSH	DWORD [EBP-0ECH+04H]
	PUSH	DWORD [EBP-0ECH+00H]
	PUSH	ESI
	LEA	EAX,[EBP-0DCH]
	PUSH	EAX
	CALL	_AdjustRectangle
	ADD	ESP,BYTE 018H
;
; Line 441:	if (!p2 && wnd != inFocus)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JNE	SHORT	L_309
	CMP	ESI,DWORD [_inFocus]
	JE	SHORT	L_309
;
; Line 442:	ClipString++;
;
	INC	DWORD [_ClipString]
L_309:
;
; Line 445:	memset(blankline, ' ', SCREENWIDTH);
;
	MOV	EAX,04AH
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	BYTE 020H
	LEA	EAX,[EBP-0CCH]
	PUSH	EAX
	CALL	_memset
	ADD	ESP,BYTE 0CH
;
; Line 446:	blankline[RectRight(rcc)+1] = '\0';
;
	MOV	EAX,DWORD [EBP-0D4H]
	MOV	BYTE [EBP+EAX-0CBH],00H
	MOV	EBX,DWORD [EBP-0E8H]
	JMP	NEAR	L_313
L_311:
;
; Line 453:	if (TestAttribute(wnd,                     HASBORDER | HASTITLEBAR))    {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04100H
	JE	NEAR	L_315
;
; Line 454:	if (y < TopBorderAdj(wnd))
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_319
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_319
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_319
	MOV	EAX,03H
	JMP	SHORT	L_320
L_319:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_324
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_323
L_324:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_321
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_321
L_323:
	MOV	EAX,02H
	JMP	SHORT	L_322
L_321:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_325
	MOV	EAX,01H
	JMP	SHORT	L_326
L_325:
	MOV	EAX,00H
L_326:
L_322:
L_320:
	CMP	EBX,EAX
	JNGE	NEAR	L_312
;
; Line 455:	continue;
;
L_317:
;
; Line 456:	if (y > WindowHeight(wnd)-2)
;
	MOV	EAX,DWORD [ESI+01CH]
	SUB	EAX,BYTE 02H
	CMP	EBX,EAX
	JNLE	NEAR	L_312
;
; Line 457:	continue;
;
L_327:
L_315:
;
; Line 459:	yy = y-TopBorderAdj(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_329
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_329
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_329
	MOV	EAX,03H
	JMP	SHORT	L_330
L_329:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_334
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_333
L_334:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_331
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_331
L_333:
	MOV	EAX,02H
	JMP	SHORT	L_332
L_331:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_335
	MOV	EAX,01H
	JMP	SHORT	L_336
L_335:
	MOV	EAX,00H
L_336:
L_332:
L_330:
	MOV	ECX,EBX
	SUB	ECX,EAX
	MOV	DWORD [EBP-0F4H],ECX
;
; Line 460:	if (yy < wnd->wlines - wnd->wtop)
;
	MOV	EAX,DWORD [ESI+090H]
	SUB	EAX,DWORD [ESI+094H]
	CMP	DWORD [EBP-0F4H],EAX
	JGE	SHORT	L_337
;
; Line 462:	WriteTextLine(wnd, &rc,
;
	PUSH	BYTE 00H
	MOV	EAX,DWORD [EBP-0F4H]
	ADD	EAX,DWORD [ESI+094H]
	PUSH	EAX
	LEA	EAX,[EBP-0ECH]
	PUSH	EAX
	PUSH	ESI
	CALL	_WriteTextLine
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_338
L_337:
;
; Line 466:	SetStandardColor(wnd);
;
	PUSH	ESI
	CALL	_SetStandardColor
	POP	ECX
;
; Line 467:	writeline(wnd, blankline+RectLeft(rcc),
;
	PUSH	BYTE 00H
	PUSH	EBX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_339
	MOV	EAX,01H
	JMP	SHORT	L_340
L_339:
	MOV	EAX,00H
L_340:
	ADD	EAX,DWORD [EBP-0DCH]
	PUSH	EAX
	LEA	EAX,[EBP-0CCH]
	ADD	EAX,DWORD [EBP-0DCH]
	PUSH	EAX
	PUSH	ESI
	CALL	_writeline
	ADD	ESP,BYTE 014H
L_338:
;
; Line 449:	for (y = RectTop(rc); y <= RectBottom(rc); y++){
;
L_312:
	INC	EBX
L_313:
	CMP	EBX,DWORD [EBP-0E0H]
	JLE	NEAR	L_311
L_314:
;
; Line 472:	if (TestAttribute(wnd, VSCROLLBAR|HSCROLLBAR)) {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 030H
	JE	SHORT	L_341
;
; Line 473:	int hscrollbox = ComputeHScrollBox(wnd);
;
	PUSH	ESI
	CALL	_ComputeHScrollBox
	POP	ECX
	MOV	DWORD [EBP-0F4H],EAX
;
; Line 474:	int vscrollbox = ComputeVScrollBox(wnd);
;
	PUSH	ESI
	CALL	_ComputeVScrollBox
	POP	ECX
	MOV	EDI,EAX
;
; Line 475:	if (hscrollbox != wnd->HScrollBox ||
;
	MOV	EAX,DWORD [EBP-0F4H]
	CMP	EAX,DWORD [ESI+0BCH]
	JNE	SHORT	L_345
	CMP	EDI,DWORD [ESI+0C0H]
	JE	SHORT	L_343
L_345:
;
; Line 477:	wnd->HScrollBox = hscrollbox;
;
	MOV	EAX,DWORD [EBP-0F4H]
	MOV	DWORD [ESI+0BCH],EAX
;
; Line 478:	wnd->VScrollBox = vscrollbox;
;
	MOV	DWORD [ESI+0C0H],EDI
;
; Line 479:	SendMessage(wnd, BORDER, p1, 0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	BYTE 0AH
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_343:
L_341:
;
; Line 482:	if (!p2 && wnd != inFocus)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JNE	SHORT	L_346
	CMP	ESI,DWORD [_inFocus]
	JE	SHORT	L_346
;
; Line 483:	--ClipString;
;
	DEC	DWORD [_ClipString]
L_346:
;
; Line 484:	}
;
L_301:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 487:	static void CloseWindowMsg(WINDOW wnd)
;
_CloseWindowMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_349:
;
; Line 488:	{
;
;
; Line 489:	SendMessage(wnd, CLEARTEXT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 033H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 490:	if (wnd->TextPointers != NULL)    {
;
	CMP	DWORD [ESI+0C4H],BYTE 00H
	JE	SHORT	L_350
;
; Line 491:	free(wnd->TextPointers);
;
	PUSH	DWORD [ESI+0C4H]
	CALL	_free
	POP	ECX
;
; Line 492:	wnd->TextPointers = NULL;
;
	MOV	DWORD [ESI+0C4H],00H
L_350:
;
; Line 494:	}
;
L_348:
	POP	ESI
	POP	EBP
	RET
[GLOBAL	_TextBoxProc]
;
; Line 497:	int TextBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_TextBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+08H]
	MOV	ESI,DWORD [EBP+010H]
	MOV	EDI,DWORD [EBP+014H]
L_353:
;
; Line 498:	{
;
;
; Line 499:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 031H
	JE	NEAR	L_359
	JA	SHORT	L_373
	CMP	EAX,BYTE 024H
	JE	NEAR	L_363
	JA	SHORT	L_374
	CMP	EAX,BYTE 09H
	JE	NEAR	L_371
	JA	SHORT	L_375
	CMP	EAX,BYTE 07H
	JE	NEAR	L_372
	JA	NEAR	L_355
	CMP	EAX,BYTE 03H
	JE	NEAR	L_356
	JMP	NEAR	L_355
L_375:
	CMP	EAX,BYTE 015H
	JE	NEAR	L_362
	JMP	NEAR	L_355
L_374:
	CMP	EAX,BYTE 027H
	JE	NEAR	L_365
	JA	SHORT	L_376
	CMP	EAX,BYTE 026H
	JE	NEAR	L_364
	JMP	NEAR	L_355
L_376:
	CMP	EAX,BYTE 030H
	JE	NEAR	L_357
	JMP	NEAR	L_355
L_373:
	CMP	EAX,BYTE 036H
	JE	NEAR	L_367
	JA	SHORT	L_377
	CMP	EAX,BYTE 034H
	JE	NEAR	L_360
	JA	SHORT	L_378
	CMP	EAX,BYTE 033H
	JE	NEAR	L_361
	JA	NEAR	L_355
	CMP	EAX,BYTE 032H
	JE	SHORT	L_358
	JMP	NEAR	L_355
L_378:
	CMP	EAX,BYTE 035H
	JE	NEAR	L_366
	JMP	NEAR	L_355
L_377:
	CMP	EAX,BYTE 038H
	JE	NEAR	L_369
	JA	SHORT	L_379
	CMP	EAX,BYTE 037H
	JE	NEAR	L_368
	JMP	NEAR	L_355
L_379:
	CMP	EAX,BYTE 039H
	JE	NEAR	L_370
	JMP	NEAR	L_355
L_356:
;
; Line 501:	wnd->HScrollBox = wnd->VScrollBox = 1;
;
	MOV	DWORD [EBX+0C0H],01H
	MOV	DWORD [EBX+0BCH],01H
;
; Line 502:	ClearTextPointers(wnd);
;
	PUSH	EBX
	CALL	_ClearTextPointers
	POP	ECX
;
; Line 503:	break;
;
	JMP	NEAR	L_354
L_357:
;
; Line 505:	return AddTextMsg(wnd, (char *) p1, p2);
;
	MOV	EAX,EDI
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	ESI
	PUSH	EBX
	CALL	_AddTextMsg
	ADD	ESP,BYTE 0CH
	JMP	NEAR	L_352
L_358:
;
; Line 507:	DeleteTextMsg(wnd, (int) p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_DeleteTextMsg
	ADD	ESP,BYTE 08H
;
; Line 508:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_359:
;
; Line 510:	InsertTextMsg(wnd, (char *) p1, (int) p2);
;
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	CALL	_InsertTextMsg
	ADD	ESP,BYTE 0CH
;
; Line 511:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_360:
;
; Line 513:	SetTextMsg(wnd, (char *) p1, p2);
;
	MOV	EAX,EDI
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	ESI
	PUSH	EBX
	CALL	_SetTextMsg
	ADD	ESP,BYTE 0CH
;
; Line 514:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_361:
;
; Line 516:	ClearTextMsg(wnd);
;
	PUSH	EBX
	CALL	_ClearTextMsg
	POP	ECX
;
; Line 517:	break;
;
	JMP	NEAR	L_354
L_362:
;
; Line 519:	if (WindowMoving || WindowSizing)
;
	CMP	DWORD [_WindowMoving],BYTE 00H
	JNE	SHORT	L_382
	CMP	DWORD [_WindowSizing],BYTE 00H
	JE	SHORT	L_380
L_382:
;
; Line 520:	break;
;
	JMP	NEAR	L_354
L_380:
;
; Line 521:	if (KeyboardMsg(wnd, p1))
;
	PUSH	ESI
	PUSH	EBX
	CALL	_KeyboardMsg
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JE	SHORT	L_383
;
; Line 522:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_383:
;
; Line 523:	break;
;
	JMP	NEAR	L_354
L_363:
;
; Line 525:	if (WindowSizing || WindowMoving)
;
	CMP	DWORD [_WindowSizing],BYTE 00H
	JNE	SHORT	L_387
	CMP	DWORD [_WindowMoving],BYTE 00H
	JE	SHORT	L_385
L_387:
;
; Line 526:	return FALSE;
;
	MOV	EAX,00H
	JMP	NEAR	L_352
L_385:
;
; Line 527:	if (LeftButtonMsg(wnd, p1, p2))
;
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	CALL	_LeftButtonMsg
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JE	SHORT	L_388
;
; Line 528:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_388:
;
; Line 529:	break;
;
	JMP	NEAR	L_354
L_364:
;
; Line 531:	if (MouseMovedMsg(wnd, p1, p2))
;
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	CALL	_MouseMovedMsg
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JE	SHORT	L_390
;
; Line 532:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_352
L_390:
;
; Line 533:	break;
;
	JMP	NEAR	L_354
L_365:
;
; Line 535:	ButtonReleasedMsg(wnd);
;
	PUSH	EBX
	CALL	_ButtonReleasedMsg
	POP	ECX
;
; Line 536:	break;
;
	JMP	SHORT	L_354
L_366:
;
; Line 538:	return ScrollMsg(wnd, p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_ScrollMsg
	ADD	ESP,BYTE 08H
	JMP	NEAR	L_352
L_367:
;
; Line 540:	return HorizScrollMsg(wnd, p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_HorizScrollMsg
	ADD	ESP,BYTE 08H
	JMP	SHORT	L_352
L_368:
;
; Line 542:	ScrollPageMsg(wnd, p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_ScrollPageMsg
	ADD	ESP,BYTE 08H
;
; Line 543:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_352
L_369:
;
; Line 545:	HorizScrollPageMsg(wnd, p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_HorizScrollPageMsg
	ADD	ESP,BYTE 08H
;
; Line 546:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_352
L_370:
;
; Line 548:	ScrollDocMsg(wnd, p1);
;
	PUSH	ESI
	PUSH	EBX
	CALL	_ScrollDocMsg
	ADD	ESP,BYTE 08H
;
; Line 549:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_352
L_371:
;
; Line 551:	if (isVisible(wnd))    {
;
	PUSH	EBX
	CALL	_isVisible
	POP	ECX
	TEST	EAX,EAX
	JE	SHORT	L_392
;
; Line 552:	PaintMsg(wnd, p1, p2);
;
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	CALL	_PaintMsg
	ADD	ESP,BYTE 0CH
;
; Line 553:	return FALSE;
;
	MOV	EAX,00H
	JMP	SHORT	L_352
L_392:
;
; Line 555:	break;
;
	JMP	SHORT	L_354
L_372:
;
; Line 557:	CloseWindowMsg(wnd);
;
	PUSH	EBX
	CALL	_CloseWindowMsg
	POP	ECX
;
; Line 558:	break;
;
	JMP	SHORT	L_354
L_355:
;
; Line 560:	break;
;
	JMP	SHORT	L_354
L_354:
;
; Line 562:	return BaseWndProc(TEXTBOX, wnd, msg, p1, p2);
;
	PUSH	EDI
	PUSH	ESI
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	EBX
	MOV	EAX,DWORD [_classdefs+018H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_352:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 567:	static int ComputeVScrollBox(WINDOW wnd)
;
_ComputeVScrollBox:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 0CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_395:
;
; Line 568:	{
;
;
; Line 569:	int pagelen = wnd->wlines - ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_396
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_396
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_396
	MOV	EAX,03H
	JMP	SHORT	L_397
L_396:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_401
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_400
L_401:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_398
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_398
L_400:
	MOV	EAX,02H
	JMP	SHORT	L_399
L_398:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_402
	MOV	EAX,01H
	JMP	SHORT	L_403
L_402:
	MOV	EAX,00H
L_403:
L_399:
L_397:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_404
	MOV	EAX,01H
	JMP	SHORT	L_405
L_404:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_406
	MOV	EAX,01H
	JMP	SHORT	L_407
L_406:
	MOV	EAX,00H
L_407:
L_405:
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+090H]
	SUB	EAX,ECX
	MOV	DWORD [EBP-08H],EAX
;
; Line 570:	int barlen = ClientHeight(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_408
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_408
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_408
	MOV	EAX,03H
	JMP	SHORT	L_409
L_408:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_413
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_412
L_413:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_410
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_410
L_412:
	MOV	EAX,02H
	JMP	SHORT	L_411
L_410:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_414
	MOV	EAX,01H
	JMP	SHORT	L_415
L_414:
	MOV	EAX,00H
L_415:
L_411:
L_409:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_416
	MOV	EAX,01H
	JMP	SHORT	L_417
L_416:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_418
	MOV	EAX,01H
	JMP	SHORT	L_419
L_418:
	MOV	EAX,00H
L_419:
L_417:
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	MOV	DWORD [EBP-04H],ECX
;
; Line 574:	if (pagelen < 1 || barlen < 1)
;
	CMP	DWORD [EBP-08H],BYTE 01H
	JL	SHORT	L_422
	CMP	DWORD [EBP-04H],BYTE 01H
	JGE	SHORT	L_420
L_422:
;
; Line 575:	vscrollbox = 1;
;
	MOV	EBX,01H
	JMP	NEAR	L_421
L_420:
;
; Line 577:	if (pagelen > barlen)
;
	MOV	EAX,DWORD [EBP-08H]
	CMP	EAX,DWORD [EBP-04H]
	JLE	SHORT	L_423
;
; Line 578:	lines_tick = pagelen / barlen;
;
	MOV	EAX,DWORD [EBP-08H]
	CDQ
	IDIV	DWORD [EBP-04H]
	MOV	EDI,EAX
	JMP	SHORT	L_424
L_423:
;
; Line 580:	lines_tick = barlen / pagelen;
;
	MOV	EAX,DWORD [EBP-04H]
	CDQ
	IDIV	DWORD [EBP-08H]
	MOV	EDI,EAX
L_424:
;
; Line 581:	vscrollbox = 1 + (wnd->wtop / lines_tick);
;
	MOV	EAX,DWORD [ESI+094H]
	CDQ
	IDIV	EDI
	INC	EAX
	MOV	EBX,EAX
;
; Line 582:	if (vscrollbox > ClientHeight(wnd)-2 ||
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_428
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_428
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_428
	MOV	EAX,03H
	JMP	SHORT	L_429
L_428:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_433
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_432
L_433:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_430
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_430
L_432:
	MOV	EAX,02H
	JMP	SHORT	L_431
L_430:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_434
	MOV	EAX,01H
	JMP	SHORT	L_435
L_434:
	MOV	EAX,00H
L_435:
L_431:
L_429:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_436
	MOV	EAX,01H
	JMP	SHORT	L_437
L_436:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_438
	MOV	EAX,01H
	JMP	SHORT	L_439
L_438:
	MOV	EAX,00H
L_439:
L_437:
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	CMP	EBX,ECX
	JG	NEAR	L_427
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_440
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_440
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_440
	MOV	EAX,03H
	JMP	SHORT	L_441
L_440:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_445
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_444
L_445:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_442
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_442
L_444:
	MOV	EAX,02H
	JMP	SHORT	L_443
L_442:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_446
	MOV	EAX,01H
	JMP	SHORT	L_447
L_446:
	MOV	EAX,00H
L_447:
L_443:
L_441:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_448
	MOV	EAX,01H
	JMP	SHORT	L_449
L_448:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_450
	MOV	EAX,01H
	JMP	SHORT	L_451
L_450:
	MOV	EAX,00H
L_451:
L_449:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	ECX,DWORD [ESI+090H]
	JL	NEAR	L_425
L_427:
;
; Line 584:	vscrollbox = ClientHeight(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_452
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_452
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_452
	MOV	EAX,03H
	JMP	SHORT	L_453
L_452:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_457
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_456
L_457:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_454
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_454
L_456:
	MOV	EAX,02H
	JMP	SHORT	L_455
L_454:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_458
	MOV	EAX,01H
	JMP	SHORT	L_459
L_458:
	MOV	EAX,00H
L_459:
L_455:
L_453:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_460
	MOV	EAX,01H
	JMP	SHORT	L_461
L_460:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_462
	MOV	EAX,01H
	JMP	SHORT	L_463
L_462:
	MOV	EAX,00H
L_463:
L_461:
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	MOV	EBX,ECX
L_425:
L_421:
;
; Line 586:	return vscrollbox;
;
	MOV	EAX,EBX
L_394:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 590:	static void ComputeWindowTop(WINDOW wnd)
;
_ComputeWindowTop:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 04H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_465:
;
; Line 591:	{
;
;
; Line 592:	int pagelen = wnd->wlines - ClientHeight(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_466
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_466
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_466
	MOV	EAX,03H
	JMP	SHORT	L_467
L_466:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_471
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_470
L_471:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_468
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_468
L_470:
	MOV	EAX,02H
	JMP	SHORT	L_469
L_468:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_472
	MOV	EAX,01H
	JMP	SHORT	L_473
L_472:
	MOV	EAX,00H
L_473:
L_469:
L_467:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_474
	MOV	EAX,01H
	JMP	SHORT	L_475
L_474:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_476
	MOV	EAX,01H
	JMP	SHORT	L_477
L_476:
	MOV	EAX,00H
L_477:
L_475:
	SUB	ECX,EAX
	MOV	EBX,DWORD [ESI+090H]
	SUB	EBX,ECX
;
; Line 593:	if (wnd->VScrollBox == 0)
;
	CMP	DWORD [ESI+0C0H],BYTE 00H
	JNE	SHORT	L_478
;
; Line 594:	wnd->wtop = 0;
;
	MOV	DWORD [ESI+094H],00H
	JMP	NEAR	L_479
L_478:
;
; Line 595:	else if (wnd->VScrollBox == ClientHeight(wnd)-2)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_482
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_482
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_482
	MOV	EAX,03H
	JMP	SHORT	L_483
L_482:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_487
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_486
L_487:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_484
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_484
L_486:
	MOV	EAX,02H
	JMP	SHORT	L_485
L_484:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_488
	MOV	EAX,01H
	JMP	SHORT	L_489
L_488:
	MOV	EAX,00H
L_489:
L_485:
L_483:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_490
	MOV	EAX,01H
	JMP	SHORT	L_491
L_490:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_492
	MOV	EAX,01H
	JMP	SHORT	L_493
L_492:
	MOV	EAX,00H
L_493:
L_491:
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	CMP	DWORD [ESI+0C0H],ECX
	JNE	SHORT	L_480
;
; Line 596:	wnd->wtop = pagelen;
;
	MOV	DWORD [ESI+094H],EBX
	JMP	NEAR	L_481
L_480:
;
; Line 598:	int barlen = ClientHeight(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_494
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_494
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_494
	MOV	EAX,03H
	JMP	SHORT	L_495
L_494:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_499
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_498
L_499:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_496
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_496
L_498:
	MOV	EAX,02H
	JMP	SHORT	L_497
L_496:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_500
	MOV	EAX,01H
	JMP	SHORT	L_501
L_500:
	MOV	EAX,00H
L_501:
L_497:
L_495:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_502
	MOV	EAX,01H
	JMP	SHORT	L_503
L_502:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_504
	MOV	EAX,01H
	JMP	SHORT	L_505
L_504:
	MOV	EAX,00H
L_505:
L_503:
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	MOV	DWORD [EBP-04H],ECX
;
; Line 601:	if (pagelen > barlen)
;
	CMP	EBX,DWORD [EBP-04H]
	JLE	SHORT	L_506
;
; Line 602:	lines_tick = barlen ? (pagelen / barlen) : 0;
;
	CMP	DWORD [EBP-04H],BYTE 00H
	JE	SHORT	L_508
	MOV	EAX,EBX
	CDQ
	IDIV	DWORD [EBP-04H]
	JMP	SHORT	L_509
L_508:
	MOV	EAX,00H
L_509:
	MOV	EDI,EAX
	JMP	SHORT	L_507
L_506:
;
; Line 604:	lines_tick = pagelen ? (barlen / pagelen) : 0;
;
	TEST	EBX,EBX
	JE	SHORT	L_510
	MOV	EAX,DWORD [EBP-04H]
	CDQ
	IDIV	EBX
	JMP	SHORT	L_511
L_510:
	MOV	EAX,00H
L_511:
	MOV	EDI,EAX
L_507:
;
; Line 605:	wnd->wtop = (wnd->VScrollBox-1) * lines_tick;
;
	MOV	EAX,DWORD [ESI+0C0H]
	DEC	EAX
	IMUL	EAX,EDI
	MOV	DWORD [ESI+094H],EAX
;
; Line 606:	if (wnd->wtop + ClientHeight(wnd) > wnd->wlines)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_514
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_514
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_514
	MOV	EAX,03H
	JMP	SHORT	L_515
L_514:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_519
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_518
L_519:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_516
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_516
L_518:
	MOV	EAX,02H
	JMP	SHORT	L_517
L_516:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_520
	MOV	EAX,01H
	JMP	SHORT	L_521
L_520:
	MOV	EAX,00H
L_521:
L_517:
L_515:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_522
	MOV	EAX,01H
	JMP	SHORT	L_523
L_522:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_524
	MOV	EAX,01H
	JMP	SHORT	L_525
L_524:
	MOV	EAX,00H
L_525:
L_523:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	ECX,DWORD [ESI+090H]
	JLE	SHORT	L_512
;
; Line 607:	wnd->wtop = pagelen;
;
	MOV	DWORD [ESI+094H],EBX
L_512:
L_481:
L_479:
;
; Line 609:	if (wnd->wtop < 0)
;
	CMP	DWORD [ESI+094H],BYTE 00H
	JGE	SHORT	L_526
;
; Line 610:	wnd->wtop = 0;
;
	MOV	DWORD [ESI+094H],00H
L_526:
;
; Line 611:	}
;
L_464:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 615:	static int ComputeHScrollBox(WINDOW wnd)
;
_ComputeHScrollBox:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 0CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_529:
;
; Line 616:	{
;
;
; Line 617:	int pagewidth = wnd->textwidth - ClientWidth(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_530
	MOV	EAX,01H
	JMP	SHORT	L_531
L_530:
	MOV	EAX,00H
L_531:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+0A8H]
	SUB	EAX,ECX
	MOV	DWORD [EBP-08H],EAX
;
; Line 618:	int barlen = ClientWidth(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_532
	MOV	EAX,01H
	JMP	SHORT	L_533
L_532:
	MOV	EAX,00H
L_533:
	SHL	EAX,01H
	MOV	EBX,DWORD [ESI+020H]
	SUB	EBX,EAX
	SUB	EBX,BYTE 02H
;
; Line 622:	if (pagewidth < 1 || barlen < 1)
;
	CMP	DWORD [EBP-08H],BYTE 01H
	JL	SHORT	L_536
	CMP	EBX,BYTE 01H
	JGE	SHORT	L_534
L_536:
;
; Line 623:	hscrollbox = 1;
;
	MOV	DWORD [EBP-04H],01H
	JMP	NEAR	L_535
L_534:
;
; Line 625:	if (pagewidth > barlen)
;
	CMP	DWORD [EBP-08H],EBX
	JLE	SHORT	L_537
;
; Line 626:	chars_tick = barlen ? (pagewidth / barlen) : 0;
;
	TEST	EBX,EBX
	JE	SHORT	L_539
	MOV	EAX,DWORD [EBP-08H]
	CDQ
	IDIV	EBX
	JMP	SHORT	L_540
L_539:
	MOV	EAX,00H
L_540:
	MOV	EDI,EAX
	JMP	SHORT	L_538
L_537:
;
; Line 628:	chars_tick = pagewidth ? (barlen / pagewidth) : 0;
;
	CMP	DWORD [EBP-08H],BYTE 00H
	JE	SHORT	L_541
	MOV	EAX,EBX
	CDQ
	IDIV	DWORD [EBP-08H]
	JMP	SHORT	L_542
L_541:
	MOV	EAX,00H
L_542:
	MOV	EDI,EAX
L_538:
;
; Line 629:	hscrollbox = 1 + (chars_tick ? (wnd->wleft / chars_tick) : 0);
;
	TEST	EDI,EDI
	JE	SHORT	L_543
	MOV	EAX,DWORD [ESI+0A4H]
	CDQ
	IDIV	EDI
	JMP	SHORT	L_544
L_543:
	MOV	EAX,00H
L_544:
	INC	EAX
	MOV	DWORD [EBP-04H],EAX
;
; Line 630:	if (hscrollbox > ClientWidth(wnd)-2 ||
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_548
	MOV	EAX,01H
	JMP	SHORT	L_549
L_548:
	MOV	EAX,00H
L_549:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	CMP	DWORD [EBP-04H],ECX
	JG	SHORT	L_547
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_550
	MOV	EAX,01H
	JMP	SHORT	L_551
L_550:
	MOV	EAX,00H
L_551:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+0A4H]
	CMP	ECX,DWORD [ESI+0A8H]
	JL	SHORT	L_545
L_547:
;
; Line 632:	hscrollbox = ClientWidth(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_552
	MOV	EAX,01H
	JMP	SHORT	L_553
L_552:
	MOV	EAX,00H
L_553:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	MOV	DWORD [EBP-04H],ECX
L_545:
L_535:
;
; Line 634:	return hscrollbox;
;
	MOV	EAX,DWORD [EBP-04H]
L_528:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 638:	static void ComputeWindowLeft(WINDOW wnd)
;
_ComputeWindowLeft:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 04H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_555:
;
; Line 639:	{
;
;
; Line 640:	int pagewidth = wnd->textwidth - ClientWidth(wnd);
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_556
	MOV	EAX,01H
	JMP	SHORT	L_557
L_556:
	MOV	EAX,00H
L_557:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	MOV	EBX,DWORD [ESI+0A8H]
	SUB	EBX,ECX
;
; Line 642:	if (wnd->HScrollBox == 0)
;
	CMP	DWORD [ESI+0BCH],BYTE 00H
	JNE	SHORT	L_558
;
; Line 643:	wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
	JMP	NEAR	L_559
L_558:
;
; Line 644:	else if (wnd->HScrollBox == ClientWidth(wnd)-2)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_562
	MOV	EAX,01H
	JMP	SHORT	L_563
L_562:
	MOV	EAX,00H
L_563:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	CMP	DWORD [ESI+0BCH],ECX
	JNE	SHORT	L_560
;
; Line 645:	wnd->wleft = pagewidth;
;
	MOV	DWORD [ESI+0A4H],EBX
	JMP	SHORT	L_561
L_560:
;
; Line 647:	int barlen = ClientWidth(wnd)-2;
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_564
	MOV	EAX,01H
	JMP	SHORT	L_565
L_564:
	MOV	EAX,00H
L_565:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	SUB	ECX,BYTE 02H
	MOV	DWORD [EBP-04H],ECX
;
; Line 650:	if (pagewidth > barlen)
;
	CMP	EBX,DWORD [EBP-04H]
	JLE	SHORT	L_566
;
; Line 651:	chars_tick = pagewidth / barlen;
;
	MOV	EAX,EBX
	CDQ
	IDIV	DWORD [EBP-04H]
	MOV	EDI,EAX
	JMP	SHORT	L_567
L_566:
;
; Line 653:	chars_tick = barlen / pagewidth;
;
	MOV	EAX,DWORD [EBP-04H]
	CDQ
	IDIV	EBX
	MOV	EDI,EAX
L_567:
;
; Line 654:	wnd->wleft = (wnd->HScrollBox-1) * chars_tick;
;
	MOV	EAX,DWORD [ESI+0BCH]
	DEC	EAX
	IMUL	EAX,EDI
	MOV	DWORD [ESI+0A4H],EAX
;
; Line 655:	if (wnd->wleft + ClientWidth(wnd) > wnd->textwidth)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_570
	MOV	EAX,01H
	JMP	SHORT	L_571
L_570:
	MOV	EAX,00H
L_571:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+0A4H]
	CMP	ECX,DWORD [ESI+0A8H]
	JLE	SHORT	L_568
;
; Line 656:	wnd->wleft = pagewidth;
;
	MOV	DWORD [ESI+0A4H],EBX
L_568:
L_561:
L_559:
;
; Line 658:	if (wnd->wleft < 0)
;
	CMP	DWORD [ESI+0A4H],BYTE 00H
	JGE	SHORT	L_572
;
; Line 659:	wnd->wleft = 0;
;
	MOV	DWORD [ESI+0A4H],00H
L_572:
;
; Line 660:	}
;
L_554:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 663:	static ATTRCHR *GetTextLine(WINDOW wnd, int selection)
;
_GetTextLine:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
L_575:
;
; Line 664:	{
;
;
; Line 666:	int len = 0;
;
	MOV	EBX,00H
;
; Line 668:	cp = cp1 = TextLine(wnd, selection);
;
	MOV	EAX,DWORD [EBP+08H]
	MOV	EAX,DWORD [EAX+0C4H]
	MOV	ECX,DWORD [EBP+0CH]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	MOV	EAX,DWORD [EBP+08H]
	ADD	ECX,DWORD [EAX+098H]
	MOV	DWORD [EBP-04H],ECX
	MOV	EDI,ECX
	JMP	SHORT	L_576
L_578:
;
; Line 670:	len++;
;
	INC	EBX
;
; Line 671:	cp++;
;
	ADD	EDI,BYTE 02H
L_576:
;
; Line 669:	while (cp->ch && cp->ch != '\n')    {
;
	CMP	BYTE [EDI+00H],BYTE 00H
	JE	SHORT	L_579
	MOVZX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_578
L_579:
L_577:
;
; Line 673:	line = DFmalloc((len+7) * sizeof(ATTRCHR));
;
	MOV	EAX,EBX
	ADD	EAX,BYTE 07H
	SHL	EAX,01H
	PUSH	EAX
	CALL	_DFmalloc
	POP	ECX
	MOV	ESI,EAX
;
; Line 674:	memmove(line, cp1, len * sizeof(ATTRCHR));
;
	MOV	EAX,EBX
	SHL	EAX,01H
	PUSH	EAX
	PUSH	DWORD [EBP-04H]
	PUSH	ESI
	CALL	_memmove
	ADD	ESP,BYTE 0CH
;
; Line 675:	line[len].ch = '\0';
;
	MOV	BYTE [ESI+EBX*2+00H],00H
;
; Line 676:	return line;
;
	MOV	EAX,ESI
L_574:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_WriteTextLine]
;
; Line 680:	void WriteTextLine(WINDOW wnd, RECT *rcc, int y, BOOL reverse)
;
_WriteTextLine:
	PUSH	EBP
	MOV	EBP,ESP
	MOV	ECX,0204CH
	CALL	DWORD ___substack
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_582:
;
; Line 681:	{
;
;
; Line 682:	int len = 0;
;
	MOV	DWORD [EBP-02024H],00H
;
; Line 683:	int dif = 0;
;
	MOV	DWORD [EBP-02020H],00H
;
; Line 691:	if (y < wnd->wtop || y >= wnd->wtop+ClientHeight(wnd))
;
	MOV	EAX,DWORD [EBP+010H]
	CMP	EAX,DWORD [ESI+094H]
	JL	NEAR	L_585
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_586
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_586
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_586
	MOV	EAX,03H
	JMP	SHORT	L_587
L_586:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_591
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_590
L_591:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_588
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_588
L_590:
	MOV	EAX,02H
	JMP	SHORT	L_589
L_588:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_592
	MOV	EAX,01H
	JMP	SHORT	L_593
L_592:
	MOV	EAX,00H
L_593:
L_589:
L_587:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_594
	MOV	EAX,01H
	JMP	SHORT	L_595
L_594:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_596
	MOV	EAX,01H
	JMP	SHORT	L_597
L_596:
	MOV	EAX,00H
L_597:
L_595:
	SUB	ECX,EAX
	ADD	ECX,DWORD [ESI+094H]
	CMP	DWORD [EBP+010H],ECX
	JL	SHORT	L_583
L_585:
;
; Line 692:	return;
;
	JMP	NEAR	L_581
L_583:
;
; Line 695:	if (rcc == NULL)    {
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JNE	SHORT	L_598
;
; Line 696:	rc = RelativeWindowRect(wnd, WindowRect(wnd));
;
	PUSH	DWORD [ESI+0CH+0CH]
	PUSH	DWORD [ESI+0CH+08H]
	PUSH	DWORD [ESI+0CH+04H]
	PUSH	DWORD [ESI+0CH+00H]
	PUSH	ESI
	LEA	EAX,[EBP-01CH]
	PUSH	EAX
	CALL	_RelativeWindowRect
	ADD	ESP,BYTE 018H
;
; Line 697:	if (TestAttribute(wnd, HASBORDER) &&
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_600
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	CMP	DWORD [EBP-014H],EAX
	JL	SHORT	L_600
;
; Line 699:	RectRight(rc) = WindowWidth(wnd)-2;
;
	MOV	EAX,DWORD [ESI+020H]
	SUB	EAX,BYTE 02H
	MOV	DWORD [EBP-014H],EAX
L_600:
	JMP	SHORT	L_599
L_598:
;
; Line 702:	rc = *rcc;
;
	MOV	EAX,DWORD [EBP+0CH]
	PUSH	ESI
	PUSH	EDI
	LEA	ESI,[EAX+00H]
	LEA	EDI,[EBP-01CH]
	PUSH	SS
	POP	ES
	CLD
	MOV	ECX,04H
	REP	MOVSD
	POP	EDI
	POP	ESI
L_599:
;
; Line 705:	if (RectLeft(rc) >= WindowWidth(wnd)-1)
;
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	CMP	DWORD [EBP-01CH],EAX
	JNL	NEAR	L_581
;
; Line 706:	return;
;
L_602:
;
; Line 707:	if (RectRight(rc) == 0)
;
	CMP	DWORD [EBP-014H],BYTE 00H
	JE	NEAR	L_581
;
; Line 708:	return;
;
L_604:
;
; Line 709:	rc = AdjustRectangle(wnd, rc);
;
	PUSH	DWORD [EBP-01CH+0CH]
	PUSH	DWORD [EBP-01CH+08H]
	PUSH	DWORD [EBP-01CH+04H]
	PUSH	DWORD [EBP-01CH+00H]
	PUSH	ESI
	LEA	EAX,[EBP-01CH]
	PUSH	EAX
	CALL	_AdjustRectangle
	ADD	ESP,BYTE 018H
;
; Line 710:	if (y-wnd->wtop<RectTop(rc) || y-wnd->wtop>RectBottom(rc))
;
	MOV	EAX,DWORD [EBP+010H]
	SUB	EAX,DWORD [ESI+094H]
	CMP	EAX,DWORD [EBP-018H]
	JL	SHORT	L_608
	MOV	EAX,DWORD [EBP+010H]
	SUB	EAX,DWORD [ESI+094H]
	CMP	EAX,DWORD [EBP-010H]
	JLE	SHORT	L_606
L_608:
;
; Line 711:	return;
;
	JMP	NEAR	L_581
L_606:
;
; Line 714:	lp = svlp = GetTextLine(wnd, y);
;
	PUSH	DWORD [EBP+010H]
	PUSH	ESI
	CALL	_GetTextLine
	ADD	ESP,BYTE 08H
	MOV	DWORD [EBP-08H],EAX
	MOV	DWORD [EBP-0CH],EAX
;
; Line 715:	if (svlp == NULL)
;
	CMP	DWORD [EBP-08H],BYTE 00H
	JE	NEAR	L_581
;
; Line 716:	return;
;
L_609:
;
; Line 717:	lnlen = tstrlen(lp);
;
	PUSH	DWORD [EBP-0CH]
	CALL	_tstrlen
	POP	ECX
	MOV	EBX,EAX
;
; Line 719:	if (wnd->protect)	{
;
	CMP	DWORD [ESI+0E8H],BYTE 00H
	JE	SHORT	L_611
;
; Line 720:	ATTRCHR *pp = lp;
;
	MOV	EAX,DWORD [EBP-0CH]
	MOV	DWORD [EBP-0202CH],EAX
	JMP	SHORT	L_613
L_615:
;
; Line 722:	if (isprint(pp->ch))
;
	MOV	EAX,DWORD [__ctype]
	MOV	ECX,DWORD [EBP-0202CH]
	MOVZX	ECX,BYTE [ECX+00H]
	MOVZX	ECX,BYTE [EAX+ECX+00H]
	AND	ECX,0DFH
	JE	SHORT	L_616
;
; Line 723:	pp->ch = '*';
;
	MOV	EAX,DWORD [EBP-0202CH]
	MOV	BYTE [EAX+00H],02AH
L_616:
;
; Line 724:	pp++;
;
	ADD	DWORD [EBP-0202CH],BYTE 02H
L_613:
;
; Line 721:	while (pp->ch)	{
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_615
L_614:
L_611:
;
; Line 729:	if (TextBlockMarked(wnd))    {
;
	CMP	DWORD [ESI+0ACH],BYTE 00H
	JNE	SHORT	L_620
	CMP	DWORD [ESI+0B4H],BYTE 00H
	JNE	SHORT	L_620
	CMP	DWORD [ESI+0B0H],BYTE 00H
	JNE	SHORT	L_620
	CMP	DWORD [ESI+0B8H],BYTE 00H
	JE	NEAR	L_618
L_620:
;
; Line 730:	int bbl = wnd->BlkBegLine;
;
	MOV	EAX,DWORD [ESI+0ACH]
	MOV	DWORD [EBP-0203CH],EAX
;
; Line 731:	int bel = wnd->BlkEndLine;
;
	MOV	EAX,DWORD [ESI+0B4H]
	MOV	DWORD [EBP-02038H],EAX
;
; Line 732:	int bbc = wnd->BlkBegCol;
;
	MOV	EAX,DWORD [ESI+0B0H]
	MOV	DWORD [EBP-02034H],EAX
;
; Line 733:	int bec = wnd->BlkEndCol;
;
	MOV	EAX,DWORD [ESI+0B8H]
	MOV	DWORD [EBP-02030H],EAX
;
; Line 734:	int by = y;
;
	MOV	EAX,DWORD [EBP+010H]
	MOV	DWORD [EBP-0202CH],EAX
;
; Line 737:	if (bbl > bel)    {
;
	MOV	EAX,DWORD [EBP-0203CH]
	CMP	EAX,DWORD [EBP-02038H]
	JLE	SHORT	L_621
;
; Line 738:	swap(bbl, bel);
;
	MOV	EAX,DWORD [EBP-0203CH]
	MOV	DWORD [EBP-0204CH],EAX
	MOV	EAX,DWORD [EBP-02038H]
	MOV	DWORD [EBP-0203CH],EAX
	MOV	EAX,DWORD [EBP-0204CH]
	MOV	DWORD [EBP-02038H],EAX
;
; Line 739:	swap(bbc, bec);
;
	MOV	EAX,DWORD [EBP-02034H]
	MOV	DWORD [EBP-0204CH],EAX
	MOV	EAX,DWORD [EBP-02030H]
	MOV	DWORD [EBP-02034H],EAX
	MOV	EAX,DWORD [EBP-0204CH]
	MOV	DWORD [EBP-02030H],EAX
L_621:
;
; Line 741:	if (bbl == bel && bbc > bec)
;
	MOV	EAX,DWORD [EBP-0203CH]
	CMP	EAX,DWORD [EBP-02038H]
	JNE	SHORT	L_623
	MOV	EAX,DWORD [EBP-02034H]
	CMP	EAX,DWORD [EBP-02030H]
	JLE	SHORT	L_623
;
; Line 742:	swap(bbc, bec);
;
	MOV	EAX,DWORD [EBP-02034H]
	MOV	DWORD [EBP-02040H],EAX
	MOV	EAX,DWORD [EBP-02030H]
	MOV	DWORD [EBP-02034H],EAX
	MOV	EAX,DWORD [EBP-02040H]
	MOV	DWORD [EBP-02030H],EAX
L_623:
;
; Line 744:	if (by >= bbl && by <= bel)    {
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-0203CH]
	JL	NEAR	L_625
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-02038H]
	JG	NEAR	L_625
;
; Line 746:	int blkbeg = 0;
;
	MOV	DWORD [EBP-02048H],00H
;
; Line 747:	int blkend = lnlen;
;
	MOV	DWORD [EBP-02044H],EBX
;
; Line 748:	int attr = clr(SelectForeground(wnd),SelectBackground(wnd));
;
	MOVSX	EAX,BYTE [ESI+037H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [ESI+036H]
	OR	ECX,EAX
	MOV	DWORD [EBP-02040H],ECX
;
; Line 749:	if (!(by > bbl && by < bel))    {
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-0203CH]
	JLE	SHORT	L_629
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-02038H]
	JL	SHORT	L_627
L_629:
;
; Line 751:	if (by == bbl)
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-0203CH]
	JNE	SHORT	L_630
;
; Line 753:	blkbeg = bbc;
;
	MOV	EAX,DWORD [EBP-02034H]
	MOV	DWORD [EBP-02048H],EAX
L_630:
;
; Line 754:	if (by == bel)
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	EAX,DWORD [EBP-02038H]
	JNE	SHORT	L_632
;
; Line 756:	blkend = bec;
;
	MOV	EAX,DWORD [EBP-02030H]
	MOV	DWORD [EBP-02044H],EAX
L_632:
L_627:
;
; Line 758:	if (blkend == 0 && lnlen == 0)	{
;
	CMP	DWORD [EBP-02044H],BYTE 00H
	JNE	SHORT	L_634
	TEST	EBX,EBX
	JNE	SHORT	L_634
;
; Line 759:	strcpy(lp, " ");
;
	PUSH	DWORD L_580
	PUSH	DWORD [EBP-0CH]
	CALL	_strcpy
	ADD	ESP,BYTE 08H
;
; Line 760:	blkend++;
;
	INC	DWORD [EBP-02044H]
L_634:
	MOV	EAX,DWORD [EBP-02048H]
	MOV	DWORD [EBP-04H],EAX
	JMP	SHORT	L_638
L_636:
;
; Line 764:	lp[i].attrib = attr;
;
	MOV	EAX,DWORD [EBP-0CH]
	MOV	ECX,DWORD [EBP-04H]
	LEA	EAX,[EAX+ECX*2+00H]
	MOV	ECX,DWORD [EBP-02040H]
	MOV	BYTE [EAX+01H],CL
;
; Line 763:	for (i=blkbeg; i < blkend; i++)
;
L_637:
	INC	DWORD [EBP-04H]
L_638:
	MOV	EAX,DWORD [EBP-04H]
	CMP	EAX,DWORD [EBP-02044H]
	JL	SHORT	L_636
L_639:
L_625:
L_618:
;
; Line 768:	if (lnlen < wnd->wleft)
;
	CMP	EBX,DWORD [ESI+0A4H]
	JGE	SHORT	L_640
;
; Line 769:	lnlen = 0;
;
	MOV	EBX,00H
	JMP	SHORT	L_641
L_640:
;
; Line 771:	lp += wnd->wleft;
;
	MOV	EAX,DWORD [ESI+0A4H]
	SHL	EAX,01H
	ADD	DWORD [EBP-0CH],EAX
L_641:
;
; Line 772:	if (lnlen > RectLeft(rc))    {
;
	CMP	EBX,DWORD [EBP-01CH]
	JLE	NEAR	L_642
;
; Line 774:	int ct = RectLeft(rc);
;
	MOV	EAX,DWORD [EBP-01CH]
	MOV	DWORD [EBP-0202CH],EAX
;
; Line 776:	lp += ct;
;
	MOV	EAX,DWORD [EBP-0202CH]
	SHL	EAX,01H
	ADD	DWORD [EBP-0CH],EAX
;
; Line 777:	lnlen = tstrlen(lp);
;
	PUSH	DWORD [EBP-0CH]
	CALL	_tstrlen
	POP	ECX
	MOV	EBX,EAX
;
; Line 778:	len = min(lnlen, RectWidth(rc));
;
	MOV	EAX,DWORD [EBP-014H]
	SUB	EAX,DWORD [EBP-01CH]
	INC	EAX
	CMP	EBX,EAX
	JGE	SHORT	L_644
	MOV	EAX,EBX
	JMP	SHORT	L_645
L_644:
	MOV	EAX,DWORD [EBP-014H]
	SUB	EAX,DWORD [EBP-01CH]
	INC	EAX
L_645:
	MOV	DWORD [EBP-02024H],EAX
;
; Line 779:	dif = tstrlen(lp) - lnlen;
;
	PUSH	DWORD [EBP-0CH]
	CALL	_tstrlen
	POP	ECX
	SUB	EAX,EBX
	MOV	DWORD [EBP-02020H],EAX
;
; Line 780:	len += dif;
;
	MOV	EAX,DWORD [EBP-02020H]
	ADD	DWORD [EBP-02024H],EAX
;
; Line 781:	if (len > 0)
;
	CMP	DWORD [EBP-02024H],BYTE 00H
	JLE	SHORT	L_646
;
; Line 783:	memcpy(line, lp, len * sizeof(ATTRCHR));
;
	MOV	EAX,DWORD [EBP-02024H]
	SHL	EAX,01H
	PUSH	EAX
	PUSH	DWORD [EBP-0CH]
	LEA	EAX,[EBP-0201CH]
	PUSH	EAX
	CALL	_memcpy
	ADD	ESP,BYTE 0CH
;
; Line 784:	line[len].ch = '\0';
;
	MOV	EAX,DWORD [EBP-02024H]
	MOV	BYTE [EBP+EAX*2-0201CH],00H
L_646:
L_642:
	JMP	SHORT	L_648
L_650:
;
; Line 790:	line[len].ch = ' ';
;
	MOV	EAX,DWORD [EBP-02024H]
	MOV	BYTE [EBP+EAX*2-0201CH],020H
;
; Line 791:	line[len++].attrib = clr(WndForeground(wnd), WndBackground(wnd));
;
	MOVSX	EAX,BYTE [ESI+035H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [ESI+034H]
	OR	ECX,EAX
	MOV	EAX,DWORD [EBP-02024H]
	INC	DWORD [EBP-02024H]
	LEA	EAX,[EBP+EAX*2-0201CH]
	MOV	BYTE [EAX+01H],CL
L_648:
;
; Line 788:	while (len < RectWidth(rc)+dif)
;
	MOV	EAX,DWORD [EBP-014H]
	SUB	EAX,DWORD [EBP-01CH]
	INC	EAX
	ADD	EAX,DWORD [EBP-02020H]
	CMP	DWORD [EBP-02024H],EAX
	JL	SHORT	L_650
L_649:
;
; Line 793:	line[len].ch = '\0';
;
	MOV	EAX,DWORD [EBP-02024H]
	MOV	BYTE [EBP+EAX*2-0201CH],00H
;
; Line 794:	if (reverse)
;
	CMP	DWORD [EBP+014H],BYTE 00H
	JE	SHORT	L_651
;
; Line 796:	ATTRCHR *pp = line;
;
	LEA	EAX,[EBP-0201CH]
	MOV	DWORD [EBP-0202CH],EAX
	JMP	SHORT	L_653
L_655:
;
; Line 800:	int fg = pp->attrib & 0xf;
;
	MOV	EAX,DWORD [EBP-0202CH]
	MOVZX	EAX,BYTE [EAX+01H]
	AND	EAX,BYTE 0FH
	MOV	EDI,EAX
;
; Line 801:	if (fg == WndForeground(wnd))
;
	MOVSX	EAX,BYTE [ESI+034H]
	CMP	EDI,EAX
	JNE	SHORT	L_656
;
; Line 802:	fg = SelectForeground(wnd);
;
	MOVSX	EAX,BYTE [ESI+036H]
	MOV	EDI,EAX
L_656:
;
; Line 803:	pp->attrib = clr(fg, SelectBackground(wnd));
;
	MOVSX	EAX,BYTE [ESI+037H]
	SAL	EAX,04H
	OR	EAX,EDI
	MOV	ECX,DWORD [EBP-0202CH]
	MOV	BYTE [ECX+01H],AL
;
; Line 804:	pp++;
;
	ADD	DWORD [EBP-0202CH],BYTE 02H
L_653:
;
; Line 798:	while (pp->ch)
;
	MOV	EAX,DWORD [EBP-0202CH]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_655
L_654:
L_651:
;
; Line 807:	dif = 0;
;
	MOV	DWORD [EBP-02020H],00H
;
; Line 809:	twriteline(wnd, line+dif,
;
	PUSH	BYTE 00H
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_658
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_658
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_658
	MOV	EAX,03H
	JMP	SHORT	L_659
L_658:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_663
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_662
L_663:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_660
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_660
L_662:
	MOV	EAX,02H
	JMP	SHORT	L_661
L_660:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_664
	MOV	EAX,01H
	JMP	SHORT	L_665
L_664:
	MOV	EAX,00H
L_665:
L_661:
L_659:
	MOV	ECX,DWORD [EBP+010H]
	SUB	ECX,DWORD [ESI+094H]
	ADD	ECX,EAX
	PUSH	ECX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_666
	MOV	EAX,01H
	JMP	SHORT	L_667
L_666:
	MOV	EAX,00H
L_667:
	ADD	EAX,DWORD [EBP-01CH]
	PUSH	EAX
	LEA	EAX,[EBP-0201CH]
	MOV	ECX,DWORD [EBP-02020H]
	SHL	ECX,01H
	ADD	EAX,ECX
	PUSH	EAX
	PUSH	ESI
	CALL	_twriteline
	ADD	ESP,BYTE 014H
;
; Line 812:	free(svlp);
;
	PUSH	DWORD [EBP-08H]
	CALL	_free
	POP	ECX
;
; Line 813:	}
;
L_581:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_MarkTextBlock]
;
; Line 815:	void MarkTextBlock(WINDOW wnd, int BegLine, int BegCol,
;
_MarkTextBlock:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_669:
;
; Line 817:	{
;
;
; Line 818:	wnd->BlkBegLine = BegLine;
;
	MOV	EAX,DWORD [EBP+0CH]
	MOV	DWORD [ESI+0ACH],EAX
;
; Line 819:	wnd->BlkEndLine = EndLine;
;
	MOV	EAX,DWORD [EBP+014H]
	MOV	DWORD [ESI+0B4H],EAX
;
; Line 820:	wnd->BlkBegCol = BegCol;
;
	MOV	EAX,DWORD [EBP+010H]
	MOV	DWORD [ESI+0B0H],EAX
;
; Line 821:	wnd->BlkEndCol = EndCol;
;
	MOV	EAX,DWORD [EBP+018H]
	MOV	DWORD [ESI+0B8H],EAX
;
; Line 822:	}
;
L_668:
	POP	ESI
	POP	EBP
	RET
[GLOBAL	_ClearTextPointers]
;
; Line 825:	void ClearTextPointers(WINDOW wnd)
;
_ClearTextPointers:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_671:
;
; Line 826:	{
;
;
; Line 827:	wnd->TextPointers = DFrealloc(wnd->TextPointers, sizeof(int));
;
	PUSH	BYTE 04H
	PUSH	DWORD [ESI+0C4H]
	CALL	_DFrealloc
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+0C4H],EAX
;
; Line 828:	*(wnd->TextPointers) = 0;
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	DWORD [EAX+00H],00H
;
; Line 829:	}
;
L_670:
	POP	ESI
	POP	EBP
	RET
[GLOBAL	_BuildTextPointers]
;
; Line 834:	void BuildTextPointers(WINDOW wnd)
;
_BuildTextPointers:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 0CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+08H]
L_673:
;
; Line 835:	{
;
;
; Line 836:	ATTRCHR *cp = wnd->text, *cp1;
;
	MOV	ESI,DWORD [EDI+098H]
;
; Line 839:	wnd->textwidth = 0;
;
	MOV	DWORD [EDI+0A8H],00H
;
; Line 840:	wnd->wlines = 0;
;
	MOV	DWORD [EDI+090H],00H
	JMP	SHORT	L_674
L_676:
;
; Line 843:	if (cp->ch == '\n')
;
	MOVZX	EAX,BYTE [ESI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_677
;
; Line 844:	wnd->wlines++;
;
	INC	DWORD [EDI+090H]
L_677:
;
; Line 845:	cp++;
;
	ADD	ESI,BYTE 02H
L_674:
;
; Line 841:	while (cp->ch)
;
	CMP	BYTE [ESI+00H],BYTE 00H
	JNE	SHORT	L_676
L_675:
;
; Line 847:	wnd->TextPointers = DFmalloc((wnd->wlines) * sizeof(int));
;
	MOV	EAX,DWORD [EDI+090H]
	SHL	EAX,02H
	PUSH	EAX
	CALL	_DFmalloc
	POP	ECX
	MOV	DWORD [EDI+0C4H],EAX
;
; Line 849:	cp = wnd->text;
;
	MOV	ESI,DWORD [EDI+098H]
;
; Line 850:	i = 0;
;
	MOV	DWORD [EBP-08H],00H
	JMP	SHORT	L_679
L_681:
;
; Line 852:	off = (unsigned int) (cp - wnd->text);
;
	MOV	EAX,ESI
	SUB	EAX,DWORD [EDI+098H]
	SHR	EAX,01H
	MOV	DWORD [EBP-04H],EAX
;
; Line 853:	*((wnd->TextPointers) + i) = off;
;
	MOV	EAX,DWORD [EDI+0C4H]
	MOV	ECX,DWORD [EBP-08H]
	MOV	EDX,DWORD [EBP-04H]
	MOV	DWORD [EAX+ECX*4+00H],EDX
;
; Line 854:	i++;
;
	INC	DWORD [EBP-08H]
;
; Line 855:	cp1 = cp;
;
	MOV	EBX,ESI
	JMP	SHORT	L_682
L_684:
;
; Line 857:	cp++;
;
	ADD	ESI,BYTE 02H
L_682:
;
; Line 856:	while (cp->ch && cp->ch != '\n')
;
	CMP	BYTE [ESI+00H],BYTE 00H
	JE	SHORT	L_685
	MOVZX	EAX,BYTE [ESI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_684
L_685:
L_683:
;
; Line 859:	wnd->textwidth = max(wnd->textwidth,                         (unsigned int) (cp - cp1));
;
	MOV	EAX,ESI
	SUB	EAX,EBX
	SHR	EAX,01H
	CMP	DWORD [EDI+0A8H],EAX
	JBE	SHORT	L_686
	MOV	EAX,DWORD [EDI+0A8H]
	JMP	SHORT	L_687
L_686:
	MOV	EAX,ESI
	SUB	EAX,EBX
	SHR	EAX,01H
L_687:
	MOV	DWORD [EDI+0A8H],EAX
;
; Line 860:	if (cp->ch)
;
	CMP	BYTE [ESI+00H],BYTE 00H
	JE	SHORT	L_688
;
; Line 861:	cp++;
;
	ADD	ESI,BYTE 02H
L_688:
L_679:
;
; Line 851:	while (cp->ch)    {
;
	CMP	BYTE [ESI+00H],BYTE 00H
	JNE	SHORT	L_681
L_680:
;
; Line 863:	}
;
L_672:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 865:	static void MoveScrollBox(WINDOW wnd, int vscrollbox)
;
_MoveScrollBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+0CH]
L_691:
;
; Line 866:	{
;
;
; Line 867:	foreground = FrameForeground(wnd);
;
	MOVSX	EAX,BYTE [ESI+038H]
	MOV	DWORD [_foreground],EAX
;
; Line 868:	background = FrameBackground(wnd);
;
	MOVSX	EAX,BYTE [ESI+039H]
	MOV	DWORD [_background],EAX
;
; Line 869:	wputch(wnd, SCROLLBARCHAR, WindowWidth(wnd)-1,
;
	MOV	EAX,DWORD [ESI+0C0H]
	INC	EAX
	PUSH	EAX
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	PUSH	EAX
	PUSH	DWORD 0B0H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 871:	wputch(wnd, SCROLLBOXCHAR, WindowWidth(wnd)-1,
;
	MOV	EAX,EBX
	INC	EAX
	PUSH	EAX
	MOV	EAX,DWORD [ESI+020H]
	DEC	EAX
	PUSH	EAX
	PUSH	DWORD 0B2H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 873:	wnd->VScrollBox = vscrollbox;
;
	MOV	DWORD [ESI+0C0H],EBX
;
; Line 874:	}
;
L_690:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_TextLineNumber]
;
; Line 876:	int TextLineNumber(WINDOW wnd, ATTRCHR *lp)
;
_TextLineNumber:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+0CH]
L_693:
;
; Line 877:	{
;
	MOV	EBX,00H
	JMP	SHORT	L_696
L_694:
;
; Line 881:	cp = wnd->text + *((wnd->TextPointers) + lineno);
;
	MOV	EAX,DWORD [EBP+08H]
	MOV	EAX,DWORD [EAX+0C4H]
	MOV	EAX,DWORD [EAX+EBX*4+00H]
	SHL	EAX,01H
	MOV	ECX,DWORD [EBP+08H]
	ADD	EAX,DWORD [ECX+098H]
	MOV	ESI,EAX
;
; Line 882:	if (cp == lp)
;
	CMP	ESI,EDI
	JNE	SHORT	L_698
;
; Line 883:	return lineno;
;
	MOV	EAX,EBX
	JMP	SHORT	L_692
L_698:
;
; Line 884:	if (cp > lp)
;
	CMP	ESI,EDI
	JNBE	SHORT	L_697
;
; Line 885:	break;
;
L_700:
;
; Line 880:	for (lineno = 0; lineno < wnd->wlines; lineno++)    {
;
L_695:
	INC	EBX
L_696:
	MOV	EAX,DWORD [EBP+08H]
	CMP	EBX,DWORD [EAX+090H]
	JL	SHORT	L_694
L_697:
;
; Line 887:	return lineno-1;
;
	MOV	EAX,EBX
	DEC	EAX
L_692:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
SECTION _STRING
L_580:
	DB	020H,00H
SECTION _BSS
[GLOBAL	_VSliding]

_VSliding	RESB	04H
[GLOBAL	_HSliding]

_HSliding	RESB	04H
SECTION _CONST

SECTION _TEXT
[EXTERN	_RelativeWindowRect]
[EXTERN	_WindowMoving]
[EXTERN	_ChangedText]
[EXTERN	___substack]
[EXTERN	_wputch]
[EXTERN	_ClipRectangle]
[EXTERN	_WindowSizing]
[EXTERN	_DFrealloc]
[EXTERN	_ClientRect]
[EXTERN	_inFocus]
[EXTERN	__ctype]
[EXTERN	_DFcalloc]
[EXTERN	_isVisible]
[EXTERN	_strlen]
[EXTERN	_tstrlen]
[EXTERN	_ClipString]
[EXTERN	_memcpy]
[EXTERN	_twriteline]
[EXTERN	_memmove]
[EXTERN	_background]
[EXTERN	_DFmalloc]
[EXTERN	_free]
[EXTERN	_writeline]
[EXTERN	_SetStandardColor]
[EXTERN	_foreground]
[EXTERN	_classdefs]
[EXTERN	_memset]
[EXTERN	_scroll_window]
[EXTERN	_SendMessage]
[EXTERN	_AdjustRectangle]
[EXTERN	___seg0040]
[EXTERN	_strcpy]
