	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:	{
;
_procexit:
	PUSH	EBX
;
; Line 15:		if (!_abterm)
;
	CMP	DWORD [__abterm],BYTE 00H
	JNE	SHORT	L_1
	MOV	EBX,DWORD [_atexitval]
	JMP	L_5
L_3:
;
; Line 17:				(*funclist[i-1])();
;
	LEA	EAX,[EBX+0FFFFFFFFH]
	CALL	DWORD [EAX*4+_funclist+00H]
;
; Line 16:			for (i=atexitval; i >0; i--)
;
L_4:
	DEC	EBX
L_5:
	TEST	EBX,EBX
	JG	SHORT	L_3
L_6:
L_1:
;
; Line 18:	}
;
	POP	EBX
	RET
[GLOBAL	_atexit]
;
; Line 21:	{
;
_atexit:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 22:		if (atexitval < 32) {
;
	CMP	DWORD [_atexitval],BYTE 020H
	JGE	SHORT	L_7
;
; Line 23:			funclist[atexitval++] = func;
;
	MOV	EAX,DWORD [_atexitval]
	INC	DWORD [_atexitval]
	MOV	ECX,DWORD [EBP+08H]
	MOV	DWORD [EAX*4+_funclist+00H],ECX
;
; Line 24:		  return 0;
;
	MOV	EAX,00H
	JMP	L_9
L_7:
;
; Line 26:	  return -1;
;
	MOV	EAX,0FFFFFFFFH
L_9:
	POP	EBP
	RET

SECTION _DATA

_atexitval	DD	00H
SECTION _BSS

_funclist	RESB	080H
SECTION crundown
	DD	_procexit,149

SECTION _DATA
[EXTERN	__abterm]
