#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 ICPrintNumbers(int iteration, int startRange, int endRange) {
  if (startRange < endRange) {
    for (int i = startRange; i < endRange; ++i) {
      if (iteration > 20) {
        printf("Cycle was broken \n ");
        break;
      } else if (i % 3 == 0) {
        continue;
      } else if (i == 50) {
        printf("Cycle returned because elmenet = %d\n", i);
        return;
      } else {
        for (int j = 0; j < iteration; ++j) {
          printf("%d", i);
        }
        printf("\n");
      }
    }
  }
}


x86 assembly (clang, -O0):
<ICPrintNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f7 <ICPrintNumbers+0xe7>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f2 <ICPrintNumbers+0xe2>
cmpl   $0x14,-0x4(%rbp)
jle    115c <ICPrintNumbers+0x4c>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <ICPrintNumbers+0xe2>
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1175 <ICPrintNumbers+0x65>
jmp    11e4 <ICPrintNumbers+0xd4>
cmpl   $0x32,-0x10(%rbp)
jne    1195 <ICPrintNumbers+0x85>
mov    -0x10(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <ICPrintNumbers+0xe7>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11c7 <ICPrintNumbers+0xb7>
mov    -0x10(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119c <ICPrintNumbers+0x8c>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <ICPrintNumbers+0xca>
jmp    11df <ICPrintNumbers+0xcf>
jmp    11e4 <ICPrintNumbers+0xd4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <ICPrintNumbers+0x23>
jmp    11f7 <ICPrintNumbers+0xe7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICPrintNumbers>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    %edx,%esi
jge    11b3 <ICPrintNumbers+0x93>
mov    %edi,%r15d
cmp    $0x14,%edi
jle    114e <ICPrintNumbers+0x2e>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
mov    %edx,%r14d
mov    %esi,%ebp
lea    0xedf(%rip),%r12
jmp    1172 <ICPrintNumbers+0x52>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
je     11b3 <ICPrintNumbers+0x93>
imul   $0xaaaaaaab,%ebp,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
jb     116a <ICPrintNumbers+0x4a>
cmp    $0x32,%ebp
je     11bc <ICPrintNumbers+0x9c>
mov    %r15d,%ebx
test   %r15d,%r15d
jle    1160 <ICPrintNumbers+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    11a0 <ICPrintNumbers+0x80>
jmp    1160 <ICPrintNumbers+0x40>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe51(%rip),%rdi
mov    $0x32,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Cycle was broken \0A \00"
@.str.1 = [37 x i8] c"Cycle returned because elmenet = %d\0A\00"
@.str.2 = [3 x i8] c"%d\00"
define void @ICPrintNumbers(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %29
5: ; preds = %3
%6 = icmp sgt i32 %0, 20
%7 = icmp sgt i32 %0, 0
br i1 %6, label %12, label %8
8: ; preds = %5, %26
%9 = phi i32 [ %27, %26 ], [ %1, %5 ]
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 0
br i1 %11, label %26, label %14
12: ; preds = %5
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %29
14: ; preds = %8
%15 = icmp eq i32 %9, 50
br i1 %15, label %17, label %16
16: ; preds = %14
br i1 %7, label %21, label %19
17: ; preds = %14
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 50)
br label %29
19: ; preds = %21, %16
%20 = tail call i32 @putchar(i32 10)
br label %26
21: ; preds = %16, %21
%22 = phi i32 [ %24, %21 ], [ 0, %16 ]
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%24 = add nuw nsw i32 %22, 1
%25 = icmp eq i32 %24, %0
br i1 %25, label %19, label %21
26: ; preds = %8, %19
%27 = add i32 %9, 1
%28 = icmp eq i32 %27, %2
br i1 %28, label %29, label %8
29: ; preds = %26, %12, %17, %3
ret void
}