#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 */
struct S_MATRIX {
  int dummy;
};

/* Variables and functions */
struct S_MATRIX *****calloc(size_t const, int);
struct S_MATRIX ****constructor_matrix4_pointer(size_t const, size_t const,
                                                size_t const);
struct S_MATRIX *****constructor_matrix5_pointer(size_t const N0,
                                                 size_t const N1,
                                                 size_t const N2,
                                                 size_t const N3) {
  struct S_MATRIX *****A = calloc(N0, sizeof *A);
  for (size_t i = 0; i < N0; i++)
    A[i] = constructor_matrix4_pointer(N1, N2, N3);
  return A;
}


x86 assembly (clang, -O0):
<constructor_matrix5_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1191 <constructor_matrix5_pointer+0x71>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <constructor_matrix4_pointer@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1152 <constructor_matrix5_pointer+0x32>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constructor_matrix5_pointer>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %r13,%r13
je     116b <constructor_matrix5_pointer+0x4b>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <constructor_matrix4_pointer@plt>
mov    %rax,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1150 <constructor_matrix5_pointer+0x30>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.S_MATRIX = type { i32 }
define %struct.S_MATRIX***** @constructor_matrix5_pointer(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.S_MATRIX*****
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i64, i64* %5
%12 = call %struct.S_MATRIX***** @calloc(i64 %11, i32 8)
store %struct.S_MATRIX***** %12, %struct.S_MATRIX****** %9
store i64 0, i64* %10
br label %13
13: ; preds = %25, %4
%14 = load i64, i64* %10
%15 = load i64, i64* %5
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = load i64, i64* %8
%21 = call %struct.S_MATRIX**** @constructor_matrix4_pointer(i64 %18, i64 %19, i64 %20)
%22 = load %struct.S_MATRIX*****, %struct.S_MATRIX****** %9
%23 = load i64, i64* %10
%24 = getelementptr inbounds %struct.S_MATRIX****, %struct.S_MATRIX***** %22, i64 %23
store %struct.S_MATRIX**** %21, %struct.S_MATRIX***** %24
br label %25
25: ; preds = %17
%26 = load i64, i64* %10
%27 = add i64 %26, 1
store i64 %27, i64* %10
br label %13
28: ; preds = %13
%29 = load %struct.S_MATRIX*****, %struct.S_MATRIX****** %9
ret %struct.S_MATRIX***** %29
}

LLVM IR (-O2):
%struct.S_MATRIX = type { i32 }
define %struct.S_MATRIX***** @constructor_matrix5_pointer(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call %struct.S_MATRIX***** @calloc(i64 %0, i32 8)
%6 = icmp eq i64 %0, 0
br i1 %6, label %7, label %8
7: ; preds = %8, %4
ret %struct.S_MATRIX***** %5
8: ; preds = %4, %8
%9 = phi i64 [ %12, %8 ], [ 0, %4 ]
%10 = tail call %struct.S_MATRIX**** @constructor_matrix4_pointer(i64 %1, i64 %2, i64 %3)
%11 = getelementptr inbounds %struct.S_MATRIX****, %struct.S_MATRIX***** %5, i64 %9
store %struct.S_MATRIX**** %10, %struct.S_MATRIX***** %11
%12 = add nuw i64 %9, 1
%13 = icmp eq i64 %12, %0
br i1 %13, label %7, label %8
}