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


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)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x578,-0x1c(%rbp)
jge    119d <init_array+0x9d>
movl   $0x0,-0x20(%rbp)
cmpl   $0x4b0,-0x20(%rbp)
jge    118a <init_array+0x8a>
cvtsi2sdl -0x1c(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
divsd  %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    113a <init_array+0x3a>
jmp    118f <init_array+0x8f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1126 <init_array+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_array>:
cvtsi2sd %esi,%xmm0
movsd  %xmm0,(%rdx)
xor    %eax,%eax
movdqa 0xeee(%rip),%xmm0
movapd 0xef6(%rip),%xmm1
movdqa 0xefe(%rip),%xmm2
movdqa 0xf06(%rip),%xmm3
nopw   0x0(%rax,%rax,1)
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
unpcklpd %xmm4,%xmm4
mov    $0x2,%edx
movdqa %xmm0,%xmm5
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvtdq2pd %xmm5,%xmm6
mulpd  %xmm4,%xmm6
divpd  %xmm1,%xmm6
movupd %xmm6,-0x10(%rcx,%rdx,8)
movdqa %xmm5,%xmm6
paddd  %xmm2,%xmm6
cvtdq2pd %xmm6,%xmm6
mulpd  %xmm4,%xmm6
divpd  %xmm1,%xmm6
movupd %xmm6,(%rcx,%rdx,8)
paddd  %xmm3,%xmm5
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 i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load double*, double** %7
store double %12, double* %13
store i32 0, i32* %9
br label %14
14: ; preds = %39, %4
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 1400
br i1 %16, label %17, label %42
17: ; preds = %14
store i32 0, i32* %10
br label %18
18: ; preds = %35, %17
%19 = load i32, i32* %10
%20 = icmp slt i32 %19, 1200
br i1 %20, label %21, label %38
21: ; preds = %18
%22 = load i32, i32* %9
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %10
%25 = sitofp i32 %24 to double
%26 = fmul double %23, %25
%27 = fdiv double %26, 1.200000e+03
%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 = %21
%36 = load i32, i32* %10
%37 = add nsw i32 %36, 1
store i32 %37, i32* %10
br label %18
38: ; preds = %18
br label %39
39: ; preds = %38
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
store i32 %41, i32* %9
br label %14
42: ; preds = %14
ret void
}

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