#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 sqrt(float);
int main() {
  float a, b, c;
  printf("Vnesi dolzini na strani: \n");
  scanf("%f %f %f", &a, &b, &c);
  if ((a + b <= c) || (a + c <= b) || (b + c <= a))
    printf("Ne moze da se konstruira triagolnik.\n");
  else {
    if (a == b && b == c)
      printf("Tragolnikot e ravnostran.\n");
    else if (a == b || b == c || a == c)
      printf("Tragolnikot e ravnokrak.\n");
    else
      printf("Tragolnikot e raznostran.\n");
    float p, s = (a + b + c) / 2;
    p = sqrt(s * (s - a) * (s - b) * (s - c));
    printf("Ploshtinata mu e %7.3f\n", p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jae    11ad <main+0x7d>
movss  -0x8(%rbp),%xmm1
addss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jae    11ad <main+0x7d>
movss  -0xc(%rbp),%xmm1
addss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11c0 <main+0x90>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dc <main+0x1ac>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    11fd <main+0xcd>
jp     11fd <main+0xcd>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    11fd <main+0xcd>
jp     11fd <main+0xcd>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126c <main+0x13c>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1217 <main+0xe7>
jp     1217 <main+0xe7>
jmp    1246 <main+0x116>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1231 <main+0x101>
jp     1231 <main+0x101>
jmp    1246 <main+0x116>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1259 <main+0x129>
jp     1259 <main+0x129>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <main+0x137>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126c <main+0x13c>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xd7d(%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
call   1050 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movaps %xmm0,%xmm3
addss  %xmm1,%xmm3
movss  0xc(%rsp),%xmm2
ucomiss %xmm3,%xmm2
jae    124f <main+0x10f>
movaps %xmm0,%xmm3
addss  %xmm2,%xmm3
ucomiss %xmm3,%xmm1
jae    124f <main+0x10f>
movaps %xmm1,%xmm3
addss  %xmm2,%xmm3
ucomiss %xmm3,%xmm0
jae    124f <main+0x10f>
ucomiss %xmm2,%xmm0
lea    0xea2(%rip),%rax
lea    0xe81(%rip),%rcx
mov    %rax,%rdx
cmovne %rcx,%rdx
cmovp  %rcx,%rdx
ucomiss %xmm2,%xmm1
lea    0xe9f(%rip),%rdi
cmovne %rax,%rdi
cmovp  %rax,%rdi
mov    %rax,%rcx
cmovne %rdx,%rcx
cmovp  %rdx,%rcx
ucomiss %xmm1,%xmm0
cmovne %rax,%rdi
cmovp  %rax,%rdi
cmovne %rcx,%rdi
cmovp  %rcx,%rdi
call   1030 <puts@plt>
movss  0x14(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
movss  0xc(%rsp),%xmm3
addss  %xmm3,%xmm0
mulss  0xddd(%rip),%xmm0
movaps %xmm0,%xmm4
subss  %xmm1,%xmm4
mulss  %xmm0,%xmm4
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
mulss  %xmm4,%xmm1
subss  %xmm3,%xmm0
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     125d <main+0x11d>
sqrtss %xmm0,%xmm0
jmp    1262 <main+0x122>
lea    0xe36(%rip),%rdi
call   1030 <puts@plt>
jmp    1274 <main+0x134>
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
lea    0xda0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Vnesi dolzini na strani: \0A\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [38 x i8] c"Ne moze da se konstruira triagolnik.\0A\00"
@.str.3 = [27 x i8] c"Tragolnikot e ravnostran.\0A\00"
@.str.4 = [26 x i8] c"Tragolnikot e ravnokrak.\0A\00"
@.str.5 = [27 x i8] c"Tragolnikot e raznostran.\0A\00"
@.str.6 = [24 x i8] c"Ploshtinata mu e %7.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fadd float %9, %10
%12 = load float, float* %4
%13 = fcmp ole float %11, %12
br i1 %13, label %26, label %14
14: ; preds = %0
%15 = load float, float* %2
%16 = load float, float* %4
%17 = fadd float %15, %16
%18 = load float, float* %3
%19 = fcmp ole float %17, %18
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load float, float* %3
%22 = load float, float* %4
%23 = fadd float %21, %22
%24 = load float, float* %2
%25 = fcmp ole float %23, %24
br i1 %25, label %26, label %28
26: ; preds = %20, %14, %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %79
28: ; preds = %20
%29 = load float, float* %2
%30 = load float, float* %3
%31 = fcmp oeq float %29, %30
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load float, float* %3
%34 = load float, float* %4
%35 = fcmp oeq float %33, %34
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %55
38: ; preds = %32, %28
%39 = load float, float* %2
%40 = load float, float* %3
%41 = fcmp oeq float %39, %40
br i1 %41, label %50, label %42
42: ; preds = %38
%43 = load float, float* %3
%44 = load float, float* %4
%45 = fcmp oeq float %43, %44
br i1 %45, label %50, label %46
46: ; preds = %42
%47 = load float, float* %2
%48 = load float, float* %4
%49 = fcmp oeq float %47, %48
br i1 %49, label %50, label %52
50: ; preds = %46, %42, %38
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %54
52: ; preds = %46
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
br label %55
55: ; preds = %54, %36
%56 = load float, float* %2
%57 = load float, float* %3
%58 = fadd float %56, %57
%59 = load float, float* %4
%60 = fadd float %58, %59
%61 = fdiv float %60, 2.000000e+00
store float %61, float* %6
%62 = load float, float* %6
%63 = load float, float* %6
%64 = load float, float* %2
%65 = fsub float %63, %64
%66 = fmul float %62, %65
%67 = load float, float* %6
%68 = load float, float* %3
%69 = fsub float %67, %68
%70 = fmul float %66, %69
%71 = load float, float* %6
%72 = load float, float* %4
%73 = fsub float %71, %72
%74 = fmul float %70, %73
%75 = call float @sqrt(float %74)
store float %75, float* %5
%76 = load float, float* %5
%77 = fpext float %76 to double
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %77)
br label %79
79: ; preds = %55, %26
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.6 = [24 x i8] c"Ploshtinata mu e %7.3f\0A\00"
@str = [26 x i8] c"Vnesi dolzini na strani: \00"
@str.7 = [26 x i8] c"Tragolnikot e raznostran.\00"
@str.8 = [25 x i8] c"Tragolnikot e ravnokrak.\00"
@str.9 = [26 x i8] c"Tragolnikot e ravnostran.\00"
@str.10 = [37 x i8] c"Ne moze da se konstruira triagolnik.\00"
define i32 @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 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fadd float %9, %10
%12 = load float, float* %3
%13 = fcmp ugt float %11, %12
%14 = fadd float %9, %12
%15 = fcmp ugt float %14, %10
%16 = and i1 %13, %15
%17 = fadd float %10, %12
%18 = fcmp ugt float %17, %9
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %22, label %20
20: ; preds = %0
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.10, i64 0, i64 0))
br label %47
22: ; preds = %0
%23 = fcmp oeq float %9, %10
%24 = fcmp oeq float %10, %12
%25 = select i1 %23, i1 %24, i1 false
%26 = select i1 %25, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0)
%27 = fcmp oeq float %9, %12
%28 = select i1 %24, i1 true, i1 %27
%29 = select i1 %28, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0)
%30 = select i1 %23, i8* %26, i8* %29
%31 = call i32 @puts(i8* dereferenceable(1) %30)
%32 = load float, float* %1
%33 = load float, float* %2
%34 = fadd float %32, %33
%35 = load float, float* %3
%36 = fadd float %34, %35
%37 = fmul float %36, 5.000000e-01
%38 = fsub float %37, %32
%39 = fmul float %37, %38
%40 = fsub float %37, %33
%41 = fmul float %40, %39
%42 = fsub float %37, %35
%43 = fmul float %42, %41
%44 = call float @sqrt(float %43)
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %45)
br label %47
47: ; preds = %22, %20
ret i32 0
}