#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, float);
float get_f_prime(float x, float **f, size_t size) {
  float result = 0.0;
  unsigned int i;
  for (i = 0; i < size; i++) {
    result += f[i][0] * pow(x, f[i][1]);
  }
  return result;
}


x86 assembly (clang, -O0):
<get_f_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1197 <get_f_prime+0x87>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movss  0x4(%rax),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movss  -0x24(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1134 <get_f_prime+0x24>
movss  -0x1c(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_f_prime>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %rsi,%rsi
je     118d <get_f_prime+0x7d>
mov    %rsi,%r15
mov    %rdi,%r14
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
xor    %ebx,%ebx
movss  %xmm2,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  %xmm0,0x4(%rsp)
mov    (%r14,%rbx,8),%rax
movss  (%rax),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rax),%xmm1
movaps %xmm2,%xmm0
call   1030 <pow@plt>
movss  0x8(%rsp),%xmm2
mulss  0xc(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0x1,%ebx
cmp    %r15,%rbx
jb     1140 <get_f_prime+0x30>
jmp    1190 <get_f_prime+0x80>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @get_f_prime(float %0, float** %1, i64 %2) {
%4 = alloca float
%5 = alloca float**
%6 = alloca i64
%7 = alloca float
%8 = alloca i32
store float %0, float* %4
store float** %1, float*** %5
store i64 %2, i64* %6
store float 0.000000e+00, float* %7
store i32 0, i32* %8
br label %9
9: ; preds = %33, %3
%10 = load i32, i32* %8
%11 = zext i32 %10 to i64
%12 = load i64, i64* %6
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %9
%15 = load float**, float*** %5
%16 = load i32, i32* %8
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds float*, float** %15, i64 %17
%19 = load float*, float** %18
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
%22 = load float, float* %4
%23 = load float**, float*** %5
%24 = load i32, i32* %8
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds float*, float** %23, i64 %25
%27 = load float*, float** %26
%28 = getelementptr inbounds float, float* %27, i64 1
%29 = load float, float* %28
%30 = call float @pow(float %22, float %29)
%31 = load float, float* %7
%32 = call float @llvm.fmuladd.f32(float %21, float %30, float %31)
store float %32, float* %7
br label %33
33: ; preds = %14
%34 = load i32, i32* %8
%35 = add i32 %34, 1
store i32 %35, i32* %8
br label %9
36: ; preds = %9
%37 = load float, float* %7
ret float %37
}

LLVM IR (-O2):
define float @get_f_prime(float %0, float** nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %18, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %16, %5 ], [ 0, %3 ]
%7 = phi float [ %14, %5 ], [ 0.000000e+00, %3 ]
%8 = getelementptr inbounds float*, float** %1, i64 %6
%9 = load float*, float** %8
%10 = load float, float* %9
%11 = getelementptr inbounds float, float* %9, i64 1
%12 = load float, float* %11
%13 = tail call float @pow(float %0, float %12)
%14 = tail call float @llvm.fmuladd.f32(float %10, float %13, float %7)
%15 = add nuw nsw i64 %6, 1
%16 = and i64 %15, 4294967295
%17 = icmp ult i64 %16, %2
br i1 %17, label %5, label %18
18: ; preds = %5, %3
%19 = phi float [ 0.000000e+00, %3 ], [ %14, %5 ]
ret float %19
}