; 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\scimark2.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	_RESOLUTION_DEFAULT
PUBLIC	_RANDOM_SEED
PUBLIC	_FFT_SIZE
PUBLIC	_SOR_SIZE
PUBLIC	_SPARSE_SIZE_M
PUBLIC	_SPARSE_SIZE_nz
PUBLIC	_LU_SIZE
PUBLIC	_LG_FFT_SIZE
PUBLIC	_LG_SOR_SIZE
PUBLIC	_LG_SPARSE_SIZE_M
PUBLIC	_LG_SPARSE_SIZE_nz
PUBLIC	_LG_LU_SIZE
EXTRN	___iob_func:PROC
EXTRN	_fprintf:PROC
EXTRN	_atof:PROC
$SG-76	DB	'-help', 00H
	ORG $+2
$SG-77	DB	'-h', 00H
	ORG $+1
$SG-78	DB	'Usage: [-large] [minimum_time]', 0aH, 00H
$SG-79	DB	'-large', 00H
	ORG $+1
$SG-80	DB	'Using %10.2f seconds min time per kenel.', 0aH, 00H
	ORG $+2
$SG-81	DB	'Composite Score:        %8.2f', 0aH, 00H
	ORG $+1
$SG-82	DB	'FFT             Mflops: %8.2f    (N=%d)', 0aH, 00H
	ORG $+3
$SG-83	DB	'SOR             Mflops: %8.2f    (%d x %d)', 0aH, 00H
$SG-84	DB	'MonteCarlo:     Mflops: %8.2f', 0aH, 00H
	ORG $+1
$SG-85	DB	'Sparse matmult  Mflops: %8.2f    (N=%d, nz=%d)', 0aH, 00H
$SG-86	DB	'LU              Mflops: %8.2f    (M=%d, N=%d)', 0aH, 00H
	ORG $+1
$SG-87	DB	'**                                                      '
	DB	'        **', 0aH, 00H
	ORG $+4
$SG-88	DB	'** SciMark2 Numeric Benchmark, see http://math.nist.gov/'
	DB	'scimark **', 0aH, 00H
	ORG $+4
$SG-89	DB	'** for details. (Results can be submitted to pozo@nist.g'
	DB	'ov)     **', 0aH, 00H
	ORG $+4
$SG-90	DB	'**                                                      '
	DB	'        **', 0aH, 00H
_RESOLUTION_DEFAULT DQ 04000000000000000r	; 2
_RANDOM_SEED DD	018a92H
_FFT_SIZE DD	0400H
_SOR_SIZE DD	064H
_SPARSE_SIZE_M DD 03e8H
_SPARSE_SIZE_nz DD 01388H
_LU_SIZE DD	064H
_LG_FFT_SIZE DD	0100000H
_LG_SOR_SIZE DD	03e8H
_LG_SPARSE_SIZE_M DD 0186a0H
_LG_SPARSE_SIZE_nz DD 0f4240H
_LG_LU_SIZE DD	03e8H
PUBLIC	_print_banner
; Function compile flags: /Ogtpy
; File c:\documents and settings\tobi\my documents\visual studio 2005\projects\scimark2-amd\source\scimark2.c
_TEXT	SEGMENT
_print_banner PROC

; 94   :  printf("**                                                              **\n");

	push	OFFSET $SG-87
	call	_printf

; 95   :  printf("** SciMark2 Numeric Benchmark, see http://math.nist.gov/scimark **\n");

	push	OFFSET $SG-88
	call	_printf

; 96   :  printf("** for details. (Results can be submitted to pozo@nist.gov)     **\n");

	push	OFFSET $SG-89
	call	_printf

; 97   :  printf("**                                                              **\n");

	push	OFFSET $SG-90
	call	_printf
	add	esp, 16					; 00000010H

; 98   : }

	ret	0
