void init_data(double B[1024 * 1024 * 10][1], int n) {
  int i;
  for (i = 0; i < n; i++)
    B[i][0] = 2.0;
}


x86 assembly (clang, -O0):
<init_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1141 <init_data+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <init_data+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_data>:
test   %esi,%esi
jle    121d <init_data+0x11d>
mov    %esi,%eax
cmp    $0x4,%esi
jae    1116 <init_data+0x16>
xor    %ecx,%ecx
jmp    11f7 <init_data+0xf7>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x7,%r8d
cmp    $0x1c,%rdx
jae    113e <init_data+0x3e>
xor    %edx,%edx
jmp    11c1 <init_data+0xc1>
and    $0xfffffffffffffff8,%rsi
xor    %edx,%edx
movaps 0xeb5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rdi,%rdx,8)
movups %xmm0,0x10(%rdi,%rdx,8)
movups %xmm0,0x20(%rdi,%rdx,8)
movups %xmm0,0x30(%rdi,%rdx,8)
movups %xmm0,0x40(%rdi,%rdx,8)
movups %xmm0,0x50(%rdi,%rdx,8)
movups %xmm0,0x60(%rdi,%rdx,8)
movups %xmm0,0x70(%rdi,%rdx,8)
movups %xmm0,0x80(%rdi,%rdx,8)
movups %xmm0,0x90(%rdi,%rdx,8)
movups %xmm0,0xa0(%rdi,%rdx,8)
movups %xmm0,0xb0(%rdi,%rdx,8)
movups %xmm0,0xc0(%rdi,%rdx,8)
movups %xmm0,0xd0(%rdi,%rdx,8)
movups %xmm0,0xe0(%rdi,%rdx,8)
movups %xmm0,0xf0(%rdi,%rdx,8)
add    $0x20,%rdx
add    $0xfffffffffffffff8,%rsi
jne    1150 <init_data+0x50>
test   %r8,%r8
je     11f2 <init_data+0xf2>
lea    (%rdi,%rdx,8),%rdx
add    $0x10,%rdx
shl    $0x5,%r8
xor    %esi,%esi
movaps 0xe25(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rdx,%rsi,1)
movups %xmm0,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%r8
jne    11e0 <init_data+0xe0>
cmp    %rax,%rcx
je     121d <init_data+0x11d>
movabs $0x4000000000000000,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,(%rdi,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1210 <init_data+0x110>
ret

LLVM IR (-O0):
define void @init_data([1 x double]* %0, i32 %1) {
%3 = alloca [1 x double]*
%4 = alloca i32
%5 = alloca i32
store [1 x double]* %0, [1 x double]** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load [1 x double]*, [1 x double]** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [1 x double], [1 x double]* %11, i64 %13
%15 = getelementptr inbounds [1 x double], [1 x double]* %14, i64 0, i64 0
store double 2.000000e+00, double* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init_data([1 x double]* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %83
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = icmp ult i32 %1, 4
br i1 %6, label %76, label %7
7: ; preds = %4
%8 = and i64 %5, 4294967292
%9 = add nsw i64 %8, -4
%10 = lshr exact i64 %9, 2
%11 = add nuw nsw i64 %10, 1
%12 = and i64 %11, 7
%13 = icmp ult i64 %9, 28
br i1 %13, label %61, label %14
14: ; preds = %7
%15 = and i64 %11, 9223372036854775800
br label %16
16: ; preds = %16, %14
%17 = phi i64 [ 0, %14 ], [ %58, %16 ]
%18 = phi i64 [ 0, %14 ], [ %59, %16 ]
%19 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %17, i64 0
%20 = bitcast double* %19 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %20
%21 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %17, i64 2
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %22
%23 = or i64 %17, 4
%24 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %23, i64 0
%25 = bitcast double* %24 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %25
%26 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %23, i64 2
%27 = bitcast double* %26 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %27
%28 = or i64 %17, 8
%29 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %28, i64 0
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %30
%31 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %28, i64 2
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %32
%33 = or i64 %17, 12
%34 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %33, i64 0
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %35
%36 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %33, i64 2
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %37
%38 = or i64 %17, 16
%39 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %38, i64 0
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %40
%41 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %38, i64 2
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %42
%43 = or i64 %17, 20
%44 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %43, i64 0
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %45
%46 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %43, i64 2
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %47
%48 = or i64 %17, 24
%49 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %48, i64 0
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %50
%51 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %48, i64 2
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %52
%53 = or i64 %17, 28
%54 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %53, i64 0
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %55
%56 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %53, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %57
%58 = add nuw i64 %17, 32
%59 = add i64 %18, 8
%60 = icmp eq i64 %59, %15
br i1 %60, label %61, label %16
61: ; preds = %16, %7
%62 = phi i64 [ 0, %7 ], [ %58, %16 ]
%63 = icmp eq i64 %12, 0
br i1 %63, label %74, label %64
64: ; preds = %61, %64
%65 = phi i64 [ %71, %64 ], [ %62, %61 ]
%66 = phi i64 [ %72, %64 ], [ 0, %61 ]
%67 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %65, i64 0
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %68
%69 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %65, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double>* %70
%71 = add nuw i64 %65, 4
%72 = add i64 %66, 1
%73 = icmp eq i64 %72, %12
br i1 %73, label %74, label %64
74: ; preds = %64, %61
%75 = icmp eq i64 %8, %5
br i1 %75, label %83, label %76
76: ; preds = %4, %74
%77 = phi i64 [ 0, %4 ], [ %8, %74 ]
br label %78
78: ; preds = %76, %78
%79 = phi i64 [ %81, %78 ], [ %77, %76 ]
%80 = getelementptr inbounds [1 x double], [1 x double]* %0, i64 %79, i64 0
store double 2.000000e+00, double* %80
%81 = add nuw nsw i64 %79, 1
%82 = icmp eq i64 %81, %5
br i1 %82, label %83, label %78
83: ; preds = %78, %74, %2
ret void
}