	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
[GLOBAL	_getenv]
;
; Line 10:	{
;
_getenv:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+08H]
;
; Line 11:		char **q = _environ;
;
	MOV	ESI,DWORD [__environ]
;
; Line 12:		int len = strlen(varname);
;
	PUSH	EDI
	CLD
	SUB	EAX,EAX
	MOV	ECX,0FFFFFFFFH
	REPNZ	SCASB
	NOT	ECX
	DEC	ECX
	MOV	EAX,ECX
	POP	EDI
	MOV	EBX,EAX
	JMP	L_1
L_3:
;
; Line 14:			if (!strncmp(varname,*q,len))
;
	PUSH	EBX
	PUSH	DWORD [ESI+00H]
	PUSH	EDI
	CALL	_strncmp
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JNE	SHORT	L_4
;
; Line 15:			return(*q+len+1);
;
	MOV	EAX,DWORD [ESI+00H]
	ADD	EAX,EBX
	INC	EAX
	JMP	L_6
L_4:
;
; Line 16:			q++;
;
	ADD	ESI,BYTE 04H
;
; Line 17:		}
;
L_1:
;
; Line 13:		while (*q) {
;
	CMP	DWORD [ESI+00H],BYTE 00H
	JNE	NEAR	L_3
L_2:
;
; Line 18:		return 0;
;
	MOV	EAX,00H
L_6:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	_strncmp]

SECTION _DATA
[EXTERN	__environ]
