#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void acceptData(int valueSet[], int *win, int *size) {
  int i = 0;
  *win = -1;
  *size = 0;
  printf("\nEnter up to 50 integers or -1 to exit: ");
  do {
    scanf("%d", &valueSet[i]);
    printf("\nLooped accept array. %d", valueSet[i]);
    i++;
  } while (valueSet[i - 1] != -1 || i <= 50 - 1);
  *size = i - 1;
  printf("\nExited accept array.");
  while (*win <= 0 || *win >= *size || *win % 2 != 0) {
    printf("\nEnter desired window length: ");
    scanf("%d", win);
    if (*win <= 0)
      printf("\nError! Minimum window length is 1.");
    else if (*win >= *size)
      printf("\nError! Maximum window length is %d.", *size - 1);
    else if (*win % 2 != 0)
      printf("\nError! Window value must be an odd number.");
  }
  return;
}


x86 assembly (clang, -O0):
<acceptData>:
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    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xecc(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdx
mov    $0x1,%al
cmpl   $0xffffffff,(%rcx,%rdx,4)
mov    %al,-0x1d(%rbp)
jne    11c0 <acceptData+0xa0>
cmpl   $0x31,-0x1c(%rbp)
setle  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    115d <acceptData+0x3d>
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x0,(%rcx)
mov    %al,-0x1e(%rbp)
jle    1225 <acceptData+0x105>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rdx
mov    $0x1,%al
cmp    (%rdx),%ecx
mov    %al,-0x1e(%rbp)
jge    1225 <acceptData+0x105>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    1235 <acceptData+0x115>
jmp    12d5 <acceptData+0x1b5>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xdf1(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jg     1273 <acceptData+0x153>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <acceptData+0x1b0>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jl     12a1 <acceptData+0x181>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cb <acceptData+0x1ab>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     12c6 <acceptData+0x1a6>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cb <acceptData+0x1ab>
jmp    12d0 <acceptData+0x1b0>
jmp    11e5 <acceptData+0xc5>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%rbp
movl   $0xffffffff,(%rsi)
movl   $0x0,(%rdx)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%r12
xor    %ebx,%ebx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%r15
lea    (%rbx,%rbp,1),%rsi
lea    0xed1(%rip),%rdi
call   1040 <scanf@plt>
mov    0x0(%rbp,%r15,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%r15),%rax
add    $0x4,%rbx
cmpl   $0xffffffff,0x0(%rbp,%r15,4)
jne    1160 <acceptData+0x40>
cmp    $0x31,%r15
jb     1160 <acceptData+0x40>
add    $0xffffffff,%eax
mov    %eax,(%r14)
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea5(%rip),%r15
lea    0xe85(%rip),%r12
lea    0xeb6(%rip),%rbx
lea    0xed3(%rip),%rbp
jmp    11dd <acceptData+0xbd>
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x0(%r13),%eax
test   %eax,%eax
jle    11ee <acceptData+0xce>
test   $0x1,%al
jne    11ee <acceptData+0xce>
cmp    (%r14),%eax
jl     122c <acceptData+0x10c>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x0(%r13),%eax
test   %eax,%eax
jle    1220 <acceptData+0x100>
mov    (%r14),%esi
cmp    %esi,%eax
jge    11d0 <acceptData+0xb0>
test   $0x1,%al
je     11dd <acceptData+0xbd>
lea    0xea3(%rip),%rdi
jmp    1223 <acceptData+0x103>
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11dd <acceptData+0xbd>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0AEnter up to 50 integers or -1 to exit: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"\0ALooped accept array. %d\00"
@.str.3 = [22 x i8] c"\0AExited accept array.\00"
@.str.4 = [31 x i8] c"\0AEnter desired window length: \00"
@.str.5 = [36 x i8] c"\0AError! Minimum window length is 1.\00"
@.str.6 = [37 x i8] c"\0AError! Maximum window length is %d.\00"
@.str.7 = [44 x i8] c"\0AError! Window value must be an odd number.\00"
define void @acceptData(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** %5
store i32 -1, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %36, %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%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 ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %25
25: ; preds = %11
%26 = load i32*, i32** %4
%27 = load i32, i32* %7
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = icmp ne i32 %31, -1
br i1 %32, label %36, label %33
33: ; preds = %25
%34 = load i32, i32* %7
%35 = icmp sle i32 %34, 49
br label %36
36: ; preds = %33, %25
%37 = phi i1 [ true, %25 ], [ %35, %33 ]
br i1 %37, label %11, label %38
38: ; preds = %36
%39 = load i32, i32* %7
%40 = sub nsw i32 %39, 1
%41 = load i32*, i32** %6
store i32 %40, i32* %41
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %89, %38
%44 = load i32*, i32** %5
%45 = load i32, i32* %44
%46 = icmp sle i32 %45, 0
br i1 %46, label %58, label %47
47: ; preds = %43
%48 = load i32*, i32** %5
%49 = load i32, i32* %48
%50 = load i32*, i32** %6
%51 = load i32, i32* %50
%52 = icmp sge i32 %49, %51
br i1 %52, label %58, label %53
53: ; preds = %47
%54 = load i32*, i32** %5
%55 = load i32, i32* %54
%56 = srem i32 %55, 2
%57 = icmp ne i32 %56, 0
br label %58
58: ; preds = %53, %47, %43
%59 = phi i1 [ true, %47 ], [ true, %43 ], [ %57, %53 ]
br i1 %59, label %60, label %90
60: ; preds = %58
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%62 = load i32*, i32** %5
%63 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %62)
%64 = load i32*, i32** %5
%65 = load i32, i32* %64
%66 = icmp sle i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %60
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %89
69: ; preds = %60
%70 = load i32*, i32** %5
%71 = load i32, i32* %70
%72 = load i32*, i32** %6
%73 = load i32, i32* %72
%74 = icmp sge i32 %71, %73
br i1 %74, label %75, label %80
75: ; preds = %69
%76 = load i32*, i32** %6
%77 = load i32, i32* %76
%78 = sub nsw i32 %77, 1
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %78)
br label %88
80: ; preds = %69
%81 = load i32*, i32** %5
%82 = load i32, i32* %81
%83 = srem i32 %82, 2
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %80
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
br label %87
87: ; preds = %85, %80
br label %88
88: ; preds = %87, %75
br label %89
89: ; preds = %88, %67
br label %43
90: ; preds = %58
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0AEnter up to 50 integers or -1 to exit: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"\0ALooped accept array. %d\00"
@.str.3 = [22 x i8] c"\0AExited accept array.\00"
@.str.4 = [31 x i8] c"\0AEnter desired window length: \00"
@.str.5 = [36 x i8] c"\0AError! Minimum window length is 1.\00"
@.str.6 = [37 x i8] c"\0AError! Maximum window length is %d.\00"
@.str.7 = [44 x i8] c"\0AError! Window value must be an odd number.\00"
define void @acceptData(i32* %0, i32* %1, i32* nocapture %2) {
store i32 -1, i32* %1
store i32 0, i32* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %6, 1
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, -1
%14 = icmp ult i64 %6, 49
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %5, label %16
16: ; preds = %5
%17 = trunc i64 %6 to i32
store i32 %17, i32* %2
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %41, %16
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 1
br i1 %21, label %28, label %22
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp slt i32 %20, %23
%25 = and i32 %20, 1
%26 = icmp eq i32 %25, 0
%27 = and i1 %26, %24
br i1 %27, label %47, label %28
28: ; preds = %19, %22
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%30 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%31 = load i32, i32* %1
%32 = icmp slt i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %41
35: ; preds = %28
%36 = load i32, i32* %2
%37 = icmp slt i32 %31, %36
br i1 %37, label %42, label %38
38: ; preds = %35
%39 = add nsw i32 %36, -1
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %45, %42, %33
br label %19
42: ; preds = %35
%43 = and i32 %31, 1
%44 = icmp eq i32 %43, 0
br i1 %44, label %41, label %45
45: ; preds = %42
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
br label %41
47: ; preds = %22
ret void
}