#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 devideByFive(int A, int B) {
  unsigned int i, remainder, p = 0;
  for (i = A; i <= B; i++) {
    if ((remainder = i % 5) == 0) {
      printf("%u", i);
      ++p;
      if (i <= B - 5) {
        printf(", ");
      }
    }
  }
  printf("\nThere is only %u numbers.", p);
}


x86 assembly (clang, -O0):
<devideByFive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     11a0 <devideByFive+0x90>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
cmp    $0x0,%edx
jne    118d <devideByFive+0x7d>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x5,%ecx
cmp    %ecx,%eax
ja     1188 <devideByFive+0x78>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118d <devideByFive+0x7d>
jmp    1192 <devideByFive+0x82>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <devideByFive+0x1b>
mov    -0x14(%rbp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devideByFive>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    %esi,%edi
jbe    113f <devideByFive+0x2f>
lea    0xede(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
mov    %esi,%r14d
mov    %edi,%ebp
lea    -0x5(%r14),%r13d
mov    $0xcccccccd,%r12d
lea    0xeab(%rip),%r15
xor    %ebx,%ebx
jmp    1168 <devideByFive+0x58>
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    %r14d,%ebp
ja     1121 <devideByFive+0x11>
mov    %ebp,%eax
imul   %r12,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%eax
cmp    %ebp,%eax
jne    1160 <devideByFive+0x50>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %r13d,%ebp
ja     1160 <devideByFive+0x50>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1160 <devideByFive+0x50>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [27 x i8] c"\0AThere is only %u numbers.\00"
define void @devideByFive(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* %7
%8 = load i32, i32* %3
store i32 %8, i32* %5
br label %9
9: ; preds = %30, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp ule i32 %10, %11
br i1 %12, label %13, label %33
13: ; preds = %9
%14 = load i32, i32* %5
%15 = urem i32 %14, 5
store i32 %15, i32* %6
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %7
%21 = add i32 %20, 1
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %23, 5
%25 = icmp ule i32 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %17
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %17
br label %29
29: ; preds = %28, %13
br label %30
30: ; preds = %29
%31 = load i32, i32* %5
%32 = add i32 %31, 1
store i32 %32, i32* %5
br label %9
33: ; preds = %9
%34 = load i32, i32* %7
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %34)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [27 x i8] c"\0AThere is only %u numbers.\00"
define void @devideByFive(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -5
br label %6
6: ; preds = %4, %17
%7 = phi i32 [ 0, %4 ], [ %18, %17 ]
%8 = phi i32 [ %0, %4 ], [ %19, %17 ]
%9 = urem i32 %8, 5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%13 = add i32 %7, 1
%14 = icmp ugt i32 %8, %5
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %6, %15, %11
%18 = phi i32 [ %13, %15 ], [ %13, %11 ], [ %7, %6 ]
%19 = add i32 %8, 1
%20 = icmp ugt i32 %19, %1
br i1 %20, label %21, label %6
21: ; preds = %17, %2
%22 = phi i32 [ 0, %2 ], [ %18, %17 ]
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret void
}