Question: I have a programming assignment where I need to generate both unoptimized and optimized assembly files from a C source code file ( Project 2
I have a programming assignment where I need to generate both unoptimized and optimized assembly files from a C source code file Project c I need these files to answer the related questions on the assignment.
Once you generate these files, please send them to me and I will be able to proceed with solving the assignment questions. Thank you.
GCC
gcc Waadhln g masmintel m "Project c "Project gasm"
gcc Waadhln O masmintel m "Project c "Project oasm"
#include
#define NOINLINE attributenoinline
static NOINLINE int functionint x int y
int i;
int sum;
int values;
sum ;
for i ; i ; i
valuesi i x y;
sum valuesi;
return sum;
static int NOINLINE functionint values int valuesLen
int i;
int sum;
int sum;
int v;
sum;
sum;
for i ; i valuesLen; i
v valuesi;
if v
sum v;
else
sum v;
return sum sum;
static NOINLINE int functionint x
int y;
y x ;
return y;
static NOINLINE int functionint a int b int c int 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;
x x ;
x x ;
x x ;
return x x x;
int mainint argc, char argv
int i;
int j;
int k;
int values;
i ;
j ;
k functioni j;
printffunction: i d j d k d
i j k;
for i ; i ; i
valuesi i 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
