	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 12:	static void InsertPercent(char *s)
;
_InsertPercent:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 0CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+08H]
	LEA	EDI,[EBP-08H]
L_5:
;
; Line 13:	{
;
;
; Line 17:	sprintf(s, "%c%c%c",
;
	MOVZX	EAX,BYTE [04BH+_color]
	ADD	EAX,080H
	PUSH	EAX
	MOVZX	EAX,BYTE [04AH+_color]
	ADD	EAX,080H
	PUSH	EAX
	PUSH	DWORD 0FCH
	PUSH	DWORD L_1
	PUSH	EBX
	CALL	_sprintf
	ADD	ESP,BYTE 014H
;
; Line 21:	s += 3;
;
	ADD	EBX,BYTE 03H
;
; Line 22:	memset(s, ' ', SliderLen);
;
	PUSH	DWORD [_SliderLen]
	PUSH	BYTE 020H
	PUSH	EBX
	CALL	_memset
	ADD	ESP,BYTE 0CH
;
; Line 23:	*(s+SliderLen) = '\0';
;
	MOV	EAX,DWORD [_SliderLen]
	MOV	BYTE [EBX+EAX+00H],00H
;
; Line 24:	sprintf(pcc, "%d%%", Percent);
;
	PUSH	DWORD [_Percent]
	PUSH	DWORD L_2
	PUSH	EDI
	CALL	_sprintf
	ADD	ESP,BYTE 0CH
;
; Line 25:	strncpy(s+SliderLen/2-1, pcc, strlen(pcc));
;
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	PUSH	EAX
	PUSH	EDI
	MOV	EAX,DWORD [_SliderLen]
	SAR	EAX,01H
	JNS	SHORT	L_6
	ADC	EAX,BYTE 00H
L_6:
	ADD	EAX,EBX
	DEC	EAX
	PUSH	EAX
	CALL	_strncpy
	ADD	ESP,BYTE 0CH
;
; Line 26:	offset = (SliderLen * Percent) / 100;
;
	MOV	EAX,DWORD [_SliderLen]
	IMUL	EAX,DWORD [_Percent]
	CDQ
	IDIV	DWORD [L_7]
	MOV	ESI,EAX
;
; Line 27:	memmove(s+offset+4, s+offset, strlen(s+offset)+1);
;
	MOV	EAX,EBX
	ADD	EAX,ESI
	PUSH	EAX
	CALL	_strlen
	POP	ECX
	INC	EAX
	PUSH	EAX
	MOV	EAX,EBX
	ADD	EAX,ESI
	PUSH	EAX
	MOV	EAX,EBX
	ADD	EAX,ESI
	ADD	EAX,BYTE 04H
	PUSH	EAX
	CALL	_memmove
	ADD	ESP,BYTE 0CH
;
; Line 28:	sprintf(pcc, "%c%c%c%c",
;
	MOVZX	EAX,BYTE [04AH+_color]
	ADD	EAX,080H
	PUSH	EAX
	MOVZX	EAX,BYTE [04BH+_color]
	ADD	EAX,080H
	PUSH	EAX
	PUSH	DWORD 0FCH
	PUSH	DWORD 0FDH
	PUSH	DWORD L_3
	PUSH	EDI
	CALL	_sprintf
	ADD	ESP,BYTE 018H
;
; Line 33:	strncpy(s+offset, pcc, 4);
;
	PUSH	BYTE 04H
	PUSH	EDI
	MOV	EAX,EBX
	ADD	EAX,ESI
	PUSH	EAX
	CALL	_strncpy
	ADD	ESP,BYTE 0CH
;
; Line 34:	*(s + strlen(s) - 1) = RESETCOLOR;
;
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	ADD	EAX,EBX
	DEC	EAX
	MOV	BYTE [EAX+00H],0FDH
;
; Line 35:	}
;
L_4:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 38:	WINDOW wnd,MESSAGE msg,PARAM p1,PARAM p2)
;
_SliderTextProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+014H]
	MOV	EDI,DWORD [EBP+0CH]
