#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 *, double, ...);
int scanf(char *, double *, double *, double *);
double sqrt(double);
main() {
  double a, b, c, s, area;
  int x, y, z;
  x = scanf("%lf%lf%lf", &a, &b, &c);
  s = (a + b + c) / 2;
  area = sqrt(s * (s - a) * (s - b) * (s - c));
  printf("ret scanf: %d\n", x);
  printf("Area: %lf\nSemiperimetro: %lf\n", area, s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe51(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xecc(%rip),%rdi
lea    0x28(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x18(%rsp),%rcx
call   1040 <scanf@plt>
mov    %eax,%ebx
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movapd %xmm0,%xmm5
addsd  %xmm1,%xmm5
movsd  0x18(%rsp),%xmm2
addsd  %xmm2,%xmm5
mulsd  0xe88(%rip),%xmm5
movapd %xmm5,%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm5,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm5,0x10(%rsp)
movapd %xmm5,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b2 <main+0x82>
sqrtsd %xmm0,%xmm0
jmp    11b7 <main+0x87>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [15 x i8] c"ret scanf: %d\0A\00"
@.str.2 = [30 x i8] c"Area: %lf\0ASemiperimetro: %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = fadd double %8, %9
%11 = load double, double* %3
%12 = fadd double %10, %11
%13 = fmul double %12, 5.000000e-01
%14 = fsub double %13, %8
%15 = fmul double %13, %14
%16 = fsub double %13, %9
%17 = fmul double %16, %15
%18 = fsub double %13, %11
%19 = fmul double %18, %17
%20 = call double @sqrt(double %19)
%21 = sitofp i32 %7 to double
%22 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %21)
%23 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %20, double %13)
ret i32 0
}