#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 */
scalar_t__ bhaskara(float, float, float, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x1, x2;
  float a, b, c;
  printf("Informe o primeiro coeficiente: ");
  scanf("%f", &a);
  printf("Informe o segundo coeficiente: ");
  scanf("%f", &b);
  printf("Informe o terceiro coeficiente: ");
  scanf("%f", &c);
  if (bhaskara(a, b, c, &x1, &x2))
    printf("Raizes: %.2f e %.2f\n", x1, x2);
  else
    printf("Sem solucao!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <bhaskara@plt>
cmp    $0x0,%rax
je     11e4 <main+0xb4>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xc2>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
lea    0x1c(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1050 <bhaskara@plt>
test   %rax,%rax
je     11e7 <main+0xa7>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe87(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    11f3 <main+0xb3>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Informe o primeiro coeficiente: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"Informe o segundo coeficiente: \00"
@.str.3 = [33 x i8] c"Informe o terceiro coeficiente: \00"
@.str.4 = [21 x i8] c"Raizes: %.2f e %.2f\0A\00"
@.str.5 = [14 x i8] c"Sem solucao!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 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* %4)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%13 = load float, float* %4
%14 = load float, float* %5
%15 = load float, float* %6
%16 = call i64 @bhaskara(float %13, float %14, float %15, float* %2, float* %3)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %0
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %20, double %22)
br label %26
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %24, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Informe o primeiro coeficiente: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"Informe o segundo coeficiente: \00"
@.str.3 = [33 x i8] c"Informe o terceiro coeficiente: \00"
@.str.4 = [21 x i8] c"Raizes: %.2f e %.2f\0A\00"
@str = [13 x i8] c"Sem solucao!\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%17 = load float, float* %3
%18 = load float, float* %4
%19 = load float, float* %5
%20 = call i64 @bhaskara(float %17, float %18, float %19, float* %1, float* %2)
%21 = icmp eq i64 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %0
%23 = load float, float* %1
%24 = fpext float %23 to double
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %24, double %26)
br label %30
28: ; preds = %0
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %30
30: ; preds = %28, %22
ret i32 0
}