#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(double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
main() {
  int n, i;
  printf("jisuu:");
  scanf("%d", &n);
  printf("keisuu:");
  double a[11];
  for (i = 0; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  double x;
  printf("x=");
  scanf("%lf", &x);
  double y = 0;
  for (i = 0; i <= n; i++) {
    y += a[i] * pow(x, i);
  }
  printf("y=%lf\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ae <main+0x7e>
movslq -0xc(%rbp),%rax
lea    -0x70(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x47>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1233 <main+0x103>
movslq -0xc(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11dd <main+0xad>
movsd  -0x80(%rbp),%xmm0
lea    0xdda(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
js     11af <main+0x7f>
mov    $0xffffffffffffffff,%r15
lea    0x20(%rsp),%rbx
lea    0xe8d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
add    $0x1,%r15
add    $0x8,%rbx
cmp    %rax,%r15
jl     1190 <main+0x60>
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
js     122e <main+0xfe>
xorps  %xmm0,%xmm0
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp,%rbx,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
lea    0x1(%rbx),%rax
movslq 0x4(%rsp),%rcx
cmp    %rcx,%rbx
mov    %rax,%rbx
jl     11e0 <main+0xb0>
jmp    1231 <main+0x101>
xorps  %xmm0,%xmm0
lea    0xde1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"jisuu:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"keisuu:\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [3 x i8] c"x=\00"
@.str.5 = [7 x i8] c"y=%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [11 x double]
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 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 ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 %16
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %10
22: ; preds = %10
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %5)
store double 0.000000e+00, double* %6
store i32 0, i32* %3
br label %25
25: ; preds = %39, %22
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %42
29: ; preds = %25
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 %31
%33 = load double, double* %32
%34 = load double, double* %5
%35 = load i32, i32* %3
%36 = call double @pow(double %34, i32 %35)
%37 = load double, double* %6
%38 = call double @llvm.fmuladd.f64(double %33, double %36, double %37)
store double %38, double* %6
br label %39
39: ; preds = %29
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %25
42: ; preds = %25
%43 = load double, double* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %43)
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str = [7 x i8] c"jisuu:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"keisuu:\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [3 x i8] c"x=\00"
@.str.5 = [7 x i8] c"y=%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x double]
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = bitcast [11 x double]* %2 to i8*
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %0, %11
%12 = phi i64 [ %15, %11 ], [ 0, %0 ]
%13 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %12
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %13)
%15 = add nuw nsw i64 %12, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %12, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %0
%20 = bitcast double* %3 to i8*
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %3)
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 0
br i1 %24, label %38, label %25
25: ; preds = %19, %25
%26 = phi i64 [ %34, %25 ], [ 0, %19 ]
%27 = phi double [ %33, %25 ], [ 0.000000e+00, %19 ]
%28 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %26
%29 = load double, double* %28
%30 = load double, double* %3
%31 = trunc i64 %26 to i32
%32 = call double @pow(double %30, i32 %31)
%33 = call double @llvm.fmuladd.f64(double %29, double %32, double %27)
%34 = add nuw nsw i64 %26, 1
%35 = load i32, i32* %1
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %26, %36
br i1 %37, label %25, label %38
38: ; preds = %25, %19
%39 = phi double [ 0.000000e+00, %19 ], [ %33, %25 ]
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %39)
ret i32 0
}