#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 sqrt(int);
int main() {
  int i, n, limit, div = 0;
  printf("Enter the number : ");
  scanf("%d", &n);
  limit = sqrt(n);
  for (i = 1; i <= limit; i++)
    if (n % i == 0) {
      if (i != n / i)
        div = div + 2;
      else
        div++;
    }
  printf("%d\n", div);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1050 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11db <main+0xab>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11c8 <main+0x98>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
je     11ba <main+0x8a>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    11c3 <main+0x93>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c8 <main+0x98>
jmp    11cd <main+0x9d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x46>
mov    -0x14(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <sqrt@plt>
test   %eax,%eax
jle    11a4 <main+0x74>
mov    %eax,%ecx
mov    0xc(%rsp),%esi
neg    %ecx
mov    $0x1,%edi
xor    %ebx,%ebx
jmp    1192 <main+0x62>
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%rcx,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
je     11a4 <main+0x74>
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1180 <main+0x50>
cmp    %eax,%edi
je     1174 <main+0x44>
add    $0x2,%ebx
jmp    1180 <main+0x50>
lea    0xe6c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @sqrt(i32 %8)
store i32 %9, i32* %4
store i32 1, i32* %2
br label %10
10: ; preds = %33, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %14
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = sdiv i32 %21, %22
%24 = icmp ne i32 %20, %23
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 2
store i32 %27, i32* %5
br label %31
28: ; preds = %19
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %10
36: ; preds = %10
%37 = load i32, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter the number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sqrt(i32 %5)
%7 = icmp slt i32 %6, 1
br i1 %7, label %26, label %8
8: ; preds = %0
%9 = load i32, i32* %1
br label %10
10: ; preds = %8, %22
%11 = phi i32 [ 0, %8 ], [ %23, %22 ]
%12 = phi i32 [ 1, %8 ], [ %24, %22 ]
%13 = srem i32 %9, %12
%14 = sdiv i32 %9, %12
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = icmp eq i32 %12, %14
br i1 %17, label %20, label %18
18: ; preds = %16
%19 = add nsw i32 %11, 2
br label %22
20: ; preds = %16
%21 = add nsw i32 %11, 1
br label %22
22: ; preds = %10, %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ], [ %11, %10 ]
%24 = add nuw i32 %12, 1
%25 = icmp eq i32 %12, %6
br i1 %25, label %26, label %10
26: ; preds = %22, %0
%27 = phi i32 [ 0, %0 ], [ %23, %22 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %27)
ret i32 0
}