#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_proc_fort_v2(int, double **);
int main() {
  int i, j, n_c = 17;
  double arr_c[3][2];
  for (j = 0; j < 3; j++) {
    for (i = 0; i < 2; i++) {
      arr_c[j][i] = (double)(i + 1) * (j + 1);
    }
  }
  test_proc_fort_v2(n_c, arr_c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1199 <main+0x89>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1186 <main+0x76>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movslq -0xc(%rbp),%rcx
lea    -0x40(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x2e>
jmp    118b <main+0x7b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x10(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   1030 <test_proc_fort_v2@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rsi
mov    $0x11,%edi
call   1030 <test_proc_fort_v2@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x [2 x double]]
store i32 0, i32* %1
store i32 17, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %34
9: ; preds = %6
store i32 0, i32* %2
br label %10
10: ; preds = %27, %9
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
%19 = sitofp i32 %18 to double
%20 = fmul double %16, %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %5, i64 0, i64 %22
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 %25
store double %20, double* %26
br label %27
27: ; preds = %13
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %10
30: ; preds = %10
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %6
34: ; preds = %6
%35 = load i32, i32* %4
%36 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %5, i64 0, i64 0
%37 = bitcast [2 x double]* %36 to double**
%38 = call i32 @test_proc_fort_v2(i32 %35, double** %37)
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [3 x [2 x double]]
%2 = bitcast [3 x [2 x double]]* %1 to i8*
%3 = bitcast [3 x [2 x double]]* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 2.000000e+00>, <2 x double>* %3
%4 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %1, i64 0, i64 1, i64 0
%5 = bitcast double* %4 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 4.000000e+00>, <2 x double>* %5
%6 = getelementptr inbounds [3 x [2 x double]], [3 x [2 x double]]* %1, i64 0, i64 2, i64 0
%7 = bitcast double* %6 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 6.000000e+00>, <2 x double>* %7
%8 = bitcast [3 x [2 x double]]* %1 to double**
%9 = call i32 @test_proc_fort_v2(i32 17, double** %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}