	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 SearchCmp(int a, int b)
;
_SearchCmp:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	EBX,DWORD [EBP+0CH]
	MOV	ESI,DWORD [EBP+08H]
L_2:
;
; Line 17:	{
;
;
; Line 18:	if (b == '\n')
;
	CMP	EBX,BYTE 0AH
	JNE	SHORT	L_3
;
; Line 19:	b = ' ';
;
	MOV	EBX,020H
L_3:
;
; Line 20:	if (CheckCase)
;
	CMP	DWORD [_CheckCase],BYTE 00H
	JE	SHORT	L_5
;
; Line 21:	return a != b;
;
	CMP	ESI,EBX
	SETNE	AL
	MOVZX	EAX,AL
	JMP	SHORT	L_1
L_5:
;
; Line 22:	return tolower(a) != tolower(b);
;
	PUSH	EBX
	CALL	_tolower
	POP	ECX
	PUSH	EAX
	PUSH	ESI
	CALL	_tolower
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	SETNE	AL
	MOVZX	EAX,AL
L_1:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 26:	static void replacetext(WINDOW wnd, ATTRCHR *cp1, DBOX *db)
;
_replacetext:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 018H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_8:
;
; Line 27:	{
;
;
; Line 28:	char *cr = GetEditBoxText(db, ID_REPLACEWITH);
;
	PUSH	BYTE 04H
	PUSH	BYTE 030H
	PUSH	DWORD [EBP+010H]
	CALL	_GetDlgTextString
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP-014H],EAX
;
; Line 29:	char *cp = GetEditBoxText(db, ID_SEARCHFOR);
;
	PUSH	BYTE 04H
	PUSH	BYTE 02FH
	PUSH	DWORD [EBP+010H]
	CALL	_GetDlgTextString
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP-010H],EAX
;
; Line 30:	int oldlen = strlen(cp);  
;
	PUSH	DWORD [EBP-010H]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-0CH],EAX
;
; Line 31:	int newlen = strlen(cr);  
;
	PUSH	DWORD [EBP-014H]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-08H],EAX
;
; Line 34:	int attr = clr(WndForeground(wnd), WndBackground(wnd));
;
	MOVSX	EAX,BYTE [ESI+035H]
	SAL	EAX,04H
	MOVSX	ECX,BYTE [ESI+034H]
	OR	ECX,EAX
	MOV	DWORD [EBP-04H],ECX
;
; Line 35:	lastsize = newlen;
;
	MOV	EAX,DWORD [EBP-08H]
	MOV	DWORD [_lastsize],EAX
