#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 int divisor_count(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  const unsigned int limit = 100;
  unsigned int count = 0;
  unsigned int n;
  printf("The first %d tau numbers are:\n", limit);
  for (n = 1; count < limit; ++n) {
    if (n % divisor_count(n) == 0) {
      printf("%6d", n);
      ++count;
      if (count % 10 == 0) {
        printf("\n");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0x64,-0xc(%rbp)
jae    11d6 <main+0xb6>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <divisor_count@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    11c3 <main+0xa3>
mov    -0x10(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    11be <main+0x9e>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
jmp    11c8 <main+0xa8>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xecc(%rip),%r14
xor    %ebp,%ebp
jmp    1168 <main+0x38>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x64,%ebp
jae    119f <main+0x6f>
mov    %ebx,%edi
call   1050 <divisor_count@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
jne    1160 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
imul   $0xffffffcd,%ebp,%eax
ror    %al
cmp    $0x19,%al
ja     1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"The first %d tau numbers are:\0A\00"
@.str.1 = [4 x i8] c"%6d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 0, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 100)
store i32 1, i32* %4
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 100
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @divisor_count(i32 %11)
%13 = urem i32 %10, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %9
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = add i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = urem i32 %20, 10
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %15
br label %26
26: ; preds = %25, %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add i32 %28, 1
store i32 %29, i32* %4
br label %6
30: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The first %d tau numbers are:\0A\00"
@.str.1 = [4 x i8] c"%6d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 100)
br label %2
2: ; preds = %0, %16
%3 = phi i32 [ 1, %0 ], [ %18, %16 ]
%4 = phi i32 [ 0, %0 ], [ %17, %16 ]
%5 = tail call i32 @divisor_count(i32 %3)
%6 = urem i32 %3, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%10 = add nuw nsw i32 %4, 1
%11 = trunc i32 %10 to i8
%12 = urem i8 %11, 10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 @putchar(i32 10)
br label %16
16: ; preds = %2, %14, %8
%17 = phi i32 [ %10, %14 ], [ %10, %8 ], [ %4, %2 ]
%18 = add i32 %3, 1
%19 = icmp ult i32 %17, 100
br i1 %19, label %2, label %20
20: ; preds = %16
ret i32 0
}