#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 **basis_dmatrix_zeiger_alloc(double *, long, long);
double *basis_dvector_alloc(long);
double **basis_dmatrix_all_alloc(long zn, long sn) {
  double **m;
  double *a;
  long ges_laenge;
  ges_laenge = zn * sn;
  a = basis_dvector_alloc(ges_laenge);
  if (a == NULL)
    return NULL;
  m = basis_dmatrix_zeiger_alloc(a, zn, sn);
  return m;
}


x86 assembly (clang, -O0):
<basis_dmatrix_all_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <basis_dvector_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1162 <basis_dmatrix_all_alloc+0x42>
movq   $0x0,-0x8(%rbp)
jmp    117f <basis_dmatrix_all_alloc+0x5f>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <basis_dmatrix_zeiger_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basis_dmatrix_all_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
imul   %rbx,%rdi
call   1030 <basis_dvector_alloc@plt>
test   %rax,%rax
je     1150 <basis_dmatrix_all_alloc+0x30>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <basis_dmatrix_zeiger_alloc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double** @basis_dmatrix_all_alloc(i64 %0, i64 %1) {
%3 = alloca double**
%4 = alloca i64
%5 = alloca i64
%6 = alloca double**
%7 = alloca double*
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = mul nsw i64 %9, %10
store i64 %11, i64* %8
%12 = load i64, i64* %8
%13 = call double* @basis_dvector_alloc(i64 %12)
store double* %13, double** %7
%14 = load double*, double** %7
%15 = icmp eq double* %14, null
br i1 %15, label %16, label %17
16: ; preds = %2
store double** null, double*** %3
br label %23
17: ; preds = %2
%18 = load double*, double** %7
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = call double** @basis_dmatrix_zeiger_alloc(double* %18, i64 %19, i64 %20)
store double** %21, double*** %6
%22 = load double**, double*** %6
store double** %22, double*** %3
br label %23
23: ; preds = %17, %16
%24 = load double**, double*** %3
ret double** %24
}

LLVM IR (-O2):
define double** @basis_dmatrix_all_alloc(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call double* @basis_dvector_alloc(i64 %3)
%5 = icmp eq double* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call double** @basis_dmatrix_zeiger_alloc(double* %4, i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi double** [ %7, %6 ], [ null, %2 ]
ret double** %9
}