#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 /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  int flag = 0;
  scanf("%d", &number);
  while (number != 0) {
    if (number % 2 != 0 && (number / 2) % 2 != 0) {
      flag = 1;
      break;
    }
    number = number >> 1;
  }
  if (!flag) {
    printf("Sparse number \n");
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     119a <main+0x7a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     118c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     118c <main+0x6c>
movl   $0x1,-0xc(%rbp)
jmp    119a <main+0x7a>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
cmpl   $0x0,-0xc(%rbp)
jne    11b0 <main+0x90>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    115f <main+0x3f>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
jmp    1170 <main+0x50>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ecx
sar    %ecx
mov    %ecx,0x4(%rsp)
cmp    $0x1,%eax
mov    %ecx,%eax
jbe    113a <main+0x1a>
test   $0x1,%al
je     1150 <main+0x30>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
bt     $0x1,%ecx
jae    1150 <main+0x30>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"Sparse number \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 2
%15 = srem i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 1, i32* %3
br label %21
18: ; preds = %12, %8
%19 = load i32, i32* %2
%20 = ashr i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %17, %5
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
ret i32 1
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [15 x i8] c"Sparse number \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %0, %14
%7 = phi i32 [ %15, %14 ], [ %4, %0 ]
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = sdiv i32 %7, 2
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %10, %6
%15 = ashr i32 %7, 1
store i32 %15, i32* %1
%16 = icmp ult i32 %7, 2
br i1 %16, label %17, label %6
17: ; preds = %14, %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %19
19: ; preds = %10, %17
ret i32 1
}