_print_banner ENDP
PUBLIC	__real@3fc999999999999a
PUBLIC	_main
;	COMDAT __real@3fc999999999999a
; File c:\documents and settings\tobi\my documents\visual studio 2005\projects\scimark2-amd\source\random.c
CONST	SEGMENT
__real@3fc999999999999a DQ 03fc999999999999ar	; 0.2
; Function compile flags: /Ogtpy
; File c:\documents and settings\tobi\my documents\visual studio 2005\projects\scimark2-amd\source\scimark2.c
CONST	ENDS
_TEXT	SEGMENT
_FFT_size$ = -76					; size = 4
_Sparse_size_nz$ = -72					; size = 4
_Sparse_size_M$ = -68					; size = 4
_LU_size$ = -64						; size = 4
_current_arg$4445 = -60					; size = 4
_min_time$ = -56					; size = 8
_res$ = -48						; size = 48
_argc$ = 8						; size = 4
_argv$ = 12						; size = 4
_main	PROC

; 12   : {

	push	ebp
	mov	ebp, esp
	and	esp, -64				; ffffffc0H
	sub	esp, 116				; 00000074H

; 13   :         /* default to the (small) cache-contained version */
; 14   : 
; 15   :         double min_time = RESOLUTION_DEFAULT;

	fld	QWORD PTR _RESOLUTION_DEFAULT
	push	ebx
	push	esi
	fstp	QWORD PTR _min_time$[esp+124]
	push	edi

; 16   : 
; 17   :         int FFT_size = FFT_SIZE;
; 18   :         int SOR_size =  SOR_SIZE;

	mov	esi, 100				; 00000064H

; 19   :         int Sparse_size_M = SPARSE_SIZE_M;
; 20   :         int Sparse_size_nz = SPARSE_SIZE_nz;
; 21   :         int LU_size = LU_SIZE;
; 22   : 
; 23   : 
; 24   :         /* run the benchmark */
; 25   : 
; 26   :         double res[6] = {0.0};
; 27   :         Random R = new_Random_seed(RANDOM_SEED);

	push	112					; 00000070H
	mov	DWORD PTR _FFT_size$[esp+132], 1024	; 00000400H
	mov	DWORD PTR _Sparse_size_M$[esp+132], 1000 ; 000003e8H
	mov	DWORD PTR _Sparse_size_nz$[esp+132], 5000 ; 00001388H
	mov	DWORD PTR _LU_size$[esp+132], esi
	call	_malloc
	mov	edi, eax
	add	esp, 4
	mov	eax, 101010				; 00018a92H
	call	_initialize
	fldz
	fstp	QWORD PTR [edi+88]

; 28   : 
; 29   : 
; 30   :         if (argc > 1)

	mov	eax, 1
	cmp	DWORD PTR _argc$[ebp], eax
	fld1
	fst	QWORD PTR [edi+96]
	mov	DWORD PTR [edi+80], 0
	fstp	QWORD PTR [edi+104]
	jle	$LN1@main

; 31   :         {
; 32   : 			int current_arg = 1;

	mov	DWORD PTR _current_arg$4445[esp+128], eax

; 33   : 
; 34   : 			if (strcmp(argv[1], "-help")==0  ||
; 35   : 					strcmp(argv[1], "-h") == 0)

	mov	eax, DWORD PTR _argv$[ebp]
	mov	ebx, DWORD PTR [eax+4]
	mov	ecx, OFFSET $SG-76
	mov	eax, ebx
$LL14@main:
	mov	dl, BYTE PTR [eax]
	cmp	dl, BYTE PTR [ecx]
	jne	SHORT $LN15@main
	test	dl, dl
	je	SHORT $LN16@main
	mov	dl, BYTE PTR [eax+1]
	cmp	dl, BYTE PTR [ecx+1]
	jne	SHORT $LN15@main
	add	eax, 2
	add	ecx, 2
	test	dl, dl
	jne	SHORT $LL14@main
$LN16@main:
	xor	eax, eax
	jmp	SHORT $LN17@main
$LN15@main:
	sbb	eax, eax
	sbb	eax, -1
$LN17@main:
	test	eax, eax
	je	$LN3@main
	mov	ecx, OFFSET $SG-77
	mov	eax, ebx
$LL18@main:
	mov	dl, BYTE PTR [eax]
	cmp	dl, BYTE PTR [ecx]
	jne	SHORT $LN19@main
	test	dl, dl
	je	SHORT $LN20@main
	mov	dl, BYTE PTR [eax+1]
	cmp	dl, BYTE PTR [ecx+1]
	jne	SHORT $LN19@main
	add	eax, 2
	add	ecx, 2
	test	dl, dl
	jne	SHORT $LL18@main
$LN20@main:
	xor	eax, eax
	jmp	SHORT $LN21@main
$LN19@main:
	sbb	eax, eax
	sbb	eax, -1
$LN21@main:
	test	eax, eax
	je	$LN3@main

; 39   : 			}
; 40   : 
; 41   : 			if (strcmp(argv[1], "-large")==0)

	mov	ecx, OFFSET $SG-79
	mov	eax, ebx
$LL22@main:
	mov	dl, BYTE PTR [eax]
	cmp	dl, BYTE PTR [ecx]
	jne	SHORT $LN23@main
	test	dl, dl
	je	SHORT $LN24@main
	mov	dl, BYTE PTR [eax+1]
	cmp	dl, BYTE PTR [ecx+1]
	jne	SHORT $LN23@main
	add	eax, 2
	add	ecx, 2
	test	dl, dl
	jne	SHORT $LL22@main
$LN24@main:
	xor	eax, eax
	jmp	SHORT $LN25@main
$LN23@main:
	sbb	eax, eax
	sbb	eax, -1
$LN25@main:
	test	eax, eax
	jne	SHORT $LN26@main

; 42   : 			{
; 43   : 				FFT_size = LG_FFT_SIZE;
; 44   : 				SOR_size = LG_SOR_SIZE;

	mov	esi, 1000				; 000003e8H
	mov	DWORD PTR _FFT_size$[esp+128], 1048576	; 00100000H

; 45   : 				Sparse_size_M = LG_SPARSE_SIZE_M;

	mov	DWORD PTR _Sparse_size_M$[esp+128], 100000 ; 000186a0H

; 46   : 				Sparse_size_nz = LG_SPARSE_SIZE_nz;

	mov	DWORD PTR _Sparse_size_nz$[esp+128], 1000000 ; 000f4240H

; 47   : 				LU_size = LG_LU_SIZE;

	mov	DWORD PTR _LU_size$[esp+128], esi

; 48   : 
; 49   : 				current_arg++;

	mov	eax, 2
	jmp	SHORT $LN2@main
$LN26@main:
	mov	eax, DWORD PTR _current_arg$4445[esp+128]
$LN2@main:

; 50   : 			}
; 51   : 
; 52   : 			if (current_arg < argc)

	cmp	eax, DWORD PTR _argc$[ebp]
	jge	SHORT $LN1@main

; 53   : 			{
; 54   : 				min_time = atof(argv[current_arg]);

	mov	ecx, DWORD PTR _argv$[ebp]
	mov	edx, DWORD PTR [ecx+eax*4]
	push	edx
	call	_atof
	fstp	QWORD PTR _min_time$[esp+132]
	add	esp, 4
$LN1@main:

; 55   : 			}
; 56   : 			
; 57   :         }
; 58   : 
; 59   : 	
; 60   : 		print_banner();

	push	OFFSET $SG-87
	call	_printf
	add	esp, 4
	push	OFFSET $SG-88
	call	_printf
	add	esp, 4
	push	OFFSET $SG-89
	call	_printf
	add	esp, 4
	push	OFFSET $SG-90
	call	_printf

