#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 *, float *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Obrobka poslidovnostei drobovyx chysel.\n");
  printf("Pislya vvody kojnogo chysla natyskaite <Enter>");
  float suma;
  for (int i = 1; i <= 5; i++) {
    float number;
    printf("\n -> ");
    scanf("%f", &number);
    suma += number;
    printf("%f\n", suma / i);
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     11c7 <main+0x97>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x32>
lea    0xe97(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xece(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec3(%rip),%r12
lea    0x4(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
lea    0xeaf(%rip),%rbx
movsd  0xe67(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
movsd  0xe3d(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
movsd  0xe16(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
movsd  0xdef(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
movsd  0xdc8(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdfe(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Obrobka poslidovnostei drobovyx chysel.\0A\00"
@.str.1 = [47 x i8] c"Pislya vvody kojnogo chysla natyskaite <Enter>\00"
@.str.2 = [6 x i8] c"\0A -> \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 5
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%13 = load float, float* %4
%14 = load float, float* %2
%15 = fadd float %14, %13
store float %15, float* %2
%16 = load float, float* %2
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to float
%19 = fdiv float %16, %18
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %20)
br label %22
22: ; preds = %10
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %7
25: ; preds = %7
%26 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"Pislya vvody kojnogo chysla natyskaite <Enter>\00"
@.str.2 = [6 x i8] c"\0A -> \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [6 x i8] c"PAUSE\00"
@str = [40 x i8] c"Obrobka poslidovnostei drobovyx chysel.\00"
define i32 @main() {
%1 = alloca float
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%4 = bitcast float* %1 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0x7FF8000000000000)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0x7FF8000000000000)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0x7FF8000000000000)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0x7FF8000000000000)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0x7FF8000000000000)
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}