#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abs(float);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float values[100];
  int countValues;
  float userValue;
  char userInput;
  float maxValue;
  float minValue;
  float avg;
  float sum;
  float nearestValue;
  FILE *file;
  avg = 0;
  sum = 0;
  file = fopen("values", "r");
  fscanf(file, "%i", &countValues);
  for (int i = 0; i < countValues; i++) {
    fscanf(file, " %f", &values[i]);
    sum += values[i];
    if (i == 0) {
      maxValue = values[i];
      minValue = values[i];
    }
    if (values[i] > maxValue) {
      maxValue = values[i];
    } else {
      if (values[i] < minValue) {
        minValue = values[i];
      }
    }
  }
  fclose(file);
  avg = sum / countValues;
  printf("[b] for maxvalue\n[s] for minvalue\n[a] for avg\n[n] for nearest "
         "value\n");
  printf("What do you want? ");
  scanf("%s", &userInput);
  switch (userInput) {
  case 'b':
    printf("%f", maxValue);
    break;
  case 's':
    printf("%f", minValue);
    break;
  case 'a':
    printf("%f", avg);
    break;
  case 'n':
    printf("What is your value? ");
    scanf("%f", &userValue);
    for (int i = 0; i < countValues; i++) {
      if (i == 0)
        nearestValue = values[i];
      if (abs(userValue - nearestValue) > abs(userValue - values[i]))
        nearestValue = values[i];
    }
    printf("The nearest value to your value is %f", nearestValue);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1b8(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1bc(%rbp)
ff
lea    0xebd(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x1c8(%rbp)
mov    -0x1c8(%rbp),%rdi
lea    0xea5(%rip),%rsi
lea    -0x1a4(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movl   $0x0,-0x1cc(%rbp)
mov    -0x1cc(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    12f2 <main+0x192>
mov    -0x1c8(%rbp),%rdi
movslq -0x1cc(%rbp),%rax
lea    -0x1a0(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
addss  -0x1bc(%rbp),%xmm0
ff
movss  %xmm0,-0x1bc(%rbp)
ff
cmpl   $0x0,-0x1cc(%rbp)
jne    1261 <main+0x101>
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1b0(%rbp)
ff
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1b4(%rbp)
ff
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
ucomiss -0x1b0(%rbp),%xmm0
jbe    129b <main+0x13b>
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1b0(%rbp)
ff
jmp    12d9 <main+0x179>
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm1
ff ff
movss  -0x1b4(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jbe    12d4 <main+0x174>
movslq -0x1cc(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1b4(%rbp)
ff
jmp    12d9 <main+0x179>
jmp    12de <main+0x17e>
mov    -0x1cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1cc(%rbp)
jmp    11c8 <main+0x68>
mov    -0x1c8(%rbp),%rdi
call   1040 <fclose@plt>
movss  -0x1bc(%rbp),%xmm0
ff
cvtsi2ssl -0x1a4(%rbp),%xmm1
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x1b8(%rbp)
ff
lea    0xd37(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x1d9(%rbp)
call   1050 <printf@plt>
mov    -0x1d9(%rbp),%al
lea    0xd62(%rip),%rdi
call   1050 <printf@plt>
mov    -0x1d9(%rbp),%al
lea    0xd63(%rip),%rdi
lea    -0x1a9(%rbp),%rsi
call   1070 <scanf@plt>
movsbl -0x1a9(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x1d8(%rbp)
sub    $0x12,%eax
ja     14e0 <main+0x380>
mov    -0x1d8(%rbp),%rax
lea    0xc7d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  -0x1b0(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd4c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14e0 <main+0x380>
movss  -0x1b4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd2d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14e0 <main+0x380>
movss  -0x1b8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd0e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14e0 <main+0x380>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xced(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movl   $0x0,-0x1d0(%rbp)
mov    -0x1d0(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    14c6 <main+0x366>
cmpl   $0x0,-0x1d0(%rbp)
jne    144d <main+0x2ed>
movslq -0x1d0(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1c0(%rbp)
ff
movss  -0x1a8(%rbp),%xmm0
ff
subss  -0x1c0(%rbp),%xmm0
ff
call   1030 <abs@plt>
mov    %eax,-0x1e0(%rbp)
movss  -0x1a8(%rbp),%xmm0
ff
movslq -0x1d0(%rbp),%rax
subss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x1e0(%rbp),%eax
cmp    %ecx,%eax
jle    14ad <main+0x34d>
movslq -0x1d0(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1c0(%rbp)
ff
jmp    14b2 <main+0x352>
mov    -0x1d0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d0(%rbp)
jmp    1416 <main+0x2b6>
movss  -0x1c0(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xbef(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1b8,%rsp
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r15
lea    0xebb(%rip),%rsi
lea    0x14(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
cmpl   $0x0,0x14(%rsp)
jle    1242 <main+0xd2>
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xee1(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1201 <main+0x91>
nopw   0x0(%rax,%rax,1)
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,0xc(%rsp)
add    $0x1,%rbx
movslq 0x14(%rsp),%rax
add    $0x4,%rbp
movss  %xmm3,0x10(%rsp)
movss  %xmm1,0x18(%rsp)
cmp    %rax,%rbx
jge    124b <main+0xdb>
lea    (%rsp,%rbp,1),%rdx
add    $0x20,%rdx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <fscanf@plt>
movss  0x20(%rsp,%rbx,4),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm3
test   %rbx,%rbx
je     1233 <main+0xc3>
movss  0x18(%rsp),%xmm1
movss  0x10(%rsp),%xmm3
ucomiss %xmm1,%xmm0
ja     11d0 <main+0x60>
ucomiss %xmm0,%xmm3
jbe    11d3 <main+0x63>
movaps %xmm0,%xmm3
jmp    11d3 <main+0x63>
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  %xmm3,0x18(%rsp)
movss  %xmm1,0x10(%rsp)
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    0x14(%rsp),%ebx
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xde7(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
movss  0x10(%rsp),%xmm1
movsbl 0xb(%rsp),%eax
add    $0xffffff9f,%eax
cmp    $0x12,%eax
ja     137c <main+0x20c>
lea    0xdf8(%rip),%r14
lea    0xd4b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
jmp    136b <main+0x1fb>
lea    0xd93(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdbd(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xd87(%rip),%r14
cmpl   $0x0,0x14(%rsp)
jle    136b <main+0x1fb>
xor    %ebx,%ebx
jmp    131e <main+0x1ae>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
movslq 0x14(%rsp),%rax
cmp    %rax,%rbx
jge    136b <main+0x1fb>
test   %rbx,%rbx
jne    1329 <main+0x1b9>
movss  0x20(%rsp),%xmm1
movss  %xmm1,0x10(%rsp)
movss  0x1c(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1040 <abs@plt>
mov    %eax,%ebp
movss  0x1c(%rsp),%xmm0
subss  0x20(%rsp,%rbx,4),%xmm0
call   1040 <abs@plt>
movss  0x10(%rsp),%xmm1
cmp    %eax,%ebp
jle    1310 <main+0x1a0>
movss  0x20(%rsp,%rbx,4),%xmm1
jmp    1310 <main+0x1a0>
movss  0x18(%rsp),%xmm1
jmp    136b <main+0x1fb>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"values\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [4 x i8] c" %f\00"
@.str.4 = [69 x i8] c"[b] for maxvalue\0A[s] for minvalue\0A[a] for avg\0A[n] for nearest value\0A\00"
@.str.5 = [19 x i8] c"What do you want? \00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%f\00"
@.str.8 = [21 x i8] c"What is your value? \00"
@.str.9 = [38 x i8] c"The nearest value to your value is %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x float]
%3 = alloca i32
%4 = alloca float
%5 = alloca i8
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %8
store float 0.000000e+00, float* %9
%14 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %14, i32** %11
%15 = load i32*, i32** %11
%16 = call i32 (i32*, i8*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
store i32 0, i32* %12
br label %17
17: ; preds = %70, %0
%18 = load i32, i32* %12
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %73
21: ; preds = %17
%22 = load i32*, i32** %11
%23 = load i32, i32* %12
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %24
%26 = call i32 (i32*, i8*, ...) @fscanf(i32* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %25)
%27 = load i32, i32* %12
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %28
%30 = load float, float* %29
%31 = load float, float* %9
%32 = fadd float %31, %30
store float %32, float* %9
%33 = load i32, i32* %12
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %44
35: ; preds = %21
%36 = load i32, i32* %12
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %37
%39 = load float, float* %38
store float %39, float* %6
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %41
%43 = load float, float* %42
store float %43, float* %7
br label %44
44: ; preds = %35, %21
%45 = load i32, i32* %12
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %46
%48 = load float, float* %47
%49 = load float, float* %6
%50 = fcmp ogt float %48, %49
br i1 %50, label %51, label %56
51: ; preds = %44
%52 = load i32, i32* %12
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %53
%55 = load float, float* %54
store float %55, float* %6
br label %69
56: ; preds = %44
%57 = load i32, i32* %12
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %58
%60 = load float, float* %59
%61 = load float, float* %7
%62 = fcmp olt float %60, %61
br i1 %62, label %63, label %68
63: ; preds = %56
%64 = load i32, i32* %12
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %65
%67 = load float, float* %66
store float %67, float* %7
br label %68
68: ; preds = %63, %56
br label %69
69: ; preds = %68, %51
br label %70
70: ; preds = %69
%71 = load i32, i32* %12
%72 = add nsw i32 %71, 1
store i32 %72, i32* %12
br label %17
73: ; preds = %17
%74 = load i32*, i32** %11
%75 = call i32 @fclose(i32* %74)
%76 = load float, float* %9
%77 = load i32, i32* %3
%78 = sitofp i32 %77 to float
%79 = fdiv float %76, %78
store float %79, float* %8
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%82 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%83 = load i8, i8* %5
%84 = sext i8 %83 to i32
switch i32 %84, label %138 [
i32 98, label %85
i32 115, label %89
i32 97, label %93
i32 110, label %97
]
85: ; preds = %73
%86 = load float, float* %6
%87 = fpext float %86 to double
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double %87)
br label %138
89: ; preds = %73
%90 = load float, float* %7
%91 = fpext float %90 to double
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double %91)
br label %138
93: ; preds = %73
%94 = load float, float* %8
%95 = fpext float %94 to double
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double %95)
br label %138
97: ; preds = %73
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%99 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), float* %4)
store i32 0, i32* %13
br label %100
100: ; preds = %131, %97
%101 = load i32, i32* %13
%102 = load i32, i32* %3
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %134
104: ; preds = %100
%105 = load i32, i32* %13
%106 = icmp eq i32 %105, 0
br i1 %106, label %107, label %112
107: ; preds = %104
%108 = load i32, i32* %13
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %109
%111 = load float, float* %110
store float %111, float* %10
br label %112
112: ; preds = %107, %104
%113 = load float, float* %4
%114 = load float, float* %10
%115 = fsub float %113, %114
%116 = call i32 @abs(float %115)
%117 = load float, float* %4
%118 = load i32, i32* %13
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %119
%121 = load float, float* %120
%122 = fsub float %117, %121
%123 = call i32 @abs(float %122)
%124 = icmp sgt i32 %116, %123
br i1 %124, label %125, label %130
125: ; preds = %112
%126 = load i32, i32* %13
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %127
%129 = load float, float* %128
store float %129, float* %10
br label %130
130: ; preds = %125, %112
br label %131
131: ; preds = %130
%132 = load i32, i32* %13
%133 = add nsw i32 %132, 1
store i32 %133, i32* %13
br label %100
134: ; preds = %100
%135 = load float, float* %10
%136 = fpext float %135 to double
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), double %136)
br label %138
138: ; preds = %73, %134, %93, %89, %85
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"values\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [4 x i8] c" %f\00"
@.str.5 = [19 x i8] c"What do you want? \00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%f\00"
@.str.8 = [21 x i8] c"What is your value? \00"
@.str.9 = [38 x i8] c"The nearest value to your value is %f\00"
@str = [68 x i8] c"[b] for maxvalue\0A[s] for minvalue\0A[a] for avg\0A[n] for nearest value\00"
define i32 @main() {
%1 = alloca [100 x float]
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
%5 = bitcast [100 x float]* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %23, label %12
12: ; preds = %39, %0
%13 = phi float [ undef, %0 ], [ %40, %39 ]
%14 = phi float [ undef, %0 ], [ %41, %39 ]
%15 = phi float [ 0.000000e+00, %0 ], [ %31, %39 ]
%16 = call i32 @fclose(i32* %8)
%17 = load i32, i32* %2
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
switch i32 %22, label %85 [
i32 98, label %80
i32 115, label %46
i32 97, label %47
i32 110, label %50
]
23: ; preds = %0, %39
%24 = phi i64 [ %42, %39 ], [ 0, %0 ]
%25 = phi float [ %31, %39 ], [ 0.000000e+00, %0 ]
%26 = phi float [ %41, %39 ], [ undef, %0 ]
%27 = phi float [ %40, %39 ], [ undef, %0 ]
%28 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 %24
%29 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %28)
%30 = load float, float* %28
%31 = fadd float %25, %30
%32 = icmp eq i64 %24, 0
%33 = select i1 %32, float %30, float %27
%34 = select i1 %32, float %30, float %26
%35 = fcmp ogt float %30, %33
br i1 %35, label %39, label %36
36: ; preds = %23
%37 = fcmp olt float %30, %34
br i1 %37, label %38, label %39
38: ; preds = %36
br label %39
39: ; preds = %23, %38, %36
%40 = phi float [ %33, %38 ], [ %33, %36 ], [ %30, %23 ]
%41 = phi float [ %30, %38 ], [ %34, %36 ], [ %34, %23 ]
%42 = add nuw nsw i64 %24, 1
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %23, label %12
46: ; preds = %12
br label %80
47: ; preds = %12
%48 = sitofp i32 %17 to float
%49 = fdiv float %15, %48
br label %80
50: ; preds = %12
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), float* %3)
%53 = load i32, i32* %2
%54 = icmp sgt i32 %53, 0
br i1 %54, label %55, label %80
55: ; preds = %50
%56 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 0
br label %57
57: ; preds = %55, %74
%58 = phi i64 [ 0, %55 ], [ %76, %74 ]
%59 = phi float [ undef, %55 ], [ %75, %74 ]
%60 = icmp eq i64 %58, 0
%61 = load float, float* %56
%62 = select i1 %60, float %61, float %59
%63 = load float, float* %3
%64 = fsub float %63, %62
%65 = call i32 @abs(float %64)
%66 = load float, float* %3
%67 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 %58
%68 = load float, float* %67
%69 = fsub float %66, %68
%70 = call i32 @abs(float %69)
%71 = icmp sgt i32 %65, %70
br i1 %71, label %72, label %74
72: ; preds = %57
%73 = load float, float* %67
br label %74
74: ; preds = %57, %72
%75 = phi float [ %73, %72 ], [ %62, %57 ]
%76 = add nuw nsw i64 %58, 1
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = icmp slt i64 %76, %78
br i1 %79, label %57, label %80
80: ; preds = %74, %50, %12, %46, %47
%81 = phi float [ %49, %47 ], [ %14, %46 ], [ %13, %12 ], [ undef, %50 ], [ %75, %74 ]
%82 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %47 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %46 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %12 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), %50 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), %74 ]
%83 = fpext float %81 to double
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %82, double %83)
br label %85
85: ; preds = %80, %12
ret i32 0
}