#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 printResults(int originalSet[], int primeSet[], int nonPrimeSet[],
                  int *origSize, int *psSize, int *npsSize, int *duplicateCount,
                  int *isNotSorted) {
  int i = 0;
  printf("\nSorted prime data: ");
  for (i = 0; i < *psSize; i++)
    printf("%d ", primeSet[i]);
  printf("\nSorted non-prime data: ");
  for (i = 0; i < *npsSize; i++)
    printf("%d ", nonPrimeSet[i]);
  if (!*isNotSorted && *duplicateCount)
    printf("\n\nAll-prime array remains sorted [with duplicates].");
  else if (!*isNotSorted && !*duplicateCount)
    printf("\n\nAll-prime array remains sorted [no duplicates].");
  else if (*isNotSorted)
    printf("\n\nAll-prime array is no longer sorted.");
  printf("\nContents of all-prime array: ");
  for (i = 0; i < *origSize; i++)
    printf("%d ", originalSet[i]);
  printf("\n\n");
  return;
}


x86 assembly (clang, -O0):
<printResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    118a <printResults+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1154 <printResults+0x44>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
jge    11d5 <printResults+0xc5>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    119f <printResults+0x8f>
mov    0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1202 <printResults+0xf2>
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1202 <printResults+0xf2>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1254 <printResults+0x144>
mov    0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    122f <printResults+0x11f>
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    122f <printResults+0x11f>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124f <printResults+0x13f>
mov    0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     124a <printResults+0x13a>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124f <printResults+0x13f>
jmp    1254 <printResults+0x144>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    129f <printResults+0x18f>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1269 <printResults+0x159>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResults>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r13
mov    %r8,%rbx
mov    %rcx,0x10(%rsp)
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,0x8(%rsp)
mov    0x68(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x60(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,(%rbx)
jle    119b <printResults+0x7b>
lea    0xea3(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%r15,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
movslq (%rbx),%rax
cmp    %rax,%r15
jl     1180 <printResults+0x60>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x0(%r13)
jle    11db <printResults+0xbb>
lea    0xe5e(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r12,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
movslq 0x0(%r13),%rax
cmp    %rax,%rbp
jl     11c0 <printResults+0xa0>
mov    0x20(%rsp),%rax
cmpl   $0x0,(%rax)
je     11ee <printResults+0xce>
lea    0xeac(%rip),%rdi
jmp    1208 <printResults+0xe8>
mov    0x18(%rsp),%rax
cmpl   $0x0,(%rax)
lea    0xe69(%rip),%rax
lea    0xe2e(%rip),%rdi
cmove  %rax,%rdi
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%r15
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,(%rbx)
jle    125a <printResults+0x13a>
lea    0xde2(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
movslq (%rbx),%rax
cmp    %rax,%rbp
jl     1240 <printResults+0x120>
lea    0xe7d(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0ASorted prime data: \00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [25 x i8] c"\0ASorted non-prime data: \00"
@.str.3 = [52 x i8] c"\0A\0AAll-prime array remains sorted [with duplicates].\00"
@.str.4 = [50 x i8] c"\0A\0AAll-prime array remains sorted [no duplicates].\00"
@.str.5 = [39 x i8] c"\0A\0AAll-prime array is no longer sorted.\00"
@.str.6 = [31 x i8] c"\0AContents of all-prime array: \00"
@.str.7 = [3 x i8] c"\0A\0A\00"
define void @printResults(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
store i32 0, i32* %17
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %17
br label %19
19: ; preds = %31, %8
%20 = load i32, i32* %17
%21 = load i32*, i32** %13
%22 = load i32, i32* %21
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %34
24: ; preds = %19
%25 = load i32*, i32** %10
%26 = load i32, i32* %17
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %24
%32 = load i32, i32* %17
%33 = add nsw i32 %32, 1
store i32 %33, i32* %17
br label %19
34: ; preds = %19
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %17
br label %36
36: ; preds = %48, %34
%37 = load i32, i32* %17
%38 = load i32*, i32** %14
%39 = load i32, i32* %38
%40 = icmp slt i32 %37, %39
br i1 %40, label %41, label %51
41: ; preds = %36
%42 = load i32*, i32** %11
%43 = load i32, i32* %17
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %41
%49 = load i32, i32* %17
%50 = add nsw i32 %49, 1
store i32 %50, i32* %17
br label %36
51: ; preds = %36
%52 = load i32*, i32** %16
%53 = load i32, i32* %52
%54 = icmp ne i32 %53, 0
br i1 %54, label %61, label %55
55: ; preds = %51
%56 = load i32*, i32** %15
%57 = load i32, i32* %56
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %79
61: ; preds = %55, %51
%62 = load i32*, i32** %16
%63 = load i32, i32* %62
%64 = icmp ne i32 %63, 0
br i1 %64, label %71, label %65
65: ; preds = %61
%66 = load i32*, i32** %15
%67 = load i32, i32* %66
%68 = icmp ne i32 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %65
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
br label %78
71: ; preds = %65, %61
%72 = load i32*, i32** %16
%73 = load i32, i32* %72
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
br label %77
77: ; preds = %75, %71
br label %78
78: ; preds = %77, %69
br label %79
79: ; preds = %78, %59
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %17
br label %81
81: ; preds = %93, %79
%82 = load i32, i32* %17
%83 = load i32*, i32** %12
%84 = load i32, i32* %83
%85 = icmp slt i32 %82, %84
br i1 %85, label %86, label %96
86: ; preds = %81
%87 = load i32*, i32** %9
%88 = load i32, i32* %17
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %87, i64 %89
%91 = load i32, i32* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %86
%94 = load i32, i32* %17
%95 = add nsw i32 %94, 1
store i32 %95, i32* %17
br label %81
96: ; preds = %81
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0ASorted prime data: \00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [25 x i8] c"\0ASorted non-prime data: \00"
@.str.3 = [52 x i8] c"\0A\0AAll-prime array remains sorted [with duplicates].\00"
@.str.4 = [50 x i8] c"\0A\0AAll-prime array remains sorted [no duplicates].\00"
@.str.5 = [39 x i8] c"\0A\0AAll-prime array is no longer sorted.\00"
@.str.6 = [31 x i8] c"\0AContents of all-prime array: \00"
@str = [2 x i8] c"\0A\00"
define void @printResults(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7) {
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %8, %12
%13 = phi i64 [ %17, %12 ], [ 0, %8 ]
%14 = getelementptr inbounds i32, i32* %1, i64 %13
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nuw nsw i64 %13, 1
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %12, label %21
21: ; preds = %12, %8
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %21, %25
%26 = phi i64 [ %30, %25 ], [ 0, %21 ]
%27 = getelementptr inbounds i32, i32* %2, i64 %26
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i64 %26, 1
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = icmp slt i64 %30, %32
br i1 %33, label %25, label %34
34: ; preds = %25, %21
%35 = load i32, i32* %7
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0)
br label %41
41: ; preds = %34, %37
%42 = phi i8* [ %40, %37 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), %34 ]
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %42)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%45 = load i32, i32* %3
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %56
47: ; preds = %41, %47
%48 = phi i64 [ %52, %47 ], [ 0, %41 ]
%49 = getelementptr inbounds i32, i32* %0, i64 %48
%50 = load i32, i32* %49
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = add nuw nsw i64 %48, 1
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %47, label %56
56: ; preds = %47, %41
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}