#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 */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int list_size = 20, i;
  for (i = 0; i < list_size; i++)
    printf("%d %s zero or power of two\n", i,
           (!((i) & ((i)-1))) ? "*IS*" : "isn't");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117f <main+0x6f>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %cl
xor    $0xff,%cl
lea    0xeca(%rip),%rdx
lea    0xebe(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xefb(%rip),%r15
lea    0xef9(%rip),%r12
lea    0xed1(%rip),%r14
nop
lea    -0x1(%rbx),%eax
test   %eax,%ebx
mov    %r12,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%d %s zero or power of two\0A\00"
@.str.1 = [5 x i8] c"*IS*\00"
@.str.2 = [6 x i8] c"isn't\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %17)
br label %19
19: ; preds = %8
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"%d %s zero or power of two\0A\00"
@.str.1 = [5 x i8] c"*IS*\00"
@.str.2 = [6 x i8] c"isn't\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 @llvm.ctpop.i32(i32 %2)
%4 = icmp ult i32 %3, 2
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 20
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}