Skip to content

Instantly share code, notes, and snippets.

@scolton99
Created June 29, 2021 23:16
Show Gist options
  • Select an option

  • Save scolton99/34a910cd5ce3d3a9b3d255a980f4866c to your computer and use it in GitHub Desktop.

Select an option

Save scolton99/34a910cd5ce3d3a9b3d255a980f4866c to your computer and use it in GitHub Desktop.
C file used to generate assembly for the first midterm review of NU COMP_SCI 213-0 (Spring 2021).
long sus(long l, long m) {
/* do nothing useful */
if (!m)
return 0;
else
return l + sus(l - 1, m - 1);
}
int amogus(unsigned char z) {
long y = 0;
if (z) {
while (z) {
y += sus(z, z);
z--;
}
return y;
} else {
return 0;
}
}
int main() {
volatile unsigned char y;
return (int) amogus(y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment