#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 */
double get_time();
int /*<<< orphan*/ init_data(int, int, double **);
scalar_t__ malloc(int);
int /*<<< orphan*/ pencil_dsyrk_n_u(int, int, double, int, double **, double,
                                    int, double **);
int main() {
  double start_time, end_time;
  double(*A)[1024][1024] =
      (double(*)[1024][1024])malloc(1024 * 1024 * sizeof(double));
  double(*C)[1024][1024] =
      (double(*)[1024][1024])malloc(1024 * 1024 * sizeof(double));
  init_data(1024, 1024, *A);
  init_data(1024, 1024, *C);
  start_time = get_time();
  pencil_dsyrk_n_u(1024, 1024, 10.0, 1, *A, 10.0, 1, *C);
  end_time = get_time();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x800000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x800000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdx
mov    $0x400,%esi
mov    %esi,%edi
call   1030 <init_data@plt>
mov    -0x28(%rbp),%rdx
mov    $0x400,%esi
mov    %esi,%edi
call   1030 <init_data@plt>
mov    $0x0,%al
call   1040 <get_time@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
mov    $0x400,%esi
movsd  0xe54(%rip),%xmm1
mov    $0x1,%r8d
mov    %esi,%edi
movaps %xmm1,%xmm0
mov    %r8d,%edx
call   1060 <pencil_dsyrk_n_u@plt>
mov    $0x0,%al
call   1040 <get_time@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x800000,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0x800000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x400,%edi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <init_data@plt>
mov    $0x400,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1030 <init_data@plt>
xor    %eax,%eax
call   1040 <get_time@plt>
movsd  0xe6f(%rip),%xmm0
mov    $0x400,%edi
mov    $0x400,%esi
mov    $0x1,%edx
mov    %r14,%rcx
movaps %xmm0,%xmm1
mov    $0x1,%r8d
mov    %rbx,%r9
call   1060 <pencil_dsyrk_n_u@plt>
xor    %eax,%eax
call   1040 <get_time@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca [1024 x [1024 x double]]*
%5 = alloca [1024 x [1024 x double]]*
store i32 0, i32* %1
%6 = call i64 @malloc(i32 8388608)
%7 = inttoptr i64 %6 to [1024 x [1024 x double]]*
store [1024 x [1024 x double]]* %7, [1024 x [1024 x double]]** %4
%8 = call i64 @malloc(i32 8388608)
%9 = inttoptr i64 %8 to [1024 x [1024 x double]]*
store [1024 x [1024 x double]]* %9, [1024 x [1024 x double]]** %5
%10 = load [1024 x [1024 x double]]*, [1024 x [1024 x double]]** %4
%11 = getelementptr inbounds [1024 x [1024 x double]], [1024 x [1024 x double]]* %10, i64 0, i64 0
%12 = bitcast [1024 x double]* %11 to double**
%13 = call i32 @init_data(i32 1024, i32 1024, double** %12)
%14 = load [1024 x [1024 x double]]*, [1024 x [1024 x double]]** %5
%15 = getelementptr inbounds [1024 x [1024 x double]], [1024 x [1024 x double]]* %14, i64 0, i64 0
%16 = bitcast [1024 x double]* %15 to double**
%17 = call i32 @init_data(i32 1024, i32 1024, double** %16)
%18 = call double (...) @get_time()
store double %18, double* %2
%19 = load [1024 x [1024 x double]]*, [1024 x [1024 x double]]** %4
%20 = getelementptr inbounds [1024 x [1024 x double]], [1024 x [1024 x double]]* %19, i64 0, i64 0
%21 = bitcast [1024 x double]* %20 to double**
%22 = load [1024 x [1024 x double]]*, [1024 x [1024 x double]]** %5
%23 = getelementptr inbounds [1024 x [1024 x double]], [1024 x [1024 x double]]* %22, i64 0, i64 0
%24 = bitcast [1024 x double]* %23 to double**
%25 = call i32 @pencil_dsyrk_n_u(i32 1024, i32 1024, double 1.000000e+01, i32 1, double** %21, double 1.000000e+01, i32 1, double** %24)
%26 = call double (...) @get_time()
store double %26, double* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8388608)
%2 = tail call i64 @malloc(i32 8388608)
%3 = inttoptr i64 %1 to double**
%4 = tail call i32 @init_data(i32 1024, i32 1024, double** %3)
%5 = inttoptr i64 %2 to double**
%6 = tail call i32 @init_data(i32 1024, i32 1024, double** %5)
%7 = tail call double (...) @get_time()
%8 = tail call i32 @pencil_dsyrk_n_u(i32 1024, i32 1024, double 1.000000e+01, i32 1, double** %3, double 1.000000e+01, i32 1, double** %5)
%9 = tail call double (...) @get_time()
ret i32 0
}