Question: I need you to generate both the unoptimized and optimized assembly code from the C source code, which I ve provided to you in both
I need you to generate both the unoptimized and optimized assembly code from the C source code, which Ive provided to you in both image form and text form just in case to avoid any indenting errors from the text version down below. I need the assembly code for both the unoptimized and optimized versions. I repeat I am asking for the ACTUAL CODE of both the unoptimized and optimized versions, not how to do it I have had this problem already where the person that tried to solve this didn't actually give me the code for both unoptimized and optimized. Please make sure to give me the actual code for both.
If you're somehow unsure how to generate these files, I believe you can use the following commands:
For unoptimized assembly:
gcc Waadhln g masmintel mProject cProject gasm"
For optimized assembly:
gcc Waadhln O masmintel mProject cProject oasm"
Once you generate these, please send both the codes of the unoptimized and optimized and let me know which one is which. Thank you!
GCC
gcc Waadhln g masmintel mProject cProject gasm"
gcc Waadhln O masmintel mProject cProject oasm"
#include
#define NOINLINE attributenoinline
static NOINLINE int functionint xint y
int i;
int sum;
int values;
sum ;
for i ; i ; i
valuesii x y;
sum valuesi;
return sum;
static int NOINLINE functionint valuesint valuesLen
int i;
int sum;
int sum;
int v;
sum;
sum;
for i ; i valuesLen; i
v valuesi;
if v
sumv;
else
sumv;
return sumsum;
static NOINLINE int functionint x
int y;
y x ;
return y;
static NOINLINE int functionint aint bint cint d
int r;
if a b
r b;
else if a c
r a;
else if a d
r a;
else
r ;
return r;
static NOINLINE unsigned int functionunsigned int x
unsigned int x;
unsigned int x;
unsigned int x;
xx ;
xx ;
xx ;
return xxx;
int mainint argc, char argv
int i;
int j;
int k;
int values;
i ;
j ;
k functionij;
printffunction: i dj dk d
ijk;
for i ; i ; i
valuesii j;
k functionvalues;
printffunction: k d
k;
k function;
printffunction: k d
k;
k function;
printffunction: k d
k;
k function;
printffunction: k d
k;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
