void DefineFunc(double Fx[2][1000], double min, double max) {
  double interval = (max - min) / 1000;
  for (int i = 0; i < 1000; i++) {
    double x = min + i * interval;
    Fx[0][i] = x;
    Fx[1][i] = x * x - 3.5 * x + 3;
  }
  return;
}


x86 assembly (clang, -O0):
<DefineFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3e8,-0x24(%rbp)
jge    11d0 <DefineFunc+0xd0>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0xe8f(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe5b(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,0x1f40(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1134 <DefineFunc+0x34>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefineFunc>:
subsd  %xmm0,%xmm1
divsd  0xef4(%rip),%xmm1
unpcklpd %xmm1,%xmm1
unpcklpd %xmm0,%xmm0
movdqa 0xef4(%rip),%xmm2
mov    $0xfffffffffffffc18,%rax
movapd 0xef5(%rip),%xmm3
movapd 0xefd(%rip),%xmm4
movdqa 0xf04(%rip),%xmm8
movdqa 0xf0c(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvtdq2pd %xmm2,%xmm7
mulpd  %xmm1,%xmm7
addpd  %xmm0,%xmm7
movupd %xmm7,0x1f40(%rdi,%rax,8)
movapd %xmm7,%xmm5
mulpd  %xmm3,%xmm5
mulpd  %xmm7,%xmm7
addpd  %xmm5,%xmm7
addpd  %xmm4,%xmm7
movupd %xmm7,0x3e80(%rdi,%rax,8)
movdqa %xmm2,%xmm5
paddd  %xmm8,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm0,%xmm5
movupd %xmm5,0x1f50(%rdi,%rax,8)
movapd %xmm5,%xmm7
mulpd  %xmm3,%xmm7
mulpd  %xmm5,%xmm5
addpd  %xmm7,%xmm5
addpd  %xmm4,%xmm5
movupd %xmm5,0x3e90(%rdi,%rax,8)
paddd  %xmm6,%xmm2
add    $0x4,%rax
jne    1150 <DefineFunc+0x50>
ret

LLVM IR (-O0):
define void @DefineFunc([1000 x double]* %0, double %1, double %2) {
%4 = alloca [1000 x double]*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
store [1000 x double]* %0, [1000 x double]** %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = fdiv double %12, 1.000000e+03
store double %13, double* %7
store i32 0, i32* %8
br label %14
14: ; preds = %41, %3
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 1000
br i1 %16, label %17, label %44
17: ; preds = %14
%18 = load double, double* %5
%19 = load i32, i32* %8
%20 = sitofp i32 %19 to double
%21 = load double, double* %7
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double %18)
store double %22, double* %9
%23 = load double, double* %9
%24 = load [1000 x double]*, [1000 x double]** %4
%25 = getelementptr inbounds [1000 x double], [1000 x double]* %24, i64 0
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [1000 x double], [1000 x double]* %25, i64 0, i64 %27
store double %23, double* %28
%29 = load double, double* %9
%30 = load double, double* %9
%31 = load double, double* %9
%32 = fmul double 3.500000e+00, %31
%33 = fneg double %32
%34 = call double @llvm.fmuladd.f64(double %29, double %30, double %33)
%35 = fadd double %34, 3.000000e+00
%36 = load [1000 x double]*, [1000 x double]** %4
%37 = getelementptr inbounds [1000 x double], [1000 x double]* %36, i64 1
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [1000 x double], [1000 x double]* %37, i64 0, i64 %39
store double %35, double* %40
br label %41
41: ; preds = %17
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %14
44: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @DefineFunc([1000 x double]* nocapture writeonly %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = fdiv double %4, 1.000000e+03
%6 = insertelement <2 x double> poison, double %5, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = insertelement <2 x double> poison, double %1, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
br label %10
10: ; preds = %10, %3
%11 = phi i64 [ 0, %3 ], [ %33, %10 ]
%12 = phi <2 x i32> [ <i32 0, i32 1>, %3 ], [ %34, %10 ]
%13 = sitofp <2 x i32> %12 to <2 x double>
%14 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %7, <2 x double> %9)
%15 = getelementptr inbounds [1000 x double], [1000 x double]* %0, i64 0, i64 %11
%16 = bitcast double* %15 to <2 x double>*
store <2 x double> %14, <2 x double>* %16
%17 = fmul <2 x double> %14, <double -3.500000e+00, double -3.500000e+00>
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %14, <2 x double> %17)
%19 = fadd <2 x double> %18, <double 3.000000e+00, double 3.000000e+00>
%20 = getelementptr inbounds [1000 x double], [1000 x double]* %0, i64 1, i64 %11
%21 = bitcast double* %20 to <2 x double>*
store <2 x double> %19, <2 x double>* %21
%22 = or i64 %11, 2
%23 = add <2 x i32> %12, <i32 2, i32 2>
%24 = sitofp <2 x i32> %23 to <2 x double>
%25 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %7, <2 x double> %9)
%26 = getelementptr inbounds [1000 x double], [1000 x double]* %0, i64 0, i64 %22
%27 = bitcast double* %26 to <2 x double>*
store <2 x double> %25, <2 x double>* %27
%28 = fmul <2 x double> %25, <double -3.500000e+00, double -3.500000e+00>
%29 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %25, <2 x double> %28)
%30 = fadd <2 x double> %29, <double 3.000000e+00, double 3.000000e+00>
%31 = getelementptr inbounds [1000 x double], [1000 x double]* %0, i64 1, i64 %22
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %30, <2 x double>* %32
%33 = add nuw nsw i64 %11, 4
%34 = add <2 x i32> %12, <i32 4, i32 4>
%35 = icmp eq i64 %33, 1000
br i1 %35, label %36, label %10
36: ; preds = %10
ret void
}