#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__ malloc(int);
void init_full_3D(float **wt_tensor, float **v, float *w, double *rv1) {
  int z;
  wt_tensor = (float **)malloc(3 * sizeof(float *));
  for (z = 0; z < 3; z++)
    wt_tensor[z] = (float *)malloc(3 * sizeof(float));
  v = (float **)malloc(3 * sizeof(float *));
  for (z = 0; z < 3; z++)
    v[z] = (float *)malloc(3 * sizeof(float));
  w = (float *)malloc(3 * sizeof(float));
  rv1 = (double *)malloc(3 * sizeof(double));
}


x86 assembly (clang, -O0):
<init_full_3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    116e <init_full_3D+0x5e>
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113d <init_full_3D+0x2d>
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11b4 <init_full_3D+0xa4>
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1183 <init_full_3D+0x73>
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_full_3D>:
push   %rbx
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    $0x18,%edi
pop    %rbx
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @init_full_3D(float** %0, float** %1, float* %2, double* %3) {
%5 = alloca float**
%6 = alloca float**
%7 = alloca float*
%8 = alloca double*
%9 = alloca i32
store float** %0, float*** %5
store float** %1, float*** %6
store float* %2, float** %7
store double* %3, double** %8
%10 = call i64 @malloc(i32 24)
%11 = inttoptr i64 %10 to float**
store float** %11, float*** %5
store i32 0, i32* %9
br label %12
12: ; preds = %22, %4
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = call i64 @malloc(i32 12)
%17 = inttoptr i64 %16 to float*
%18 = load float**, float*** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float*, float** %18, i64 %20
store float* %17, float** %21
br label %22
22: ; preds = %15
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %12
25: ; preds = %12
%26 = call i64 @malloc(i32 24)
%27 = inttoptr i64 %26 to float**
store float** %27, float*** %6
store i32 0, i32* %9
br label %28
28: ; preds = %38, %25
%29 = load i32, i32* %9
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = call i64 @malloc(i32 12)
%33 = inttoptr i64 %32 to float*
%34 = load float**, float*** %6
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float*, float** %34, i64 %36
store float* %33, float** %37
br label %38
38: ; preds = %31
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %28
41: ; preds = %28
%42 = call i64 @malloc(i32 12)
%43 = inttoptr i64 %42 to float*
store float* %43, float** %7
%44 = call i64 @malloc(i32 24)
%45 = inttoptr i64 %44 to double*
store double* %45, double** %8
ret void
}

LLVM IR (-O2):
define void @init_full_3D(float** nocapture readnone %0, float** nocapture readnone %1, float* nocapture readnone %2, double* nocapture readnone %3) {
%5 = tail call i64 @malloc(i32 24)
%6 = inttoptr i64 %5 to float**
%7 = tail call i64 @malloc(i32 12)
%8 = inttoptr i64 %7 to float*
store float* %8, float** %6
%9 = tail call i64 @malloc(i32 12)
%10 = inttoptr i64 %9 to float*
%11 = getelementptr inbounds float*, float** %6, i64 1
store float* %10, float** %11
%12 = tail call i64 @malloc(i32 12)
%13 = inttoptr i64 %12 to float*
%14 = getelementptr inbounds float*, float** %6, i64 2
store float* %13, float** %14
%15 = tail call i64 @malloc(i32 24)
%16 = inttoptr i64 %15 to float**
%17 = tail call i64 @malloc(i32 12)
%18 = inttoptr i64 %17 to float*
store float* %18, float** %16
%19 = tail call i64 @malloc(i32 12)
%20 = inttoptr i64 %19 to float*
%21 = getelementptr inbounds float*, float** %16, i64 1
store float* %20, float** %21
%22 = tail call i64 @malloc(i32 12)
%23 = inttoptr i64 %22 to float*
%24 = getelementptr inbounds float*, float** %16, i64 2
store float* %23, float** %24
%25 = tail call i64 @malloc(i32 12)
%26 = tail call i64 @malloc(i32 24)
ret void
}