#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 /*<<< orphan*/ init_matrix(double **, int /*<<< orphan*/, int,
                               int /*<<< orphan*/, int, double);
double **matrix(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void init_uvp(double UI, double VI, double PI, int imax, int jmax, double ***U,
              double ***V, double ***P) {
  *U = matrix(0, imax + 1, 0, jmax + 1);
  init_matrix(*U, 0, imax + 1, 0, jmax + 1, UI);
  *V = matrix(0, imax + 1, 0, jmax + 1);
  init_matrix(*V, 0, imax + 1, 0, jmax + 1, VI);
  *P = matrix(0, imax + 1, 0, jmax + 1);
  init_matrix(*P, 0, imax + 1, 0, jmax + 1, PI);
}


x86 assembly (clang, -O0):
<init_uvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1030 <matrix@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%r8d
add    $0x1,%r8d
movsd  -0x8(%rbp),%xmm0
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <init_matrix@plt>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1030 <matrix@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%r8d
add    $0x1,%r8d
movsd  -0x10(%rbp),%xmm0
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <init_matrix@plt>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1030 <matrix@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%r8d
add    $0x1,%r8d
movsd  -0x18(%rbp),%xmm0
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <init_matrix@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uvp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0x1(%rdi),%ebp
lea    0x1(%rsi),%ebx
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1030 <matrix@plt>
mov    %rax,(%r12)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
movsd  0x8(%rsp),%xmm0
call   1040 <init_matrix@plt>
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1030 <matrix@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
movsd  0x10(%rsp),%xmm0
call   1040 <init_matrix@plt>
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1030 <matrix@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
movsd  0x18(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <init_matrix@plt>

LLVM IR (-O0):
define void @init_uvp(double %0, double %1, double %2, i32 %3, i32 %4, double*** %5, double*** %6, double*** %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca double***
%15 = alloca double***
%16 = alloca double***
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store double*** %5, double**** %14
store double*** %6, double**** %15
store double*** %7, double**** %16
%17 = load i32, i32* %12
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %13
%20 = add nsw i32 %19, 1
%21 = call double** @matrix(i32 0, i32 %18, i32 0, i32 %20)
%22 = load double***, double**** %14
store double** %21, double*** %22
%23 = load double***, double**** %14
%24 = load double**, double*** %23
%25 = load i32, i32* %12
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %13
%28 = add nsw i32 %27, 1
%29 = load double, double* %9
%30 = call i32 @init_matrix(double** %24, i32 0, i32 %26, i32 0, i32 %28, double %29)
%31 = load i32, i32* %12
%32 = add nsw i32 %31, 1
%33 = load i32, i32* %13
%34 = add nsw i32 %33, 1
%35 = call double** @matrix(i32 0, i32 %32, i32 0, i32 %34)
%36 = load double***, double**** %15
store double** %35, double*** %36
%37 = load double***, double**** %15
%38 = load double**, double*** %37
%39 = load i32, i32* %12
%40 = add nsw i32 %39, 1
%41 = load i32, i32* %13
%42 = add nsw i32 %41, 1
%43 = load double, double* %10
%44 = call i32 @init_matrix(double** %38, i32 0, i32 %40, i32 0, i32 %42, double %43)
%45 = load i32, i32* %12
%46 = add nsw i32 %45, 1
%47 = load i32, i32* %13
%48 = add nsw i32 %47, 1
%49 = call double** @matrix(i32 0, i32 %46, i32 0, i32 %48)
%50 = load double***, double**** %16
store double** %49, double*** %50
%51 = load double***, double**** %16
%52 = load double**, double*** %51
%53 = load i32, i32* %12
%54 = add nsw i32 %53, 1
%55 = load i32, i32* %13
%56 = add nsw i32 %55, 1
%57 = load double, double* %11
%58 = call i32 @init_matrix(double** %52, i32 0, i32 %54, i32 0, i32 %56, double %57)
ret void
}

LLVM IR (-O2):
define void @init_uvp(double %0, double %1, double %2, i32 %3, i32 %4, double*** nocapture writeonly %5, double*** nocapture writeonly %6, double*** nocapture writeonly %7) {
%9 = add nsw i32 %3, 1
%10 = add nsw i32 %4, 1
%11 = tail call double** @matrix(i32 0, i32 %9, i32 0, i32 %10)
store double** %11, double*** %5
%12 = tail call i32 @init_matrix(double** %11, i32 0, i32 %9, i32 0, i32 %10, double %0)
%13 = tail call double** @matrix(i32 0, i32 %9, i32 0, i32 %10)
store double** %13, double*** %6
%14 = tail call i32 @init_matrix(double** %13, i32 0, i32 %9, i32 0, i32 %10, double %1)
%15 = tail call double** @matrix(i32 0, i32 %9, i32 0, i32 %10)
store double** %15, double*** %7
%16 = tail call i32 @init_matrix(double** %15, i32 0, i32 %9, i32 0, i32 %10, double %2)
ret void
}