#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 sqrt(double);
int obliczRozwDwukwad(double t1, double t2, double *x1, double *x2, double *x3,
                      double *x4) {
  if (t1 < 0) {
    if (t2 < 0) {
      *x1 = 0;
      *x2 = 0;
      *x3 = 0;
      *x4 = 0;
      return 0;
    } else {
      *x1 = sqrt(t2);
      *x2 = (-1) * (*x1);
      return 2;
    }
  } else {
    *x1 = sqrt(t1);
    *x2 = (-1) * (*x1);
    if (t2 < 0) {
      *x3 = 0;
      *x4 = 0;
      return 2;
    } else {
      *x3 = sqrt(t2);
      *x4 = (-1) * (*x3);
      return 4;
    }
  }
  return -1000;
}


x86 assembly (clang, -O0):
<obliczRozwDwukwad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11bc <obliczRozwDwukwad+0xac>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1186 <obliczRozwDwukwad+0x76>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1247 <obliczRozwDwukwad+0x137>
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xe5c(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1247 <obliczRozwDwukwad+0x137>
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xe26(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1216 <obliczRozwDwukwad+0x106>
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1247 <obliczRozwDwukwad+0x137>
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xdcc(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obliczRozwDwukwad>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    1158 <obliczRozwDwukwad+0x48>
ucomisd %xmm1,%xmm2
jbe    1164 <obliczRozwDwukwad+0x54>
movq   $0x0,(%rbx)
movq   $0x0,(%r12)
movq   $0x0,(%r15)
movq   $0x0,(%r14)
xor    %eax,%eax
jmp    1208 <obliczRozwDwukwad+0xf8>
ucomisd %xmm2,%xmm0
jb     1177 <obliczRozwDwukwad+0x67>
sqrtsd %xmm0,%xmm0
jmp    1186 <obliczRozwDwukwad+0x76>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     11c6 <obliczRozwDwukwad+0xb6>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11cf <obliczRozwDwukwad+0xbf>
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
movsd  %xmm0,(%rbx)
xorpd  0xe6e(%rip),%xmm0
movlpd %xmm0,(%r12)
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11b7 <obliczRozwDwukwad+0xa7>
movq   $0x0,(%r15)
movq   $0x0,(%r14)
mov    $0x2,%eax
jmp    1208 <obliczRozwDwukwad+0xf8>
ucomisd %xmm0,%xmm1
jb     11e8 <obliczRozwDwukwad+0xd8>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11f1 <obliczRozwDwukwad+0xe1>
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,(%rbx)
xorpd  0xe25(%rip),%xmm0
movlpd %xmm0,(%r12)
mov    $0x2,%eax
jmp    1208 <obliczRozwDwukwad+0xf8>
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,(%r15)
xorpd  0xe02(%rip),%xmm0
movlpd %xmm0,(%r14)
mov    $0x4,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @obliczRozwDwukwad(double %0, double %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %8
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %32
16: ; preds = %6
%17 = load double, double* %9
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load double*, double** %10
store double 0.000000e+00, double* %20
%21 = load double*, double** %11
store double 0.000000e+00, double* %21
%22 = load double*, double** %12
store double 0.000000e+00, double* %22
%23 = load double*, double** %13
store double 0.000000e+00, double* %23
store i32 0, i32* %7
br label %53
24: ; preds = %16
%25 = load double, double* %9
%26 = call double @sqrt(double %25)
%27 = load double*, double** %10
store double %26, double* %27
%28 = load double*, double** %10
%29 = load double, double* %28
%30 = fmul double -1.000000e+00, %29
%31 = load double*, double** %11
store double %30, double* %31
store i32 2, i32* %7
br label %53
32: ; preds = %6
%33 = load double, double* %8
%34 = call double @sqrt(double %33)
%35 = load double*, double** %10
store double %34, double* %35
%36 = load double*, double** %10
%37 = load double, double* %36
%38 = fmul double -1.000000e+00, %37
%39 = load double*, double** %11
store double %38, double* %39
%40 = load double, double* %9
%41 = fcmp olt double %40, 0.000000e+00
br i1 %41, label %42, label %45
42: ; preds = %32
%43 = load double*, double** %12
store double 0.000000e+00, double* %43
%44 = load double*, double** %13
store double 0.000000e+00, double* %44
store i32 2, i32* %7
br label %53
45: ; preds = %32
%46 = load double, double* %9
%47 = call double @sqrt(double %46)
%48 = load double*, double** %12
store double %47, double* %48
%49 = load double*, double** %12
%50 = load double, double* %49
%51 = fmul double -1.000000e+00, %50
%52 = load double*, double** %13
store double %51, double* %52
store i32 4, i32* %7
br label %53
53: ; preds = %45, %42, %24, %19
%54 = load i32, i32* %7
ret i32 %54
}

LLVM IR (-O2):
define i32 @obliczRozwDwukwad(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fcmp olt double %0, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = fcmp olt double %1, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %8
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
br label %22
11: ; preds = %8
%12 = tail call double @sqrt(double %1)
store double %12, double* %2
%13 = fneg double %12
store double %13, double* %3
br label %22
14: ; preds = %6
%15 = tail call double @sqrt(double %0)
store double %15, double* %2
%16 = fneg double %15
store double %16, double* %3
%17 = fcmp olt double %1, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %14
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
br label %22
19: ; preds = %14
%20 = tail call double @sqrt(double %1)
store double %20, double* %4
%21 = fneg double %20
store double %21, double* %5
br label %22
22: ; preds = %19, %18, %11, %10
%23 = phi i32 [ 0, %10 ], [ 2, %11 ], [ 2, %18 ], [ 4, %19 ]
ret i32 %23
}