#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 *, long);
int main(int argc, char *argv[]) {
  long range = 0;
  long largest = 0;
  long limit = 1000000;
  long number = 0;
  long a;
  printf("yes %ld", range);
  for (long i = 0; i < limit; i++) {
    number = i;
    a = i;
    while (a != 1) {
      if (a % 2 == 0) {
        a = a / 2;
        range++;
      } else {
        a = (3 * a) + 1;
      }
      if (range > largest) {
        largest = number;
      }
    }
  }
  printf("%ld", number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0xf4240,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1200 <main+0xf0>
mov    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x1,-0x38(%rbp)
je     11ea <main+0xda>
mov    -0x38(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11c2 <main+0xb2>
mov    -0x38(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11cf <main+0xbf>
imul   $0x3,-0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    11e5 <main+0xd5>
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117c <main+0x6c>
jmp    11ef <main+0xdf>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    115e <main+0x4e>
mov    -0x30(%rbp),%rsi
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"yes %ld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 0)
unreachable
}