#include "labels.h" /* When using a simulator or native environment, this program will collect profile data without any modifications. You can also use trace, if supported, to display profile data after the demo has finished running. For hardware targets, you may need to set the Target-Based Timing Profiling option (-timer_profile) to enable timer-based stochastic sampling, if supported for your target. For more information, search your documentation for "Target-Based Timing Profiling". */ typedef struct { int a,b; } foo; int main2(void); void calc_sum(int *sum, int n); void eval_parabolic(int *sum, int n); #include /* The debugger must be attached, and x must be modified to have the test exit. The same applies to main2. */ int main() { int i = 0, sum = 0; volatile int x = 0; while(x == 0) { BEGIN: calc_sum(&sum, ++i); eval_parabolic(&sum, i); } main2(); END: return 0; } int gen_pairs(int a, int b, int c, int d, int e, int f, int g, int h, int i) { if (a) a++; if (h>2) a += (a-100) + b++ * c*7 / -d + (e < 0) + (f+=g) - (h-=i); return a+b+h+f+d+c+e+g; } void polarize() {} int ion_propagate(int i,int a,int b,int c,int d,int e,int f,int g,int h) { if (i) i--; if (i>2) i-=10; if (i) i/=3; i = i ? i : -i; if (i) i--; if (i>2) i-=10; if (i) i/=3; polarize(); i = i ? i : -i; return i+a+b+c+d+e+f+g+h; } void calc_sum(int *sum, int n) { if(n > 0) *sum += n / n; gen_pairs(0,1,2,3,4,5,6,7,8); gen_pairs(0,1,2,3,4,5,6,7,8); gen_pairs(0,1,2,3,4,5,6,7,8); gen_pairs(0,1,2,3,4,5,6,7,8); gen_pairs(0,1,2,3,4,5,6,7,8); } void eval_parabolic(int *sum, int n) { *sum *= n; if (*sum) (*sum)--; ion_propagate(1,2,3,4,5,6,7,8,9); ion_propagate(1,2,3,4,5,6,7,8,9); }