#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 fizzbuzz_range(int begin, int end) {
  printf("fizzbuzz range app from %d to %d \n", begin, end);
  int i;
  if (end < begin) {
    i = begin;
    begin = end;
    end = i;
  }
  for (i = begin; i < end; i++) {
    if (i % 3 == 0 || i % 5 == 0) {
      if (i % 3 == 0)
        printf("Fizz");
      if (i % 5 == 0)
        printf("Buzz");
    } else
      printf("%d", i);
    printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<fizzbuzz_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <fizzbuzz_range+0x40>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1200 <fizzbuzz_range+0xf0>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     118a <fizzbuzz_range+0x7a>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d3 <fizzbuzz_range+0xc3>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ac <fizzbuzz_range+0x9c>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ce <fizzbuzz_range+0xbe>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <fizzbuzz_range+0xd4>
mov    -0xc(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <fizzbuzz_range+0x46>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz_range>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r13d
mov    %edi,%r14d
lea    0xec8(%rip),%rdi
mov    %r14d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r14d,%r13d
mov    %r14d,%ebp
cmovl  %r13d,%ebp
cmovl  %r14d,%r13d
cmp    %r13d,%ebp
jge    11ff <fizzbuzz_range+0xdf>
lea    0xec0(%rip),%r14
lea    0xebe(%rip),%r15
lea    0xebc(%rip),%r12
jmp    119e <fizzbuzz_range+0x7e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%r13d
je     11ff <fizzbuzz_range+0xdf>
movslq %ebp,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%edx
mov    %eax,%ebx
sub    %edx,%ebx
sub    %ecx,%eax
je     11db <fizzbuzz_range+0xbb>
test   %ebx,%ebx
jne    1180 <fizzbuzz_range+0x60>
test   %eax,%eax
je     11e5 <fizzbuzz_range+0xc5>
test   %ebx,%ebx
jne    118c <fizzbuzz_range+0x6c>
jmp    11f3 <fizzbuzz_range+0xd3>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jne    118c <fizzbuzz_range+0x6c>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118c <fizzbuzz_range+0x6c>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [35 x i8] c"fizzbuzz range app from %d to %d \0A\00"
@.str.1 = [5 x i8] c"Fizz\00"
@.str.2 = [5 x i8] c"Buzz\00"
@.str.3 = [3 x i8] c"%d\00"
define void @fizzbuzz_range(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %4, i32 %0, i32 %1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %27
8: ; preds = %2, %23
%9 = phi i32 [ %25, %23 ], [ %5, %2 ]
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 0
%12 = srem i32 %9, 5
%13 = icmp eq i32 %12, 0
%14 = or i1 %11, %13
br i1 %14, label %15, label %21
15: ; preds = %8
br i1 %11, label %16, label %18
16: ; preds = %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %15
br i1 %13, label %19, label %23
19: ; preds = %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %23
21: ; preds = %8
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %23
23: ; preds = %18, %19, %21
%24 = tail call i32 @putchar(i32 32)
%25 = add i32 %9, 1
%26 = icmp eq i32 %25, %6
br i1 %26, label %27, label %8
27: ; preds = %23, %2
%28 = tail call i32 @putchar(i32 10)
ret void
}