#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 */
scalar_t__ atoi(char *);
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[], char *env[]) {
  float t = 0;
  int i;
  for (i = 1; i < argc; i++)
    t += atoi(argv[i]);
  printf("%f", (t / (argc - 1)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1183 <main+0x63>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
cvtsi2ss %rax,%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <main+0x29>
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xorps  %xmm0,%xmm0
cmp    $0x2,%edi
jl     116a <main+0x4a>
mov    %rsi,%r15
mov    %r14d,%ebp
xorps  %xmm0,%xmm0
mov    $0x1,%ebx
movss  %xmm0,0x4(%rsp)
mov    (%r15,%rbx,8),%rdi
call   1040 <atoi@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <main+0x20>
add    $0xffffffff,%r14d
xorps  %xmm1,%xmm1
cvtsi2ss %r14d,%xmm1
divss  %xmm1,%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca float
%9 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store float 0.000000e+00, float* %8
store i32 1, i32* %9
br label %10
10: ; preds = %24, %3
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i8**, i8*** %6
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i64 @atoi(i8* %19)
%21 = sitofp i64 %20 to float
%22 = load float, float* %8
%23 = fadd float %22, %21
store float %23, float* %8
br label %24
24: ; preds = %14
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %10
27: ; preds = %10
%28 = load float, float* %8
%29 = load i32, i32* %5
%30 = sub nsw i32 %29, 1
%31 = sitofp i32 %30 to float
%32 = fdiv float %28, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %32)
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 1, %5 ], [ %15, %7 ]
%9 = phi float [ 0.000000e+00, %5 ], [ %14, %7 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %8
%11 = load i8*, i8** %10
%12 = tail call i64 @atoi(i8* %11)
%13 = sitofp i64 %12 to float
%14 = fadd float %9, %13
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %17, label %7
17: ; preds = %7, %3
%18 = phi float [ 0.000000e+00, %3 ], [ %14, %7 ]
%19 = add nsw i32 %0, -1
%20 = sitofp i32 %19 to float
%21 = fdiv float %18, %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %21)
ret i32 0
}