L_9:
;
; Line 39:	{
;
;
; Line 40:	switch (msg)    {
;
	CMP	EDI,BYTE 09H
	JE	SHORT	L_12
	JMP	SHORT	L_11
L_12:
;
; Line 42:	Percent = (int)p2;
;
	MOV	DWORD [_Percent],EBX
;
; Line 43:	InsertPercent(GetText(wnd) ?
;
	CMP	DWORD [ESI+098H],BYTE 00H
	JE	SHORT	L_13
	MOV	EAX,DWORD [ESI+098H]
	JMP	SHORT	L_14
L_13:
	MOV	EAX,DWORD [_SliderBoxDB+060H]
L_14:
	PUSH	EAX
	CALL	_InsertPercent
	POP	ECX
;
; Line 45:	GenericProc(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	DWORD [_GenericProc]
	ADD	ESP,BYTE 010H
;
; Line 46:	if (Percent >= 100)
;
	CMP	DWORD [_Percent],BYTE 064H
	JL	SHORT	L_15
;
; Line 47:	SendMessage(GetParent(wnd),COMMAND,ID_CANCEL,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 035H
	PUSH	BYTE 02H
	PUSH	DWORD [ESI+03CH]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_15:
;
; Line 48:	if (!dispatch_message())
;
	CALL	_dispatch_message
	TEST	EAX,EAX
	JNE	SHORT	L_17
;
; Line 49:	PostMessage(GetParent(wnd), ENDDIALOG, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 04BH
	PUSH	DWORD [ESI+03CH]
	CALL	_PostMessage
	ADD	ESP,BYTE 010H
L_17:
;
; Line 50:	return KeepRunning;
;
	MOV	EAX,DWORD [_KeepRunning]
	JMP	SHORT	L_8
L_11:
;
; Line 52:	break;
;
	JMP	SHORT	L_10
L_10:
;
; Line 54:	return GenericProc(wnd, msg, p1, p2);
;
	PUSH	EBX
	PUSH	DWORD [EBP+010H]
	MOV	EAX,EDI
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	ESI
	CALL	DWORD [_GenericProc]
	ADD	ESP,BYTE 010H
L_8:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 58:	WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_SliderBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+010H]
L_23:
;
; Line 59:	{
;
;
; Line 62:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 02H
	JE	NEAR	L_27
	CMP	EAX,BYTE 03H
	JE	SHORT	L_26
	CMP	EAX,BYTE 07H
	JE	NEAR	L_28
	JMP	NEAR	L_25
L_26:
;
; Line 64:	AddAttribute(wnd, SAVESELF);
;
	BTS	DWORD [ESI+054H],07H
;
; Line 65:	rtn = DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_29
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_30
L_29:
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_30:
	MOV	DWORD [EBP-04H],EAX
;
; Line 66:	twnd = SliderBoxDB.ctl[1].wnd;
;
	MOV	EDI,DWORD [_SliderBoxDB+074H]
;
; Line 67:	GenericProc = twnd->wndproc;
;
	MOV	EAX,DWORD [EDI+08H]
	MOV	DWORD [_GenericProc],EAX
;
; Line 68:	twnd->wndproc = SliderTextProc;
;
	MOV	DWORD [EDI+08H],DWORD _SliderTextProc
;
; Line 69:	KeepRunning = TRUE;
;
	MOV	DWORD [_KeepRunning],01H
;
; Line 70:	SendMessage(wnd, CAPTURE_MOUSE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 02EH
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 71:	SendMessage(wnd, CAPTURE_KEYBOARD, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 016H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 72:	return rtn;
;
	MOV	EAX,DWORD [EBP-04H]
	JMP	NEAR	L_22
L_27:
;
; Line 74:	if ((int)p2 == 0 && (int)p1 == ID_CANCEL)    {
;
	CMP	DWORD [EBP+014H],BYTE 00H
	JNE	SHORT	L_31
	CMP	EBX,BYTE 035H
	JNE	SHORT	L_31
;
; Line 75:	if (Percent >= 100 ||
;
	CMP	DWORD [_Percent],BYTE 064H
	JGE	SHORT	L_35
	PUSH	BYTE 01H
	PUSH	BYTE 035H
	PUSH	BYTE 034H
	PUSH	DWORD L_21
	PUSH	DWORD L_20
	PUSH	DWORD _YesNoBoxProc
	PUSH	BYTE 02H
	PUSH	DWORD L_19
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	CALL	_GenericMessage
	ADD	ESP,BYTE 028H
	TEST	EAX,EAX
	JE	SHORT	L_33
L_35:
;
; Line 77:	KeepRunning = FALSE;
;
	MOV	DWORD [_KeepRunning],00H
	JMP	SHORT	L_34
L_33:
;
; Line 79:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_22
L_34:
L_31:
;
; Line 81:	break;
;
	JMP	SHORT	L_24
L_28:
;
; Line 83:	SendMessage(wnd, RELEASE_MOUSE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 02FH
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 84:	SendMessage(wnd, RELEASE_KEYBOARD, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 017H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 85:	break;
;
	JMP	SHORT	L_24
L_25:
;
; Line 87:	break;
;
	JMP	SHORT	L_24
L_24:
;
; Line 89:	return DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_36
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_37
L_36:
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_37:
L_22:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_SliderBox]
;
; Line 92:	WINDOW SliderBox(int len, char *ttl, char *msg)
;
_SliderBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD _SliderBoxDB
	MOV	EBX,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+010H]
L_39:
;
; Line 93:	{
;
;
; Line 94:	SliderLen = len;
;
	MOV	DWORD [_SliderLen],EBX
;
; Line 95:	SliderBoxDB.dwnd.title = ttl;
;
	MOV	EAX,DWORD [EBP+0CH]
	MOV	DWORD [ESI+04H],EAX
;
; Line 96:	SliderBoxDB.dwnd.w =
;
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	CMP	EBX,EAX
	JBE	SHORT	L_42
	MOV	EAX,EBX
	JMP	SHORT	L_43
L_42:
	PUSH	EDI
	CALL	_strlen
	POP	ECX
L_43:
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JBE	SHORT	L_40
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_41
L_40:
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	CMP	EBX,EAX
	JBE	SHORT	L_44
	MOV	EAX,EBX
	JMP	SHORT	L_45
L_44:
	PUSH	EDI
	CALL	_strlen
	POP	ECX
L_45:
L_41:
	ADD	EAX,BYTE 04H
	MOV	DWORD [ESI+014H],EAX
;
; Line 98:	SliderBoxDB.ctl[0].itext = msg;
;
	MOV	DWORD [ESI+030H],EDI
;
; Line 99:	SliderBoxDB.ctl[0].dwnd.w = strlen(msg);
;
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	DWORD [ESI+028H],EAX
;
; Line 100:	SliderBoxDB.ctl[0].dwnd.x =
;
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	ECX,DWORD [ESI+014H]
	SUB	ECX,EAX
	DEC	ECX
	SAR	ECX,01H
	JNS	SHORT	L_46
	ADC	ECX,BYTE 00H
L_46:
	MOV	DWORD [ESI+01CH],ECX
;
; Line 102:	SliderBoxDB.ctl[1].itext =
;
	MOV	EAX,EBX
	ADD	EAX,BYTE 0AH
	PUSH	EAX
	PUSH	DWORD [ESI+060H]
	CALL	_DFrealloc
	ADD	ESP,BYTE 08H
	MOV	DWORD [ESI+060H],EAX
;
; Line 104:	Percent = 0;
;
	MOV	DWORD [_Percent],00H
;
; Line 105:	InsertPercent(SliderBoxDB.ctl[1].itext);
;
	PUSH	DWORD [ESI+060H]
	CALL	_InsertPercent
	POP	ECX
;
; Line 106:	SliderBoxDB.ctl[1].dwnd.w = len;
;
	MOV	DWORD [ESI+058H],EBX
;
; Line 107:	SliderBoxDB.ctl[1].dwnd.x = (SliderBoxDB.dwnd.w-len-1)/2;
;
	MOV	EAX,DWORD [ESI+014H]
	SUB	EAX,EBX
	DEC	EAX
	SAR	EAX,01H
	JNS	SHORT	L_47
	ADC	EAX,BYTE 00H
L_47:
	MOV	DWORD [ESI+04CH],EAX
;
; Line 108:	SliderBoxDB.ctl[2].dwnd.x = (SliderBoxDB.dwnd.w-10)/2;
;
	MOV	EAX,DWORD [ESI+014H]
	SUB	EAX,BYTE 0AH
	SAR	EAX,01H
	JNS	SHORT	L_48
	ADC	EAX,BYTE 00H
L_48:
	MOV	DWORD [ESI+07CH],EAX
;
; Line 109:	DialogBox(NULL, &SliderBoxDB, FALSE, SliderBoxProc);
;
	PUSH	DWORD _SliderBoxProc
	PUSH	BYTE 00H
	PUSH	ESI
	PUSH	BYTE 00H
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
;
; Line 110:	return SliderBoxDB.ctl[1].wnd;
;
	MOV	EAX,DWORD [ESI+074H]
L_38:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
SECTION _STRING
L_21:
	DB	020H,020H,020H,04EH,06FH,020H,020H,020H,00H
L_20:
	DB	020H,020H,059H,065H,073H,020H,020H,020H,00H
L_19:
	DB	054H,065H,072H,06DH,069H,06EH,061H,074H,065H,020H,070H,072H
	DB	06FH,063H,065H,073H,073H,03FH,00H
L_3:
	DB	025H,063H,025H,063H,025H,063H,025H,063H,00H
L_2:
	DB	025H,064H,025H,025H,00H
L_1:
	DB	025H,063H,025H,063H,025H,063H,00H
SECTION _BSS

_GenericProc	RESB	04H

_KeepRunning	RESB	04H

_SliderLen	RESB	04H

_Percent	RESB	04H
SECTION _CONST

	TIMES $$-$ & 3 NOP
L_7:
	DD	064H

SECTION _TEXT
[EXTERN	_color]
[EXTERN	_sprintf]
[EXTERN	_DFrealloc]
[EXTERN	_GenericMessage]
[EXTERN	_YesNoBoxProc]
[EXTERN	_strncpy]
[EXTERN	_strlen]
[EXTERN	_DialogBox]
[EXTERN	_dispatch_message]
[EXTERN	_memmove]
[EXTERN	_SliderBoxDB]
[EXTERN	_classdefs]
[EXTERN	_memset]
[EXTERN	_SendMessage]
[EXTERN	_PostMessage]
