#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);
void main() {
  int i, m, j, k, count;
  for (i = 4; i < 10000; i += 4) {
    count = 0;
    m = i;
    for (k = 0; k < 5; k++) {
      j = i / 4 * 5 + 1;
      i = j;
      if (j % 4 == 0)
        count++;
      else
        break;
    }
    i = m;
    if (count == 4) {
      printf("%d\n", count);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    11d5 <main+0xc5>
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    119e <main+0x8e>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
imul   $0x5,%eax,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1186 <main+0x76>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118b <main+0x7b>
jmp    119e <main+0x8e>
jmp    1190 <main+0x80>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <main+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x4,-0x14(%rbp)
jne    11c2 <main+0xb2>
mov    -0x14(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    11d5 <main+0xc5>
jmp    11c7 <main+0xb7>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%eax
xor    %ecx,%ecx
jmp    112e <main+0x1e>
nopl   0x0(%rax)
add    $0x5,%eax
add    $0x4,%ecx
cmp    $0x270b,%ecx
ja     117d <main+0x6d>
test   $0x3,%al
jne    1120 <main+0x10>
mov    %eax,%edx
shr    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
add    $0x1,%edx
test   $0x3,%dl
jne    1120 <main+0x10>
shr    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
add    $0x1,%edx
test   $0x3,%dl
jne    1120 <main+0x10>
shr    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
add    $0x1,%edx
test   $0x3,%dl
jne    1120 <main+0x10>
shr    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
add    $0x1,%edx
test   $0x3,%dl
je     1120 <main+0x10>
lea    0xe8d(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
br label %4
1: ; preds = %29, %23, %17, %11, %4
%2 = add nuw nsw i32 %5, 4
%3 = icmp ult i32 %5, 9996
br i1 %3, label %4, label %37
4: ; preds = %0, %1
%5 = phi i32 [ 4, %0 ], [ %2, %1 ]
%6 = lshr exact i32 %5, 2
%7 = mul nuw nsw i32 %6, 5
%8 = add nuw nsw i32 %7, 1
%9 = and i32 %8, 3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %1
11: ; preds = %4
%12 = lshr i32 %8, 2
%13 = mul nuw nsw i32 %12, 5
%14 = add nuw nsw i32 %13, 1
%15 = and i32 %14, 3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %1
17: ; preds = %11
%18 = lshr i32 %14, 2
%19 = mul nuw nsw i32 %18, 5
%20 = add nuw nsw i32 %19, 1
%21 = and i32 %20, 3
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %1
23: ; preds = %17
%24 = lshr i32 %20, 2
%25 = mul nuw nsw i32 %24, 5
%26 = add nuw nsw i32 %25, 1
%27 = and i32 %26, 3
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %1
29: ; preds = %23
%30 = lshr i32 %26, 2
%31 = mul nuw nsw i32 %30, 5
%32 = add nuw nsw i32 %31, 1
%33 = and i32 %32, 3
%34 = icmp eq i32 %33, 0
br i1 %34, label %1, label %35
35: ; preds = %29
%36 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
br label %37
37: ; preds = %1, %35
ret void
}