#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_no_repeat() {
  printf("fizzbuzz app without redundant code\n");
  int i;
  int flag;
  for (i = 1; i < 100; i++) {
    flag = 0;
    if (i % 3 == 0) {
      printf("Fizz");
      flag = 1;
    }
    if (i % 5 == 0) {
      printf("Buzz");
      flag = 1;
    }
    if (flag == 0)
      printf("%d", i);
    printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<fizzbuzz_no_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    11c7 <fizzbuzz_no_repeat+0xb7>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <fizzbuzz_no_repeat+0x57>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1190 <fizzbuzz_no_repeat+0x80>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11ab <fizzbuzz_no_repeat+0x9b>
mov    -0x4(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <fizzbuzz_no_repeat+0x1d>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz_no_repeat>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xeac(%rip),%r12
jmp    117c <fizzbuzz_no_repeat+0x4c>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     11d1 <fizzbuzz_no_repeat+0xa1>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ebp
neg    %ebp
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %cl,%al
je     11c0 <fizzbuzz_no_repeat+0x90>
add    %bl,%bpl
je     1160 <fizzbuzz_no_repeat+0x30>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    116a <fizzbuzz_no_repeat+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    %bl,%bpl
jne    116a <fizzbuzz_no_repeat+0x3a>
jmp    1160 <fizzbuzz_no_repeat+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"fizzbuzz app without redundant code\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_no_repeat() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %4
4: ; preds = %27, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %30
7: ; preds = %4
store i32 0, i32* %2
%8 = load i32, i32* %1
%9 = srem i32 %8, 3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %1
%15 = srem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %19
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %4
30: ; preds = %4
%31 = 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.1 = [5 x i8] c"Fizz\00"
@.str.2 = [5 x i8] c"Buzz\00"
@.str.3 = [3 x i8] c"%d\00"
@str = [36 x i8] c"fizzbuzz app without redundant code\00"
define void @fizzbuzz_no_repeat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %18
%3 = phi i32 [ 1, %0 ], [ %20, %18 ]
%4 = trunc i32 %3 to i8
%5 = urem i8 %4, 3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = urem i8 %4, 5
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %18
11: ; preds = %2
%12 = urem i8 %4, 5
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11, %7
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
br label %18
18: ; preds = %7, %14, %16
%19 = tail call i32 @putchar(i32 32)
%20 = add nuw nsw i32 %3, 1
%21 = icmp eq i32 %20, 100
br i1 %21, label %22, label %2
22: ; preds = %18
%23 = tail call i32 @putchar(i32 10)
ret void
}