#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ assertError(int /*<<< orphan*/, unsigned long const);
int /*<<< orphan*/ assertFalse(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ assertTrue(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ ispowerful(unsigned long const);
int /*<<< orphan*/ puts(char *);
int main(void) {
  unsigned long int powerful[] = {1,
                                  4,
                                  8,
                                  9,
                                  16,
                                  25,
                                  27,
                                  32,
                                  36,
                                  49,
                                  64,
                                  72,
                                  81,
                                  100,
                                  108,
                                  121,
                                  125,
                                  128,
                                  144,
                                  169,
                                  196,
                                  200,
                                  216,
                                  225,
                                  243,
                                  256,
                                  288,
                                  289,
                                  324,
                                  343,
                                  361,
                                  392,
                                  400,
                                  432,
                                  441,
                                  484,
                                  500,
                                  512,
                                  529,
                                  576,
                                  625,
                                  648,
                                  675,
                                  676,
                                  729,
                                  784,
                                  800,
                                  841,
                                  864,
                                  900,
                                  961,
                                  968,
                                  972,
                                  1000,
                                  32,
                                  841,
                                  961,
                                  972,
                                  1024,
                                  1521,
                                  2312,
                                  2744,
                                  2916,
                                  3087,
                                  4900,
                                  5408,
                                  8000,
                                  10976,
                                  13068,
                                  13824,
                                  15876,
                                  17956,
                                  18000,
                                  19600,
                                  19881,
                                  21600,
                                  25088,
                                  26244,
                                  27556,
                                  30375,
                                  2 * 2,
                                  3 * 3,
                                  5 * 5,
                                  7 * 7,
                                  101 * 101,
                                  2 * 2 * 3 * 3 * 5 * 5,
                                  2 * 2 * 3 * 3 * 5 * 5 * 7 * 7,
                                  2 * 2 * 2,
                                  3 * 3 * 3,
                                  5 * 5 * 5,
                                  7 * 7 * 7,
                                  101 * 101 * 101,
                                  2 * 2 * 2 * 3 * 3 * 7 * 7,
                                  2 * 2 * 2 * 3 * 3 * 7 * 7 * 11 * 11,
                                  2 * 2 * 2 * 2 * 2,
                                  3 * 3 * 3 * 3 * 3,
                                  5 * 5 * 5 * 5 * 5,
                                  11 * 11,
                                  13 * 13,
                                  17 * 17,
                                  3 * 3 * 7 * 7 * 13 * 13,
                                  227 * 227,
                                  229 * 229};
  unsigned long int notpowerful[] = {2,
                                     3,
                                     5,
                                     7,
                                     11,
                                     13,
                                     17,
                                     19,
                                     23,
                                     29,
                                     31,
                                     37,
                                     41,
                                     43,
                                     47,
                                     53,
                                     59,
                                     61,
                                     67,
                                     71,
                                     73,
                                     79,
                                     83,
                                     89,
                                     97,
                                     101,
                                     103,
                                     107,
                                     109,
                                     113,
                                     127,
                                     131,
                                     137,
                                     139,
                                     149,
                                     151,
                                     157,
                                     163,
                                     167,
                                     173,
                                     179,
                                     181,
                                     191,
                                     193,
                                     197,
                                     199,
                                     211,
                                     223,
                                     227,
                                     229,
                                     233,
                                     239,
                                     241,
                                     251,
                                     257,
                                     263,
                                     269,
                                     271,
                                     279,
                                     2 * 3 * 5 * 7 * 11,
                                     2 * 3 * 5 * 7 * 11 * 11,
                                     2 * 2 * 2 * 3 * 3 * 7 * 11 * 11,
                                     2 * 2 * 2 * 3 * 3 * 7 * 7 * 11,
                                     3 * 3 * 7 * 7 * 13 * 13 * 19,
                                     43 * 43 * 47 * 83 * 83,
                                     229 * 229 * 233};
  const unsigned long int invalid = 0;
  int i, size;
  size = sizeof powerful / sizeof *powerful;
  for (i = 0; i < size; ++i) {
    assertTrue(ispowerful(powerful[i]), powerful[i]);
  }
  size = sizeof notpowerful / sizeof *notpowerful;
  for (i = 0; i < size; ++i) {
    assertFalse(ispowerful(notpowerful[i]), notpowerful[i]);
  }
  assertError(ispowerful(invalid), invalid);
  puts("TESTS PASSED");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x560,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x340(%rbp),%rdi
lea    0xe80(%rip),%rsi
mov    $0x338,%edx
call   1080 <memcpy@plt>
lea    -0x550(%rbp),%rdi
lea    0x11a8(%rip),%rsi
mov    $0x210,%edx
call   1080 <memcpy@plt>
movq   $0x0,-0x558(%rbp)
movl   $0x67,-0x560(%rbp)
movl   $0x0,-0x55c(%rbp)
mov    -0x55c(%rbp),%eax
cmp    -0x560(%rbp),%eax
jge    1211 <main+0xb1>
movslq -0x55c(%rbp),%rax
mov    -0x340(%rbp,%rax,8),%rdi
ff
call   1030 <ispowerful@plt>
mov    %eax,%edi
movslq -0x55c(%rbp),%rax
mov    -0x340(%rbp,%rax,8),%rsi
ff
call   1070 <assertTrue@plt>
mov    -0x55c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x55c(%rbp)
jmp    11c1 <main+0x61>
movl   $0x42,-0x560(%rbp)
movl   $0x0,-0x55c(%rbp)
mov    -0x55c(%rbp),%eax
cmp    -0x560(%rbp),%eax
jge    1275 <main+0x115>
movslq -0x55c(%rbp),%rax
mov    -0x550(%rbp,%rax,8),%rdi
ff
call   1030 <ispowerful@plt>
mov    %eax,%edi
movslq -0x55c(%rbp),%rax
mov    -0x550(%rbp,%rax,8),%rsi
ff
call   1050 <assertFalse@plt>
mov    -0x55c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x55c(%rbp)
jmp    1225 <main+0xc5>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ispowerful@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <assertError@plt>
lea    0x12c0(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%eax
add    $0x560,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xea2(%rip),%r15
xchg   %ax,%ax
mov    (%rbx,%r15,1),%r14
mov    %r14,%rdi
call   1030 <ispowerful@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1070 <assertTrue@plt>
add    $0x8,%rbx
cmp    $0x338,%rbx
jne    1160 <main+0x10>
xor    %ebx,%ebx
lea    0x11b4(%rip),%r15
nopl   0x0(%rax)
mov    (%rbx,%r15,1),%r14
mov    %r14,%rdi
call   1030 <ispowerful@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <assertFalse@plt>
add    $0x8,%rbx
cmp    $0x210,%rbx
jne    1190 <main+0x40>
xor    %edi,%edi
call   1030 <ispowerful@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1060 <assertError@plt>
lea    0x1386(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.powerful = [103 x i64] [i64 1, i64 4, i64 8, i64 9, i64 16, i64 25, i64 27, i64 32, i64 36, i64 49, i64 64, i64 72, i64 81, i64 100, i64 108, i64 121, i64 125, i64 128, i64 144, i64 169, i64 196, i64 200, i64 216, i64 225, i64 243, i64 256, i64 288, i64 289, i64 324, i64 343, i64 361, i64 392, i64 400, i64 432, i64 441, i64 484, i64 500, i64 512, i64 529, i64 576, i64 625, i64 648, i64 675, i64 676, i64 729, i64 784, i64 800, i64 841, i64 864, i64 900, i64 961, i64 968, i64 972, i64 1000, i64 32, i64 841, i64 961, i64 972, i64 1024, i64 1521, i64 2312, i64 2744, i64 2916, i64 3087, i64 4900, i64 5408, i64 8000, i64 10976, i64 13068, i64 13824, i64 15876, i64 17956, i64 18000, i64 19600, i64 19881, i64 21600, i64 25088, i64 26244, i64 27556, i64 30375, i64 4, i64 9, i64 25, i64 49, i64 10201, i64 900, i64 44100, i64 8, i64 27, i64 125, i64 343, i64 1030301, i64 3528, i64 426888, i64 32, i64 243, i64 3125, i64 121, i64 169, i64 289, i64 74529, i64 51529, i64 52441]
@__const.main.notpowerful = [66 x i64] [i64 2, i64 3, i64 5, i64 7, i64 11, i64 13, i64 17, i64 19, i64 23, i64 29, i64 31, i64 37, i64 41, i64 43, i64 47, i64 53, i64 59, i64 61, i64 67, i64 71, i64 73, i64 79, i64 83, i64 89, i64 97, i64 101, i64 103, i64 107, i64 109, i64 113, i64 127, i64 131, i64 137, i64 139, i64 149, i64 151, i64 157, i64 163, i64 167, i64 173, i64 179, i64 181, i64 191, i64 193, i64 197, i64 199, i64 211, i64 223, i64 227, i64 229, i64 233, i64 239, i64 241, i64 251, i64 257, i64 263, i64 269, i64 271, i64 279, i64 2310, i64 25410, i64 60984, i64 38808, i64 1416051, i64 598674767, i64 12218753]
@.str = [13 x i8] c"TESTS PASSED\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [103 x i64]
%3 = alloca [66 x i64]
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [103 x i64]* %2 to i8*
%8 = bitcast [66 x i64]* %3 to i8*
store i64 0, i64* %4
store i32 103, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %24, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [103 x i64], [103 x i64]* %2, i64 0, i64 %15
%17 = load i64, i64* %16
%18 = call i32 @ispowerful(i64 %17)
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [103 x i64], [103 x i64]* %2, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = call i32 @assertTrue(i32 %18, i64 %22)
br label %24
24: ; preds = %13
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %9
27: ; preds = %9
store i32 66, i32* %6
store i32 0, i32* %5
br label %28
28: ; preds = %43, %27
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %46
32: ; preds = %28
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [66 x i64], [66 x i64]* %3, i64 0, i64 %34
%36 = load i64, i64* %35
%37 = call i32 @ispowerful(i64 %36)
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [66 x i64], [66 x i64]* %3, i64 0, i64 %39
%41 = load i64, i64* %40
%42 = call i32 @assertFalse(i32 %37, i64 %41)
br label %43
43: ; preds = %32
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %28
46: ; preds = %28
%47 = call i32 @ispowerful(i64 0)
%48 = call i32 @assertError(i32 %47, i64 0)
%49 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%50 = load i32, i32* @EXIT_SUCCESS
ret i32 %50
}

LLVM IR (-O2):
@__const.main.powerful = [103 x i64] [i64 1, i64 4, i64 8, i64 9, i64 16, i64 25, i64 27, i64 32, i64 36, i64 49, i64 64, i64 72, i64 81, i64 100, i64 108, i64 121, i64 125, i64 128, i64 144, i64 169, i64 196, i64 200, i64 216, i64 225, i64 243, i64 256, i64 288, i64 289, i64 324, i64 343, i64 361, i64 392, i64 400, i64 432, i64 441, i64 484, i64 500, i64 512, i64 529, i64 576, i64 625, i64 648, i64 675, i64 676, i64 729, i64 784, i64 800, i64 841, i64 864, i64 900, i64 961, i64 968, i64 972, i64 1000, i64 32, i64 841, i64 961, i64 972, i64 1024, i64 1521, i64 2312, i64 2744, i64 2916, i64 3087, i64 4900, i64 5408, i64 8000, i64 10976, i64 13068, i64 13824, i64 15876, i64 17956, i64 18000, i64 19600, i64 19881, i64 21600, i64 25088, i64 26244, i64 27556, i64 30375, i64 4, i64 9, i64 25, i64 49, i64 10201, i64 900, i64 44100, i64 8, i64 27, i64 125, i64 343, i64 1030301, i64 3528, i64 426888, i64 32, i64 243, i64 3125, i64 121, i64 169, i64 289, i64 74529, i64 51529, i64 52441]
@__const.main.notpowerful = [66 x i64] [i64 2, i64 3, i64 5, i64 7, i64 11, i64 13, i64 17, i64 19, i64 23, i64 29, i64 31, i64 37, i64 41, i64 43, i64 47, i64 53, i64 59, i64 61, i64 67, i64 71, i64 73, i64 79, i64 83, i64 89, i64 97, i64 101, i64 103, i64 107, i64 109, i64 113, i64 127, i64 131, i64 137, i64 139, i64 149, i64 151, i64 157, i64 163, i64 167, i64 173, i64 179, i64 181, i64 191, i64 193, i64 197, i64 199, i64 211, i64 223, i64 227, i64 229, i64 233, i64 239, i64 241, i64 251, i64 257, i64 263, i64 269, i64 271, i64 279, i64 2310, i64 25410, i64 60984, i64 38808, i64 1416051, i64 598674767, i64 12218753]
@.str = [13 x i8] c"TESTS PASSED\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = getelementptr inbounds [103 x i64], [103 x i64]* @__const.main.powerful, i64 0, i64 %2
%4 = load i64, i64* %3
%5 = tail call i32 @ispowerful(i64 %4)
%6 = tail call i32 @assertTrue(i32 %5, i64 %4)
%7 = add nuw nsw i64 %2, 1
%8 = icmp eq i64 %7, 103
br i1 %8, label %9, label %1
9: ; preds = %1, %9
%10 = phi i64 [ %15, %9 ], [ 0, %1 ]
%11 = getelementptr inbounds [66 x i64], [66 x i64]* @__const.main.notpowerful, i64 0, i64 %10
%12 = load i64, i64* %11
%13 = tail call i32 @ispowerful(i64 %12)
%14 = tail call i32 @assertFalse(i32 %13, i64 %12)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, 66
br i1 %16, label %17, label %9
17: ; preds = %9
%18 = tail call i32 @ispowerful(i64 0)
%19 = tail call i32 @assertError(i32 %18, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}