#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ strlen(char *);
int main() {
  int ilosc, i;
  float length = 0;
  scanf("%d", &ilosc);
  char stringArray[101][21];
  for (i = 0; i <= ilosc; i++) {
    gets(stringArray[i]);
  }
  for (i = ilosc; i >= 0; i--) {
    printf("%s\n", stringArray[i]);
    length += strlen(stringArray[i]);
  }
  printf("%.1f", length / ilosc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a2 <main+0x62>
movslq -0xc(%rbp),%rax
lea    -0x860(%rbp),%rdi
imul   $0x15,%rax,%rax
add    %rax,%rdi
call   1050 <gets@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <main+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1206 <main+0xc6>
movslq -0xc(%rbp),%rax
lea    -0x860(%rbp),%rsi
imul   $0x15,%rax,%rax
add    %rax,%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0xc(%rbp),%rax
lea    -0x860(%rbp),%rdi
imul   $0x15,%rax,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
cvtsi2ss %rax,%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11a8 <main+0x68>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x868,%rsp
lea    0xe9f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x8(%rsp),%eax
xorps  %xmm1,%xmm1
test   %eax,%eax
js     1203 <main+0xb3>
mov    $0xffffffffffffffff,%r14
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <gets@plt>
movslq 0x8(%rsp),%rax
add    $0x1,%r14
add    $0x15,%rbx
cmp    %rax,%r14
jl     1190 <main+0x40>
test   %eax,%eax
js     1200 <main+0xb0>
mov    %eax,%eax
lea    (%rax,%rax,4),%rcx
lea    (%rax,%rcx,4),%rbx
xorps  %xmm1,%xmm1
nopl   0x0(%rax,%rax,1)
movss  %xmm1,0xc(%rsp)
lea    (%rsp,%rbx,1),%r14
add    $0x10,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movss  0xc(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm1
add    $0xffffffffffffffeb,%rbx
cmp    $0xffffffffffffffeb,%rbx
jne    11c0 <main+0x70>
mov    0x8(%rsp),%eax
jmp    1203 <main+0xb3>
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xde7(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x868,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"%.1f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca [101 x [21 x i8]]
store i32 0, i32* %1
store float 0.000000e+00, float* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %5, i64 0, i64 %13
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %14, i64 0, i64 0
%16 = call i32 @gets(i8* %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %2
store i32 %21, i32* %3
br label %22
22: ; preds = %39, %20
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %42
25: ; preds = %22
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %5, i64 0, i64 %27
%29 = getelementptr inbounds [21 x i8], [21 x i8]* %28, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %5, i64 0, i64 %32
%34 = getelementptr inbounds [21 x i8], [21 x i8]* %33, i64 0, i64 0
%35 = call i64 @strlen(i8* %34)
%36 = sitofp i64 %35 to float
%37 = load float, float* %4
%38 = fadd float %37, %36
store float %38, float* %4
br label %39
39: ; preds = %25
%40 = load i32, i32* %3
%41 = add nsw i32 %40, -1
store i32 %41, i32* %3
br label %22
42: ; preds = %22
%43 = load float, float* %4
%44 = load i32, i32* %2
%45 = sitofp i32 %44 to float
%46 = fdiv float %43, %45
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %47)
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%.1f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x [21 x i8]]
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %2, i64 0, i64 0, i64 0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %32, label %12
8: ; preds = %12
%9 = icmp sgt i32 %17, -1
br i1 %9, label %10, label %32
10: ; preds = %8
%11 = zext i32 %17 to i64
br label %20
12: ; preds = %0, %12
%13 = phi i64 [ %16, %12 ], [ 0, %0 ]
%14 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %2, i64 0, i64 %13, i64 0
%15 = call i32 @gets(i8* %14)
%16 = add nuw nsw i64 %13, 1
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %13, %18
br i1 %19, label %12, label %8
20: ; preds = %10, %20
%21 = phi i64 [ %11, %10 ], [ %28, %20 ]
%22 = phi float [ 0.000000e+00, %10 ], [ %27, %20 ]
%23 = getelementptr inbounds [101 x [21 x i8]], [101 x [21 x i8]]* %2, i64 0, i64 %21, i64 0
%24 = call i32 @puts(i8* %23)
%25 = call i64 @strlen(i8* %23)
%26 = sitofp i64 %25 to float
%27 = fadd float %22, %26
%28 = add nsw i64 %21, -1
%29 = icmp eq i64 %21, 0
br i1 %29, label %30, label %20
30: ; preds = %20
%31 = load i32, i32* %1
br label %32
32: ; preds = %0, %30, %8
%33 = phi i32 [ %17, %8 ], [ %31, %30 ], [ %6, %0 ]
%34 = phi float [ 0.000000e+00, %8 ], [ %27, %30 ], [ 0.000000e+00, %0 ]
%35 = sitofp i32 %33 to float
%36 = fdiv float %34, %35
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %37)
ret i32 0
}