#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 *, char *);
void hoppity(int n) {
  for (int i = 1; i <= n; i++) {
    char *s = i % 15 == 0  ? "Hop"
              : i % 5 == 0 ? "Hophop"
              : i % 3 == 0 ? "Hoppity"
                           : NULL;
    if (s != NULL) {
      printf("%s\n", s);
    }
  }
}


x86 assembly (clang, -O0):
<hoppity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11d3 <hoppity+0xc3>
mov    -0x8(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1152 <hoppity+0x42>
lea    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    119d <hoppity+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1176 <hoppity+0x66>
lea    0xe97(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1195 <hoppity+0x85>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
lea    0xe81(%rip),%rcx
cmp    $0x0,%edx
cmove  %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11c0 <hoppity+0xb0>
mov    -0x10(%rbp),%rsi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    11c5 <hoppity+0xb5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <hoppity+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoppity>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    11b9 <hoppity+0xa9>
mov    %edi,%r15d
mov    $0x1,%ebp
mov    $0xffffffff,%ebx
mov    $0x88888889,%r12d
lea    0xec3(%rip),%r13
lea    0xecf(%rip),%r14
jmp    1164 <hoppity+0x54>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
add    $0xffffffff,%r15d
je     11b9 <hoppity+0xa9>
mov    %ebp,%eax
mov    %rax,%rcx
imul   %r12,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %r13,%rsi
add    %ebx,%ecx
je     1150 <hoppity+0x40>
mov    %rax,%rcx
mov    $0xcccccccd,%edx
imul   %rdx,%rcx
shr    $0x22,%rcx
lea    (%rcx,%rcx,4),%ecx
lea    0xe6c(%rip),%rsi
add    %ebx,%ecx
je     1150 <hoppity+0x40>
mov    $0xaaaaaaab,%ecx
imul   %rcx,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
lea    0xe58(%rip),%rsi
add    %ebx,%eax
jne    1158 <hoppity+0x48>
jmp    1150 <hoppity+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Hop\00"
@.str.1 = [7 x i8] c"Hophop\00"
@.str.2 = [8 x i8] c"Hoppity\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define void @hoppity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %35, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %38
9: ; preds = %5
%10 = load i32, i32* %3
%11 = srem i32 %10, 15
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %27
14: ; preds = %9
%15 = load i32, i32* %3
%16 = srem i32 %15, 5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %25
19: ; preds = %14
%20 = load i32, i32* %3
%21 = srem i32 %20, 3
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* null
br label %25
25: ; preds = %19, %18
%26 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %18 ], [ %24, %19 ]
br label %27
27: ; preds = %25, %13
%28 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %13 ], [ %26, %25 ]
store i8* %28, i8** %4
%29 = load i8*, i8** %4
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i8*, i8** %4
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %31, %27
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %5
38: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Hop\00"
@.str.1 = [7 x i8] c"Hophop\00"
@.str.2 = [8 x i8] c"Hoppity\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define void @hoppity(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %17, %1
ret void
4: ; preds = %1, %17
%5 = phi i32 [ %18, %17 ], [ 1, %1 ]
%6 = urem i32 %5, 15
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = urem i32 %5, 5
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = urem i32 %5, 3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11, %4, %8
%15 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %11 ]
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %11, %14
%18 = add nuw i32 %5, 1
%19 = icmp eq i32 %5, %0
br i1 %19, label %3, label %4
}