#include "profile.h"

#define funB1(x) for (delay=0; delay<x*1000; delay++);

int funA(int a) {
	// define local variables
	int sum = 0;
	int delay;

	// hang out here for a while
    for (delay=0; delay<DELAY_A; delay++) {};

	// do the math...
	a--; 		                 // decrement the value
	if (a <= 0) { return sum; }	 // decide when to end the recursion
	sum += a + funA(a);              // recursively call and add the result to the sum

	return(sum);
}

int funB(int b) {
	// define local variables
	int delay;

	// hang out here for a while
    for (delay=0; delay<DELAY_B; delay++) {};

    funB1(b);

	return b;
}

int funD(int d) {
	// define local variables
	int delay;

	// hang out here for a while
    for (delay=0; delay<DELAY_D; delay++) {};

	return d;
}

int funE(int e) {
	// define local variables
	int sum = 1;
	int delay;

	// hang out here for a while
    for (delay=0; delay<DELAY_E; delay++) {};

	// do the math...
	e--; 		                 // decrement the value
	if (e <= 0) { return sum; }	 // decide when to end the recursion
	sum *= e + funE(e);          // recursively call and add the result to the sum

	return(sum);
}

//<copyright-disclaimer-start>
//<copyright-disclaimer-start>
//  **************************************************************************************************************
//  * © 2024 Advanced Micro Devices, Inc. All rights reserved.                                                   *
//  * DISCLAIMER                                                                                                 *
//  * The information contained herein is for informational purposes only, and is subject to change              *
//  * without notice. While every precaution has been taken in the preparation of this document, it              *
//  * may contain technical inaccuracies, omissions and typographical errors, and AMD is under no                *
//  * obligation to update or otherwise correct this information.  Advanced Micro Devices, Inc. makes            *
//  * no representations or warranties with respect to the accuracy or completeness of the contents of           *
//  * this document, and assumes no liability of any kind, including the implied warranties of noninfringement,  *
//  * merchantability or fitness for particular purposes, with respect to the operation or use of AMD            *
//  * hardware, software or other products described herein.  No license, including implied or                   *
//  * arising by estoppel, to any intellectual property rights is granted by this document.  Terms and           *
//  * limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement     *
//  * between the parties or in AMD's Standard Terms and Conditions of Sale. GD-18                               *
//  *                                                                                                            *
//  **************************************************************************************************************
//<copyright-disclaimer-end>
//<copyright-disclaimer-end>
