#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 pow(float, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
float sqrt(float);
int /*<<< orphan*/ system(char *);
void bhaska() {
  char pedeTempo;
  float a, b, c, rd;
  system("clear");
  printf("F(x) = a*x^2 + b*x + c\n");
  printf("de-me a o valor de 'a':\n");
  scanf(" %f", &a);
  printf("de-me a o valor de 'b':\n");
  scanf(" %f", &b);
  printf("de-me a o valor de 'c':\n");
  scanf(" %f", &c);
  rd = pow(b, 2.0) - 4.0 * a * c;
  if (rd >= 0) {
    rd = sqrt(rd);
    printf("x1 é %f\n", (-b + rd) / 2.0 / a);
    printf("x2 é %f\n", (-b - rd) / 2.0 / a);
  } else {
    rd = sqrt(-rd);
    printf("x1 é %f + i * %f\n", -b / 2 / a, rd / 2 / a);
    printf("x2 é %f - i * %f\n", -b / 2 / a, rd / 2 / a);
  }
  printf("\nq para sair\n");
  scanf(" %c", &pedeTempo);
}


x86 assembly (clang, -O0):
<bhaska>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xe08(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     12d6 <bhaska+0x186>
movss  -0x14(%rbp),%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd98(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
subss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd56(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
lea    0xdc1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1390 <bhaska+0x240>
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xd04(%rip),%xmm1
divss  %xmm1,%xmm0
divss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
movss  0xcea(%rip),%xmm2
divss  %xmm2,%xmm1
divss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd5b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xcb5(%rip),%xmm1
divss  %xmm1,%xmm0
divss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
movss  0xc9b(%rip),%xmm2
divss  %xmm2,%xmm1
divss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd1f(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd24(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bhaska>:
push   %rbx
sub    $0x20,%rsp
lea    0xed0(%rip),%rdi
call   1040 <system@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
movsd  0xe1d(%rip),%xmm1
call   1070 <pow@plt>
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x1c(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xe04(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    123b <bhaska+0xdb>
movaps 0xdfe(%rip),%xmm1
xorps  %xmm0,%xmm1
movss  0xe03(%rip),%xmm2
ucomiss %xmm0,%xmm2
jb     124a <bhaska+0xea>
xorps  %xmm2,%xmm2
sqrtss %xmm1,%xmm2
jmp    1255 <bhaska+0xf5>
jb     12d5 <bhaska+0x175>
sqrtss %xmm0,%xmm0
jmp    12da <bhaska+0x17a>
movaps %xmm1,%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm2
movss  0xc(%rsp),%xmm0
mulss  0xdd1(%rip),%xmm0
movss  0x10(%rsp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulss  0xdbf(%rip),%xmm2
movss  %xmm2,0x14(%rsp)
divss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xdc9(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd94(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rsp),%xmm2
divss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xda1(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1349 <bhaska+0x1e9>
call   1080 <sqrt@plt>
movss  %xmm0,0x14(%rsp)
subss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd1e(%rip),%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
lea    0xd3f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
xorps  0xd05(%rip),%xmm0
subss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xce3(%rip),%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
lea    0xd0e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd93(%rip),%rdi
call   1030 <puts@plt>
lea    0xd24(%rip),%rdi
lea    0x1b(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [24 x i8] c"F(x) = a*x^2 + b*x + c\0A\00"
@.str.2 = [25 x i8] c"de-me a o valor de 'a':\0A\00"
@.str.3 = [4 x i8] c" %f\00"
@.str.4 = [25 x i8] c"de-me a o valor de 'b':\0A\00"
@.str.5 = [25 x i8] c"de-me a o valor de 'c':\0A\00"
@.str.6 = [10 x i8] c"x1 \C3\A9 %f\0A\00"
@.str.7 = [10 x i8] c"x2 \C3\A9 %f\0A\00"
@.str.8 = [19 x i8] c"x1 \C3\A9 %f + i * %f\0A\00"
@.str.9 = [19 x i8] c"x2 \C3\A9 %f - i * %f\0A\00"
@.str.10 = [14 x i8] c"\0Aq para sair\0A\00"
@.str.11 = [4 x i8] c" %c\00"
define void @bhaska() {
%1 = alloca i8
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %4)
%14 = load float, float* %3
%15 = call double @pow(float %14, double 2.000000e+00)
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fmul double 4.000000e+00, %17
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = fneg double %18
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double %15)
%23 = fptrunc double %22 to float
store float %23, float* %5
%24 = load float, float* %5
%25 = fcmp oge float %24, 0.000000e+00
br i1 %25, label %26, label %49
26: ; preds = %0
%27 = load float, float* %5
%28 = call float @sqrt(float %27)
store float %28, float* %5
%29 = load float, float* %3
%30 = fneg float %29
%31 = load float, float* %5
%32 = fadd float %30, %31
%33 = fpext float %32 to double
%34 = fdiv double %33, 2.000000e+00
%35 = load float, float* %2
%36 = fpext float %35 to double
%37 = fdiv double %34, %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %37)
%39 = load float, float* %3
%40 = fneg float %39
%41 = load float, float* %5
%42 = fsub float %40, %41
%43 = fpext float %42 to double
%44 = fdiv double %43, 2.000000e+00
%45 = load float, float* %2
%46 = fpext float %45 to double
%47 = fdiv double %44, %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %47)
br label %77
49: ; preds = %0
%50 = load float, float* %5
%51 = fneg float %50
%52 = call float @sqrt(float %51)
store float %52, float* %5
%53 = load float, float* %3
%54 = fneg float %53
%55 = fdiv float %54, 2.000000e+00
%56 = load float, float* %2
%57 = fdiv float %55, %56
%58 = fpext float %57 to double
%59 = load float, float* %5
%60 = fdiv float %59, 2.000000e+00
%61 = load float, float* %2
%62 = fdiv float %60, %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %58, double %63)
%65 = load float, float* %3
%66 = fneg float %65
%67 = fdiv float %66, 2.000000e+00
%68 = load float, float* %2
%69 = fdiv float %67, %68
%70 = fpext float %69 to double
%71 = load float, float* %5
%72 = fdiv float %71, 2.000000e+00
%73 = load float, float* %2
%74 = fdiv float %72, %73
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %70, double %75)
br label %77
77: ; preds = %49, %26
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%79 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.3 = [4 x i8] c" %f\00"
@.str.6 = [10 x i8] c"x1 \C3\A9 %f\0A\00"
@.str.7 = [10 x i8] c"x2 \C3\A9 %f\0A\00"
@.str.8 = [19 x i8] c"x1 \C3\A9 %f + i * %f\0A\00"
@.str.9 = [19 x i8] c"x2 \C3\A9 %f - i * %f\0A\00"
@.str.11 = [4 x i8] c" %c\00"
@str = [23 x i8] c"F(x) = a*x^2 + b*x + c\00"
@str.12 = [24 x i8] c"de-me a o valor de 'a':\00"
@str.13 = [24 x i8] c"de-me a o valor de 'b':\00"
@str.14 = [24 x i8] c"de-me a o valor de 'c':\00"
@str.15 = [13 x i8] c"\0Aq para sair\00"
define void @bhaska() {
%1 = alloca i8
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %2)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %3)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.14, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %4)
%16 = load float, float* %3
%17 = call double @pow(float %16, double 2.000000e+00)
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = fmul double %19, -4.000000e+00
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %17)
%24 = fptrunc double %23 to float
%25 = fcmp ult float %24, 0.000000e+00
br i1 %25, label %45, label %26
26: ; preds = %0
%27 = call float @sqrt(float %24)
%28 = load float, float* %3
%29 = fsub float %27, %28
%30 = fpext float %29 to double
%31 = fmul double %30, 5.000000e-01
%32 = load float, float* %2
%33 = fpext float %32 to double
%34 = fdiv double %31, %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %34)
%36 = load float, float* %3
%37 = fneg float %36
%38 = fsub float %37, %27
%39 = fpext float %38 to double
%40 = fmul double %39, 5.000000e-01
%41 = load float, float* %2
%42 = fpext float %41 to double
%43 = fdiv double %40, %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %43)
br label %65
45: ; preds = %0
%46 = fneg float %24
%47 = call float @sqrt(float %46)
%48 = load float, float* %3
%49 = fmul float %48, -5.000000e-01
%50 = load float, float* %2
%51 = fdiv float %49, %50
%52 = fpext float %51 to double
%53 = fmul float %47, 5.000000e-01
%54 = fdiv float %53, %50
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), double %52, double %55)
%57 = load float, float* %3
%58 = fmul float %57, -5.000000e-01
%59 = load float, float* %2
%60 = fdiv float %58, %59
%61 = fpext float %60 to double
%62 = fdiv float %53, %59
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %61, double %63)
br label %65
65: ; preds = %45, %26
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.15, i64 0, i64 0))
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %1)
ret void
}