;
; Line 36:	if (oldlen < newlen)    {
;
	MOV	EAX,DWORD [EBP-0CH]
	CMP	EAX,DWORD [EBP-08H]
	JGE	SHORT	L_9
;
; Line 38:	dif = newlen-oldlen;
;
	MOV	EBX,DWORD [EBP-08H]
	SUB	EBX,DWORD [EBP-0CH]
;
; Line 40:	if (wnd->textalloc < wnd->textlen + dif + 1)    {
;
	MOV	EAX,DWORD [ESI+09CH]
	ADD	EAX,EBX
	INC	EAX
	CMP	DWORD [ESI+0A0H],EAX
	JNC	SHORT	L_11
;
; Line 42:	wnd->textalloc += dif + 2 + GROWLENGTH ;
;
	MOV	EAX,EBX
	ADD	EAX,BYTE 042H
	ADD	DWORD [ESI+0A0H],EAX
;
; Line 43:	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_11:
;
; Line 45:	memmove(cp1+dif, cp1, (wnd->textlen - (cp1 - wnd->text) +1) * sizeof ATTRCHR);
;
	MOV	EAX,DWORD [EBP+0CH]
	SUB	EAX,DWORD [ESI+098H]
	SHR	EAX,01H
	MOV	ECX,DWORD [ESI+09CH]
	SUB	ECX,EAX
	INC	ECX
	SHL	ECX,01H
	PUSH	ECX
	PUSH	DWORD [EBP+0CH]
	MOV	EAX,EBX
	SHL	EAX,01H
	ADD	EAX,DWORD [EBP+0CH]
	PUSH	EAX
	CALL	_memmove
	ADD	ESP,BYTE 0CH
;
; Line 46:	wnd->textlen += dif;
;
	ADD	DWORD [ESI+09CH],EBX
	JMP	SHORT	L_10
L_9:
;
; Line 48:	else if (oldlen > newlen)    {
;
	MOV	EAX,DWORD [EBP-0CH]
	CMP	EAX,DWORD [EBP-08H]
	JLE	SHORT	L_13
;
; Line 50:	dif = oldlen-newlen;
;
	MOV	EBX,DWORD [EBP-0CH]
	SUB	EBX,DWORD [EBP-08H]
;
; Line 51:	memmove(cp1, cp1+dif, (wnd->textlen - (cp1 + dif - wnd->text)+1) * sizeof(ATTRCHR));
;
	MOV	EAX,EBX
	SHL	EAX,01H
	ADD	EAX,DWORD [EBP+0CH]
	SUB	EAX,DWORD [ESI+098H]
	SHR	EAX,01H
	MOV	ECX,DWORD [ESI+09CH]
	SUB	ECX,EAX
	INC	ECX
	SHL	ECX,01H
	PUSH	ECX
	MOV	EAX,EBX
	SHL	EAX,01H
	ADD	EAX,DWORD [EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_memmove
	ADD	ESP,BYTE 0CH
;
; Line 52:	wnd->textlen -= dif;
;
	SUB	DWORD [ESI+09CH],EBX
L_13:
L_10:
	MOV	EDI,00H
	JMP	SHORT	L_17
L_15:
;
; Line 56:	cp1[i].ch = cr[i];
;
	MOV	EAX,DWORD [EBP-014H]
	MOV	AL,BYTE [EAX+EDI+00H]
	MOV	ECX,DWORD [EBP+0CH]
	MOV	BYTE [ECX+EDI*2+00H],AL
;
; Line 57:	cp1[i].attrib = attr;
;
	MOV	EAX,DWORD [EBP+0CH]
	LEA	EAX,[EAX+EDI*2+00H]
	MOV	ECX,DWORD [EBP-04H]
	MOV	BYTE [EAX+01H],CL
;
; Line 54:	for (i=0; i < newlen; i++)
;
L_16:
	INC	EDI
L_17:
	CMP	EDI,DWORD [EBP-08H]
	JL	SHORT	L_15
L_18:
;
; Line 59:	}
;
L_7:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 63:	static void CalculateNewSize(WINDOW wnd)
;
_CalculateNewSize:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 01CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_20:
;
; Line 64:	{
;
;
; Line 65:	char *cr = GetEditBoxText(&ReplaceTextDB, ID_REPLACEWITH);
;
	PUSH	BYTE 04H
	PUSH	BYTE 030H
	PUSH	DWORD _ReplaceTextDB
	CALL	_GetDlgTextString
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP-018H],EAX
;
; Line 66:	char *cp = GetEditBoxText(&ReplaceTextDB, ID_SEARCHFOR);
;
	PUSH	BYTE 04H
	PUSH	BYTE 02FH
	PUSH	DWORD _ReplaceTextDB
	CALL	_GetDlgTextString
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP-014H],EAX
;
; Line 67:	int plen = strlen(cp);
;
	PUSH	DWORD [EBP-014H]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-010H],EAX
;
; Line 68:	int rlen = strlen(cr);
;
	PUSH	DWORD [EBP-018H]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [EBP-0CH],EAX
;
; Line 70:	int count = 0;
;
	MOV	DWORD [EBP-04H],00H
;
; Line 71:	if (rlen <= plen)
;
	MOV	EAX,DWORD [EBP-0CH]
	CMP	EAX,DWORD [EBP-010H]
	JNG	NEAR	L_19
;
; Line 72:	return;
;
L_21:
;
; Line 73:	cp1 = CurrChar;
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	ECX,DWORD [ESI+0DCH]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	ADD	ECX,DWORD [ESI+098H]
	MOV	EAX,DWORD [ESI+0D8H]
	SHL	EAX,01H
	ADD	ECX,EAX
	MOV	DWORD [EBP-08H],ECX
	JMP	SHORT	L_23
L_25:
;
; Line 76:	char *s1 = cp;
;
	MOV	EDI,DWORD [EBP-014H]
;
; Line 77:	ATTRCHR *s2 = cp1;
;
	MOV	EBX,DWORD [EBP-08H]
	JMP	SHORT	L_26
L_28:
;
; Line 79:	if (SearchCmp(*s1, s2->ch))
;
	MOVZX	EAX,BYTE [EBX+00H]
	PUSH	EAX
	MOVSX	EAX,BYTE [EDI+00H]
	PUSH	EAX
	CALL	_SearchCmp
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JNE	SHORT	L_27
;
; Line 80:	break;
;
L_29:
;
; Line 81:	s1++, s2++;
;
	INC	EDI
	ADD	EBX,BYTE 02H
L_26:
;
; Line 78:	while (*s1 && *s1 != '\n')    {
;
	CMP	BYTE [EDI+00H],BYTE 00H
	JE	SHORT	L_31
	MOVSX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_28
L_31:
L_27:
;
; Line 83:	if (*s1 == '\0' || *s1 == '\n')
;
	MOVSX	EAX,BYTE [EDI+00H]
	TEST	EAX,EAX
	JE	SHORT	L_34
	MOVSX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_32
L_34:
;
; Line 85:	count++;
;
	INC	DWORD [EBP-04H]
;
; Line 86:	cp1 += plen;
;
	MOV	EAX,DWORD [EBP-010H]
	SHL	EAX,01H
	ADD	DWORD [EBP-08H],EAX
	JMP	SHORT	L_33
L_32:
;
; Line 90:	cp1++;
;
	ADD	DWORD [EBP-08H],BYTE 02H
L_33:
L_23:
;
; Line 75:	while (cp1->ch)    {
;
	MOV	EAX,DWORD [EBP-08H]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_25
L_24:
;
; Line 93:	count = count * (rlen - plen);
;
	MOV	EAX,DWORD [EBP-0CH]
	SUB	EAX,DWORD [EBP-010H]
	IMUL	EAX,DWORD [EBP-04H]
	MOV	DWORD [EBP-04H],EAX
;
; Line 95:	if (wnd->textalloc < wnd->textlen + count + 1)    {
;
	MOV	EAX,DWORD [ESI+09CH]
	ADD	EAX,DWORD [EBP-04H]
	INC	EAX
	CMP	DWORD [ESI+0A0H],EAX
	JNC	SHORT	L_35
;
; Line 97:	wnd->textalloc += count + 2 + GROWLENGTH ;
;
	MOV	EAX,DWORD [EBP-04H]
	ADD	EAX,BYTE 042H
	ADD	DWORD [ESI+0A0H],EAX
;
; Line 98:	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_35:
;
; Line 100:	}
;
L_19:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 102:	static void SearchTextBox(WINDOW wnd, int incr)
;
_SearchTextBox:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 01CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_44:
;
; Line 103:	{
;
;
; Line 104:	char *s1 = NULL;
;
	MOV	EDI,00H
;
; Line 106:	DBOX *db = Replacing ? &ReplaceTextDB : &SearchTextDB;
;
	CMP	DWORD [_Replacing],BYTE 00H
	JE	SHORT	L_45
	MOV	EAX,_ReplaceTextDB
	JMP	SHORT	L_46
L_45:
	MOV	EAX,_SearchTextDB
L_46:
	MOV	DWORD [EBP-014H],EAX
;
; Line 107:	char *cp = GetEditBoxText(db, ID_SEARCHFOR);
;
	PUSH	BYTE 04H
	PUSH	BYTE 02FH
	PUSH	DWORD [EBP-014H]
	CALL	_GetDlgTextString
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP-010H],EAX
;
; Line 108:	BOOL rpl = TRUE, FoundOne = FALSE;
;
	MOV	DWORD [EBP-0CH],01H
	MOV	DWORD [EBP-08H],00H
;
; Line 109:	BOOL changed = FALSE;
;
	MOV	DWORD [EBP-04H],00H
;
; Line 111:	if (!Replacing)
;
	CMP	DWORD [_Replacing],BYTE 00H
	JNE	SHORT	L_47
;
; Line 113:	highlightCaseSensitive = CheckCase;
;
	MOV	EAX,DWORD [_CheckCase]
	MOV	DWORD [_highlightCaseSensitive],EAX
;
; Line 114:	strcpy(highlightText , cp);
;
	PUSH	DWORD [EBP-010H]
	PUSH	DWORD _highlightText
	CALL	_strcpy
	ADD	ESP,BYTE 08H
L_47:
;
; Line 116:	if (Replacing)
;
	CMP	DWORD [_Replacing],BYTE 00H
	JE	SHORT	L_49
;
; Line 117:	CalculateNewSize(wnd);
;
	PUSH	ESI
	CALL	_CalculateNewSize
	POP	ECX
L_49:
	JMP	NEAR	L_51
L_53:
;
; Line 119:	rpl = Replacing ?
;
	CMP	DWORD [_Replacing],BYTE 00H
	JE	SHORT	L_54
	PUSH	BYTE 032H
	PUSH	DWORD _ReplaceTextDB
	CALL	_CheckBoxSetting
	ADD	ESP,BYTE 08H
	JMP	SHORT	L_55
L_54:
	MOV	EAX,00H
L_55:
	MOV	DWORD [EBP-0CH],EAX
;
; Line 122:	if (TextBlockMarked(wnd))    {
;
	CMP	DWORD [ESI+0ACH],BYTE 00H
	JNE	SHORT	L_58
	CMP	DWORD [ESI+0B4H],BYTE 00H
	JNE	SHORT	L_58
	CMP	DWORD [ESI+0B0H],BYTE 00H
	JNE	SHORT	L_58
	CMP	DWORD [ESI+0B8H],BYTE 00H
	JE	SHORT	L_56
L_58:
;
; Line 123:	ClearTextBlock(wnd);
;
	MOV	DWORD [ESI+0B8H],00H
	MOV	DWORD [ESI+0B0H],00H
	MOV	DWORD [ESI+0B4H],00H
	MOV	DWORD [ESI+0ACH],00H
;
; Line 124:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_56:
;
; Line 127:	cp1 = CurrChar;
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	ECX,DWORD [ESI+0DCH]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	ADD	ECX,DWORD [ESI+098H]
	MOV	EAX,DWORD [ESI+0D8H]
	SHL	EAX,01H
	ADD	ECX,EAX
	MOV	DWORD [EBP-018H],ECX
;
; Line 128:	if (incr)
;
	CMP	DWORD [EBP+0CH],BYTE 00H
	JE	SHORT	L_59
;
; Line 129:	cp1 += lastsize;     
;
	MOV	EAX,DWORD [_lastsize]
	SHL	EAX,01H
	ADD	DWORD [EBP-018H],EAX
L_59:
	JMP	SHORT	L_61
L_63:
;
; Line 132:	s1 = cp;
;
	MOV	EDI,DWORD [EBP-010H]
;
; Line 133:	s2 = cp1;
;
	MOV	EBX,DWORD [EBP-018H]
	JMP	SHORT	L_64
L_66:
;
; Line 135:	if (SearchCmp(*s1, s2->ch))
;
	MOVZX	EAX,BYTE [EBX+00H]
	PUSH	EAX
	MOVSX	EAX,BYTE [EDI+00H]
	PUSH	EAX
	CALL	_SearchCmp
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JNE	SHORT	L_65
;
; Line 136:	break;
;
L_67:
;
; Line 137:	s1++, s2++;
;
	INC	EDI
	ADD	EBX,BYTE 02H
L_64:
;
; Line 134:	while (*s1 && *s1 != '\n')    {
;
	CMP	BYTE [EDI+00H],BYTE 00H
	JE	SHORT	L_69
	MOVSX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_66
L_69:
L_65:
;
; Line 139:	if (*s1 == '\0' || *s1 == '\n')
;
	MOVSX	EAX,BYTE [EDI+00H]
	TEST	EAX,EAX
	JE	SHORT	L_72
	MOVSX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	SHORT	L_70
L_72:
;
; Line 140:	break;
;
	JMP	SHORT	L_62
L_70:
;
; Line 141:	cp1++;
;
	ADD	DWORD [EBP-018H],BYTE 02H
L_61:
;
; Line 131:	while (cp1->ch)    {
;
	MOV	EAX,DWORD [EBP-018H]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	SHORT	L_63
L_62:
;
; Line 143:	if (s1 != NULL && (*s1 == 0 || *s1 == '\n'))    {
;
	TEST	EDI,EDI
	JE	NEAR	L_73
	MOVSX	EAX,BYTE [EDI+00H]
	TEST	EAX,EAX
	JE	SHORT	L_75
	MOVSX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0AH
	JNE	NEAR	L_73
L_75:
;
; Line 145:	FoundOne = TRUE;
;
	MOV	DWORD [EBP-08H],01H
;
; Line 148:	lastsize = strlen(cp);
;
	PUSH	DWORD [EBP-010H]
	CALL	_strlen
	POP	ECX
	MOV	DWORD [_lastsize],EAX
;
; Line 151:	wnd->CurrLine = TextLineNumber(wnd, cp1);
;
	PUSH	DWORD [EBP-018H]
	PUSH	ESI
	CALL	_TextLineNumber
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+0DCH],EAX
;
; Line 152:	wnd->CurrCol = (int)(s2 - TextLine(wnd, wnd->CurrLine));
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	ECX,DWORD [ESI+0DCH]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	ADD	ECX,DWORD [ESI+098H]
	MOV	EAX,EBX
	SUB	EAX,ECX
	SHR	EAX,01H
	MOV	DWORD [ESI+0D8H],EAX
;
; Line 153:	wnd->WndRow = wnd->CurrLine - wnd->wtop;
;
	MOV	EAX,DWORD [ESI+0DCH]
	SUB	EAX,DWORD [ESI+094H]
	MOV	DWORD [ESI+0E0H],EAX
;
; Line 155:	if (!rpl)
;
	CMP	DWORD [EBP-0CH],BYTE 00H
	JNE	NEAR	L_76
;
; Line 158:	wnd->BlkEndLine = TextLineNumber(wnd, s2);
;
	PUSH	EBX
	PUSH	ESI
	CALL	_TextLineNumber
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+0B4H],EAX
;
; Line 159:	wnd->BlkBegLine = TextLineNumber(wnd, cp1);
;
	PUSH	DWORD [EBP-018H]
	PUSH	ESI
	CALL	_TextLineNumber
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+0ACH],EAX
;
; Line 160:	if (wnd->BlkEndLine < wnd->BlkBegLine)
;
	MOV	EAX,DWORD [ESI+0B4H]
	CMP	EAX,DWORD [ESI+0ACH]
	JGE	SHORT	L_78
;
; Line 161:	wnd->BlkEndLine = wnd->BlkBegLine;
;
	MOV	EAX,DWORD [ESI+0ACH]
	MOV	DWORD [ESI+0B4H],EAX
L_78:
;
; Line 162:	wnd->BlkEndCol =
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	ECX,DWORD [ESI+0B4H]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	ADD	ECX,DWORD [ESI+098H]
	MOV	EAX,EBX
	SUB	EAX,ECX
	SHR	EAX,01H
	MOV	DWORD [ESI+0B8H],EAX
;
; Line 164:	wnd->BlkBegCol =
;
	MOV	EAX,DWORD [ESI+0C4H]
	MOV	ECX,DWORD [ESI+0ACH]
	MOV	ECX,DWORD [EAX+ECX*4+00H]
	SHL	ECX,01H
	ADD	ECX,DWORD [ESI+098H]
	MOV	EAX,DWORD [EBP-018H]
	SUB	EAX,ECX
	SHR	EAX,01H
	MOV	DWORD [ESI+0B0H],EAX
;
; Line 168:	if (WndCol > ClientWidth(wnd)-1)
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_82
	MOV	EAX,01H
	JMP	SHORT	L_83
L_82:
	MOV	EAX,00H
L_83:
	SHL	EAX,01H
	MOV	ECX,DWORD [ESI+020H]
	SUB	ECX,EAX
	DEC	ECX
	MOV	EAX,DWORD [ESI+0D8H]
	SUB	EAX,DWORD [ESI+0A4H]
	CMP	EAX,ECX
	JLE	SHORT	L_80
;
; Line 169:	wnd->wleft = wnd->CurrCol;
;
	MOV	EAX,DWORD [ESI+0D8H]
	MOV	DWORD [ESI+0A4H],EAX
L_80:
;
; Line 170:	if (wnd->WndRow > ClientHeight(wnd)-1)    {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_86
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JE	SHORT	L_86
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_86
	MOV	EAX,03H
	JMP	SHORT	L_87
L_86:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_91
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 08H
	JNE	SHORT	L_90
L_91:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,0100H
	JE	SHORT	L_88
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,010000H
	JE	SHORT	L_88
L_90:
	MOV	EAX,02H
	JMP	SHORT	L_89
L_88:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,014108H
	JE	SHORT	L_92
	MOV	EAX,01H
	JMP	SHORT	L_93
L_92:
	MOV	EAX,00H
L_93:
L_89:
L_87:
	MOV	ECX,DWORD [ESI+01CH]
	SUB	ECX,EAX
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,08000H
	JE	SHORT	L_94
	MOV	EAX,01H
	JMP	SHORT	L_95
L_94:
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,04000H
	JE	SHORT	L_96
	MOV	EAX,01H
	JMP	SHORT	L_97
L_96:
	MOV	EAX,00H
L_97:
L_95:
	SUB	ECX,EAX
	DEC	ECX
	CMP	DWORD [ESI+0E0H],ECX
	JLE	SHORT	L_84
;
; Line 171:	wnd->wtop = wnd->CurrLine;
;
	MOV	EAX,DWORD [ESI+0DCH]
	MOV	DWORD [ESI+094H],EAX
;
; Line 172:	wnd->WndRow = 0;
;
	MOV	DWORD [ESI+0E0H],00H
L_84:
;
; Line 175:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 176:	SendMessage(wnd, KEYBOARD_CURSOR,
;
	PUSH	DWORD [ESI+0E0H]
	MOV	EAX,DWORD [ESI+0D8H]
	SUB	EAX,DWORD [ESI+0A4H]
	PUSH	EAX
	PUSH	BYTE 018H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_76:
;
; Line 180:	if (Replacing)    {
;
	CMP	DWORD [_Replacing],BYTE 00H
	JE	SHORT	L_98
;
; Line 181:	if (rpl || YesNoBox("Replace the text?"))  {
;
	CMP	DWORD [EBP-0CH],BYTE 00H
	JNE	SHORT	L_102
	PUSH	BYTE 01H
	PUSH	BYTE 035H
	PUSH	BYTE 034H
	PUSH	DWORD L_39
	PUSH	DWORD L_38
	PUSH	DWORD _YesNoBoxProc
	PUSH	BYTE 02H
	PUSH	DWORD L_37
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	CALL	_GenericMessage
	ADD	ESP,BYTE 028H
	TEST	EAX,EAX
	JE	SHORT	L_100
L_102:
;
; Line 182:	replacetext(wnd, cp1, db);
;
	PUSH	DWORD [EBP-014H]
	PUSH	DWORD [EBP-018H]
	PUSH	ESI
	CALL	_replacetext
	ADD	ESP,BYTE 0CH
;
; Line 183:	changed = TRUE;
;
	MOV	DWORD [EBP-04H],01H
;
; Line 184:	if (rpl)    {
;
	CMP	DWORD [EBP-0CH],BYTE 00H
	JE	SHORT	L_103
;
; Line 185:	incr = TRUE;
;
	MOV	DWORD [EBP+0CH],01H
;
; Line 186:	continue;
;
	JMP	SHORT	L_51
L_103:
L_100:
L_98:
L_73:
;
; Line 191:	break;
;
	JMP	SHORT	L_52
L_51:
;
; Line 118:	while (rpl == TRUE && cp != NULL && *cp)    {
;
	CMP	DWORD [EBP-0CH],BYTE 01H
	JNE	SHORT	L_105
	CMP	DWORD [EBP-010H],BYTE 00H
	JE	SHORT	L_105
	MOV	EAX,DWORD [EBP-010H]
	CMP	BYTE [EAX+00H],BYTE 00H
	JNE	NEAR	L_53
L_105:
L_52:
;
; Line 193:	if (Replacing)
;
	CMP	DWORD [_Replacing],BYTE 00H
	JE	SHORT	L_106
;
; Line 195:	ClearTextBlock(wnd);
;
	MOV	DWORD [ESI+0B8H],00H
	MOV	DWORD [ESI+0B0H],00H
	MOV	DWORD [ESI+0B4H],00H
	MOV	DWORD [ESI+0ACH],00H
;
; Line 196:	BuildTextPointers(wnd);
;
	PUSH	ESI
	CALL	_BuildTextPointers
	POP	ECX
;
; Line 197:	if (changed)
;
	CMP	DWORD [EBP-04H],BYTE 00H
	JE	SHORT	L_108
;
; Line 198:	ChangedText(wnd, TRUE);
;
	PUSH	BYTE 01H
	PUSH	ESI
	CALL	_ChangedText
	ADD	ESP,BYTE 08H
L_108:
;
; Line 199:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_106:
;
; Line 201:	SendMessage(ApplicationWindow, SEARCHDONE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 04EH
	PUSH	DWORD [_ApplicationWindow]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 202:	if (!FoundOne)
;
	CMP	DWORD [EBP-08H],BYTE 00H
	JNE	SHORT	L_110
;
; Line 205:	lastsize = 0;
;
	MOV	DWORD [_lastsize],00H
;
; Line 206:	MessageBox("Search/Replace Text", "No match found");
;
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	PUSH	BYTE 034H
	PUSH	BYTE 00H
	PUSH	DWORD L_42
	PUSH	DWORD _MessageBoxProc
	PUSH	BYTE 01H
	PUSH	DWORD L_41
	PUSH	DWORD L_40
	PUSH	BYTE 00H
	CALL	_GenericMessage
	ADD	ESP,BYTE 028H
L_110:
;
; Line 208:	}
;
L_43:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_ReplaceText]
;
; Line 212:	void ReplaceText(WINDOW wnd)
;
_ReplaceText:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD _ReplaceTextDB
L_113:
;
; Line 213:	{
;
;
; Line 214:	Replacing = TRUE;
;
	MOV	DWORD [_Replacing],01H
;
; Line 215:	lastsize = 0;
;
	MOV	DWORD [_lastsize],00H
;
; Line 216:	if (CheckCase)
;
	CMP	DWORD [_CheckCase],BYTE 00H
	JE	SHORT	L_114
;
; Line 217:	SetCheckBox(&ReplaceTextDB, ID_MATCHCASE);
;
	PUSH	BYTE 01H
	PUSH	BYTE 0FH
	PUSH	BYTE 031H
	PUSH	EBX
	CALL	_ControlSetting
	ADD	ESP,BYTE 010H
L_114:
;
; Line 218:	if (DialogBox(NULL, &ReplaceTextDB, TRUE, NULL))    {
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	EBX
	PUSH	BYTE 00H
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
	TEST	EAX,EAX
	JE	SHORT	L_116
;
; Line 219:	CheckCase=CheckBoxSetting(&ReplaceTextDB,ID_MATCHCASE);
;
	PUSH	BYTE 031H
	PUSH	EBX
	CALL	_CheckBoxSetting
	ADD	ESP,BYTE 08H
	MOV	DWORD [_CheckCase],EAX
;
; Line 220:	SearchTextBox(wnd, FALSE);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	_SearchTextBox
	ADD	ESP,BYTE 08H
L_116:
;
; Line 222:	}
;
L_112:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_SearchText]
;
; Line 225:	void SearchText(WINDOW wnd)
;
_SearchText:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD _SearchTextDB
L_119:
;
; Line 226:	{
;
;
; Line 227:	Replacing = FALSE;
;
	MOV	DWORD [_Replacing],00H
;
; Line 228:	lastsize = 0;
;
	MOV	DWORD [_lastsize],00H
;
; Line 229:	if (CheckCase)
;
	CMP	DWORD [_CheckCase],BYTE 00H
	JE	SHORT	L_120
;
; Line 230:	SetCheckBox(&SearchTextDB, ID_MATCHCASE);
;
	PUSH	BYTE 01H
	PUSH	BYTE 0FH
	PUSH	BYTE 031H
	PUSH	EBX
	CALL	_ControlSetting
	ADD	ESP,BYTE 010H
L_120:
;
; Line 231:	if (DialogBox(NULL, &SearchTextDB, TRUE, NULL))    {
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	EBX
	PUSH	BYTE 00H
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
	TEST	EAX,EAX
	JE	SHORT	L_122
;
; Line 232:	CheckCase=CheckBoxSetting(&SearchTextDB,ID_MATCHCASE);
;
	PUSH	BYTE 031H
	PUSH	EBX
	CALL	_CheckBoxSetting
	ADD	ESP,BYTE 08H
	MOV	DWORD [_CheckCase],EAX
;
; Line 233:	SearchTextBox(wnd, FALSE);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	_SearchTextBox
	ADD	ESP,BYTE 08H
L_122:
;
; Line 235:	}
;
L_118:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_SearchNext]
;
; Line 238:	void SearchNext(WINDOW wnd)
;
_SearchNext:
	PUSH	EBP
	MOV	EBP,ESP
L_125:
;
; Line 239:	{
;
;
; Line 240:	SearchTextBox(wnd, TRUE);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+08H]
	CALL	_SearchTextBox
	ADD	ESP,BYTE 08H
;
; Line 241:	}
;
L_124:
	POP	EBP
	RET
SECTION _STRING
L_42:
	DB	020H,020H,020H,04FH,04BH,020H,020H,020H,00H
L_41:
	DB	04EH,06FH,020H,06DH,061H,074H,063H,068H,020H,066H,06FH,075H
	DB	06EH,064H,00H
L_40:
	DB	053H,065H,061H,072H,063H,068H,02FH,052H,065H,070H,06CH,061H
	DB	063H,065H,020H,054H,065H,078H,074H,00H
L_39:
	DB	020H,020H,020H,04EH,06FH,020H,020H,020H,00H
L_38:
	DB	020H,020H,059H,065H,073H,020H,020H,020H,00H
L_37:
	DB	052H,065H,070H,06CH,061H,063H,065H,020H,074H,068H,065H,020H
	DB	074H,065H,078H,074H,03FH,00H
SECTION _DATA

_CheckCase	DD	01H

_Replacing	DD	00H
SECTION _BSS
[GLOBAL	_highlightText]

_highlightText	RESB	0100H
[GLOBAL	_highlightCaseSensitive]

_highlightCaseSensitive	RESB	04H
[GLOBAL	_highlightWholeWord]

_highlightWholeWord	RESB	04H

_lastsize	RESB	04H
SECTION _CONST

SECTION _TEXT
[EXTERN	_ChangedText]
[EXTERN	_ReplaceTextDB]
[EXTERN	_DFrealloc]
[EXTERN	_GenericMessage]
[EXTERN	_YesNoBoxProc]
[EXTERN	_strlen]
[EXTERN	_DialogBox]
[EXTERN	_ControlSetting]
[EXTERN	_SearchTextDB]
[EXTERN	_memmove]
[EXTERN	_tolower]
[EXTERN	_MessageBoxProc]
[EXTERN	_ApplicationWindow]
[EXTERN	_CheckBoxSetting]
[EXTERN	_SendMessage]
[EXTERN	_TextLineNumber]
[EXTERN	_GetDlgTextString]
[EXTERN	_BuildTextPointers]
[EXTERN	_strcpy]
