#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 */
float cosf(float);
float el_true_anomalyf(float, float, float);
float fabsf(float);
float sinf(float);
float el_segment_areaf(float semiMajor, float ecc, float fi0, float fi1) {
  float r0 = el_true_anomalyf(semiMajor, ecc, fi0);
  float r1 = el_true_anomalyf(semiMajor, ecc, fi1);
  float x0 = r0 * cosf(fi0);
  float y0 = r0 * sinf(fi0);
  float x1 = r1 * cosf(fi1);
  float y1 = r1 * sinf(fi1);
  float seg = 0.5f * fabsf(x0 * y1 - x1 * y0);
  return seg;
}


x86 assembly (clang, -O0):
<el_segment_areaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1050 <el_true_anomalyf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1050 <el_true_anomalyf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x3c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x38(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x30(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x28(%rbp),%xmm2
movss  -0x24(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movaps 0xdce(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xdb2(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_segment_areaf>:
sub    $0x18,%rsp
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x4(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
call   1050 <el_true_anomalyf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1050 <el_true_anomalyf@plt>
movss  %xmm0,0x10(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <cosf@plt>
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <sinf@plt>
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x14(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0x4(%rsp)
movss  0x14(%rsp),%xmm0
call   1030 <sinf@plt>
movss  0x10(%rsp),%xmm1
mulss  %xmm1,%xmm0
mulss  0xc(%rsp),%xmm0
movss  0x4(%rsp),%xmm2
mulss  %xmm1,%xmm2
mulss  0x8(%rsp),%xmm2
subss  %xmm2,%xmm0
andps  0xe17(%rip),%xmm0
mulss  0xe1f(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @el_segment_areaf(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%16 = load float, float* %5
%17 = load float, float* %6
%18 = load float, float* %7
%19 = call float @el_true_anomalyf(float %16, float %17, float %18)
store float %19, float* %9
%20 = load float, float* %5
%21 = load float, float* %6
%22 = load float, float* %8
%23 = call float @el_true_anomalyf(float %20, float %21, float %22)
store float %23, float* %10
%24 = load float, float* %9
%25 = load float, float* %7
%26 = call float @cosf(float %25)
%27 = fmul float %24, %26
store float %27, float* %11
%28 = load float, float* %9
%29 = load float, float* %7
%30 = call float @sinf(float %29)
%31 = fmul float %28, %30
store float %31, float* %12
%32 = load float, float* %10
%33 = load float, float* %8
%34 = call float @cosf(float %33)
%35 = fmul float %32, %34
store float %35, float* %13
%36 = load float, float* %10
%37 = load float, float* %8
%38 = call float @sinf(float %37)
%39 = fmul float %36, %38
store float %39, float* %14
%40 = load float, float* %11
%41 = load float, float* %14
%42 = load float, float* %13
%43 = load float, float* %12
%44 = fmul float %42, %43
%45 = fneg float %44
%46 = call float @llvm.fmuladd.f32(float %40, float %41, float %45)
%47 = call float @llvm.fabs.f32(float %46)
%48 = fmul float 5.000000e-01, %47
store float %48, float* %15
%49 = load float, float* %15
ret float %49
}

LLVM IR (-O2):
define float @el_segment_areaf(float %0, float %1, float %2, float %3) {
%5 = tail call float @el_true_anomalyf(float %0, float %1, float %2)
%6 = tail call float @el_true_anomalyf(float %0, float %1, float %3)
%7 = tail call float @cosf(float %2)
%8 = fmul float %5, %7
%9 = tail call float @sinf(float %2)
%10 = fmul float %5, %9
%11 = tail call float @cosf(float %3)
%12 = tail call float @sinf(float %3)
%13 = fmul float %6, %12
%14 = fneg float %6
%15 = fmul float %11, %14
%16 = fmul float %10, %15
%17 = tail call float @llvm.fmuladd.f32(float %8, float %13, float %16)
%18 = tail call float @llvm.fabs.f32(float %17)
%19 = fmul float %18, 5.000000e-01
ret float %19
}