#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 *, double, ...);
int /*<<< orphan*/ puts(char *);
int sqrt(double);
int main(int argc, char const *argv[]) {
  int a = 2;
  int b = 3;
  int c = 1;
  double delta = b * b - 4 * a * c;
  printf("delta=%f\n", delta);
  if (delta > 0) {
    double x1 = (-b - sqrt(delta)) / 2 * a;
    double x2 = (-b + sqrt(delta)) / 2 * a;
    printf("pierwiastki: %f %f\n", x1, x2);
  } else if (delta == 0) {
    double x1 = -b / 2 * a;
    printf("pierwiastek: %f\n", x1);
  } else {
    puts("Brak pierwiastków");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x1c(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1215 <main+0xe5>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xe01(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1270 <main+0x140>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    125f <main+0x12f>
jp     125f <main+0x12f>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xdcb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    126b <main+0x13b>
lea    0xdc9(%rip),%rdi
call   1030 <puts@plt>
jmp    1270 <main+0x140>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xec1(%rip),%xmm0
call   1040 <sqrt@plt>
mov    $0xfffffffd,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
and    $0xfffffffe,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe97(%rip),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
add    $0xfffffffd,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xfffffffd,%eax
and    $0xfffffffe,%eax
cvtsi2sd %eax,%xmm1
lea    0xe89(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"delta=%f\0A\00"
@.str.1 = [20 x i8] c"pierwiastki: %f %f\0A\00"
@.str.2 = [17 x i8] c"pierwiastek: %f\0A\00"
@.str.3 = [19 x i8] c"Brak pierwiastk\C3\B3w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 3, i32* %7
store i32 1, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %7
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %6
%17 = mul nsw i32 4, %16
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = sub nsw i32 %15, %19
%21 = sitofp i32 %20 to double
store double %21, double* %9
%22 = load double, double* %9
%23 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %22)
%24 = load double, double* %9
%25 = fcmp ogt double %24, 0.000000e+00
br i1 %25, label %26, label %48
26: ; preds = %2
%27 = load i32, i32* %7
%28 = sub nsw i32 0, %27
%29 = load double, double* %9
%30 = call i32 @sqrt(double %29)
%31 = sub nsw i32 %28, %30
%32 = sdiv i32 %31, 2
%33 = load i32, i32* %6
%34 = mul nsw i32 %32, %33
%35 = sitofp i32 %34 to double
store double %35, double* %10
%36 = load i32, i32* %7
%37 = sub nsw i32 0, %36
%38 = load double, double* %9
%39 = call i32 @sqrt(double %38)
%40 = add nsw i32 %37, %39
%41 = sdiv i32 %40, 2
%42 = load i32, i32* %6
%43 = mul nsw i32 %41, %42
%44 = sitofp i32 %43 to double
store double %44, double* %11
%45 = load double, double* %10
%46 = load double, double* %11
%47 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %45, double %46)
br label %63
48: ; preds = %2
%49 = load double, double* %9
%50 = fcmp oeq double %49, 0.000000e+00
br i1 %50, label %51, label %60
51: ; preds = %48
%52 = load i32, i32* %7
%53 = sub nsw i32 0, %52
%54 = sdiv i32 %53, 2
%55 = load i32, i32* %6
%56 = mul nsw i32 %54, %55
%57 = sitofp i32 %56 to double
store double %57, double* %12
%58 = load double, double* %12
%59 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %58)
br label %62
60: ; preds = %48
%61 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %62
62: ; preds = %60, %51
br label %63
63: ; preds = %62, %26
%64 = load i32, i32* %3
ret i32 %64
}

LLVM IR (-O2):
@.str = [10 x i8] c"delta=%f\0A\00"
@.str.1 = [20 x i8] c"pierwiastki: %f %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
%4 = tail call i32 @sqrt(double 1.000000e+00)
%5 = sub nsw i32 -3, %4
%6 = sdiv i32 %5, 2
%7 = shl nsw i32 %6, 1
%8 = sitofp i32 %7 to double
%9 = tail call i32 @sqrt(double 1.000000e+00)
%10 = add nsw i32 %9, -3
%11 = sdiv i32 %10, 2
%12 = shl nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %8, double %13)
ret i32 0
}