#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*/ exit(int);
int /*<<< orphan*/ posix_memalign(void **, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ zz_fillBlock(long, long, long **);
void alloc_and_genmat(long (**A)[((4L - 2L) + 2L) * 16L]) {
  posix_memalign((void **)A, sizeof(long) * ((4L - 2L) + 2L) * 16L * 16L,
                 sizeof(long) * (((4L - 2L) + 2L) * 16L) *
                     (((4L - 2L) + 2L) * 16L));
  if (*A == NULL) {
    printf(
        "Memory allocation error %liMB\n",
        (sizeof(long) * (((4L - 2L) + 2L) * 16L) * (((4L - 2L) + 2L) * 16L)) /
            (1024L * 1024L));
    exit(1);
  }
  long i, j;
  for (i = 0; i < ((4L - 2L) + 2L) * 16L; i += 16L) {
    for (j = 0; j < ((4L - 2L) + 2L) * 16L; j += 16L) {
      zz_fillBlock(i, j, (long(*)[((4L - 2L) + 2L) * 16L]) & ((*A)[i][j]));
    }
  }
}


x86 assembly (clang, -O0):
<alloc_and_genmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2000,%esi
mov    $0x8000,%edx
call   1060 <posix_memalign@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1185 <alloc_and_genmat+0x45>
lea    0xe8c(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x40,-0x10(%rbp)
jge    11fc <alloc_and_genmat+0xbc>
movq   $0x0,-0x18(%rbp)
cmpq   $0x40,-0x18(%rbp)
jge    11e6 <alloc_and_genmat+0xa6>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rdx
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1040 <zz_fillBlock@plt>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
jmp    11a0 <alloc_and_genmat+0x60>
jmp    11eb <alloc_and_genmat+0xab>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    118d <alloc_and_genmat+0x4d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_and_genmat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2000,%esi
mov    $0x8000,%edx
call   1060 <posix_memalign@plt>
mov    (%rbx),%rdx
test   %rdx,%rdx
je     12af <alloc_and_genmat+0x16f>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <zz_fillBlock@plt>
mov    (%rbx),%rdx
sub    $0xffffffffffffff80,%rdx
mov    $0x10,%esi
xor    %edi,%edi
call   1040 <zz_fillBlock@plt>
mov    $0x100,%edx
add    (%rbx),%rdx
mov    $0x20,%esi
xor    %edi,%edi
call   1040 <zz_fillBlock@plt>
mov    $0x180,%edx
add    (%rbx),%rdx
mov    $0x30,%esi
xor    %edi,%edi
call   1040 <zz_fillBlock@plt>
mov    $0x2000,%edx
add    (%rbx),%rdx
mov    $0x10,%edi
xor    %esi,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x2080,%edx
add    (%rbx),%rdx
mov    $0x10,%edi
mov    $0x10,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x2100,%edx
add    (%rbx),%rdx
mov    $0x10,%edi
mov    $0x20,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x2180,%edx
add    (%rbx),%rdx
mov    $0x10,%edi
mov    $0x30,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x4000,%edx
add    (%rbx),%rdx
mov    $0x20,%edi
xor    %esi,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x4080,%edx
add    (%rbx),%rdx
mov    $0x20,%edi
mov    $0x10,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x4100,%edx
add    (%rbx),%rdx
mov    $0x20,%edi
mov    $0x20,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x4180,%edx
add    (%rbx),%rdx
mov    $0x20,%edi
mov    $0x30,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x6000,%edx
add    (%rbx),%rdx
mov    $0x30,%edi
xor    %esi,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x6080,%edx
add    (%rbx),%rdx
mov    $0x30,%edi
mov    $0x10,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x6100,%edx
add    (%rbx),%rdx
mov    $0x30,%edi
mov    $0x20,%esi
call   1040 <zz_fillBlock@plt>
mov    $0x6180,%edx
add    (%rbx),%rdx
mov    $0x30,%edi
mov    $0x30,%esi
pop    %rbx
jmp    1040 <zz_fillBlock@plt>
lea    0xd4a(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Memory allocation error %liMB\0A\00"
define void @alloc_and_genmat([64 x i64]** %0) {
%2 = alloca [64 x i64]**
%3 = alloca i64
%4 = alloca i64
store [64 x i64]** %0, [64 x i64]*** %2
%5 = load [64 x i64]**, [64 x i64]*** %2
%6 = bitcast [64 x i64]** %5 to i8**
%7 = call i32 @posix_memalign(i8** %6, i32 8192, i32 32768)
%8 = load [64 x i64]**, [64 x i64]*** %2
%9 = load [64 x i64]*, [64 x i64]** %8
%10 = icmp eq [64 x i64]* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
store i64 0, i64* %3
br label %15
15: ; preds = %38, %14
%16 = load i64, i64* %3
%17 = icmp slt i64 %16, 64
br i1 %17, label %18, label %41
18: ; preds = %15
store i64 0, i64* %4
br label %19
19: ; preds = %34, %18
%20 = load i64, i64* %4
%21 = icmp slt i64 %20, 64
br i1 %21, label %22, label %37
22: ; preds = %19
%23 = load i64, i64* %3
%24 = load i64, i64* %4
%25 = load [64 x i64]**, [64 x i64]*** %2
%26 = load [64 x i64]*, [64 x i64]** %25
%27 = load i64, i64* %3
%28 = getelementptr inbounds [64 x i64], [64 x i64]* %26, i64 %27
%29 = load i64, i64* %4
%30 = getelementptr inbounds [64 x i64], [64 x i64]* %28, i64 0, i64 %29
%31 = bitcast i64* %30 to [64 x i64]*
%32 = bitcast [64 x i64]* %31 to i64**
%33 = call i32 @zz_fillBlock(i64 %23, i64 %24, i64** %32)
br label %34
34: ; preds = %22
%35 = load i64, i64* %4
%36 = add nsw i64 %35, 16
store i64 %36, i64* %4
br label %19
37: ; preds = %19
br label %38
38: ; preds = %37
%39 = load i64, i64* %3
%40 = add nsw i64 %39, 16
store i64 %40, i64* %3
br label %15
41: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Memory allocation error %liMB\0A\00"
define void @alloc_and_genmat([64 x i64]** %0) {
%2 = bitcast [64 x i64]** %0 to i8**
%3 = tail call i32 @posix_memalign(i8** %2, i32 8192, i32 32768)
%4 = load [64 x i64]*, [64 x i64]** %0
%5 = icmp eq [64 x i64]* %4, null
br i1 %5, label %69, label %6
6: ; preds = %1
%7 = bitcast [64 x i64]* %4 to i64**
%8 = tail call i32 @zz_fillBlock(i64 0, i64 0, i64** %7)
%9 = load [64 x i64]*, [64 x i64]** %0
%10 = getelementptr inbounds [64 x i64], [64 x i64]* %9, i64 0, i64 16
%11 = bitcast i64* %10 to i64**
%12 = tail call i32 @zz_fillBlock(i64 0, i64 16, i64** %11)
%13 = load [64 x i64]*, [64 x i64]** %0
%14 = getelementptr inbounds [64 x i64], [64 x i64]* %13, i64 0, i64 32
%15 = bitcast i64* %14 to i64**
%16 = tail call i32 @zz_fillBlock(i64 0, i64 32, i64** %15)
%17 = load [64 x i64]*, [64 x i64]** %0
%18 = getelementptr inbounds [64 x i64], [64 x i64]* %17, i64 0, i64 48
%19 = bitcast i64* %18 to i64**
%20 = tail call i32 @zz_fillBlock(i64 0, i64 48, i64** %19)
%21 = load [64 x i64]*, [64 x i64]** %0
%22 = getelementptr inbounds [64 x i64], [64 x i64]* %21, i64 16, i64 0
%23 = bitcast i64* %22 to i64**
%24 = tail call i32 @zz_fillBlock(i64 16, i64 0, i64** %23)
%25 = load [64 x i64]*, [64 x i64]** %0
%26 = getelementptr inbounds [64 x i64], [64 x i64]* %25, i64 16, i64 16
%27 = bitcast i64* %26 to i64**
%28 = tail call i32 @zz_fillBlock(i64 16, i64 16, i64** %27)
%29 = load [64 x i64]*, [64 x i64]** %0
%30 = getelementptr inbounds [64 x i64], [64 x i64]* %29, i64 16, i64 32
%31 = bitcast i64* %30 to i64**
%32 = tail call i32 @zz_fillBlock(i64 16, i64 32, i64** %31)
%33 = load [64 x i64]*, [64 x i64]** %0
%34 = getelementptr inbounds [64 x i64], [64 x i64]* %33, i64 16, i64 48
%35 = bitcast i64* %34 to i64**
%36 = tail call i32 @zz_fillBlock(i64 16, i64 48, i64** %35)
%37 = load [64 x i64]*, [64 x i64]** %0
%38 = getelementptr inbounds [64 x i64], [64 x i64]* %37, i64 32, i64 0
%39 = bitcast i64* %38 to i64**
%40 = tail call i32 @zz_fillBlock(i64 32, i64 0, i64** %39)
%41 = load [64 x i64]*, [64 x i64]** %0
%42 = getelementptr inbounds [64 x i64], [64 x i64]* %41, i64 32, i64 16
%43 = bitcast i64* %42 to i64**
%44 = tail call i32 @zz_fillBlock(i64 32, i64 16, i64** %43)
%45 = load [64 x i64]*, [64 x i64]** %0
%46 = getelementptr inbounds [64 x i64], [64 x i64]* %45, i64 32, i64 32
%47 = bitcast i64* %46 to i64**
%48 = tail call i32 @zz_fillBlock(i64 32, i64 32, i64** %47)
%49 = load [64 x i64]*, [64 x i64]** %0
%50 = getelementptr inbounds [64 x i64], [64 x i64]* %49, i64 32, i64 48
%51 = bitcast i64* %50 to i64**
%52 = tail call i32 @zz_fillBlock(i64 32, i64 48, i64** %51)
%53 = load [64 x i64]*, [64 x i64]** %0
%54 = getelementptr inbounds [64 x i64], [64 x i64]* %53, i64 48, i64 0
%55 = bitcast i64* %54 to i64**
%56 = tail call i32 @zz_fillBlock(i64 48, i64 0, i64** %55)
%57 = load [64 x i64]*, [64 x i64]** %0
%58 = getelementptr inbounds [64 x i64], [64 x i64]* %57, i64 48, i64 16
%59 = bitcast i64* %58 to i64**
%60 = tail call i32 @zz_fillBlock(i64 48, i64 16, i64** %59)
%61 = load [64 x i64]*, [64 x i64]** %0
%62 = getelementptr inbounds [64 x i64], [64 x i64]* %61, i64 48, i64 32
%63 = bitcast i64* %62 to i64**
%64 = tail call i32 @zz_fillBlock(i64 48, i64 32, i64** %63)
%65 = load [64 x i64]*, [64 x i64]** %0
%66 = getelementptr inbounds [64 x i64], [64 x i64]* %65, i64 48, i64 48
%67 = bitcast i64* %66 to i64**
%68 = tail call i32 @zz_fillBlock(i64 48, i64 48, i64** %67)
ret void
69: ; preds = %1
%70 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0)
%71 = tail call i32 @exit(i32 1)
unreachable
}