#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 num_factors(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 100000; i < 200000; ++i) {
    int n0 = num_factors(i);
    int n1 = num_factors(i + 1);
    int n2 = num_factors(i + 2);
    int n3 = num_factors(i + 3);
    if (n0 == 4 && n1 == 4 && n2 == 4 && n3 == 4) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x186a0,-0x14(%rbp)
cmpl   $0x30d40,-0x14(%rbp)
jge    11c9 <main+0xa9>
mov    -0x14(%rbp),%edi
call   1040 <num_factors@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <num_factors@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
add    $0x2,%edi
call   1040 <num_factors@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
add    $0x3,%edi
call   1040 <num_factors@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x4,-0x18(%rbp)
jne    11b6 <main+0x96>
cmpl   $0x4,-0x1c(%rbp)
jne    11b6 <main+0x96>
cmpl   $0x4,-0x20(%rbp)
jne    11b6 <main+0x96>
cmpl   $0x4,-0x24(%rbp)
jne    11b6 <main+0x96>
mov    -0x14(%rbp),%esi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <main+0x9b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x186a0,%ebp
lea    0xec9(%rip),%r14
jmp    1148 <main+0x28>
nopl   0x0(%rax)
cmp    $0x30d40,%ebp
je     1197 <main+0x77>
mov    %ebp,%ebx
mov    %ebp,%edi
call   1040 <num_factors@plt>
mov    %eax,%r13d
lea    0x1(%rbx),%ebp
mov    %ebp,%edi
call   1040 <num_factors@plt>
mov    %eax,%r15d
lea    0x2(%rbx),%edi
call   1040 <num_factors@plt>
mov    %eax,%r12d
lea    0x3(%rbx),%edi
call   1040 <num_factors@plt>
cmp    $0x4,%r13d
jne    1140 <main+0x20>
cmp    $0x4,%r15d
jne    1140 <main+0x20>
cmp    $0x4,%r12d
jne    1140 <main+0x20>
cmp    $0x4,%eax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %21
%4 = phi i32 [ 100000, %2 ], [ %6, %21 ]
%5 = tail call i32 @num_factors(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 @num_factors(i32 %6)
%8 = add nuw nsw i32 %4, 2
%9 = tail call i32 @num_factors(i32 %8)
%10 = add nuw nsw i32 %4, 3
%11 = tail call i32 @num_factors(i32 %10)
%12 = icmp eq i32 %5, 4
%13 = icmp eq i32 %7, 4
%14 = select i1 %12, i1 %13, i1 false
%15 = icmp eq i32 %9, 4
%16 = select i1 %14, i1 %15, i1 false
%17 = icmp eq i32 %11, 4
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %21
21: ; preds = %19, %3
%22 = icmp eq i32 %6, 200000
br i1 %22, label %23, label %3
23: ; preds = %21
ret i32 0
}