void init_array(int n, double *alpha, double *beta,
                double A[2000 + 0][2000 + 0], double u1[2000 + 0],
                double v1[2000 + 0], double u2[2000 + 0], double v2[2000 + 0],
                double w[2000 + 0], double x[2000 + 0], double y[2000 + 0],
                double z[2000 + 0]) {
  int i, j;
  *alpha = 1.5;
  *beta = 1.2;
  double fn = (double)n;
  for (i = 0; i < n; i++) {
    u1[i] = i;
    u2[i] = ((i + 1) / fn) / 2.0;
    v1[i] = ((i + 1) / fn) / 4.0;
    v2[i] = ((i + 1) / fn) / 6.0;
    y[i] = ((i + 1) / fn) / 8.0;
    z[i] = ((i + 1) / fn) / 9.0;
    x[i] = 0.0;
    w[i] = 0.0;
    for (j = 0; j < n; j++)
      A[i][j] = (double)(i * j % n) / n;
  }
}


x86 assembly (clang, -O0):
<init_array>:
push   %rbp
mov    %rsp,%rbp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,(%rax)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d1 <init_array+0x1d1>
cvtsi2sdl -0x34(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe37(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xe07(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xdd7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x38(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12be <init_array+0x1be>
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cvtsi2sd %edx,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   $0x3e80,%rcx,%rcx
add    %rcx,%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1271 <init_array+0x171>
jmp    12c3 <init_array+0x1c3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1164 <init_array+0x64>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movabs $0x3ff8000000000000,%rax
mov    %rax,(%rsi)
movabs $0x3ff3333333333333,%rax
33 f3 3f
mov    %rax,(%rdx)
test   %edi,%edi
jle    1231 <init_array+0x131>
mov    0x58(%rsp),%r11
mov    0x50(%rsp),%r14
mov    0x48(%rsp),%r15
mov    0x40(%rsp),%r12
cvtsi2sd %edi,%xmm0
mov    0x38(%rsp),%r13
mov    %edi,%edi
xor    %ebx,%ebx
movsd  0xeab(%rip),%xmm1
movsd  0xeab(%rip),%xmm2
movsd  0xeab(%rip),%xmm3
movsd  0xeab(%rip),%xmm4
movsd  0xeab(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rbp
xorps  %xmm6,%xmm6
cvtsi2sd %ebp,%xmm6
add    $0x1,%rbx
xorps  %xmm7,%xmm7
cvtsi2sd %ebx,%xmm7
movsd  %xmm6,(%r8,%rbp,8)
divsd  %xmm0,%xmm7
movapd %xmm7,%xmm6
mulsd  %xmm1,%xmm6
movsd  %xmm6,0x0(%r13,%rbp,8)
movapd %xmm7,%xmm6
mulsd  %xmm2,%xmm6
movsd  %xmm6,(%r9,%rbp,8)
movapd %xmm7,%xmm6
divsd  %xmm3,%xmm6
movsd  %xmm6,(%r12,%rbp,8)
movapd %xmm7,%xmm6
mulsd  %xmm4,%xmm6
movsd  %xmm6,(%r11,%rbp,8)
divsd  %xmm5,%xmm7
mov    0x60(%rsp),%rax
movsd  %xmm7,(%rax,%rbp,8)
movq   $0x0,(%r14,%rbp,8)
movq   $0x0,(%r15,%rbp,8)
xor    %esi,%esi
xor    %r10d,%r10d
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
cltd
idiv   %edi
xorps  %xmm6,%xmm6
cvtsi2sd %edx,%xmm6
divsd  %xmm0,%xmm6
movsd  %xmm6,(%rcx,%r10,8)
add    $0x1,%r10
add    %ebp,%esi
cmp    %r10,%rdi
jne    1200 <init_array+0x100>
add    $0x3e80,%rcx
cmp    %rdi,%rbx
jne    1180 <init_array+0x80>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init_array(i32 %0, double* %1, double* %2, [2000 x double]* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11) {
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca [2000 x double]*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca i32
%26 = alloca i32
%27 = alloca double
store i32 %0, i32* %13
store double* %1, double** %14
store double* %2, double** %15
store [2000 x double]* %3, [2000 x double]** %16
store double* %4, double** %17
store double* %5, double** %18
store double* %6, double** %19
store double* %7, double** %20
store double* %8, double** %21
store double* %9, double** %22
store double* %10, double** %23
store double* %11, double** %24
%28 = load double*, double** %14
store double 1.500000e+00, double* %28
%29 = load double*, double** %15
store double 1.200000e+00, double* %29
%30 = load i32, i32* %13
%31 = sitofp i32 %30 to double
store double %31, double* %27
store i32 0, i32* %25
br label %32
32: ; preds = %126, %12
%33 = load i32, i32* %25
%34 = load i32, i32* %13
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %129
36: ; preds = %32
%37 = load i32, i32* %25
%38 = sitofp i32 %37 to double
%39 = load double*, double** %17
%40 = load i32, i32* %25
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
store double %38, double* %42
%43 = load i32, i32* %25
%44 = add nsw i32 %43, 1
%45 = sitofp i32 %44 to double
%46 = load double, double* %27
%47 = fdiv double %45, %46
%48 = fdiv double %47, 2.000000e+00
%49 = load double*, double** %19
%50 = load i32, i32* %25
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double %48, double* %52
%53 = load i32, i32* %25
%54 = add nsw i32 %53, 1
%55 = sitofp i32 %54 to double
%56 = load double, double* %27
%57 = fdiv double %55, %56
%58 = fdiv double %57, 4.000000e+00
%59 = load double*, double** %18
%60 = load i32, i32* %25
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
store double %58, double* %62
%63 = load i32, i32* %25
%64 = add nsw i32 %63, 1
%65 = sitofp i32 %64 to double
%66 = load double, double* %27
%67 = fdiv double %65, %66
%68 = fdiv double %67, 6.000000e+00
%69 = load double*, double** %20
%70 = load i32, i32* %25
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double %68, double* %72
%73 = load i32, i32* %25
%74 = add nsw i32 %73, 1
%75 = sitofp i32 %74 to double
%76 = load double, double* %27
%77 = fdiv double %75, %76
%78 = fdiv double %77, 8.000000e+00
%79 = load double*, double** %23
%80 = load i32, i32* %25
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
store double %78, double* %82
%83 = load i32, i32* %25
%84 = add nsw i32 %83, 1
%85 = sitofp i32 %84 to double
%86 = load double, double* %27
%87 = fdiv double %85, %86
%88 = fdiv double %87, 9.000000e+00
%89 = load double*, double** %24
%90 = load i32, i32* %25
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
store double %88, double* %92
%93 = load double*, double** %22
%94 = load i32, i32* %25
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
store double 0.000000e+00, double* %96
%97 = load double*, double** %21
%98 = load i32, i32* %25
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
store double 0.000000e+00, double* %100
store i32 0, i32* %26
br label %101
101: ; preds = %122, %36
%102 = load i32, i32* %26
%103 = load i32, i32* %13
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %125
105: ; preds = %101
%106 = load i32, i32* %25
%107 = load i32, i32* %26
%108 = mul nsw i32 %106, %107
%109 = load i32, i32* %13
%110 = srem i32 %108, %109
%111 = sitofp i32 %110 to double
%112 = load i32, i32* %13
%113 = sitofp i32 %112 to double
%114 = fdiv double %111, %113
%115 = load [2000 x double]*, [2000 x double]** %16
%116 = load i32, i32* %25
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [2000 x double], [2000 x double]* %115, i64 %117
%119 = load i32, i32* %26
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [2000 x double], [2000 x double]* %118, i64 0, i64 %120
store double %114, double* %121
br label %122
122: ; preds = %105
%123 = load i32, i32* %26
%124 = add nsw i32 %123, 1
store i32 %124, i32* %26
br label %101
125: ; preds = %101
br label %126
126: ; preds = %125
%127 = load i32, i32* %25
%128 = add nsw i32 %127, 1
store i32 %128, i32* %25
br label %32
129: ; preds = %32
ret void
}

LLVM IR (-O2):
define void @init_array(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2, [2000 x double]* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8, double* nocapture writeonly %9, double* nocapture writeonly %10, double* nocapture writeonly %11) {
store double 1.500000e+00, double* %1
store double 1.200000e+00, double* %2
%13 = sitofp i32 %0 to double
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %50
15: ; preds = %12
%16 = zext i32 %0 to i64
br label %19
17: ; preds = %40
%18 = icmp eq i64 %24, %16
br i1 %18, label %50, label %19
19: ; preds = %17, %15
%20 = phi i64 [ 0, %15 ], [ %24, %17 ]
%21 = trunc i64 %20 to i32
%22 = sitofp i32 %21 to double
%23 = getelementptr inbounds double, double* %4, i64 %20
store double %22, double* %23
%24 = add nuw nsw i64 %20, 1
%25 = trunc i64 %24 to i32
%26 = sitofp i32 %25 to double
%27 = fdiv double %26, %13
%28 = fmul double %27, 5.000000e-01
%29 = getelementptr inbounds double, double* %6, i64 %20
store double %28, double* %29
%30 = fmul double %27, 2.500000e-01
%31 = getelementptr inbounds double, double* %5, i64 %20
store double %30, double* %31
%32 = fdiv double %27, 6.000000e+00
%33 = getelementptr inbounds double, double* %7, i64 %20
store double %32, double* %33
%34 = fmul double %27, 1.250000e-01
%35 = getelementptr inbounds double, double* %10, i64 %20
store double %34, double* %35
%36 = fdiv double %27, 9.000000e+00
%37 = getelementptr inbounds double, double* %11, i64 %20
store double %36, double* %37
%38 = getelementptr inbounds double, double* %9, i64 %20
store double 0.000000e+00, double* %38
%39 = getelementptr inbounds double, double* %8, i64 %20
store double 0.000000e+00, double* %39
br label %40
40: ; preds = %19, %40
%41 = phi i64 [ 0, %19 ], [ %48, %40 ]
%42 = trunc i64 %41 to i32
%43 = mul nsw i32 %42, %21
%44 = srem i32 %43, %0
%45 = sitofp i32 %44 to double
%46 = fdiv double %45, %13
%47 = getelementptr inbounds [2000 x double], [2000 x double]* %3, i64 %20, i64 %41
store double %46, double* %47
%48 = add nuw nsw i64 %41, 1
%49 = icmp eq i64 %48, %16
br i1 %49, label %17, label %40
50: ; preds = %17, %12
ret void
}