#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, int, int, float);
float sqrt(int);
int main() {
  int a = 10, b = 10, c = 10;
  float area = sqrt(((a + b + c) / 2) * (((a + b + c) / 2) - a) *
                    (((a + b + c) / 2) - b) * (((a + b + c) / 2) - c));
  printf("If A=%d, B=%d, C=%d, \nThen the Area of Traingle is: %f", a, b, c,
         area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0x8(%rbp),%eax
imul   %eax,%edi
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0xc(%rbp),%eax
imul   %eax,%edi
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0x10(%rbp),%eax
imul   %eax,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movss  -0x14(%rbp),%xmm0
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x753,%edi
call   1040 <sqrt@plt>
lea    0xece(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"If A=%d, B=%d, C=%d, \0AThen the Area of Traingle is: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store i32 10, i32* %2
store i32 10, i32* %3
store i32 10, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = sdiv i32 %10, 2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = sdiv i32 %16, 2
%18 = load i32, i32* %2
%19 = sub nsw i32 %17, %18
%20 = mul nsw i32 %11, %19
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
%26 = sdiv i32 %25, 2
%27 = load i32, i32* %3
%28 = sub nsw i32 %26, %27
%29 = mul nsw i32 %20, %28
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %4
%34 = add nsw i32 %32, %33
%35 = sdiv i32 %34, 2
%36 = load i32, i32* %4
%37 = sub nsw i32 %35, %36
%38 = mul nsw i32 %29, %37
%39 = call float @sqrt(i32 %38)
store float %39, float* %5
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = load float, float* %5
%44 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %41, i32 %42, float %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"If A=%d, B=%d, C=%d, \0AThen the Area of Traingle is: %f\00"
define i32 @main() {
%1 = tail call float @sqrt(i32 1875)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 10, float %1)
ret i32 0
}