#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 */
scalar_t__ basis_malloc(size_t);
double **basis_dmatrix_zeiger_alloc_0(double *a, long zn, long sn) {
  double **m;
  long i;
  m = (double **)basis_malloc((size_t)zn * sizeof(double *));
  if (m == NULL)
    return NULL;
#pragma omp parallel for
  for (i = 0; i < zn; i++)
    m[i] = a + i * sn;
  return m;
}


x86 assembly (clang, -O0):
<basis_dmatrix_zeiger_alloc_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <basis_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    114d <basis_dmatrix_zeiger_alloc_0+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    119c <basis_dmatrix_zeiger_alloc_0+0x8c>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1194 <basis_dmatrix_zeiger_alloc_0+0x84>
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rax
imul   -0x20(%rbp),%rax
shl    $0x3,%rax
add    %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    1155 <basis_dmatrix_zeiger_alloc_0+0x45>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basis_dmatrix_zeiger_alloc_0>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
lea    0x0(,%rsi,8),%rdi
call   1030 <basis_malloc@plt>
test   %rax,%rax
je     1152 <basis_dmatrix_zeiger_alloc_0+0x42>
test   %r12,%r12
jle    11e0 <basis_dmatrix_zeiger_alloc_0+0xd0>
lea    -0x1(%r12),%rcx
mov    %r12d,%r8d
and    $0x3,%r8d
cmp    $0x3,%rcx
jae    1159 <basis_dmatrix_zeiger_alloc_0+0x49>
xor    %edx,%edx
jmp    11ab <basis_dmatrix_zeiger_alloc_0+0x9b>
xor    %eax,%eax
jmp    11e0 <basis_dmatrix_zeiger_alloc_0+0xd0>
and    $0xfffffffffffffffc,%r12
mov    %r15,%r9
shl    $0x4,%r9
mov    %r15,%rdi
shl    $0x5,%rdi
lea    0x0(,%r15,8),%rcx
lea    (%rcx,%rcx,2),%r10
xor    %edx,%edx
mov    %r14,%rbx
nopl   0x0(%rax)
mov    %rbx,(%rax,%rdx,8)
lea    (%rbx,%rcx,1),%rsi
mov    %rsi,0x8(%rax,%rdx,8)
lea    (%rbx,%r9,1),%rsi
mov    %rsi,0x10(%rax,%rdx,8)
lea    (%rbx,%r10,1),%rsi
mov    %rsi,0x18(%rax,%rdx,8)
add    $0x4,%rdx
add    %rdi,%rbx
cmp    %rdx,%r12
jne    1180 <basis_dmatrix_zeiger_alloc_0+0x70>
test   %r8,%r8
je     11e0 <basis_dmatrix_zeiger_alloc_0+0xd0>
lea    (%rax,%rdx,8),%rcx
imul   %r15,%rdx
lea    (%r14,%rdx,8),%rdx
shl    $0x3,%r15
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdx,(%rcx,%rsi,8)
add    $0x1,%rsi
add    %r15,%rdx
cmp    %rsi,%r8
jne    11d0 <basis_dmatrix_zeiger_alloc_0+0xc0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double** @basis_dmatrix_zeiger_alloc_0(double* %0, i64 %1, i64 %2) {
%4 = alloca double**
%5 = alloca double*
%6 = alloca i64
%7 = alloca i64
%8 = alloca double**
%9 = alloca i64
store double* %0, double** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%10 = load i64, i64* %6
%11 = mul i64 %10, 8
%12 = call i64 @basis_malloc(i64 %11)
%13 = inttoptr i64 %12 to double**
store double** %13, double*** %8
%14 = load double**, double*** %8
%15 = icmp eq double** %14, null
br i1 %15, label %16, label %17
16: ; preds = %3
store double** null, double*** %4
br label %36
17: ; preds = %3
store i64 0, i64* %9
br label %18
18: ; preds = %31, %17
%19 = load i64, i64* %9
%20 = load i64, i64* %6
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %34
22: ; preds = %18
%23 = load double*, double** %5
%24 = load i64, i64* %9
%25 = load i64, i64* %7
%26 = mul nsw i64 %24, %25
%27 = getelementptr inbounds double, double* %23, i64 %26
%28 = load double**, double*** %8
%29 = load i64, i64* %9
%30 = getelementptr inbounds double*, double** %28, i64 %29
store double* %27, double** %30
br label %31
31: ; preds = %22
%32 = load i64, i64* %9
%33 = add nsw i64 %32, 1
store i64 %33, i64* %9
br label %18
34: ; preds = %18
%35 = load double**, double*** %8
store double** %35, double*** %4
br label %36
36: ; preds = %34, %16
%37 = load double**, double*** %4
ret double** %37
}

LLVM IR (-O2):
define double** @basis_dmatrix_zeiger_alloc_0(double* %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 3
%5 = tail call i64 @basis_malloc(i64 %4)
%6 = inttoptr i64 %5 to double**
%7 = icmp eq i64 %5, 0
br i1 %7, label %49, label %8
8: ; preds = %3
%9 = icmp sgt i64 %1, 0
br i1 %9, label %10, label %49
10: ; preds = %8
%11 = add i64 %1, -1
%12 = and i64 %1, 3
%13 = icmp ult i64 %11, 3
br i1 %13, label %37, label %14
14: ; preds = %10
%15 = and i64 %1, -4
br label %16
16: ; preds = %16, %14
%17 = phi i64 [ 0, %14 ], [ %34, %16 ]
%18 = phi i64 [ 0, %14 ], [ %35, %16 ]
%19 = mul nsw i64 %17, %2
%20 = getelementptr inbounds double, double* %0, i64 %19
%21 = getelementptr inbounds double*, double** %6, i64 %17
store double* %20, double** %21
%22 = or i64 %17, 1
%23 = mul nsw i64 %22, %2
%24 = getelementptr inbounds double, double* %0, i64 %23
%25 = getelementptr inbounds double*, double** %6, i64 %22
store double* %24, double** %25
%26 = or i64 %17, 2
%27 = mul nsw i64 %26, %2
%28 = getelementptr inbounds double, double* %0, i64 %27
%29 = getelementptr inbounds double*, double** %6, i64 %26
store double* %28, double** %29
%30 = or i64 %17, 3
%31 = mul nsw i64 %30, %2
%32 = getelementptr inbounds double, double* %0, i64 %31
%33 = getelementptr inbounds double*, double** %6, i64 %30
store double* %32, double** %33
%34 = add nuw nsw i64 %17, 4
%35 = add i64 %18, 4
%36 = icmp eq i64 %35, %15
br i1 %36, label %37, label %16
37: ; preds = %16, %10
%38 = phi i64 [ 0, %10 ], [ %34, %16 ]
%39 = icmp eq i64 %12, 0
br i1 %39, label %49, label %40
40: ; preds = %37, %40
%41 = phi i64 [ %46, %40 ], [ %38, %37 ]
%42 = phi i64 [ %47, %40 ], [ 0, %37 ]
%43 = mul nsw i64 %41, %2
%44 = getelementptr inbounds double, double* %0, i64 %43
%45 = getelementptr inbounds double*, double** %6, i64 %41
store double* %44, double** %45
%46 = add nuw nsw i64 %41, 1
%47 = add i64 %42, 1
%48 = icmp eq i64 %47, %12
br i1 %48, label %49, label %40
49: ; preds = %37, %40, %8, %3
%50 = phi double** [ null, %3 ], [ %6, %8 ], [ %6, %40 ], [ %6, %37 ]
ret double** %50
}