#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 */
double compute_bisector_slope(double);
double compute_midpoint(double, double);
double compute_slope(double, double, double, double);
double compute_y_intercept(double, double, double);
int /*<<< orphan*/ display_results(double, double, double, double, double,
                                   double);
double get_number(char, int);
int main(void) {
  double coord_x1 = 0.0, coord_x2 = 0.0, coord_y1 = 0.0, coord_y2 = 0.0,
         slope = 0.0, midpoint_X = 0.0, midpoint_Y = 0.0, y_intercept = 0.0;
  coord_x1 = get_number('X', 1);
  coord_y1 = get_number('Y', 1);
  coord_x2 = get_number('X', 2);
  coord_y2 = get_number('Y', 2);
  slope = compute_slope(coord_x1, coord_y1, coord_x2, coord_y2);
  midpoint_X = compute_midpoint(coord_x1, coord_x2);
  midpoint_Y = compute_midpoint(coord_y1, coord_y2);
  slope = compute_bisector_slope(slope);
  y_intercept = compute_y_intercept(slope, midpoint_X, midpoint_Y);
  display_results(coord_x1, coord_y1, coord_x2, coord_y2, slope, y_intercept);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x58,%edi
mov    $0x1,%esi
call   1040 <get_number@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x59,%edi
mov    $0x1,%esi
call   1040 <get_number@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x58,%edi
mov    $0x2,%esi
call   1040 <get_number@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x59,%edi
mov    $0x2,%esi
call   1040 <get_number@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1080 <compute_slope@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1060 <compute_midpoint@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1060 <compute_midpoint@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <compute_bisector_slope@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
call   1070 <compute_y_intercept@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
call   1050 <display_results@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    $0x58,%edi
mov    $0x1,%esi
call   1040 <get_number@plt>
movsd  %xmm0,0x18(%rsp)
mov    $0x59,%edi
mov    $0x1,%esi
call   1040 <get_number@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x58,%edi
mov    $0x2,%esi
call   1040 <get_number@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x59,%edi
mov    $0x2,%esi
call   1040 <get_number@plt>
movaps %xmm0,%xmm3
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1080 <compute_slope@plt>
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <compute_midpoint@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1060 <compute_midpoint@plt>
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
call   1030 <compute_bisector_slope@plt>
movsd  %xmm0,(%rsp)
movsd  0x30(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
call   1070 <compute_y_intercept@plt>
movaps %xmm0,%xmm5
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  (%rsp),%xmm4
call   1050 <display_results@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
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
%9 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
%10 = call double @get_number(i8 signext 88, i32 1)
store double %10, double* %2
%11 = call double @get_number(i8 signext 89, i32 1)
store double %11, double* %4
%12 = call double @get_number(i8 signext 88, i32 2)
store double %12, double* %3
%13 = call double @get_number(i8 signext 89, i32 2)
store double %13, double* %5
%14 = load double, double* %2
%15 = load double, double* %4
%16 = load double, double* %3
%17 = load double, double* %5
%18 = call double @compute_slope(double %14, double %15, double %16, double %17)
store double %18, double* %6
%19 = load double, double* %2
%20 = load double, double* %3
%21 = call double @compute_midpoint(double %19, double %20)
store double %21, double* %7
%22 = load double, double* %4
%23 = load double, double* %5
%24 = call double @compute_midpoint(double %22, double %23)
store double %24, double* %8
%25 = load double, double* %6
%26 = call double @compute_bisector_slope(double %25)
store double %26, double* %6
%27 = load double, double* %6
%28 = load double, double* %7
%29 = load double, double* %8
%30 = call double @compute_y_intercept(double %27, double %28, double %29)
store double %30, double* %9
%31 = load double, double* %2
%32 = load double, double* %4
%33 = load double, double* %3
%34 = load double, double* %5
%35 = load double, double* %6
%36 = load double, double* %9
%37 = call i32 @display_results(double %31, double %32, double %33, double %34, double %35, double %36)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @get_number(i8 signext 88, i32 1)
%2 = tail call double @get_number(i8 signext 89, i32 1)
%3 = tail call double @get_number(i8 signext 88, i32 2)
%4 = tail call double @get_number(i8 signext 89, i32 2)
%5 = tail call double @compute_slope(double %1, double %2, double %3, double %4)
%6 = tail call double @compute_midpoint(double %1, double %3)
%7 = tail call double @compute_midpoint(double %2, double %4)
%8 = tail call double @compute_bisector_slope(double %5)
%9 = tail call double @compute_y_intercept(double %8, double %6, double %7)
%10 = tail call i32 @display_results(double %1, double %2, double %3, double %4, double %8, double %9)
ret i32 0
}