#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__ atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (1 == argc) {
    printf("Nombre de param\212tres insuffisant\n");
    return 1;
  }
  int i;
  float total = 0;
  for (i = 1; i < argc; ++i) {
    total += atof(argv[i]);
  }
  printf("%.1f", total / (argc - 1));
  return 0;
}


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    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    115e <main+0x3e>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d3 <main+0xb3>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a7 <main+0x87>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
cvtsi2ss %rax,%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x4d>
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
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
cmp    $0x1,%edi
jne    114f <main+0x1f>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    11c1 <main+0x91>
mov    %edi,%r14d
xorps  %xmm1,%xmm1
jle    119a <main+0x6a>
mov    %rsi,%r15
mov    %r14d,%ebp
xorps  %xmm1,%xmm1
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movss  %xmm1,0x4(%rsp)
mov    (%r15,%rbx,8),%rdi
call   1040 <atof@plt>
movss  0x4(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm1
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1170 <main+0x40>
add    $0xffffffff,%r14d
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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