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

SECTION _TEXT
;
; Line 13:	{
;
_spawnbase:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,0278H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	LEA	ESI,[EBP+0FFFFFD8CH]
;
; Line 18:		parms[0] = ' ';
;
	MOV	BYTE [EBP+0FFFFFE0CH],020H
;
; Line 19:		parms[1] = 0;
;
	MOV	BYTE [EBP+0FFFFFE0DH],00H
;
; Line 20:		if (env)
;
	CMP	DWORD [EBP+010H],BYTE 00H
	JE	SHORT	L_5
;
; Line 21:			printf("Warning: RTL does not support environment-passing spawn/exec\n");
;
	PUSH	DWORD L_1
	CALL	_printf
	POP	ECX
L_5:
	JMP	L_7
L_9:
;
; Line 23:			strcat(parms,*args);
;
	MOV	EAX,DWORD [EBP+0CH]
	LEA	ECX,[EBP+0FFFFFE0CH]
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EAX+00H]
	MOV	EDI,ECX
	CLD
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	DEC	EDI
	XCHG	ESI,EDI
	PUSH	EDI
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	MOV	EAX,ECX
	POP	EDI
	XCHG	ESI,EDI
	REPNZ	MOVSB
	POP	EDI
	POP	ESI
	LEA	ECX,[EBP+0FFFFFE0CH]
L_7:
;
; Line 22:		while (*++args)
;
	ADD	DWORD [EBP+0CH],BYTE 04H
	MOV	EAX,DWORD [EBP+0CH]
	CMP	DWORD [EAX+00H],BYTE 00H
	JNE	NEAR	L_9
L_8:
;
; Line 24:		strcpy(name,path);
;
	MOV	EAX,ESI
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,EAX
	XCHG	ESI,EDI
	CLD
	PUSH	EDI
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	MOV	EAX,ECX
	POP	EDI
	XCHG	ESI,EDI
	REPNZ	MOVSB
	POP	EDI
	POP	ESI
