#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 *, float);
int main() {
  float a = 5.0;
  float b = 7.5;
  float c = 10.2;
  float L = a + b + c;
  float s = L / 2;
  float P = s * (s - a) * (s - b) * (s - c);
  printf("Perimeter is: %.2f\n", L);
  printf("Area is: %.2f\n", P);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe99(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Perimeter is: %.2f\0A\00"
@.str.1 = [15 x i8] c"Area is: %.2f\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
store i32 0, i32* %1
store float 5.000000e+00, float* %2
store float 7.500000e+00, float* %3
store float 0x4024666660000000, float* %4
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fadd float %8, %9
%11 = load float, float* %4
%12 = fadd float %10, %11
store float %12, float* %5
%13 = load float, float* %5
%14 = fdiv float %13, 2.000000e+00
store float %14, float* %6
%15 = load float, float* %6
%16 = load float, float* %6
%17 = load float, float* %2
%18 = fsub float %16, %17
%19 = fmul float %15, %18
%20 = load float, float* %6
%21 = load float, float* %3
%22 = fsub float %20, %21
%23 = fmul float %19, %22
%24 = load float, float* %6
%25 = load float, float* %4
%26 = fsub float %24, %25
%27 = fmul float %23, %26
store float %27, float* %7
%28 = load float, float* %5
%29 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %28)
%30 = load float, float* %7
%31 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Perimeter is: %.2f\0A\00"
@.str.1 = [15 x i8] c"Area is: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float 0x4036B33340000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float 0x4073F19EA0000000)
ret i32 0
}