#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 sqrt(float);
void main() {
  float a, b, c, S, A;
  printf("Informe o lado A: ");
  scanf("%f", &a);
  printf("Informe o lado B: ");
  scanf("%f", &b);
  printf("Informe o lado C: ");
  scanf("%f", &c);
  S = (a + b + c) / 2;
  A = sqrt(S * ((S - a) * (S - b) * (S - c)));
  printf("A = %.2f\n", A);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe57(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe45(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  0x4(%rsp),%xmm3
addss  %xmm3,%xmm2
mulss  0xe4e(%rip),%xmm2
movaps %xmm2,%xmm4
subss  %xmm0,%xmm4
movaps %xmm2,%xmm5
subss  %xmm1,%xmm5
mulss  %xmm4,%xmm5
movaps %xmm2,%xmm0
subss  %xmm3,%xmm0
mulss  %xmm5,%xmm0
mulss  %xmm2,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11e1 <main+0xb1>
sqrtss %xmm0,%xmm0
jmp    11e6 <main+0xb6>
call   1050 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe4f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Informe o lado A: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Informe o lado B: \00"
@.str.3 = [19 x i8] c"Informe o lado C: \00"
@.str.4 = [10 x i8] c"A = %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = load float, float* %1
%13 = load float, float* %2
%14 = fadd float %12, %13
%15 = load float, float* %3
%16 = fadd float %14, %15
%17 = fdiv float %16, 2.000000e+00
store float %17, float* %4
%18 = load float, float* %4
%19 = load float, float* %4
%20 = load float, float* %1
%21 = fsub float %19, %20
%22 = load float, float* %4
%23 = load float, float* %2
%24 = fsub float %22, %23
%25 = fmul float %21, %24
%26 = load float, float* %4
%27 = load float, float* %3
%28 = fsub float %26, %27
%29 = fmul float %25, %28
%30 = fmul float %18, %29
%31 = call float @sqrt(float %30)
store float %31, float* %5
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %33)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Informe o lado A: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Informe o lado B: \00"
@.str.3 = [19 x i8] c"Informe o lado C: \00"
@.str.4 = [10 x i8] c"A = %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%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 = fmul float %17, 5.000000e-01
%19 = fsub float %18, %13
%20 = fsub float %18, %14
%21 = fmul float %19, %20
%22 = fsub float %18, %16
%23 = fmul float %22, %21
%24 = fmul float %18, %23
%25 = call float @sqrt(float %24)
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %26)
ret void
}