#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*/ feof(int /*<<< orphan*/);
double nearLine(float, float, float, float, float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *, float *, float *,
                         float *);
int /*<<< orphan*/ stdin;
main() {
  float x, y, x1, y1, x2, y2;
  while (!feof(stdin)) {
    (void)printf("x, y, x1, y1, x2, y2:  ");
    (void)scanf("%f %f %f %f %f %f", &x, &y, &x1, &y1, &x2, &y2);
    (void)printf("distance:  %.3f\n", nearLine(x, y, x1, y1, x2, y2));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1172 <main+0x32>
jmp    11de <main+0x9e>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
lea    -0x1c(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
movss  -0x18(%rbp),%xmm4
movss  -0x1c(%rbp),%xmm5
call   1050 <nearLine@plt>
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    114f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1207 <main+0xc7>
lea    0x24(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x1c(%rsp),%rbx
lea    0x18(%rsp),%rbp
lea    0x14(%rsp),%r14
lea    0xea6(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
lea    0xe6a(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
mov    %r14,%r9
call   1060 <scanf@plt>
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x18(%rsp),%xmm3
movss  0x14(%rsp),%xmm4
movss  0x10(%rsp),%xmm5
call   1050 <nearLine@plt>
mov    %r15,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1190 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [24 x i8] c"x, y, x1, y1, x2, y2: \00"
@.str.1 = [18 x i8] c"%f %f %f %f %f %f\00"
@.str.2 = [17 x i8] c"distance: %.3f\0A\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
br label %8
8: ; preds = %13, %0
%9 = load i32, i32* @stdin
%10 = call i32 @feof(i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6, float* %7)
%16 = load float, float* %2
%17 = load float, float* %3
%18 = load float, float* %4
%19 = load float, float* %5
%20 = load float, float* %6
%21 = load float, float* %7
%22 = call double @nearLine(float %16, float %17, float %18, float %19, float %20, float %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %22)
br label %8
24: ; preds = %8
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [24 x i8] c"x, y, x1, y1, x2, y2: \00"
@.str.1 = [18 x i8] c"%f %f %f %f %f %f\00"
@.str.2 = [17 x i8] c"distance: %.3f\0A\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* @stdin
%14 = call i32 @feof(i32 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %30
16: ; preds = %0, %16
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3, float* %4, float* %5, float* %6)
%19 = load float, float* %1
%20 = load float, float* %2
%21 = load float, float* %3
%22 = load float, float* %4
%23 = load float, float* %5
%24 = load float, float* %6
%25 = call double @nearLine(float %19, float %20, float %21, float %22, float %23, float %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %25)
%27 = load i32, i32* @stdin
%28 = call i32 @feof(i32 %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %16, label %30
30: ; preds = %16, %0
ret i32 0
}