#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 sqrt(float);
int main() {
  float a, b, c, delta, x1, x2;
  printf("Podaj wartosci a,b,c:\n");
  scanf("%f", &a);
  scanf("%f", &b);
  scanf("%f", &c);
  delta = b * b - 4 * a * c;
  printf("Funkcja kwadratowa przyjmuje wartosci ponizej zera w przedziale\n");
  if (delta > 0) {
    x1 = (-b - sqrt(delta)) / 2 * a;
    x2 = (-b + sqrt(delta)) / 2 * a;
    printf("%f\n", x1);
    printf("%f\n", x2);
  } else if (delta = 0)
    x1 = x2 = -b / (2 * a);
  else if (a >= 0)
    printf("jednak nie przyjmuje he he he\n");
  else
    printf("dla kazdego iks\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xe71(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    128b <main+0x15b>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  0xdfd(%rip),%xmm1
divss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  0xdba(%rip),%xmm1
divss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1310 <main+0x1e0>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    12a2 <main+0x172>
jmp    12d4 <main+0x1a4>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xd48(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  %xmm0,-0x18(%rbp)
jmp    130b <main+0x1db>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     12f8 <main+0x1c8>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1306 <main+0x1d6>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130b <main+0x1db>
jmp    1310 <main+0x1e0>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x18(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
mulss  0xe6d(%rip),%xmm0
mulss  0x1c(%rsp),%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    1289 <main+0x149>
movss  0x18(%rsp),%xmm2
xorps  0xe3e(%rip),%xmm2
sqrtss %xmm1,%xmm3
ucomiss %xmm0,%xmm1
movaps %xmm3,%xmm0
jae    1202 <main+0xc2>
movaps %xmm1,%xmm0
movaps %xmm2,0x20(%rsp)
movss  %xmm3,0x14(%rsp)
call   1060 <sqrt@plt>
movss  0x14(%rsp),%xmm3
movaps 0x20(%rsp),%xmm2
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm2
mulss  0xdf6(%rip),%xmm2
mulss  0x10(%rsp),%xmm2
movss  0x18(%rsp),%xmm4
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jae    1243 <main+0x103>
movaps %xmm1,%xmm0
movaps %xmm2,0x20(%rsp)
movss  %xmm4,0xc(%rsp)
call   1060 <sqrt@plt>
movss  0xc(%rsp),%xmm4
movaps 0x20(%rsp),%xmm2
movaps %xmm0,%xmm3
subss  %xmm4,%xmm3
mulss  0xdb5(%rip),%xmm3
mulss  0x10(%rsp),%xmm3
movss  %xmm3,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
lea    0xdba(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    12a9 <main+0x169>
movss  0x10(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jae    129d <main+0x15d>
lea    0xde2(%rip),%rdi
jmp    12a4 <main+0x164>
lea    0xde9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Podaj wartosci a,b,c:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [65 x i8] c"Funkcja kwadratowa przyjmuje wartosci ponizej zera w przedziale\0A\00"
@.str.3 = [4 x i8] c"%f\0A\00"
@.str.4 = [31 x i8] c"jednak nie przyjmuje he he he\0A\00"
@.str.5 = [17 x i8] c"dla kazdego iks\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
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = load float, float* %3
%13 = load float, float* %3
%14 = load float, float* %2
%15 = fmul float 4.000000e+00, %14
%16 = load float, float* %4
%17 = fmul float %15, %16
%18 = fneg float %17
%19 = call float @llvm.fmuladd.f32(float %12, float %13, float %18)
store float %19, float* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%21 = load float, float* %5
%22 = fcmp ogt float %21, 0.000000e+00
br i1 %22, label %23, label %46
23: ; preds = %0
%24 = load float, float* %3
%25 = fneg float %24
%26 = load float, float* %5
%27 = call float @sqrt(float %26)
%28 = fsub float %25, %27
%29 = fdiv float %28, 2.000000e+00
%30 = load float, float* %2
%31 = fmul float %29, %30
store float %31, float* %6
%32 = load float, float* %3
%33 = fneg float %32
%34 = load float, float* %5
%35 = call float @sqrt(float %34)
%36 = fadd float %33, %35
%37 = fdiv float %36, 2.000000e+00
%38 = load float, float* %2
%39 = fmul float %37, %38
store float %39, float* %7
%40 = load float, float* %6
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %41)
%43 = load float, float* %7
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %44)
br label %62
46: ; preds = %0
store float 0.000000e+00, float* %5
br i1 false, label %47, label %53
47: ; preds = %46
%48 = load float, float* %3
%49 = fneg float %48
%50 = load float, float* %2
%51 = fmul float 2.000000e+00, %50
%52 = fdiv float %49, %51
store float %52, float* %7
store float %52, float* %6
br label %61
53: ; preds = %46
%54 = load float, float* %2
%55 = fcmp oge float %54, 0.000000e+00
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %60
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
br label %61
61: ; preds = %60, %47
br label %62
62: ; preds = %61, %23
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [4 x i8] c"%f\0A\00"
@str = [22 x i8] c"Podaj wartosci a,b,c:\00"
@str.6 = [64 x i8] c"Funkcja kwadratowa przyjmuje wartosci ponizej zera w przedziale\00"
@str.7 = [16 x i8] c"dla kazdego iks\00"
@str.8 = [30 x i8] c"jednak nie przyjmuje he he he\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = load float, float* %2
%12 = load float, float* %1
%13 = load float, float* %3
%14 = fmul float %12, -4.000000e+00
%15 = fmul float %14, %13
%16 = call float @llvm.fmuladd.f32(float %11, float %11, float %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.6, i64 0, i64 0))
%18 = fcmp ogt float %16, 0.000000e+00
br i1 %18, label %19, label %37
19: ; preds = %0
%20 = load float, float* %2
%21 = fneg float %20
%22 = call float @sqrt(float %16)
%23 = fsub float %21, %22
%24 = fmul float %23, 5.000000e-01
%25 = load float, float* %1
%26 = fmul float %25, %24
%27 = load float, float* %2
%28 = call float @sqrt(float %16)
%29 = fsub float %28, %27
%30 = fmul float %29, 5.000000e-01
%31 = load float, float* %1
%32 = fmul float %31, %30
%33 = fpext float %26 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %33)
%35 = fpext float %32 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %35)
br label %44
37: ; preds = %0
%38 = load float, float* %1
%39 = fcmp ult float %38, 0.000000e+00
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.8, i64 0, i64 0))
br label %44
42: ; preds = %37
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
br label %44
44: ; preds = %42, %40, %19
ret i32 0
}