#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 isArm(int);
int isEven(int);
int isOdd(int);
int isPSquare(int);
int isPallin(int);
int isPrime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
void special(int a) {
  int number = a;
  int a1, a2, a3, a4, a5, a6;
  int count = 6;
  char special[100];
  printf("%s\n", "Number you entered has something special !!");
  int arrs[6];
  a1 = isPrime(number);
  arrs[0] = a1;
  a2 = isPSquare(number);
  arrs[1] = a2;
  a3 = isArm(number);
  arrs[2] = a3;
  a4 = isPallin(number);
  arrs[3] = a4;
  a5 = isEven(number);
  arrs[4] = a5;
  a6 = isOdd(number);
  arrs[5] = a6;
  for (int i = 0; i < count; i++) {
    if (arrs[i] == 0) {
      switch (i) {
      case '0':
        strcat(special, " prime ");
        break;
      case '1':
        strcat(special, " perfect square ");
        break;
      case '2':
        strcat(special, " armstrong no ");
        break;
      case '3':
        strcat(special, " palindrome ");
        break;
      case '4':
        strcat(special, " even ");
        break;
      case '5':
        strcat(special, " odd ");
        break;
      }
      printf("Number %d is-%s \n", number, special);
    }
  }
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x6,-0x24(%rbp)
lea    0xe76(%rip),%rdi
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1080 <isPrime@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <isPSquare@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isArm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isPallin@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x8(%rbp),%edi
call   1090 <isEven@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <isOdd@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x9c(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1344 <special+0x1c4>
movslq -0xb4(%rbp),%rax
cmpl   $0x0,-0xb0(%rbp,%rax,4)
jne    132b <special+0x1ab>
mov    -0xb4(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0xc0(%rbp)
sub    $0x5,%eax
ja     1313 <special+0x193>
mov    -0xc0(%rbp),%rax
lea    0xd81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x90(%rbp),%rdi
lea    0xdb2(%rip),%rsi
call   10a0 <strcat@plt>
jmp    1313 <special+0x193>
lea    -0x90(%rbp),%rdi
lea    0xda2(%rip),%rsi
call   10a0 <strcat@plt>
jmp    1313 <special+0x193>
lea    -0x90(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   10a0 <strcat@plt>
jmp    1313 <special+0x193>
lea    -0x90(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   10a0 <strcat@plt>
jmp    1313 <special+0x193>
lea    -0x90(%rbp),%rdi
lea    0xd87(%rip),%rsi
call   10a0 <strcat@plt>
jmp    1313 <special+0x193>
lea    -0x90(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x8(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1330 <special+0x1b0>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1232 <special+0xb2>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edi,%ebx
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1090 <isPrime@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1080 <isPSquare@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <isArm@plt>
mov    %eax,%r13d
mov    %ebx,%edi
call   1030 <isPallin@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   10a0 <isEven@plt>
mov    %eax,%r15d
mov    %ebx,%edi
call   1070 <isOdd@plt>
mov    %eax,0xc(%rsp)
test   %r14d,%r14d
je     120e <special+0x8e>
test   %ebp,%ebp
je     1227 <special+0xa7>
test   %r13d,%r13d
je     1241 <special+0xc1>
test   %r12d,%r12d
je     125b <special+0xdb>
test   %r15d,%r15d
je     1279 <special+0xf9>
cmpl   $0x0,0xc(%rsp)
je     1299 <special+0x119>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe17(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebp,%ebp
jne    11e1 <special+0x61>
lea    0xdfe(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r13d,%r13d
jne    11e6 <special+0x66>
lea    0xde4(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r12d,%r12d
jne    11eb <special+0x6b>
lea    0xdca(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r15d,%r15d
jne    11f4 <special+0x74>
lea    0xdac(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jne    11ff <special+0x7f>
lea    0xd8c(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11ff <special+0x7f>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"Number you entered has something special !!\00"
@.str.2 = [8 x i8] c" prime \00"
@.str.3 = [17 x i8] c" perfect square \00"
@.str.4 = [15 x i8] c" armstrong no \00"
@.str.5 = [13 x i8] c" palindrome \00"
@.str.6 = [7 x i8] c" even \00"
@.str.7 = [6 x i8] c" odd \00"
@.str.8 = [18 x i8] c"Number %d is-%s \0A\00"
define void @special(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [100 x i8]
%12 = alloca [6 x i32]
%13 = alloca i32
store i32 %0, i32* %2
%14 = load i32, i32* %2
store i32 %14, i32* %3
store i32 6, i32* %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = call i32 @isPrime(i32 %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 %18, i32* %19
%20 = load i32, i32* %3
%21 = call i32 @isPSquare(i32 %20)
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 %22, i32* %23
%24 = load i32, i32* %3
%25 = call i32 @isArm(i32 %24)
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 %26, i32* %27
%28 = load i32, i32* %3
%29 = call i32 @isPallin(i32 %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 %30, i32* %31
%32 = load i32, i32* %3
%33 = call i32 @isEven(i32 %32)
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 %34, i32* %35
%36 = load i32, i32* %3
%37 = call i32 @isOdd(i32 %36)
store i32 %37, i32* %9
%38 = load i32, i32* %9
%39 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 %38, i32* %39
store i32 0, i32* %13
br label %40
40: ; preds = %75, %1
%41 = load i32, i32* %13
%42 = load i32, i32* %10
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %78
44: ; preds = %40
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %74
50: ; preds = %44
%51 = load i32, i32* %13
switch i32 %51, label %70 [
i32 48, label %52
i32 49, label %55
i32 50, label %58
i32 51, label %61
i32 52, label %64
i32 53, label %67
]
52: ; preds = %50
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%54 = call i32 @strcat(i8* %53, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %70
55: ; preds = %50
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%57 = call i32 @strcat(i8* %56, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %70
58: ; preds = %50
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%60 = call i32 @strcat(i8* %59, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %70
61: ; preds = %50
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%63 = call i32 @strcat(i8* %62, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %70
64: ; preds = %50
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%66 = call i32 @strcat(i8* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %70
67: ; preds = %50
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%69 = call i32 @strcat(i8* %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %50, %67, %64, %61, %58, %55, %52
%71 = load i32, i32* %3
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %71, i8* %72)
br label %74
74: ; preds = %70, %44
br label %75
75: ; preds = %74
%76 = load i32, i32* %13
%77 = add nsw i32 %76, 1
store i32 %77, i32* %13
br label %40
78: ; preds = %40
ret void
}

LLVM IR (-O2):
@.str.1 = [44 x i8] c"Number you entered has something special !!\00"
@.str.8 = [18 x i8] c"Number %d is-%s \0A\00"
define void @special(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @isPrime(i32 %0)
%6 = tail call i32 @isPSquare(i32 %0)
%7 = tail call i32 @isArm(i32 %0)
%8 = tail call i32 @isPallin(i32 %0)
%9 = tail call i32 @isEven(i32 %0)
%10 = tail call i32 @isOdd(i32 %0)
%11 = icmp eq i32 %5, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %14
14: ; preds = %1, %12
%15 = icmp eq i32 %6, 0
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %18
18: ; preds = %16, %14
%19 = icmp eq i32 %7, 0
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %22
22: ; preds = %20, %18
%23 = icmp eq i32 %8, 0
br i1 %23, label %24, label %26
24: ; preds = %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %26
26: ; preds = %24, %22
%27 = icmp eq i32 %9, 0
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %30
30: ; preds = %28, %26
%31 = icmp eq i32 %10, 0
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %0, i8* %3)
br label %34
34: ; preds = %32, %30
ret void
}