#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 **allocMatrixInt(int);
int /*<<< orphan*/ initMatrixInt(int **, int);
int /*<<< orphan*/ srandom(unsigned int);
int setupExp(int ***A, int ***B, int ***C, int size, unsigned int seed) {
  *A = allocMatrixInt(size);
  *B = allocMatrixInt(size);
  *C = allocMatrixInt(size);
  if ((*A == NULL) || (*B == NULL) || (*C == NULL)) {
    return -1;
  }
  srandom(seed);
  initMatrixInt(*A, size);
  initMatrixInt(*B, size);
  return 0;
}


x86 assembly (clang, -O0):
<setupExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x24(%rbp),%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x24(%rbp),%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ab <setupExp+0x7b>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ab <setupExp+0x7b>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11b7 <setupExp+0x87>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e4 <setupExp+0xb4>
mov    -0x28(%rbp),%edi
call   1030 <srandom@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x24(%rbp),%esi
call   1040 <initMatrixInt@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x24(%rbp),%esi
call   1040 <initMatrixInt@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupExp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbp
mov    %ecx,%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,0x0(%rbp)
mov    %ebx,%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,(%r14)
mov    %ebx,%edi
call   1050 <allocMatrixInt@plt>
mov    %rax,%rcx
mov    %rax,(%r12)
mov    $0xffffffff,%eax
cmpq   $0x0,0x0(%rbp)
je     119f <setupExp+0x6f>
cmpq   $0x0,(%r14)
je     119f <setupExp+0x6f>
test   %rcx,%rcx
je     119f <setupExp+0x6f>
mov    %r15d,%edi
call   1030 <srandom@plt>
mov    0x0(%rbp),%rdi
mov    %ebx,%esi
call   1040 <initMatrixInt@plt>
mov    (%r14),%rdi
mov    %ebx,%esi
call   1040 <initMatrixInt@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @setupExp(i32*** %0, i32*** %1, i32*** %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32***
%8 = alloca i32***
%9 = alloca i32***
%10 = alloca i32
%11 = alloca i32
store i32*** %0, i32**** %7
store i32*** %1, i32**** %8
store i32*** %2, i32**** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %10
%13 = call i32** @allocMatrixInt(i32 %12)
%14 = load i32***, i32**** %7
store i32** %13, i32*** %14
%15 = load i32, i32* %10
%16 = call i32** @allocMatrixInt(i32 %15)
%17 = load i32***, i32**** %8
store i32** %16, i32*** %17
%18 = load i32, i32* %10
%19 = call i32** @allocMatrixInt(i32 %18)
%20 = load i32***, i32**** %9
store i32** %19, i32*** %20
%21 = load i32***, i32**** %7
%22 = load i32**, i32*** %21
%23 = icmp eq i32** %22, null
br i1 %23, label %32, label %24
24: ; preds = %5
%25 = load i32***, i32**** %8
%26 = load i32**, i32*** %25
%27 = icmp eq i32** %26, null
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i32***, i32**** %9
%30 = load i32**, i32*** %29
%31 = icmp eq i32** %30, null
br i1 %31, label %32, label %33
32: ; preds = %28, %24, %5
store i32 -1, i32* %6
br label %44
33: ; preds = %28
%34 = load i32, i32* %11
%35 = call i32 @srandom(i32 %34)
%36 = load i32***, i32**** %7
%37 = load i32**, i32*** %36
%38 = load i32, i32* %10
%39 = call i32 @initMatrixInt(i32** %37, i32 %38)
%40 = load i32***, i32**** %8
%41 = load i32**, i32*** %40
%42 = load i32, i32* %10
%43 = call i32 @initMatrixInt(i32** %41, i32 %42)
store i32 0, i32* %6
br label %44
44: ; preds = %33, %32
%45 = load i32, i32* %6
ret i32 %45
}

LLVM IR (-O2):
define i32 @setupExp(i32*** nocapture %0, i32*** nocapture %1, i32*** nocapture writeonly %2, i32 %3, i32 %4) {
%6 = tail call i32** @allocMatrixInt(i32 %3)
store i32** %6, i32*** %0
%7 = tail call i32** @allocMatrixInt(i32 %3)
store i32** %7, i32*** %1
%8 = tail call i32** @allocMatrixInt(i32 %3)
store i32** %8, i32*** %2
%9 = load i32**, i32*** %0
%10 = icmp eq i32** %9, null
br i1 %10, label %22, label %11
11: ; preds = %5
%12 = load i32**, i32*** %1
%13 = icmp eq i32** %12, null
%14 = icmp eq i32** %8, null
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %22, label %16
16: ; preds = %11
%17 = tail call i32 @srandom(i32 %4)
%18 = load i32**, i32*** %0
%19 = tail call i32 @initMatrixInt(i32** %18, i32 %3)
%20 = load i32**, i32*** %1
%21 = tail call i32 @initMatrixInt(i32** %20, i32 %3)
br label %22
22: ; preds = %5, %11, %16
%23 = phi i32 [ 0, %16 ], [ -1, %11 ], [ -1, %5 ]
ret i32 %23
}