; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.42 

	TITLE	c:\Documents and Settings\Tobi\My Documents\Visual Studio 2005\Projects\Scimark2-AMD\source\Stopwatch.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

EXTRN	_clock:PROC
PUBLIC	_Stopwatch_delete
; Function compile flags: /Ogtpy
; File c:\documents and settings\tobi\my documents\visual studio 2005\projects\scimark2-amd\source\stopwatch.c
_TEXT	SEGMENT
_Stopwatch_delete PROC
; _S$ = eax

; 29   :     if (S != NULL)

	test	eax, eax
	je	SHORT $LN1@Stopwatch_

; 30   :         free(S);

	push	eax
	call	_free
	pop	ecx
$LN1@Stopwatch_:

; 31   : }

	ret	0
_Stopwatch_delete ENDP
_TEXT	ENDS
PUBLIC	_Stopwtach_reset
EXTRN	__fltused:DWORD
; Function compile flags: /Ogtpy
_TEXT	SEGMENT
_Stopwtach_reset PROC
; _Q$ = eax

; 11   :     Q->running = 0;         /* false */
; 12   :     Q->last_time = 0.0;

	xorps	xmm0, xmm0
	mov	DWORD PTR [eax], 0
	movsd	QWORD PTR [eax+8], xmm0

; 13   :     Q->total= 0.0;

	movsd	QWORD PTR [eax+16], xmm0

; 14   : }

	ret	0
_Stopwtach_reset ENDP
_TEXT	ENDS
PUBLIC	__real@408f400000000000
PUBLIC	_seconds
;	COMDAT __real@408f400000000000
CONST	SEGMENT
__real@408f400000000000 DQ 0408f400000000000r	; 1000
; Function compile flags: /Ogtpy
CONST	ENDS
_TEXT	SEGMENT
_seconds PROC

; 6    :         return ((double) clock()) / (double) CLOCKS_PER_SEC; 

	call	_clock
	cvtsi2sd xmm0, eax
	divsd	xmm0, QWORD PTR __real@408f400000000000

; 7    : }

	ret	0
_seconds ENDP
PUBLIC	_Stopwatch_read
; Function compile flags: /Ogtpy
_TEXT	SEGMENT
_Stopwatch_read PROC
; _Q$ = esi

; 73   :     
; 74   :     if (Q->running) 

	cmp	DWORD PTR [esi], 0
	je	SHORT $LN6@Stopwatch_@2

; 75   :     {
; 76   :         double t = seconds();

	call	_clock
	cvtsi2sd xmm0, eax
	divsd	xmm0, QWORD PTR __real@408f400000000000

; 77   :         Q->total += t - Q->last_time;

	movapd	xmm1, xmm0
	subsd	xmm1, QWORD PTR [esi+8]
	addsd	xmm1, QWORD PTR [esi+16]
	movsd	QWORD PTR [esi+16], xmm1

; 78   :         Q->last_time = t;

	movsd	QWORD PTR [esi+8], xmm0
$LN6@Stopwatch_@2:

; 79   :     }
; 80   :     return Q->total;

	movsd	xmm0, QWORD PTR [esi+16]

; 81   : }

	ret	0
_Stopwatch_read ENDP
_TEXT	ENDS
PUBLIC	_Stopwatch_stop
; Function compile flags: /Ogtpy
_TEXT	SEGMENT
_Stopwatch_stop PROC
; _Q$ = esi

; 63   :     if (Q->running) 

	cmp	DWORD PTR [esi], 0
	je	SHORT $LN1@Stopwatch_@3

; 64   :     { 
; 65   :         Q->total += seconds() - Q->last_time; 

	call	_clock
	cvtsi2sd xmm0, eax
	divsd	xmm0, QWORD PTR __real@408f400000000000
	subsd	xmm0, QWORD PTR [esi+8]
	addsd	xmm0, QWORD PTR [esi+16]
	movsd	QWORD PTR [esi+16], xmm0

; 66   :         Q->running = 0;  /* false */

	mov	DWORD PTR [esi], 0
$LN1@Stopwatch_@3:

; 67   :     }
; 68   : }

	ret	0
_Stopwatch_stop ENDP
_TEXT	ENDS
PUBLIC	_Stopwatch_start
; Function compile flags: /Ogtpy
_TEXT	SEGMENT
_Stopwatch_start PROC
; _Q$ = esi

; 38   :     if (! (Q->running)  )

	cmp	DWORD PTR [esi], 0
	jne	SHORT $LN1@Stopwatch_@4

; 39   :     {
; 40   :         Q->running = 1;  /* true */
; 41   :         Q->total = 0.0;

	xorps	xmm0, xmm0
	mov	DWORD PTR [esi], 1
	movsd	QWORD PTR [esi+16], xmm0

; 42   :         Q->last_time = seconds();

	call	_clock
	cvtsi2sd xmm0, eax
	divsd	xmm0, QWORD PTR __real@408f400000000000
	movsd	QWORD PTR [esi+8], xmm0
$LN1@Stopwatch_@4:

; 43   :     }
; 44   : }

	ret	0
_Stopwatch_start ENDP
_TEXT	ENDS
PUBLIC	_new_Stopwatch
; Function compile flags: /Ogtpy
_TEXT	SEGMENT
_new_Stopwatch PROC

; 19   :     Stopwatch S = (Stopwatch) malloc(sizeof(Stopwatch_struct));

	push	24					; 00000018H
	call	_malloc
	add	esp, 4

; 20   :     if (S == NULL)

	test	eax, eax
	jne	SHORT $LN1@new_Stopwa

; 24   :     return S;
; 25   : }

	ret	0
$LN1@new_Stopwa:

; 21   :         return NULL;
; 22   : 
; 23   :     Stopwtach_reset(S);

	xorps	xmm0, xmm0
	mov	DWORD PTR [eax], 0
	movsd	QWORD PTR [eax+8], xmm0
	movsd	QWORD PTR [eax+16], xmm0

; 24   :     return S;
; 25   : }

	ret	0
_new_Stopwatch ENDP
END
