#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 modulizer(int start, int end, int mod[], int mod_c) {
  int num_index, mod_index, num_is = 0, num_isnot = 0;
  printf("\nStart: %d\nEnd: %d\n", start, end);
  for (mod_index = 0; mod_index < mod_c; mod_index++) {
    printf("\nUsing the mod value %d:\n", mod[mod_index]);
    if (mod[mod_index] != 0 && start <= end) {
      for (num_index = start; num_index <= end; num_index++) {
        if (num_index % mod[mod_index] == 0) {
          printf("%d IS dividable with %d\n", num_index, mod[mod_index]);
          num_is++;
        } else {
          printf("%d IS NOT dividable with %d\n", num_index, mod[mod_index]);
          num_isnot++;
        }
      }
    } else if (mod[mod_index] == 0) {
      printf(
          "'Black holes are where God divided by zero.'\n  — Albert Eintein\n");
    } else if (start > end) {
      printf(
          "Please make sure the start number is less than the end number.\n");
    }
  }
  printf("\nThere was %d not dividable and %d dividable.\nDone, goodbye and "
         "have a good day.\n",
         num_isnot, num_is);
  return;
}


x86 assembly (clang, -O0):
<modulizer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    127e <modulizer+0x16e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1222 <modulizer+0x112>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1222 <modulizer+0x112>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     121d <modulizer+0x10d>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rsi
cltd
idivl  (%rcx,%rsi,4)
cmp    $0x0,%edx
jne    11e5 <modulizer+0xd5>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    120a <modulizer+0xfa>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    120f <modulizer+0xff>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <modulizer+0x87>
jmp    126b <modulizer+0x15b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1247 <modulizer+0x137>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1266 <modulizer+0x156>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1261 <modulizer+0x151>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1266 <modulizer+0x156>
jmp    126b <modulizer+0x15b>
jmp    1270 <modulizer+0x160>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <modulizer+0x3e>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulizer>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %rdx,%r12
mov    %esi,%ebp
mov    %edi,%r13d
lea    0xec0(%rip),%rdi
xor    %r15d,%r15d
mov    %r13d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x0,%ebx
test   %r14d,%r14d
jle    124b <modulizer+0x12b>
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
xor    %r14d,%r14d
xor    %ebx,%ebx
xor    %r15d,%r15d
mov    %r13d,0xc(%rsp)
jmp    1194 <modulizer+0x74>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xc(%rsp),%r13d
add    $0x1,%r14
cmp    0x10(%rsp),%r14
je     124b <modulizer+0x12b>
mov    (%r12,%r14,4),%esi
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r12,%r14,4),%ecx
cmp    %ebp,%r13d
jg     1220 <modulizer+0x100>
test   %ecx,%ecx
je     1220 <modulizer+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13d,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     11f0 <modulizer+0xd0>
lea    0xe76(%rip),%rdi
mov    %r13d,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %r13d,%ebp
jne    1210 <modulizer+0xf0>
jmp    1180 <modulizer+0x60>
nopw   0x0(%rax,%rax,1)
lea    0xe37(%rip),%rdi
mov    %r13d,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
cmp    %r13d,%ebp
je     1180 <modulizer+0x60>
add    $0x1,%r13d
mov    (%r12,%r14,4),%ecx
jmp    11c0 <modulizer+0xa0>
nopw   0x0(%rax,%rax,1)
test   %ecx,%ecx
je     122d <modulizer+0x10d>
cmp    %ebp,%r13d
jle    1185 <modulizer+0x65>
test   %ecx,%ecx
lea    0xe80(%rip),%rdi
lea    0xeb8(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
jmp    1185 <modulizer+0x65>
lea    0xe12(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\0AStart: %d\0AEnd: %d\0A\00"
@.str.1 = [26 x i8] c"\0AUsing the mod value %d:\0A\00"
@.str.2 = [25 x i8] c"%d IS dividable with %d\0A\00"
@.str.3 = [29 x i8] c"%d IS NOT dividable with %d\0A\00"
@.str.4 = [67 x i8] c"'Black holes are where God divided by zero.'\0A \E2\80\94 Albert Eintein\0A\00"
@.str.5 = [64 x i8] c"Please make sure the start number is less than the end number.\0A\00"
@.str.6 = [82 x i8] c"\0AThere was %d not dividable and %d dividable.\0ADone, goodbye and have a good day.\0A\00"
define void @modulizer(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32 0, i32* %11
store i32 0, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
store i32 0, i32* %10
br label %16
16: ; preds = %95, %4
%17 = load i32, i32* %10
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %98
20: ; preds = %16
%21 = load i32*, i32** %7
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = load i32*, i32** %7
%28 = load i32, i32* %10
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %77
33: ; preds = %20
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %77
37: ; preds = %33
%38 = load i32, i32* %5
store i32 %38, i32* %9
br label %39
39: ; preds = %73, %37
%40 = load i32, i32* %9
%41 = load i32, i32* %6
%42 = icmp sle i32 %40, %41
br i1 %42, label %43, label %76
43: ; preds = %39
%44 = load i32, i32* %9
%45 = load i32*, i32** %7
%46 = load i32, i32* %10
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
%49 = load i32, i32* %48
%50 = srem i32 %44, %49
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %62
52: ; preds = %43
%53 = load i32, i32* %9
%54 = load i32*, i32** %7
%55 = load i32, i32* %10
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %53, i32 %58)
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %72
62: ; preds = %43
%63 = load i32, i32* %9
%64 = load i32*, i32** %7
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %64, i64 %66
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %63, i32 %68)
%70 = load i32, i32* %12
%71 = add nsw i32 %70, 1
store i32 %71, i32* %12
br label %72
72: ; preds = %62, %52
br label %73
73: ; preds = %72
%74 = load i32, i32* %9
%75 = add nsw i32 %74, 1
store i32 %75, i32* %9
br label %39
76: ; preds = %39
br label %94
77: ; preds = %33, %20
%78 = load i32*, i32** %7
%79 = load i32, i32* %10
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %78, i64 %80
%82 = load i32, i32* %81
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %77
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0))
br label %93
86: ; preds = %77
%87 = load i32, i32* %5
%88 = load i32, i32* %6
%89 = icmp sgt i32 %87, %88
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
br label %92
92: ; preds = %90, %86
br label %93
93: ; preds = %92, %84
br label %94
94: ; preds = %93, %76
br label %95
95: ; preds = %94
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %16
98: ; preds = %16
%99 = load i32, i32* %12
%100 = load i32, i32* %11
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.6, i64 0, i64 0), i32 %99, i32 %100)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0AStart: %d\0AEnd: %d\0A\00"
@.str.1 = [26 x i8] c"\0AUsing the mod value %d:\0A\00"
@.str.2 = [25 x i8] c"%d IS dividable with %d\0A\00"
@.str.3 = [29 x i8] c"%d IS NOT dividable with %d\0A\00"
@.str.6 = [82 x i8] c"\0AThere was %d not dividable and %d dividable.\0ADone, goodbye and have a good day.\0A\00"
@str = [63 x i8] c"Please make sure the start number is less than the end number.\00"
@str.7 = [66 x i8] c"'Black holes are where God divided by zero.'\0A \E2\80\94 Albert Eintein\00"
define void @modulizer(i32 %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %50
7: ; preds = %4
%8 = icmp sgt i32 %0, %1
%9 = zext i32 %3 to i64
br label %10
10: ; preds = %7, %45
%11 = phi i64 [ 0, %7 ], [ %48, %45 ]
%12 = phi i32 [ 0, %7 ], [ %47, %45 ]
%13 = phi i32 [ 0, %7 ], [ %46, %45 ]
%14 = getelementptr inbounds i32, i32* %2, i64 %11
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %14
%18 = icmp eq i32 %17, 0
%19 = or i1 %8, %18
br i1 %19, label %40, label %20
20: ; preds = %10, %37
%21 = phi i32 [ %39, %37 ], [ %17, %10 ]
%22 = phi i32 [ %35, %37 ], [ %12, %10 ]
%23 = phi i32 [ %34, %37 ], [ %13, %10 ]
%24 = phi i32 [ %38, %37 ], [ %0, %10 ]
%25 = srem i32 %24, %21
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 %21)
%29 = add nsw i32 %23, 1
br label %33
30: ; preds = %20
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %21)
%32 = add nsw i32 %22, 1
br label %33
33: ; preds = %27, %30
%34 = phi i32 [ %29, %27 ], [ %23, %30 ]
%35 = phi i32 [ %22, %27 ], [ %32, %30 ]
%36 = icmp eq i32 %24, %1
br i1 %36, label %45, label %37
37: ; preds = %33
%38 = add i32 %24, 1
%39 = load i32, i32* %14
br label %20
40: ; preds = %10
%41 = or i1 %18, %8
br i1 %41, label %42, label %45
42: ; preds = %40
%43 = select i1 %18, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0)
%44 = tail call i32 @puts(i8* dereferenceable(1) %43)
br label %45
45: ; preds = %33, %40, %42
%46 = phi i32 [ %13, %42 ], [ %13, %40 ], [ %34, %33 ]
%47 = phi i32 [ %12, %42 ], [ %12, %40 ], [ %35, %33 ]
%48 = add nuw nsw i64 %11, 1
%49 = icmp eq i64 %48, %9
br i1 %49, label %50, label %10
50: ; preds = %45, %4
%51 = phi i32 [ 0, %4 ], [ %46, %45 ]
%52 = phi i32 [ 0, %4 ], [ %47, %45 ]
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str.6, i64 0, i64 0), i32 %52, i32 %51)
ret void
}