#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 distance_s(float const, float const, float const, float const);
float __attribute__((__always___, __gnu___, __const__))
triangle_perimeter_s(const float ax, const float ay, const float bx,
                     const float by, const float cx, const float cy) {
  return distance_s(ax, ay, bx, by) + distance_s(ax, ay, cx, cy) +
         distance_s(bx, by, cx, cy);
}


x86 assembly (clang, -O0):
<triangle_perimeter_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <distance_s@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <distance_s@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <distance_s@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle_perimeter_s>:
sub    $0x28,%rsp
movss  %xmm5,0x14(%rsp)
movss  %xmm4,0x10(%rsp)
movss  %xmm3,0x24(%rsp)
movss  %xmm2,0x20(%rsp)
movss  %xmm1,0x1c(%rsp)
movss  %xmm0,0x18(%rsp)
call   1030 <distance_s@plt>
movss  %xmm0,0xc(%rsp)
movss  0x18(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
call   1030 <distance_s@plt>
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x20(%rsp),%xmm0
movss  0x24(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
call   1030 <distance_s@plt>
addss  0xc(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @triangle_perimeter_s(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = call float @distance_s(float %13, float %14, float %15, float %16)
%18 = load float, float* %7
%19 = load float, float* %8
%20 = load float, float* %11
%21 = load float, float* %12
%22 = call float @distance_s(float %18, float %19, float %20, float %21)
%23 = fadd float %17, %22
%24 = load float, float* %9
%25 = load float, float* %10
%26 = load float, float* %11
%27 = load float, float* %12
%28 = call float @distance_s(float %24, float %25, float %26, float %27)
%29 = fadd float %23, %28
ret float %29
}

LLVM IR (-O2):
define float @triangle_perimeter_s(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @distance_s(float %0, float %1, float %2, float %3)
%8 = tail call float @distance_s(float %0, float %1, float %4, float %5)
%9 = fadd float %7, %8
%10 = tail call float @distance_s(float %2, float %3, float %4, float %5)
%11 = fadd float %9, %10
ret float %11
}