#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 calc_1root(double, double);
double calc_2root1(double, double, double);
double calc_2root2(double, double, double);
scalar_t__ calc_disc(double, double, double);
int /*<<< orphan*/ printf(char *, ...);
void print_solution(double a, double b, double c) {
  printf("\nThe discriminant is: %.2f\n\n", calc_disc(a, b, c));
  if (calc_disc(a, b, c) < 0)
    printf("  No solution:\n  No root\n\n");
  else if (calc_disc(a, b, c) == 0)
    printf("  One solution:\n  Root: %.2f\n\n", calc_1root(a, b));
  else
    printf("  Two solutions:\n  First root: %.2f\n  Second root: %.2f\n\n",
           calc_2root1(a, b, c), calc_2root2(a, b, c));
}


x86 assembly (clang, -O0):
<print_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <calc_disc@plt>
mov    %rax,%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <calc_disc@plt>
cmp    $0x0,%rax
jge    11bd <print_solution+0x6d>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1245 <print_solution+0xf5>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <calc_disc@plt>
cmp    $0x0,%rax
jne    11fd <print_solution+0xad>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <calc_1root@plt>
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1240 <print_solution+0xf0>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1070 <calc_2root1@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <calc_2root2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe1e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1245 <print_solution+0xf5>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_solution>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1070 <calc_disc@plt>
lea    0xe7e(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1070 <calc_disc@plt>
test   %rax,%rax
js     1213 <print_solution+0xb3>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1070 <calc_disc@plt>
test   %rax,%rax
je     1223 <print_solution+0xc3>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1080 <calc_2root1@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1040 <calc_2root2@plt>
movaps %xmm0,%xmm1
lea    0xe3a(%rip),%rdi
movsd  0x20(%rsp),%xmm0
mov    $0x2,%al
add    $0x28,%rsp
jmp    1060 <printf@plt>
lea    0xe5c(%rip),%rdi
add    $0x28,%rsp
jmp    1050 <puts@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <calc_1root@plt>
lea    0xde2(%rip),%rdi
mov    $0x1,%al
add    $0x28,%rsp
jmp    1060 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0AThe discriminant is: %.2f\0A\0A\00"
@.str.1 = [27 x i8] c" No solution:\0A No root\0A\0A\00"
@.str.2 = [31 x i8] c" One solution:\0A Root: %.2f\0A\0A\00"
@.str.3 = [58 x i8] c" Two solutions:\0A First root: %.2f\0A Second root: %.2f\0A\0A\00"
define void @print_solution(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i64 @calc_disc(double %7, double %8, double %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %6
%15 = call i64 @calc_disc(double %12, double %13, double %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %41
19: ; preds = %3
%20 = load double, double* %4
%21 = load double, double* %5
%22 = load double, double* %6
%23 = call i64 @calc_disc(double %20, double %21, double %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %19
%26 = load double, double* %4
%27 = load double, double* %5
%28 = call double @calc_1root(double %26, double %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %28)
br label %40
30: ; preds = %19
%31 = load double, double* %4
%32 = load double, double* %5
%33 = load double, double* %6
%34 = call double @calc_2root1(double %31, double %32, double %33)
%35 = load double, double* %4
%36 = load double, double* %5
%37 = load double, double* %6
%38 = call double @calc_2root2(double %35, double %36, double %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), double %34, double %38)
br label %40
40: ; preds = %30, %25
br label %41
41: ; preds = %40, %17
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0AThe discriminant is: %.2f\0A\0A\00"
@.str.2 = [31 x i8] c" One solution:\0A Root: %.2f\0A\0A\00"
@.str.3 = [58 x i8] c" Two solutions:\0A First root: %.2f\0A Second root: %.2f\0A\0A\00"
@str = [26 x i8] c" No solution:\0A No root\0A\00"
define void @print_solution(double %0, double %1, double %2) {
%4 = tail call i64 @calc_disc(double %0, double %1, double %2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = tail call i64 @calc_disc(double %0, double %1, double %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %20
10: ; preds = %3
%11 = tail call i64 @calc_disc(double %0, double %1, double %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call double @calc_1root(double %0, double %1)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %14)
br label %20
16: ; preds = %10
%17 = tail call double @calc_2root1(double %0, double %1, double %2)
%18 = tail call double @calc_2root2(double %0, double %1, double %2)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), double %17, double %18)
br label %20
20: ; preds = %13, %16, %8
ret void
}