#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 */
float pow(float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
main() {
  int n;
  float x, k, p, i;
  k = 1;
  printf("Введите n \n");
  scanf("%d", &n);
  printf("Введите x \n");
  scanf("%f", &x);
  p = pow(x, k) * (k * x + 1) * 2 * pow(k * x, 2) + (3 * k * x) + 1;
  i = n;
  n = 0;
  if (x < 1 && x > -1)
    while (n < i) {
      k++;
      n++;
      p = p * (pow(x, k) * (k * x + 1) * 2 * pow(k * x, 2) + (3 * k * x) + 1);
      printf("P=%f\n", p);
    }
  else
    printf("%f > 1", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvttss2si -0x10(%rbp),%edi
call   1050 <pow@plt>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xe4f(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xe47(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
movss  0xe16(%rip),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xdf8(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
movss  0xdd6(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1336 <main+0x206>
movss  -0xc(%rbp),%xmm0
movss  0xdcb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1336 <main+0x206>
jmp    124f <main+0x11f>
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1331 <main+0x201>
movss  0xd96(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvttss2si -0x10(%rbp),%edi
call   1050 <pow@plt>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xd54(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xd4c(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movss  -0x24(%rbp),%xmm1
movaps %xmm0,%xmm3
movss  -0x20(%rbp),%xmm0
movss  0xd16(%rip),%xmm2
mulss  -0x10(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xcf8(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd17(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    124f <main+0x11f>
jmp    134d <main+0x21d>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcfc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mov    $0x1,%edi
call   1060 <pow@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
mov    0x14(%rsp),%eax
movl   $0x0,0x14(%rsp)
movss  0xe34(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1307 <main+0x1c7>
ucomiss 0xe28(%rip),%xmm0
jbe    1307 <main+0x1c7>
test   %eax,%eax
jle    1319 <main+0x1d9>
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
movss  %xmm2,0x18(%rsp)
movss  0xe01(%rip),%xmm3
movss  0x8(%rsp),%xmm2
addss  %xmm3,%xmm2
movss  0x10(%rsp),%xmm4
mulss  %xmm2,%xmm4
addss  %xmm4,%xmm4
movss  0xde9(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm4
addss  %xmm2,%xmm4
addss  %xmm3,%xmm4
xor    %eax,%eax
lea    0xdda(%rip),%rbx
movss  %xmm3,0x8(%rsp)
xchg   %ax,%ax
movss  %xmm4,0x10(%rsp)
movss  0xdb2(%rip),%xmm1
movss  0x8(%rsp),%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,0x8(%rsp)
add    $0x1,%eax
mov    %eax,0x14(%rsp)
cvttss2si %xmm2,%edi
call   1060 <pow@plt>
movss  0xc(%rsp),%xmm1
mulss  0x8(%rsp),%xmm1
movaps %xmm1,%xmm2
addss  0xd7b(%rip),%xmm2
mulss  %xmm0,%xmm2
addss  %xmm2,%xmm2
movss  %xmm2,0x1c(%rsp)
movaps %xmm1,%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movss  0x8(%rsp),%xmm1
mulss  0xd5a(%rip),%xmm1
mulss  0xc(%rsp),%xmm1
mulss  0x1c(%rsp),%xmm0
addss  %xmm1,%xmm0
addss  0xd3a(%rip),%xmm0
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x14(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x18(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1319 <main+0x1d9>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm4
jmp    1240 <main+0x100>
cvtss2sd %xmm0,%xmm0
lea    0xd06(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 n \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 x \0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [6 x i8] c"P=%f\0A\00"
@.str.5 = [7 x i8] c"%f > 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 1.000000e+00, float* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fptosi float %12 to i32
%14 = call float @pow(float %11, i32 %13)
%15 = load float, float* %4
%16 = load float, float* %3
%17 = call float @llvm.fmuladd.f32(float %15, float %16, float 1.000000e+00)
%18 = fmul float %14, %17
%19 = fmul float %18, 2.000000e+00
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fmul float %20, %21
%23 = call float @pow(float %22, i32 2)
%24 = load float, float* %4
%25 = fmul float 3.000000e+00, %24
%26 = load float, float* %3
%27 = fmul float %25, %26
%28 = call float @llvm.fmuladd.f32(float %19, float %23, float %27)
%29 = fadd float %28, 1.000000e+00
store float %29, float* %5
%30 = load i32, i32* %2
%31 = sitofp i32 %30 to float
store float %31, float* %6
store i32 0, i32* %2
%32 = load float, float* %3
%33 = fcmp olt float %32, 1.000000e+00
br i1 %33, label %34, label %73
34: ; preds = %0
%35 = load float, float* %3
%36 = fcmp ogt float %35, -1.000000e+00
br i1 %36, label %37, label %73
37: ; preds = %34
br label %38
38: ; preds = %43, %37
%39 = load i32, i32* %2
%40 = sitofp i32 %39 to float
%41 = load float, float* %6
%42 = fcmp olt float %40, %41
br i1 %42, label %43, label %72
43: ; preds = %38
%44 = load float, float* %4
%45 = fadd float %44, 1.000000e+00
store float %45, float* %4
%46 = load i32, i32* %2
%47 = add nsw i32 %46, 1
store i32 %47, i32* %2
%48 = load float, float* %5
%49 = load float, float* %3
%50 = load float, float* %4
%51 = fptosi float %50 to i32
%52 = call float @pow(float %49, i32 %51)
%53 = load float, float* %4
%54 = load float, float* %3
%55 = call float @llvm.fmuladd.f32(float %53, float %54, float 1.000000e+00)
%56 = fmul float %52, %55
%57 = fmul float %56, 2.000000e+00
%58 = load float, float* %4
%59 = load float, float* %3
%60 = fmul float %58, %59
%61 = call float @pow(float %60, i32 2)
%62 = load float, float* %4
%63 = fmul float 3.000000e+00, %62
%64 = load float, float* %3
%65 = fmul float %63, %64
%66 = call float @llvm.fmuladd.f32(float %57, float %61, float %65)
%67 = fadd float %66, 1.000000e+00
%68 = fmul float %48, %67
store float %68, float* %5
%69 = load float, float* %5
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %70)
br label %38
72: ; preds = %38
br label %77
73: ; preds = %34, %0
%74 = load float, float* %3
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %75)
br label %77
77: ; preds = %73, %72
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [6 x i8] c"P=%f\0A\00"
@.str.5 = [7 x i8] c"%f > 1\00"
@str = [18 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 n \00"
@str.6 = [18 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 x \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%9 = load float, float* %2
%10 = call float @pow(float %9, i32 1)
%11 = load float, float* %2
%12 = call float @pow(float %11, i32 2)
%13 = load float, float* %2
%14 = load i32, i32* %1
%15 = sitofp i32 %14 to float
store i32 0, i32* %1
%16 = fcmp olt float %13, 1.000000e+00
%17 = fcmp ogt float %13, -1.000000e+00
%18 = and i1 %16, %17
br i1 %18, label %19, label %56
19: ; preds = %0
%20 = icmp sgt i32 %14, 0
br i1 %20, label %21, label %59
21: ; preds = %19
%22 = fadd float %11, 1.000000e+00
%23 = fmul float %10, %22
%24 = fmul float %23, 2.000000e+00
%25 = fmul float %13, 3.000000e+00
%26 = call float @llvm.fmuladd.f32(float %24, float %12, float %25)
%27 = fadd float %26, 1.000000e+00
br label %28
28: ; preds = %54, %21
%29 = phi float [ %55, %54 ], [ %13, %21 ]
%30 = phi i32 [ %51, %54 ], [ 0, %21 ]
%31 = phi float [ %33, %54 ], [ 1.000000e+00, %21 ]
%32 = phi float [ %48, %54 ], [ %27, %21 ]
%33 = fadd float %31, 1.000000e+00
%34 = add nsw i32 %30, 1
store i32 %34, i32* %1
%35 = fptosi float %33 to i32
%36 = call float @pow(float %29, i32 %35)
%37 = load float, float* %2
%38 = call float @llvm.fmuladd.f32(float %33, float %37, float 1.000000e+00)
%39 = fmul float %36, %38
%40 = fmul float %39, 2.000000e+00
%41 = fmul float %33, %37
%42 = call float @pow(float %41, i32 2)
%43 = fmul float %33, 3.000000e+00
%44 = load float, float* %2
%45 = fmul float %43, %44
%46 = call float @llvm.fmuladd.f32(float %40, float %42, float %45)
%47 = fadd float %46, 1.000000e+00
%48 = fmul float %32, %47
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %49)
%51 = load i32, i32* %1
%52 = sitofp i32 %51 to float
%53 = fcmp olt float %52, %15
br i1 %53, label %54, label %59
54: ; preds = %28
%55 = load float, float* %2
br label %28
56: ; preds = %0
%57 = fpext float %13 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %57)
br label %59
59: ; preds = %28, %19, %56
ret i32 0
}