#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 aboveAverage(double *, int);
double average(double *, int);
int /*<<< orphan*/ find(int, double *, int);
int max(double *, int);
int min(double *, int);
int occurrences(double, double *, int);
int pairs(double *, int);
int /*<<< orphan*/ printArray(double *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readArray(double *, int);
int removeFives(double *, int);
int /*<<< orphan*/ reverse(double *, int);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ sep();
double unpairsAverage(double *, int);
int main() {
  int choice = 14, size;
  double t[100];
  do {
    printf("\n\nArray manipulation:\n"
           "=================================\n"
           "1.  Read array.\n"
           "2.  Print array.\n"
           "3.  Print Min\n"
           "4.  Print Max\n"
           "5.  Print average\n"
           "6.  Print number of values above average\n"
           "7.  Find value in array\n"
           "8.  Count number of occurrences of value in array\n"
           "9.  Count pairs in array\n"
           "10. Average of unpair values in array\n"
           "11. Reverse array elements inplace\n"
           "12. Remove values dividable by 5 from array\n"
           "13. Quit\n");
    printf("\nEnter choice: ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      sep();
      printf("Enter array size: ");
      scanf("%d", &size);
      printf("Enter array elments: ");
      readArray(t, size);
      sep();
      break;
    case 2:
      sep();
      printf("Array elements: ");
      printArray(t, size);
      sep();
      break;
    case 3: {
      int m = min(t, size);
      sep();
      printf("Min index: %d, Min value: %.2f\n", m, t[m]);
      sep();
      break;
    }
    case 4: {
      int m = max(t, size);
      sep();
      printf("Max index: %d, Max value: %.2f\n", m, t[m]);
      sep();
      break;
    }
    case 5:
      sep();
      printf("Average: %.2f\n", average(t, size));
      sep();
      break;
    case 6:
      sep();
      printf("Above average: %d\n", aboveAverage(t, size));
      sep();
      break;
    case 7: {
      int value;
      printf("Enter value: ");
      scanf("%d", &value);
      sep();
      printf("Value %d %s found!\n", value,
             (find(value, t, size) ? "\b" : "not"));
      sep();
      break;
    }
    case 8: {
      double value;
      printf("Enter value: ");
      scanf("%lf", &value);
      sep();
      printf("Value %.f occurred %d time(s)!\n", value,
             occurrences(value, t, size));
      sep();
      break;
    }
    case 9:
      sep();
      printf("Number of pair values is %d\n", pairs(t, size));
      sep();
      break;
    case 10:
      sep();
      printf("Average of unpair values: %.2f\n", unpairsAverage(t, size));
      sep();
      break;
    case 11:
      reverse(t, size);
      sep();
      printArray(t, size);
      sep();
      break;
    case 12: {
      size = removeFives(t, size);
      sep();
      printArray(t, size);
      sep();
      break;
    }
    case 13:
      return 0;
    default:
      printf("Not a valid choice!\n");
    }
  } while (choice != 13);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x360,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
lea    0xe24(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x351(%rbp)
call   1050 <printf@plt>
mov    -0x351(%rbp),%al
lea    0xf9c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x351(%rbp),%al
lea    0xf9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x350(%rbp)
sub    $0xc,%eax
ja     15b8 <main+0x3c8>
mov    -0x350(%rbp),%rax
lea    0xd95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1110 <sep@plt>
lea    0xf57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf46(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   10d0 <scanf@plt>
lea    0xf4a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1100 <readArray@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
mov    $0x0,%al
call   1110 <sep@plt>
lea    0xf30(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10f0 <printArray@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <min@plt>
mov    %eax,-0x334(%rbp)
mov    $0x0,%al
call   1110 <sep@plt>
mov    -0x334(%rbp),%esi
movslq -0x334(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xee6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <max@plt>
mov    %eax,-0x338(%rbp)
mov    $0x0,%al
call   1110 <sep@plt>
mov    -0x338(%rbp),%esi
movslq -0x338(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1090 <average@plt>
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10c0 <aboveAverage@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd3(%rip),%rdi
lea    -0x33c(%rbp),%rsi
mov    $0x0,%al
call   10d0 <scanf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
mov    -0x33c(%rbp),%eax
mov    %eax,-0x358(%rbp)
mov    -0x33c(%rbp),%edi
lea    -0x330(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   10a0 <find@plt>
mov    -0x358(%rbp),%esi
mov    %eax,%ecx
lea    0xe51(%rip),%rdx
lea    0xe48(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe18(%rip),%rdi
lea    -0x348(%rbp),%rsi
mov    $0x0,%al
call   10d0 <scanf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
movsd  -0x348(%rbp),%xmm0
ff
movsd  %xmm0,-0x360(%rbp)
ff
movsd  -0x348(%rbp),%xmm0
ff
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10b0 <occurrences@plt>
movsd  -0x360(%rbp),%xmm0
ff
mov    %eax,%esi
lea    0xdcf(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <pairs@plt>
mov    %eax,%esi
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10e0 <unpairsAverage@plt>
lea    0xdaa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <reverse@plt>
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10f0 <printArray@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <removeFives@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1110 <sep@plt>
lea    -0x330(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10f0 <printArray@plt>
mov    $0x0,%al
call   1110 <sep@plt>
jmp    15c6 <main+0x3d6>
movl   $0x0,-0x4(%rbp)
jmp    15dc <main+0x3ec>
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15cb <main+0x3db>
cmpl   $0xd,-0x8(%rbp)
jne    1209 <main+0x19>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x360,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x348,%rsp
movl   $0xe,0x8(%rsp)
lea    0xf4c(%rip),%rbx
lea    0xe0d(%rip),%r12
lea    0xe16(%rip),%r14
lea    0x8(%rsp),%rbp
lea    0xdc6(%rip),%r15
movl   $0x0,0xc(%rsp)
lea    0x20(%rsp),%r13
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
mov    0x8(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xc,%eax
ja     12c7 <main+0xc7>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   1120 <sep@plt>
lea    0xdb5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
lea    0xdab(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1110 <readArray@plt>
jmp    14d9 <main+0x2d9>
lea    0x102f(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0xd,0x8(%rsp)
jne    1250 <main+0x50>
jmp    14eb <main+0x2eb>
xor    %eax,%eax
call   1120 <sep@plt>
lea    0xd7f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    14cd <main+0x2cd>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1070 <min@plt>
mov    %r12,%rbp
mov    %eax,%r12d
xor    %eax,%eax
call   1120 <sep@plt>
movslq %r12d,%rsi
mov    %rbp,%r12
lea    0x8(%rsp),%rbp
movsd  0x20(%rsp,%rsi,8),%xmm0
lea    0xd53(%rip),%rdi
jmp    135a <main+0x15a>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1080 <max@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1120 <sep@plt>
movslq %ebp,%rsi
lea    0x8(%rsp),%rbp
movsd  0x20(%rsp,%rsi,8),%xmm0
lea    0xd47(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
jmp    14d9 <main+0x2d9>
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   10a0 <average@plt>
lea    0xd41(%rip),%rdi
jmp    149f <main+0x29f>
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   10d0 <aboveAverage@plt>
lea    0xd31(%rip),%rdi
jmp    147a <main+0x27a>
lea    0xd38(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x10(%rsp),%ebp
mov    0x4(%rsp),%edx
mov    %ebp,%edi
mov    %r13,%rsi
call   10b0 <find@plt>
test   %eax,%eax
lea    0xd22(%rip),%rdx
lea    0xd1d(%rip),%rax
cmove  %rax,%rdx
lea    0xcfc(%rip),%rdi
mov    %ebp,%esi
lea    0x8(%rsp),%rbp
xor    %eax,%eax
call   1060 <printf@plt>
jmp    14d9 <main+0x2d9>
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcee(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
xor    %eax,%eax
call   1120 <sep@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   10c0 <occurrences@plt>
lea    0xcc0(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    %eax,%esi
mov    $0x1,%al
call   1060 <printf@plt>
jmp    14d9 <main+0x2d9>
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1090 <pairs@plt>
lea    0xcb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    14d9 <main+0x2d9>
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   10f0 <unpairsAverage@plt>
lea    0xcad(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
jmp    14d9 <main+0x2d9>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1030 <reverse@plt>
jmp    14c6 <main+0x2c6>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1050 <removeFives@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1120 <sep@plt>
mov    0x4(%rsp),%esi
mov    %r13,%rdi
call   1100 <printArray@plt>
xor    %eax,%eax
call   1120 <sep@plt>
cmpl   $0xd,0x8(%rsp)
jne    1250 <main+0x50>
movl   $0xffffffff,0xc(%rsp)
ff
mov    0xc(%rsp),%eax
add    $0x348,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [402 x i8] c"\0A\0AArray manipulation:\0A=================================\0A1. Read array.\0A2. Print array.\0A3. Print Min\0A4. Print Max\0A5. Print average\0A6. Print number of values above average\0A7. Find value in array\0A8. Count number of occurrences of value in array\0A9. Count pairs in array\0A10. Average of unpair values in array\0A11. Reverse array elements inplace\0A12. Remove values dividable by 5 from array\0A13. Quit\0A\00"
@.str.1 = [16 x i8] c"\0AEnter choice: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Enter array size: \00"
@.str.4 = [22 x i8] c"Enter array elments: \00"
@.str.5 = [17 x i8] c"Array elements: \00"
@.str.6 = [32 x i8] c"Min index: %d, Min value: %.2f\0A\00"
@.str.7 = [32 x i8] c"Max index: %d, Max value: %.2f\0A\00"
@.str.8 = [15 x i8] c"Average: %.2f\0A\00"
@.str.9 = [19 x i8] c"Above average: %d\0A\00"
@.str.10 = [14 x i8] c"Enter value: \00"
@.str.11 = [20 x i8] c"Value %d %s found!\0A\00"
@.str.12 = [2 x i8] c"\08\00"
@.str.13 = [4 x i8] c"not\00"
@.str.14 = [4 x i8] c"%lf\00"
@.str.15 = [32 x i8] c"Value %.f occurred %d time(s)!\0A\00"
@.str.16 = [29 x i8] c"Number of pair values is %d\0A\00"
@.str.17 = [32 x i8] c"Average of unpair values: %.2f\0A\00"
@.str.18 = [21 x i8] c"Not a valid choice!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x double]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 0, i32* %1
store i32 14, i32* %2
br label %9
9: ; preds = %129, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
switch i32 %13, label %126 [
i32 1, label %14
i32 2, label %23
i32 3, label %30
i32 4, label %42
i32 5, label %54
i32 6, label %61
i32 7, label %68
i32 8, label %82
i32 9, label %93
i32 10, label %100
i32 11, label %107
i32 12, label %116
i32 13, label %125
]
14: ; preds = %9
%15 = call i32 (...) @sep()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%19 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%20 = load i32, i32* %3
%21 = call i32 @readArray(double* %19, i32 %20)
%22 = call i32 (...) @sep()
br label %128
23: ; preds = %9
%24 = call i32 (...) @sep()
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%26 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%27 = load i32, i32* %3
%28 = call i32 @printArray(double* %26, i32 %27)
%29 = call i32 (...) @sep()
br label %128
30: ; preds = %9
%31 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%32 = load i32, i32* %3
%33 = call i32 @min(double* %31, i32 %32)
store i32 %33, i32* %5
%34 = call i32 (...) @sep()
%35 = load i32, i32* %5
%36 = load i32, i32* %5
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 %37
%39 = load double, double* %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %35, double %39)
%41 = call i32 (...) @sep()
br label %128
42: ; preds = %9
%43 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%44 = load i32, i32* %3
%45 = call i32 @max(double* %43, i32 %44)
store i32 %45, i32* %6
%46 = call i32 (...) @sep()
%47 = load i32, i32* %6
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 %49
%51 = load double, double* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %47, double %51)
%53 = call i32 (...) @sep()
br label %128
54: ; preds = %9
%55 = call i32 (...) @sep()
%56 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%57 = load i32, i32* %3
%58 = call double @average(double* %56, i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), double %58)
%60 = call i32 (...) @sep()
br label %128
61: ; preds = %9
%62 = call i32 (...) @sep()
%63 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%64 = load i32, i32* %3
%65 = call i32 @aboveAverage(double* %63, i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %65)
%67 = call i32 (...) @sep()
br label %128
68: ; preds = %9
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%70 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%71 = call i32 (...) @sep()
%72 = load i32, i32* %7
%73 = load i32, i32* %7
%74 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%75 = load i32, i32* %3
%76 = call i32 @find(i32 %73, double* %74, i32 %75)
%77 = icmp ne i32 %76, 0
%78 = zext i1 %77 to i64
%79 = select i1 %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %72, i8* %79)
%81 = call i32 (...) @sep()
br label %128
82: ; preds = %9
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%84 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double* %8)
%85 = call i32 (...) @sep()
%86 = load double, double* %8
%87 = load double, double* %8
%88 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%89 = load i32, i32* %3
%90 = call i32 @occurrences(double %87, double* %88, i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), double %86, i32 %90)
%92 = call i32 (...) @sep()
br label %128
93: ; preds = %9
%94 = call i32 (...) @sep()
%95 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%96 = load i32, i32* %3
%97 = call i32 @pairs(double* %95, i32 %96)
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0), i32 %97)
%99 = call i32 (...) @sep()
br label %128
100: ; preds = %9
%101 = call i32 (...) @sep()
%102 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%103 = load i32, i32* %3
%104 = call double @unpairsAverage(double* %102, i32 %103)
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), double %104)
%106 = call i32 (...) @sep()
br label %128
107: ; preds = %9
%108 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%109 = load i32, i32* %3
%110 = call i32 @reverse(double* %108, i32 %109)
%111 = call i32 (...) @sep()
%112 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%113 = load i32, i32* %3
%114 = call i32 @printArray(double* %112, i32 %113)
%115 = call i32 (...) @sep()
br label %128
116: ; preds = %9
%117 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%118 = load i32, i32* %3
%119 = call i32 @removeFives(double* %117, i32 %118)
store i32 %119, i32* %3
%120 = call i32 (...) @sep()
%121 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%122 = load i32, i32* %3
%123 = call i32 @printArray(double* %121, i32 %122)
%124 = call i32 (...) @sep()
br label %128
125: ; preds = %9
store i32 0, i32* %1
br label %133
126: ; preds = %9
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0))
br label %128
128: ; preds = %126, %116, %107, %100, %93, %82, %68, %61, %54, %42, %30, %23, %14
br label %129
129: ; preds = %128
%130 = load i32, i32* %2
%131 = icmp ne i32 %130, 13
br i1 %131, label %9, label %132
132: ; preds = %129
store i32 -1, i32* %1
br label %133
133: ; preds = %132, %125
%134 = load i32, i32* %1
ret i32 %134
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"\0AEnter choice: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Enter array size: \00"
@.str.4 = [22 x i8] c"Enter array elments: \00"
@.str.5 = [17 x i8] c"Array elements: \00"
@.str.6 = [32 x i8] c"Min index: %d, Min value: %.2f\0A\00"
@.str.7 = [32 x i8] c"Max index: %d, Max value: %.2f\0A\00"
@.str.8 = [15 x i8] c"Average: %.2f\0A\00"
@.str.9 = [19 x i8] c"Above average: %d\0A\00"
@.str.10 = [14 x i8] c"Enter value: \00"
@.str.11 = [20 x i8] c"Value %d %s found!\0A\00"
@.str.12 = [2 x i8] c"\08\00"
@.str.13 = [4 x i8] c"not\00"
@.str.14 = [4 x i8] c"%lf\00"
@.str.15 = [32 x i8] c"Value %.f occurred %d time(s)!\0A\00"
@.str.16 = [29 x i8] c"Number of pair values is %d\0A\00"
@.str.17 = [32 x i8] c"Average of unpair values: %.2f\0A\00"
@str = [401 x i8] c"\0A\0AArray manipulation:\0A=================================\0A1. Read array.\0A2. Print array.\0A3. Print Min\0A4. Print Max\0A5. Print average\0A6. Print number of values above average\0A7. Find value in array\0A8. Count number of occurrences of value in array\0A9. Count pairs in array\0A10. Average of unpair values in array\0A11. Reverse array elements inplace\0A12. Remove values dividable by 5 from array\0A13. Quit\00"
@str.19 = [20 x i8] c"Not a valid choice!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x double]
%4 = alloca i32
%5 = alloca double
%6 = bitcast i32* %1 to i8*
store i32 14, i32* %1
%7 = bitcast i32* %2 to i8*
%8 = bitcast [100 x double]* %3 to i8*
%9 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 0
%10 = bitcast double* %5 to i8*
%11 = bitcast i32* %4 to i8*
br label %12
12: ; preds = %109, %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([401 x i8], [401 x i8]* @str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
switch i32 %16, label %107 [
i32 1, label %17
i32 2, label %25
i32 3, label %31
i32 4, label %40
i32 5, label %49
i32 6, label %55
i32 7, label %61
i32 8, label %72
i32 9, label %81
i32 10, label %87
i32 11, label %93
i32 12, label %100
i32 13, label %112
]
17: ; preds = %12
%18 = call i32 (...) @sep()
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = call i32 @readArray(double* %9, i32 %22)
%24 = call i32 (...) @sep()
br label %109
25: ; preds = %12
%26 = call i32 (...) @sep()
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = call i32 @printArray(double* %9, i32 %28)
%30 = call i32 (...) @sep()
br label %109
31: ; preds = %12
%32 = load i32, i32* %2
%33 = call i32 @min(double* %9, i32 %32)
%34 = call i32 (...) @sep()
%35 = sext i32 %33 to i64
%36 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 %35
%37 = load double, double* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %33, double %37)
%39 = call i32 (...) @sep()
br label %109
40: ; preds = %12
%41 = load i32, i32* %2
%42 = call i32 @max(double* %9, i32 %41)
%43 = call i32 (...) @sep()
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 %44
%46 = load double, double* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %42, double %46)
%48 = call i32 (...) @sep()
br label %109
49: ; preds = %12
%50 = call i32 (...) @sep()
%51 = load i32, i32* %2
%52 = call double @average(double* %9, i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), double %52)
%54 = call i32 (...) @sep()
br label %109
55: ; preds = %12
%56 = call i32 (...) @sep()
%57 = load i32, i32* %2
%58 = call i32 @aboveAverage(double* %9, i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %58)
%60 = call i32 (...) @sep()
br label %109
61: ; preds = %12
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%64 = call i32 (...) @sep()
%65 = load i32, i32* %4
%66 = load i32, i32* %2
%67 = call i32 @find(i32 %65, double* %9, i32 %66)
%68 = icmp eq i32 %67, 0
%69 = select i1 %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %65, i8* %69)
%71 = call i32 (...) @sep()
br label %109
72: ; preds = %12
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%74 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), double* %5)
%75 = call i32 (...) @sep()
%76 = load double, double* %5
%77 = load i32, i32* %2
%78 = call i32 @occurrences(double %76, double* %9, i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), double %76, i32 %78)
%80 = call i32 (...) @sep()
br label %109
81: ; preds = %12
%82 = call i32 (...) @sep()
%83 = load i32, i32* %2
%84 = call i32 @pairs(double* %9, i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0), i32 %84)
%86 = call i32 (...) @sep()
br label %109
87: ; preds = %12
%88 = call i32 (...) @sep()
%89 = load i32, i32* %2
%90 = call double @unpairsAverage(double* %9, i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), double %90)
%92 = call i32 (...) @sep()
br label %109
93: ; preds = %12
%94 = load i32, i32* %2
%95 = call i32 @reverse(double* %9, i32 %94)
%96 = call i32 (...) @sep()
%97 = load i32, i32* %2
%98 = call i32 @printArray(double* %9, i32 %97)
%99 = call i32 (...) @sep()
br label %109
100: ; preds = %12
%101 = load i32, i32* %2
%102 = call i32 @removeFives(double* %9, i32 %101)
store i32 %102, i32* %2
%103 = call i32 (...) @sep()
%104 = load i32, i32* %2
%105 = call i32 @printArray(double* %9, i32 %104)
%106 = call i32 (...) @sep()
br label %109
107: ; preds = %12
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.19, i64 0, i64 0))
br label %109
109: ; preds = %17, %25, %31, %40, %49, %55, %61, %72, %81, %87, %93, %100, %107
%110 = load i32, i32* %1
%111 = icmp eq i32 %110, 13
br i1 %111, label %112, label %12
112: ; preds = %109, %12
%113 = phi i32 [ 0, %12 ], [ -1, %109 ]
ret i32 %113
}