; 61   : 		printf("Using %10.2f seconds min time per kenel.\n", min_time);

	fld	QWORD PTR _min_time$[esp+132]
	push	ecx
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-80
	call	_printf

; 62   : 
; 63   :         res[1] = kernel_measureFFT( FFT_size, min_time, R);   

	fld	QWORD PTR _min_time$[esp+140]
	mov	eax, DWORD PTR _FFT_size$[esp+140]
	fstp	QWORD PTR [esp+4]
	add	esp, 4
	push	eax
	mov	eax, edi
	call	_kernel_measureFFT
	fstp	QWORD PTR _res$[esp+148]

; 64   :         res[2] = kernel_measureSOR( SOR_size, min_time, R);   

	fld	QWORD PTR _min_time$[esp+140]
	add	esp, 4
	fstp	QWORD PTR [esp]
	push	esi
	mov	eax, edi
	call	_kernel_measureSOR
	fstp	QWORD PTR _res$[esp+156]

; 65   :         res[3] = kernel_measureMonteCarlo(min_time, R); 

	fld	QWORD PTR _min_time$[esp+140]
	add	esp, 4
	fstp	QWORD PTR [esp]
	call	_kernel_measureMonteCarlo

; 66   :         res[4] = kernel_measureSparseMatMult( Sparse_size_M, 
; 67   :                 Sparse_size_nz, min_time, R);           

	mov	ecx, DWORD PTR _Sparse_size_nz$[esp+136]
	fstp	QWORD PTR _res$[esp+160]
	fld	QWORD PTR _min_time$[esp+136]
	mov	ebx, DWORD PTR _Sparse_size_M$[esp+136]
	mov	eax, edi
	fstp	QWORD PTR [esp]
	call	_kernel_measureSparseMatMult
	fstp	QWORD PTR _res$[esp+168]

