#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 */
unsigned long int divisorCount(unsigned long int n) {
  unsigned long int divisorCount = 2;
  for (size_t i = 2; i <= n / 2; i++) {
    if (n % i == 0) {
      divisorCount += 1;
    }
  }
  return divisorCount;
}


x86 assembly (clang, -O0):
<divisorCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
cmp    %rcx,%rax
ja     1165 <divisorCount+0x65>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    114f <divisorCount+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <divisorCount+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <divisorCount+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisorCount>:
mov    $0x2,%ecx
cmp    $0x4,%rdi
jb     11e7 <divisorCount+0xe7>
mov    %rdi,%r10
mov    %rdi,%rax
shr    %rax
lea    -0x1(%rax),%r8
cmp    $0x2,%rax
jne    1153 <divisorCount+0x53>
mov    $0x2,%esi
mov    $0x2,%ecx
test   $0x1,%r8b
je     11e7 <divisorCount+0xe7>
mov    %r10,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     11d8 <divisorCount+0xd8>
mov    %r10,%rax
xor    %edx,%edx
div    %rsi
jmp    11df <divisorCount+0xdf>
mov    %r8,%r9
and    $0xfffffffffffffffe,%r9
neg    %r9
mov    $0x2,%esi
mov    $0x2,%ecx
jmp    1192 <divisorCount+0x92>
nopl   0x0(%rax)
mov    %r10,%rax
xor    %edx,%edx
div    %rdi
cmp    $0x1,%rdx
adc    $0x0,%rcx
lea    (%r9,%rsi,1),%rax
add    $0x2,%rax
add    $0x2,%rsi
cmp    $0x2,%rax
je     112c <divisorCount+0x2c>
mov    %r10,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     11b0 <divisorCount+0xb0>
mov    %r10,%rax
xor    %edx,%edx
div    %rsi
jmp    11b7 <divisorCount+0xb7>
nopl   0x0(%rax,%rax,1)
mov    %r10d,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
adc    $0x0,%rcx
lea    0x1(%rsi),%rdi
mov    %r10,%rax
or     %rdi,%rax
shr    $0x20,%rax
jne    1170 <divisorCount+0x70>
mov    %r10d,%eax
xor    %edx,%edx
div    %edi
jmp    1178 <divisorCount+0x78>
mov    %r10d,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
adc    $0x0,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @divisorCount(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 2, i64* %3
store i64 2, i64* %4
br label %5
5: ; preds = %19, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = udiv i64 %7, 2
%9 = icmp ule i64 %6, %8
br i1 %9, label %10, label %22
10: ; preds = %5
%11 = load i64, i64* %2
%12 = load i64, i64* %4
%13 = urem i64 %11, %12
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i64, i64* %3
%17 = add i64 %16, 1
store i64 %17, i64* %3
br label %18
18: ; preds = %15, %10
br label %19
19: ; preds = %18
%20 = load i64, i64* %4
%21 = add i64 %20, 1
store i64 %21, i64* %4
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @divisorCount(i64 %0) {
%2 = icmp ult i64 %0, 4
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = lshr i64 %0, 1
%5 = add nsw i64 %4, -1
%6 = and i64 %5, 1
%7 = icmp eq i64 %4, 2
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = and i64 %5, -2
br label %22
10: ; preds = %22, %3
%11 = phi i64 [ undef, %3 ], [ %34, %22 ]
%12 = phi i64 [ 2, %3 ], [ %35, %22 ]
%13 = phi i64 [ 2, %3 ], [ %34, %22 ]
%14 = icmp eq i64 %6, 0
br i1 %14, label %20, label %15
15: ; preds = %10
%16 = urem i64 %0, %12
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i64
%19 = add i64 %13, %18
br label %20
20: ; preds = %15, %10, %1
%21 = phi i64 [ 2, %1 ], [ %11, %10 ], [ %19, %15 ]
ret i64 %21
22: ; preds = %22, %8
%23 = phi i64 [ 2, %8 ], [ %35, %22 ]
%24 = phi i64 [ 2, %8 ], [ %34, %22 ]
%25 = phi i64 [ 0, %8 ], [ %36, %22 ]
%26 = urem i64 %0, %23
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i64
%29 = add i64 %24, %28
%30 = or i64 %23, 1
%31 = urem i64 %0, %30
%32 = icmp eq i64 %31, 0
%33 = zext i1 %32 to i64
%34 = add i64 %29, %33
%35 = add nuw i64 %23, 2
%36 = add i64 %25, 2
%37 = icmp eq i64 %36, %9
br i1 %37, label %10, label %22
}