#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 *, ...);
void acceptData(float valueSet[], int *win, int *size) {
  int i = 0;
  int j = 0;
  *win = -1;
  *size = 0;
  printf("\nEnter up to 50 integers or -1 to exit: ");
  for (j = 0; j < 50; j++) {
    scanf("%f", &valueSet[j]);
    if (valueSet[j] == -1) {
      j = 55;
      i--;
    }
    i++;
  }
  *size = i;
  while (*win <= 0 || *win > *size - 1 || *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 - 1)
      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    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x32,-0x20(%rbp)
jge    11dd <acceptData+0xbd>
mov    -0x8(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  0xe59(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11c6 <acceptData+0xa6>
jp     11c6 <acceptData+0xa6>
movl   $0x37,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116b <acceptData+0x4b>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x0,(%rcx)
mov    %al,-0x21(%rbp)
jle    122b <acceptData+0x10b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
sub    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x21(%rbp)
jg     122b <acceptData+0x10b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    123b <acceptData+0x11b>
jmp    12e2 <acceptData+0x1c2>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jg     127b <acceptData+0x15b>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dd <acceptData+0x1bd>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    12ae <acceptData+0x18e>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d8 <acceptData+0x1b8>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12d3 <acceptData+0x1b3>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d8 <acceptData+0x1b8>
jmp    12dd <acceptData+0x1bd>
jmp    11e6 <acceptData+0xc6>
add    $0x30,%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,%r12
movl   $0xffffffff,(%rsi)
movl   $0x0,(%rdx)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%r15
xor    %eax,%eax
xor    %ebp,%ebp
nopl   0x0(%rax)
movslq %eax,%rbx
lea    (%r12,%rbx,4),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  (%r12,%rbx,4),%xmm0
add    $0x1,%ebx
movss  0xe7e(%rip),%xmm1
ucomiss %xmm1,%xmm0
cmpeqss %xmm1,%xmm0
movd   %xmm0,%ecx
mov    $0x38,%eax
cmovne %ebx,%eax
lea    0x1(%rbp,%rcx,1),%ebp
cmovp  %ebx,%eax
cmp    $0x32,%eax
jl     1160 <acceptData+0x40>
mov    %ebp,(%r14)
lea    0xe84(%rip),%r15
lea    0xe9c(%rip),%r12
lea    0xe98(%rip),%rbx
lea    0xeb5(%rip),%rbp
jmp    11dd <acceptData+0xbd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
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
je     11ee <acceptData+0xce>
cmp    (%r14),%eax
jl     123c <acceptData+0x11c>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x0(%r13),%eax
test   %eax,%eax
jle    1230 <acceptData+0x110>
mov    (%r14),%esi
cmp    %esi,%eax
jge    11d0 <acceptData+0xb0>
test   $0x1,%al
jne    11dd <acceptData+0xbd>
lea    0xe7c(%rip),%rdi
jmp    1233 <acceptData+0x113>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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"%f\00"
@.str.2 = [31 x i8] c"\0AEnter desired window length: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [36 x i8] c"\0AError! Minimum window length is 1.\00"
@.str.5 = [37 x i8] c"\0AError! Maximum window length is %d.\00"
@.str.6 = [44 x i8] c"\0AError! Window value must be an odd number.\00"
define void @acceptData(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32*, i32** %5
store i32 -1, i32* %9
%10 = load i32*, i32** %6
store i32 0, i32* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %12
12: ; preds = %33, %3
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 50
br i1 %14, label %15, label %36
15: ; preds = %12
%16 = load float*, float** %4
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %19)
%21 = load float*, float** %4
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
%26 = fcmp oeq float %25, -1.000000e+00
br i1 %26, label %27, label %30
27: ; preds = %15
store i32 55, i32* %8
%28 = load i32, i32* %7
%29 = add nsw i32 %28, -1
store i32 %29, i32* %7
br label %30
30: ; preds = %27, %15
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %33
33: ; preds = %30
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %12
36: ; preds = %12
%37 = load i32, i32* %7
%38 = load i32*, i32** %6
store i32 %37, i32* %38
br label %39
39: ; preds = %87, %36
%40 = load i32*, i32** %5
%41 = load i32, i32* %40
%42 = icmp sle i32 %41, 0
br i1 %42, label %55, label %43
43: ; preds = %39
%44 = load i32*, i32** %5
%45 = load i32, i32* %44
%46 = load i32*, i32** %6
%47 = load i32, i32* %46
%48 = sub nsw i32 %47, 1
%49 = icmp sgt i32 %45, %48
br i1 %49, label %55, label %50
50: ; preds = %43
%51 = load i32*, i32** %5
%52 = load i32, i32* %51
%53 = srem i32 %52, 2
%54 = icmp eq i32 %53, 0
br label %55
55: ; preds = %50, %43, %39
%56 = phi i1 [ true, %43 ], [ true, %39 ], [ %54, %50 ]
br i1 %56, label %57, label %88
57: ; preds = %55
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32*, i32** %5
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %59)
%61 = load i32*, i32** %5
%62 = load i32, i32* %61
%63 = icmp sle i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %57
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %87
66: ; preds = %57
%67 = load i32*, i32** %5
%68 = load i32, i32* %67
%69 = load i32*, i32** %6
%70 = load i32, i32* %69
%71 = sub nsw i32 %70, 1
%72 = icmp sgt i32 %68, %71
br i1 %72, label %73, label %78
73: ; preds = %66
%74 = load i32*, i32** %6
%75 = load i32, i32* %74
%76 = sub nsw i32 %75, 1
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %76)
br label %86
78: ; preds = %66
%79 = load i32*, i32** %5
%80 = load i32, i32* %79
%81 = srem i32 %80, 2
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %78
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %85
85: ; preds = %83, %78
br label %86
86: ; preds = %85, %73
br label %87
87: ; preds = %86, %64
br label %39
88: ; preds = %55
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"%f\00"
@.str.2 = [31 x i8] c"\0AEnter desired window length: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [36 x i8] c"\0AError! Minimum window length is 1.\00"
@.str.5 = [37 x i8] c"\0AError! Maximum window length is %d.\00"
@.str.6 = [44 x i8] c"\0AError! Window value must be an odd number.\00"
define void @acceptData(float* %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 = %3, %5
%6 = phi i32 [ 0, %3 ], [ %17, %5 ]
%7 = phi i32 [ 0, %3 ], [ %15, %5 ]
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds float, float* %0, i64 %8
%10 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%11 = load float, float* %9
%12 = fcmp oeq float %11, -1.000000e+00
%13 = sext i1 %12 to i32
%14 = add i32 %7, 1
%15 = add i32 %14, %13
%16 = add nsw i32 %6, 1
%17 = select i1 %12, i32 56, i32 %16
%18 = icmp slt i32 %17, 50
br i1 %18, label %5, label %19
19: ; preds = %5
store i32 %15, i32* %2
br label %20
20: ; preds = %42, %19
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 1
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sge i32 %21, %24
%26 = and i32 %21, 1
%27 = icmp eq i32 %26, 0
%28 = or i1 %27, %25
br i1 %28, label %29, label %48
29: ; preds = %20, %23
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%31 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 1
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %42
36: ; preds = %29
%37 = load i32, i32* %2
%38 = icmp slt i32 %32, %37
br i1 %38, label %43, label %39
39: ; preds = %36
%40 = add nsw i32 %37, -1
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %46, %43, %34
br label %20
43: ; preds = %36
%44 = and i32 %32, 1
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %42
46: ; preds = %43
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %42
48: ; preds = %23
ret void
}