#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 f(double, double);
double pow(int, double);
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  double min = 0.0;
  double max = 1.0;
  int di = 2;
  int i, res = 4;
  for (i = 0; i < 10; i++, res *= 2) {
    double tse = 0.0;
    int j, k;
    for (j = 1; j < (res - 1); j++) {
      for (k = 1; k < (res - 1); k++) {
        double err;
        double y1, y2, y3;
        y1 = f((min + (max - min) * (j - 1) / (res - 1.0)),
               (min + (max - min) * (k) / (res - 1.0)));
        y2 = f((min + (max - min) * (j + 0) / (res - 1.0)),
               (min + (max - min) * (k) / (res - 1.0)));
        y3 = f((min + (max - min) * (j + 1) / (res - 1.0)),
               (min + (max - min) * (k) / (res - 1.0)));
        err = 0.5 * (y3 + y1) - y2;
        tse += err * err;
        y1 = f((min + (max - min) * (j) / (res - 1.0)),
               (min + (max - min) * (k - 1) / (res - 1.0)));
        y2 = f((min + (max - min) * (j) / (res - 1.0)),
               (min + (max - min) * (k + 0) / (res - 1.0)));
        y3 = f((min + (max - min) * (j) / (res - 1.0)),
               (min + (max - min) * (k + 1) / (res - 1.0)));
        err = 0.5 * (y3 + y1) - y2;
        tse += err * err;
      }
    }
    tse *= pow((res - 1.0), 4.0);
    tse /= pow((res - 2.0), (double)di);
    printf("Res %d, tse = %f\n", res, tse);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    15a7 <main+0x477>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1520 <main+0x3f0>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    150d <main+0x3dd>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xe2b(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xdfa(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mov    -0x34(%rbp),%eax
add    $0x0,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xdba(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xd89(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xd49(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xd18(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xcec(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x34(%rbp),%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xc86(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xc50(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x34(%rbp),%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xc15(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mov    -0x38(%rbp),%eax
add    $0x0,%eax
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xbdf(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x34(%rbp),%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xba4(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mov    -0x38(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm2
cvtsi2sdl -0x24(%rbp),%xmm3
movsd  0xb6e(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
call   1030 <f@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xb42(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    119a <main+0x6a>
jmp    1512 <main+0x3e2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1182 <main+0x52>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xad3(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xad3(%rip),%xmm0
call   1050 <pow@plt>
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xaaf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
cvtsi2sdl -0x1c(%rbp),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x30(%rbp),%xmm0
lea    0xa95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1169 <main+0x39>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    $0x4,%ebx
xor    %r15d,%r15d
movsd  0xeba(%rip),%xmm0
xorpd  %xmm5,%xmm5
lea    0xedf(%rip),%r14
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
lea    -0x1(%rbx),%r12d
movsd  %xmm2,0x30(%rsp)
addsd  0xe87(%rip),%xmm2
mov    $0x1,%r13d
xorps  %xmm3,%xmm3
movsd  %xmm3,(%rsp)
movapd %xmm0,%xmm3
movsd  %xmm2,0x20(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r13),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,0x48(%rsp)
movapd %xmm3,%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x1,%r13d
cvtsi2sd %r13d,%xmm4
movsd  0xe2c(%rip),%xmm0
addsd  %xmm0,%xmm3
movsd  %xmm3,0x38(%rsp)
divsd  %xmm2,%xmm4
addsd  %xmm5,%xmm4
movsd  %xmm4,0x40(%rsp)
mov    $0x2,%ebp
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm5,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x48(%rsp),%xmm0
call   1030 <f@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <f@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x40(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <f@plt>
movapd %xmm0,%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0xd9c(%rip),%xmm0
mulsd  %xmm0,%xmm1
subsd  0x50(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  (%rsp),%xmm1
movsd  %xmm1,(%rsp)
lea    -0x2(%rbp),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0x20(%rsp),%xmm1
addsd  0xd8c(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <f@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <f@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  0xd2e(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  0x20(%rsp),%xmm1
addsd  0xd3b(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <f@plt>
movsd  0x20(%rsp),%xmm2
xorpd  %xmm5,%xmm5
addsd  0x18(%rsp),%xmm0
mulsd  0xcf8(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  (%rsp),%xmm0
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1210 <main+0xe0>
movsd  %xmm0,(%rsp)
cmp    %r12d,%r13d
movsd  0x38(%rsp),%xmm3
jne    11a0 <main+0x70>
cvttsd2si %xmm2,%edi
movsd  0xcc6(%rip),%xmm0
call   1050 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  0xcb0(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xcac(%rip),%xmm0
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
movapd %xmm1,%xmm0
call   1040 <printf@plt>
xorpd  %xmm5,%xmm5
add    $0x1,%r15d
add    %ebx,%ebx
cmp    $0xa,%r15d
movsd  0xc59(%rip),%xmm0
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Res %d, tse = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 1.000000e+00, double* %3
store i32 2, i32* %4
store i32 4, i32* %6
store i32 0, i32* %5
br label %14
14: ; preds = %233, %0
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %238
17: ; preds = %14
store double 0.000000e+00, double* %7
store i32 1, i32* %8
br label %18
18: ; preds = %210, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = sub nsw i32 %20, 1
%22 = icmp slt i32 %19, %21
br i1 %22, label %23, label %213
23: ; preds = %18
store i32 1, i32* %9
br label %24
24: ; preds = %206, %23
%25 = load i32, i32* %9
%26 = load i32, i32* %6
%27 = sub nsw i32 %26, 1
%28 = icmp slt i32 %25, %27
br i1 %28, label %29, label %209
29: ; preds = %24
%30 = load double, double* %2
%31 = load double, double* %3
%32 = load double, double* %2
%33 = fsub double %31, %32
%34 = load i32, i32* %8
%35 = sub nsw i32 %34, 1
%36 = sitofp i32 %35 to double
%37 = fmul double %33, %36
%38 = load i32, i32* %6
%39 = sitofp i32 %38 to double
%40 = fsub double %39, 1.000000e+00
%41 = fdiv double %37, %40
%42 = fadd double %30, %41
%43 = load double, double* %2
%44 = load double, double* %3
%45 = load double, double* %2
%46 = fsub double %44, %45
%47 = load i32, i32* %9
%48 = sitofp i32 %47 to double
%49 = fmul double %46, %48
%50 = load i32, i32* %6
%51 = sitofp i32 %50 to double
%52 = fsub double %51, 1.000000e+00
%53 = fdiv double %49, %52
%54 = fadd double %43, %53
%55 = call double @f(double %42, double %54)
store double %55, double* %11
%56 = load double, double* %2
%57 = load double, double* %3
%58 = load double, double* %2
%59 = fsub double %57, %58
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 0
%62 = sitofp i32 %61 to double
%63 = fmul double %59, %62
%64 = load i32, i32* %6
%65 = sitofp i32 %64 to double
%66 = fsub double %65, 1.000000e+00
%67 = fdiv double %63, %66
%68 = fadd double %56, %67
%69 = load double, double* %2
%70 = load double, double* %3
%71 = load double, double* %2
%72 = fsub double %70, %71
%73 = load i32, i32* %9
%74 = sitofp i32 %73 to double
%75 = fmul double %72, %74
%76 = load i32, i32* %6
%77 = sitofp i32 %76 to double
%78 = fsub double %77, 1.000000e+00
%79 = fdiv double %75, %78
%80 = fadd double %69, %79
%81 = call double @f(double %68, double %80)
store double %81, double* %12
%82 = load double, double* %2
%83 = load double, double* %3
%84 = load double, double* %2
%85 = fsub double %83, %84
%86 = load i32, i32* %8
%87 = add nsw i32 %86, 1
%88 = sitofp i32 %87 to double
%89 = fmul double %85, %88
%90 = load i32, i32* %6
%91 = sitofp i32 %90 to double
%92 = fsub double %91, 1.000000e+00
%93 = fdiv double %89, %92
%94 = fadd double %82, %93
%95 = load double, double* %2
%96 = load double, double* %3
%97 = load double, double* %2
%98 = fsub double %96, %97
%99 = load i32, i32* %9
%100 = sitofp i32 %99 to double
%101 = fmul double %98, %100
%102 = load i32, i32* %6
%103 = sitofp i32 %102 to double
%104 = fsub double %103, 1.000000e+00
%105 = fdiv double %101, %104
%106 = fadd double %95, %105
%107 = call double @f(double %94, double %106)
store double %107, double* %13
%108 = load double, double* %13
%109 = load double, double* %11
%110 = fadd double %108, %109
%111 = load double, double* %12
%112 = fneg double %111
%113 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %110, double %112)
store double %113, double* %10
%114 = load double, double* %10
%115 = load double, double* %10
%116 = load double, double* %7
%117 = call double @llvm.fmuladd.f64(double %114, double %115, double %116)
store double %117, double* %7
%118 = load double, double* %2
%119 = load double, double* %3
%120 = load double, double* %2
%121 = fsub double %119, %120
%122 = load i32, i32* %8
%123 = sitofp i32 %122 to double
%124 = fmul double %121, %123
%125 = load i32, i32* %6
%126 = sitofp i32 %125 to double
%127 = fsub double %126, 1.000000e+00
%128 = fdiv double %124, %127
%129 = fadd double %118, %128
%130 = load double, double* %2
%131 = load double, double* %3
%132 = load double, double* %2
%133 = fsub double %131, %132
%134 = load i32, i32* %9
%135 = sub nsw i32 %134, 1
%136 = sitofp i32 %135 to double
%137 = fmul double %133, %136
%138 = load i32, i32* %6
%139 = sitofp i32 %138 to double
%140 = fsub double %139, 1.000000e+00
%141 = fdiv double %137, %140
%142 = fadd double %130, %141
%143 = call double @f(double %129, double %142)
store double %143, double* %11
%144 = load double, double* %2
%145 = load double, double* %3
%146 = load double, double* %2
%147 = fsub double %145, %146
%148 = load i32, i32* %8
%149 = sitofp i32 %148 to double
%150 = fmul double %147, %149
%151 = load i32, i32* %6
%152 = sitofp i32 %151 to double
%153 = fsub double %152, 1.000000e+00
%154 = fdiv double %150, %153
%155 = fadd double %144, %154
%156 = load double, double* %2
%157 = load double, double* %3
%158 = load double, double* %2
%159 = fsub double %157, %158
%160 = load i32, i32* %9
%161 = add nsw i32 %160, 0
%162 = sitofp i32 %161 to double
%163 = fmul double %159, %162
%164 = load i32, i32* %6
%165 = sitofp i32 %164 to double
%166 = fsub double %165, 1.000000e+00
%167 = fdiv double %163, %166
%168 = fadd double %156, %167
%169 = call double @f(double %155, double %168)
store double %169, double* %12
%170 = load double, double* %2
%171 = load double, double* %3
%172 = load double, double* %2
%173 = fsub double %171, %172
%174 = load i32, i32* %8
%175 = sitofp i32 %174 to double
%176 = fmul double %173, %175
%177 = load i32, i32* %6
%178 = sitofp i32 %177 to double
%179 = fsub double %178, 1.000000e+00
%180 = fdiv double %176, %179
%181 = fadd double %170, %180
%182 = load double, double* %2
%183 = load double, double* %3
%184 = load double, double* %2
%185 = fsub double %183, %184
%186 = load i32, i32* %9
%187 = add nsw i32 %186, 1
%188 = sitofp i32 %187 to double
%189 = fmul double %185, %188
%190 = load i32, i32* %6
%191 = sitofp i32 %190 to double
%192 = fsub double %191, 1.000000e+00
%193 = fdiv double %189, %192
%194 = fadd double %182, %193
%195 = call double @f(double %181, double %194)
store double %195, double* %13
%196 = load double, double* %13
%197 = load double, double* %11
%198 = fadd double %196, %197
%199 = load double, double* %12
%200 = fneg double %199
%201 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %198, double %200)
store double %201, double* %10
%202 = load double, double* %10
%203 = load double, double* %10
%204 = load double, double* %7
%205 = call double @llvm.fmuladd.f64(double %202, double %203, double %204)
store double %205, double* %7
br label %206
206: ; preds = %29
%207 = load i32, i32* %9
%208 = add nsw i32 %207, 1
store i32 %208, i32* %9
br label %24
209: ; preds = %24
br label %210
210: ; preds = %209
%211 = load i32, i32* %8
%212 = add nsw i32 %211, 1
store i32 %212, i32* %8
br label %18
213: ; preds = %18
%214 = load i32, i32* %6
%215 = sitofp i32 %214 to double
%216 = fsub double %215, 1.000000e+00
%217 = fptosi double %216 to i32
%218 = call double @pow(i32 %217, double 4.000000e+00)
%219 = load double, double* %7
%220 = fmul double %219, %218
store double %220, double* %7
%221 = load i32, i32* %6
%222 = sitofp i32 %221 to double
%223 = fsub double %222, 2.000000e+00
%224 = fptosi double %223 to i32
%225 = load i32, i32* %4
%226 = sitofp i32 %225 to double
%227 = call double @pow(i32 %224, double %226)
%228 = load double, double* %7
%229 = fdiv double %228, %227
store double %229, double* %7
%230 = load i32, i32* %6
%231 = load double, double* %7
%232 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %230, double %231)
br label %233
233: ; preds = %213
%234 = load i32, i32* %5
%235 = add nsw i32 %234, 1
store i32 %235, i32* %5
%236 = load i32, i32* %6
%237 = mul nsw i32 %236, 2
store i32 %237, i32* %6
br label %14
238: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Res %d, tse = %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %52, %0
%2 = phi i32 [ 0, %0 ], [ %61, %52 ]
%3 = phi i32 [ 4, %0 ], [ %62, %52 ]
%4 = add nsw i32 %3, -1
%5 = sitofp i32 %3 to double
%6 = fadd double %5, -1.000000e+00
br label %7
7: ; preds = %50, %1
%8 = phi double [ 0.000000e+00, %1 ], [ %48, %50 ]
%9 = phi i32 [ 1, %1 ], [ %17, %50 ]
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, %6
%13 = fadd double %12, 0.000000e+00
%14 = sitofp i32 %9 to double
%15 = fdiv double %14, %6
%16 = fadd double %15, 0.000000e+00
%17 = add nuw nsw i32 %9, 1
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, %6
%20 = fadd double %19, 0.000000e+00
br label %21
21: ; preds = %7, %21
%22 = phi double [ %8, %7 ], [ %48, %21 ]
%23 = phi i32 [ 1, %7 ], [ %40, %21 ]
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, %6
%26 = fadd double %25, 0.000000e+00
%27 = tail call double @f(double %13, double %26)
%28 = tail call double @f(double %16, double %26)
%29 = tail call double @f(double %20, double %26)
%30 = fadd double %27, %29
%31 = fneg double %28
%32 = tail call double @llvm.fmuladd.f64(double %30, double 5.000000e-01, double %31)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %32, double %22)
%34 = add nsw i32 %23, -1
%35 = sitofp i32 %34 to double
%36 = fdiv double %35, %6
%37 = fadd double %36, 0.000000e+00
%38 = tail call double @f(double %16, double %37)
%39 = tail call double @f(double %16, double %26)
%40 = add nuw nsw i32 %23, 1
%41 = sitofp i32 %40 to double
%42 = fdiv double %41, %6
%43 = fadd double %42, 0.000000e+00
%44 = tail call double @f(double %16, double %43)
%45 = fadd double %38, %44
%46 = fneg double %39
%47 = tail call double @llvm.fmuladd.f64(double %45, double 5.000000e-01, double %46)
%48 = tail call double @llvm.fmuladd.f64(double %47, double %47, double %33)
%49 = icmp eq i32 %40, %4
br i1 %49, label %50, label %21
50: ; preds = %21
%51 = icmp eq i32 %17, %4
br i1 %51, label %52, label %7
52: ; preds = %50
%53 = fptosi double %6 to i32
%54 = tail call double @pow(i32 %53, double 4.000000e+00)
%55 = fmul double %48, %54
%56 = fadd double %5, -2.000000e+00
%57 = fptosi double %56 to i32
%58 = tail call double @pow(i32 %57, double 2.000000e+00)
%59 = fdiv double %55, %58
%60 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3, double %59)
%61 = add nuw nsw i32 %2, 1
%62 = shl nsw i32 %3, 1
%63 = icmp eq i32 %61, 10
br i1 %63, label %64, label %1
64: ; preds = %52
ret i32 0
}