diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-06-08 17:10:31 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-06-08 17:10:31 +0800 |
| commit | 72af0dedf9e18911da65b9a5c4906689e868d9fc (patch) | |
| tree | 2ecbad93f96ab8ad7e26dc02cd02d802f853ab97 /rcc-legacy/tests/sysy_lvX/091_long_func.sy | |
| parent | 8faf6d290d6703b1775e0ad7a8928a4ebea4b11b (diff) | |
| download | rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.gz rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.xz | |
[legacy] Add functional and performance test suites
Diffstat (limited to 'rcc-legacy/tests/sysy_lvX/091_long_func.sy')
| -rw-r--r-- | rcc-legacy/tests/sysy_lvX/091_long_func.sy | 1382 |
1 files changed, 1382 insertions, 0 deletions
diff --git a/rcc-legacy/tests/sysy_lvX/091_long_func.sy b/rcc-legacy/tests/sysy_lvX/091_long_func.sy new file mode 100644 index 0000000..15cc41d --- /dev/null +++ b/rcc-legacy/tests/sysy_lvX/091_long_func.sy @@ -0,0 +1,1382 @@ +const int SHIFT_TABLE[16] = {1, 2, 4, 8, 16, 32, 64, 128, + 256, 512, 1024, 2048, 4096, 8192, 16384, 32768}; + +int long_func() { + int ans, i, x, y, cur; + { + int pl = 2, pr = 0, pres = 1; + while (pr > 0) { + ans = 0; + i = 0; + x = pr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int ml = pres, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pres = ans; + } + { + int ml = pl, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pl = ans; + x = pr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + pr = ans; + } + ans = pres; + } + putint(ans); + putch(10); + { + int pl = 2, pr = 1, pres = 1; + while (pr > 0) { + ans = 0; + i = 0; + x = pr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int ml = pres, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pres = ans; + } + { + int ml = pl, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pl = ans; + x = pr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + pr = ans; + } + ans = pres; + } + putint(ans); + putch(10); + cur = 2; + while (cur < 16) { + { + int pl = 2, pr = cur, pres = 1; + while (pr > 0) { + ans = 0; + i = 0; + x = pr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int ml = pres, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pres = ans; + } + { + int ml = pl, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pl = ans; + x = pr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + pr = ans; + } + ans = pres; + } + putint(ans); + putch(10); + cur = cur + 1; + } + cur = 0; + while (cur < 16) { + { + int pl = 2, pr = cur, pres = 1; + while (pr > 0) { + ans = 0; + i = 0; + x = pr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int ml = pres, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pres = ans; + } + { + int ml = pl, mr = pl, mres = 0; + while (mr) { + ans = 0; + i = 0; + x = mr; + y = 1; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + if (ans) { + { + int al = mres, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + mres = ans; + } + { + int al = ml, c = ml, sum; + while (c) { + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2) { + if (y % 2 == 0) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + } else if (y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + sum = ans; + ans = 0; + i = 0; + x = al; + y = c; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + c = ans; + if ((1) > 15) { + ans = 0; + } else { + ans = 0; + i = 0; + x = (c)*SHIFT_TABLE[1]; + y = 0xffff; + while (i < 16) { + if (x % 2 && y % 2) { + ans = ans + 1 * SHIFT_TABLE[i]; + } + x = x / 2; + y = y / 2; + i = i + 1; + } + } + c = ans; + al = sum; + } + ans = al; + } + ml = ans; + x = mr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + mr = ans; + } + ans = mres; + } + pl = ans; + x = pr; + y = 1; + if (y >= 15) { + if (x < 0) { + ans = 0xffff; + } else { + ans = 0; + } + } else if (y > 0) { + if (x > 0x7fff) { + x = x / SHIFT_TABLE[y]; + ans = x + 65536 - SHIFT_TABLE[15 - y + 1]; + } else { + ans = x / SHIFT_TABLE[y]; + } + } else { + ans = x; + } + pr = ans; + } + ans = pres; + } + if (SHIFT_TABLE[cur] != ans) return 1; + cur = cur + 1; + } + return 0; +} + +int main() { + return long_func(); +} |
