#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 pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int x;
  float result;
  printf("Enter number x:");
  scanf("%d", &x);
  if (x != 2) {
    result = (pow(x, 2) - 3) / (pow(x, 2) - 4);
    printf("The result is:%f\n", result);
  } else {
    printf("Imposible!\n");
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
je     11c7 <main+0x87>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1060 <pow@plt>
sub    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11d5 <main+0x95>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
cmp    $0x2,%edi
jne    118b <main+0x3b>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
jmp    11c8 <main+0x78>
mov    $0x2,%esi
call   1070 <pow@plt>
mov    %eax,%ebx
add    $0xfffffffd,%ebx
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    %eax,%ecx
add    $0xfffffffc,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe56(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter number x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The result is:%f\0A\00"
@.str.3 = [12 x i8] c"Imposible!\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @pow(i32 %9, i32 2)
%11 = sub nsw i32 %10, 3
%12 = load i32, i32* %2
%13 = call i32 @pow(i32 %12, i32 2)
%14 = sub nsw i32 %13, 4
%15 = sdiv i32 %11, %14
%16 = sitofp i32 %15 to float
store float %16, float* %3
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %18)
br label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %8
%23 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter number x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The result is:%f\0A\00"
@.str.4 = [6 x i8] c"pause\00"
@str = [11 x i8] c"Imposible!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 2
br i1 %6, label %17, label %7
7: ; preds = %0
%8 = call i32 @pow(i32 %5, i32 2)
%9 = add nsw i32 %8, -3
%10 = load i32, i32* %1
%11 = call i32 @pow(i32 %10, i32 2)
%12 = add nsw i32 %11, -4
%13 = sdiv i32 %9, %12
%14 = sitofp i32 %13 to float
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %19
19: ; preds = %17, %7
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}