#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 *, float *, float *, float *, float *);
int main() {
  float s1, s2, s3, s4, s5;
  float total, avg;
  printf("Enter the marks of each subject: ");
  scanf("%f %f %f %f %f", &s1, &s2, &s3, &s4, &s5);
  total = (s1 + s2 + s3 + s4 + s5);
  avg = (total / 500) * 100;
  printf("The total is %f and the average is %f\n", total, avg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe7c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe6c(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe83(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movaps %xmm0,%xmm1
divss  0xe80(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
mulss  0xe78(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xea2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter the marks of each subject: \00"
@.str.1 = [15 x i8] c"%f %f %f %f %f\00"
@.str.2 = [39 x i8] c"The total is %f and the average is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6)
%11 = load float, float* %2
%12 = load float, float* %3
%13 = fadd float %11, %12
%14 = load float, float* %4
%15 = fadd float %13, %14
%16 = load float, float* %5
%17 = fadd float %15, %16
%18 = load float, float* %6
%19 = fadd float %17, %18
store float %19, float* %7
%20 = load float, float* %7
%21 = fdiv float %20, 5.000000e+02
%22 = fmul float %21, 1.000000e+02
store float %22, float* %8
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = load float, float* %8
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %24, double %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter the marks of each subject: \00"
@.str.1 = [15 x i8] c"%f %f %f %f %f\00"
@.str.2 = [39 x i8] c"The total is %f and the average is %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3, float* %4, float* %5)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fadd float %13, %14
%16 = load float, float* %3
%17 = fadd float %15, %16
%18 = load float, float* %4
%19 = fadd float %17, %18
%20 = load float, float* %5
%21 = fadd float %19, %20
%22 = fdiv float %21, 5.000000e+02
%23 = fmul float %22, 1.000000e+02
%24 = fpext float %21 to double
%25 = fpext float %23 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %24, double %25)
ret i32 0
}