Convert this program to y86
#include
#include
char s[6];
char s2[6];
int len;
void move(int hold, char *curr, char *cend);
void findc(char *curr, char *cend) {
int i;
for (i = 0; i < len; i++) {
if (s[i]) {
int hold = s[i];
s[i] = 0;
move(hold, curr, cend);
s[i] = hold;
}
}
}
void move(int hold, char *curr, char *cend) {
static int first = 1;
*curr++ = hold;
if (curr == cend) {
if (first)
first = 0;
else
printf(" ");
printf("%s", s2);
}
else
findc(curr, cend);
}
main()
{
fgets(s, sizeof(s), stdin);
if (s[strlen(s) - 1] == 'n')
s[strlen(s) - 1] = 0;
len = strlen(s);
findc(s2, s2 + len);
}