#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*/ fprintf(int /*<<< orphan*/, char *);
double *malloc(int);
int /*<<< orphan*/ stderr;
void Allocate_vectors(double **x_pp, double **y_pp, double **z_pp, int n) {
  *x_pp = malloc(n * sizeof(double));
  *y_pp = malloc(n * sizeof(double));
  *z_pp = malloc(n * sizeof(double));
  if (*x_pp == NULL || *y_pp == NULL || *z_pp == NULL) {
    fprintf(stderr, "Can't allocate vectors\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<Allocate_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     11bc <Allocate_vectors+0x8c>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11bc <Allocate_vectors+0x8c>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11db <Allocate_vectors+0xab>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Allocate_vectors>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x0(,%rcx,8),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,(%r15)
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
cmpq   $0x0,(%rbx)
je     1181 <Allocate_vectors+0x51>
test   %rax,%rax
je     1181 <Allocate_vectors+0x51>
cmpq   $0x0,(%r15)
je     1181 <Allocate_vectors+0x51>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate vectors\0A\00"
define void @Allocate_vectors(double** %0, double** %1, double** %2, i32 %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32
store double** %0, double*** %5
store double** %1, double*** %6
store double** %2, double*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call double* @malloc(i32 %12)
%14 = load double**, double*** %5
store double* %13, double** %14
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 8
%18 = trunc i64 %17 to i32
%19 = call double* @malloc(i32 %18)
%20 = load double**, double*** %6
store double* %19, double** %20
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call double* @malloc(i32 %24)
%26 = load double**, double*** %7
store double* %25, double** %26
%27 = load double**, double*** %5
%28 = load double*, double** %27
%29 = icmp eq double* %28, null
br i1 %29, label %38, label %30
30: ; preds = %4
%31 = load double**, double*** %6
%32 = load double*, double** %31
%33 = icmp eq double* %32, null
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load double**, double*** %7
%36 = load double*, double** %35
%37 = icmp eq double* %36, null
br i1 %37, label %38, label %42
38: ; preds = %34, %30, %4
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%41 = call i32 @exit(i32 -1)
unreachable
42: ; preds = %34
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate vectors\0A\00"
define void @Allocate_vectors(double** nocapture %0, double** nocapture %1, double** nocapture writeonly %2, i32 %3) {
%5 = shl i32 %3, 3
%6 = tail call double* @malloc(i32 %5)
store double* %6, double** %0
%7 = tail call double* @malloc(i32 %5)
store double* %7, double** %1
%8 = tail call double* @malloc(i32 %5)
store double* %8, double** %2
%9 = load double*, double** %0
%10 = icmp eq double* %9, null
br i1 %10, label %16, label %11
11: ; preds = %4
%12 = load double*, double** %1
%13 = icmp eq double* %12, null
%14 = icmp eq double* %8, null
%15 = or i1 %14, %13
br i1 %15, label %16, label %20
16: ; preds = %11, %4
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %11
ret void
}