#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*/ fscanf(int /*<<< orphan*/, char *, double *, double *,
                          double *);
double *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qsolv(double, double, double, double *, double *);
int /*<<< orphan*/ setRoot1(double *);
int /*<<< orphan*/ setRoot2(double *);
int /*<<< orphan*/ stdin;
double promptUser() {
  double a, b, c, ret;
  double *x1 = malloc(sizeof(double));
  double *x2 = malloc(sizeof(double));
  printf("Hi, Please input a,b,c double size cofficents of a qudratic equation "
         "in the format (a,b,c)\n");
  fscanf(stdin, "%lf,%lf,%lf", &a, &b, &c);
  qsolv(a, b, c, x1, x2);
  setRoot1(x1);
  setRoot2(x2);
  return 0;
}


x86 assembly (clang, -O0):
<promptUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <fscanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <qsolv@plt>
mov    -0x28(%rbp),%rdi
call   1060 <setRoot1@plt>
mov    -0x30(%rbp),%rdi
call   1080 <setRoot2@plt>
xorps  %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptUser>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe84(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
call   1050 <fscanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <qsolv@plt>
mov    %r14,%rdi
call   1060 <setRoot1@plt>
mov    %rbx,%rdi
call   1080 <setRoot2@plt>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [92 x i8] c"Hi, Please input a,b,c double size cofficents of a qudratic equation in the format (a,b,c)\0A\00"
@stdin = global i32 0
@.str.1 = [12 x i8] c"%lf,%lf,%lf\00"
define double @promptUser() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = call double* @malloc(i32 8)
store double* %7, double** %5
%8 = call double* @malloc(i32 8)
store double* %8, double** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @fscanf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%12 = load double, double* %1
%13 = load double, double* %2
%14 = load double, double* %3
%15 = load double*, double** %5
%16 = load double*, double** %6
%17 = call i32 @qsolv(double %12, double %13, double %14, double* %15, double* %16)
%18 = load double*, double** %5
%19 = call i32 @setRoot1(double* %18)
%20 = load double*, double** %6
%21 = call i32 @setRoot2(double* %20)
ret double 0.000000e+00
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [12 x i8] c"%lf,%lf,%lf\00"
@str = [91 x i8] c"Hi, Please input a,b,c double size cofficents of a qudratic equation in the format (a,b,c)\00"
define double @promptUser() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call double* @malloc(i32 8)
%8 = tail call double* @malloc(i32 8)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @fscanf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%12 = load double, double* %1
%13 = load double, double* %2
%14 = load double, double* %3
%15 = call i32 @qsolv(double %12, double %13, double %14, double* %7, double* %8)
%16 = call i32 @setRoot1(double* %7)
%17 = call i32 @setRoot2(double* %8)
ret double 0.000000e+00
}