#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 */
scalar_t__ isPrime(unsigned int);
int isSquare(unsigned int);
unsigned int pow(int, int);
unsigned int divisible(unsigned int number) {
  int temp, i = 1, j = 2, result = 1;
  if (number == 1)
    return 1;
  if (isPrime(number))
    return 2;
  if (temp == isSquare(number) != 0)
    return temp + 1;
  while (number != 1) {
    temp = pow(j, i);
    if (number % temp == 0)
      i++;
    else {
      result *= i;
      --i;
      number /= pow(j, i);
      i = 1;
      ++j;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<divisible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1166 <divisible+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1239 <divisible+0x109>
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%rax
je     1184 <divisible+0x54>
movl   $0x2,-0x4(%rbp)
jmp    1239 <divisible+0x109>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <isSquare@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     11b8 <divisible+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1239 <divisible+0x109>
jmp    11bd <divisible+0x8d>
cmpl   $0x1,-0x8(%rbp)
je     1233 <divisible+0x103>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    11f4 <divisible+0xc4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    122e <divisible+0xfe>
mov    -0x10(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bd <divisible+0x8d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisible>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x1,%edi
je     1154 <divisible+0x24>
mov    %edi,%ebx
call   1030 <isPrime@plt>
mov    $0x2,%r14d
test   %rax,%rax
je     1162 <divisible+0x32>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebx,%edi
call   1050 <isSquare@plt>
mov    $0x2,%r15d
mov    $0x1,%r14d
mov    $0x1,%ebp
jmp    11a9 <divisible+0x79>
nopl   0x0(%rax)
imul   %ebp,%r14d
add    $0xffffffff,%ebp
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
add    $0x1,%r15d
mov    $0x1,%ebp
mov    %eax,%ebx
cmp    $0x1,%ebx
je     1154 <divisible+0x24>
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
jne    1180 <divisible+0x50>
add    $0x1,%ebp
cmp    $0x1,%ebx
jne    11a9 <divisible+0x79>
jmp    1154 <divisible+0x24>

LLVM IR (-O0):
define i32 @divisible(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %5
store i32 2, i32* %6
store i32 1, i32* %7
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %57
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i64 @isPrime(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 2, i32* %2
br label %57
16: ; preds = %11
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = call i32 @isSquare(i32 %18)
%20 = icmp eq i32 %17, %19
%21 = zext i1 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %57
26: ; preds = %16
br label %27
27: ; preds = %54, %26
%28 = load i32, i32* %3
%29 = icmp ne i32 %28, 1
br i1 %29, label %30, label %55
30: ; preds = %27
%31 = load i32, i32* %6
%32 = load i32, i32* %5
%33 = call i32 @pow(i32 %31, i32 %32)
store i32 %33, i32* %4
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = urem i32 %34, %35
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %54
41: ; preds = %30
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = mul nsw i32 %43, %42
store i32 %44, i32* %7
%45 = load i32, i32* %5
%46 = add nsw i32 %45, -1
store i32 %46, i32* %5
%47 = load i32, i32* %6
%48 = load i32, i32* %5
%49 = call i32 @pow(i32 %47, i32 %48)
%50 = load i32, i32* %3
%51 = udiv i32 %50, %49
store i32 %51, i32* %3
store i32 1, i32* %5
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %54
54: ; preds = %41, %38
br label %27
55: ; preds = %27
%56 = load i32, i32* %7
store i32 %56, i32* %2
br label %57
57: ; preds = %55, %23, %15, %10
%58 = load i32, i32* %2
ret i32 %58
}

LLVM IR (-O2):
define i32 @divisible(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %30, label %3
3: ; preds = %1
%4 = tail call i64 @isPrime(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %3
%7 = tail call i32 @isSquare(i32 %0)
br label %8
8: ; preds = %6, %24
%9 = phi i32 [ %28, %24 ], [ 1, %6 ]
%10 = phi i32 [ %27, %24 ], [ 2, %6 ]
%11 = phi i32 [ %26, %24 ], [ 1, %6 ]
%12 = phi i32 [ %25, %24 ], [ %0, %6 ]
%13 = tail call i32 @pow(i32 %10, i32 %11)
%14 = urem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = add nsw i32 %11, 1
br label %24
18: ; preds = %8
%19 = mul nsw i32 %9, %11
%20 = add nsw i32 %11, -1
%21 = tail call i32 @pow(i32 %10, i32 %20)
%22 = udiv i32 %12, %21
%23 = add nsw i32 %10, 1
br label %24
24: ; preds = %18, %16
%25 = phi i32 [ %12, %16 ], [ %22, %18 ]
%26 = phi i32 [ %17, %16 ], [ 1, %18 ]
%27 = phi i32 [ %10, %16 ], [ %23, %18 ]
%28 = phi i32 [ %9, %16 ], [ %19, %18 ]
%29 = icmp eq i32 %25, 1
br i1 %29, label %30, label %8
30: ; preds = %24, %3, %1
%31 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %28, %24 ]
ret i32 %31
}