#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, float);
float Lpq_weight(int start_frame, int stop_frame, float power_syllable,
                 float power_time, float *frame_disturbance,
                 float *time_weight) {
  double result_time = 0;
  double total_time_weight_time = 0;
  int start_frame_of_syllable;
  for (start_frame_of_syllable = start_frame;
       start_frame_of_syllable <= stop_frame;
       start_frame_of_syllable += 20 / 2) {
    double result_syllable = 0;
    int count_syllable = 0;
    int frame;
    for (frame = start_frame_of_syllable; frame < start_frame_of_syllable + 20;
         frame++) {
      if (frame <= stop_frame) {
        float h = frame_disturbance[frame];
        result_syllable += pow(h, power_syllable);
      }
      count_syllable++;
    }
    result_syllable /= count_syllable;
    result_syllable = pow(result_syllable, (double)1 / power_syllable);
    result_time += pow(time_weight[start_frame_of_syllable - start_frame] *
                           result_syllable,
                       power_time);
    total_time_weight_time +=
        pow(time_weight[start_frame_of_syllable - start_frame], power_time);
  }
  result_time /= total_time_weight_time;
  result_time = pow(result_time, (float)1 / power_time);
  return (float)result_time;
}


x86 assembly (clang, -O0):
<Lpq_weight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     126c <Lpq_weight+0x15c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x14,%ecx
cmp    %ecx,%eax
jge    11ca <Lpq_weight+0xba>
mov    -0x48(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b3 <Lpq_weight+0xa3>
mov    -0x18(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <pow@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1167 <Lpq_weight+0x57>
cvtsi2sdl -0x44(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe15(%rip),%xmm1
divsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x4(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x40(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x4(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <Lpq_weight+0x36>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movss  0xd74(%rip),%xmm1
divss  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lpq_weight>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,0x20(%rsp)
movss  %xmm1,0x4(%rsp)
cmp    %esi,%edi
jle    113a <Lpq_weight+0x2a>
movsd  0xecb(%rip),%xmm0
jmp    1270 <Lpq_weight+0x160>
movss  0xec6(%rip),%xmm1
movss  %xmm0,0x14(%rsp)
divss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
movslq %edi,%rbp
movslq %esi,%r12
lea    -0x1(%rbp),%rbx
lea    (%rdx,%rbp,4),%r13
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,0x18(%rsp)
xorps  %xmm1,%xmm1
jmp    1201 <Lpq_weight+0xf1>
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movss  0x10(%rsp),%xmm1
call   1030 <pow@plt>
mov    %rbp,%r14
sub    0x18(%rsp),%r14
mov    0x20(%rsp),%r15
movss  (%r15,%r14,4),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movss  (%r15,%r14,4),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <pow@plt>
movsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0xa,%rbp
add    $0xa,%rbx
add    $0x28,%r13
cmp    %r12,%rbp
jg     1266 <Lpq_weight+0x156>
movsd  %xmm1,0x28(%rsp)
lea    0x13(%rbp),%r15
xor    %r14d,%r14d
xorps  %xmm1,%xmm1
jmp    1235 <Lpq_weight+0x125>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rbx,%r14,1),%rax
add    $0x1,%rax
add    $0x1,%r14
cmp    %r15,%rax
jge    1180 <Lpq_weight+0x70>
lea    (%r14,%rbp,1),%rax
cmp    %r12,%rax
jg     1220 <Lpq_weight+0x110>
movss  0x0(%r13,%r14,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm1,0x30(%rsp)
movss  0x14(%rsp),%xmm1
call   1030 <pow@plt>
movsd  0x30(%rsp),%xmm1
addsd  %xmm0,%xmm1
jmp    1220 <Lpq_weight+0x110>
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
movss  0xd90(%rip),%xmm1
divss  0x4(%rsp),%xmm1
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @Lpq_weight(i32 %0, i32 %1, float %2, float %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca float*
%12 = alloca float*
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca float
store i32 %0, i32* %7
store i32 %1, i32* %8
store float %2, float* %9
store float %3, float* %10
store float* %4, float** %11
store float* %5, float** %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
%20 = load i32, i32* %7
store i32 %20, i32* %15
br label %21
21: ; preds = %91, %6
%22 = load i32, i32* %15
%23 = load i32, i32* %8
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %94
25: ; preds = %21
store double 0.000000e+00, double* %16
store i32 0, i32* %17
%26 = load i32, i32* %15
store i32 %26, i32* %18
br label %27
27: ; preds = %51, %25
%28 = load i32, i32* %18
%29 = load i32, i32* %15
%30 = add nsw i32 %29, 20
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %54
32: ; preds = %27
%33 = load i32, i32* %18
%34 = load i32, i32* %8
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = load float*, float** %11
%38 = load i32, i32* %18
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds float, float* %37, i64 %39
%41 = load float, float* %40
store float %41, float* %19
%42 = load float, float* %19
%43 = fpext float %42 to double
%44 = load float, float* %9
%45 = call double @pow(double %43, float %44)
%46 = load double, double* %16
%47 = fadd double %46, %45
store double %47, double* %16
br label %48
48: ; preds = %36, %32
%49 = load i32, i32* %17
%50 = add nsw i32 %49, 1
store i32 %50, i32* %17
br label %51
51: ; preds = %48
%52 = load i32, i32* %18
%53 = add nsw i32 %52, 1
store i32 %53, i32* %18
br label %27
54: ; preds = %27
%55 = load i32, i32* %17
%56 = sitofp i32 %55 to double
%57 = load double, double* %16
%58 = fdiv double %57, %56
store double %58, double* %16
%59 = load double, double* %16
%60 = load float, float* %9
%61 = fpext float %60 to double
%62 = fdiv double 1.000000e+00, %61
%63 = fptrunc double %62 to float
%64 = call double @pow(double %59, float %63)
store double %64, double* %16
%65 = load float*, float** %12
%66 = load i32, i32* %15
%67 = load i32, i32* %7
%68 = sub nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %65, i64 %69
%71 = load float, float* %70
%72 = fpext float %71 to double
%73 = load double, double* %16
%74 = fmul double %72, %73
%75 = load float, float* %10
%76 = call double @pow(double %74, float %75)
%77 = load double, double* %13
%78 = fadd double %77, %76
store double %78, double* %13
%79 = load float*, float** %12
%80 = load i32, i32* %15
%81 = load i32, i32* %7
%82 = sub nsw i32 %80, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %79, i64 %83
%85 = load float, float* %84
%86 = fpext float %85 to double
%87 = load float, float* %10
%88 = call double @pow(double %86, float %87)
%89 = load double, double* %14
%90 = fadd double %89, %88
store double %90, double* %14
br label %91
91: ; preds = %54
%92 = load i32, i32* %15
%93 = add nsw i32 %92, 10
store i32 %93, i32* %15
br label %21
94: ; preds = %21
%95 = load double, double* %14
%96 = load double, double* %13
%97 = fdiv double %96, %95
store double %97, double* %13
%98 = load double, double* %13
%99 = load float, float* %10
%100 = fdiv float 1.000000e+00, %99
%101 = call double @pow(double %98, float %100)
store double %101, double* %13
%102 = load double, double* %13
%103 = fptrunc double %102 to float
ret float %103
}

LLVM IR (-O2):
define float @Lpq_weight(i32 %0, i32 %1, float %2, float %3, float* nocapture %4, float* nocapture %5) {
%7 = icmp sgt i32 %0, %1
br i1 %7, label %52, label %8
8: ; preds = %6
%9 = fdiv float 1.000000e+00, %2
%10 = sext i32 %0 to i64
%11 = sext i32 %1 to i64
br label %12
12: ; preds = %8, %33
%13 = phi i64 [ %10, %8 ], [ %48, %33 ]
%14 = phi double [ 0.000000e+00, %8 ], [ %43, %33 ]
%15 = phi double [ 0.000000e+00, %8 ], [ %47, %33 ]
%16 = add nsw i64 %13, 19
br label %17
17: ; preds = %12, %28
%18 = phi i64 [ %13, %12 ], [ %31, %28 ]
%19 = phi i32 [ 0, %12 ], [ %30, %28 ]
%20 = phi double [ 0.000000e+00, %12 ], [ %29, %28 ]
%21 = icmp sgt i64 %18, %11
br i1 %21, label %28, label %22
22: ; preds = %17
%23 = getelementptr inbounds float, float* %4, i64 %18
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = tail call double @pow(double %25, float %2)
%27 = fadd double %20, %26
br label %28
28: ; preds = %22, %17
%29 = phi double [ %27, %22 ], [ %20, %17 ]
%30 = add nuw nsw i32 %19, 1
%31 = add i64 %18, 1
%32 = icmp slt i64 %18, %16
br i1 %32, label %17, label %33
33: ; preds = %28
%34 = sitofp i32 %30 to double
%35 = fdiv double %29, %34
%36 = tail call double @pow(double %35, float %9)
%37 = sub nsw i64 %13, %10
%38 = getelementptr inbounds float, float* %5, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = fmul double %36, %40
%42 = tail call double @pow(double %41, float %3)
%43 = fadd double %14, %42
%44 = load float, float* %38
%45 = fpext float %44 to double
%46 = tail call double @pow(double %45, float %3)
%47 = fadd double %15, %46
%48 = add i64 %13, 10
%49 = icmp sgt i64 %48, %11
br i1 %49, label %50, label %12
50: ; preds = %33
%51 = fdiv double %43, %47
br label %52
52: ; preds = %50, %6
%53 = phi double [ %51, %50 ], [ 0x7FF8000000000000, %6 ]
%54 = fdiv float 1.000000e+00, %3
%55 = tail call double @pow(double %53, float %54)
%56 = fptrunc double %55 to float
ret float %56
}