;
; Line 25:		if (!(vv = searchpath(name))) {
;
	PUSH	ESI
	CALL	_searchpath
	POP	ECX
	MOV	EBX,EAX
	TEST	EAX,EAX
	JNE	NEAR	L_10
;
; Line 26:			strcat(name,".EXE");
;
	MOV	EAX,DWORD L_2
	MOV	ECX,ESI
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,EAX
	MOV	EDI,ECX
	CLD
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	DEC	EDI
	XCHG	ESI,EDI
	PUSH	EDI
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	MOV	EAX,ECX
	POP	EDI
	XCHG	ESI,EDI
	REPNZ	MOVSB
	POP	EDI
	POP	ESI
;
; Line 27:			if (!(vv = searchpath(name))) {
;
	PUSH	ESI
	CALL	_searchpath
	POP	ECX
	MOV	EBX,EAX
	TEST	EAX,EAX
	JNE	NEAR	L_12
;
; Line 28:				strcpy(name,path);
;
	MOV	EAX,ESI
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,EAX
	XCHG	ESI,EDI
	CLD
	PUSH	EDI
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	MOV	EAX,ECX
	POP	EDI
	XCHG	ESI,EDI
	REPNZ	MOVSB
	POP	EDI
	POP	ESI
;
; Line 29:				strcat(name,".COM");
;
	MOV	EAX,DWORD L_3
	MOV	ECX,ESI
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,EAX
	MOV	EDI,ECX
	CLD
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	DEC	EDI
	XCHG	ESI,EDI
	PUSH	EDI
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	MOV	EAX,ECX
	POP	EDI
	XCHG	ESI,EDI
	REPNZ	MOVSB
	POP	EDI
	POP	ESI
;
; Line 30:				if (!(vv = searchpath(name))) {
;
	PUSH	ESI
	CALL	_searchpath
	POP	ECX
	MOV	EBX,EAX
	TEST	EAX,EAX
	JNE	SHORT	L_14
;
; Line 31:					printf("not found"); return -1;
;
	PUSH	DWORD L_4
	CALL	_printf
	POP	ECX
	MOV	EAX,0FFFFFFFFH
	JMP	L_16
L_14:
;
; Line 33:			}
;
L_12:
;
; Line 34:		}
;
L_10:
;
; Line 35:		rv = _ll_spawn(vv,parms,env);
;
	PUSH	DWORD [EBP+010H]
	LEA	EAX,[EBP+0FFFFFE0CH]
	PUSH	EAX
	PUSH	EBX
	CALL	__ll_spawn
	ADD	ESP,BYTE 0CH
	MOV	EDI,EAX
;
; Line 36:		if (toexit)
;
	CMP	DWORD [EBP+014H],BYTE 00H
	JE	SHORT	L_17
;
; Line 37:			exit(rv);
;
	PUSH	EDI
	CALL	_exit
	POP	ECX
L_17:
;
; Line 38:		return rv;
;
	MOV	EAX,EDI
L_16:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 41:	{
;
_findenv:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
;
; Line 43:		vv = argv;
;
	MOV	EBX,DWORD [EBP+08H]
	JMP	L_19
L_21:
;
; Line 45:			vv++;
;
	INC	EBX
L_19:
;
; Line 44:		while (*vv)
;
	CMP	BYTE [EBX+00H],BYTE 00H
	JNE	SHORT	L_21
L_20:
;
; Line 46:		return (++vv);
;
	INC	EBX
	MOV	EAX,EBX
L_22:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_execl]
;
; Line 49:	{
;
_execl:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 50:		return spawnbase(path,&argv0,0,1,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_23:
	POP	EBP
	RET
[GLOBAL	_execle]
;
; Line 53:	{
;
_execle:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 54:		return spawnbase(path,&argv0,findenv(&argv0),1,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	CALL	_findenv
	POP	ECX
	PUSH	EAX
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_24:
	POP	EBP
	RET
[GLOBAL	_execlp]
;
; Line 57:	{
;
_execlp:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 58:		return spawnbase(path,&argv0,0,1,1);
;
	PUSH	BYTE 01H
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_25:
	POP	EBP
	RET
[GLOBAL	_execlpe]
;
; Line 61:	{
;
_execlpe:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 62:		return spawnbase(path,&argv0,findenv(&argv0),1,1);
;
	PUSH	BYTE 01H
	PUSH	BYTE 01H
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	CALL	_findenv
	POP	ECX
	PUSH	EAX
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_26:
	POP	EBP
	RET
[GLOBAL	_execv]
;
; Line 65:	{
;
_execv:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 66:		return spawnbase(path,&argv,0,1,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	LEA	EAX,[EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_27:
	POP	EBP
	RET
[GLOBAL	_execve]
;
; Line 69:	{
;
_execve:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 70:		return spawnbase(path,argv,env,1,0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_28:
	POP	EBP
	RET
[GLOBAL	_execvp]
;
; Line 73:	{
;
_execvp:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 74:		return spawnbase(path,argv,0,1,1);
;
	PUSH	BYTE 01H
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_29:
	POP	EBP
	RET
[GLOBAL	_execvpe]
;
; Line 77:	{
;
_execvpe:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 78:		return spawnbase(path,argv,env,1,1);
;
	PUSH	BYTE 01H
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_30:
	POP	EBP
	RET
[GLOBAL	_spawnl]
;
; Line 81:	{
;
_spawnl:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 82:		return spawnbase(path,&argv0,0,mode,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	PUSH	BYTE 00H
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_31:
	POP	EBP
	RET
[GLOBAL	_spawnle]
;
; Line 85:	{
;
_spawnle:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 86:		return spawnbase(path,&argv0,findenv(&argv0),mode,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	CALL	_findenv
	POP	ECX
	PUSH	EAX
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_32:
	POP	EBP
	RET
[GLOBAL	_spawnlp]
;
; Line 89:	{
;
_spawnlp:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 90:		return spawnbase(path,&argv0,0,mode,1);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+08H]
	PUSH	BYTE 00H
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_33:
	POP	EBP
	RET
[GLOBAL	_spawnlpe]
;
; Line 93:	{
;
_spawnlpe:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 94:		return spawnbase(path,&argv0,findenv(&argv0),mode,1);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+08H]
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	CALL	_findenv
	POP	ECX
	PUSH	EAX
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_34:
	POP	EBP
	RET
[GLOBAL	_spawnv]
;
; Line 97:	{
;
_spawnv:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 98:		return spawnbase(path,&argv,0,mode,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	PUSH	BYTE 00H
	LEA	EAX,[EBP+010H]
	PUSH	EAX
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_35:
	POP	EBP
	RET
[GLOBAL	_spawnve]
;
; Line 101:	{
;
_spawnve:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 102:		return spawnbase(path,argv,env,mode,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_36:
	POP	EBP
	RET
[GLOBAL	_spawnvp]
;
; Line 105:	{
;
_spawnvp:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 106:		return spawnbase(path,argv,0,mode,1);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+08H]
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_37:
	POP	EBP
	RET
[GLOBAL	_spawnvpe]
;
; Line 109:	{
;
_spawnvpe:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 110:		return spawnbase(path,argv,env,mode,1);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+08H]
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	CALL	_spawnbase
	ADD	ESP,BYTE 014H
L_38:
	POP	EBP
	RET

SECTION _STRING
L_4:
	DB	06EH,06FH,074H,020H,066H,06FH,075H,06EH,064H,00H
L_3:
	DB	02EH,043H,04FH,04DH,00H
L_2:
	DB	02EH,045H,058H,045H,00H
L_1:
	DB	057H,061H,072H,06EH,069H,06EH,067H,03AH,020H,052H,054H,04CH
	DB	020H,064H,06FH,065H,073H,020H,06EH,06FH,074H,020H,073H,075H
	DB	070H,070H,06FH,072H,074H,020H,065H,06EH,076H,069H,072H,06FH
	DB	06EH,06DH,065H,06EH,074H,02DH,070H,061H,073H,073H,069H,06EH
	DB	067H,020H,073H,070H,061H,077H,06EH,02FH,065H,078H,065H,063H
	DB	0AH,00H

SECTION _TEXT
[EXTERN	_exit]
[EXTERN	__ll_spawn]
[EXTERN	_searchpath]
[EXTERN	_printf]
