#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 is_prime(int);
int /*<<< orphan*/ printf(char *, int);
void output(int num) {
  if ((num % 7 == 0) || (num % 11 == 0) || (num % 13 == 0)) {
    if (num % 7 == 0)
      printf("divisble by 7 %d\n", num);
    else if (num % 11 == 0)
      printf("divisible by 11 %d\n", num);
    else
      printf("divisible by 13 %d\n", num);
  } else if (num % 2 == 0) {
    printf("the number is even %d\n", num);
  } else if (num % 2 != 0) {
    printf("the number is odd %d\n", num);
  } else if (num == is_prime(num)) {
    printf("the number is prime %d\n", num);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1167 <output+0x47>
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1167 <output+0x47>
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d0 <output+0xb0>
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118f <output+0x6f>
mov    -0x4(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <output+0xab>
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b7 <output+0x97>
mov    -0x4(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11c6 <output+0xa6>
mov    -0x4(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <output+0xab>
jmp    1259 <output+0x139>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f8 <output+0xd8>
mov    -0x4(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    1254 <output+0x134>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1220 <output+0x100>
mov    -0x4(%rbp),%esi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    124f <output+0x12f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jne    124a <output+0x12a>
mov    -0x4(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
jmp    124f <output+0x12f>
jmp    1254 <output+0x134>
jmp    1259 <output+0x139>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
mov    %edi,%esi
movslq %edi,%rax
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %edi,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %edi,%ecx
imul   $0x2e8ba2e9,%rax,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rdx
add    %edi,%edx
lea    (%rdx,%rdx,4),%edi
lea    (%rdx,%rdi,2),%edx
imul   $0xc4ec4ec5,%eax,%edi
sub    %edx,%eax
add    $0x9d89d89,%edi
cmp    $0x13b13b13,%edi
jb     118a <output+0x7a>
test   %ecx,%ecx
je     118a <output+0x7a>
test   %eax,%eax
je     118a <output+0x7a>
test   $0x1,%sil
lea    0xec0(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>
test   %ecx,%ecx
je     11a7 <output+0x97>
test   %eax,%eax
lea    0xe7b(%rip),%rax
lea    0xe88(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>
lea    0xe52(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"divisble by 7 %d\0A\00"
@.str.1 = [20 x i8] c"divisible by 11 %d\0A\00"
@.str.2 = [20 x i8] c"divisible by 13 %d\0A\00"
@.str.3 = [23 x i8] c"the number is even %d\0A\00"
@.str.4 = [22 x i8] c"the number is odd %d\0A\00"
@.str.5 = [24 x i8] c"the number is prime %d\0A\00"
define void @output(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 7
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 11
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 13
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %33
14: ; preds = %10, %6, %1
%15 = load i32, i32* %2
%16 = srem i32 %15, 7
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %32
21: ; preds = %14
%22 = load i32, i32* %2
%23 = srem i32 %22, 11
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %31
28: ; preds = %21
%29 = load i32, i32* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %18
br label %58
33: ; preds = %10
%34 = load i32, i32* %2
%35 = srem i32 %34, 2
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = load i32, i32* %2
%39 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %57
40: ; preds = %33
%41 = load i32, i32* %2
%42 = srem i32 %41, 2
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i32, i32* %2
%46 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %45)
br label %56
47: ; preds = %40
%48 = load i32, i32* %2
%49 = load i32, i32* %2
%50 = call i32 @is_prime(i32 %49)
%51 = icmp eq i32 %48, %50
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = load i32, i32* %2
%54 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %47
br label %56
56: ; preds = %55, %44
br label %57
57: ; preds = %56, %37
br label %58
58: ; preds = %57, %32
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"divisble by 7 %d\0A\00"
@.str.1 = [20 x i8] c"divisible by 11 %d\0A\00"
@.str.2 = [20 x i8] c"divisible by 13 %d\0A\00"
@.str.3 = [23 x i8] c"the number is even %d\0A\00"
@.str.4 = [22 x i8] c"the number is odd %d\0A\00"
define void @output(i32 %0) {
%2 = srem i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 11
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = srem i32 %0, 13
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
br i1 %9, label %10, label %13
10: ; preds = %1
br i1 %3, label %17, label %11
11: ; preds = %10
%12 = select i1 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0)
br label %17
13: ; preds = %1
%14 = and i32 %0, 1
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0)
br label %17
17: ; preds = %13, %11, %10
%18 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %10 ], [ %12, %11 ], [ %16, %13 ]
%19 = tail call i32 @printf(i8* %18, i32 %0)
ret void
}