#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 *);
main() {
  system("title 23_Cascallar_Autrán_Manuel");
  system("color 88");
  system("cls");
  printf("CANTIDADE DE NUMEROS, A SUA SUMA E MENOR E MAIOR\n");
  printf("================================================\n");
  int b;
  float a, resultado, menor, maior, z;
  printf("Introduce os n\243meros:\n");
  scanf("%f", &a);
  maior = a;
  menor = a;
  b = 1;
  resultado = a;
  do {
    scanf("%f", &a);
    z = a;
    resultado = resultado + a;
    b = b + 1;
    if (z > maior && z != 0) {
      maior = z;
    }
    if (z < menor && z != 0) {
      menor = z;
    }
  } while (a != 0);
  b = b - 1;
  printf("A cantidade de n\243meros introducida \202:\n");
  printf("%d\n", b);
  printf("O resultado da suma de t\242dolos n\243meros introducidos \202:\n");
  printf("%.2f\n", resultado);
  printf("O n\243mero menor \202:\n");
  printf("%.2f\n", menor);
  printf("O n\243mero maior \202:\n");
  printf("%.2f\n", maior);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
lea    0xecd(%rip),%rdi
call   1030 <system@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf16(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xee1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    1229 <main+0xf9>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    121f <main+0xef>
jp     121f <main+0xef>
jmp    1229 <main+0xf9>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1262 <main+0x132>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1258 <main+0x128>
jp     1258 <main+0x128>
jmp    1262 <main+0x132>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1267 <main+0x137>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11c2 <main+0x92>
jp     11c2 <main+0x92>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe27(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe02(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe20(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xeb0(%rip),%rdi
call   1040 <system@plt>
lea    0xec6(%rip),%rdi
call   1040 <system@plt>
lea    0xec3(%rip),%rdi
call   1040 <system@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%r14
lea    0xc(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
xor    %ebx,%ebx
movss  0xc(%rsp),%xmm0
movaps %xmm0,%xmm1
movss  %xmm0,0x8(%rsp)
jmp    11ff <main+0xbf>
nopl   0x0(%rax,%rax,1)
movss  0x8(%rsp),%xmm2
addss  %xmm3,%xmm2
movss  %xmm2,0x8(%rsp)
add    $0x1,%ebx
ucomiss %xmm4,%xmm3
movaps %xmm6,%xmm2
cmpltss %xmm3,%xmm2
andps  %xmm2,%xmm1
andnps %xmm6,%xmm2
orps   %xmm1,%xmm2
cmpltss %xmm5,%xmm3
andps  %xmm3,%xmm0
andnps %xmm5,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm1
movaps %xmm2,%xmm0
jne    11ff <main+0xbf>
jnp    124d <main+0x10d>
movaps %xmm0,0x10(%rsp)
movaps %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
movaps 0x10(%rsp),%xmm6
xorps  %xmm4,%xmm4
movss  0xc(%rsp),%xmm3
ucomiss %xmm3,%xmm4
movaps %xmm3,%xmm1
jne    1232 <main+0xf2>
movaps %xmm3,%xmm1
jp     1232 <main+0xf2>
movaps %xmm6,%xmm1
movaps %xmm3,%xmm0
movaps 0x20(%rsp),%xmm5
jne    11c0 <main+0x80>
movaps %xmm3,%xmm0
jp     11c0 <main+0x80>
movaps %xmm5,%xmm0
jmp    11c0 <main+0x80>
lea    0xe66(%rip),%rdi
movaps %xmm3,0x10(%rsp)
movaps %xmm2,0x20(%rsp)
call   1030 <puts@plt>
lea    0xdc8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xda6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
movaps 0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd5d(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"title 23_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [9 x i8] c"color 88\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.3 = [50 x i8] c"CANTIDADE DE NUMEROS, A SUA SUMA E MENOR E MAIOR\0A\00"
@.str.4 = [50 x i8] c"================================================\0A\00"
@.str.5 = [23 x i8] c"Introduce os n\A3meros:\0A\00"
@.str.6 = [3 x i8] c"%f\00"
@.str.7 = [39 x i8] c"A cantidade de n\A3meros introducida \82:\0A\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@.str.9 = [56 x i8] c"O resultado da suma de t\A2dolos n\A3meros introducidos \82:\0A\00"
@.str.10 = [6 x i8] c"%.2f\0A\00"
@.str.11 = [19 x i8] c"O n\A3mero menor \82:\0A\00"
@.str.12 = [19 x i8] c"O n\A3mero maior \82:\0A\00"
@.str.13 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %3)
%15 = load float, float* %3
store float %15, float* %6
%16 = load float, float* %3
store float %16, float* %5
store i32 1, i32* %2
%17 = load float, float* %3
store float %17, float* %4
br label %18
18: ; preds = %44, %0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %3)
%20 = load float, float* %3
store float %20, float* %7
%21 = load float, float* %4
%22 = load float, float* %3
%23 = fadd float %21, %22
store float %23, float* %4
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = load float, float* %7
%27 = load float, float* %6
%28 = fcmp ogt float %26, %27
br i1 %28, label %29, label %34
29: ; preds = %18
%30 = load float, float* %7
%31 = fcmp une float %30, 0.000000e+00
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = load float, float* %7
store float %33, float* %6
br label %34
34: ; preds = %32, %29, %18
%35 = load float, float* %7
%36 = load float, float* %5
%37 = fcmp olt float %35, %36
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = load float, float* %7
%40 = fcmp une float %39, 0.000000e+00
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = load float, float* %7
store float %42, float* %5
br label %43
43: ; preds = %41, %38, %34
br label %44
44: ; preds = %43
%45 = load float, float* %3
%46 = fcmp une float %45, 0.000000e+00
br i1 %46, label %18, label %47
47: ; preds = %44
%48 = load i32, i32* %2
%49 = sub nsw i32 %48, 1
store i32 %49, i32* %2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%51 = load i32, i32* %2
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%54 = load float, float* %4
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%58 = load float, float* %5
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %59)
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%62 = load float, float* %6
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %63)
%65 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%66 = load i32, i32* %1
ret i32 %66
}

LLVM IR (-O2):
@.str = [34 x i8] c"title 23_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [9 x i8] c"color 88\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.6 = [3 x i8] c"%f\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@.str.10 = [6 x i8] c"%.2f\0A\00"
@.str.13 = [6 x i8] c"pause\00"
@str = [49 x i8] c"CANTIDADE DE NUMEROS, A SUA SUMA E MENOR E MAIOR\00"
@str.14 = [49 x i8] c"================================================\00"
@str.15 = [22 x i8] c"Introduce os n\A3meros:\00"
@str.16 = [38 x i8] c"A cantidade de n\A3meros introducida \82:\00"
@str.17 = [55 x i8] c"O resultado da suma de t\A2dolos n\A3meros introducidos \82:\00"
@str.18 = [18 x i8] c"O n\A3mero menor \82:\00"
@str.19 = [18 x i8] c"O n\A3mero maior \82:\00"
define i32 @main() {
%1 = alloca float
%2 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.14, i64 0, i64 0))
%7 = bitcast float* %1 to i8*
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%10 = load float, float* %1
br label %11
11: ; preds = %11, %0
%12 = phi float [ %10, %0 ], [ %18, %11 ]
%13 = phi float [ %10, %0 ], [ %26, %11 ]
%14 = phi float [ %10, %0 ], [ %23, %11 ]
%15 = phi i32 [ 1, %0 ], [ %19, %11 ]
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%17 = load float, float* %1
%18 = fadd float %12, %17
%19 = add nuw nsw i32 %15, 1
%20 = fcmp ogt float %17, %14
%21 = fcmp une float %17, 0.000000e+00
%22 = and i1 %20, %21
%23 = select i1 %22, float %17, float %14
%24 = fcmp olt float %17, %13
%25 = and i1 %24, %21
%26 = select i1 %25, float %17, float %13
br i1 %21, label %11, label %27
27: ; preds = %11
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.16, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %15)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.17, i64 0, i64 0))
%31 = fpext float %18 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.18, i64 0, i64 0))
%34 = fpext float %26 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %34)
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.19, i64 0, i64 0))
%37 = fpext float %23 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), double %37)
%39 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}