#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 *);
int main() {
  int x;
  double sum;
  double average;
  int cnt = 0;
  int number[100];
  int choice = 0;
  scanf("%d", &x);
  while (x != -1) {
    number[cnt] = x;
    sum += x;
    cnt++;
    scanf("%d", &x);
  }
  average = sum / cnt;
  if (cnt > 0) {
    printf("The average is:%f\n", average);
  }
  printf("Now you can choose to show the number which have a diff to the "
         "average.");
  printf("You can choose from the list:\n");
  printf("1. >\n");
  printf("2. <\n");
  printf("3. >=\n");
  printf("4. <=\n");
  printf("Now Enter your choice(The number please.):");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    printf("The numbers larger than(>) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] > average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 2:
    printf("The numbers larger than(<) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] < average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 3:
    printf("The numbers larger than(>=) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] >= average) {
        printf(" %d ", number[i]);
      }
    }
    break;
  case 4:
    printf("And the numbers larger than(<=) the average(%f) are:\n", average);
    for (int i = 0; i <= cnt; i++) {
      if (number[i] >= average) {
        printf(" %d \f", number[i]);
      }
    }
    break;
  default:
    printf("Skipped");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1b4(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1198 <main+0x78>
mov    -0x8(%rbp),%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
cvtsi2sdl -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    0xe86(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1153 <main+0x33>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    11c8 <main+0xa8>
movsd  -0x18(%rbp),%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x1d1(%rbp)
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d1(%rbp),%al
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
lea    0xdc1(%rip),%rdi
lea    -0x1b4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1b4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x1d0(%rbp)
sub    $0x3,%eax
ja     1495 <main+0x375>
mov    -0x1d0(%rbp),%rax
lea    0xd7c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  -0x18(%rbp),%xmm0
lea    0xe39(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1309 <main+0x1e9>
movslq -0x1b8(%rbp),%rax
cvtsi2sdl -0x1b0(%rbp,%rax,4),%xmm0
ff ff
ucomisd -0x18(%rbp),%xmm0
jbe    12f0 <main+0x1d0>
movslq -0x1b8(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f5 <main+0x1d5>
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%rbp)
jmp    12aa <main+0x18a>
jmp    14a3 <main+0x383>
movsd  -0x18(%rbp),%xmm0
lea    0xdee(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x1bc(%rbp)
mov    -0x1bc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     138e <main+0x26e>
movslq -0x1bc(%rbp),%rax
cvtsi2sdl -0x1b0(%rbp,%rax,4),%xmm1
ff ff
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1375 <main+0x255>
movslq -0x1bc(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    137a <main+0x25a>
mov    -0x1bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1bc(%rbp)
jmp    132b <main+0x20b>
jmp    14a3 <main+0x383>
movsd  -0x18(%rbp),%xmm0
lea    0xd9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c0(%rbp)
mov    -0x1c0(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     140f <main+0x2ef>
movslq -0x1c0(%rbp),%rax
cvtsi2sdl -0x1b0(%rbp,%rax,4),%xmm0
ff ff
ucomisd -0x18(%rbp),%xmm0
jb     13f6 <main+0x2d6>
movslq -0x1c0(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xd14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13fb <main+0x2db>
mov    -0x1c0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c0(%rbp)
jmp    13b0 <main+0x290>
jmp    14a3 <main+0x383>
movsd  -0x18(%rbp),%xmm0
lea    0xd4b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c4(%rbp)
mov    -0x1c4(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1490 <main+0x370>
movslq -0x1c4(%rbp),%rax
cvtsi2sdl -0x1b0(%rbp,%rax,4),%xmm0
ff ff
ucomisd -0x18(%rbp),%xmm0
jb     1477 <main+0x357>
movslq -0x1c4(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    147c <main+0x35c>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
jmp    1431 <main+0x311>
jmp    14a3 <main+0x383>
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1a8,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
mov    $0x1,%r15d
cmp    $0xffffffff,%eax
je     11db <main+0xab>
xor    %ebx,%ebx
lea    0xea9(%rip),%r14
lea    0x8(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,0x10(%rsp,%rbx,4)
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mov    0x8(%rsp),%eax
cmp    $0xffffffff,%eax
jne    1180 <main+0x50>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
test   %ebx,%ebx
movsd  %xmm0,(%rsp)
je     11e8 <main+0xb8>
lea    0xe4f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebx
mov    %rbx,%r15
jmp    11e8 <main+0xb8>
movsd  0xe1d(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf81(%rip),%rdi
call   1030 <puts@plt>
lea    0xf93(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf85(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     12bb <main+0x18b>
lea    0xda4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe2d(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
lea    0xe46(%rip),%r14
xor    %ebx,%ebx
jmp    1299 <main+0x169>
add    $0x1,%rbx
cmp    %rbx,%r15
je     12c9 <main+0x199>
mov    0x10(%rsp,%rbx,4),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
ucomisd %xmm1,%xmm0
jbe    1290 <main+0x160>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
jmp    1290 <main+0x160>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xdf6(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
lea    0xdd9(%rip),%r14
xor    %ebx,%ebx
jmp    1309 <main+0x1d9>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     12c9 <main+0x199>
mov    0x10(%rsp,%rbx,4),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
ucomisd %xmm0,%xmm1
jbe    1300 <main+0x1d0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
jmp    1300 <main+0x1d0>
lea    0xdd6(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
lea    0xd88(%rip),%r14
xor    %ebx,%ebx
jmp    135d <main+0x22d>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r15
je     12c9 <main+0x199>
mov    0x10(%rsp,%rbx,4),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
ucomisd %xmm1,%xmm0
jb     1350 <main+0x220>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
jmp    1350 <main+0x220>
lea    0xdb4(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
lea    0xdd2(%rip),%r14
xor    %ebx,%ebx
jmp    13bd <main+0x28d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     12c9 <main+0x199>
mov    0x10(%rsp,%rbx,4),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
ucomisd %xmm1,%xmm0
jb     13b0 <main+0x280>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
jmp    13b0 <main+0x280>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"The average is:%f\0A\00"
@.str.2 = [72 x i8] c"Now you can choose to show the number which have a diff to the average.\00"
@.str.3 = [31 x i8] c"You can choose from the list:\0A\00"
@.str.4 = [6 x i8] c"1. >\0A\00"
@.str.5 = [6 x i8] c"2. <\0A\00"
@.str.6 = [7 x i8] c"3. >=\0A\00"
@.str.7 = [7 x i8] c"4. <=\0A\00"
@.str.8 = [43 x i8] c"Now Enter your choice(The number please.):\00"
@.str.9 = [49 x i8] c"The numbers larger than(>) the average(%f) are:\0A\00"
@.str.10 = [5 x i8] c" %d \00"
@.str.11 = [49 x i8] c"The numbers larger than(<) the average(%f) are:\0A\00"
@.str.12 = [50 x i8] c"The numbers larger than(>=) the average(%f) are:\0A\00"
@.str.13 = [54 x i8] c"And the numbers larger than(<=) the average(%f) are:\0A\00"
@.str.14 = [6 x i8] c" %d \0C\00"
@.str.15 = [8 x i8] c"Skipped\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca [100 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %7
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %13
13: ; preds = %16, %0
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %19
store i32 %17, i32* %20
%21 = load i32, i32* %2
%22 = sitofp i32 %21 to double
%23 = load double, double* %3
%24 = fadd double %23, %22
store double %24, double* %3
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %13
28: ; preds = %13
%29 = load double, double* %3
%30 = load i32, i32* %5
%31 = sitofp i32 %30 to double
%32 = fdiv double %29, %31
store double %32, double* %4
%33 = load i32, i32* %5
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %28
%36 = load double, double* %4
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %36)
br label %38
38: ; preds = %35, %28
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%47 = load i32, i32* %7
switch i32 %47, label %152 [
i32 1, label %48
i32 2, label %74
i32 3, label %100
i32 4, label %126
]
48: ; preds = %38
%49 = load double, double* %4
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), double %49)
store i32 0, i32* %8
br label %51
51: ; preds = %70, %48
%52 = load i32, i32* %8
%53 = load i32, i32* %5
%54 = icmp sle i32 %52, %53
br i1 %54, label %55, label %73
55: ; preds = %51
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = sitofp i32 %59 to double
%61 = load double, double* %4
%62 = fcmp ogt double %60, %61
br i1 %62, label %63, label %69
63: ; preds = %55
%64 = load i32, i32* %8
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %63, %55
br label %70
70: ; preds = %69
%71 = load i32, i32* %8
%72 = add nsw i32 %71, 1
store i32 %72, i32* %8
br label %51
73: ; preds = %51
br label %154
74: ; preds = %38
%75 = load double, double* %4
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0), double %75)
store i32 0, i32* %9
br label %77
77: ; preds = %96, %74
%78 = load i32, i32* %9
%79 = load i32, i32* %5
%80 = icmp sle i32 %78, %79
br i1 %80, label %81, label %99
81: ; preds = %77
%82 = load i32, i32* %9
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = sitofp i32 %85 to double
%87 = load double, double* %4
%88 = fcmp olt double %86, %87
br i1 %88, label %89, label %95
89: ; preds = %81
%90 = load i32, i32* %9
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %89, %81
br label %96
96: ; preds = %95
%97 = load i32, i32* %9
%98 = add nsw i32 %97, 1
store i32 %98, i32* %9
br label %77
99: ; preds = %77
br label %154
100: ; preds = %38
%101 = load double, double* %4
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), double %101)
store i32 0, i32* %10
br label %103
103: ; preds = %122, %100
%104 = load i32, i32* %10
%105 = load i32, i32* %5
%106 = icmp sle i32 %104, %105
br i1 %106, label %107, label %125
107: ; preds = %103
%108 = load i32, i32* %10
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = sitofp i32 %111 to double
%113 = load double, double* %4
%114 = fcmp oge double %112, %113
br i1 %114, label %115, label %121
115: ; preds = %107
%116 = load i32, i32* %10
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %115, %107
br label %122
122: ; preds = %121
%123 = load i32, i32* %10
%124 = add nsw i32 %123, 1
store i32 %124, i32* %10
br label %103
125: ; preds = %103
br label %154
126: ; preds = %38
%127 = load double, double* %4
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0), double %127)
store i32 0, i32* %11
br label %129
129: ; preds = %148, %126
%130 = load i32, i32* %11
%131 = load i32, i32* %5
%132 = icmp sle i32 %130, %131
br i1 %132, label %133, label %151
133: ; preds = %129
%134 = load i32, i32* %11
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %135
%137 = load i32, i32* %136
%138 = sitofp i32 %137 to double
%139 = load double, double* %4
%140 = fcmp oge double %138, %139
br i1 %140, label %141, label %147
141: ; preds = %133
%142 = load i32, i32* %11
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 %143
%145 = load i32, i32* %144
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %145)
br label %147
147: ; preds = %141, %133
br label %148
148: ; preds = %147
%149 = load i32, i32* %11
%150 = add nsw i32 %149, 1
store i32 %150, i32* %11
br label %129
151: ; preds = %129
br label %154
152: ; preds = %38
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
br label %154
154: ; preds = %152, %151, %125, %99, %73
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"The average is:%f\0A\00"
@.str.2 = [72 x i8] c"Now you can choose to show the number which have a diff to the average.\00"
@.str.8 = [43 x i8] c"Now Enter your choice(The number please.):\00"
@.str.9 = [49 x i8] c"The numbers larger than(>) the average(%f) are:\0A\00"
@.str.10 = [5 x i8] c" %d \00"
@.str.11 = [49 x i8] c"The numbers larger than(<) the average(%f) are:\0A\00"
@.str.12 = [50 x i8] c"The numbers larger than(>=) the average(%f) are:\0A\00"
@.str.13 = [54 x i8] c"And the numbers larger than(<=) the average(%f) are:\0A\00"
@.str.14 = [6 x i8] c" %d \0C\00"
@.str.15 = [8 x i8] c"Skipped\00"
@str = [30 x i8] c"You can choose from the list:\00"
@str.16 = [5 x i8] c"1. >\00"
@str.17 = [5 x i8] c"2. <\00"
@str.18 = [6 x i8] c"3. >=\00"
@str.19 = [6 x i8] c"4. <=\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast [100 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
br i1 %9, label %30, label %10
10: ; preds = %0, %10
%11 = phi i64 [ %17, %10 ], [ 0, %0 ]
%12 = phi i32 [ %19, %10 ], [ %8, %0 ]
%13 = phi double [ %16, %10 ], [ undef, %0 ]
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %11
store i32 %12, i32* %14
%15 = sitofp i32 %12 to double
%16 = fadd double %13, %15
%17 = add nuw i64 %11, 1
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %10
21: ; preds = %10
%22 = trunc i64 %17 to i32
%23 = sitofp i32 %22 to double
%24 = fdiv double %16, %23
%25 = icmp eq i32 %22, 0
br i1 %25, label %30, label %26
26: ; preds = %21
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %24)
%28 = add i64 %11, 2
%29 = and i64 %28, 4294967295
br label %30
30: ; preds = %0, %26, %21
%31 = phi double [ %24, %26 ], [ %24, %21 ], [ 0x7FF8000000000000, %0 ]
%32 = phi i64 [ %29, %26 ], [ 1, %21 ], [ 1, %0 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.16, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.17, i64 0, i64 0))
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.18, i64 0, i64 0))
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.19, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%41 = load i32, i32* %3
switch i32 %41, label %94 [
i32 1, label %42
i32 2, label %55
i32 3, label %68
i32 4, label %81
]
42: ; preds = %30
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), double %31)
br label %44
44: ; preds = %42, %52
%45 = phi i64 [ 0, %42 ], [ %53, %52 ]
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = sitofp i32 %47 to double
%49 = fcmp olt double %31, %48
br i1 %49, label %50, label %52
50: ; preds = %44
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %47)
br label %52
52: ; preds = %44, %50
%53 = add nuw nsw i64 %45, 1
%54 = icmp eq i64 %53, %32
br i1 %54, label %96, label %44
55: ; preds = %30
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0), double %31)
br label %57
57: ; preds = %55, %65
%58 = phi i64 [ 0, %55 ], [ %66, %65 ]
%59 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = sitofp i32 %60 to double
%62 = fcmp ogt double %31, %61
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %60)
br label %65
65: ; preds = %57, %63
%66 = add nuw nsw i64 %58, 1
%67 = icmp eq i64 %66, %32
br i1 %67, label %96, label %57
68: ; preds = %30
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.12, i64 0, i64 0), double %31)
br label %70
70: ; preds = %68, %78
%71 = phi i64 [ 0, %68 ], [ %79, %78 ]
%72 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = sitofp i32 %73 to double
%75 = fcmp ugt double %31, %74
br i1 %75, label %78, label %76
76: ; preds = %70
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %73)
br label %78
78: ; preds = %70, %76
%79 = add nuw nsw i64 %71, 1
%80 = icmp eq i64 %79, %32
br i1 %80, label %96, label %70
81: ; preds = %30
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0), double %31)
br label %83
83: ; preds = %81, %91
%84 = phi i64 [ 0, %81 ], [ %92, %91 ]
%85 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = sitofp i32 %86 to double
%88 = fcmp ugt double %31, %87
br i1 %88, label %91, label %89
89: ; preds = %83
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i32 %86)
br label %91
91: ; preds = %83, %89
%92 = add nuw nsw i64 %84, 1
%93 = icmp eq i64 %92, %32
br i1 %93, label %96, label %83
94: ; preds = %30
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
br label %96
96: ; preds = %91, %78, %65, %52, %94
ret i32 0
}