#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__ length(float, float, float, float);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *, float *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  float x1, y1;
  float x2, y2;
  float x3, y3;
  setbuf(stdout, NULL);
  printf("Input coordinates of the beginning point of the piece:\n");
  scanf("%f%f", &x1, &y1);
  printf("Input coordinates of the ending point of the piece:\n");
  scanf("%f%f", &x2, &y2);
  printf("Input coordinates of the point:\n");
  scanf("%f%f", &x3, &y3);
  if ((x1 == x2) && (y1 == y2)) {
    printf("The length of the piece is zero\n");
  }
  if (length(x1, y1, x3, y3) + length(x3, y3, x2, y2) ==
      length(x1, y1, x2, y2)) {
    printf("The point lays on the piece");
  } else {
    printf("It's an outer point");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <scanf@plt>
lea    0xeca(%rip),%rdi
call   1050 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    11f7 <main+0xb7>
jp     11f7 <main+0xb7>
movss  -0xc(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jne    11f7 <main+0xb7>
jp     11f7 <main+0xb7>
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
call   1030 <length@plt>
mov    %rax,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1030 <length@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1030 <length@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jne    1275 <main+0x135>
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
jmp    1281 <main+0x141>
lea    0xe54(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <setbuf@plt>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xe86(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xef1(%rip),%rdi
call   1040 <puts@plt>
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0x4(%rsp),%xmm0
jne    11f5 <main+0xa5>
jp     11f5 <main+0xa5>
movss  0x8(%rsp),%xmm1
ucomiss (%rsp),%xmm1
jne    11f5 <main+0xa5>
jp     11f5 <main+0xa5>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
call   1030 <length@plt>
mov    %rax,%r14
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
movss  (%rsp),%xmm3
call   1030 <length@plt>
mov    %rax,%rbx
add    %r14,%rbx
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
movss  (%rsp),%xmm3
call   1030 <length@plt>
cmp    %rax,%rbx
lea    0xdae(%rip),%rax
lea    0xdc3(%rip),%rdi
cmove  %rax,%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [56 x i8] c"Input coordinates of the beginning point of the piece:\0A\00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [53 x i8] c"Input coordinates of the ending point of the piece:\0A\00"
@.str.3 = [33 x i8] c"Input coordinates of the point:\0A\00"
@.str.4 = [33 x i8] c"The length of the piece is zero\0A\00"
@.str.5 = [28 x i8] c"The point lays on the piece\00"
@.str.6 = [20 x i8] c"It's an outer point\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = load i32, i32* @stdout
%9 = call i32 @setbuf(i32 %8, i32* null)
%10 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %4, float* %5)
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %6, float* %7)
%16 = load float, float* %2
%17 = load float, float* %4
%18 = fcmp oeq float %16, %17
br i1 %18, label %19, label %25
19: ; preds = %0
%20 = load float, float* %3
%21 = load float, float* %5
%22 = fcmp oeq float %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %19, %0
%26 = load float, float* %2
%27 = load float, float* %3
%28 = load float, float* %6
%29 = load float, float* %7
%30 = call i64 @length(float %26, float %27, float %28, float %29)
%31 = load float, float* %6
%32 = load float, float* %7
%33 = load float, float* %4
%34 = load float, float* %5
%35 = call i64 @length(float %31, float %32, float %33, float %34)
%36 = add nsw i64 %30, %35
%37 = load float, float* %2
%38 = load float, float* %3
%39 = load float, float* %4
%40 = load float, float* %5
%41 = call i64 @length(float %37, float %38, float %39, float %40)
%42 = icmp eq i64 %36, %41
br i1 %42, label %43, label %45
43: ; preds = %25
%44 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %47
45: ; preds = %25
%46 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [5 x i8] c"%f%f\00"
@.str.5 = [28 x i8] c"The point lays on the piece\00"
@.str.6 = [20 x i8] c"It's an outer point\00"
@str = [55 x i8] c"Input coordinates of the beginning point of the piece:\00"
@str.7 = [52 x i8] c"Input coordinates of the ending point of the piece:\00"
@str.8 = [32 x i8] c"Input coordinates of the point:\00"
@str.9 = [32 x i8] c"The length of the piece is zero\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = bitcast float* %1 to i8*
%8 = bitcast float* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = load i32, i32* @stdout
%14 = tail call i32 @setbuf(i32 %13, i32* null)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.7, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %3, float* %4)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %5, float* %6)
%21 = load float, float* %1
%22 = load float, float* %3
%23 = fcmp oeq float %21, %22
br i1 %23, label %24, label %31
24: ; preds = %0
%25 = load float, float* %2
%26 = load float, float* %4
%27 = fcmp oeq float %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
%30 = load float, float* %1
br label %31
31: ; preds = %28, %24, %0
%32 = phi float [ %30, %28 ], [ %21, %24 ], [ %21, %0 ]
%33 = load float, float* %2
%34 = load float, float* %5
%35 = load float, float* %6
%36 = call i64 @length(float %32, float %33, float %34, float %35)
%37 = load float, float* %5
%38 = load float, float* %6
%39 = load float, float* %3
%40 = load float, float* %4
%41 = call i64 @length(float %37, float %38, float %39, float %40)
%42 = add nsw i64 %41, %36
%43 = load float, float* %1
%44 = load float, float* %2
%45 = load float, float* %3
%46 = load float, float* %4
%47 = call i64 @length(float %43, float %44, float %45, float %46)
%48 = icmp eq i64 %42, %47
%49 = select i1 %48, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0)
%50 = call i32 @printf(i8* dereferenceable(1) %49)
ret i32 0
}