; 68   :         res[5] = kernel_measureLU( LU_size, min_time, R);  

	fld	QWORD PTR _min_time$[esp+136]
	mov	ebx, DWORD PTR _LU_size$[esp+136]
	fstp	QWORD PTR [esp]
	push	edi
	push	ebx
	call	_kernel_measureLU
	fst	QWORD PTR _res$[esp+184]

; 69   : 
; 70   : 
; 71   : 
; 72   :         res[0] = (res[1] + res[2] + res[3] + res[4] + res[5]) / 5;

	fadd	QWORD PTR _res$[esp+176]

; 73   : 
; 74   :         /* print out results  */
; 75   :         printf("Composite Score:        %8.2f\n" ,res[0]);

	add	esp, 8
	fadd	QWORD PTR _res$[esp+160]
	fadd	QWORD PTR _res$[esp+152]
	fadd	QWORD PTR _res$[esp+144]
	fmul	QWORD PTR __real@3fc999999999999a
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-81
	call	_printf

; 76   :         printf("FFT             Mflops: %8.2f    (N=%d)\n", res[1], FFT_size);

	fld	QWORD PTR _res$[esp+148]
	mov	ecx, DWORD PTR _FFT_size$[esp+140]
	add	esp, 12					; 0000000cH
	push	ecx
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-82
	call	_printf

; 77   :         printf("SOR             Mflops: %8.2f    (%d x %d)\n", 		
; 78   : 				res[2], SOR_size, SOR_size);

	fld	QWORD PTR _res$[esp+160]
	add	esp, 16					; 00000010H
	push	esi
	push	esi
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-83
	call	_printf

; 79   :         printf("MonteCarlo:     Mflops: %8.2f\n", res[3]);

	fld	QWORD PTR _res$[esp+172]
	add	esp, 12					; 0000000cH
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-84
	call	_printf
	add	esp, 12					; 0000000cH

; 80   :         printf("Sparse matmult  Mflops: %8.2f    (N=%d, nz=%d)\n", res[4], 
; 81   : 					Sparse_size_M, Sparse_size_nz);

	mov	edx, DWORD PTR _Sparse_size_nz$[esp+128]
	fld	QWORD PTR _res$[esp+160]
	mov	eax, DWORD PTR _Sparse_size_M$[esp+128]
	push	edx
	push	eax
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-85
	call	_printf

; 82   :         printf("LU              Mflops: %8.2f    (M=%d, N=%d)\n", res[5],
; 83   : 				LU_size, LU_size);

	fld	QWORD PTR _res$[esp+188]
	add	esp, 20					; 00000014H
	push	ebx
	push	ebx
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	OFFSET $SG-86
	call	_printf
	add	esp, 20					; 00000014H

; 84   : 
; 85   : 
; 86   :         Random_delete(R);

	push	edi
	call	_free
	add	esp, 4

; 87   : 
; 88   :         return 0;
; 89   :   
; 90   : }

	pop	edi
	pop	esi
	xor	eax, eax
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
$LN3@main:

; 36   : 			{
; 37   : 				fprintf(stderr, "Usage: [-large] [minimum_time]\n");

	push	OFFSET $SG-78
	call	___iob_func
	add	eax, 64					; 00000040H
	push	eax
	call	_fprintf
	add	esp, 8

; 38   : 				exit(0);

	push	0
	call	_exit
$LN28@main:
	int	3
_main	ENDP
_TEXT	ENDS
END
