#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 finalSet[], int *size, int *window) {
  int i = 0;
  printf("\nMoving window (%d) average:\n", *window);
  while (i < *size) {
    printf("%d ", finalSet[i]);
    if ((i + 1) % 5 == 0)
      printf("\n");
    i++;
  }
  printf("\n\n");
  return;
}


x86 assembly (clang, -O0):
<printResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    119a <printResults+0x8a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <printResults+0x7c>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <printResults+0x2f>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResults>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%r14
mov    (%rdx),%esi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x0(%r13)
jle    11bd <printResults+0x8d>
mov    $0x1,%ebp
xor    %r12d,%r12d
jmp    117c <printResults+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0x0(%r13),%rax
add    $0x1,%ebp
cmp    %rax,%r12
jge    11bd <printResults+0x8d>
mov    %r12,%rbx
mov    %ebp,%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%r15d
add    $0xffffffff,%r15d
mov    (%r14,%r12,4),%esi
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r12
cmp    %ebx,%r15d
jne    1170 <printResults+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1170 <printResults+0x40>
lea    0xe58(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0AMoving window (%d) average:\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @printResults(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %29, %3
%12 = load i32, i32* %7
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %32
16: ; preds = %11
%17 = load i32*, i32** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
%25 = srem i32 %24, 5
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %16
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27, %16
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %11
32: ; preds = %11
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0AMoving window (%d) average:\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@str = [2 x i8] c"\0A\00"
define void @printResults(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %3, %19
%9 = phi i64 [ %13, %19 ], [ 0, %3 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = urem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = tail call i32 @putchar(i32 10)
br label %19
19: ; preds = %17, %8
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %13, %21
br i1 %22, label %8, label %23
23: ; preds = %19, %3
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}