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


x86 assembly (clang, -O0):
<init_full_2D>:
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    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    116e <init_full_2D+0x5e>
mov    $0x8,%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_2D+0x2d>
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    11b4 <init_full_2D+0xa4>
mov    $0x8,%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_2D+0x73>
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_full_2D(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 16)
%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, 2
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = call i64 @malloc(i32 8)
%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 16)
%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, 2
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = call i64 @malloc(i32 8)
%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 8)
%43 = inttoptr i64 %42 to float*
store float* %43, float** %7
%44 = call i64 @malloc(i32 16)
%45 = inttoptr i64 %44 to double*
store double* %45, double** %8
ret void
}

LLVM IR (-O2):
define void @init_full_2D(float** nocapture readnone %0, float** nocapture readnone %1, float* nocapture readnone %2, double* nocapture readnone %3) {
%5 = tail call i64 @malloc(i32 16)
%6 = inttoptr i64 %5 to float**
%7 = tail call i64 @malloc(i32 8)
%8 = inttoptr i64 %7 to float*
store float* %8, float** %6
%9 = tail call i64 @malloc(i32 8)
%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 16)
%13 = inttoptr i64 %12 to float**
%14 = tail call i64 @malloc(i32 8)
%15 = inttoptr i64 %14 to float*
store float* %15, float** %13
%16 = tail call i64 @malloc(i32 8)
%17 = inttoptr i64 %16 to float*
%18 = getelementptr inbounds float*, float** %13, i64 1
store float* %17, float** %18
%19 = tail call i64 @malloc(i32 8)
%20 = tail call i64 @malloc(i32 16)
ret void
}