#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 *, ...);
void oneness(int startPoint, int endPoint) {
  int stepsTo1 = 0;
  int newLnCounter = 0;
  int updatedStartPoint = startPoint;
  while (startPoint <= endPoint) {
    if (updatedStartPoint % 2 == 0) {
      updatedStartPoint = updatedStartPoint / 2;
      stepsTo1++;
      if (updatedStartPoint == 1) {
        printf("%5d:%-5d", startPoint, stepsTo1);
        newLnCounter++;
        if (newLnCounter == 7) {
          printf("\n");
          newLnCounter = 0;
        }
        startPoint++;
        stepsTo1 = 0;
        updatedStartPoint = startPoint;
      }
    } else {
      updatedStartPoint = 3 * updatedStartPoint + 1;
      stepsTo1++;
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<oneness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e2 <oneness+0xd2>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ca <oneness+0xba>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11c5 <oneness+0xb5>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jne    11af <oneness+0x9f>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11dd <oneness+0xcd>
imul   $0x3,-0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <oneness+0x22>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oneness>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jle    113f <oneness+0x1f>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
mov    %esi,%ebx
lea    0xeb8(%rip),%r14
xor    %r15d,%r15d
xor    %edx,%edx
mov    %edi,%ebp
jmp    116d <oneness+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
add    $0x1,%edx
cmp    %ebx,%ebp
jg     112b <oneness+0xb>
test   $0x1,%dil
jne    1160 <oneness+0x40>
add    $0x1,%edx
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0x2,%eax
jne    11b0 <oneness+0x90>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
cmp    $0x7,%r15d
jne    11a3 <oneness+0x83>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %r15d,%r15d
add    $0x1,%ebp
xor    %edx,%edx
mov    %ebp,%edi
jmp    1169 <oneness+0x49>
nopl   0x0(%rax)
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
mov    %eax,%edi
jmp    1169 <oneness+0x49>

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

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