#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *, float *);
int main() {
  float a1, a2, b1, b2;
  scanf("%f %f %f %f", &a1, &b1, &a2, &b2);
  float c = a1 / b1;
  float d = a2 / b2;
  float x = ((b1 - b2) * (a1 * a2)) / ((b1 * a2) - (b2 * a1));
  float y = ((a1 - a2) * (b1 * b2)) / ((a1 * b2) - (a2 * b1));
  if (c == d) {
    printf("INF\n");
  } else if (c != d) {
    if (x == 0)
      x = 0;
    if (y == 0)
      y = 0;
    printf("(%.3f,%.3f)", x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm3
movss  -0x14(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm3
movss  -0xc(%rbp),%xmm2
mulss  -0x10(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jne    1225 <main+0x105>
jp     1225 <main+0x105>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x182>
movss  -0x18(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jne    123f <main+0x11f>
jp     123f <main+0x11f>
jmp    129d <main+0x17d>
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    125e <main+0x13e>
jp     125e <main+0x13e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    127d <main+0x15d>
jp     127d <main+0x15d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd7b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x182>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movaps %xmm3,%xmm4
unpcklps %xmm2,%xmm4
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm5
unpcklps %xmm0,%xmm5
divps  %xmm5,%xmm4
movaps %xmm4,%xmm5
shufps $0x55,%xmm4,%xmm5
ucomiss %xmm5,%xmm4
jne    1197 <main+0x67>
jp     1197 <main+0x67>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
jmp    11fd <main+0xcd>
movaps %xmm3,%xmm4
unpcklps %xmm1,%xmm4
movaps %xmm2,%xmm5
unpcklps %xmm0,%xmm5
unpcklps %xmm3,%xmm1
unpcklps %xmm2,%xmm0
movaps %xmm1,%xmm2
mulps  %xmm0,%xmm2
mulps  %xmm4,%xmm0
subps  %xmm5,%xmm4
mulps  %xmm4,%xmm2
mulps  %xmm5,%xmm1
subps  %xmm1,%xmm0
divps  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cmpeqps %xmm2,%xmm0
unpcklps %xmm0,%xmm0
movmskpd %xmm0,%eax
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
test   $0x2,%al
jne    11e4 <main+0xb4>
movaps %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
test   $0x1,%al
jne    11ef <main+0xbf>
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xe16(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%f %f %f %f\00"
@.str.1 = [5 x i8] c"INF\0A\00"
@.str.2 = [12 x i8] c"(%.3f,%.3f)\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
%8 = alloca float
%9 = alloca float
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float* %2, float* %4, float* %3, float* %5)
%11 = load float, float* %2
%12 = load float, float* %4
%13 = fdiv float %11, %12
store float %13, float* %6
%14 = load float, float* %3
%15 = load float, float* %5
%16 = fdiv float %14, %15
store float %16, float* %7
%17 = load float, float* %4
%18 = load float, float* %5
%19 = fsub float %17, %18
%20 = load float, float* %2
%21 = load float, float* %3
%22 = fmul float %20, %21
%23 = fmul float %19, %22
%24 = load float, float* %4
%25 = load float, float* %3
%26 = load float, float* %5
%27 = load float, float* %2
%28 = fmul float %26, %27
%29 = fneg float %28
%30 = call float @llvm.fmuladd.f32(float %24, float %25, float %29)
%31 = fdiv float %23, %30
store float %31, float* %8
%32 = load float, float* %2
%33 = load float, float* %3
%34 = fsub float %32, %33
%35 = load float, float* %4
%36 = load float, float* %5
%37 = fmul float %35, %36
%38 = fmul float %34, %37
%39 = load float, float* %2
%40 = load float, float* %5
%41 = load float, float* %3
%42 = load float, float* %4
%43 = fmul float %41, %42
%44 = fneg float %43
%45 = call float @llvm.fmuladd.f32(float %39, float %40, float %44)
%46 = fdiv float %38, %45
store float %46, float* %9
%47 = load float, float* %6
%48 = load float, float* %7
%49 = fcmp oeq float %47, %48
br i1 %49, label %50, label %52
50: ; preds = %0
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %71
52: ; preds = %0
%53 = load float, float* %6
%54 = load float, float* %7
%55 = fcmp une float %53, %54
br i1 %55, label %56, label %70
56: ; preds = %52
%57 = load float, float* %8
%58 = fcmp oeq float %57, 0.000000e+00
br i1 %58, label %59, label %60
59: ; preds = %56
store float 0.000000e+00, float* %8
br label %60
60: ; preds = %59, %56
%61 = load float, float* %9
%62 = fcmp oeq float %61, 0.000000e+00
br i1 %62, label %63, label %64
63: ; preds = %60
store float 0.000000e+00, float* %9
br label %64
64: ; preds = %63, %60
%65 = load float, float* %8
%66 = fpext float %65 to double
%67 = load float, float* %9
%68 = fpext float %67 to double
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %66, double %68)
br label %70
70: ; preds = %64, %52
br label %71
71: ; preds = %70, %50
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%f %f %f %f\00"
@.str.2 = [12 x i8] c"(%.3f,%.3f)\00"
@str = [4 x i8] c"INF\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float* %1, float* %3, float* %2, float* %4)
%10 = load float, float* %1
%11 = load float, float* %3
%12 = load float, float* %2
%13 = load float, float* %4
%14 = insertelement <2 x float> poison, float %10, i64 0
%15 = insertelement <2 x float> %14, float %12, i64 1
%16 = insertelement <2 x float> poison, float %11, i64 0
%17 = insertelement <2 x float> %16, float %13, i64 1
%18 = fdiv <2 x float> %15, %17
%19 = insertelement <2 x float> %14, float %11, i64 1
%20 = insertelement <2 x float> poison, float %12, i64 0
%21 = insertelement <2 x float> %20, float %13, i64 1
%22 = fsub <2 x float> %19, %21
%23 = insertelement <2 x float> %16, float %10, i64 1
%24 = insertelement <2 x float> poison, float %13, i64 0
%25 = insertelement <2 x float> %24, float %12, i64 1
%26 = fmul <2 x float> %23, %25
%27 = fmul <2 x float> %22, %26
%28 = fneg <2 x float> %21
%29 = fmul <2 x float> %23, %28
%30 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %19, <2 x float> %25, <2 x float> %29)
%31 = fdiv <2 x float> %27, %30
%32 = extractelement <2 x float> %18, i64 0
%33 = extractelement <2 x float> %18, i64 1
%34 = fcmp oeq float %32, %33
br i1 %34, label %35, label %37
35: ; preds = %0
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %48
37: ; preds = %0
%38 = fcmp oeq <2 x float> %31, zeroinitializer
%39 = extractelement <2 x i1> %38, i64 1
%40 = extractelement <2 x float> %31, i64 1
%41 = extractelement <2 x i1> %38, i64 0
%42 = extractelement <2 x float> %31, i64 0
%43 = fpext float %40 to double
%44 = select i1 %39, double 0.000000e+00, double %43
%45 = fpext float %42 to double
%46 = select i1 %41, double 0.000000e+00, double %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %44, double %46)
br label %48
48: ; preds = %37, %35
ret i32 0
}