void init_array(int m, int n, double *float_n,
                double data[1400 + 0][1200 + 0]) {
  int i, j;
  *float_n = (double)1400;
  for (i = 0; i < 1400; i++)
    for (j = 0; j < 1200; j++)
      data[i][j] = (double)(i * j) / 1200 + i;
}


x86 assembly (clang, -O0):
<init_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x578,-0x1c(%rbp)
jge    11a6 <init_array+0xa6>
movl   $0x0,-0x20(%rbp)
cmpl   $0x4b0,-0x20(%rbp)
jge    1193 <init_array+0x93>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x2580,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113d <init_array+0x3d>
jmp    1198 <init_array+0x98>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <init_array+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_array>:
movabs $0x4095e00000000000,%rax
e0 95 40
mov    %rax,(%rdx)
xor    %eax,%eax
movdqa 0xee9(%rip),%xmm0
movapd 0xef1(%rip),%xmm1
movdqa 0xef9(%rip),%xmm2
movdqa 0xf01(%rip),%xmm3
nop
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movq   %rax,%xmm5
pshufd $0x44,%xmm5,%xmm5
unpcklpd %xmm4,%xmm4
mov    $0x2,%edx
movdqa %xmm0,%xmm6
xchg   %ax,%ax
movdqa %xmm6,%xmm7
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm7
cvtdq2pd %xmm7,%xmm7
divpd  %xmm1,%xmm7
addpd  %xmm4,%xmm7
movupd %xmm7,-0x10(%rcx,%rdx,8)
movdqa %xmm6,%xmm7
paddq  %xmm2,%xmm7
pmuludq %xmm5,%xmm7
pshufd $0xe8,%xmm7,%xmm7
cvtdq2pd %xmm7,%xmm7
divpd  %xmm1,%xmm7
addpd  %xmm4,%xmm7
movupd %xmm7,(%rcx,%rdx,8)
paddq  %xmm3,%xmm6
add    $0x4,%rdx
cmp    $0x4b2,%rdx
jne    1150 <init_array+0x50>
add    $0x1,%rax
add    $0x2580,%rcx
cmp    $0x578,%rax
jne    1130 <init_array+0x30>
ret

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

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