#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, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a, b;
  scanf("%f %f", &a, &b);
  float area = (1 / 2.0) * a * b;
  float ar = (-1 / 2.0) * a * b;
  printf("The area of (%.4f,%.4f), ", a, b);
  printf("(%.4f,0) and ", a);
  if (area > 0) {
    printf("(0,%.4f) is %.4f.", b, area);
  } else {
    printf("(0,%.4f) is %.4f.", b, ar);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe68(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11fa <main+0xda>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe50(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1216 <main+0xf6>
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe2f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xeae(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  0x8(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movaps %xmm1,0x20(%rsp)
lea    0xe9c(%rip),%rdi
movaps %xmm2,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
mulsd  0xe62(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
movaps 0x20(%rsp),%xmm2
cmpltss %xmm2,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xe67(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [26 x i8] c"The area of (%.4f,%.4f), \00"
@.str.2 = [14 x i8] c"(%.4f,0) and \00"
@.str.3 = [18 x i8] c"(0,%.4f) is %.4f.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double 5.000000e-01, %8
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fmul double %9, %11
%13 = fptrunc double %12 to float
store float %13, float* %4
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fmul double -5.000000e-01, %15
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = fmul double %16, %18
%20 = fptrunc double %19 to float
store float %20, float* %5
%21 = load float, float* %2
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %21, double %23)
%25 = load float, float* %2
%26 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float %25)
%27 = load float, float* %4
%28 = fcmp ogt float %27, 0.000000e+00
br i1 %28, label %29, label %34
29: ; preds = %0
%30 = load float, float* %3
%31 = load float, float* %4
%32 = fpext float %31 to double
%33 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %30, double %32)
br label %39
34: ; preds = %0
%35 = load float, float* %3
%36 = load float, float* %5
%37 = fpext float %36 to double
%38 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %35, double %37)
br label %39
39: ; preds = %34, %29
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [26 x i8] c"The area of (%.4f,%.4f), \00"
@.str.2 = [14 x i8] c"(%.4f,0) and \00"
@.str.3 = [18 x i8] c"(0,%.4f) is %.4f.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fmul double %7, 5.000000e-01
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fmul double %8, %10
%12 = fptrunc double %11 to float
%13 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %6, double %10)
%14 = load float, float* %1
%15 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float %14)
%16 = fcmp ogt float %12, 0.000000e+00
%17 = fmul double %7, -5.000000e-01
%18 = fmul double %17, %10
%19 = fptrunc double %18 to float
%20 = select i1 %16, float %12, float %19
%21 = load float, float* %2
%22 = fpext float %20 to double
%23 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %21, double %22)
ret i32 0
}