#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(float);
main() {
  float x, y, a;
  printf("Enter x\n");
  printf("x=");
  scanf("%f", &x);
  a = 4 * x - 6;
  if (a <= 0)
    printf("Expression does not make sense\n");
  else {
    y = sqrt(a);
    printf("%f", y);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe88(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe80(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     11ad <main+0x7d>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <main+0xa3>
movss  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xe86(%rip),%xmm0
addss  0xe82(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1195 <main+0x55>
ucomiss %xmm1,%xmm0
jb     11a3 <main+0x63>
sqrtss %xmm0,%xmm0
jmp    11a8 <main+0x68>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
jmp    11ba <main+0x7a>
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Enter x\0A\00"
@.str.1 = [3 x i8] c"x=\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [32 x i8] c"Expression does not make sense\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = call float @llvm.fmuladd.f32(float 4.000000e+00, float %8, float -6.000000e+00)
store float %9, float* %4
%10 = load float, float* %4
%11 = fcmp ole float %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %20
14: ; preds = %0
%15 = load float, float* %4
%16 = call float @sqrt(float %15)
store float %16, float* %3
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %18)
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"x=\00"
@.str.2 = [3 x i8] c"%f\00"
@str = [8 x i8] c"Enter x\00"
@str.4 = [31 x i8] c"Expression does not make sense\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = call float @llvm.fmuladd.f32(float %6, float 4.000000e+00, float -6.000000e+00)
%8 = fcmp ugt float %7, 0.000000e+00
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br label %15
11: ; preds = %0
%12 = call float @sqrt(float %7)
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %13)
br label %15
15: ; preds = %11, %9
ret i32 0
}