#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, double *);
scalar_t__ triangle(double, double, double, double, double, double);
int main(void) {
  double xo, yo, x1, y1, x2, y2, square = 0;
  scanf("%lf,%lf\n", &xo, &yo);
  scanf("%lf,%lf\n", &x1, &y1);
  while (scanf("%lf,%lf\n", &x2, &y2) != EOF) {
    square += triangle(xo, yo, x1, y1, x2, y2);
    x1 = x2;
    y1 = y2;
  }
  printf("%.6lf\n", square);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e5e(%rip),%rcx
cmp    (%rcx),%rax
je     11de <main+0xae>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
call   1030 <triangle@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    116f <main+0x3f>
movsd  -0x40(%rbp),%xmm0
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebe(%rip),%rbx
lea    0x30(%rsp),%rsi
lea    0x28(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x2e69(%rip),%r12
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
cmp    (%r12),%rax
je     121b <main+0xeb>
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe60(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm5
call   1030 <triangle@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    (%r12),%rax
jne    11b0 <main+0x80>
lea    0xde7(%rip),%rdi
movsd  (%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lf,%lf\0A\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.6lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %8
%9 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%10 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %4, double* %5)
br label %11
11: ; preds = %15, %0
%12 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %6, double* %7)
%13 = load i64, i64* @EOF
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load double, double* %2
%17 = load double, double* %3
%18 = load double, double* %4
%19 = load double, double* %5
%20 = load double, double* %6
%21 = load double, double* %7
%22 = call i64 @triangle(double %16, double %17, double %18, double %19, double %20, double %21)
%23 = sitofp i64 %22 to double
%24 = load double, double* %8
%25 = fadd double %24, %23
store double %25, double* %8
%26 = load double, double* %6
store double %26, double* %4
%27 = load double, double* %7
store double %27, double* %5
br label %11
28: ; preds = %11
%29 = load double, double* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lf,%lf\0A\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.6lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %1 to i8*
%8 = bitcast double* %2 to i8*
%9 = bitcast double* %3 to i8*
%10 = bitcast double* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
%13 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%14 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%15 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %5, double* %6)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %34, label %18
18: ; preds = %0, %18
%19 = phi double [ %28, %18 ], [ 0.000000e+00, %0 ]
%20 = load double, double* %1
%21 = load double, double* %2
%22 = load double, double* %3
%23 = load double, double* %4
%24 = load double, double* %5
%25 = load double, double* %6
%26 = call i64 @triangle(double %20, double %21, double %22, double %23, double %24, double %25)
%27 = sitofp i64 %26 to double
%28 = fadd double %19, %27
%29 = load double, double* %5
store double %29, double* %3
%30 = load double, double* %6
store double %30, double* %4
%31 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double* %5, double* %6)
%32 = load i64, i64* @EOF
%33 = icmp eq i64 %31, %32
br i1 %33, label %34, label %18
34: ; preds = %18, %0
%35 = phi double [ 0.000000e+00, %0 ], [ %28, %18 ]
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %35)
ret i32 0
}