#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);
float rectangle_area(float, float, float, float, float, float);
int /*<<< orphan*/ scanf(char *, float *);
float triangle_area(float, float, float, float);
int main() {
  float x1, x2, x3;
  float y1, y2, y3;
  float ans;
  scanf("%f", &x1);
  scanf("%f", &y1);
  scanf("%f", &x2);
  scanf("%f", &y2);
  scanf("%f", &x3);
  scanf("%f", &y3);
  ans = rectangle_area(x1, x2, x3, y1, y2, y3) - triangle_area(x1, x2, y1, y2) -
        triangle_area(x2, x3, y2, y3) - triangle_area(x3, x1, y3, y1);
  printf("S = %f\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe6a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe5a(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
movss  -0x18(%rbp),%xmm4
movss  -0x1c(%rbp),%xmm5
call   1050 <rectangle_area@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <triangle_area@plt>
movaps %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
call   1030 <triangle_area@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1030 <triangle_area@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
lea    0xda2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
movss  0xc(%rsp),%xmm4
movss  0x8(%rsp),%xmm5
call   1050 <rectangle_area@plt>
movss  %xmm0,0x4(%rsp)
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
call   1030 <triangle_area@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x18(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
movss  0x8(%rsp),%xmm3
call   1030 <triangle_area@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
call   1030 <triangle_area@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
lea    0xdb2(%rip),%rdi
movaps %xmm1,%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"S = %f\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
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%15 = load float, float* %2
%16 = load float, float* %3
%17 = load float, float* %4
%18 = load float, float* %5
%19 = load float, float* %6
%20 = load float, float* %7
%21 = call float @rectangle_area(float %15, float %16, float %17, float %18, float %19, float %20)
%22 = load float, float* %2
%23 = load float, float* %3
%24 = load float, float* %5
%25 = load float, float* %6
%26 = call float @triangle_area(float %22, float %23, float %24, float %25)
%27 = fsub float %21, %26
%28 = load float, float* %3
%29 = load float, float* %4
%30 = load float, float* %6
%31 = load float, float* %7
%32 = call float @triangle_area(float %28, float %29, float %30, float %31)
%33 = fsub float %27, %32
%34 = load float, float* %4
%35 = load float, float* %2
%36 = load float, float* %7
%37 = load float, float* %5
%38 = call float @triangle_area(float %34, float %35, float %36, float %37)
%39 = fsub float %33, %38
store float %39, float* %8
%40 = load float, float* %8
%41 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"S = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = bitcast float* %1 to i8*
%8 = bitcast float* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%19 = load float, float* %1
%20 = load float, float* %2
%21 = load float, float* %3
%22 = load float, float* %4
%23 = load float, float* %5
%24 = load float, float* %6
%25 = call float @rectangle_area(float %19, float %20, float %21, float %22, float %23, float %24)
%26 = load float, float* %1
%27 = load float, float* %2
%28 = load float, float* %4
%29 = load float, float* %5
%30 = call float @triangle_area(float %26, float %27, float %28, float %29)
%31 = fsub float %25, %30
%32 = load float, float* %2
%33 = load float, float* %3
%34 = load float, float* %5
%35 = load float, float* %6
%36 = call float @triangle_area(float %32, float %33, float %34, float %35)
%37 = fsub float %31, %36
%38 = load float, float* %3
%39 = load float, float* %1
%40 = load float, float* %6
%41 = load float, float* %4
%42 = call float @triangle_area(float %38, float %39, float %40, float %41)
%43 = fsub float %37, %42
%44 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %43)
ret i32 0
}