#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 24_Cascallar_Autrán_Manuel");
  system("color 88");
  system("cls");
  printf("SUMA DE CINCO NUMEROS INTRODUCIDOS POLO TECLADO\n");
  printf("===============================================\n");
  int b;
  float a, resultado;
  resultado = 0;
  b = 0;
  printf("Introduce os cinco n\243meros:\n");
  while (b < 5) {
    scanf("%f", &a);
    resultado = resultado + a;
    b++;
  }
  printf("O resultado da suma dos cinco n\243meros \202:\n");
  printf("%.2f\n\n", resultado);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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    0xee8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jge    11d3 <main+0xa3>
lea    0xf01(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119c <main+0x6c>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
call   1040 <system@plt>
lea    0xecb(%rip),%rdi
call   1040 <system@plt>
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdf2(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"title 24_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 = [49 x i8] c"SUMA DE CINCO NUMEROS INTRODUCIDOS POLO TECLADO\0A\00"
@.str.4 = [49 x i8] c"===============================================\0A\00"
@.str.5 = [29 x i8] c"Introduce os cinco n\A3meros:\0A\00"
@.str.6 = [3 x i8] c"%f\00"
@.str.7 = [42 x i8] c"O resultado da suma dos cinco n\A3meros \82:\0A\00"
@.str.8 = [7 x i8] c"%.2f\0A\0A\00"
@.str.9 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
store float 0.000000e+00, float* %4
store i32 0, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %11
11: ; preds = %14, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %3)
%16 = load float, float* %4
%17 = load float, float* %3
%18 = fadd float %16, %17
store float %18, float* %4
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %11
21: ; preds = %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double %24)
%26 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [34 x i8] c"title 24_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 = [7 x i8] c"%.2f\0A\0A\00"
@.str.9 = [6 x i8] c"pause\00"
@str = [48 x i8] c"SUMA DE CINCO NUMEROS INTRODUCIDOS POLO TECLADO\00"
@str.10 = [48 x i8] c"===============================================\00"
@str.11 = [28 x i8] c"Introduce os cinco n\A3meros:\00"
@str.12 = [41 x i8] c"O resultado da suma dos cinco n\A3meros \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 ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.10, i64 0, i64 0))
%7 = bitcast float* %1 to i8*
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, 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
%11 = fadd float %10, 0.000000e+00
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%13 = load float, float* %1
%14 = fadd float %11, %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%16 = load float, float* %1
%17 = fadd float %14, %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%19 = load float, float* %1
%20 = fadd float %17, %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %1)
%22 = load float, float* %1
%23 = fadd float %20, %22
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.12, i64 0, i64 0))
%25 = fpext float %23 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double %25)
%27 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}